fuse-importer 0.18.0 → 0.23.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 (97) hide show
  1. package/lib/esm/Importer/Footer.js +2 -2
  2. package/lib/esm/Importer/ImporterContextProvider.d.ts +35 -5
  3. package/lib/esm/Importer/ImporterContextProvider.js +43 -24
  4. package/lib/esm/Importer/ImporterFonts.js +1 -1
  5. package/lib/esm/Importer/Matcher/EnumFieldsMatchers/EnumFieldMatcher/index.js +1 -1
  6. package/lib/esm/Importer/Matcher/EnumFieldsMatchers/EnumFieldMatcher/tableColumns.js +3 -3
  7. package/lib/esm/Importer/Matcher/EnumFieldsMatchers/EnumFieldMatcherContext.js +1 -1
  8. package/lib/esm/Importer/Matcher/EnumFieldsMatchers/index.js +3 -3
  9. package/lib/esm/Importer/Matcher/HeaderMatcher/index.js +2 -2
  10. package/lib/esm/Importer/Matcher/HeaderMatcher/tableColumns.js +3 -3
  11. package/lib/esm/Importer/Matcher/common/icons/index.js +2 -2
  12. package/lib/esm/Importer/Matcher/common/index.js +4 -4
  13. package/lib/esm/Importer/Matcher/index.js +6 -5
  14. package/lib/esm/Importer/PreviewModeBanner.d.ts +2 -0
  15. package/lib/esm/Importer/PreviewModeBanner.js +20 -0
  16. package/lib/esm/Importer/Review/AppResponseModal.js +1 -1
  17. package/lib/esm/Importer/Review/index.js +18 -22
  18. package/lib/esm/Importer/SpreadsheetReviewContextProvider.js +2 -2
  19. package/lib/esm/Importer/Stepper.js +24 -17
  20. package/lib/esm/Importer/TrialModeBanner.js +3 -3
  21. package/lib/esm/Importer/Uploader/DragAndDropImporter/ImporterDropzone.js +7 -4
  22. package/lib/esm/Importer/Uploader/DragAndDropImporter/backgrounds.js +2 -2
  23. package/lib/esm/Importer/Uploader/DragAndDropImporter/index.js +9 -9
  24. package/lib/esm/Importer/Uploader/HeadersPreview.js +21 -19
  25. package/lib/esm/Importer/Uploader/UploaderContextProvider.js +1 -1
  26. package/lib/esm/Importer/Uploader/index.js +2 -2
  27. package/lib/esm/Importer/common/AppLoading.js +1 -1
  28. package/lib/esm/Importer/common/Spreadsheet/SpreadsheetContextProvider.js +8 -6
  29. package/lib/esm/Importer/common/Spreadsheet/SpreadsheetRowNumbers.js +2 -2
  30. package/lib/esm/Importer/common/Spreadsheet/common/FieldHeader.d.ts +7 -0
  31. package/lib/esm/Importer/common/Spreadsheet/common/FieldHeader.js +31 -0
  32. package/lib/esm/Importer/common/Spreadsheet/common/fields/SpeadsheetAutocomplete.d.ts +11 -6
  33. package/lib/esm/Importer/common/Spreadsheet/common/fields/SpeadsheetAutocomplete.js +7 -8
  34. package/lib/esm/Importer/common/Spreadsheet/common/fields/SpreadsheetInput.d.ts +4 -4
  35. package/lib/esm/Importer/common/Spreadsheet/common/fields/SpreadsheetInput.js +5 -6
  36. package/lib/esm/Importer/common/Spreadsheet/common/fields/index.d.ts +6 -5
  37. package/lib/esm/Importer/common/Spreadsheet/common/fields/index.js +15 -7
  38. package/lib/esm/Importer/common/Spreadsheet/common/index.d.ts +3 -0
  39. package/lib/esm/Importer/common/Spreadsheet/common/index.js +53 -9
  40. package/lib/esm/Importer/common/Spreadsheet/index.js +32 -61
  41. package/lib/esm/Importer/common/Spreadsheet/inputs/Boolean.d.ts +3 -0
  42. package/lib/esm/Importer/common/Spreadsheet/inputs/Boolean.js +18 -0
  43. package/lib/esm/Importer/common/Spreadsheet/inputs/EmailInput.d.ts +3 -0
  44. package/lib/esm/Importer/common/Spreadsheet/inputs/EmailInput.js +14 -0
  45. package/lib/esm/Importer/common/Spreadsheet/inputs/EnumInput.d.ts +6 -0
  46. package/lib/esm/Importer/common/Spreadsheet/inputs/EnumInput.js +30 -0
  47. package/lib/esm/Importer/common/Spreadsheet/inputs/FloatInput.d.ts +3 -0
  48. package/lib/esm/Importer/common/Spreadsheet/inputs/FloatInput.js +16 -0
  49. package/lib/esm/Importer/common/Spreadsheet/inputs/IntegerInput.d.ts +3 -0
  50. package/lib/esm/Importer/common/Spreadsheet/inputs/IntegerInput.js +16 -0
  51. package/lib/esm/Importer/common/Spreadsheet/inputs/StringInput.d.ts +3 -0
  52. package/lib/esm/Importer/common/Spreadsheet/inputs/StringInput.js +14 -0
  53. package/lib/esm/Importer/common/Spreadsheet/inputs/index.d.ts +13 -0
  54. package/lib/esm/Importer/common/Spreadsheet/inputs/index.js +20 -0
  55. package/lib/esm/Importer/common/icons/index.js +3 -3
  56. package/lib/esm/Importer/common/index.d.ts +2 -2
  57. package/lib/esm/Importer/common/index.js +2 -2
  58. package/lib/esm/Importer/index.d.ts +4 -2
  59. package/lib/esm/Importer/index.js +10 -10
  60. package/lib/esm/Importer/theme.d.ts +225 -0
  61. package/lib/esm/Importer/theme.js +18 -0
  62. package/lib/esm/common/Modal.js +1 -1
  63. package/lib/esm/common/Spinner.js +1 -1
  64. package/lib/esm/common/Table/Pagination/icons.js +5 -5
  65. package/lib/esm/common/Table/Pagination/index.js +2 -2
  66. package/lib/esm/common/Table/TableDataProvider.js +1 -1
  67. package/lib/esm/common/Table/TableView/TableHeaders.js +2 -2
  68. package/lib/esm/common/Table/TableView/TableRow.js +3 -3
  69. package/lib/esm/common/Table/TableView/index.js +5 -5
  70. package/lib/esm/common/Table/icons.js +2 -2
  71. package/lib/esm/common/Table/index.js +2 -2
  72. package/lib/esm/common/Toast.js +4 -3
  73. package/lib/esm/common/TooltipProvider.js +1 -1
  74. package/lib/esm/common/buttons.d.ts +15 -5
  75. package/lib/esm/common/buttons.js +13 -11
  76. package/lib/esm/common/icons/index.js +11 -11
  77. package/lib/esm/common/index.js +2 -2
  78. package/lib/esm/common/inputs/Autocomplete.d.ts +2 -2
  79. package/lib/esm/common/inputs/Autocomplete.js +4 -4
  80. package/lib/esm/common/inputs/SelectMenu.js +1 -1
  81. package/lib/esm/common/inputs/TextInput.js +13 -6
  82. package/lib/esm/common/logo.js +1 -1
  83. package/lib/esm/index.d.ts +2 -1
  84. package/lib/esm/index.js +1 -0
  85. package/lib/esm/styled/theme/dimensionsCss.js +1 -1
  86. package/lib/esm/styled/theme/fontCss.d.ts +0 -1
  87. package/lib/esm/styled/theme/fontCss.js +10 -11
  88. package/lib/esm/styled/theme/index.d.ts +0 -2
  89. package/lib/esm/styled/themeType.d.ts +1 -1
  90. package/lib/esm/styled/utils.d.ts +3 -0
  91. package/lib/esm/styled/utils.js +4 -3
  92. package/lib/esm/types.d.ts +8 -2
  93. package/lib/esm/types.js +4 -1
  94. package/lib/main.js +1 -1
  95. package/package.json +1 -1
  96. package/lib/esm/Importer/useCustomImporter.d.ts +0 -4
  97. package/lib/esm/Importer/useCustomImporter.js +0 -80
