fuse-importer 0.12.0 → 0.15.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 (188) hide show
  1. package/lib/esm/Importer/Footer.js +0 -1
  2. package/lib/esm/Importer/FuseApi.js +0 -1
  3. package/lib/esm/Importer/GlobalStyle.js +0 -1
  4. package/lib/esm/Importer/ImporterContextProvider.d.ts +5 -4
  5. package/lib/esm/Importer/ImporterContextProvider.js +17 -16
  6. package/lib/esm/Importer/{LoadFonts.d.ts → ImporterFonts.d.ts} +0 -0
  7. package/lib/esm/Importer/{LoadFonts.js → ImporterFonts.js} +0 -1
  8. package/lib/esm/Importer/Matcher/EnumFieldsMatchers/EnumFieldMatcher/index.js +20 -5
  9. package/lib/esm/Importer/Matcher/EnumFieldsMatchers/EnumFieldMatcher/tableColumns.js +6 -6
  10. package/lib/esm/Importer/Matcher/EnumFieldsMatchers/EnumFieldMatcherContext.js +0 -1
  11. package/lib/esm/Importer/Matcher/EnumFieldsMatchers/index.js +0 -1
  12. package/lib/esm/Importer/Matcher/HeaderMatcher/index.js +19 -5
  13. package/lib/esm/Importer/Matcher/HeaderMatcher/tableColumns.d.ts +0 -5
  14. package/lib/esm/Importer/Matcher/HeaderMatcher/tableColumns.js +7 -15
  15. package/lib/esm/Importer/Matcher/common/icons/index.js +0 -1
  16. package/lib/esm/Importer/Matcher/common/index.d.ts +4 -2
  17. package/lib/esm/Importer/Matcher/common/index.js +32 -3
  18. package/lib/esm/Importer/Matcher/common/types.js +0 -1
  19. package/lib/esm/Importer/Matcher/index.js +0 -1
  20. package/lib/esm/Importer/Review/AppResponseModal.js +1 -2
  21. package/lib/esm/Importer/Review/index.js +32 -23
  22. package/lib/esm/Importer/SpreadsheetReviewContextProvider.js +0 -1
  23. package/lib/esm/Importer/Stepper.js +5 -5
  24. package/lib/esm/Importer/TrialModeBanner.js +0 -1
  25. package/lib/esm/Importer/Uploader/DragAndDropImporter/ImporterDropzone.js +0 -1
  26. package/lib/esm/Importer/Uploader/DragAndDropImporter/backgrounds.js +0 -1
  27. package/lib/esm/Importer/Uploader/DragAndDropImporter/index.js +0 -1
  28. package/lib/esm/Importer/Uploader/HeadersPreview.js +2 -3
  29. package/lib/esm/Importer/Uploader/UploaderContextProvider.js +0 -1
  30. package/lib/esm/Importer/Uploader/index.js +0 -1
  31. package/lib/esm/Importer/common/AppLoading.js +0 -1
  32. package/lib/esm/Importer/common/Spreadsheet/GlobalStyle.js +0 -1
  33. package/lib/esm/Importer/common/Spreadsheet/SpreadsheetContextProvider.d.ts +4 -4
  34. package/lib/esm/Importer/common/Spreadsheet/SpreadsheetContextProvider.js +21 -25
  35. package/lib/esm/Importer/common/Spreadsheet/SpreadsheetRowNumbers.js +0 -1
  36. package/lib/esm/Importer/common/Spreadsheet/common/fields/SpeadsheetAutocomplete.js +5 -5
  37. package/lib/esm/Importer/common/Spreadsheet/common/fields/SpreadsheetInput.d.ts +12 -0
  38. package/lib/esm/Importer/common/Spreadsheet/common/fields/{SpreadsheetTextInput.js → SpreadsheetInput.js} +15 -5
  39. package/lib/esm/Importer/common/Spreadsheet/common/fields/index.js +0 -1
  40. package/lib/esm/Importer/common/Spreadsheet/common/index.js +17 -15
  41. package/lib/esm/Importer/common/Spreadsheet/index.d.ts +3 -3
  42. package/lib/esm/Importer/common/Spreadsheet/index.js +39 -31
  43. package/lib/esm/Importer/common/icons/index.js +0 -1
  44. package/lib/esm/Importer/common/index.d.ts +8 -0
  45. package/lib/esm/Importer/common/index.js +6 -1
  46. package/lib/esm/Importer/common/utils.d.ts +3 -2
  47. package/lib/esm/Importer/common/utils.js +21 -5
  48. package/lib/esm/Importer/index.d.ts +4 -4
  49. package/lib/esm/Importer/index.js +6 -7
  50. package/lib/esm/Importer/useCustomImporter.js +0 -1
  51. package/lib/esm/Importer/useFullscreenOverlay.js +0 -1
  52. package/lib/esm/api/index.js +0 -1
  53. package/lib/esm/api/responseHandlers.js +0 -1
  54. package/lib/esm/common/Modal.js +0 -1
  55. package/lib/esm/common/Spinner.js +0 -1
  56. package/lib/esm/common/Table/Pagination/icons.js +0 -1
  57. package/lib/esm/common/Table/Pagination/index.js +0 -1
  58. package/lib/esm/common/Table/TableDataProvider.js +0 -1
  59. package/lib/esm/common/Table/TableView/TableHeaders.d.ts +2 -1
  60. package/lib/esm/common/Table/TableView/TableHeaders.js +4 -5
  61. package/lib/esm/common/Table/TableView/TableRow.js +0 -1
  62. package/lib/esm/common/Table/TableView/common.d.ts +1 -1
  63. package/lib/esm/common/Table/TableView/common.js +1 -2
  64. package/lib/esm/common/Table/TableView/index.d.ts +2 -1
  65. package/lib/esm/common/Table/TableView/index.js +3 -8
  66. package/lib/esm/common/Table/icons.js +0 -1
  67. package/lib/esm/common/Table/index.js +0 -1
  68. package/lib/esm/common/Toast.js +0 -1
  69. package/lib/esm/common/TooltipProvider.js +8 -1
  70. package/lib/esm/common/buttons.js +0 -1
  71. package/lib/esm/common/icons/index.js +0 -1
  72. package/lib/esm/common/index.d.ts +0 -1
  73. package/lib/esm/common/index.js +7 -10
  74. package/lib/esm/common/inputs/Autocomplete.d.ts +3 -2
  75. package/lib/esm/common/inputs/Autocomplete.js +19 -11
  76. package/lib/esm/common/inputs/SelectMenu.js +0 -1
  77. package/lib/esm/common/inputs/TextInput.d.ts +1 -0
  78. package/lib/esm/common/inputs/TextInput.js +2 -3
  79. package/lib/esm/common/inputs/index.js +0 -1
  80. package/lib/esm/common/logo.js +0 -1
  81. package/lib/esm/hooks/index.js +0 -1
  82. package/lib/esm/index.d.ts +3 -2
  83. package/lib/esm/index.js +15 -8
  84. package/lib/esm/styled/index.js +0 -1
  85. package/lib/esm/styled/theme/animations.js +0 -1
  86. package/lib/esm/styled/theme/colorPalette.js +0 -1
  87. package/lib/esm/styled/theme/debugCss.js +0 -1
  88. package/lib/esm/styled/theme/dimensionsCss.js +0 -1
  89. package/lib/esm/styled/theme/fontCss.js +0 -1
  90. package/lib/esm/styled/theme/globalCss.js +0 -1
  91. package/lib/esm/styled/theme/index.js +0 -1
  92. package/lib/esm/styled/theme/layoutCss.js +0 -1
  93. package/lib/esm/styled/theme/mediaQueries.js +0 -1
  94. package/lib/esm/styled/theme/positionCss.js +0 -1
  95. package/lib/esm/styled/theme/textCss.js +0 -1
  96. package/lib/esm/styled/theme/textStyles.js +0 -1
  97. package/lib/esm/styled/themeType.js +0 -1
  98. package/lib/esm/styled/utils.d.ts +2 -0
  99. package/lib/esm/styled/utils.js +0 -1
  100. package/lib/esm/types.d.ts +16 -4
  101. package/lib/esm/types.js +0 -1
  102. package/lib/esm/utils/index.js +0 -1
  103. package/lib/main.js +1 -1
  104. package/package.json +2 -1
  105. package/lib/esm/Importer/Footer.js.map +0 -1
  106. package/lib/esm/Importer/FuseApi.js.map +0 -1
  107. package/lib/esm/Importer/GlobalStyle.js.map +0 -1
  108. package/lib/esm/Importer/ImporterContextProvider.js.map +0 -1
  109. package/lib/esm/Importer/LoadFonts.js.map +0 -1
  110. package/lib/esm/Importer/Matcher/EnumFieldsMatchers/EnumFieldMatcher/index.js.map +0 -1
  111. package/lib/esm/Importer/Matcher/EnumFieldsMatchers/EnumFieldMatcher/tableColumns.js.map +0 -1
  112. package/lib/esm/Importer/Matcher/EnumFieldsMatchers/EnumFieldMatcherContext.js.map +0 -1
  113. package/lib/esm/Importer/Matcher/EnumFieldsMatchers/index.js.map +0 -1
  114. package/lib/esm/Importer/Matcher/HeaderMatcher/index.js.map +0 -1
  115. package/lib/esm/Importer/Matcher/HeaderMatcher/tableColumns.js.map +0 -1
  116. package/lib/esm/Importer/Matcher/common/icons/index.js.map +0 -1
  117. package/lib/esm/Importer/Matcher/common/index.js.map +0 -1
  118. package/lib/esm/Importer/Matcher/common/types.js.map +0 -1
  119. package/lib/esm/Importer/Matcher/index.js.map +0 -1
  120. package/lib/esm/Importer/Review/AppResponseModal.js.map +0 -1
  121. package/lib/esm/Importer/Review/index.js.map +0 -1
  122. package/lib/esm/Importer/SpreadsheetReviewContextProvider.js.map +0 -1
  123. package/lib/esm/Importer/Stepper.js.map +0 -1
  124. package/lib/esm/Importer/TrialModeBanner.js.map +0 -1
  125. package/lib/esm/Importer/Uploader/DragAndDropImporter/ImporterDropzone.js.map +0 -1
  126. package/lib/esm/Importer/Uploader/DragAndDropImporter/backgrounds.js.map +0 -1
  127. package/lib/esm/Importer/Uploader/DragAndDropImporter/index.js.map +0 -1
  128. package/lib/esm/Importer/Uploader/HeadersPreview.js.map +0 -1
  129. package/lib/esm/Importer/Uploader/UploaderContextProvider.js.map +0 -1
  130. package/lib/esm/Importer/Uploader/index.js.map +0 -1
  131. package/lib/esm/Importer/common/AppLoading.js.map +0 -1
  132. package/lib/esm/Importer/common/Spreadsheet/GlobalStyle.js.map +0 -1
  133. package/lib/esm/Importer/common/Spreadsheet/SpreadsheetContextProvider.js.map +0 -1
  134. package/lib/esm/Importer/common/Spreadsheet/SpreadsheetRowNumbers.js.map +0 -1
  135. package/lib/esm/Importer/common/Spreadsheet/common/fields/SpeadsheetAutocomplete.js.map +0 -1
  136. package/lib/esm/Importer/common/Spreadsheet/common/fields/SpreadsheetTextInput.d.ts +0 -13
  137. package/lib/esm/Importer/common/Spreadsheet/common/fields/SpreadsheetTextInput.js.map +0 -1
  138. package/lib/esm/Importer/common/Spreadsheet/common/fields/index.js.map +0 -1
  139. package/lib/esm/Importer/common/Spreadsheet/common/index.js.map +0 -1
  140. package/lib/esm/Importer/common/Spreadsheet/index.js.map +0 -1
  141. package/lib/esm/Importer/common/icons/index.js.map +0 -1
  142. package/lib/esm/Importer/common/index.js.map +0 -1
  143. package/lib/esm/Importer/common/utils.js.map +0 -1
  144. package/lib/esm/Importer/index.js.map +0 -1
  145. package/lib/esm/Importer/useCustomImporter.js.map +0 -1
  146. package/lib/esm/Importer/useFullscreenOverlay.js.map +0 -1
  147. package/lib/esm/api/index.js.map +0 -1
  148. package/lib/esm/api/responseHandlers.js.map +0 -1
  149. package/lib/esm/common/Modal.js.map +0 -1
  150. package/lib/esm/common/Spinner.js.map +0 -1
  151. package/lib/esm/common/Table/Pagination/icons.js.map +0 -1
  152. package/lib/esm/common/Table/Pagination/index.js.map +0 -1
  153. package/lib/esm/common/Table/TableDataProvider.js.map +0 -1
  154. package/lib/esm/common/Table/TableView/TableHeaders.js.map +0 -1
  155. package/lib/esm/common/Table/TableView/TableRow.js.map +0 -1
  156. package/lib/esm/common/Table/TableView/common.js.map +0 -1
  157. package/lib/esm/common/Table/TableView/index.js.map +0 -1
  158. package/lib/esm/common/Table/icons.js.map +0 -1
  159. package/lib/esm/common/Table/index.js.map +0 -1
  160. package/lib/esm/common/Toast.js.map +0 -1
  161. package/lib/esm/common/TooltipProvider.js.map +0 -1
  162. package/lib/esm/common/buttons.js.map +0 -1
  163. package/lib/esm/common/icons/index.js.map +0 -1
  164. package/lib/esm/common/index.js.map +0 -1
  165. package/lib/esm/common/inputs/Autocomplete.js.map +0 -1
  166. package/lib/esm/common/inputs/SelectMenu.js.map +0 -1
  167. package/lib/esm/common/inputs/TextInput.js.map +0 -1
  168. package/lib/esm/common/inputs/index.js.map +0 -1
  169. package/lib/esm/common/logo.js.map +0 -1
  170. package/lib/esm/hooks/index.js.map +0 -1
  171. package/lib/esm/index.js.map +0 -1
  172. package/lib/esm/styled/index.js.map +0 -1
  173. package/lib/esm/styled/theme/animations.js.map +0 -1
  174. package/lib/esm/styled/theme/colorPalette.js.map +0 -1
  175. package/lib/esm/styled/theme/debugCss.js.map +0 -1
  176. package/lib/esm/styled/theme/dimensionsCss.js.map +0 -1
  177. package/lib/esm/styled/theme/fontCss.js.map +0 -1
  178. package/lib/esm/styled/theme/globalCss.js.map +0 -1
  179. package/lib/esm/styled/theme/index.js.map +0 -1
  180. package/lib/esm/styled/theme/layoutCss.js.map +0 -1
  181. package/lib/esm/styled/theme/mediaQueries.js.map +0 -1
  182. package/lib/esm/styled/theme/positionCss.js.map +0 -1
  183. package/lib/esm/styled/theme/textCss.js.map +0 -1
  184. package/lib/esm/styled/theme/textStyles.js.map +0 -1
  185. package/lib/esm/styled/themeType.js.map +0 -1
  186. package/lib/esm/styled/utils.js.map +0 -1
  187. package/lib/esm/types.js.map +0 -1
  188. package/lib/esm/utils/index.js.map +0 -1
