fuse-importer 0.0.7-testing → 0.0.8-testing
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.
- package/lib/esm/Importer/common/Spreadsheet/components/inputs/index.d.ts +0 -1
- package/lib/esm/common/columnsValidations.d.ts +1 -1
- package/lib/esm/hooks/index.d.ts +0 -1
- package/lib/esm/types.d.ts +2 -2
- package/lib/main.js +18 -18
- package/package.json +2 -3
- package/lib/esm/Importer/ImporterWithContext.js +0 -63
- package/lib/esm/Importer/Matcher/EnumFieldsMatchers/EnumFieldMatcher/index.js +0 -68
- package/lib/esm/Importer/Matcher/EnumFieldsMatchers/EnumFieldMatcher/tableColumns.js +0 -58
- package/lib/esm/Importer/Matcher/EnumFieldsMatchers/EnumFieldMatcherContext.js +0 -21
- package/lib/esm/Importer/Matcher/EnumFieldsMatchers/index.js +0 -23
- package/lib/esm/Importer/Matcher/HeaderMatcher/index.js +0 -61
- package/lib/esm/Importer/Matcher/HeaderMatcher/tableColumns.js +0 -55
- package/lib/esm/Importer/Matcher/common/icons/index.js +0 -14
- package/lib/esm/Importer/Matcher/common/index.js +0 -39
- package/lib/esm/Importer/Matcher/common/types.js +0 -9
- package/lib/esm/Importer/Matcher/index.js +0 -22
- package/lib/esm/Importer/PreviewFirstTime.js +0 -81
- package/lib/esm/Importer/PreviewModeBanner.js +0 -19
- package/lib/esm/Importer/Review/AppResponseModal.js +0 -35
- package/lib/esm/Importer/Review/ReviewContextProvider.js +0 -315
- package/lib/esm/Importer/Review/ReviewWithContext.js +0 -33
- package/lib/esm/Importer/Review/index.js +0 -4
- package/lib/esm/Importer/Stepper/ConfirmCloseModal.js +0 -24
- package/lib/esm/Importer/Stepper/Step.js +0 -19
- package/lib/esm/Importer/Stepper/StepIndex.js +0 -27
- package/lib/esm/Importer/Stepper/StepperSubmitModal.js +0 -24
- package/lib/esm/Importer/Stepper/UnmatchedHeadersModal.js +0 -31
- package/lib/esm/Importer/Stepper/common/getEnumFieldValueMatchingsInitialValue.js +0 -33
- package/lib/esm/Importer/Stepper/common/icons.js +0 -18
- package/lib/esm/Importer/Stepper/index.js +0 -118
- package/lib/esm/Importer/TrialModeBanner.js +0 -22
- package/lib/esm/Importer/Uploader/DragAndDropImporter/DragAndDropImporter.styles.js +0 -11
- package/lib/esm/Importer/Uploader/DragAndDropImporter/ImporterDropzone.js +0 -123
- package/lib/esm/Importer/Uploader/DragAndDropImporter/ImporterSectionHeader/ImporterSectionHeader.styles.js +0 -11
- package/lib/esm/Importer/Uploader/DragAndDropImporter/ImporterSectionHeader/index.js +0 -44
- package/lib/esm/Importer/Uploader/DragAndDropImporter/backgrounds.js +0 -14
- package/lib/esm/Importer/Uploader/DragAndDropImporter/index.js +0 -45
- package/lib/esm/Importer/Uploader/HeaderButtons.js +0 -28
- package/lib/esm/Importer/Uploader/HeadersPreview.js +0 -44
- package/lib/esm/Importer/Uploader/UploaderContextProvider.js +0 -27
- package/lib/esm/Importer/Uploader/index.js +0 -13
- package/lib/esm/Importer/common/AppLoading.js +0 -24
- package/lib/esm/Importer/common/Footer.js +0 -17
- package/lib/esm/Importer/common/FuseApi.js +0 -48
- package/lib/esm/Importer/common/GlobalStyle.js +0 -7
- package/lib/esm/Importer/common/ImporterFonts.js +0 -5
- package/lib/esm/Importer/common/Spreadsheet/SpreadsheetContextProvider/filterMethods.js +0 -56
- package/lib/esm/Importer/common/Spreadsheet/SpreadsheetContextProvider/index.js +0 -176
- package/lib/esm/Importer/common/Spreadsheet/SpreadsheetContextProvider/useSpreadsheetFilter.js +0 -45
- package/lib/esm/Importer/common/Spreadsheet/SpreadsheetContextProvider/utils.js +0 -14
- package/lib/esm/Importer/common/Spreadsheet/common/index.js +0 -63
- package/lib/esm/Importer/common/Spreadsheet/common/types.js +0 -5
- package/lib/esm/Importer/common/Spreadsheet/components/FieldHeader.js +0 -66
- package/lib/esm/Importer/common/Spreadsheet/components/GlobalStyle.js +0 -9
- package/lib/esm/Importer/common/Spreadsheet/components/SpreadsheetData.js +0 -110
- package/lib/esm/Importer/common/Spreadsheet/components/SpreadsheetRowCheckboxes.js +0 -186
- package/lib/esm/Importer/common/Spreadsheet/components/SpreadsheetRowNumbers.js +0 -55
- package/lib/esm/Importer/common/Spreadsheet/components/ValidationProgress.js +0 -19
- package/lib/esm/Importer/common/Spreadsheet/components/fields/SpeadsheetAutocomplete.js +0 -43
- package/lib/esm/Importer/common/Spreadsheet/components/fields/SpreadsheetInput.js +0 -70
- package/lib/esm/Importer/common/Spreadsheet/components/fields/index.js +0 -108
- package/lib/esm/Importer/common/Spreadsheet/components/inputs/Boolean.js +0 -18
- package/lib/esm/Importer/common/Spreadsheet/components/inputs/EmailInput.js +0 -14
- package/lib/esm/Importer/common/Spreadsheet/components/inputs/EnumInput.js +0 -30
- package/lib/esm/Importer/common/Spreadsheet/components/inputs/FloatInput.js +0 -16
- package/lib/esm/Importer/common/Spreadsheet/components/inputs/IntegerInput.js +0 -16
- package/lib/esm/Importer/common/Spreadsheet/components/inputs/StringInput.js +0 -14
- package/lib/esm/Importer/common/Spreadsheet/components/inputs/index.js +0 -20
- package/lib/esm/Importer/common/Spreadsheet/hooks.js +0 -245
- package/lib/esm/Importer/common/Spreadsheet/index.js +0 -119
- package/lib/esm/Importer/common/Spreadsheet/styles.js +0 -16
- package/lib/esm/Importer/common/Spreadsheet/transformation/index.js +0 -47
- package/lib/esm/Importer/common/Spreadsheet/transformation/transformators.js +0 -204
- package/lib/esm/Importer/common/Spreadsheet/validation/index.js +0 -202
- package/lib/esm/Importer/common/Spreadsheet/validation/validators.js +0 -181
- package/lib/esm/Importer/common/icons/index.js +0 -18
- package/lib/esm/Importer/common/index.js +0 -13
- package/lib/esm/Importer/common/theme.js +0 -19
- package/lib/esm/Importer/common/utils.js +0 -100
- package/lib/esm/Importer/contexts/ImporterContextProvider.js +0 -247
- package/lib/esm/Importer/data/index.js +0 -152
- package/lib/esm/Importer/index.js +0 -28
- package/lib/esm/api/index.js +0 -93
- package/lib/esm/api/responseHandlers.js +0 -49
- package/lib/esm/common/AppLoadingContextProvider/AppLoadingUI.js +0 -26
- package/lib/esm/common/AppLoadingContextProvider/index.js +0 -25
- package/lib/esm/common/ConfirmationModal.js +0 -19
- package/lib/esm/common/Modal.js +0 -31
- package/lib/esm/common/Spinner.js +0 -41
- package/lib/esm/common/Table/Pagination/icons.js +0 -42
- package/lib/esm/common/Table/Pagination/index.js +0 -32
- package/lib/esm/common/Table/TableActions/DeleteSelectedRows.js +0 -50
- package/lib/esm/common/Table/TableActions/ExportData.js +0 -23
- package/lib/esm/common/Table/TableActions/FilterByErrors/FilterByErrors.js +0 -47
- package/lib/esm/common/Table/TableActions/FilterByErrors/FilterByErrors.styles.js +0 -24
- package/lib/esm/common/Table/TableActions/FilterByErrors/functions.js +0 -35
- package/lib/esm/common/Table/TableActions/FilterByErrors/index.js +0 -1
- package/lib/esm/common/Table/TableActions/RowFilters.js +0 -42
- package/lib/esm/common/Table/TableActions/SearchRows.js +0 -72
- package/lib/esm/common/Table/TableActions/TableActions.js +0 -35
- package/lib/esm/common/Table/TableActions/TableActions.styles.js +0 -18
- package/lib/esm/common/Table/TableActions/TransformedRecordsCount.js +0 -71
- package/lib/esm/common/Table/TableActions/common.js +0 -1
- package/lib/esm/common/Table/TableActions/hooks.js +0 -41
- package/lib/esm/common/Table/TableActions/icons.js +0 -17
- package/lib/esm/common/Table/TableActions/index.js +0 -1
- package/lib/esm/common/Table/TableDataProvider.js +0 -127
- package/lib/esm/common/Table/TableView/CustomScrollbar.d.ts +0 -2
- package/lib/esm/common/Table/TableView/CustomScrollbar.js +0 -34
- package/lib/esm/common/Table/TableView/TableHeaders.js +0 -69
- package/lib/esm/common/Table/TableView/TableRows/TableRow.js +0 -57
- package/lib/esm/common/Table/TableView/TableRows/index.js +0 -48
- package/lib/esm/common/Table/TableView/common/index.js +0 -37
- package/lib/esm/common/Table/TableView/index.js +0 -132
- package/lib/esm/common/Table/TableView/types.js +0 -1
- package/lib/esm/common/Table/icons.js +0 -15
- package/lib/esm/common/Table/index.js +0 -140
- package/lib/esm/common/Table/useReorderRows.js +0 -83
- package/lib/esm/common/Toast.js +0 -69
- package/lib/esm/common/TooltipProvider.js +0 -57
- package/lib/esm/common/buttons.js +0 -97
- package/lib/esm/common/columnsTransformations.js +0 -94
- package/lib/esm/common/columnsValidations.js +0 -687
- package/lib/esm/common/icons/index.js +0 -30
- package/lib/esm/common/index.js +0 -45
- package/lib/esm/common/inputs/Autocomplete.js +0 -110
- package/lib/esm/common/inputs/Checkbox.js +0 -53
- package/lib/esm/common/inputs/SelectMenu.js +0 -67
- package/lib/esm/common/inputs/TextInput.js +0 -89
- package/lib/esm/common/inputs/index.js +0 -5
- package/lib/esm/common/inputs/tooltip.js +0 -38
- package/lib/esm/common/logo.js +0 -13
- package/lib/esm/hooks/index.js +0 -16
- package/lib/esm/index.js +0 -218
- package/lib/esm/locales/de.js +0 -126
- package/lib/esm/locales/en.js +0 -126
- package/lib/esm/locales/es.js +0 -126
- package/lib/esm/locales/fr.js +0 -126
- package/lib/esm/locales/index.js +0 -4
- package/lib/esm/styled/fontsURL.js +0 -27
- package/lib/esm/styled/index.js +0 -3
- package/lib/esm/styled/theme/animations.js +0 -9
- package/lib/esm/styled/theme/colorPalette.js +0 -109
- package/lib/esm/styled/theme/debugCss.js +0 -16
- package/lib/esm/styled/theme/dimensionsCss.js +0 -20
- package/lib/esm/styled/theme/fontCss.js +0 -17
- package/lib/esm/styled/theme/globalCss.js +0 -26
- package/lib/esm/styled/theme/index.js +0 -33
- package/lib/esm/styled/theme/layoutCss.js +0 -26
- package/lib/esm/styled/theme/mediaQueries.js +0 -4
- package/lib/esm/styled/theme/positionCss.js +0 -27
- package/lib/esm/styled/theme/textCss.js +0 -18
- package/lib/esm/styled/theme/textStyles.js +0 -27
- package/lib/esm/styled/themeType.js +0 -6
- package/lib/esm/styled/utils.js +0 -17
- package/lib/esm/types.js +0 -65
- package/lib/esm/utils/hooks/useWindowSize.js +0 -23
- package/lib/esm/utils/hooks.js +0 -1
- package/lib/esm/utils/index.js +0 -37
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
var __assign = (this && this.__assign) || function () {
|
|
2
|
-
__assign = Object.assign || function(t) {
|
|
3
|
-
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
4
|
-
s = arguments[i];
|
|
5
|
-
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
|
|
6
|
-
t[p] = s[p];
|
|
7
|
-
}
|
|
8
|
-
return t;
|
|
9
|
-
};
|
|
10
|
-
return __assign.apply(this, arguments);
|
|
11
|
-
};
|
|
12
|
-
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
13
|
-
export var chevronDown = (_jsx("svg", __assign({ width: "9", height: "5", viewBox: "0 0 9 5", fill: "none", xmlns: "http://www.w3.org/2000/svg" }, { children: _jsx("path", { d: "M4.31848 4.93945L0.421366 0.439453L8.2156 0.439454L4.31848 4.93945Z", fill: "#102622" }) })));
|
|
14
|
-
export var chevronRight = (_jsx("svg", __assign({ width: "6", height: "8", viewBox: "0 0 6 8", fill: "none", xmlns: "http://www.w3.org/2000/svg" }, { children: _jsx("path", { d: "M5.31848 4.06738L0.818482 7.9645L0.818482 0.170269L5.31848 4.06738Z", fill: "#102622" }) })));
|
|
15
|
-
export var spreedSheetIcon = (_jsxs("svg", __assign({ width: "376", height: "256", viewBox: "0 0 376 256", fill: "none", xmlns: "http://www.w3.org/2000/svg" }, { children: [_jsxs("g", __assign({ filter: "url(#filter0_d_4260_84132)" }, { children: [_jsx("rect", { x: "12", y: "8", width: "352", height: "231.997", rx: "4", fill: "white" }), _jsxs("g", __assign({ clipPath: "url(#clip0_4260_84132)" }, { children: [_jsx("path", { d: "M364 40.2222H12V236C12 238.209 13.7909 240 16 240H360C362.209 240 364 238.209 364 236V40.2222Z", stroke: "#E6DBDB", strokeWidth: "0.5", strokeMiterlimit: "10" }), _jsx("path", { d: "M12.1463 224.239H364.146", stroke: "#E6DBDB", strokeWidth: "0.5", strokeMiterlimit: "10" }), _jsx("path", { d: "M12.1463 208.937H364.146", stroke: "#E6DBDB", strokeWidth: "0.5", strokeMiterlimit: "10" }), _jsx("path", { d: "M12.1463 193.655H364.146", stroke: "#E6DBDB", strokeWidth: "0.5", strokeMiterlimit: "10" }), _jsx("path", { d: "M12.1463 178.355H364.146", stroke: "#E6DBDB", strokeWidth: "0.5", strokeMiterlimit: "10" }), _jsx("path", { d: "M12.1463 163.052H364.146", stroke: "#E6DBDB", strokeWidth: "0.5", strokeMiterlimit: "10" }), _jsx("path", { d: "M12.1463 147.752H364.146", stroke: "#E6DBDB", strokeWidth: "0.5", strokeMiterlimit: "10" }), _jsx("path", { d: "M12.1463 132.47H364.146", stroke: "#E6DBDB", strokeWidth: "0.5", strokeMiterlimit: "10" }), _jsx("path", { d: "M12.1463 117.169H364.146", stroke: "#E6DBDB", strokeWidth: "0.5", strokeMiterlimit: "10" }), _jsx("path", { d: "M12.1463 101.867H364.146", stroke: "#E6DBDB", strokeWidth: "0.5", strokeMiterlimit: "10" }), _jsx("path", { d: "M12.1463 86.5674H364.146", stroke: "#E6DBDB", strokeWidth: "0.5", strokeMiterlimit: "10" }), _jsx("path", { d: "M12.1463 71.2844H364.146", stroke: "#E6DBDB", strokeWidth: "0.5", strokeMiterlimit: "10" }), _jsx("path", { d: "M12.1463 55.9827H364.146", stroke: "#E6DBDB", strokeWidth: "0.5", strokeMiterlimit: "10" }), _jsx("path", { d: "M305.004 40.6831V239.54", stroke: "#E6DBDB", strokeWidth: "0.5", strokeMiterlimit: "10" }), _jsx("path", { d: "M246.511 40.6831V239.54", stroke: "#E6DBDB", strokeWidth: "0.5", strokeMiterlimit: "10" }), _jsx("path", { d: "M188 40.6831V239.54", stroke: "#E6DBDB", strokeWidth: "0.5", strokeMiterlimit: "10" }), _jsx("path", { d: "M129.489 40.6831V239.54", stroke: "#E6DBDB", strokeWidth: "0.5", strokeMiterlimit: "10" }), _jsx("path", { d: "M70.9966 40.6831V239.54", stroke: "#E6DBDB", strokeWidth: "0.5", strokeMiterlimit: "10" }), _jsx("rect", { x: "17.2543", y: "61.252", width: "49.9104", height: "5.25731", rx: "1", fill: "#E6DBDB" }), _jsx("rect", { x: "75.045", y: "61.252", width: "49.9105", height: "5.25731", rx: "1", fill: "#E6DBDB" }), _jsx("rect", { x: "75.045", y: "92.7949", width: "49.9105", height: "5.25731", rx: "1", fill: "#E6DBDB" }), _jsx("rect", { x: "75.045", y: "105.938", width: "49.9105", height: "5.2573", rx: "1", fill: "#E6DBDB" }), _jsx("rect", { x: "75.045", y: "137.482", width: "49.9105", height: "5.25731", rx: "1", fill: "#E6DBDB" }), _jsx("rect", { x: "75.045", y: "153.254", width: "49.9105", height: "5.25734", rx: "1", fill: "#E6DBDB" }), _jsx("rect", { x: "17.2543", y: "137.482", width: "49.9104", height: "5.25731", rx: "1", fill: "#E6DBDB" }), _jsx("rect", { x: "17.2543", y: "153.254", width: "49.9104", height: "5.25734", rx: "1", fill: "#E6DBDB" }), _jsx("rect", { x: "17.2543", y: "169.026", width: "49.9104", height: "5.25732", rx: "1", fill: "#E6DBDB" }), _jsx("rect", { x: "17.2543", y: "184.798", width: "49.9104", height: "5.25732", rx: "1", fill: "#E6DBDB" }), _jsx("rect", { x: "17.2543", y: "197.942", width: "49.9104", height: "5.25729", rx: "1", fill: "#E6DBDB" }), _jsx("rect", { x: "17.2543", y: "213.713", width: "49.9104", height: "5.25729", rx: "1", fill: "#E6DBDB" }), _jsx("rect", { x: "17.2543", y: "229.485", width: "49.9104", height: "5.25731", rx: "1", fill: "#E6DBDB" }), _jsx("rect", { x: "193.253", y: "121.71", width: "49.9104", height: "5.25733", rx: "1", fill: "#E6DBDB" }), _jsx("rect", { x: "193.253", y: "182.169", width: "49.9104", height: "5.25733", rx: "1", fill: "#E6DBDB" }), _jsx("rect", { x: "251.044", y: "182.169", width: "49.9105", height: "5.25733", rx: "1", fill: "#E6DBDB" }), _jsx("rect", { x: "251.044", y: "121.71", width: "49.9105", height: "5.25733", rx: "1", fill: "#E6DBDB" }), _jsx("rect", { x: "251.044", y: "58.623", width: "49.9105", height: "5.25731", rx: "1", fill: "#E6DBDB" }), _jsx("rect", { x: "193.253", y: "137.482", width: "49.9104", height: "5.25731", rx: "1", fill: "#E6DBDB" }), _jsx("rect", { x: "193.253", y: "197.942", width: "49.9104", height: "5.25729", rx: "1", fill: "#E6DBDB" }), _jsx("rect", { x: "251.044", y: "197.942", width: "49.9105", height: "5.25729", rx: "1", fill: "#E6DBDB" }), _jsx("rect", { x: "251.044", y: "137.482", width: "49.9105", height: "5.25731", rx: "1", fill: "#E6DBDB" }), _jsx("rect", { x: "251.044", y: "74.3953", width: "49.9105", height: "5.25731", rx: "1", fill: "#E6DBDB" }), _jsx("rect", { x: "193.253", y: "153.254", width: "49.9104", height: "5.25734", rx: "1", fill: "#E6DBDB" }), _jsx("rect", { x: "193.253", y: "213.713", width: "49.9104", height: "5.25729", rx: "1", fill: "#E6DBDB" }), _jsx("rect", { x: "251.044", y: "213.713", width: "49.9105", height: "5.25729", rx: "1", fill: "#E6DBDB" }), _jsx("rect", { x: "251.044", y: "153.254", width: "49.9105", height: "5.25734", rx: "1", fill: "#E6DBDB" }), _jsx("rect", { x: "251.044", y: "90.1672", width: "49.9105", height: "5.2573", rx: "1", fill: "#E6DBDB" }), _jsx("rect", { x: "193.253", y: "169.026", width: "49.9104", height: "5.25732", rx: "1", fill: "#E6DBDB" }), _jsx("rect", { x: "193.253", y: "229.485", width: "49.9104", height: "5.25731", rx: "1", fill: "#E6DBDB" }), _jsx("rect", { x: "251.044", y: "229.485", width: "49.9105", height: "5.25731", rx: "1", fill: "#E6DBDB" }), _jsx("rect", { x: "251.044", y: "169.026", width: "49.9105", height: "5.25732", rx: "1", fill: "#E6DBDB" }), _jsx("rect", { x: "251.044", y: "105.938", width: "49.9105", height: "5.2573", rx: "1", fill: "#E6DBDB" }), _jsx("rect", { x: "17.2543", y: "45.48", width: "49.9104", height: "5.25731", rx: "1", fill: "#E6DBDB" }), _jsx("rect", { x: "75.045", y: "45.48", width: "49.9105", height: "5.25731", rx: "1", fill: "#E6DBDB" }), _jsx("rect", { x: "75.045", y: "77.0229", width: "49.9105", height: "5.25731", rx: "1", fill: "#E6DBDB" }), _jsx("rect", { x: "17.2543", y: "121.71", width: "49.9104", height: "5.25733", rx: "1", fill: "#E6DBDB" })] }))] })), _jsx("path", { d: "M12 12.0015C12 9.79233 13.7909 8.00146 16 8.00146H360C362.209 8.00146 364 9.79233 364 12.0015V40.2237H12V12.0015Z", fill: "#00D085" }), _jsx("circle", { cx: "306.77", cy: "24.0002", r: "6", fill: "#025F40" }), _jsx("circle", { cx: "324.77", cy: "24.0002", r: "6", fill: "#025F40" }), _jsx("circle", { cx: "342.77", cy: "24.0002", r: "6", fill: "#025F40" }), _jsxs("defs", { children: [_jsxs("filter", __assign({ id: "filter0_d_4260_84132", x: "0", y: "0", width: "376", height: "256", filterUnits: "userSpaceOnUse", colorInterpolationFilters: "sRGB" }, { children: [_jsx("feFlood", { floodOpacity: "0", result: "BackgroundImageFix" }), _jsx("feColorMatrix", { in: "SourceAlpha", type: "matrix", values: "0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 127 0", result: "hardAlpha" }), _jsx("feOffset", { dy: "4" }), _jsx("feGaussianBlur", { stdDeviation: "6" }), _jsx("feColorMatrix", { type: "matrix", values: "0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0.1 0" }), _jsx("feBlend", { mode: "normal", in2: "BackgroundImageFix", result: "effect1_dropShadow_4260_84132" }), _jsx("feBlend", { mode: "normal", in: "SourceGraphic", in2: "effect1_dropShadow_4260_84132", result: "shape" })] })), _jsx("clipPath", __assign({ id: "clip0_4260_84132" }, { children: _jsx("path", { d: "M12 40.2222H364V236C364 238.209 362.209 240 360 240H16C13.7909 240 12 238.209 12 236V40.2222Z", fill: "white" }) }))] })] })));
|
|
@@ -1,140 +0,0 @@
|
|
|
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
|
-
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
17
|
-
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
18
|
-
return new (P || (P = Promise))(function (resolve, reject) {
|
|
19
|
-
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
20
|
-
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
21
|
-
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
22
|
-
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
23
|
-
});
|
|
24
|
-
};
|
|
25
|
-
var __generator = (this && this.__generator) || function (thisArg, body) {
|
|
26
|
-
var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
|
|
27
|
-
return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
|
|
28
|
-
function verb(n) { return function (v) { return step([n, v]); }; }
|
|
29
|
-
function step(op) {
|
|
30
|
-
if (f) throw new TypeError("Generator is already executing.");
|
|
31
|
-
while (g && (g = 0, op[0] && (_ = 0)), _) try {
|
|
32
|
-
if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
|
|
33
|
-
if (y = 0, t) op = [op[0] & 2, t.value];
|
|
34
|
-
switch (op[0]) {
|
|
35
|
-
case 0: case 1: t = op; break;
|
|
36
|
-
case 4: _.label++; return { value: op[1], done: false };
|
|
37
|
-
case 5: _.label++; y = op[1]; op = [0]; continue;
|
|
38
|
-
case 7: op = _.ops.pop(); _.trys.pop(); continue;
|
|
39
|
-
default:
|
|
40
|
-
if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
|
|
41
|
-
if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
|
|
42
|
-
if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
|
|
43
|
-
if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
|
|
44
|
-
if (t[2]) _.ops.pop();
|
|
45
|
-
_.trys.pop(); continue;
|
|
46
|
-
}
|
|
47
|
-
op = body.call(thisArg, _);
|
|
48
|
-
} catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
|
|
49
|
-
if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
|
|
50
|
-
}
|
|
51
|
-
};
|
|
52
|
-
var __rest = (this && this.__rest) || function (s, e) {
|
|
53
|
-
var t = {};
|
|
54
|
-
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
55
|
-
t[p] = s[p];
|
|
56
|
-
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
|
57
|
-
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
58
|
-
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
|
59
|
-
t[p[i]] = s[p[i]];
|
|
60
|
-
}
|
|
61
|
-
return t;
|
|
62
|
-
};
|
|
63
|
-
import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
|
|
64
|
-
import styled, { css } from "styled-components";
|
|
65
|
-
import { DndContext, useSensors, useSensor, PointerSensor, KeyboardSensor, closestCenter, } from "@dnd-kit/core";
|
|
66
|
-
import { restrictToVerticalAxis, restrictToWindowEdges, } from "@dnd-kit/modifiers";
|
|
67
|
-
import { sortableKeyboardCoordinates } from "@dnd-kit/sortable";
|
|
68
|
-
import { Div } from "../../styled/utils";
|
|
69
|
-
import { Pagination } from "./Pagination";
|
|
70
|
-
import { useTableContext } from "./TableDataProvider";
|
|
71
|
-
import { TableView as TableViewBase } from "./TableView";
|
|
72
|
-
import { useReorderRows } from "./useReorderRows";
|
|
73
|
-
import { addToast } from "../../common/Toast";
|
|
74
|
-
var TableContainer = styled(Div)(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n overflow-x: auto;\n width: calc(100% + 2px);\n ", ";\n"], ["\n overflow-x: auto;\n width: calc(100% + 2px);\n ", ";\n"])), function (p) { return p.theme.css.scrollbarDark; });
|
|
75
|
-
var TableWrapper = styled(Div)(templateObject_2 || (templateObject_2 = __makeTemplateObject(["\n min-width: 1000px;\n border: solid 1px ", ";\n"], ["\n min-width: 1000px;\n border: solid 1px ", ";\n"])), function (p) { return p.theme.colors.gray300; });
|
|
76
|
-
var TableView = styled(TableViewBase)(templateObject_4 || (templateObject_4 = __makeTemplateObject(["\n ", "\n"], ["\n ", "\n"])), function (p) {
|
|
77
|
-
return p.withPagination && css(templateObject_3 || (templateObject_3 = __makeTemplateObject(["\n border-radius: 0px;\n "], ["\n border-radius: 0px;\n "])));
|
|
78
|
-
});
|
|
79
|
-
var Table = function (_a) {
|
|
80
|
-
var columns = _a.columns, _b = _a.onRowClick, onRowClick = _b === void 0 ? null : _b, _c = _a.blankState, blankState = _c === void 0 ? null : _c, templateSlug = _a.templateSlug, _d = _a.isDraggable, isDraggable = _d === void 0 ? false : _d, props = __rest(_a, ["columns", "onRowClick", "blankState", "templateSlug", "isDraggable"]);
|
|
81
|
-
var _e = useTableContext(), data = _e.data, isLoading = _e.isLoading, sortBy = _e.sortBy, setSortBy = _e.setSortBy, totalPages = _e.totalPages;
|
|
82
|
-
var reorderRows = useReorderRows(templateSlug).reorderRows;
|
|
83
|
-
var withPagination = data.length > 0 && totalPages > 1;
|
|
84
|
-
var sensors = useSensors(useSensor(PointerSensor, {
|
|
85
|
-
activationConstraint: {
|
|
86
|
-
distance: 8,
|
|
87
|
-
},
|
|
88
|
-
}), useSensor(KeyboardSensor, {
|
|
89
|
-
coordinateGetter: sortableKeyboardCoordinates,
|
|
90
|
-
}));
|
|
91
|
-
var paginationUI = (_jsx(_Fragment, { children: withPagination && (_jsx(Div, __assign({ dflex: true, justifyCenter: true, pb: 50 }, { children: _jsx(Pagination, {}) }))) }));
|
|
92
|
-
var handleDragEnd = function (event) { return __awaiter(void 0, void 0, void 0, function () {
|
|
93
|
-
var active, over, overIndex, overIndexIsFalsyButNotZero, error_1;
|
|
94
|
-
var _a, _b, _c;
|
|
95
|
-
return __generator(this, function (_d) {
|
|
96
|
-
switch (_d.label) {
|
|
97
|
-
case 0:
|
|
98
|
-
active = event.active, over = event.over;
|
|
99
|
-
overIndex = (_c = (_b = (_a = over === null || over === void 0 ? void 0 : over.data) === null || _a === void 0 ? void 0 : _a.current) === null || _b === void 0 ? void 0 : _b.sortable) === null || _c === void 0 ? void 0 : _c.index;
|
|
100
|
-
overIndexIsFalsyButNotZero = !overIndex && overIndex !== 0;
|
|
101
|
-
if (!(active === null || active === void 0 ? void 0 : active.id) || overIndexIsFalsyButNotZero || active.id === over.id) {
|
|
102
|
-
return [2 /*return*/];
|
|
103
|
-
}
|
|
104
|
-
_d.label = 1;
|
|
105
|
-
case 1:
|
|
106
|
-
_d.trys.push([1, 3, , 4]);
|
|
107
|
-
return [4 /*yield*/, reorderRows(active.id, overIndex + 1)];
|
|
108
|
-
case 2:
|
|
109
|
-
_d.sent();
|
|
110
|
-
return [3 /*break*/, 4];
|
|
111
|
-
case 3:
|
|
112
|
-
error_1 = _d.sent();
|
|
113
|
-
addToast("Failed to reorder rows", "error");
|
|
114
|
-
return [3 /*break*/, 4];
|
|
115
|
-
case 4: return [2 /*return*/];
|
|
116
|
-
}
|
|
117
|
-
});
|
|
118
|
-
}); };
|
|
119
|
-
var dndContextValues = {
|
|
120
|
-
sensors: isDraggable ? sensors : undefined,
|
|
121
|
-
collisionDetection: isDraggable ? closestCenter : undefined,
|
|
122
|
-
onDragEnd: isDraggable ? handleDragEnd : undefined,
|
|
123
|
-
modifiers: isDraggable
|
|
124
|
-
? [restrictToVerticalAxis, restrictToWindowEdges]
|
|
125
|
-
: undefined,
|
|
126
|
-
};
|
|
127
|
-
var Container = data.length > 0 ? TableContainer : Div;
|
|
128
|
-
var Wrapper = data.length > 0 ? TableWrapper : Div;
|
|
129
|
-
return (_jsx(Container, { children: _jsx(Wrapper, { children: _jsxs(Div, __assign({}, props, { children: [data.length || isLoading ? (_jsx(DndContext, __assign({ sensors: dndContextValues.sensors, collisionDetection: dndContextValues.collisionDetection, onDragEnd: dndContextValues.onDragEnd, modifiers: dndContextValues.modifiers }, { children: _jsx(TableView, __assign({ pageSize: data.length, withPagination: withPagination, isDraggable: isDraggable }, {
|
|
130
|
-
isLoading: isLoading,
|
|
131
|
-
data: data,
|
|
132
|
-
columns: columns,
|
|
133
|
-
sortBy: sortBy,
|
|
134
|
-
setSortBy: setSortBy,
|
|
135
|
-
onRowClick: onRowClick,
|
|
136
|
-
})) }))) : (blankState), paginationUI] })) }) }));
|
|
137
|
-
};
|
|
138
|
-
export { Table };
|
|
139
|
-
export * from "./TableDataProvider";
|
|
140
|
-
var templateObject_1, templateObject_2, templateObject_3, templateObject_4;
|
|
@@ -1,83 +0,0 @@
|
|
|
1
|
-
var __assign = (this && this.__assign) || function () {
|
|
2
|
-
__assign = Object.assign || function(t) {
|
|
3
|
-
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
4
|
-
s = arguments[i];
|
|
5
|
-
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
|
|
6
|
-
t[p] = s[p];
|
|
7
|
-
}
|
|
8
|
-
return t;
|
|
9
|
-
};
|
|
10
|
-
return __assign.apply(this, arguments);
|
|
11
|
-
};
|
|
12
|
-
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
13
|
-
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
14
|
-
return new (P || (P = Promise))(function (resolve, reject) {
|
|
15
|
-
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
16
|
-
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
17
|
-
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
18
|
-
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
19
|
-
});
|
|
20
|
-
};
|
|
21
|
-
var __generator = (this && this.__generator) || function (thisArg, body) {
|
|
22
|
-
var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
|
|
23
|
-
return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
|
|
24
|
-
function verb(n) { return function (v) { return step([n, v]); }; }
|
|
25
|
-
function step(op) {
|
|
26
|
-
if (f) throw new TypeError("Generator is already executing.");
|
|
27
|
-
while (g && (g = 0, op[0] && (_ = 0)), _) try {
|
|
28
|
-
if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
|
|
29
|
-
if (y = 0, t) op = [op[0] & 2, t.value];
|
|
30
|
-
switch (op[0]) {
|
|
31
|
-
case 0: case 1: t = op; break;
|
|
32
|
-
case 4: _.label++; return { value: op[1], done: false };
|
|
33
|
-
case 5: _.label++; y = op[1]; op = [0]; continue;
|
|
34
|
-
case 7: op = _.ops.pop(); _.trys.pop(); continue;
|
|
35
|
-
default:
|
|
36
|
-
if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
|
|
37
|
-
if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
|
|
38
|
-
if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
|
|
39
|
-
if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
|
|
40
|
-
if (t[2]) _.ops.pop();
|
|
41
|
-
_.trys.pop(); continue;
|
|
42
|
-
}
|
|
43
|
-
op = body.call(thisArg, _);
|
|
44
|
-
} catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
|
|
45
|
-
if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
|
|
46
|
-
}
|
|
47
|
-
};
|
|
48
|
-
import { jsx as _jsx } from "react/jsx-runtime";
|
|
49
|
-
import { addToast } from "..";
|
|
50
|
-
import { api } from "../../api";
|
|
51
|
-
import { Div } from "../../styled/utils";
|
|
52
|
-
import { useTableContext } from "./TableDataProvider";
|
|
53
|
-
export var useReorderRows = function (templateSlug, customMessage) {
|
|
54
|
-
var getData = useTableContext().getData;
|
|
55
|
-
var reorderRows = function (columnId, position) { return __awaiter(void 0, void 0, void 0, function () {
|
|
56
|
-
var apiUrl, defaultMessage, confirmationMessage, error_1;
|
|
57
|
-
return __generator(this, function (_a) {
|
|
58
|
-
switch (_a.label) {
|
|
59
|
-
case 0:
|
|
60
|
-
apiUrl = "/api/v1/templates/".concat(templateSlug, "/columns/").concat(columnId);
|
|
61
|
-
defaultMessage = (_jsx(Div, __assign({ alignCenter: true }, { children: _jsx(Div, { children: "Columns reordered successfully" }) })));
|
|
62
|
-
confirmationMessage = (_jsx(Div, __assign({ spaceBetween: true, alignCenter: true }, { children: customMessage || defaultMessage })));
|
|
63
|
-
_a.label = 1;
|
|
64
|
-
case 1:
|
|
65
|
-
_a.trys.push([1, 3, , 4]);
|
|
66
|
-
return [4 /*yield*/, api.patch(apiUrl, {
|
|
67
|
-
position: position,
|
|
68
|
-
})];
|
|
69
|
-
case 2:
|
|
70
|
-
_a.sent();
|
|
71
|
-
addToast(confirmationMessage, "success");
|
|
72
|
-
getData();
|
|
73
|
-
return [3 /*break*/, 4];
|
|
74
|
-
case 3:
|
|
75
|
-
error_1 = _a.sent();
|
|
76
|
-
addToast("Failed to reorder rows", "error");
|
|
77
|
-
return [3 /*break*/, 4];
|
|
78
|
-
case 4: return [2 /*return*/];
|
|
79
|
-
}
|
|
80
|
-
});
|
|
81
|
-
}); };
|
|
82
|
-
return { reorderRows: reorderRows };
|
|
83
|
-
};
|
package/lib/esm/common/Toast.js
DELETED
|
@@ -1,69 +0,0 @@
|
|
|
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 { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
17
|
-
import toast, { ToastBar, Toaster, } from "react-hot-toast";
|
|
18
|
-
import styled from "styled-components";
|
|
19
|
-
import { defaultCheckIcon, greenCheckIcon, redXIcon } from "./icons";
|
|
20
|
-
import { colors } from "../styled/theme/colorPalette";
|
|
21
|
-
import { Div } from "../styled/utils";
|
|
22
|
-
var defaultDuration = 5000;
|
|
23
|
-
var defaultPosition = "bottom-right";
|
|
24
|
-
var toastBorderRadius = 4;
|
|
25
|
-
var toastMaxWidth = "85%";
|
|
26
|
-
export var addToast = function (msg, type, toastOptions) {
|
|
27
|
-
if (type === void 0) { type = "blank"; }
|
|
28
|
-
if (toastOptions === void 0) { toastOptions = {}; }
|
|
29
|
-
var _toastOptions = __assign({ duration: defaultDuration, position: defaultPosition }, toastOptions);
|
|
30
|
-
var toastFn = type === "blank" ? toast : toast[type];
|
|
31
|
-
toastFn(msg, _toastOptions);
|
|
32
|
-
};
|
|
33
|
-
var toastContainerCss = {
|
|
34
|
-
padding: 0,
|
|
35
|
-
marginRight: 72,
|
|
36
|
-
borderRadius: toastBorderRadius,
|
|
37
|
-
boxShadow: "none",
|
|
38
|
-
maxWidth: toastMaxWidth,
|
|
39
|
-
};
|
|
40
|
-
var toastTypeStyles = {
|
|
41
|
-
success: {
|
|
42
|
-
backgroundColor: colors.blue50,
|
|
43
|
-
color: colors.text,
|
|
44
|
-
icon: greenCheckIcon,
|
|
45
|
-
},
|
|
46
|
-
error: {
|
|
47
|
-
color: colors.red800,
|
|
48
|
-
backgroundColor: colors.red100,
|
|
49
|
-
icon: redXIcon,
|
|
50
|
-
},
|
|
51
|
-
blank: {
|
|
52
|
-
backgroundColor: colors.white,
|
|
53
|
-
color: colors.text,
|
|
54
|
-
icon: defaultCheckIcon,
|
|
55
|
-
},
|
|
56
|
-
};
|
|
57
|
-
var ToastWrapper = styled(Div)(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n padding: 10px;\n box-shadow: 0px 2px 8px 1px rgba(0, 0, 0, 0.1);\n border-radius: ", "px;\n ", ";\n"], ["\n padding: 10px;\n box-shadow: 0px 2px 8px 1px rgba(0, 0, 0, 0.1);\n border-radius: ", "px;\n ", ";\n"])), toastBorderRadius, function (p) { return p.theme.css.alignCenter; });
|
|
58
|
-
var Toast = function () {
|
|
59
|
-
return (_jsx(Toaster, __assign({ toastOptions: {
|
|
60
|
-
style: toastContainerCss,
|
|
61
|
-
} }, { children: function (t) { return (_jsx(ToastBar, __assign({ toast: t }, { children: function (_a) {
|
|
62
|
-
var message = _a.message, hotToastIcon = _a.icon;
|
|
63
|
-
var _b = toastTypeStyles[t.type] || {}, icon = _b.icon, color = _b.color, backgroundColor = _b.backgroundColor;
|
|
64
|
-
return (_jsxs(ToastWrapper, __assign({ c: color, bg: backgroundColor }, { children: [_jsx(Div, __assign({ alignCenter: true }, { children: icon || hotToastIcon })), _jsx(Div, __assign({ alignCenter: true }, { children: message })), _jsx(Div, __assign({ p: 5, clickable: true, onClick: function () { return toast.dismiss(t.id); } }, { children: closeIcon }))] })));
|
|
65
|
-
} }))); } })));
|
|
66
|
-
};
|
|
67
|
-
export { Toast };
|
|
68
|
-
var closeIcon = (_jsxs("svg", __assign({ width: "10", height: "10", viewBox: "0 0 10 10", fill: "none", xmlns: "http://www.w3.org/2000/svg" }, { children: [_jsx("path", { d: "M2.5 2.5L7.82258 7.82258", stroke: "currentColor", strokeWidth: "1.5", strokeLinecap: "round", strokeLinejoin: "round" }), _jsx("path", { d: "M2.5 7.82251L7.82258 2.49993", stroke: "currentColor", strokeWidth: "1.5", strokeLinecap: "round", strokeLinejoin: "round" })] })));
|
|
69
|
-
var templateObject_1;
|
|
@@ -1,57 +0,0 @@
|
|
|
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
|
-
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
|
-
};
|
|
27
|
-
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
28
|
-
import { useMemo, useState } from "react";
|
|
29
|
-
import { usePopper } from "react-popper";
|
|
30
|
-
import styled from "styled-components";
|
|
31
|
-
import { Div } from "../styled/utils";
|
|
32
|
-
export var TooltipContent = styled(Div)(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n ", ";\n color: ", ";\n background: ", ";\n border-radius: 4px;\n padding: 10px;\n pointer-events: none;\n z-index: 1000;\n"], ["\n ", ";\n color: ", ";\n background: ", ";\n border-radius: 4px;\n padding: 10px;\n pointer-events: none;\n z-index: 1000;\n"])), function (p) { return p.theme.css.body4; }, function (p) { return p.theme.colors.white; }, function (p) { return p.theme.colors.black; });
|
|
33
|
-
export var TooltipProvider = function (_a) {
|
|
34
|
-
var tooltip = _a.tooltip, children = _a.children, tooltipMaxWidth = _a.tooltipMaxWidth, tooltipMinWidth = _a.tooltipMinWidth, _b = _a.placement, placement = _b === void 0 ? "top-start" : _b, _c = _a.flip, flip = _c === void 0 ? true : _c, _d = _a.isDisabled, isDisabled = _d === void 0 ? false : _d, _e = _a.isOpen, isOpen = _e === void 0 ? false : _e, _f = _a.offset, offset = _f === void 0 ? [0, 4] : _f, props = __rest(_a, ["tooltip", "children", "tooltipMaxWidth", "tooltipMinWidth", "placement", "flip", "isDisabled", "isOpen", "offset"]);
|
|
35
|
-
var _g = useState(false), isDisplayingTooltip = _g[0], setIsDisplayingTooltip = _g[1];
|
|
36
|
-
var _h = useState(null), referenceElement = _h[0], setReferenceElement = _h[1];
|
|
37
|
-
var _j = useState(null), popperElement = _j[0], setPopperElement = _j[1];
|
|
38
|
-
var options = useMemo(function () { return ({
|
|
39
|
-
placement: placement,
|
|
40
|
-
modifiers: [
|
|
41
|
-
{
|
|
42
|
-
name: "offset",
|
|
43
|
-
options: {
|
|
44
|
-
offset: offset,
|
|
45
|
-
},
|
|
46
|
-
},
|
|
47
|
-
{
|
|
48
|
-
name: "flip",
|
|
49
|
-
enabled: flip,
|
|
50
|
-
},
|
|
51
|
-
],
|
|
52
|
-
}); }, [placement, offset]);
|
|
53
|
-
var _k = usePopper(referenceElement, popperElement, options), styles = _k.styles, attributes = _k.attributes;
|
|
54
|
-
var showTooltip = isOpen || (isDisplayingTooltip && !!tooltip);
|
|
55
|
-
return (_jsxs(Div, __assign({ dim: "100%", ref: setReferenceElement, onMouseOver: function () { return isDisabled || setIsDisplayingTooltip(true); }, onMouseOut: function () { return isDisabled || setIsDisplayingTooltip(false); } }, props, { children: [children, showTooltip && (_jsx(TooltipContent, __assign({ ref: setPopperElement, style: styles.popper, maxw: tooltipMaxWidth, minw: tooltipMinWidth }, attributes.popper, { children: tooltip })))] })));
|
|
56
|
-
};
|
|
57
|
-
var templateObject_1;
|
|
@@ -1,97 +0,0 @@
|
|
|
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
|
-
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
|
-
};
|
|
27
|
-
import { jsx as _jsx, Fragment as _Fragment } from "react/jsx-runtime";
|
|
28
|
-
import { get } from "lodash";
|
|
29
|
-
import styled, { css } from "styled-components";
|
|
30
|
-
import { Div, HTMLButton } from "../styled/utils";
|
|
31
|
-
var types = ["primary", "secondary", "tertiary", "link"];
|
|
32
|
-
var getBgColor = function (props) {
|
|
33
|
-
return get(props, "backgroundColor", get(props.theme, "colors.pink500"));
|
|
34
|
-
};
|
|
35
|
-
var getBorderColor = function (props) {
|
|
36
|
-
return get(props, "backgroundColor", get(props.theme, "colors.pink700"));
|
|
37
|
-
};
|
|
38
|
-
var getSvgFillColorForNormalState = function (props) {
|
|
39
|
-
return get(props, "svgNormalFillColorOverride", get(props.theme, "colors.black"));
|
|
40
|
-
};
|
|
41
|
-
var getSvgFillColorForActiveState = function (props) {
|
|
42
|
-
return get(props, "svgActiveFillColorOverride", get(props.theme, "colors.white"));
|
|
43
|
-
};
|
|
44
|
-
var getSvgFillColorForDisabledState = function (props) {
|
|
45
|
-
return get(props, "svgDisabledFillColorOverride", get(props.theme, "colors.gray390"));
|
|
46
|
-
};
|
|
47
|
-
var getSvgStrokeColorForNormalState = function (props) {
|
|
48
|
-
return get(props, "svgNormalStrokeColorOverride", get(props.theme, "colors.black"));
|
|
49
|
-
};
|
|
50
|
-
var getSvgStrokeColorForActiveState = function (props) {
|
|
51
|
-
return get(props, "svgActiveStrokeColorOverride", get(props.theme, "colors.white"));
|
|
52
|
-
};
|
|
53
|
-
var getSvgStrokeColorForDisabledState = function (props) {
|
|
54
|
-
return get(props, "svgDisabledStrokeColorOverride", get(props.theme, "colors.black"));
|
|
55
|
-
};
|
|
56
|
-
var withoutBrandingCSS = css(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n text-decoration: underline;\n"], ["\n text-decoration: underline;\n"])));
|
|
57
|
-
var withBrandingCSS = css(templateObject_2 || (templateObject_2 = __makeTemplateObject(["\n :hover {\n background: transparent;\n text-decoration: underline;\n }\n"], ["\n :hover {\n background: transparent;\n text-decoration: underline;\n }\n"])));
|
|
58
|
-
var styles = {
|
|
59
|
-
primary: css(templateObject_4 || (templateObject_4 = __makeTemplateObject(["\n color: ", ";\n background: ", ";\n\n border: solid 4px ", ";\n box-sizing: border-box;\n\n :hover {\n background: ", ";\n /* a3 at the end adds 0.64 opacity */\n box-shadow: 0px 0px 8px ", "a3;\n }\n :active {\n background: ", ";\n border: 4px solid ", ";\n }\n :focus {\n background: ", ";\n /* a3 at the end adds 0.64 opacity */\n box-shadow: 0px 0px 8px ", "a3;\n }\n ", "\n "], ["\n color: ", ";\n background: ", ";\n\n border: solid 4px ", ";\n box-sizing: border-box;\n\n :hover {\n background: ", ";\n /* a3 at the end adds 0.64 opacity */\n box-shadow: 0px 0px 8px ", "a3;\n }\n :active {\n background: ", ";\n border: 4px solid ", ";\n }\n :focus {\n background: ", ";\n /* a3 at the end adds 0.64 opacity */\n box-shadow: 0px 0px 8px ", "a3;\n }\n ", "\n "])), function (props) { return props.theme.colors.white; }, getBgColor, getBgColor, getBgColor, getBgColor, getBgColor, getBorderColor, getBgColor, getBgColor, function (props) {
|
|
60
|
-
return props.isDisabled && css(templateObject_3 || (templateObject_3 = __makeTemplateObject(["\n background: ", " !important;\n opacity: 0.4;\n box-shadow: none !important;\n border: none !important;\n cursor: not-allowed !important;\n "], ["\n background: ", " !important;\n opacity: 0.4;\n box-shadow: none !important;\n border: none !important;\n cursor: not-allowed !important;\n "])), getBgColor);
|
|
61
|
-
}),
|
|
62
|
-
secondary: css(templateObject_6 || (templateObject_6 = __makeTemplateObject(["\n background: ", ";\n box-sizing: border-box;\n border: solid 1px ", ";\n color: ", ";\n & > svg {\n & > path {\n fill: ", ";\n stroke: ", ";\n }\n }\n :active {\n border: 1px solid ", ";\n background: ", ";\n color: ", ";\n & > svg {\n & > path {\n fill: ", ";\n stroke: ", ";\n }\n }\n }\n :focus {\n box-shadow: 0px 0px 8px rgba(0, 0, 0, 0.24);\n }\n ", "\n "], ["\n background: ", ";\n box-sizing: border-box;\n border: solid 1px ", ";\n color: ", ";\n & > svg {\n & > path {\n fill: ", ";\n stroke: ", ";\n }\n }\n :active {\n border: 1px solid ", ";\n background: ", ";\n color: ", ";\n & > svg {\n & > path {\n fill: ", ";\n stroke: ", ";\n }\n }\n }\n :focus {\n box-shadow: 0px 0px 8px rgba(0, 0, 0, 0.24);\n }\n ", "\n "])), function (props) { return props.theme.colors.white; }, function (props) { return props.theme.colors.black; }, function (props) { return props.theme.colors.black; }, getSvgFillColorForNormalState, getSvgStrokeColorForNormalState, function (props) { return props.theme.colors.black; }, function (props) { return props.theme.colors.black; }, function (props) { return props.theme.colors.white; }, getSvgFillColorForActiveState, getSvgStrokeColorForActiveState, function (props) {
|
|
63
|
-
return props.isDisabled && css(templateObject_5 || (templateObject_5 = __makeTemplateObject(["\n border: 2px solid ", ";\n color: ", ";\n & > svg {\n & > path {\n fill: ", ";\n stroke: ", ";\n }\n }\n "], ["\n border: 2px solid ", ";\n color: ", ";\n & > svg {\n & > path {\n fill: ", ";\n stroke: ", ";\n }\n }\n "])), function (props) { return props.theme.colors.gray390; }, function (props) { return props.theme.colors.gray390; }, getSvgFillColorForDisabledState, getSvgStrokeColorForDisabledState);
|
|
64
|
-
}),
|
|
65
|
-
tertiary: css(templateObject_8 || (templateObject_8 = __makeTemplateObject(["\n background: transparent;\n border: solid 1px transparent;\n color: ", ";\n :hover {\n background: ", ";\n }\n :active {\n background: ", ";\n color: ", ";\n }\n ", "\n "], ["\n background: transparent;\n border: solid 1px transparent;\n color: ", ";\n :hover {\n background: ", ";\n }\n :active {\n background: ", ";\n color: ", ";\n }\n ", "\n "])), function (props) { return props.theme.colors.text; }, function (props) { return props.theme.colors.white50; }, function (props) { return props.theme.colors.black; }, function (props) { return props.theme.colors.white; }, function (props) {
|
|
66
|
-
return props.isDisabled && css(templateObject_7 || (templateObject_7 = __makeTemplateObject(["\n color: ", ";\n "], ["\n color: ", ";\n "])), function (props) { return props.theme.colors.gray300; });
|
|
67
|
-
}),
|
|
68
|
-
link: css(templateObject_10 || (templateObject_10 = __makeTemplateObject(["\n background: transparent;\n border: solid 1px transparent;\n color: ", ";\n\n :hover {\n background: ", ";\n }\n\n ", "\n\n ", "\n\n :active {\n background: ", ";\n color: ", ";\n }\n "], ["\n background: transparent;\n border: solid 1px transparent;\n color: ", ";\n\n :hover {\n background: ", ";\n }\n\n ", "\n\n ", "\n\n :active {\n background: ", ";\n color: ", ";\n }\n "])), function (props) { return props.theme.colors.black; }, function (props) { return props.theme.colors.white50; }, function (props) {
|
|
69
|
-
return props.isDisabled && css(templateObject_9 || (templateObject_9 = __makeTemplateObject(["\n color: ", ";\n "], ["\n color: ", ";\n "])), function (props) { return props.theme.colors.gray300; });
|
|
70
|
-
}, function (_a) {
|
|
71
|
-
var theme = _a.theme;
|
|
72
|
-
return theme.colors.black === "black"
|
|
73
|
-
? withoutBrandingCSS
|
|
74
|
-
: withBrandingCSS;
|
|
75
|
-
}, function (props) { return props.theme.colors.black; }, function (props) { return props.theme.colors.white; }),
|
|
76
|
-
};
|
|
77
|
-
var commonButtonStyle = css(templateObject_13 || (templateObject_13 = __makeTemplateObject(["\n padding: 12px 24px;\n user-select: none;\n width: fit-content;\n\n ", "\n\n border: solid 1px black;\n border-radius: 4px;\n\n font-family: DM Sans;\n\n :focus {\n outline: none;\n }\n :hover {\n cursor: pointer;\n }\n\n ", "\n ", ";\n\n ", ";\n"], ["\n padding: 12px 24px;\n user-select: none;\n width: fit-content;\n\n ", "\n\n border: solid 1px black;\n border-radius: 4px;\n\n font-family: DM Sans;\n\n :focus {\n outline: none;\n }\n :hover {\n cursor: pointer;\n }\n\n ", "\n ", ";\n\n ", ";\n"])), function (props) {
|
|
78
|
-
return props.isSmall && css(templateObject_11 || (templateObject_11 = __makeTemplateObject(["\n padding: 6px 20px;\n "], ["\n padding: 6px 20px;\n "])));
|
|
79
|
-
}, function (props) {
|
|
80
|
-
return props.isDisabled && css(templateObject_12 || (templateObject_12 = __makeTemplateObject(["\n pointer-events: none;\n "], ["\n pointer-events: none;\n "])));
|
|
81
|
-
}, function (props) {
|
|
82
|
-
var c = props.theme.css;
|
|
83
|
-
return [c.centered, c.buttonText];
|
|
84
|
-
}, function (props) { return styles[props.variant || "primary"]; });
|
|
85
|
-
export var ButtonWrapper = styled(Div)(templateObject_14 || (templateObject_14 = __makeTemplateObject(["\n ", ";\n"], ["\n ", ";\n"])), commonButtonStyle);
|
|
86
|
-
export var ButtonElementWrapper = styled(HTMLButton)(templateObject_15 || (templateObject_15 = __makeTemplateObject(["\n ", ";\n"], ["\n ", ";\n"])), commonButtonStyle);
|
|
87
|
-
export var Button = function (_a) {
|
|
88
|
-
var _b = _a.onClick, onClick = _b === void 0 ? null : _b, _c = _a.isDisabled, isDisabled = _c === void 0 ? false : _c, _d = _a.variant, variant = _d === void 0 ? "primary" : _d, _e = _a.isSmall, isSmall = _e === void 0 ? false : _e, children = _a.children, _f = _a.isButtonElement, isButtonElement = _f === void 0 ? false : _f, props = __rest(_a, ["onClick", "isDisabled", "variant", "isSmall", "children", "isButtonElement"]);
|
|
89
|
-
return (_jsx(_Fragment, { children: isButtonElement ? (_jsx(ButtonElementWrapper, __assign({ isSmall: isSmall, isDisabled: isDisabled, disabled: isDisabled, variant: variant, type: "submit" }, props, { children: children }))) : (_jsx(ButtonWrapper, __assign({ role: "button", w: "fit-content", p: 12, isSmall: isSmall, onClick: isDisabled ? null : onClick, onKeyDown: function (_a) {
|
|
90
|
-
var code = _a.code;
|
|
91
|
-
if ((code === "Space" || (code === "Enter" && onClick)) &&
|
|
92
|
-
!isDisabled) {
|
|
93
|
-
onClick();
|
|
94
|
-
}
|
|
95
|
-
}, tabIndex: 0 }, __assign({ variant: variant, isDisabled: isDisabled, onClick: onClick, disabled: isDisabled }, props), { children: _jsx(_Fragment, { children: children }) }))) }));
|
|
96
|
-
};
|
|
97
|
-
var templateObject_1, templateObject_2, templateObject_3, templateObject_4, templateObject_5, templateObject_6, templateObject_7, templateObject_8, templateObject_9, templateObject_10, templateObject_11, templateObject_12, templateObject_13, templateObject_14, templateObject_15;
|
|
@@ -1,94 +0,0 @@
|
|
|
1
|
-
var commonDateAndTimeTransformations = [
|
|
2
|
-
{
|
|
3
|
-
value: "autoformat",
|
|
4
|
-
label: "Autoformat (e.g. 02-13-2020 -> 02/13/2020",
|
|
5
|
-
isDefaultTransformation: true,
|
|
6
|
-
},
|
|
7
|
-
];
|
|
8
|
-
var stringTransformations = [
|
|
9
|
-
{
|
|
10
|
-
value: "sentence_case",
|
|
11
|
-
label: "Sentence Case (e.g. hello world -> Hello world)",
|
|
12
|
-
},
|
|
13
|
-
{
|
|
14
|
-
value: "capitalize",
|
|
15
|
-
label: "Capitalize (e.g. hello world -> Hello World)",
|
|
16
|
-
},
|
|
17
|
-
{
|
|
18
|
-
value: "uppercase",
|
|
19
|
-
label: "Uppercase (e.g. hello world -> HELLO WORLD)",
|
|
20
|
-
},
|
|
21
|
-
{
|
|
22
|
-
value: "lowercase",
|
|
23
|
-
label: "Lowercase (e.g. Hello World -> hello world)",
|
|
24
|
-
},
|
|
25
|
-
{
|
|
26
|
-
value: "trim_whitespace",
|
|
27
|
-
label: "Trim Whitespace (e.g. ' hello world ' -> 'hello world')",
|
|
28
|
-
},
|
|
29
|
-
];
|
|
30
|
-
var urlTransformations = [
|
|
31
|
-
{
|
|
32
|
-
value: "prefix",
|
|
33
|
-
label: "Prefix",
|
|
34
|
-
options: [
|
|
35
|
-
{
|
|
36
|
-
key: "prefix",
|
|
37
|
-
type: "text",
|
|
38
|
-
tooltip: "Add Prefix (e.g., 'example.com' becomes 'https://example.com')",
|
|
39
|
-
},
|
|
40
|
-
],
|
|
41
|
-
},
|
|
42
|
-
];
|
|
43
|
-
var floatTransformations = [
|
|
44
|
-
{
|
|
45
|
-
value: "number_of_decimals",
|
|
46
|
-
label: "Number of Decimals",
|
|
47
|
-
options: [
|
|
48
|
-
{
|
|
49
|
-
key: "number_of_decimals",
|
|
50
|
-
type: "number",
|
|
51
|
-
tooltip: "Set Number of Decimals (e.g., '10.567' becomes '10.57' with 2 decimals)",
|
|
52
|
-
},
|
|
53
|
-
],
|
|
54
|
-
},
|
|
55
|
-
];
|
|
56
|
-
var integerTransformations = [
|
|
57
|
-
{
|
|
58
|
-
value: "round",
|
|
59
|
-
label: "Round (e.g. 3.19 -> 3)",
|
|
60
|
-
},
|
|
61
|
-
{
|
|
62
|
-
value: "floor",
|
|
63
|
-
label: "Floor (e.g. 3.99 -> 3)",
|
|
64
|
-
},
|
|
65
|
-
{
|
|
66
|
-
value: "ceiling",
|
|
67
|
-
label: "Ceiling (e.g. 3.01 -> 4)",
|
|
68
|
-
},
|
|
69
|
-
];
|
|
70
|
-
var enumTransformations = [
|
|
71
|
-
{
|
|
72
|
-
value: "autodetect",
|
|
73
|
-
label: "Autodetect (e.g. 0/1 -> true/false)",
|
|
74
|
-
isDefaultTransformation: true,
|
|
75
|
-
},
|
|
76
|
-
];
|
|
77
|
-
export var transformationsByColumnType = {
|
|
78
|
-
string: stringTransformations,
|
|
79
|
-
integer: integerTransformations,
|
|
80
|
-
float: floatTransformations,
|
|
81
|
-
enum: enumTransformations,
|
|
82
|
-
url: urlTransformations,
|
|
83
|
-
date: commonDateAndTimeTransformations,
|
|
84
|
-
datetime: commonDateAndTimeTransformations,
|
|
85
|
-
time: commonDateAndTimeTransformations,
|
|
86
|
-
};
|
|
87
|
-
// the final object will look like this:
|
|
88
|
-
// { autodetect: { value: "autodetect", label: "Autodetect" }, ... }
|
|
89
|
-
export var transformationsByType = Object.values(transformationsByColumnType)
|
|
90
|
-
.reduce(function (acc, arr) { return acc.concat(arr); }, [])
|
|
91
|
-
.reduce(function (result, p) {
|
|
92
|
-
result[p.value] = p;
|
|
93
|
-
return result;
|
|
94
|
-
}, {});
|