@@ -31,15 +31,15 @@ var StepIndexWrapper = styled(Div)(templateObject_2 || (templateObject_2 = __mak
31
31
  return p.isSelected && css(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n height: 32px;\n width: 32px;\n border: solid 1px ", ";\n color: ", ";\n background-color: ", ";\n "], ["\n height: 32px;\n width: 32px;\n border: solid 1px ", ";\n color: ", ";\n background-color: ", ";\n "])), function (p) { return p.theme.colors.blue500; }, function (p) { return p.theme.colors.white; }, function (p) { return p.theme.colors.blue500; });
32
32
  });
33
33
  var StepperWrapper = styled(Div)(templateObject_3 || (templateObject_3 = __makeTemplateObject(["\n background-color: ", ";\n user-select: none;\n border-bottom: 1px solid ", ";\n"], ["\n background-color: ", ";\n user-select: none;\n border-bottom: 1px solid ", ";\n"])), function (p) { return p.theme.colors.white; }, function (p) { return p.theme.colors.gray300; });
34
- var Logo = styled.img(templateObject_4 || (templateObject_4 = __makeTemplateObject(["\n max-height: 70px;\n position: absolute;\n left: 41px;\n"], ["\n max-height: 70px;\n position: absolute;\n left: 41px;\n"])));
34
+ var Logo = styled.img(templateObject_4 || (templateObject_4 = __makeTemplateObject(["\n max-height: 70px;\n max-width: 300px;\n position: absolute;\n left: 41px;\n"], ["\n max-height: 70px;\n max-width: 300px;\n position: absolute;\n left: 41px;\n"])));
35
35
  var StepIndex = function (_a) {
36
36
  var index = _a.index, isSelected = _a.isSelected, isCompleted = _a.isCompleted;
37
- return (_jsx(_Fragment, { children: isCompleted ? (_jsx(Div, __assign({ centered: true, body2: true, bold: true, mr: 8 }, { children: whiteCheckIcon }), void 0)) : (_jsx(StepIndexWrapper, __assign({ centered: true, body2: true, bold: true, mr: 8, isSelected: isSelected }, { children: index }), void 0)) }, void 0));
37
+ return (_jsx(_Fragment, { children: isCompleted ? (_jsx(Div, __assign({ centered: true, body2: true, bold: true, mr: 8 }, { children: whiteCheckIcon }))) : (_jsx(StepIndexWrapper, __assign({ centered: true, body2: true, bold: true, mr: 8, isSelected: isSelected }, { children: index }))) }));
38
38
  };
39
39
  var Step = function (_a) {
40
40
  var index = _a.index, label = _a.label, isSelected = _a.isSelected, isCompleted = _a.isCompleted;
41
41
  var isActive = isCompleted || isSelected;
42
- return (_jsxs(Div, __assign({ centered: true, buttonText: true, c: isActive ? colors.text : colors.gray400 }, { children: [_jsx(StepIndex, { index: index + 1, isSelected: isSelected, isCompleted: isCompleted }, void 0), label] }), void 0));
42
+ return (_jsxs(Div, __assign({ centered: true, buttonText: true, c: isActive ? colors.text : colors.gray400 }, { children: [_jsx(StepIndex, { index: index + 1, isSelected: isSelected, isCompleted: isCompleted }), label] })));
43
43
  };
44
44
  var getEnumFieldValueMatchingsInitialValue = function (_a) {
45
45
  var uploadedDataEnumFieldValues = _a.uploadedDataEnumFieldValues, templateHeaders = _a.templateHeaders;
@@ -67,15 +67,15 @@ var Stepper = function (_a) {
67
67
  var _c = useSpreadsheetReviewContext(), appResponse = _c.appResponse, isSpreadsheetReviewComplete = _c.isSpreadsheetReviewComplete, onSubmit = _c.onSubmit;
68
68
  var _d = useState(false), isSubmitModalOpen = _d[0], setIsSubmitModalOpen = _d[1];
69
69
  var _e = useImporterContext(), currentStepIndex = _e.currentStepIndex, setEnumFieldValueMatchings = _e.setEnumFieldValueMatchings, setCurrentStepIndex = _e.setCurrentStepIndex, templateHeaderMatchings = _e.templateHeaderMatchings, matcherSubstep = _e.matcherSubstep, setMatcherSubstep = _e.setMatcherSubstep, templateHeaders = _e.templateHeaders, uploadedDataEnumFieldValues = _e.uploadedDataEnumFieldValues, onClose = _e.onClose;
70
- var submitModalUI = (_jsx(Modal, __assign({ isOpen: isSubmitModalOpen, onClose: function () { return setIsSubmitModalOpen(false); } }, { children: _jsxs(Div, __assign({ centered: true, flexColumn: true, p: 60 }, { children: [_jsx(Div, { children: submitSvg }, void 0), _jsx(Div, __assign({ h5: true, mt: 20 }, { children: "Ready to submit?" }), void 0), _jsx(Div, __assign({ body1: true, mt: 12, w: 448, textAlignCenter: true }, { children: "We didn't find anything wrong with your file. You're good to go!" }), void 0), _jsxs(Div, __assign({ dflex: true, mt: 40, w100: true, centered: true }, { children: [_jsx(Button, __assign({ w: 115, variant: "secondary", mr: 10, onClick: function () { return setIsSubmitModalOpen(false); } }, { children: "Go back" }), void 0), _jsx(Button, __assign({ w: 140, ml: 10, onClick: function () {
70
+ var submitModalUI = (_jsx(Modal, __assign({ isOpen: isSubmitModalOpen, onClose: function () { return setIsSubmitModalOpen(false); } }, { children: _jsxs(Div, __assign({ centered: true, flexColumn: true, p: 60 }, { children: [_jsx(Div, { children: submitSvg }), _jsx(Div, __assign({ h5: true, mt: 20 }, { children: "Ready to submit?" })), _jsx(Div, __assign({ body1: true, mt: 12, w: 448, textAlignCenter: true }, { children: "We didn't find anything wrong with your file. You're good to go!" })), _jsxs(Div, __assign({ dflex: true, mt: 40, w100: true, centered: true }, { children: [_jsx(Button, __assign({ w: 115, variant: "secondary", mr: 10, onClick: function () { return setIsSubmitModalOpen(false); } }, { children: "Go back" })), _jsx(Button, __assign({ w: 140, ml: 10, onClick: function () {
71
71
  onSubmit();
72
72
  setIsSubmitModalOpen(false);
73
- } }, { children: "Yes, submit" }), void 0)] }), void 0)] }), void 0) }), void 0));
73
+ } }, { children: "Yes, submit" }))] }))] })) })));
74
74
  var stepsUI = (_jsx(Div, __assign({ dflex: true, centered: true }, { children: stepLabels.map(function (label, index) {
75
75
  var isLast = index === stepLabels.length - 1;
76
76
  var isCompleted = index < currentStepIndex;
77
- return (_jsxs(Div, __assign({ centered: true }, { children: [_jsx(Step, { index: index, label: label, isCompleted: isCompleted, isSelected: index === currentStepIndex }, void 0), !isLast && (_jsx(Div, __assign({ ml: 18, mr: 18, dflex: true }, { children: _jsx(ChevronRightIcon, {}, void 0) }), void 0))] }), index));
78
- }) }), void 0));
77
+ return (_jsxs(Div, __assign({ centered: true }, { children: [_jsx(Step, { index: index, label: label, isCompleted: isCompleted, isSelected: index === currentStepIndex }), !isLast && (_jsx(Div, __assign({ ml: 18, mr: 18, dflex: true }, { children: _jsx(ChevronRightIcon, {}) })))] }), index));
78
+ }) })));
79
79
  var templateHeaderLabels = Object.keys(templateHeaderMatchings || []);
80
80
  var unmatchedHeadersCount = templateHeaderLabels.filter(function (templateHeaderLabel) { return !templateHeaderMatchings[templateHeaderLabel]; }).length;
81
81
  var isLastSubMatchStep = matcherSubstep === 1;
@@ -112,19 +112,26 @@ var Stepper = function (_a) {
112
112
  }
113
113
  };
114
114
  var goBack = function () {
115
- setMatcherSubstep(0);
116
- setCurrentStepIndex(currentStepIndex - 1);
115
+ var isMatchingColumnValues = matcherSubstep === 1;
116
+ var isInMachStep = currentStepIndex === 1;
117
+ var shouldBackOnlyMatcherSubStep = isMatchingColumnValues && isInMachStep;
118
+ if (shouldBackOnlyMatcherSubStep) {
119
+ setMatcherSubstep(matcherSubstep - 1);
120
+ }
121
+ else {
122
+ setCurrentStepIndex(currentStepIndex - 1);
123
+ }
117
124
  };
118
125
  var skipStep = function () {
119
126
  setStep();
120
127
  setIsUnmatchedHeadersModalOpen(false);
121
128
  };
122
- var unmatchedHeadersModalUI = (_jsx(Modal, __assign({ isOpen: isUnmatchedHeadersModalOpen, onClose: function () { return setIsUnmatchedHeadersModalOpen(false); } }, { children: _jsxs(Div, __assign({ p: "17px 20px" }, { children: [_jsx(Div, __assign({ textAlignCenter: true, mb: 24, mt: 5 }, { children: errorIcon }), void 0), _jsx(Div, __assign({ textAlignCenter: true, h5: true }, { children: "Unmatched Column Headers" }), void 0), _jsxs(Div, __assign({ w: 448, mt: 12, textAlignCenter: true, body1: true }, { children: [unmatchedHeadersCount === 1 ? "There is " : "There are ", unmatchedHeadersCount, " unmatched column headers. You will have to fill these out manually if you proceed."] }), void 0), _jsxs(Div, __assign({ dflex: true, centered: true, mt: 40 }, { children: [_jsx(Button, __assign({ variant: "secondary", onClick: function () { return setIsUnmatchedHeadersModalOpen(false); }, w: 160, mr: 16 }, { children: "Assign Headers" }), void 0), _jsx(Button, __assign({ w: 83, variant: "primary", onClick: skipStep }, { children: "Skip" }), void 0)] }), void 0)] }), void 0) }), void 0));
129
+ var unmatchedHeadersModalUI = (_jsx(Modal, __assign({ isOpen: isUnmatchedHeadersModalOpen, onClose: function () { return setIsUnmatchedHeadersModalOpen(false); } }, { children: _jsxs(Div, __assign({ p: "17px 20px" }, { children: [_jsx(Div, __assign({ textAlignCenter: true, mb: 24, mt: 5 }, { children: errorIcon })), _jsx(Div, __assign({ textAlignCenter: true, h5: true }, { children: "Unmatched Column Headers" })), _jsxs(Div, __assign({ w: 448, mt: 12, textAlignCenter: true, body1: true }, { children: [unmatchedHeadersCount === 1 ? "There is " : "There are ", unmatchedHeadersCount, " unmatched column headers. You will have to fill these out manually if you proceed."] })), _jsxs(Div, __assign({ dflex: true, centered: true, mt: 40 }, { children: [_jsx(Button, __assign({ variant: "secondary", onClick: function () { return setIsUnmatchedHeadersModalOpen(false); }, w: 160, mr: 16 }, { children: "Assign Headers" })), _jsx(Button, __assign({ w: 83, variant: "primary", onClick: skipStep }, { children: "Skip" }))] }))] })) })));
123
130
  var isMatchStep = currentStepIndex === 1;
124
131
  var isReviewStep = currentStepIndex === 2;
125
- var leftButtonUI = (_jsx(Div, __assign({ w: 100 }, { children: currentStepIndex > 0 && !appResponse && (_jsx(Button, __assign({ variant: "secondary", onClick: goBack }, { children: "Go back" }), void 0)) }), void 0));
126
- var rightButtonUI = (_jsxs(Div, __assign({ w: 100 }, { children: [isMatchStep && (_jsx(Button, __assign({ variant: "primary", onClick: continueToNextStep }, { children: "Continue" }), void 0)), isReviewStep && (_jsx(Button, __assign({ variant: "primary", isDisabled: !isSpreadsheetReviewComplete, onClick: function () { return setIsSubmitModalOpen(true); } }, { children: "Submit" }), void 0))] }), void 0));
127
- return (_jsxs(_Fragment, { children: [unmatchedHeadersModalUI, submitModalUI, _jsxs(StepperWrapper, __assign({ pRelative: true, alignCenter: true, w100: true, h: 96, centered: true }, { children: [logoURL && _jsx(Logo, { src: logoURL, alt: "" }, void 0), _jsxs(Content, __assign({ spaceBetween: true, w: contentWidth }, { children: [leftButtonUI, _jsx(Div, __assign({ alignCenter: true }, { children: stepsUI }), void 0), rightButtonUI] }), void 0), _jsx(CloseIcon, __assign({ centered: true, clickable: true, onClick: onClose }, { children: closeIconCondensed }), void 0)] }), void 0)] }, void 0));
132
+ var leftButtonUI = (_jsx(Div, __assign({ w: 100 }, { children: currentStepIndex > 0 && !appResponse && (_jsx(Button, __assign({ variant: "secondary", onClick: goBack }, { children: "Go back" }))) })));
133
+ var rightButtonUI = (_jsxs(Div, __assign({ w: 100 }, { children: [isMatchStep && (_jsx(Button, __assign({ variant: "primary", onClick: continueToNextStep }, { children: "Continue" }))), isReviewStep && (_jsx(Button, __assign({ variant: "primary", isDisabled: !isSpreadsheetReviewComplete, onClick: function () { return setIsSubmitModalOpen(true); } }, { children: "Submit" })))] })));
134
+ return (_jsxs(_Fragment, { children: [unmatchedHeadersModalUI, submitModalUI, _jsxs(StepperWrapper, __assign({ pRelative: true, alignCenter: true, w100: true, h: 96, centered: true }, { children: [logoURL && _jsx(Logo, { src: logoURL, alt: "" }), _jsxs(Content, __assign({ spaceBetween: true, w: contentWidth }, { children: [leftButtonUI, _jsx(Div, __assign({ alignCenter: true }, { children: stepsUI })), rightButtonUI] })), _jsx(CloseIcon, __assign({ centered: true, clickable: true, onClick: onClose }, { children: closeIconCondensed }))] }))] }));
128
135
  };