@@ -21,4 +21,3 @@ export var TrialModeBanner = function () {
21
21
  } }, { children: "Select plan" }), void 0)] }), void 0)) }, void 0));
22
22
  };
23
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));
24
- //# sourceMappingURL=TrialModeBanner.js.map
@@ -103,4 +103,3 @@ var ImporterDropzone = function () {
103
103
  };
104
104
  export { ImporterDropzone };
105
105
  var templateObject_1, templateObject_2, templateObject_3, templateObject_4, templateObject_5;
106
- //# sourceMappingURL=ImporterDropzone.js.map
@@ -12,4 +12,3 @@ var __assign = (this && this.__assign) || function () {
12
12
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
13
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
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));
15
- //# sourceMappingURL=backgrounds.js.map
@@ -76,4 +76,3 @@ var DragAndDropImporter = function () {
76
76
  };
77
77
  export { DragAndDropImporter };
78
78
  var templateObject_1, templateObject_2, templateObject_3, templateObject_4;
79
- //# sourceMappingURL=index.js.map
@@ -36,7 +36,7 @@ var HeaderButtons = function () {
36
36
  var onClick = function () {
37
37
  setCurrentStepIndex(1);
38
38
  };
39
- return (_jsxs(HeaderButtonsWrapper, __assign({ dflex: true, spaceBetween: true, mb: 24 }, { 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));
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
40
  };
41
41
  var HeadersPreview = function () {
42
42
  var uploadedData = useImporterContext().uploadedData;
@@ -72,8 +72,7 @@ var HeadersPreview = function () {
72
72
  isRequired: false,
73
73
  };
74
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, mt: 30, 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));
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));
76
76
  };