129
136
  var Content = styled(Div)(function (_a) {
130
137
  var _b = _a.theme, colors = _b.colors, c = _b.css;
@@ -135,10 +142,10 @@ var CloseIcon = styled(Div)(function (_a) {
135
142
  return css(templateObject_6 || (templateObject_6 = __makeTemplateObject(["\n position: absolute;\n right: 41px;\n "], ["\n position: absolute;\n right: 41px;\n "])));
136
143
  });
137
144
  export { Stepper };
138
- var submitSvg = (_jsxs("svg", __assign({ width: 64, height: 64, fill: "none", xmlns: "http://www.w3.org/2000/svg" }, { children: [_jsx("path", { fill: "#fff", d: "M0 0h64v64H0z" }, void 0), _jsx("path", { d: "M49.306 6.195a2 2 0 0 1 2.824-.16l10.379 9.27a2 2 0 0 1 .16 2.824L28.148 56.78a2 2 0 0 1-2.824.16l-10.379-9.27a2 2 0 0 1-.16-2.823l34.52-38.652Z", fill: "url(#a)", style: {
145
+ var submitSvg = (_jsxs("svg", __assign({ width: 64, height: 64, fill: "none", xmlns: "http://www.w3.org/2000/svg" }, { children: [_jsx("path", { fill: "#fff", d: "M0 0h64v64H0z" }), _jsx("path", { d: "M49.306 6.195a2 2 0 0 1 2.824-.16l10.379 9.27a2 2 0 0 1 .16 2.824L28.148 56.78a2 2 0 0 1-2.824.16l-10.379-9.27a2 2 0 0 1-.16-2.823l34.52-38.652Z", fill: "url(#a)", style: {
139
146
  mixBlendMode: "multiply",
140
- } }, void 0), _jsx("rect", { x: 38.727, y: 44.871, width: 17.915, height: 35.878, rx: 2, transform: "rotate(131.582 38.727 44.87)", fill: "url(#b)", style: {
147
+ } }), _jsx("rect", { x: 38.727, y: 44.871, width: 17.915, height: 35.878, rx: 2, transform: "rotate(131.582 38.727 44.87)", fill: "url(#b)", style: {
141
148
  mixBlendMode: "darken",
142
- } }, void 0), _jsxs("defs", { children: [_jsxs("linearGradient", __assign({ id: "a", x1: 18.672, y1: 47.198, x2: 37.603, y2: 58.473, gradientUnits: "userSpaceOnUse" }, { children: [_jsx("stop", { stopColor: "#D0A617" }, void 0), _jsx("stop", { offset: 1, stopColor: "#FEE18F" }, void 0)] }), void 0), _jsxs("linearGradient", __assign({ id: "b", x1: 47.684, y1: 44.871, x2: 36.123, y2: 89.527, gradientUnits: "userSpaceOnUse" }, { children: [_jsx("stop", { stopColor: "#6BEEFF" }, void 0), _jsx("stop", { offset: 1, stopColor: "#08CABE" }, void 0)] }), void 0)] }, void 0)] }), void 0));
143
- var errorIcon = (_jsxs("svg", __assign({ width: "68", height: "68", viewBox: "0 0 68 68", fill: "none", xmlns: "http://www.w3.org/2000/svg" }, { children: [_jsxs("g", __assign({ clipPath: "url(#clip0_1052_34495)" }, { children: [_jsx("rect", { width: "68", height: "68", fill: "white" }, void 0), _jsx("g", __assign({ style: { mixBlendMode: "multiply" } }, { children: _jsx("path", { d: "M28.5668 8.05854C29.6943 6.10577 32.5129 6.10576 33.6403 8.05854L59.1466 52.2368C60.274 54.1895 58.8648 56.6305 56.6099 56.6305H5.59726C3.34239 56.6305 1.93309 54.1895 3.06053 52.2368L28.5668 8.05854Z", fill: "url(#paint0_linear_1052_34495)" }, void 0) }), void 0), _jsx("g", __assign({ style: { mixBlendMode: "multiply" } }, { children: _jsx("path", { d: "M34.4375 9.68867C35.5649 7.73589 38.3835 7.73589 39.511 9.68867L65.816 55.2503C66.9434 57.2031 65.5341 59.6441 63.2793 59.6441H10.6692C8.41432 59.6441 7.00502 57.2031 8.13246 55.2503L34.4375 9.68867Z", fill: "url(#paint1_linear_1052_34495)" }, void 0) }), void 0), _jsx("rect", { x: "29.0371", y: "21.2632", width: "6.43183", height: "21.3972", rx: "2.92916", fill: "#FFFDF8" }, void 0), _jsx("rect", { x: "29.0371", y: "44.7898", width: "6.43183", height: "5.61436", rx: "2.80718", fill: "#FFFDF8" }, void 0)] }), void 0), _jsxs("defs", { children: [_jsxs("linearGradient", __assign({ id: "paint0_linear_1052_34495", x1: "10.0099", y1: "28.8136", x2: "30.2646", y2: "54.4823", gradientUnits: "userSpaceOnUse" }, { children: [_jsx("stop", { stopColor: "#FD5C39" }, void 0), _jsx("stop", { offset: "1", stopColor: "#FFB869" }, void 0)] }), void 0), _jsxs("linearGradient", __assign({ id: "paint1_linear_1052_34495", x1: "18.8007", y1: "74.0811", x2: "85.2567", y2: "33.8684", gradientUnits: "userSpaceOnUse" }, { children: [_jsx("stop", { stopColor: "#E7C551" }, void 0), _jsx("stop", { offset: "1", stopColor: "#FEE18F" }, void 0)] }), void 0), _jsx("clipPath", __assign({ id: "clip0_1052_34495" }, { children: _jsx("rect", { width: "68", height: "68", fill: "white" }, void 0) }), void 0)] }, void 0)] }), void 0));
149
+ } }), _jsxs("defs", { children: [_jsxs("linearGradient", __assign({ id: "a", x1: 18.672, y1: 47.198, x2: 37.603, y2: 58.473, gradientUnits: "userSpaceOnUse" }, { children: [_jsx("stop", { stopColor: "#D0A617" }), _jsx("stop", { offset: 1, stopColor: "#FEE18F" })] })), _jsxs("linearGradient", __assign({ id: "b", x1: 47.684, y1: 44.871, x2: 36.123, y2: 89.527, gradientUnits: "userSpaceOnUse" }, { children: [_jsx("stop", { stopColor: "#6BEEFF" }), _jsx("stop", { offset: 1, stopColor: "#08CABE" })] }))] })] })));
150
+ var errorIcon = (_jsxs("svg", __assign({ width: "68", height: "68", viewBox: "0 0 68 68", fill: "none", xmlns: "http://www.w3.org/2000/svg" }, { children: [_jsxs("g", __assign({ clipPath: "url(#clip0_1052_34495)" }, { children: [_jsx("rect", { width: "68", height: "68", fill: "white" }), _jsx("g", __assign({ style: { mixBlendMode: "multiply" } }, { children: _jsx("path", { d: "M28.5668 8.05854C29.6943 6.10577 32.5129 6.10576 33.6403 8.05854L59.1466 52.2368C60.274 54.1895 58.8648 56.6305 56.6099 56.6305H5.59726C3.34239 56.6305 1.93309 54.1895 3.06053 52.2368L28.5668 8.05854Z", fill: "url(#paint0_linear_1052_34495)" }) })), _jsx("g", __assign({ style: { mixBlendMode: "multiply" } }, { children: _jsx("path", { d: "M34.4375 9.68867C35.5649 7.73589 38.3835 7.73589 39.511 9.68867L65.816 55.2503C66.9434 57.2031 65.5341 59.6441 63.2793 59.6441H10.6692C8.41432 59.6441 7.00502 57.2031 8.13246 55.2503L34.4375 9.68867Z", fill: "url(#paint1_linear_1052_34495)" }) })), _jsx("rect", { x: "29.0371", y: "21.2632", width: "6.43183", height: "21.3972", rx: "2.92916", fill: "#FFFDF8" }), _jsx("rect", { x: "29.0371", y: "44.7898", width: "6.43183", height: "5.61436", rx: "2.80718", fill: "#FFFDF8" })] })), _jsxs("defs", { children: [_jsxs("linearGradient", __assign({ id: "paint0_linear_1052_34495", x1: "10.0099", y1: "28.8136", x2: "30.2646", y2: "54.4823", gradientUnits: "userSpaceOnUse" }, { children: [_jsx("stop", { stopColor: "#FD5C39" }), _jsx("stop", { offset: "1", stopColor: "#FFB869" })] })), _jsxs("linearGradient", __assign({ id: "paint1_linear_1052_34495", x1: "18.8007", y1: "74.0811", x2: "85.2567", y2: "33.8684", gradientUnits: "userSpaceOnUse" }, { children: [_jsx("stop", { stopColor: "#E7C551" }), _jsx("stop", { offset: "1", stopColor: "#FEE18F" })] })), _jsx("clipPath", __assign({ id: "clip0_1052_34495" }, { children: _jsx("rect", { width: "68", height: "68", fill: "white" }) }))] })] })));
144
151
  var templateObject_1, templateObject_2, templateObject_3, templateObject_4, templateObject_5, templateObject_6;
@@ -16,8 +16,8 @@ import { Div, Span } from "../styled/utils";
16
16
  import { useImporterContext } from "./ImporterContextProvider";
17
17
  export var TrialModeBanner = function () {
18
18
  var inTrialMode = useImporterContext().inTrialMode;
19
- return (_jsx(_Fragment, { children: inTrialMode && (_jsxs(Div, __assign({ bg: theme.colors.orange100, h: 80, dflex: true, alignCenter: true, justifyCenter: true }, { children: [_jsx(Div, __assign({ ml: 33, mr: 8 }, { children: exclamationPointIcon }), void 0), _jsx(Span, __assign({ mr: 16 }, { children: "You're currently in Trial mode. Subscribe to a plan to deploy to your website." }), void 0), _jsx(Button, __assign({ w: 120, br: 8, variant: "secondary", onClick: function () {
19
+ return (_jsx(_Fragment, { children: inTrialMode && (_jsxs(Div, __assign({ bg: theme.colors.orange100, h: 80, dflex: true, alignCenter: true, justifyCenter: true }, { children: [_jsx(Div, __assign({ ml: 33, mr: 8 }, { children: exclamationPointIcon })), _jsx(Span, __assign({ mr: 16 }, { children: "You're currently in Trial mode. Subscribe to a plan to deploy to your website." })), _jsx(Button, __assign({ w: 120, br: 8, variant: "secondary", onClick: function () {
20
20
  window.location.href = "".concat(process.env.REACT_APP_API_BASE_URL, "/account/billing");
21
- } }, { children: "Select plan" }), void 0)] }), void 0)) }, void 0));
21
+ } }, { children: "Select plan" }))] }))) }));
22
22
  };
23
- var exclamationPointIcon = (_jsx("svg", __assign({ width: "24", height: "24", viewBox: "0 0 24 24", fill: "none", xmlns: "http://www.w3.org/2000/svg" }, { children: _jsx("path", { fillRule: "evenodd", clipRule: "evenodd", d: "M12 23C18.0751 23 23 18.0751 23 12C23 5.92487 18.0751 1 12 1C5.92487 1 1 5.92487 1 12C1 18.0751 5.92487 23 12 23ZM12 6C12.5523 6 13 6.44772 13 7V12C13 12.5523 12.5523 13 12 13C11.4477 13 11 12.5523 11 12V7C11 6.44772 11.4477 6 12 6ZM12 15C12.5523 15 13 15.4477 13 16V16.5C13 17.0523 12.5523 17.5 12 17.5C11.4477 17.5 11 17.0523 11 16.5V16C11 15.4477 11.4477 15 12 15Z", fill: "#FF9A34" }, void 0) }), void 0));
23
+ var exclamationPointIcon = (_jsx("svg", __assign({ width: "24", height: "24", viewBox: "0 0 24 24", fill: "none", xmlns: "http://www.w3.org/2000/svg" }, { children: _jsx("path", { fillRule: "evenodd", clipRule: "evenodd", d: "M12 23C18.0751 23 23 18.0751 23 12C23 5.92487 18.0751 1 12 1C5.92487 1 1 5.92487 1 12C1 18.0751 5.92487 23 12 23ZM12 6C12.5523 6 13 6.44772 13 7V12C13 12.5523 12.5523 13 12 13C11.4477 13 11 12.5523 11 12V7C11 6.44772 11.4477 6 12 6ZM12 15C12.5523 15 13 15.4477 13 16V16.5C13 17.0523 12.5523 17.5 12 17.5C11.4477 17.5 11 17.0523 11 16.5V16C11 15.4477 11.4477 15 12 15Z", fill: "#FF9A34" }) })));
@@ -33,10 +33,10 @@ var DropzoneUploadingContainer = styled(Div)(function (_a) {
33
33
  var _b = _a.theme, colors = _b.colors, c = _b.css;
34
34
  return css(templateObject_5 || (templateObject_5 = __makeTemplateObject(["\n position: absolute;\n height: 100%;\n width: 100%;\n background: ", ";\n border: 1px solid ", ";\n "], ["\n position: absolute;\n height: 100%;\n width: 100%;\n background: ", ";\n border: 1px solid ", ";\n "])), theme.colors.blue100, theme.colors.blue500);
35
35
  });
36
- var dropzoneUploadingUI = (_jsx(DropzoneUploadingContainer, __assign({ centered: true }, { children: _jsxs(Div, { children: [_jsx(Div, __assign({ centered: true, mb: 12 }, { children: UploadIndicatorSvg }), void 0), _jsx(Div, __assign({ h5: true }, { children: " Drop your file here to upload!" }), void 0)] }, void 0) }), void 0));
36
+ var dropzoneUploadingUI = (_jsx(DropzoneUploadingContainer, __assign({ centered: true }, { children: _jsxs(Div, { children: [_jsx(Div, __assign({ centered: true, mb: 12 }, { children: UploadIndicatorSvg })), _jsx(Div, __assign({ h5: true }, { children: " Drop your file here to upload!" }))] }) })));
37
37
  var DragAndDropComponent = function (_a) {
38
38
  var openUploadFileDialog = _a.openUploadFileDialog;
39
- return (_jsxs(Div, __assign({ centered: true, flexColumn: true }, { children: [_jsx(Div, __assign({ mb: 12 }, { children: DragAndDropSvg }), void 0), _jsx(Div, __assign({ h4: true }, { children: "Drag & drop your file here" }), void 0), _jsx(Div, __assign({ body1: true, textAlignCenter: true, m: 20 }, { children: "Or" }), void 0), _jsx(Button, __assign({ variant: "secondary", w: 133, isSmall: true, onClick: openUploadFileDialog }, { children: "Browse Files" }), void 0)] }), void 0));
39
+ return (_jsxs(Div, __assign({ centered: true, flexColumn: true }, { children: [_jsx(Div, __assign({ mb: 12 }, { children: DragAndDropSvg })), _jsx(Div, __assign({ h4: true }, { children: "Drag & drop your file here" })), _jsx(Div, __assign({ body1: true, textAlignCenter: true, m: 20 }, { children: "Or" })), _jsx(Button, __assign({ variant: "secondary", w: 133, isSmall: true, onClick: openUploadFileDialog }, { children: "Browse Files" }))] })));
40
40
  };
41
41
  var ImporterDropzone = function () {
42
42
  var _a = useUploaderContext(), setIsUploading = _a.setIsUploading, setFileName = _a.setFileName;
@@ -61,7 +61,10 @@ var ImporterDropzone = function () {
61
61
  reader.onload = function (event) {
62
62
  var results = event.target.result;
63
63
  var getDataFromFile = function (fileResults) {
64
- var workBook = XLSX.read(fileResults, { type: "array" });
64
+ var workBook = XLSX.read(fileResults, {
65
+ type: "array",
66
+ raw: true,
67
+ });
65
68
  var workBookName = workBook.SheetNames[0];
66
69
  var sheet = workBook.Sheets[workBookName];
67
70
  return XLSX.utils.sheet_to_json(sheet, { header: 1 });
@@ -99,7 +102,7 @@ var ImporterDropzone = function () {
99
102
  maxFiles: 1,
100
103
  maxSize: 10000000,
101
104
  }), getRootProps = _b.getRootProps, getInputProps = _b.getInputProps, open = _b.open, isDragActive = _b.isDragActive;
102
- return (_jsxs(DragAndDropCard, __assign({ centered: true, pRelative: true }, getRootProps(), { children: [_jsx("input", __assign({}, getInputProps()), void 0), isDragActive && dropzoneUploadingUI, _jsx(DragAndDropComponent, { openUploadFileDialog: open }, void 0)] }), void 0));
105
+ return (_jsxs(DragAndDropCard, __assign({ centered: true, pRelative: true }, getRootProps(), { children: [_jsx("input", __assign({}, getInputProps())), isDragActive && dropzoneUploadingUI, _jsx(DragAndDropComponent, { openUploadFileDialog: open })] })));
103
106
  };
104
107
  export { ImporterDropzone };
105
108
  var templateObject_1, templateObject_2, templateObject_3, templateObject_4, templateObject_5;
@@ -10,5 +10,5 @@ var __assign = (this && this.__assign) || function () {
10
10
  return __assign.apply(this, arguments);
11
11
  };
12
12
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
13
- export var DragAndDropSvg = (_jsxs("svg", __assign({ width: "164", height: "96", viewBox: "0 0 164 96", fill: "none", xmlns: "http://www.w3.org/2000/svg" }, { children: [_jsx("g", { children: _jsx("path", { d: "M70.5229 74.0865C70.7599 74.9708 70.2351 75.8798 69.3508 76.1167L20.8309 89.1176C19.9466 89.3545 19.0377 88.8297 18.8007 87.9455L1.0238 21.6011C0.786859 20.7168 1.31164 19.8079 2.19593 19.5709L25.801 13.246C26.2207 13.1335 26.6678 13.1904 27.0461 13.4043L58.5194 31.2049C58.9065 31.4238 59.1894 31.7891 59.3045 32.2187L70.5229 74.0865Z", fill: "url(#paint0_linear_1658_47819)" }, void 0) }, void 0), _jsx("g", { children: _jsx("path", { d: "M26.1516 13.1523L58.22 31.2361L34.3354 37.6359C33.4988 37.8601 32.6389 37.3636 32.4148 36.527L26.1516 13.1523Z", fill: "#E8CF81" }, void 0) }, void 0), _jsx("g", { children: _jsx("path", { d: "M145.75 88.0883C145.511 88.9799 144.594 89.509 143.703 89.2701L95.2092 76.2763C94.3176 76.0374 93.7885 75.121 94.0274 74.2294L111.797 7.9115C112.036 7.0199 112.953 6.49079 113.844 6.72969L137.431 13.0496C137.854 13.163 138.216 13.4381 138.438 13.8155L156.789 44.9582C157.016 45.3445 157.079 45.8061 156.963 46.2392L145.75 88.0883Z", fill: "url(#paint1_linear_1658_47819)" }, void 0) }, void 0), _jsx("g", { children: _jsx("path", { d: "M138.09 13.2272L156.82 44.9224L132.676 38.4529C131.983 38.2672 131.571 37.5548 131.757 36.8617L138.09 13.2272Z", fill: "#68CECA" }, void 0) }, void 0), _jsx("g", { children: _jsx("path", { d: "M118.113 93.183C118.113 94.7388 116.852 96.0001 115.296 96.0001L49.5348 96.0001C47.979 96.0001 46.7177 94.7388 46.7177 93.183L46.7177 2.81711C46.7177 1.2613 47.979 6.91772e-05 49.5348 6.87584e-05L81.2634 6.02178e-05C82.0018 6.00191e-05 82.7108 0.290033 83.2376 0.807552L117.271 34.2418C117.81 34.7715 118.113 35.4956 118.113 36.2514L118.113 93.183Z", fill: "url(#paint2_linear_1658_47819)" }, void 0) }, void 0), _jsx("g", { children: _jsx("path", { d: "M81.9936 0.00131226L117.054 34.3579H83.8716C82.8344 34.3579 81.9936 33.5171 81.9936 32.4799L81.9936 0.00131226Z", fill: "#6FE7E2" }, void 0) }, void 0), _jsxs("defs", { children: [_jsxs("linearGradient", __assign({ id: "paint0_linear_1658_47819", x1: "40.3734", y1: "13.1259", x2: "-7.01613", y2: "51.8154", gradientUnits: "userSpaceOnUse" }, { children: [_jsx("stop", { stopColor: "#D0A617" }, void 0), _jsx("stop", { offset: "1", stopColor: "#FEE18F" }, void 0)] }), void 0), _jsxs("linearGradient", __assign({ id: "paint1_linear_1658_47819", x1: "119.456", y1: "82.7732", x2: "171.105", y2: "7.1263", gradientUnits: "userSpaceOnUse" }, { children: [_jsx("stop", { stopColor: "#006BA8" }, void 0), _jsx("stop", { offset: "1", stopColor: "#01FFD7" }, void 0)] }), void 0), _jsxs("linearGradient", __assign({ id: "paint2_linear_1658_47819", x1: "82.4156", y1: "96.0001", x2: "103.774", y2: "10.7256", gradientUnits: "userSpaceOnUse" }, { children: [_jsx("stop", { stopColor: "#24D2EA" }, void 0), _jsx("stop", { offset: "1", stopColor: "#10F9EB" }, void 0)] }), void 0)] }, void 0)] }), void 0));
14
- export var UploadIndicatorSvg = (_jsxs("svg", __assign({ width: "96", height: "96", viewBox: "0 0 96 96", fill: "none", xmlns: "http://www.w3.org/2000/svg" }, { children: [_jsx("g", { children: _jsx("path", { d: "M1 79.3761L95.7523 79.3762L48.3762 32L1 79.3761Z", fill: "url(#paint0_linear_1630_46301)" }, void 0) }, void 0), _jsx("g", { children: _jsx("path", { d: "M1 55.3761L95.7523 55.3762L48.3762 8L1 55.3761Z", fill: "url(#paint1_linear_1630_46301)" }, void 0) }, void 0), _jsxs("defs", { children: [_jsxs("linearGradient", __assign({ id: "paint0_linear_1630_46301", x1: "48.3761", y1: "32", x2: "40.1872", y2: "94.8016", gradientUnits: "userSpaceOnUse" }, { children: [_jsx("stop", { stopColor: "#88CDF3" }, void 0), _jsx("stop", { offset: "1", stopColor: "#00C7A8", stopOpacity: "0.895833" }, void 0)] }), void 0), _jsxs("linearGradient", __assign({ id: "paint1_linear_1630_46301", x1: "78.6058", y1: "-24.6165", x2: "64.3686", y2: "81.3108", gradientUnits: "userSpaceOnUse" }, { children: [_jsx("stop", { stopColor: "#0098B9" }, void 0), _jsx("stop", { offset: "1", stopColor: "#00A8CD", stopOpacity: "0.895833" }, void 0)] }), void 0)] }, void 0)] }), void 0));
13
+ export var DragAndDropSvg = (_jsxs("svg", __assign({ width: "164", height: "96", viewBox: "0 0 164 96", fill: "none", xmlns: "http://www.w3.org/2000/svg" }, { children: [_jsx("g", { children: _jsx("path", { d: "M70.5229 74.0865C70.7599 74.9708 70.2351 75.8798 69.3508 76.1167L20.8309 89.1176C19.9466 89.3545 19.0377 88.8297 18.8007 87.9455L1.0238 21.6011C0.786859 20.7168 1.31164 19.8079 2.19593 19.5709L25.801 13.246C26.2207 13.1335 26.6678 13.1904 27.0461 13.4043L58.5194 31.2049C58.9065 31.4238 59.1894 31.7891 59.3045 32.2187L70.5229 74.0865Z", fill: "url(#paint0_linear_1658_47819)" }) }), _jsx("g", { children: _jsx("path", { d: "M26.1516 13.1523L58.22 31.2361L34.3354 37.6359C33.4988 37.8601 32.6389 37.3636 32.4148 36.527L26.1516 13.1523Z", fill: "#E8CF81" }) }), _jsx("g", { children: _jsx("path", { d: "M145.75 88.0883C145.511 88.9799 144.594 89.509 143.703 89.2701L95.2092 76.2763C94.3176 76.0374 93.7885 75.121 94.0274 74.2294L111.797 7.9115C112.036 7.0199 112.953 6.49079 113.844 6.72969L137.431 13.0496C137.854 13.163 138.216 13.4381 138.438 13.8155L156.789 44.9582C157.016 45.3445 157.079 45.8061 156.963 46.2392L145.75 88.0883Z", fill: "url(#paint1_linear_1658_47819)" }) }), _jsx("g", { children: _jsx("path", { d: "M138.09 13.2272L156.82 44.9224L132.676 38.4529C131.983 38.2672 131.571 37.5548 131.757 36.8617L138.09 13.2272Z", fill: "#68CECA" }) }), _jsx("g", { children: _jsx("path", { d: "M118.113 93.183C118.113 94.7388 116.852 96.0001 115.296 96.0001L49.5348 96.0001C47.979 96.0001 46.7177 94.7388 46.7177 93.183L46.7177 2.81711C46.7177 1.2613 47.979 6.91772e-05 49.5348 6.87584e-05L81.2634 6.02178e-05C82.0018 6.00191e-05 82.7108 0.290033 83.2376 0.807552L117.271 34.2418C117.81 34.7715 118.113 35.4956 118.113 36.2514L118.113 93.183Z", fill: "url(#paint2_linear_1658_47819)" }) }), _jsx("g", { children: _jsx("path", { d: "M81.9936 0.00131226L117.054 34.3579H83.8716C82.8344 34.3579 81.9936 33.5171 81.9936 32.4799L81.9936 0.00131226Z", fill: "#6FE7E2" }) }), _jsxs("defs", { children: [_jsxs("linearGradient", __assign({ id: "paint0_linear_1658_47819", x1: "40.3734", y1: "13.1259", x2: "-7.01613", y2: "51.8154", gradientUnits: "userSpaceOnUse" }, { children: [_jsx("stop", { stopColor: "#D0A617" }), _jsx("stop", { offset: "1", stopColor: "#FEE18F" })] })), _jsxs("linearGradient", __assign({ id: "paint1_linear_1658_47819", x1: "119.456", y1: "82.7732", x2: "171.105", y2: "7.1263", gradientUnits: "userSpaceOnUse" }, { children: [_jsx("stop", { stopColor: "#006BA8" }), _jsx("stop", { offset: "1", stopColor: "#01FFD7" })] })), _jsxs("linearGradient", __assign({ id: "paint2_linear_1658_47819", x1: "82.4156", y1: "96.0001", x2: "103.774", y2: "10.7256", gradientUnits: "userSpaceOnUse" }, { children: [_jsx("stop", { stopColor: "#24D2EA" }), _jsx("stop", { offset: "1", stopColor: "#10F9EB" })] }))] })] })));
14
+ export var UploadIndicatorSvg = (_jsxs("svg", __assign({ width: "96", height: "96", viewBox: "0 0 96 96", fill: "none", xmlns: "http://www.w3.org/2000/svg" }, { children: [_jsx("g", { children: _jsx("path", { d: "M1 79.3761L95.7523 79.3762L48.3762 32L1 79.3761Z", fill: "url(#paint0_linear_1630_46301)" }) }), _jsx("g", { children: _jsx("path", { d: "M1 55.3761L95.7523 55.3762L48.3762 8L1 55.3761Z", fill: "url(#paint1_linear_1630_46301)" }) }), _jsxs("defs", { children: [_jsxs("linearGradient", __assign({ id: "paint0_linear_1630_46301", x1: "48.3761", y1: "32", x2: "40.1872", y2: "94.8016", gradientUnits: "userSpaceOnUse" }, { children: [_jsx("stop", { stopColor: "#88CDF3" }), _jsx("stop", { offset: "1", stopColor: "#00C7A8", stopOpacity: "0.895833" })] })), _jsxs("linearGradient", __assign({ id: "paint1_linear_1630_46301", x1: "78.6058", y1: "-24.6165", x2: "64.3686", y2: "81.3108", gradientUnits: "userSpaceOnUse" }, { children: [_jsx("stop", { stopColor: "#0098B9" }), _jsx("stop", { offset: "1", stopColor: "#00A8CD", stopOpacity: "0.895833" })] }))] })] })));
@@ -37,15 +37,15 @@ var HeaderCardWrapper = styled(Div)(templateObject_1 || (templateObject_1 = __ma
37
37
  var ErrorCardContainer = styled(Div)(templateObject_2 || (templateObject_2 = __makeTemplateObject(["\n border-radius: 8px;\n width: 1120px;\n height: 550px;\n display: flex;\n flex-direction: column;\n align-items: center;\n background: ", ";\n border: 1px dashed ", ";\n justify-content: center;\n"], ["\n border-radius: 8px;\n width: 1120px;\n height: 550px;\n display: flex;\n flex-direction: column;\n align-items: center;\n background: ", ";\n border: 1px dashed ", ";\n justify-content: center;\n"])), theme.colors.blue100, theme.colors.blue500);
38
38
  export var ErrorCard = function () {
39
39
  var templateError = useImporterContext().templateError;
40
- return (_jsxs(ErrorCardContainer, { children: [_jsx(Div, __assign({ mb: 28 }, { children: errorIcon }), void 0), _jsx(Div, __assign({ h3: true, mb: 16 }, { children: "Something\u2019s wrong" }), void 0), _jsx(Div, __assign({ body1: true }, { children: templateError }), void 0)] }, void 0));
40
+ return (_jsxs(ErrorCardContainer, { children: [_jsx(Div, __assign({ mb: 28 }, { children: errorIcon })), _jsx(Div, __assign({ h3: true, mb: 16 }, { children: "Something\u2019s wrong" })), _jsx(Div, __assign({ body1: true }, { children: templateError }))] }));
41
41
  };
42
42
  var HeaderListItem = styled(Div)(templateObject_3 || (templateObject_3 = __makeTemplateObject(["\n margin-bottom: ", "px;\n"], ["\n margin-bottom: ", "px;\n"])), function (p) { return (p.isLast ? 0 : 8); });
43
43
  var HeadersList = function (_a) {
44
44
  var title = _a.title, headers = _a.headers, props = __rest(_a, ["title", "headers"]);
45
- return (_jsxs(_Fragment, { children: [_jsx(Div, __assign({ label3: true }, props, { children: title }), void 0), headers.map(function (header, index) {
45
+ return (_jsxs(_Fragment, { children: [_jsx(Div, __assign({ label3: true }, props, { children: title })), headers.map(function (header, index) {
46
46
  var isLast = index === headers.length - 1;
47
47
  return (_jsx(HeaderListItem, __assign({ body1: true, isLast: isLast, mt: 16 }, { children: header }), index));
48
- })] }, void 0));
48
+ })] }));
49
49
  };
50
50
  var HeaderCard = function (_a) {
51
51
  var templateHeaders = _a.templateHeaders, props = __rest(_a, ["templateHeaders"]);
@@ -55,24 +55,24 @@ var HeaderCard = function (_a) {
55
55
  var optionalHeaders = templateHeaders
56
56
  .filter(function (h) { return !h.required; })
57
57
  .map(function (h) { return h.label; });
58
- return (_jsx(Div, { children: _jsxs(HeaderCardWrapper, __assign({}, props, { children: [_jsx(Div, __assign({ body3: true, mb: 24 }, { children: "Make sure your document contains data similar to this:" }), void 0), requiredHeaders.length > 0 && (_jsx(HeadersList, { title: "Required Headers", headers: requiredHeaders }, void 0)), optionalHeaders.length > 0 && (_jsx(HeadersList, { title: "Optional Headers", headers: optionalHeaders, mt: 30 }, void 0))] }), void 0) }, void 0));
58
+ return (_jsx(Div, { children: _jsxs(HeaderCardWrapper, __assign({}, props, { children: [_jsx(Div, __assign({ body3: true, mb: 24 }, { children: "Make sure your document contains data similar to this:" })), requiredHeaders.length > 0 && (_jsx(HeadersList, { title: "Required Headers", headers: requiredHeaders })), optionalHeaders.length > 0 && (_jsx(HeadersList, { title: "Optional Headers", headers: optionalHeaders, mt: 30 }))] })) }));
59
59
  };
60
60
  var LoadingCardWrapper = styled(Div)(templateObject_4 || (templateObject_4 = __makeTemplateObject(["\n box-shadow: 0px 0px 12px rgba(33, 75, 167, 0.24);\n border-radius: 8px;\n max-width: 544px;\n height: 102px;\n padding-left: 30px;\n padding-right: 30px;\n background: ", ";\n"], ["\n box-shadow: 0px 0px 12px rgba(33, 75, 167, 0.24);\n border-radius: 8px;\n max-width: 544px;\n height: 102px;\n padding-left: 30px;\n padding-right: 30px;\n background: ", ";\n"])), function (p) { return p.theme.colors.white; });
61
61
  var LoadingCard = function () {
62
62
  var fileName = useUploaderContext().fileName;
63
63
  var resetImport = useImporterContext().resetImport;
64
64
  var fileExtension = fileName && fileName.slice(fileName.lastIndexOf("."));
65
- var fileExtensionUI = (_jsxs(Div, { children: [fileExtensionIcon, _jsx(Div, __assign({ c: colors.gray900, helperText: true, mt: -26, ml: 7 }, { children: fileExtension }), void 0)] }, void 0));
66
- return (_jsxs(LoadingCardWrapper, __assign({ spaceBetween: true, centered: true }, { children: [fileExtensionUI, _jsxs(Div, __assign({ mr: 30, ml: 30 }, { children: [_jsx(Div, __assign({ label2: true }, { children: fileName }), void 0), _jsx(Div, __assign({ helperText: true, c: colors.gray500 }, { children: "Uploading..." }), void 0)] }), void 0), _jsx(Div, __assign({ clickable: true, onClick: resetImport }, { children: closeIconWithCircle }), void 0)] }), void 0));
65
+ var fileExtensionUI = (_jsxs(Div, { children: [fileExtensionIcon, _jsx(Div, __assign({ c: colors.gray900, helperText: true, mt: -26, ml: 7 }, { children: fileExtension }))] }));
66
+ return (_jsxs(LoadingCardWrapper, __assign({ spaceBetween: true, centered: true }, { children: [fileExtensionUI, _jsxs(Div, __assign({ mr: 30, ml: 30 }, { children: [_jsx(Div, __assign({ label2: true }, { children: fileName })), _jsx(Div, __assign({ helperText: true, c: colors.gray500 }, { children: "Uploading..." }))] })), _jsx(Div, __assign({ clickable: true, onClick: resetImport }, { children: closeIconWithCircle }))] })));
67
67
  };
68
68
  var ImporterSection = function () {
69
69
  var _a = useImporterContext(), templateHeaders = _a.templateHeaders, templateError = _a.templateError;
70
- return templateError ? (_jsx(ErrorCard, {}, void 0)) : (_jsx(_Fragment, { children: templateHeaders && (_jsxs(Div, __assign({ dflex: true }, { children: [_jsx(ImporterDropzone, {}, void 0), _jsx(HeaderCard, { ml: 25, templateHeaders: templateHeaders }, void 0)] }), void 0)) }, void 0));
70
+ return templateError ? (_jsx(ErrorCard, {})) : (_jsx(_Fragment, { children: templateHeaders && (_jsxs(Div, __assign({ dflex: true }, { children: [_jsx(ImporterDropzone, {}), _jsx(HeaderCard, { ml: 25, templateHeaders: templateHeaders })] }))) }));
71
71
  };
72
72
  var DragAndDropImporter = function () {
73
73
  var isUploading = useUploaderContext().isUploading;
74
- var headerUI = (_jsxs(Div, __assign({ textAlignCenter: true }, { children: [_jsx(Div, __assign({ h2: true, mb: 16, mt: 64 }, { children: "Upload a File to Import your Data" }), void 0), _jsx(Div, __assign({ body1: true, mb: 24, textAlignCenter: true }, { children: "Upload any .csv, .tsv, .xls, .xlsx spreadsheet file with any set of columns as long as it has one record per row." }), void 0)] }), void 0));
75
- return (_jsxs(Div, __assign({ flexColumn: true, centered: true }, { children: [headerUI, isUploading ? (_jsx(Div, __assign({ mt: 40 }, { children: _jsx(LoadingCard, {}, void 0) }), void 0)) : (_jsx(ImporterSection, {}, void 0))] }), void 0));
74
+ var headerUI = (_jsxs(Div, __assign({ textAlignCenter: true }, { children: [_jsx(Div, __assign({ h2: true, mb: 16, mt: 64 }, { children: "Upload a File to Import your Data" })), _jsx(Div, __assign({ body1: true, mb: 24, textAlignCenter: true }, { children: "Upload any .csv, .tsv, .xls, .xlsx spreadsheet file with any set of columns as long as it has one record per row." }))] })));
75
+ return (_jsxs(Div, __assign({ flexColumn: true, centered: true }, { children: [headerUI, isUploading ? (_jsx(Div, __assign({ mt: 40 }, { children: _jsx(LoadingCard, {}) }))) : (_jsx(ImporterSection, {}))] })));
76
76
  };
77
77
  export { DragAndDropImporter };
78
78
  var templateObject_1, templateObject_2, templateObject_3, templateObject_4;
@@ -30,23 +30,25 @@ import { useImporterContext } from "../ImporterContextProvider";
30
30
  import { FieldTypes } from "../../types";
31
31
  import { Div } from "../../styled/utils";
32
32
  import { getSpreadsheetRowWidth } from "../common/utils";
33
+ import { useMemo } from "react";
33
34
  var HeaderButtonsWrapper = styled(Div)(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n > div {\n margin-left: 8px;\n margin-right: 8px;\n }\n"], ["\n > div {\n margin-left: 8px;\n margin-right: 8px;\n }\n"])));
34
35
  var HeaderButtons = function () {
35
36
  var _a = useImporterContext(), setCurrentStepIndex = _a.setCurrentStepIndex, resetImport = _a.resetImport;
36
37
  var onClick = function () {
37
38
  setCurrentStepIndex(1);
38
39
  };
39
- return (_jsxs(HeaderButtonsWrapper, __assign({ dflex: true, spaceBetween: true, mb: 12 }, { children: [_jsx(Button, __assign({ w: 180, isSmall: true, variant: "secondary", onClick: resetImport }, { children: "No, Re-upload file" }), void 0), _jsx(Button, __assign({ w: 142, isSmall: true, onClick: onClick }, { children: "Yes, continue" }), void 0)] }), void 0));
40
+ return (_jsxs(HeaderButtonsWrapper, __assign({ dflex: true, spaceBetween: true, mb: 12 }, { children: [_jsx(Button, __assign({ w: 180, isSmall: true, variant: "secondary", onClick: resetImport }, { children: "No, Re-upload file" })), _jsx(Button, __assign({ w: 142, isSmall: true, onClick: onClick }, { children: "Yes, continue" }))] })));
40
41
  };
41
42
  var HeadersPreview = function () {
42
43
  var uploadedData = useImporterContext().uploadedData;
43
- var formattedData = (function () {
44
+ var formattedData = useMemo(function () {
44
45
  var firstRowLen = 0;
45
- if (uploadedData.length > 0 && Array.isArray(uploadedData[0]))
46
+ if (uploadedData.length > 0 && Array.isArray(uploadedData[0])) {
46
47
  firstRowLen = uploadedData[0].length;
47
- var placeholderHeaders = __spreadArray([], Array(firstRowLen), true).map(function (_, i) {
48
- return String.fromCharCode(65 + i);
49
- });
48
+ }
49
+ var placeholderHeaders = new Array(firstRowLen)
50
+ .fill(null)
51
+ .map(function (_, i) { return String.fromCharCode(65 + i); });
50
52
  var getDataRows = function () {
51
53
  var emptyRows = [];
52
54
  if (uploadedData.length < 20)
@@ -60,19 +62,19 @@ var HeadersPreview = function () {
60
62
  return entry;
61
63
  });
62
64
  };
63
- var dataRows = getDataRows();
64
- return dataRows;
65
- })();
66
- var placeholderFields = Object.keys(formattedData[0]);
67
- var readonlyFields = placeholderFields.map(function (key) {
68
- return {
69
- label: key,
70
- name: key,
71
- type: FieldTypes.string,
72
- isRequired: false,
73
- };
74
- });
75
- return (_jsx(_Fragment, { children: _jsxs(Div, __assign({ flexColumn: true, centered: true, pt: 40 }, { children: [_jsx(Div, __assign({ h2: true, mb: 16 }, { children: "Verify Your Column Headers" }), void 0), _jsx(Div, __assign({ body1: true, mb: 24, textAlignCenter: true }, { children: "File must contain column headers to proceed." }), void 0), _jsx(HeaderButtons, {}, void 0), _jsx(Div, __assign({ w100: true, centered: true, mb: 36 }, { children: _jsx(Spreadsheet, __assign({ rowWidth: getSpreadsheetRowWidth(readonlyFields, 6), isReadOnly: true, initialData: formattedData }, { fields: readonlyFields }, { highlightFirstRow: true }), void 0) }), void 0)] }), void 0) }, void 0));
65
+ return getDataRows();
66
+ }, [uploadedData]);
67
+ var readonlyFields = useMemo(function () {
68
+ return Object.keys(formattedData[0]).map(function (key) {
69
+ return {
70
+ label: key,
71
+ name: key,
72
+ type: FieldTypes.string,
73
+ isRequired: false,
74
+ };
75
+ });
76
+ }, []);
77
+ return (_jsx(_Fragment, { children: _jsxs(Div, __assign({ flexColumn: true, centered: true, pt: 40 }, { children: [_jsx(Div, __assign({ h2: true, mb: 16 }, { children: "Verify Your Column Headers" })), _jsx(Div, __assign({ body1: true, mb: 24, textAlignCenter: true }, { children: "File must contain column headers to proceed." })), _jsx(HeaderButtons, {}), _jsx(Div, __assign({ w100: true, centered: true, mb: 36 }, { children: _jsx(Spreadsheet, __assign({ rowWidth: getSpreadsheetRowWidth(readonlyFields, 6), isReadOnly: true, initialData: formattedData }, { fields: readonlyFields }, { highlightFirstRow: true })) }))] })) }));
76
78
  };
77
79
  export default HeadersPreview;
78
80
  var templateObject_1;
@@ -22,6 +22,6 @@ export var UploaderContextProvider = function (_a) {
22
22
  fileName: fileName,
23
23
  setFileName: setFileName,
24
24
  };
25
- return (_jsx(UploaderContext.Provider, __assign({ value: value }, { children: children }), void 0));
25
+ return (_jsx(UploaderContext.Provider, __assign({ value: value }, { children: children })));
26
26
  };
27
27
  export var useUploaderContext = function () { return useContext(UploaderContext); };
@@ -5,9 +5,9 @@ import { UploaderContextProvider } from "./UploaderContextProvider";
5
5
  import { useImporterContext } from "../ImporterContextProvider";
6
6
  var UploaderWithContext = function () {
7
7
  var uploadedData = useImporterContext().uploadedData;
8
- return _jsx(_Fragment, { children: uploadedData ? _jsx(HeadersPreview, {}, void 0) : _jsx(DragAndDropImporter, {}, void 0) }, void 0);
8
+ return _jsx(_Fragment, { children: uploadedData ? _jsx(HeadersPreview, {}) : _jsx(DragAndDropImporter, {}) });
9
9
  };
10
10
  var Uploader = function () {
11
- return (_jsx(UploaderContextProvider, { children: _jsx(UploaderWithContext, {}, void 0) }, void 0));
11
+ return (_jsx(UploaderContextProvider, { children: _jsx(UploaderWithContext, {}) }));
12
12
  };
13
13
  export { Uploader };
@@ -20,5 +20,5 @@ import { Div } from "../../styled/utils";
20
20
  var LoadingBackdrop = styled(Div)(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n position: fixed;\n top: 0px;\n left: 0px;\n margin: 0px;\n width: 100vw;\n height: 100vh;\n z-index: 99999999;\n background: ", ";\n opacity: 0.6;\n"], ["\n position: fixed;\n top: 0px;\n left: 0px;\n margin: 0px;\n width: 100vw;\n height: 100vh;\n z-index: 99999999;\n background: ", ";\n opacity: 0.6;\n"])), function (props) { return props.theme.colors.white; });
21
21
  var ModalContainer = styled(Div)(templateObject_2 || (templateObject_2 = __makeTemplateObject(["\n top: 0px;\n left: 0px;\n margin: 0px;\n position: fixed;\n display: flex;\n align-items: center;\n justify-content: center;\n z-index: 10000000000;\n width: 100vw;\n height: 100vh;\n pointer-events: none;\n div {\n pointer-events: auto;\n }\n"], ["\n top: 0px;\n left: 0px;\n margin: 0px;\n position: fixed;\n display: flex;\n align-items: center;\n justify-content: center;\n z-index: 10000000000;\n width: 100vw;\n height: 100vh;\n pointer-events: none;\n div {\n pointer-events: auto;\n }\n"])));
22
22
  var LoaderContainer = styled(ModalContainer)(templateObject_3 || (templateObject_3 = __makeTemplateObject(["\n pointer-events: none;\n"], ["\n pointer-events: none;\n"])));
23
- export var AppLoading = function () { return (_jsxs(_Fragment, { children: [_jsx(LoadingBackdrop, {}, void 0), _jsx(LoaderContainer, { children: _jsx(Div, __assign({ w: 300 }, { children: _jsx(Div, __assign({ pRelative: true }, { children: _jsx(Spinner, {}, void 0) }), void 0) }), void 0) }, void 0)] }, void 0)); };
23
+ export var AppLoading = function () { return (_jsxs(_Fragment, { children: [_jsx(LoadingBackdrop, {}), _jsx(LoaderContainer, { children: _jsx(Div, __assign({ w: 300 }, { children: _jsx(Div, __assign({ pRelative: true }, { children: _jsx(Spinner, {}) })) })) })] })); };
24
24
  var templateObject_1, templateObject_2, templateObject_3;
@@ -55,7 +55,7 @@ var __spreadArray = (this && this.__spreadArray) || function (to, from, pack) {
55
55
  return to.concat(ar || Array.prototype.slice.call(from));
56
56
  };
57
57
  import { jsx as _jsx } from "react/jsx-runtime";
58
- import { createContext, useContext, useEffect, useState } from "react";
58
+ import { createContext, useContext, useEffect, useState, useMemo, } from "react";
59
59
  import { formatBatchErrors } from "../../..";
60
60
  import { getRecordErrors, getRenderedRecordWithErrors, recordIsEmpty, } from "./common";
61
61
  var MINIMUM_ROW_COUNT = 20;
@@ -102,10 +102,10 @@ export var SpreadsheetContextProvider = function (_a) {
102
102
  }), columnErrorCounts = _l.columnErrorCounts, totalErrors = _l.totalErrors, isValidationComplete = _l.isValidationComplete;
103
103
  useEffect(function () {
104
104
  var init = function () { return __awaiter(void 0, void 0, void 0, function () {
105
- var batchValidationDelayMs, batchValidationSize, addEmtpyRows, validateInBatches;
105
+ var batchValidationDelayMs, batchValidationSize, addEmptyRows, validateInBatches;
106
106
  return __generator(this, function (_a) {
107
107
  batchValidationDelayMs = options.batchValidationDelayMs, batchValidationSize = options.batchValidationSize;
108
- addEmtpyRows = function () {
108
+ addEmptyRows = function () {
109
109
  var newData = __spreadArray([], data, true);
110
110
  var emptyRecord = fields.reduce(function (obj, f) {
111
111
  var _a;
@@ -120,7 +120,7 @@ export var SpreadsheetContextProvider = function (_a) {
120
120
  setData(newData);
121
121
  };
122
122
  if (data.length < MINIMUM_ROW_COUNT)
123
- addEmtpyRows();
123
+ addEmptyRows();
124
124
  validateInBatches = function () { return __awaiter(void 0, void 0, void 0, function () {
125
125
  var validationErrors, batchSize, batchCount, batchIdx, idx, batch, errors, validationPercentage;
126
126
  return __generator(this, function (_a) {
@@ -252,7 +252,7 @@ export var SpreadsheetContextProvider = function (_a) {
252
252
  setIsScrollingEnabled: setIsScrollingEnabled,
253
253
  highlightFirstRow: highlightFirstRow,
254
254
  };
255
- return (_jsx(SpreadsheetContext.Provider, __assign({ value: value }, { children: children }), void 0));
255
+ return (_jsx(SpreadsheetContext.Provider, __assign({ value: value }, { children: children })));
256
256
  };
257
257
  var useValidationState = function (_a) {
258
258
  var data = _a.data, fields = _a.fields, batchValidationErrors = _a.batchValidationErrors, submittedData = _a.submittedData;
@@ -280,7 +280,9 @@ var useValidationState = function (_a) {
280
280
  };
281
281
  updateErrorCounts();
282
282
  }, [data, batchValidationErrors]);
283
- var totalErrors = Object.keys(columnErrorCounts).reduce(function (total, key) { return total + (columnErrorCounts[key] || 0); }, 0);
283
+ var totalErrors = useMemo(function () {
284
+ return Object.keys(columnErrorCounts).reduce(function (total, key) { return total + (columnErrorCounts[key] || 0); }, 0);
285
+ }, []);
284
286
  var isValidationComplete = batchValidationErrors && totalErrors === 0;
285
287
  return { columnErrorCounts: columnErrorCounts, totalErrors: totalErrors, isValidationComplete: isValidationComplete };
286
288
  };
@@ -37,7 +37,7 @@ export var SpreadsheetRowNumbers = function (_a) {
37
37
  var data = useSpreadsheetContext().data;
38
38
  var rowRenderer = function (_a) {
39
39
  var rowIndex = _a.rowIndex, style = _a.style;
40
- return (_jsx(RowNumber, __assign({ style: style, alignCenter: true, justifyEnd: true, isLast: rowIndex === data.length - 1 }, { children: _jsx(Div, __assign({ truncateText: true, mr: 16, textAlignRight: true }, { children: rowIndex + 1 }), void 0) }), rowIndex));
40
+ return (_jsx(RowNumber, __assign({ style: style, alignCenter: true, justifyEnd: true, isLast: rowIndex === data.length - 1 }, { children: _jsx(Div, __assign({ truncateText: true, mr: 16, textAlignRight: true }, { children: rowIndex + 1 })) }), rowIndex));
41
41
  };
42
42
  var gridStyles = {
43
43
  outline: "none",
@@ -45,7 +45,7 @@ export var SpreadsheetRowNumbers = function (_a) {
45
45
  overflowY: "hidden",
46
46
  overflowX: "scroll",
47
47
  };
48
- return (_jsxs(SpreadsheetRowNumbersContainer, __assign({}, props, { h: height }, { children: [_jsx(SpreadsheetRowNumbersHeader, {}, void 0), _jsx(Grid, { scrollTop: scrollTop, style: gridStyles, width: SPREADSHEET_ROW_NUMBERS_WIDTH, columnCount: 1, columnWidth: SPREADSHEET_ROW_NUMBERS_WIDTH, height: height - spreadsheetHeaderHeightPx, rowHeight: 40, cellRenderer: rowRenderer, rowCount: data.length }, void 0)] }), void 0));
48
+ return (_jsxs(SpreadsheetRowNumbersContainer, __assign({}, props, { h: height }, { children: [_jsx(SpreadsheetRowNumbersHeader, {}), _jsx(Grid, { scrollTop: scrollTop, style: gridStyles, width: SPREADSHEET_ROW_NUMBERS_WIDTH, columnCount: 1, columnWidth: SPREADSHEET_ROW_NUMBERS_WIDTH, height: height - spreadsheetHeaderHeightPx, rowHeight: 40, cellRenderer: rowRenderer, rowCount: data.length })] })));
49
49
  };
50
50
  var RowNumber = styled(Div)(templateObject_2 || (templateObject_2 = __makeTemplateObject(["\n background-color: ", ";\n ", ";\n ", "\n"], ["\n background-color: ", ";\n ", ";\n ", "\n"])), function (p) { return p.theme.colors.tableHeader; }, function (p) { return p.theme.css.label3; }, function (p) {
51
51
  return !p.isLast && css(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n box-shadow: inset 0 -1px 0 ", ";\n "], ["\n box-shadow: inset 0 -1px 0 ", ";\n "])), function (p) { return p.theme.colors.gray300; });
@@ -0,0 +1,7 @@
1
+ import React from "react";
2
+ import { Field } from "../../../../types";
3
+ export declare type FieldHeaderProps = {
4
+ field: Field;
5
+ sortByFieldErrors: (name: string) => void;
6
+ };
7
+ export declare const FieldHeader: React.FC<FieldHeaderProps>;
@@ -0,0 +1,31 @@
1
+ var __makeTemplateObject = (this && this.__makeTemplateObject) || function (cooked, raw) {
2
+ if (Object.defineProperty) { Object.defineProperty(cooked, "raw", { value: raw }); } else { cooked.raw = raw; }
3
+ return cooked;
4
+ };
5
+ var __assign = (this && this.__assign) || function () {
6
+ __assign = Object.assign || function(t) {
7
+ for (var s, i = 1, n = arguments.length; i < n; i++) {
8
+ s = arguments[i];
9
+ for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
10
+ t[p] = s[p];
11
+ }
12
+ return t;
13
+ };
14
+ return __assign.apply(this, arguments);
15
+ };
16
+ import { jsxs as _jsxs, jsx as _jsx } from "react/jsx-runtime";
17
+ import { TooltipProvider } from "../../../../common";
18
+ import { Div } from "../../../../styled/utils";
19
+ import { useSpreadsheetContext } from "../SpreadsheetContextProvider";
20
+ import styled, { css } from "styled-components";
21
+ var ErrorCount = styled(Div)(function (_a) {
22
+ var _b = _a.theme, colors = _b.colors, c = _b.css;
23
+ return css(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n color: ", ";\n background: ", ";\n border: solid 1px ", ";\n padding: 4px 7px;\n border-radius: 56px;\n min-width: 24px;\n ", ";\n "], ["\n color: ", ";\n background: ", ";\n border: solid 1px ", ";\n padding: 4px 7px;\n border-radius: 56px;\n min-width: 24px;\n ", ";\n "])), colors.error, colors.red100, colors.error, c.centered);
24
+ });
25
+ export var FieldHeader = function (_a) {
26
+ var field = _a.field, sortByFieldErrors = _a.sortByFieldErrors;
27
+ var columnErrorCounts = useSpreadsheetContext().columnErrorCounts;
28
+ var fieldErrorCount = columnErrorCounts[field.name];
29
+ return (_jsxs(Div, __assign({ p: "0 16px", spaceBetween: true, w100: true, alignCenter: true }, { children: [_jsxs(Div, __assign({ truncateText: true }, { children: [field.label, field.isRequired && "*"] })), fieldErrorCount && (_jsx(TooltipProvider, __assign({ mr: 3, w: 35, tooltip: "Sort by ".concat(field.label, " errors") }, { children: _jsx(ErrorCount, __assign({ onClick: function () { return sortByFieldErrors(field.name); } }, { children: _jsx(Div, __assign({ centered: true }, { children: _jsx(Div, __assign({ w: 35, textAlignCenter: true, label3: true, truncateText: true }, { children: fieldErrorCount })) })) })) })))] })));
30
+ };
31
+ var templateObject_1;
@@ -1,7 +1,12 @@
1
- /// <reference types="react" />
2
- export declare const SpreadsheetAutocomplete: ({ name, record, options, isInputDisabled, }: {
3
- name: any;
4
- record: any;
5
- options: any;
1
+ import React from "react";
2
+ import { Option } from "../../../../../common/inputs/Autocomplete";
3
+ import { Record, FieldTypes } from "../../../../../types";
4
+ export declare type AutoCompleteOption = Option;
5
+ export declare type SpreadsheetAutocompleteProps = {
6
+ name: string;
7
+ record: Record;
8
+ options: AutoCompleteOption[];
6
9
  isInputDisabled?: boolean;
7
- }) => JSX.Element;
10
+ fieldType: FieldTypes;
11
+ };
12
+ export declare const SpreadsheetAutocomplete: React.FC<SpreadsheetAutocompleteProps>;
@@ -15,9 +15,9 @@ var __assign = (this && this.__assign) || function () {
15
15
  };
16
16
  import { jsx as _jsx } from "react/jsx-runtime";
17
17
  import styled, { css } from "styled-components";
18
- import { SpreadsheetField, useSpreadsheetField, useValidationError } from ".";
18
+ import { SpreadsheetField, useSpreadsheetField } from ".";
19
19
  import { spreadsheetRowHeightPx } from "..";
20
- import { Autocomplete as AutocompleteBase } from "../../../../../common/inputs/Autocomplete";
20
+ import { Autocomplete as AutocompleteBase, } from "../../../../../common/inputs/Autocomplete";
21
21
  import { SelectMenuDiv, SelectMenuScrollArea, } from "../../../../../common/inputs/SelectMenu";
22
22
  import { HTMLInput, TextInputIcon, } from "../../../../../common/inputs/TextInput";
23
23
  import { useSpreadsheetContext } from "../../SpreadsheetContextProvider";
@@ -26,12 +26,11 @@ var Autocomplete = styled(AutocompleteBase)(templateObject_3 || (templateObject_
26
26
  }, function (p) {
27
27
  return p.hasError && css(templateObject_2 || (templateObject_2 = __makeTemplateObject(["\n color: ", ";\n "], ["\n color: ", ";\n "])), function (p) { return p.theme.colors.error; });
28
28
  }, TextInputIcon, SelectMenuDiv, SelectMenuScrollArea);
29
- export var SpreadsheetAutocomplete = function (_a) {
30
- var name = _a.name, record = _a.record, options = _a.options, _b = _a.isInputDisabled, isInputDisabled = _b === void 0 ? false : _b;
31
- var validationError = useValidationError(name, record).validationError;
32
- var _c = useSpreadsheetField(name, record), value = _c.value, setValue = _c.setValue;
29
+ export var SpreadsheetAutocomplete = function (props) {
30
+ var name = props.name, record = props.record, options = props.options, fieldType = props.fieldType, _a = props.isInputDisabled, isInputDisabled = _a === void 0 ? false : _a;
31
+ var _b = useSpreadsheetField(name, record, fieldType), value = _b.value, setValue = _b.setValue, validationError = _b.validationError;
33
32
  var setIsScrollingEnabled = useSpreadsheetContext().setIsScrollingEnabled;
34
- return (_jsx(SpreadsheetField, __assign({}, { name: name, record: record }, { children: _jsx(Autocomplete, { placement: "bottom", isInputDisabled: isInputDisabled, hasError: !!validationError, onToggle: function (isOpen) { return setIsScrollingEnabled(!isOpen); }, options: options, value: value, icon: chevronDownIcon, onChange: function (v) { return setValue(v); } }, void 0) }), void 0));
33
+ return (_jsx(SpreadsheetField, __assign({ validationError: validationError }, { children: _jsx(Autocomplete, { placement: "bottom", isInputDisabled: isInputDisabled, hasError: !!validationError, onToggle: function (isOpen) { return setIsScrollingEnabled(!isOpen); }, options: options, value: value, icon: chevronDownIcon, onChange: function (v) { return setValue(v); } }) })));
35
34
  };
36
- var chevronDownIcon = (_jsx("svg", __assign({ width: "10", height: "6", viewBox: "0 0 10 6", fill: "none", xmlns: "http://www.w3.org/2000/svg" }, { children: _jsx("path", { d: "M8.46289 1L4.98131 4.48159L1.49972 1", stroke: "black", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round" }, void 0) }), void 0));
35
+ var chevronDownIcon = (_jsx("svg", __assign({ width: "10", height: "6", viewBox: "0 0 10 6", fill: "none", xmlns: "http://www.w3.org/2000/svg" }, { children: _jsx("path", { d: "M8.46289 1L4.98131 4.48159L1.49972 1", stroke: "black", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round" }) })));
37
36
  var templateObject_1, templateObject_2, templateObject_3;
@@ -1,12 +1,12 @@
1
1
  /// <reference types="react" />
2
2
  import { HTMLInputCSSProps } from "../../../../../styled/utils";
3
- import { Record } from "../../../../../types";
4
- declare type SpreadsheetTextInputArgs = {
3
+ import { FieldTypes, Record } from "../../../../../types";
4
+ export declare type SpreadsheetTextInputArgs = {
5
5
  name: string;
6
6
  record: Record;
7
+ fieldType: FieldTypes;
7
8
  } & HTMLInputCSSProps;
8
- export declare const SpreadsheetInput: ({ name, record, ...props }: SpreadsheetTextInputArgs) => JSX.Element;
9
+ export declare const SpreadsheetInput: ({ name, record, fieldType, ...props }: SpreadsheetTextInputArgs) => JSX.Element;
9
10
  export declare const Input: import("styled-components").StyledComponent<"input", import("styled-components").DefaultTheme, {
10
11
  hasError: boolean;
11
12
  } & import("../../../../../styled/utils").HTMLInputProps & import("../../../../../styled/utils").CSSProps, never>;
12
- export {};
@@ -26,15 +26,14 @@ var __rest = (this && this.__rest) || function (s, e) {
26
26
  };
27
27
  import { jsx as _jsx } from "react/jsx-runtime";
28
28
  import styled, { css } from "styled-components";
29
- import { SpreadsheetField, useSpreadsheetField, useValidationError } from ".";
29
+ import { SpreadsheetField, useSpreadsheetField } from ".";
30
30
  export var SpreadsheetInput = function (_a) {
31
- var name = _a.name, record = _a.record, props = __rest(_a, ["name", "record"]);
32
- var validationError = useValidationError(name, record).validationError;
33
- var _b = useSpreadsheetField(name, record), value = _b.value, setValue = _b.setValue;
34
- return (_jsx(SpreadsheetField, __assign({}, { name: name, record: record }, { children: _jsx(Input, __assign({ hasError: !!validationError, value: value || "", onChange: function (_a) {
31
+ var name = _a.name, record = _a.record, fieldType = _a.fieldType, props = __rest(_a, ["name", "record", "fieldType"]);
32
+ var _b = useSpreadsheetField(name, record, fieldType), value = _b.value, setValue = _b.setValue, validationError = _b.validationError;
33
+ return (_jsx(SpreadsheetField, __assign({ validationError: validationError }, { children: _jsx(Input, __assign({ hasError: !!validationError, value: value || "", onChange: function (_a) {
35
34
  var value = _a.target.value;
36
35
  return setValue(value);
37
- } }, props), void 0) }), void 0));
36
+ } }, props)) })));
38
37
  };
39
38
  export var Input = styled.input(templateObject_2 || (templateObject_2 = __makeTemplateObject(["\n outline: none;\n border: none;\n width: 100%;\n height: calc(100% - 2px);\n background: transparent;\n box-sizing: border-box;\n\n ::-webkit-outer-spin-button,\n ::-webkit-inner-spin-button {\n -webkit-appearance: none;\n margin: 0;\n }\n /* Firefox */\n -moz-appearance: textfield;\n\n padding: 0 12px;\n ", ";\n color: ", ";\n ::placeholder {\n color: ", ";\n }\n\n ", "\n"], ["\n outline: none;\n border: none;\n width: 100%;\n height: calc(100% - 2px);\n background: transparent;\n box-sizing: border-box;\n\n ::-webkit-outer-spin-button,\n ::-webkit-inner-spin-button {\n -webkit-appearance: none;\n margin: 0;\n }\n /* Firefox */\n -moz-appearance: textfield;\n\n padding: 0 12px;\n ", ";\n color: ", ";\n ::placeholder {\n color: ", ";\n }\n\n ", "\n"])), function (props) { return props.theme.css.body1; }, function (props) { return props.theme.colors.gray1000; }, function (props) { return props.theme.colors.placeholder; }, function (p) {
40
39
  return p.hasError && css(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n color: ", ";\n "], ["\n color: ", ";\n "])), function (p) { return p.theme.colors.error; });
@@ -1,14 +1,15 @@
1
1
  import React from "react";
2
- import { Record } from "../../../../../types";
2
+ import { FieldTypes, Record } from "../../../../../types";
3
+ export declare const parseValue: (fieldType: FieldTypes, value: any) => any;
3
4
  export declare const useValidationError: (fieldName: string, record: Record) => {
4
5
  validationError: any;
5
6
  };
6
- export declare const useSpreadsheetField: (name: any, record: Record) => {
7
+ export declare const useSpreadsheetField: (name: any, record: Record, fieldType: FieldTypes) => {
7
8
  value: any;
8
9
  setValue: React.Dispatch<any>;
10
+ validationError: any;
9
11
  };
10
- export declare const SpreadsheetField: ({ name, record, children }: {
11
- name: any;
12
- record: any;
12
+ export declare const SpreadsheetField: ({ validationError, children }: {
13
+ validationError: any;
13
14
  children: any;
14
15
  }) => JSX.Element;