77
77
  export default HeadersPreview;
78
78
  var templateObject_1;
79
- //# sourceMappingURL=HeadersPreview.js.map
@@ -25,4 +25,3 @@ export var UploaderContextProvider = function (_a) {
25
25
  return (_jsx(UploaderContext.Provider, __assign({ value: value }, { children: children }), void 0));
26
26
  };
27
27
  export var useUploaderContext = function () { return useContext(UploaderContext); };
28
- //# sourceMappingURL=UploaderContextProvider.js.map
@@ -11,4 +11,3 @@ var Uploader = function () {
11
11
  return (_jsx(UploaderContextProvider, { children: _jsx(UploaderWithContext, {}, void 0) }, void 0));
12
12
  };
13
13
  export { Uploader };
14
- //# sourceMappingURL=index.js.map
@@ -22,4 +22,3 @@ var ModalContainer = styled(Div)(templateObject_2 || (templateObject_2 = __makeT
22
22
  var LoaderContainer = styled(ModalContainer)(templateObject_3 || (templateObject_3 = __makeTemplateObject(["\n pointer-events: none;\n"], ["\n pointer-events: none;\n"])));
23
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)); };
24
24
  var templateObject_1, templateObject_2, templateObject_3;
25
- //# sourceMappingURL=AppLoading.js.map
@@ -7,4 +7,3 @@ import { createGlobalStyle } from "styled-components";
7
7
  var GlobalStyle = createGlobalStyle(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n ", ";\n"], ["\n ", ";\n"])), function (p) { return p.theme.css.scrollbarDark; });
8
8
  export default GlobalStyle;
9
9
  var templateObject_1;
10
- //# sourceMappingURL=GlobalStyle.js.map
@@ -1,7 +1,7 @@
1
1
  import React from "react";
2
- import { AppResponse } from "../../..";
2
+ import { AppResponse, SpreadsheetOptions } from "../../..";
3
3
  import { BatchValidationErrors, Field, OnValidateBatch, OnValidateRecord, Record } from "../../../types";
4
- export declare const getBatchErrors: (records: any, onValidateRecord: any) => Promise<any>;
4
+ export declare const getBatchErrors: (records: Record[], onValidateRecord: OnValidateRecord) => Promise<BatchValidationErrors>;
5
5
  declare type State = {
6
6
  rowWidth?: number;
7
7
  data: Record[];
@@ -33,13 +33,13 @@ declare type Props = {
33
33
  appResponse?: AppResponse;
34
34
  onValidateRecord: OnValidateRecord;
35
35
  onValidateBatch?: OnValidateBatch;
36
- validationBatchSize?: number;
37
36
  children: JSX.Element;
38
37
  fields: Field[];
38
+ options: SpreadsheetOptions;
39
39
  highlightFirstRow: boolean;
40
40
  submittedData?: Record[];
41
41
  setReviewedData?: React.Dispatch<React.SetStateAction<Record[]>>;
42
42
  };
43
- export declare const SpreadsheetContextProvider: ({ initialData, rowWidth, onValidateRecord, onValidateBatch, appResponse, fields, isReadOnly, validationBatchSize, highlightFirstRow, submittedData, setReviewedData, children, }: Props) => JSX.Element;
43
+ export declare const SpreadsheetContextProvider: ({ initialData, rowWidth, onValidateRecord, onValidateBatch, appResponse, fields, options, isReadOnly, highlightFirstRow, submittedData, setReviewedData, children, }: Props) => JSX.Element;
44
44
  export declare const useSpreadsheetContext: () => State;
45
45
  export {};
@@ -56,45 +56,38 @@ var __spreadArray = (this && this.__spreadArray) || function (to, from, pack) {
56
56
  };
57
57
  import { jsx as _jsx } from "react/jsx-runtime";
58
58
  import { createContext, useContext, useEffect, useState } from "react";
59
+ import { formatBatchErrors } from "../../..";
59
60
  import { getRecordErrors, getRenderedRecordWithErrors, recordIsEmpty, } from "./common";
60
61
  var MINIMUM_ROW_COUNT = 20;
61
- // time in ms
62
- var batchValidationIdleTime = 500;
63
62
  var getRowId = function (id) { return "r".concat(id); };
64
63
  export var getBatchErrors = function (records, onValidateRecord) { return __awaiter(void 0, void 0, void 0, function () {
65
- var getRecordError, errors;
64
+ var batchErrors;
66
65
  return __generator(this, function (_a) {
67
66
  switch (_a.label) {
68
- case 0:
69
- getRecordError = function (record) { return __awaiter(void 0, void 0, void 0, function () {
67
+ case 0: return [4 /*yield*/, Promise.all(records.map(function (record) { return __awaiter(void 0, void 0, void 0, function () {
70
68
  var _a;
71
69
  return __generator(this, function (_b) {
72
70
  switch (_b.label) {
73
71
  case 0:
74
72
  _a = {
75
- id: record._meta.id
73
+ rowId: record._meta.id
76
74
  };
77
75
  return [4 /*yield*/, onValidateRecord(record)];
78
- case 1: return [2 /*return*/, (_a.error = _b.sent(),
76
+ case 1: return [2 /*return*/, (_a.errors = _b.sent(),
79
77
  _a)];
80
78
  }
81
79
  });
82
- }); };
83
- return [4 /*yield*/, Promise.all(records.map(function (r) { return getRecordError(r); }))];
80
+ }); }))];
84
81
  case 1:
85
- errors = _a.sent();
86
- return [2 /*return*/, errors.reduce(function (prevState, curr) {
87
- var newState = __assign({}, prevState);
88
- newState[curr.id] = curr.error;
89
- return newState;
90
- }, {})];
82
+ batchErrors = _a.sent();
83
+ return [2 /*return*/, formatBatchErrors(batchErrors)];
91
84
  }
92
85
  });
93
86
  }); };
94
87
  var SpreadsheetContext = createContext({});
95
88
  var sleep = function (n) { return new Promise(function (resolve) { return setTimeout(resolve, n); }); };
96
89
  export var SpreadsheetContextProvider = function (_a) {
97
- var initialData = _a.initialData, _b = _a.rowWidth, rowWidth = _b === void 0 ? 1 : _b, _c = _a.onValidateRecord, onValidateRecord = _c === void 0 ? null : _c, _d = _a.onValidateBatch, onValidateBatch = _d === void 0 ? null : _d, appResponse = _a.appResponse, fields = _a.fields, isReadOnly = _a.isReadOnly, validationBatchSize = _a.validationBatchSize, highlightFirstRow = _a.highlightFirstRow, submittedData = _a.submittedData, setReviewedData = _a.setReviewedData, children = _a.children;
90
+ var initialData = _a.initialData, _b = _a.rowWidth, rowWidth = _b === void 0 ? 1 : _b, _c = _a.onValidateRecord, onValidateRecord = _c === void 0 ? null : _c, _d = _a.onValidateBatch, onValidateBatch = _d === void 0 ? null : _d, appResponse = _a.appResponse, fields = _a.fields, options = _a.options, isReadOnly = _a.isReadOnly, highlightFirstRow = _a.highlightFirstRow, submittedData = _a.submittedData, setReviewedData = _a.setReviewedData, children = _a.children;
98
91
  var _e = useState(initialData.map(function (d, i) { return (__assign(__assign({}, d), { _meta: { id: getRowId(i), rowIndex: i } })); })), data = _e[0], setData = _e[1];
99
92
  var _f = useState(false), isLoading = _f[0], setIsLoading = _f[1];
100
93
  var _g = useState(null), sortByFieldErrors = _g[0], setSortByFieldErrors = _g[1];
@@ -109,8 +102,9 @@ export var SpreadsheetContextProvider = function (_a) {
109
102
  }), columnErrorCounts = _l.columnErrorCounts, totalErrors = _l.totalErrors, isValidationComplete = _l.isValidationComplete;
110
103
  useEffect(function () {
111
104
  var init = function () { return __awaiter(void 0, void 0, void 0, function () {
112
- var addEmtpyRows, validateInBatches;
105
+ var batchValidationDelayMs, batchValidationSize, addEmtpyRows, validateInBatches;
113
106
  return __generator(this, function (_a) {
107
+ batchValidationDelayMs = options.batchValidationDelayMs, batchValidationSize = options.batchValidationSize;
114
108
  addEmtpyRows = function () {
115
109
  var newData = __spreadArray([], data, true);
116
110
  var emptyRecord = fields.reduce(function (obj, f) {
@@ -128,16 +122,18 @@ export var SpreadsheetContextProvider = function (_a) {
128
122
  if (data.length < MINIMUM_ROW_COUNT)
129
123
  addEmtpyRows();
130
124
  validateInBatches = function () { return __awaiter(void 0, void 0, void 0, function () {
131
- var validationErrors, batchSize, idx, batch, errors;
125
+ var validationErrors, batchSize, batchCount, batchIdx, idx, batch, errors, validationPercentage;
132
126
  return __generator(this, function (_a) {
133
127
  switch (_a.label) {
134
128
  case 0:
135
129
  validationErrors = {};
136
- batchSize = Math.min(validationBatchSize, data.length) || data.length;
137
- idx = 0;
130
+ batchSize = Math.min(Math.floor(batchValidationSize), data.length) || data.length;
131
+ batchCount = Math.ceil(data.length / batchSize);
132
+ batchIdx = 0;
138
133
  _a.label = 1;
139
134
  case 1:
140
- if (!(idx < data.length)) return [3 /*break*/, 5];
135
+ if (!(batchIdx < batchCount)) return [3 /*break*/, 5];
136
+ idx = batchIdx * batchSize;
141
137
  batch = data.slice(idx, idx + batchSize);
142
138
  return [4 /*yield*/, (onValidateBatch
143
139
  ? onValidateBatch(batch)
@@ -146,15 +142,16 @@ export var SpreadsheetContextProvider = function (_a) {
146
142
  errors = _a.sent();
147
143
  validationErrors = __assign(__assign({}, validationErrors), errors);
148
144
  // unblocks main thread for rendering ui
149
- return [4 /*yield*/, sleep(batchValidationIdleTime)];
145
+ return [4 /*yield*/, sleep(batchValidationDelayMs)];
150
146
  case 3:
151
147
  // unblocks main thread for rendering ui
152
148
  _a.sent();
153
- setBatchValidationPercentage(Math.floor(((idx + batchSize) / data.length) * 100));
149
+ validationPercentage = (Math.min(idx + batchSize, data.length) / data.length) * 100;
150
+ setBatchValidationPercentage(Math.floor(validationPercentage));
154
151
  setBatchValidationErrors(validationErrors);
155
152
  _a.label = 4;
156
153
  case 4:
157
- idx += batchSize;
154
+ batchIdx++;
158
155
  return [3 /*break*/, 1];
159
156
  case 5: return [2 /*return*/];
160
157
  }
@@ -288,4 +285,3 @@ var useValidationState = function (_a) {
288
285
  return { columnErrorCounts: columnErrorCounts, totalErrors: totalErrors, isValidationComplete: isValidationComplete };
289
286
  };
290
287
  export var useSpreadsheetContext = function () { return useContext(SpreadsheetContext); };
291
- //# sourceMappingURL=SpreadsheetContextProvider.js.map
@@ -53,4 +53,3 @@ var RowNumber = styled(Div)(templateObject_2 || (templateObject_2 = __makeTempla
53
53
  var SpreadsheetRowNumbersHeader = styled(Div)(templateObject_3 || (templateObject_3 = __makeTemplateObject(["\n height: ", "px;\n border-top-left-radius: 8px;\n background-color: ", ";\n box-shadow: inset 0 -1px 0px ", ";\n"], ["\n height: ", "px;\n border-top-left-radius: 8px;\n background-color: ", ";\n box-shadow: inset 0 -1px 0px ", ";\n"])), spreadsheetRowHeightPx, function (p) { return p.theme.colors.tableHeader; }, function (p) { return p.theme.colors.gray300; });
54
54
  var SpreadsheetRowNumbersContainer = styled(Div)(templateObject_4 || (templateObject_4 = __makeTemplateObject(["\n width: ", "px;\n border-top-left-radius: 8px;\n border-right: solid 1px ", ";\n .ReactVirtualized__Grid {\n /* Track */\n ::-webkit-scrollbar-track {\n background-color: ", " !important;\n }\n }\n"], ["\n width: ", "px;\n border-top-left-radius: 8px;\n border-right: solid 1px ", ";\n .ReactVirtualized__Grid {\n /* Track */\n ::-webkit-scrollbar-track {\n background-color: ", " !important;\n }\n }\n"])), SPREADSHEET_ROW_NUMBERS_WIDTH, function (p) { return p.theme.colors.gray300; }, function (p) { return p.theme.colors.tableHeader; });
55
55
  var templateObject_1, templateObject_2, templateObject_3, templateObject_4;
56
- //# sourceMappingURL=SpreadsheetRowNumbers.js.map
@@ -19,19 +19,19 @@ import { SpreadsheetField, useSpreadsheetField, useValidationError } from ".";
19
19
  import { spreadsheetRowHeightPx } from "..";
20
20
  import { Autocomplete as AutocompleteBase } from "../../../../../common/inputs/Autocomplete";
21
21
  import { SelectMenuDiv, SelectMenuScrollArea, } from "../../../../../common/inputs/SelectMenu";
22
- import { HTMLInput } from "../../../../../common/inputs/TextInput";
22
+ import { HTMLInput, TextInputIcon, } from "../../../../../common/inputs/TextInput";
23
23
  import { useSpreadsheetContext } from "../../SpreadsheetContextProvider";
24
- var Autocomplete = styled(AutocompleteBase)(templateObject_3 || (templateObject_3 = __makeTemplateObject(["\n ", " {\n border: none;\n border-radius: 0;\n margin: 0;\n background: transparent;\n height: ", "px;\n padding: 0 12px;\n\n ", "\n\n ::placeholder {\n ", "\n }\n :focus {\n border: none;\n box-shadow: none;\n }\n }\n ", " {\n border-radius: 7px;\n }\n ", " {\n padding: 4px;\n }\n"], ["\n ", " {\n border: none;\n border-radius: 0;\n margin: 0;\n background: transparent;\n height: ", "px;\n padding: 0 12px;\n\n ", "\n\n ::placeholder {\n ", "\n }\n :focus {\n border: none;\n box-shadow: none;\n }\n }\n ", " {\n border-radius: 7px;\n }\n ", " {\n padding: 4px;\n }\n"])), HTMLInput, spreadsheetRowHeightPx - 5, function (p) {
24
+ var Autocomplete = styled(AutocompleteBase)(templateObject_3 || (templateObject_3 = __makeTemplateObject(["\n ", " {\n border: none;\n border-radius: 0;\n margin: 0;\n background: transparent;\n height: ", "px;\n padding: 0 12px;\n\n ", "\n\n ::placeholder {\n ", "\n }\n :focus {\n border: none;\n box-shadow: none;\n }\n }\n ", " {\n right: 6px;\n }\n ", " {\n border-radius: 7px;\n }\n ", " {\n padding: 4px;\n }\n"], ["\n ", " {\n border: none;\n border-radius: 0;\n margin: 0;\n background: transparent;\n height: ", "px;\n padding: 0 12px;\n\n ", "\n\n ::placeholder {\n ", "\n }\n :focus {\n border: none;\n box-shadow: none;\n }\n }\n ", " {\n right: 6px;\n }\n ", " {\n border-radius: 7px;\n }\n ", " {\n padding: 4px;\n }\n"])), HTMLInput, spreadsheetRowHeightPx - 5, function (p) {
25
25
  return p.hasError && css(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n color: ", ";\n "], ["\n color: ", ";\n "])), function (p) { return p.theme.colors.error; });
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
- }, SelectMenuDiv, SelectMenuScrollArea);
28
+ }, TextInputIcon, SelectMenuDiv, SelectMenuScrollArea);
29
29
  export var SpreadsheetAutocomplete = function (_a) {
30
30
  var name = _a.name, record = _a.record, options = _a.options, _b = _a.isInputDisabled, isInputDisabled = _b === void 0 ? false : _b;
31
31
  var validationError = useValidationError(name, record).validationError;
32
32
  var _c = useSpreadsheetField(name, record), value = _c.value, setValue = _c.setValue;
33
33
  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, onChange: function (v) { return setValue(v); } }, void 0) }), void 0));
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));
35
35
  };
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));
36
37
  var templateObject_1, templateObject_2, templateObject_3;
37
- //# sourceMappingURL=SpeadsheetAutocomplete.js.map
@@ -0,0 +1,12 @@
1
+ /// <reference types="react" />
2
+ import { HTMLInputCSSProps } from "../../../../../styled/utils";
3
+ import { Record } from "../../../../../types";
4
+ declare type SpreadsheetTextInputArgs = {
5
+ name: string;
6
+ record: Record;
7
+ } & HTMLInputCSSProps;
8
+ export declare const SpreadsheetInput: ({ name, record, ...props }: SpreadsheetTextInputArgs) => JSX.Element;
9
+ export declare const Input: import("styled-components").StyledComponent<"input", import("styled-components").DefaultTheme, {
10
+ hasError: boolean;
11
+ } & import("../../../../../styled/utils").HTMLInputProps & import("../../../../../styled/utils").CSSProps, never>;
12
+ export {};
@@ -13,20 +13,30 @@ var __assign = (this && this.__assign) || function () {
13
13
  };
14
14
  return __assign.apply(this, arguments);
15
15
  };
16
+ var __rest = (this && this.__rest) || function (s, e) {
17
+ var t = {};
18
+ for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
19
+ t[p] = s[p];
20
+ if (s != null && typeof Object.getOwnPropertySymbols === "function")
21
+ for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
22
+ if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
23
+ t[p[i]] = s[p[i]];
24
+ }
25
+ return t;
26
+ };
16
27
  import { jsx as _jsx } from "react/jsx-runtime";
17
28
  import styled, { css } from "styled-components";
18
29
  import { SpreadsheetField, useSpreadsheetField, useValidationError } from ".";
19
- export var SpreadsheetTextInput = function (_a) {
20
- var name = _a.name, record = _a.record, type = _a.type;
30
+ export var SpreadsheetInput = function (_a) {
31
+ var name = _a.name, record = _a.record, props = __rest(_a, ["name", "record"]);
21
32
  var validationError = useValidationError(name, record).validationError;
22
33
  var _b = useSpreadsheetField(name, record), value = _b.value, setValue = _b.setValue;
23
- return (_jsx(SpreadsheetField, __assign({}, { name: name, record: record }, { children: _jsx(Input, { type: type, hasError: !!validationError, value: value || "", onChange: function (_a) {
34
+ return (_jsx(SpreadsheetField, __assign({}, { name: name, record: record }, { children: _jsx(Input, __assign({ hasError: !!validationError, value: value || "", onChange: function (_a) {
24
35
  var value = _a.target.value;
25
36
  return setValue(value);
26
- } }, void 0) }), void 0));
37
+ } }, props), void 0) }), void 0));
27
38
  };
28
39
  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) {
29
40
  return p.hasError && css(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n color: ", ";\n "], ["\n color: ", ";\n "])), function (p) { return p.theme.colors.error; });
30
41
  });
31
42
  var templateObject_1, templateObject_2;
32
- //# sourceMappingURL=SpreadsheetTextInput.js.map
@@ -146,4 +146,3 @@ export var SpreadsheetField = function (_a) {
146
146
  return (_jsx(Wrapper, __assign({ dim: "100%", isLoading: isLoading }, { children: _jsx(TooltipProvider, __assign({ tooltip: validationError }, { children: _jsx(Div, __assign({ dim: "100%" }, { children: _jsx(ContentContainer, __assign({ hasError: !!validationError, isReadOnly: isReadOnly }, { children: children }), void 0) }), void 0) }), void 0) }), void 0));
147
147
  };
148
148
  var templateObject_1, templateObject_2, templateObject_3, templateObject_4, templateObject_5;
149
- //# sourceMappingURL=index.js.map
@@ -12,8 +12,14 @@ var __assign = (this && this.__assign) || function () {
12
12
  import { FieldTypes, } from "../../../../types";
13
13
  export var spreadsheetRowHeightPx = 40;
14
14
  export var spreadsheetHeaderHeightPx = 40;
15
+ var isEmpty = function (value) {
16
+ return (value === undefined ||
17
+ value === null ||
18
+ (typeof value === "object" && Object.keys(value).length === 0) ||
19
+ (typeof value === "string" && value.trim().length === 0));
20
+ };
15
21
  export var recordIsEmpty = function (record, fields) {
16
- return fields.reduce(function (isEmptyRecord, f) { return isEmptyRecord && !record[f.name]; }, true);
22
+ return fields.reduce(function (isEmptyRecord, f) { return isEmptyRecord && isEmpty(record[f.name]); }, true);
17
23
  };
18
24
  export var getRenderedRecordWithErrors = function (_a) {
19
25
  var record = _a.record, validationErrors = _a.validationErrors;
@@ -23,23 +29,20 @@ export var getRecordErrors = function (_a) {
23
29
  var record = _a.record, fields = _a.fields, batchValidationErrors = _a.batchValidationErrors, submittedData = _a.submittedData;
24
30
  var submittedRecord = submittedData === null || submittedData === void 0 ? void 0 : submittedData.find(function (r) { return r._meta.id === record._meta.id; });
25
31
  var isEmail = function (value) {
26
- var emailRegex = /^[\w-\.]+@([\w-]+\.)+[\w-]{2,4}$/;
27
- return Boolean(value.match(emailRegex));
28
- };
29
- var isEmptyString = function (string) {
30
- return string.replace(/\s/g, "") === "";
32
+ var emailRegex = /^(([^<>()\[\]\\.,;:\s@"]+(\.[^<>()\[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/;
33
+ return emailRegex.test(value);
31
34
  };
32
35
  var recordHasData = !recordIsEmpty(record, fields);
33
36
  if (recordHasData) {
34
- var recordIsRequiredErrors = fields.reduce(function (errors, field) {
37
+ var recordTemplateValidationErrors = fields.reduce(function (errors, field) {
35
38
  var newErrors = __assign({}, errors);
36
39
  var fieldValue = record[field.name];
37
- if (field.isRequired && !fieldValue)
38
- newErrors[field.name] = "".concat(field.label, " is required");
39
- if (FieldTypes.email === field.type &&
40
- !isEmptyString(fieldValue) &&
41
- !isEmail(fieldValue)) {
42
- newErrors[field.name] = "Must be an email";
40
+ if (isEmpty(fieldValue)) {
41
+ if (field.isRequired)
42
+ newErrors[field.name] = "".concat(field.label, " is required");
43
+ }
44
+ else if (field.type === FieldTypes.email && !isEmail(fieldValue)) {
45
+ newErrors[field.name] = "".concat(field.label, " is not a valid email");
43
46
  }
44
47
  return newErrors;
45
48
  }, {});
@@ -61,9 +64,8 @@ export var getRecordErrors = function (_a) {
61
64
  return newErrors;
62
65
  }, {});
63
66
  }
64
- var recordErrors = __assign(__assign(__assign({}, recordValidationErrors), recordIsRequiredErrors), appValidationErrors);
67
+ var recordErrors = __assign(__assign(__assign({}, recordValidationErrors), recordTemplateValidationErrors), appValidationErrors);
65
68
  return recordErrors;
66
69
  }
67
70
  return {};
68
71
  };
69
- //# sourceMappingURL=index.js.map
@@ -1,18 +1,18 @@
1
1
  import React from "react";
2
2
  import { AppResponse } from "../../..";
3
- import { Field, OnValidateBatch, OnValidateRecord, Record } from "../../../types";
3
+ import { Field, OnValidateBatch, OnValidateRecord, Record, SpreadsheetOptions } from "../../../types";
4
4
  export declare type SpreadsheetProps = {
5
5
  initialData: any[];
6
6
  rowWidth?: number;
7
7
  appResponse?: AppResponse;
8
8
  isReadOnly?: boolean;
9
- validationBatchSize?: number;
10
9
  onValidateRecord?: OnValidateRecord;
11
10
  onValidateBatch?: OnValidateBatch;
12
11
  fields?: Field[];
13
12
  submittedData?: Record[];
14
13
  highlightFirstRow?: boolean;
14
+ options?: SpreadsheetOptions;
15
15
  setReviewedData?: React.Dispatch<React.SetStateAction<Record[]>>;
16
16
  };
17
- declare const Spreadsheet: ({ isReadOnly, initialData, rowWidth, fields, appResponse, validationBatchSize, onValidateRecord, submittedData, setReviewedData, onValidateBatch, highlightFirstRow, }: SpreadsheetProps) => JSX.Element;
17
+ declare const Spreadsheet: ({ isReadOnly, initialData, rowWidth, fields, appResponse, options, onValidateRecord, submittedData, setReviewedData, onValidateBatch, highlightFirstRow, }: SpreadsheetProps) => JSX.Element;
18
18
  export { Spreadsheet };
@@ -52,27 +52,28 @@ var __generator = (this && this.__generator) || function (thisArg, body) {
52
52
  import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
53
53
  import { useEffect, useMemo, useRef, useState } from "react";
54
54
  import styled, { css } from "styled-components";
55
- import { TableView as TableViewBase, TableViewCellContainer, TableViewHeader, TableViewRow, } from "../../../common/Table/TableView";
55
+ import { getTableHeight } from "..";
56
+ import { TooltipProvider } from "../../../common";
57
+ import { TableView as TableViewBase, TableViewCellContainer, TableViewRow, } from "../../../common/Table/TableView";
56
58
  import { colors } from "../../../styled/theme/colorPalette";
57
59
  import { Div } from "../../../styled/utils";
58
60
  import { FieldTypes, } from "../../../types";
59
- import GlobalStyle from "./GlobalStyle";
60
61
  import { useSpreadsheetReviewContext } from "../../SpreadsheetReviewContextProvider";
61
62
  import { getUnsubmittedData } from "../utils";
62
63
  import { spreadsheetHeaderHeightPx, spreadsheetRowHeightPx } from "./common";
63
64
  import { SpreadsheetAutocomplete } from "./common/fields/SpeadsheetAutocomplete";
64
- import { SpreadsheetTextInput } from "./common/fields/SpreadsheetTextInput";
65
+ import { SpreadsheetInput } from "./common/fields/SpreadsheetInput";
66
+ import GlobalStyle from "./GlobalStyle";
65
67
  import { SpreadsheetContextProvider, useSpreadsheetContext, } from "./SpreadsheetContextProvider";
66
68
  import { SpreadsheetRowNumbers } from "./SpreadsheetRowNumbers";
67
- var SPREADSHEET_HEIGHT = 540;
68
69
  var SpreadSheetWrapper = styled(Div)(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n border: solid 1px ", ";\n border-radius: 8px;\n background: ", ";\n overflow: hidden !important;\n"], ["\n border: solid 1px ", ";\n border-radius: 8px;\n background: ", ";\n overflow: hidden !important;\n"])), function (p) { return p.theme.colors.gray300; }, function (p) { return p.theme.colors.white; });
69
- var TableView = styled(TableViewBase)(templateObject_2 || (templateObject_2 = __makeTemplateObject(["\n width: 100%;\n border: none;\n border-top-left-radius: 0;\n border-bottom-left-radius: 0;\n overflow: hidden;\n ", " {\n border-bottom: none;\n height: 40px;\n }\n ", " {\n padding: 0;\n border-right: 1px solid ", ";\n }\n ", " {\n background: ", ";\n height: ", "px;\n box-shadow: inset 0 -1px 0 ", ";\n border-bottom: none;\n }\n"], ["\n width: 100%;\n border: none;\n border-top-left-radius: 0;\n border-bottom-left-radius: 0;\n overflow: hidden;\n ", " {\n border-bottom: none;\n height: 40px;\n }\n ", " {\n padding: 0;\n border-right: 1px solid ", ";\n }\n ", " {\n background: ", ";\n height: ", "px;\n box-shadow: inset 0 -1px 0 ", ";\n border-bottom: none;\n }\n"])), TableViewRow, TableViewCellContainer, function (p) { return p.theme.colors.gray300; }, TableViewHeader, function (p) { return p.theme.colors.tableHeader; }, spreadsheetHeaderHeightPx, function (p) { return p.theme.colors.gray300; });
70
+ var TableView = styled(TableViewBase)(templateObject_2 || (templateObject_2 = __makeTemplateObject(["\n width: 100%;\n border: none;\n border-top-left-radius: 0;\n border-bottom-left-radius: 0;\n overflow: hidden;\n background-color: ", ";\n ", " {\n border-bottom: none;\n height: 40px;\n }\n ", " {\n padding: 0;\n border-right: 1px solid ", ";\n }\n"], ["\n width: 100%;\n border: none;\n border-top-left-radius: 0;\n border-bottom-left-radius: 0;\n overflow: hidden;\n background-color: ", ";\n ", " {\n border-bottom: none;\n height: 40px;\n }\n ", " {\n padding: 0;\n border-right: 1px solid ", ";\n }\n"])), function (p) { return p.theme.colors.gray50; }, TableViewRow, TableViewCellContainer, function (p) { return p.theme.colors.gray300; });
70
71
  var ErrorCount = styled(Div)(function (_a) {
71
72
  var _b = _a.theme, colors = _b.colors, c = _b.css;
72
- return css(templateObject_3 || (templateObject_3 = __makeTemplateObject(["\n color: ", ";\n background: ", ";\n border: solid 1px ", ";\n padding: 4px 7px;\n border-radius: 56px;\n min-width: 22px;\n ", ";\n ", ";\n "], ["\n color: ", ";\n background: ", ";\n border: solid 1px ", ";\n padding: 4px 7px;\n border-radius: 56px;\n min-width: 22px;\n ", ";\n ", ";\n "])), colors.error, colors.red100, colors.error, c.label3, c.centered);
73
+ return css(templateObject_3 || (templateObject_3 = __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);
73
74
  });
74
75
  var Spreadsheet = function (_a) {
75
- var isReadOnly = _a.isReadOnly, initialData = _a.initialData, rowWidth = _a.rowWidth, fields = _a.fields, appResponse = _a.appResponse, validationBatchSize = _a.validationBatchSize, _b = _a.onValidateRecord, onValidateRecord = _b === void 0 ? null : _b, submittedData = _a.submittedData, setReviewedData = _a.setReviewedData, _c = _a.onValidateBatch, onValidateBatch = _c === void 0 ? null : _c, _d = _a.highlightFirstRow, highlightFirstRow = _d === void 0 ? false : _d;
76
+ var isReadOnly = _a.isReadOnly, initialData = _a.initialData, rowWidth = _a.rowWidth, fields = _a.fields, appResponse = _a.appResponse, options = _a.options, _b = _a.onValidateRecord, onValidateRecord = _b === void 0 ? null : _b, submittedData = _a.submittedData, setReviewedData = _a.setReviewedData, _c = _a.onValidateBatch, onValidateBatch = _c === void 0 ? null : _c, _d = _a.highlightFirstRow, highlightFirstRow = _d === void 0 ? false : _d;
76
77
  return (_jsx(SpreadsheetContextProvider, __assign({}, {
77
78
  appResponse: appResponse,
78
79
  submittedData: submittedData,
@@ -84,16 +85,20 @@ var Spreadsheet = function (_a) {
84
85
  onValidateRecord: onValidateRecord,
85
86
  onValidateBatch: onValidateBatch,
86
87
  highlightFirstRow: highlightFirstRow,
87
- validationBatchSize: validationBatchSize || initialData.length,
88
+ options: options,
88
89
  }, { children: _jsx(SpreadSheetWithContext, {}, void 0) }), void 0));
89
90
  };
90
91
  var SpreadSheetWithContext = function () {
91
92
  var _a = useSpreadsheetContext(), isReadOnly = _a.isReadOnly, totalErrors = _a.totalErrors, batchValidationPercentage = _a.batchValidationPercentage;
92
93
  var batchValidationProgressUI = (_jsxs(Div, __assign({ body1: true, dflex: true, mb: 22 }, { children: ["Calculating Data...", _jsxs(Div, __assign({ bold: true, ml: 5 }, { children: [batchValidationPercentage, "%"] }), void 0), _jsxs(Div, __assign({ bold: true, c: colors.error, ml: 5 }, { children: ["(", totalErrors, " errors)"] }), void 0)] }), void 0));
93
- return (_jsxs(_Fragment, { children: [_jsx(Div, __assign({ h: 32 }, { children: !isReadOnly &&
94
+ return (_jsxs(Div, { children: [_jsx(Div, __assign({ h: 32 }, { children: !isReadOnly &&
94
95
  batchValidationPercentage < 100 &&
95
96
  batchValidationProgressUI }), void 0), _jsx(SpreadsheetData, {}, void 0)] }, void 0));
96
97
  };
98
+ var booleanOptions = [
99
+ { label: "True", value: true },
100
+ { label: "False", value: false },
101
+ ];
97
102
  var SpreadsheetData = function () {
98
103
  var _a = useSpreadsheetReviewContext(), appResponse = _a.appResponse, isSubmitting = _a.isSubmitting;
99
104
  var _b = useSpreadsheetContext(), fields = _b.fields, data = _b.data, isLoading = _b.isLoading, isReadOnly = _b.isReadOnly, rowWidth = _b.rowWidth, sortByFieldErrors = _b.sortByFieldErrors, setSortByFieldErrors = _b.setSortByFieldErrors, validateRenderedRecords = _b.validateRenderedRecords, setIsLoading = _b.setIsLoading;
@@ -129,27 +134,11 @@ var SpreadsheetData = function () {
129
134
  Header: function () {
130
135
  var columnErrorCounts = useSpreadsheetContext().columnErrorCounts;
131
136
  var fieldErrorCount = columnErrorCounts[f.name];
132
- return (_jsxs(Div, __assign({ p: "0px 16px", spaceBetween: true, w100: true, alignCenter: true }, { children: [_jsxs(Div, { children: [f.label, f.isRequired && "*"] }, void 0), fieldErrorCount && (_jsx(ErrorCount, __assign({ onClick: function () { return setSortByFieldErrors(f.name); } }, { children: fieldErrorCount }), void 0))] }), void 0));
137
+ return (_jsxs(Div, __assign({ p: "0 16px", spaceBetween: true, w100: true, alignCenter: true }, { children: [_jsxs(Div, __assign({ truncateText: true }, { children: [f.label, f.isRequired && "*"] }), void 0), fieldErrorCount && (_jsx(TooltipProvider, __assign({ mr: 3, w: 35, tooltip: "Sort by ".concat(f.label, " errors") }, { children: _jsx(ErrorCount, __assign({ onClick: function () { return setSortByFieldErrors(f.name); } }, { children: _jsx(Div, __assign({ centered: true }, { children: _jsx(Div, __assign({ w: 35, textAlignCenter: true, label3: true, truncateText: true }, { children: fieldErrorCount }), void 0) }), void 0) }), void 0) }), void 0))] }), void 0));
133
138
  },
134
139
  Content: function (record) {
135
- var getInputType = function () {
136
- switch (f.type) {
137
- case FieldTypes.integer:
138
- case FieldTypes.float:
139
- return "number";
140
- case FieldTypes.email:
141
- return "email";
142
- default:
143
- return "text";
144
- }
145
- };
146
- var booleanOptions = [
147
- { label: "True", value: "true" },
148
- { label: "False", value: "false" },
149
- ];
150
140
  var props = {
151
141
  name: f.name,
152
- type: getInputType(),
153
142
  record: (function () {
154
143
  var res = __assign({}, record);
155
144
  delete res.rowIndex;
@@ -161,18 +150,37 @@ var SpreadsheetData = function () {
161
150
  return (_jsx(SpreadsheetAutocomplete, __assign({ isInputDisabled: true }, props, { options: booleanOptions }), void 0));
162
151
  case FieldTypes.enum:
163
152
  return (_jsx(SpreadsheetAutocomplete, __assign({}, props, { options: f === null || f === void 0 ? void 0 : f.options.map(function (o) { return ({ label: o, value: o }); }) }), void 0));
164
- case FieldTypes.string:
165
- case FieldTypes.float:
166
153
  case FieldTypes.integer:
154
+ return (_jsx(SpreadsheetInput, __assign({}, props, { type: "number", step: "1", onKeyDown: function (event) {
155
+ if (event.key === "." ||
156
+ event.key === "," ||
157
+ event.key === "e") {
158
+ event.preventDefault();
159
+ }
160
+ } }), void 0));
161
+ case FieldTypes.float:
162
+ return (_jsx(SpreadsheetInput, __assign({}, props, { type: "number", onKeyDown: function (event) {
163
+ if (event.key === "e") {
164
+ event.preventDefault();
165
+ }
166
+ } }), void 0));
167
+ case FieldTypes.string:
168
+ return _jsx(SpreadsheetInput, __assign({}, props, { type: "email" }), void 0);
167
169
  case FieldTypes.email:
168
- return _jsx(SpreadsheetTextInput, __assign({}, props), void 0);
170
+ return _jsx(SpreadsheetInput, __assign({}, props, { type: "text" }), void 0);
169
171
  }
170
172
  },
171
173
  }); });
172
174
  }, [fields]);
173
175
  var unsubmittedData = getUnsubmittedData(data, appResponse);
174
- return (_jsxs(_Fragment, { children: [_jsx(GlobalStyle, {}, void 0), !isSortingTableData && !isSubmitting && (_jsxs(SpreadSheetWrapper, __assign({ h: SPREADSHEET_HEIGHT, dflex: true, w: 1400 }, { children: [_jsx(SpreadsheetRowNumbers, { spreadsheetHasXScroll: rowWidth > 1, scrollTop: scrollTop, height: SPREADSHEET_HEIGHT }, void 0), _jsx(TableView, { highlightFirstRow: isReadOnly, rowHeight: spreadsheetRowHeightPx, onSectionRendered: onSectionRendered, onTableScroll: function (_scrollTop) { return setScrollTop(_scrollTop); }, h: SPREADSHEET_HEIGHT, rowWidth: rowWidth, data: unsubmittedData, columns: columns, isLoading: isLoading }, void 0)] }), void 0))] }, void 0));
176
+ var spreadsheetHeight = getTableHeight({
177
+ headerHeight: spreadsheetHeaderHeightPx,
178
+ rowHeight: spreadsheetRowHeightPx,
179
+ dataCount: unsubmittedData.length,
180
+ mininmumTableHeight: 450,
181
+ maxVisibleRows: 12,
182
+ });
183
+ return (_jsxs(_Fragment, { children: [_jsx(GlobalStyle, {}, void 0), !isSortingTableData && !isSubmitting && (_jsxs(SpreadSheetWrapper, __assign({ h: spreadsheetHeight, dflex: true, w: 1400 }, { children: [_jsx(SpreadsheetRowNumbers, { spreadsheetHasXScroll: rowWidth > 1, scrollTop: scrollTop, height: spreadsheetHeight }, void 0), _jsx(TableView, { tableHeadersHeight: spreadsheetHeaderHeightPx, highlightFirstRow: isReadOnly, rowHeight: spreadsheetRowHeightPx, onSectionRendered: onSectionRendered, onTableScroll: function (_scrollTop) { return setScrollTop(_scrollTop); }, h: spreadsheetHeight, rowWidth: rowWidth, data: unsubmittedData, columns: columns, isLoading: isLoading }, void 0)] }), void 0))] }, void 0));
175
184
  };
176
185
  export { Spreadsheet };
177
186
  var templateObject_1, templateObject_2, templateObject_3;
178
- //# sourceMappingURL=index.js.map
@@ -13,4 +13,3 @@ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
13
13
  export var fileExtensionIcon = (_jsxs("svg", __assign({ width: "36", height: "44", viewBox: "0 0 36 44", fill: "none", xmlns: "http://www.w3.org/2000/svg" }, { children: [_jsx("path", { d: "M33 43.0001H3C1.89543 43.0001 1 42.1046 1 41.0001V3.00006C1 1.89549 1.89543 1.00006 3 1.00006H16.655C19.0148 1.00006 21.2542 2.04193 22.7743 3.84697L33.1193 16.1317C34.3339 17.5741 35 19.3991 35 21.2848V41.0001C35 42.1046 34.1046 43.0001 33 43.0001Z", fill: "#C2CEEC", stroke: "#333333", strokeWidth: "2" }, void 0), _jsx("path", { d: "M33 43.0004H3C1.89543 43.0004 1 42.105 1 41.0004V3.0004C1 1.89583 1.89543 1.0004 3 1.0004H16.8421C18.499 1.0004 19.8421 2.34354 19.8421 4.0004V14.5004C19.8421 15.8811 20.9614 17.0004 22.3421 17.0004H32C33.6569 17.0004 35 18.3435 35 20.0004V41.0004C35 42.105 34.1046 43.0004 33 43.0004Z", fill: "white", stroke: "#333333", strokeWidth: "2" }, void 0)] }), void 0));
14
14
  export var closeIconWithCircle = (_jsxs("svg", __assign({ width: "24", height: "24", viewBox: "0 0 24 24", fill: "none", xmlns: "http://www.w3.org/2000/svg" }, { children: [_jsx("circle", { cx: "12", cy: "12", r: "11", stroke: "#989898", strokeWidth: "2" }, void 0), _jsx("path", { d: "M9 9L15 15", stroke: "#989898", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round" }, void 0), _jsx("path", { d: "M9 15L15 9", stroke: "#989898", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round" }, void 0)] }), void 0));
15
15
  export var errorIcon = (_jsxs("svg", __assign({ width: "76", height: "64", viewBox: "0 0 76 64", fill: "none", xmlns: "http://www.w3.org/2000/svg" }, { children: [_jsx("path", { d: "M38 3.95611L72.0101 62H3.98992L38 3.95611Z", stroke: "black", strokeWidth: "4" }, void 0), _jsx("path", { fillRule: "evenodd", clipRule: "evenodd", d: "M40.5 26.5C40.5 25.1193 39.3807 24 38 24C36.6193 24 35.5 25.1193 35.5 26.5V39.8333C35.5 41.214 36.6193 42.3333 38 42.3333C39.3807 42.3333 40.5 41.214 40.5 39.8333V26.5ZM40.5 50.5C40.5 49.1193 39.3807 48 38 48C36.6193 48 35.5 49.1193 35.5 50.5V51.8333C35.5 53.214 36.6193 54.3333 38 54.3333C39.3807 54.3333 40.5 53.214 40.5 51.8333V50.5Z", fill: "black" }, void 0)] }), void 0));
16
- //# sourceMappingURL=index.js.map
@@ -4,4 +4,12 @@ declare type Environments = {
4
4
  [K in EnvironmentType]?: any;
5
5
  };
6
6
  export declare const baseUrls: Environments;
7
+ declare type GetTableHeightArgs = {
8
+ headerHeight: number;
9
+ rowHeight: number;
10
+ maxVisibleRows: number;
11
+ mininmumTableHeight?: number;
12
+ dataCount: number;
13
+ };
14
+ export declare const getTableHeight: ({ headerHeight, rowHeight, maxVisibleRows, mininmumTableHeight, dataCount, }: GetTableHeightArgs) => number;
7
15
  export {};
@@ -1,3 +1,4 @@
1
+ import { defaultTableHeaderHeightPx, defaultTableRowHeightPx, } from "../../common/Table/TableView/common";
1
2
  export var contentWidth = 1120;
2
3
  export var baseUrls = {
3
4
  local: "http://localhost:3000",
@@ -5,4 +6,8 @@ export var baseUrls = {
5
6
  production: "https://fuse.flatironsdevelopment.com",
6
7
  test: "https://fuse-test.flatironsdevelopment.com",
7
8
  };
8
- //# sourceMappingURL=index.js.map
9
+ var MINIMUM_TABLE_HEIGHT = 375;
10
+ export var getTableHeight = function (_a) {
11
+ var _b = _a.headerHeight, headerHeight = _b === void 0 ? defaultTableHeaderHeightPx : _b, _c = _a.rowHeight, rowHeight = _c === void 0 ? defaultTableRowHeightPx : _c, _d = _a.maxVisibleRows, maxVisibleRows = _d === void 0 ? 7 : _d, _e = _a.mininmumTableHeight, mininmumTableHeight = _e === void 0 ? MINIMUM_TABLE_HEIGHT : _e, dataCount = _a.dataCount;
12
+ return Math.max(headerHeight + rowHeight * Math.min(dataCount, maxVisibleRows + 0.5), mininmumTableHeight);
13
+ };
@@ -1,4 +1,4 @@
1
- import { AppResponse, Record } from "../../types";
1
+ import { AppResponse, BatchValidationErrors, Record, RowValidationError } from "../../types";
2
2
  import { TemplateHeader } from "../ImporterContextProvider";
3
3
  export declare const getSpreadsheetRowWidth: (fields: any, visibleRowsOnTableViewport: any) => number;
4
4
  export declare const getUnsubmittedData: (data: Record[], appResponse: AppResponse) => Record[];
@@ -6,5 +6,6 @@ declare type IsEnumFieldArgs = {
6
6
  templateLabel: string;
7
7
  templateHeaders: TemplateHeader[];
8
8
  };
9
- export declare const isEnumField: ({ templateLabel, templateHeaders, }: IsEnumFieldArgs) => boolean;
9
+ export declare const getColumnType: ({ templateLabel, templateHeaders, }: IsEnumFieldArgs) => string;
10
+ export declare const formatBatchErrors: (errors: RowValidationError[]) => BatchValidationErrors;
10
11
  export {};