fuse-importer 0.2.0-testing → 0.2.1-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/ImporterWithContext.js +9 -8
- package/lib/esm/Importer/Matcher/EnumFieldsMatchers/EnumFieldMatcher/index.js +2 -2
- package/lib/esm/Importer/PreviewModeBanner.js +2 -2
- package/lib/esm/Importer/Stepper/StepperSubmitModal.js +4 -21
- package/lib/esm/Importer/Stepper/index.js +13 -15
- package/lib/esm/Importer/TrialModeBanner.d.ts +1 -0
- package/lib/esm/Importer/TrialModeBanner.js +22 -0
- package/lib/esm/Importer/Uploader/DragAndDropImporter/ImporterSectionHeader/index.js +1 -1
- package/lib/esm/Importer/common/Spreadsheet/FilteredDataContextProvider/index.d.ts +0 -1
- package/lib/esm/Importer/common/Spreadsheet/FilteredDataContextProvider/index.js +1 -6
- package/lib/esm/Importer/common/Spreadsheet/SpreadsheetContextProvider/index.d.ts +1 -2
- package/lib/esm/Importer/common/Spreadsheet/SpreadsheetContextProvider/index.js +1 -2
- package/lib/esm/Importer/common/Spreadsheet/SpreadsheetContextProvider/useDataSetManipulation.d.ts +0 -3
- package/lib/esm/Importer/common/Spreadsheet/SpreadsheetContextProvider/useDataSetManipulation.js +13 -46
- package/lib/esm/Importer/common/Spreadsheet/ValidationContextProvider/index.js +2 -7
- package/lib/esm/Importer/common/Spreadsheet/components/FindAndReplace/index.js +2 -8
- package/lib/esm/Importer/common/Spreadsheet/components/{SpreadsheetData/index.d.ts → SpreadsheetData.d.ts} +1 -1
- package/lib/esm/Importer/common/Spreadsheet/components/{SpreadsheetData/index.js → SpreadsheetData.js} +17 -18
- package/lib/esm/Importer/common/Spreadsheet/components/fields/SpreadsheetInput.js +1 -2
- package/lib/esm/Importer/common/Spreadsheet/components/fields/index.d.ts +0 -11
- package/lib/esm/Importer/common/Spreadsheet/components/fields/index.js +10 -13
- package/lib/esm/Importer/contexts/ImporterContextProvider.d.ts +1 -3
- package/lib/esm/Importer/contexts/ImporterContextProvider.js +0 -4
- package/lib/esm/Importer/hooks/useSubmitToServer.js +0 -25
- package/lib/esm/common/Table/TableActions/SearchRows.js +17 -9
- package/lib/esm/common/Table/TableView/TableRows/TableRow.js +1 -1
- package/lib/esm/common/inputs/Autocomplete.js +1 -1
- package/lib/esm/common/inputs/TextInput.d.ts +0 -1
- package/lib/esm/common/inputs/TextInput.js +2 -10
- package/lib/esm/index.js +1 -1
- package/lib/esm/locales/de.d.ts +0 -10
- package/lib/esm/locales/de.js +0 -10
- package/lib/esm/locales/en.d.ts +0 -10
- package/lib/esm/locales/en.js +0 -10
- package/lib/esm/locales/es.d.ts +0 -10
- package/lib/esm/locales/es.js +0 -10
- package/lib/esm/locales/fr.d.ts +0 -10
- package/lib/esm/locales/fr.js +0 -10
- package/lib/esm/types.d.ts +0 -1
- package/lib/main.js +9 -9
- package/package.json +1 -1
- package/lib/esm/Importer/WarningsBanner.d.ts +0 -3
- package/lib/esm/Importer/WarningsBanner.js +0 -42
- package/lib/esm/Importer/common/Spreadsheet/KeyboardEventContextProvider/index.d.ts +0 -7
- package/lib/esm/Importer/common/Spreadsheet/KeyboardEventContextProvider/index.js +0 -73
- package/lib/esm/Importer/common/Spreadsheet/SearchContextProvider/index.d.ts +0 -15
- package/lib/esm/Importer/common/Spreadsheet/SearchContextProvider/index.js +0 -43
- package/lib/esm/Importer/common/Spreadsheet/SpreadsheetContextProvider/useCellSelection.d.ts +0 -24
- package/lib/esm/Importer/common/Spreadsheet/SpreadsheetContextProvider/useCellSelection.js +0 -207
- package/lib/esm/Importer/common/Spreadsheet/UndoRedoContextProvider/index.d.ts +0 -16
- package/lib/esm/Importer/common/Spreadsheet/UndoRedoContextProvider/index.js +0 -104
- package/lib/esm/Importer/common/Spreadsheet/components/SpreadsheetData/CellContextProvider.d.ts +0 -23
- package/lib/esm/Importer/common/Spreadsheet/components/SpreadsheetData/CellContextProvider.js +0 -128
|
@@ -62,7 +62,6 @@ import { useSpreadsheetContext } from "../../SpreadsheetContextProvider";
|
|
|
62
62
|
import { useDataSetManipulation } from "../../SpreadsheetContextProvider/useDataSetManipulation";
|
|
63
63
|
import { useValidationContext } from "../../ValidationContextProvider";
|
|
64
64
|
import { parseValue } from "../../common";
|
|
65
|
-
import { useCellContext } from "../SpreadsheetData/CellContextProvider";
|
|
66
65
|
export var useSpreadsheetField = function (name, record, fieldType) {
|
|
67
66
|
var appendNewRecordToSpreadsheet = useDataSetManipulation().appendNewRecordToSpreadsheet;
|
|
68
67
|
var _a = useFilteredDataContext(), lastFilteredRecordId = _a.lastFilteredRecordId, spreadsheetFilter = _a.spreadsheetFilter;
|
|
@@ -115,40 +114,38 @@ export var useSpreadsheetField = function (name, record, fieldType) {
|
|
|
115
114
|
validationWarning: validationWarning,
|
|
116
115
|
};
|
|
117
116
|
};
|
|
118
|
-
|
|
117
|
+
var ContentContainer = styled(Div)(templateObject_9 || (templateObject_9 = __makeTemplateObject(["\n height: calc(100% - 1px);\n width: ", ";\n overflow: hidden;\n\n ", "\n\n &:focus-within, \n &:hover {\n ", "\n }\n\n &:focus-within, \n &:hover {\n ", "\n }\n\n ", ";\n ", "\n ", "\n ", "\n\n ", "\n\n ", "\n"], ["\n height: calc(100% - 1px);\n width: ", ";\n overflow: hidden;\n\n ", "\n\n &:focus-within, \n &:hover {\n ", "\n }\n\n &:focus-within, \n &:hover {\n ", "\n }\n\n ", ";\n ", "\n ", "\n ", "\n\n ", "\n\n ", "\n"])), function (_a) {
|
|
119
118
|
var defaultFieldWidth = _a.defaultFieldWidth;
|
|
120
119
|
return defaultFieldWidth ? "".concat(defaultFieldWidth, "px") : "100%";
|
|
121
120
|
}, function (_a) {
|
|
122
121
|
var expandedFieldWidth = _a.expandedFieldWidth;
|
|
123
122
|
return expandedFieldWidth && css(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n position: absolute;\n "], ["\n position: absolute;\n "])));
|
|
124
123
|
}, function (_a) {
|
|
125
|
-
var hasError = _a.hasError, hasWarning = _a.hasWarning, isHighlighted = _a.isHighlighted, theme = _a.theme, shouldExpandInput = _a.shouldExpandInput
|
|
124
|
+
var hasError = _a.hasError, hasWarning = _a.hasWarning, isHighlighted = _a.isHighlighted, theme = _a.theme, shouldExpandInput = _a.shouldExpandInput;
|
|
126
125
|
return shouldExpandInput &&
|
|
127
126
|
!hasError &&
|
|
128
|
-
!hasWarning &&
|
|
129
|
-
!isSelected && css(templateObject_2 || (templateObject_2 = __makeTemplateObject(["\n background: ", ";\n box-shadow: 0px 0px 0px 2px ", " inset;\n "], ["\n background: ", ";\n box-shadow: 0px 0px 0px 2px ", " inset;\n "])), !isHighlighted
|
|
127
|
+
!hasWarning && css(templateObject_2 || (templateObject_2 = __makeTemplateObject(["\n background: ", ";\n box-shadow: 0px 0px 0px 2px ", " inset;\n "], ["\n background: ", ";\n box-shadow: 0px 0px 0px 2px ", " inset;\n "])), !isHighlighted
|
|
130
128
|
? theme.colors.white
|
|
131
129
|
: theme.colors.blue100, function (p) { return p.theme.colors.blue500; });
|
|
132
130
|
}, function (_a) {
|
|
133
131
|
var expandedFieldWidth = _a.expandedFieldWidth, shouldExpandInput = _a.shouldExpandInput;
|
|
134
132
|
return shouldExpandInput && css(templateObject_3 || (templateObject_3 = __makeTemplateObject(["\n width: ", ";\n\n .suffix {\n right: 12px;\n }\n "], ["\n width: ", ";\n\n .suffix {\n right: 12px;\n }\n "])), expandedFieldWidth || "auto");
|
|
135
133
|
}, function (p) { return p.theme.css.alignCenter; }, function (p) {
|
|
136
|
-
return p.hasWarning && css(
|
|
134
|
+
return p.hasWarning && css(templateObject_4 || (templateObject_4 = __makeTemplateObject(["\n color: ", ";\n background: ", ";\n /* internal border */\n box-shadow: 0px 0px 0px 1px ", " inset;\n "], ["\n color: ", ";\n background: ", ";\n /* internal border */\n box-shadow: 0px 0px 0px 1px ", " inset;\n "])), function (p) { return p.theme.colors.orange1200; }, function (p) { return p.theme.colors.orange1100; }, function (p) { return p.theme.colors.orange500; });
|
|
137
135
|
}, function (p) {
|
|
138
|
-
return p.hasError && css(
|
|
136
|
+
return p.hasError && css(templateObject_5 || (templateObject_5 = __makeTemplateObject(["\n color: ", ";\n background: ", ";\n /* internal border */\n box-shadow: 0px 0px 0px 1px ", " inset;\n "], ["\n color: ", ";\n background: ", ";\n /* internal border */\n box-shadow: 0px 0px 0px 1px ", " inset;\n "])), function (p) { return p.theme.colors.error; }, function (p) { return p.theme.colors.red100; }, function (p) { return p.theme.colors.error; });
|
|
139
137
|
}, function (p) {
|
|
140
|
-
return p.isHighlighted && css(
|
|
138
|
+
return p.isHighlighted && css(templateObject_6 || (templateObject_6 = __makeTemplateObject(["\n background: ", ";\n /* internal border */\n box-shadow: 0px 0px 0px 2px ", " inset;\n z-index: 99;\n color: ", ";\n\n &:hover {\n z-index: 100;\n }\n\n input {\n color: ", ";\n }\n "], ["\n background: ", ";\n /* internal border */\n box-shadow: 0px 0px 0px 2px ", " inset;\n z-index: 99;\n color: ", ";\n\n &:hover {\n z-index: 100;\n }\n\n input {\n color: ", ";\n }\n "])), function (p) { return p.theme.colors.blue100; }, function (p) { return p.theme.colors.blue500; }, function (p) { return p.theme.colors.gray1000; }, function (p) { return p.theme.colors.gray1000; });
|
|
141
139
|
}, function (_a) {
|
|
142
140
|
var shouldExpandInput = _a.shouldExpandInput, isHighlighted = _a.isHighlighted;
|
|
143
141
|
return shouldExpandInput &&
|
|
144
|
-
!isHighlighted && css(
|
|
142
|
+
!isHighlighted && css(templateObject_7 || (templateObject_7 = __makeTemplateObject(["\n z-index: 1;\n "], ["\n z-index: 1;\n "])));
|
|
145
143
|
}, function (p) {
|
|
146
|
-
return p.isReadOnly && css(
|
|
144
|
+
return p.isReadOnly && css(templateObject_8 || (templateObject_8 = __makeTemplateObject(["\n pointer-events: none;\n "], ["\n pointer-events: none;\n "])));
|
|
147
145
|
});
|
|
148
146
|
export var SpreadsheetField = function (_a) {
|
|
149
147
|
var validationError = _a.validationError, validationWarning = _a.validationWarning, children = _a.children, isHighlighted = _a.isHighlighted, expandedFieldWidth = _a.expandedFieldWidth, shouldExpandInput = _a.shouldExpandInput, defaultFieldWidth = _a.defaultFieldWidth;
|
|
150
148
|
var isReadOnly = useSpreadsheetContext().isReadOnly;
|
|
151
|
-
|
|
152
|
-
return (_jsx(Div, __assign({ dim: "100%" }, selectionProps, { children: _jsx(TooltipProvider, __assign({ tooltip: validationError || validationWarning }, { children: _jsx(Div, __assign({ dim: "100%" }, { children: _jsx(ContentContainer, __assign({ css: selectedCellStyles, hasError: validationError !== null, hasWarning: validationWarning !== null, isSelected: isSelected, isHighlighted: isHighlighted, expandedFieldWidth: expandedFieldWidth, defaultFieldWidth: defaultFieldWidth, shouldExpandInput: shouldExpandInput, isReadOnly: isReadOnly, className: "input-content" }, { children: children })) })) })) })));
|
|
149
|
+
return (_jsx(Div, __assign({ dim: "100%" }, { children: _jsx(TooltipProvider, __assign({ tooltip: validationError || validationWarning }, { children: _jsx(Div, __assign({ dim: "100%" }, { children: _jsx(ContentContainer, __assign({ hasError: validationError !== null, hasWarning: validationWarning !== null, isHighlighted: isHighlighted, expandedFieldWidth: expandedFieldWidth, defaultFieldWidth: defaultFieldWidth, shouldExpandInput: shouldExpandInput, isReadOnly: isReadOnly, className: "input-content" }, { children: children })) })) })) })));
|
|
153
150
|
};
|
|
154
|
-
var templateObject_1, templateObject_2, templateObject_3, templateObject_4, templateObject_5, templateObject_6, templateObject_7, templateObject_8, templateObject_9
|
|
151
|
+
var templateObject_1, templateObject_2, templateObject_3, templateObject_4, templateObject_5, templateObject_6, templateObject_7, templateObject_8, templateObject_9;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import React
|
|
1
|
+
import React from "react";
|
|
2
2
|
import { CustomAction, FormatRecord, ImporterOptions, Integration, OnSubmit, OnValidateRecord, Record, TemplateHeader } from "../../types";
|
|
3
3
|
import { FuseApi } from "../common/FuseApi";
|
|
4
4
|
export type HeaderMatchings = {
|
|
@@ -31,7 +31,6 @@ export type State = {
|
|
|
31
31
|
templateSlug: string;
|
|
32
32
|
apiToken: string;
|
|
33
33
|
inTrialMode: boolean;
|
|
34
|
-
hasValidSubmitFn: boolean;
|
|
35
34
|
previewFirstTime: boolean;
|
|
36
35
|
fuseApi: FuseApi;
|
|
37
36
|
importerOptions: ImporterOptions;
|
|
@@ -61,7 +60,6 @@ export type State = {
|
|
|
61
60
|
headerMappingsLoaded: boolean;
|
|
62
61
|
valueMappingsLoaded: boolean;
|
|
63
62
|
headersMappings: HeaderMappings[];
|
|
64
|
-
layoutRef: MutableRefObject<HTMLDivElement>;
|
|
65
63
|
};
|
|
66
64
|
export type Props = {
|
|
67
65
|
templateSlug: string;
|
|
@@ -84,7 +84,6 @@ export var ImporterContextProvider = function (_a) {
|
|
|
84
84
|
var _r = useState(0), headerRowIndex = _r[0], setHeaderRowIndex = _r[1];
|
|
85
85
|
var _s = useState(false), headerMappingsLoaded = _s[0], setHeaderMappingsLoaded = _s[1];
|
|
86
86
|
var _t = useState(false), valueMappingsLoaded = _t[0], setValueMappingsLoaded = _t[1];
|
|
87
|
-
var layoutRef = useRef(null);
|
|
88
87
|
var fuseApi = useMemo(function () { return new FuseApi(options.env, apiToken); }, [
|
|
89
88
|
options.env,
|
|
90
89
|
apiToken,
|
|
@@ -327,7 +326,6 @@ export var ImporterContextProvider = function (_a) {
|
|
|
327
326
|
}
|
|
328
327
|
};
|
|
329
328
|
var inTrialMode = organization === null || organization === void 0 ? void 0 : organization.trial_mode;
|
|
330
|
-
var hasValidSubmitFn = typeof onSubmit === "function";
|
|
331
329
|
var value = {
|
|
332
330
|
initialRecords: initialRecords,
|
|
333
331
|
currentStepIndex: currentStepIndex,
|
|
@@ -344,7 +342,6 @@ export var ImporterContextProvider = function (_a) {
|
|
|
344
342
|
apiToken: apiToken,
|
|
345
343
|
templateSlug: templateSlug,
|
|
346
344
|
inTrialMode: inTrialMode,
|
|
347
|
-
hasValidSubmitFn: hasValidSubmitFn,
|
|
348
345
|
fuseApi: fuseApi,
|
|
349
346
|
theme: style.theme,
|
|
350
347
|
logoURL: style.logoURL,
|
|
@@ -373,7 +370,6 @@ export var ImporterContextProvider = function (_a) {
|
|
|
373
370
|
headerMappingsLoaded: headerMappingsLoaded,
|
|
374
371
|
valueMappingsLoaded: valueMappingsLoaded,
|
|
375
372
|
headersMappings: headersMappings,
|
|
376
|
-
layoutRef: layoutRef,
|
|
377
373
|
};
|
|
378
374
|
return (_jsx(ImporterContext.Provider, __assign({ value: value }, { children: children })));
|
|
379
375
|
};
|
|
@@ -58,7 +58,6 @@ import { useState } from "react";
|
|
|
58
58
|
import { isRecordEmpty } from "../../Importer/common/Spreadsheet/common";
|
|
59
59
|
import { sendRecordsToIntegrations } from "../../Importer/common/utils";
|
|
60
60
|
import { getTemplateFields, recordListToDataSet } from "../../Importer/data";
|
|
61
|
-
import { addToast } from "../../common";
|
|
62
61
|
import { useImporterContext, } from "../contexts/ImporterContextProvider";
|
|
63
62
|
var trackImportedRowsCount = function (fuseApi, templateSlug, rowCount) { return __awaiter(void 0, void 0, void 0, function () {
|
|
64
63
|
var error_1, errorMessage;
|
|
@@ -139,29 +138,6 @@ var filterAndMapWithBackendErrors = function (dataSet, errors) {
|
|
|
139
138
|
return __assign(__assign({}, record), { _meta: __assign(__assign({}, meta), { isInvalid: true, backendErrors: errors[rId] }) });
|
|
140
139
|
}, []);
|
|
141
140
|
};
|
|
142
|
-
var checkWrongData = function (dataSet, errors, reviewFields) {
|
|
143
|
-
var errorsKeys = Object.keys(errors);
|
|
144
|
-
var highestRowIndex = 0;
|
|
145
|
-
Object.values(dataSet).forEach(function (record) {
|
|
146
|
-
highestRowIndex = Math.max(highestRowIndex, record._meta.rowIndex);
|
|
147
|
-
});
|
|
148
|
-
var _loop_1 = function (currErrorId) {
|
|
149
|
-
var allFieldsName = reviewFields.map(function (field) { return field.name; });
|
|
150
|
-
var columnsOnError = Object.keys(errors[currErrorId]);
|
|
151
|
-
columnsOnError.forEach(function (column) {
|
|
152
|
-
if (!allFieldsName.includes(column)) {
|
|
153
|
-
addToast("Invalid column \"".concat(column, "\""), "error");
|
|
154
|
-
}
|
|
155
|
-
});
|
|
156
|
-
if (+currErrorId > highestRowIndex) {
|
|
157
|
-
addToast("Invalid row id \"".concat(currErrorId, "\""), "error");
|
|
158
|
-
}
|
|
159
|
-
};
|
|
160
|
-
for (var _i = 0, errorsKeys_1 = errorsKeys; _i < errorsKeys_1.length; _i++) {
|
|
161
|
-
var currErrorId = errorsKeys_1[_i];
|
|
162
|
-
_loop_1(currErrorId);
|
|
163
|
-
}
|
|
164
|
-
};
|
|
165
141
|
export var useSubmitToServer = function (setHasTransformedRecords) {
|
|
166
142
|
var _a = useImporterContext(), enumFieldValueMatchings = _a.enumFieldValueMatchings, templateHeaderMatchings = _a.templateHeaderMatchings, templateHeaders = _a.templateHeaders, integrations = _a.integrations, templateSlug = _a.templateSlug, fuseApi = _a.fuseApi, previewMode = _a.importerOptions.previewMode, onSubmit = _a.onSubmit;
|
|
167
143
|
var _b = useState(false), isSubmitting = _b[0], setIsSubmitting = _b[1];
|
|
@@ -190,7 +166,6 @@ export var useSubmitToServer = function (setHasTransformedRecords) {
|
|
|
190
166
|
if (!isAppResponseSuccessful) {
|
|
191
167
|
_a = (applicationResponse !== null && applicationResponse !== void 0 ? applicationResponse : {}).errors, errors = _a === void 0 ? {} : _a;
|
|
192
168
|
invalidRecords_1 = __spreadArray(__spreadArray([], filterAndMapWithBackendErrors(dataSet, errors), true), invalidRecords_1, true);
|
|
193
|
-
checkWrongData(dataSet, errors, reviewFields_1);
|
|
194
169
|
}
|
|
195
170
|
isDataValid = invalidRecords_1.length === 0;
|
|
196
171
|
setImportWasSuccessful(isDataValid && isAppResponseSuccessful);
|
|
@@ -14,7 +14,7 @@ var __assign = (this && this.__assign) || function () {
|
|
|
14
14
|
return __assign.apply(this, arguments);
|
|
15
15
|
};
|
|
16
16
|
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
17
|
-
import { useRef } from "react";
|
|
17
|
+
import { useRef, useState } from "react";
|
|
18
18
|
import { useTranslation } from "react-i18next";
|
|
19
19
|
import styled, { css } from "styled-components";
|
|
20
20
|
import { useReviewContext } from "../../../Importer";
|
|
@@ -26,7 +26,6 @@ import { Div } from "../../../styled";
|
|
|
26
26
|
import { colors } from "../../../styled/theme/colorPalette";
|
|
27
27
|
import { textStyles } from "../../../styled/theme/textStyles";
|
|
28
28
|
import { ReplaceIcon, SearchIcon } from "./icons";
|
|
29
|
-
import { useSearchContext } from "../../../Importer/common/Spreadsheet/SearchContextProvider";
|
|
30
29
|
var Wrapper = styled(Div)(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n background: ", ";\n border-radius: 4px;\n cursor: pointer;\n display: flex;\n gap: 8px;\n height: 24px;\n overflow: hidden;\n padding: 8px;\n position: relative;\n transition: width 0.25s ease-in-out;\n width: ", ";\n"], ["\n background: ", ";\n border-radius: 4px;\n cursor: pointer;\n display: flex;\n gap: 8px;\n height: 24px;\n overflow: hidden;\n padding: 8px;\n position: relative;\n transition: width 0.25s ease-in-out;\n width: ", ";\n"])), function (_a) {
|
|
31
30
|
var isOpen = _a.isOpen;
|
|
32
31
|
return (isOpen ? colors.orange50 : "none");
|
|
@@ -44,8 +43,10 @@ var Input = styled.input(templateObject_6 || (templateObject_6 = __makeTemplateO
|
|
|
44
43
|
var SearchInput = function (_a) {
|
|
45
44
|
var testId = _a.testId, value = _a.value, onChange = _a.onChange, isDisabled = _a.isDisabled;
|
|
46
45
|
var _b = useDebounce(value, onChange, 300), _value = _b._value, set_Value = _b.set_Value;
|
|
46
|
+
var inputRef = useRef(null);
|
|
47
47
|
var filteredDataIds = useFilteredDataContext().filteredDataIds;
|
|
48
|
-
var _c =
|
|
48
|
+
var _c = useState(false), findAndReplaceModalOpen = _c[0], setFindAndReplaceModalOpen = _c[1];
|
|
49
|
+
var _d = useState(false), isOpen = _d[0], setIsOpen = _d[1];
|
|
49
50
|
var actionsRef = useRef();
|
|
50
51
|
var t = useTranslation("review").t;
|
|
51
52
|
var handleInputChange = function (_a) {
|
|
@@ -54,14 +55,21 @@ var SearchInput = function (_a) {
|
|
|
54
55
|
};
|
|
55
56
|
var handleInputOnBlur = function (e) {
|
|
56
57
|
if (!_value && e.relatedTarget !== actionsRef.current) {
|
|
57
|
-
|
|
58
|
+
setIsOpen(false);
|
|
58
59
|
}
|
|
59
60
|
};
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
61
|
+
var handleWrapperClick = function () {
|
|
62
|
+
var _a;
|
|
63
|
+
if (!isOpen) {
|
|
64
|
+
setIsOpen(true);
|
|
65
|
+
if (inputRef === null || inputRef === void 0 ? void 0 : inputRef.current) {
|
|
66
|
+
(_a = inputRef.current) === null || _a === void 0 ? void 0 : _a.focus();
|
|
67
|
+
}
|
|
68
|
+
}
|
|
69
|
+
};
|
|
70
|
+
return (_jsxs(TooltipProvider, __assign({ tooltip: !isOpen && !isDisabled ? t("table_actions.search_rows.tooltip") : "", placement: "right", flip: false, centered: true, w: "auto", "data-testid": testId }, { children: [_jsxs(Wrapper, __assign({ isOpen: isOpen, onClick: function () { return !isDisabled && handleWrapperClick(); }, disabledWhen: isDisabled }, { children: [_jsx(IconWrapper, { children: _jsx(SearchIcon, {}) }), _jsx(Input, { isOpen: isOpen, ref: inputRef, value: _value, onChange: handleInputChange, onBlur: handleInputOnBlur, type: "text", placeholder: t("table_actions.search_rows.placeholder") }), _jsxs(ActionsWrapper, __assign({ "data-cy": "open-find-replace", ref: actionsRef, onClick: function () { return setFindAndReplaceModalOpen(true); }, tabIndex: 0 }, { children: [_jsx(ResultsText, { children: t("table_actions.search_rows.number_of_results", {
|
|
71
|
+
length: value ? filteredDataIds.length : 0,
|
|
72
|
+
}) }), _jsx(IconWrapper, { children: _jsx(ReplaceIcon, {}) })] }))] })), findAndReplaceModalOpen && (_jsx(FindAndReplaceModal, { initialText: value, onClose: function () { return setFindAndReplaceModalOpen(false); } }))] })));
|
|
65
73
|
};
|
|
66
74
|
export var SearchRows = function (_a) {
|
|
67
75
|
var _b = _a.testId, testId = _b === void 0 ? "ta-search-rows" : _b;
|
|
@@ -51,7 +51,7 @@ export var TableRow = function (_a) {
|
|
|
51
51
|
var isLastColumn = indexJ === columns.length - 1;
|
|
52
52
|
return (_jsx(Cell, __assign({ row: row, onClick: onRowClick && !column.preventRowClick
|
|
53
53
|
? function () { return onRowClick(row); }
|
|
54
|
-
: null, isLast: isLastColumn, className: isLastColumn ? "last-column" : "", w: columnWidthPercentage }, { children: Content ? (_jsx(Content, __assign({}, row, { columnWidth: columnWidthPercentage,
|
|
54
|
+
: null, isLast: isLastColumn, className: isLastColumn ? "last-column" : "", w: columnWidthPercentage }, { children: Content ? (_jsx(Content, __assign({}, row, { columnWidth: columnWidthPercentage, rowIndex: indexI }))) : (_jsx(Div, __assign({ truncateText: true }, { children: row[column.dataAccessor] || "-" }))) }), resolvedKey));
|
|
55
55
|
}) })));
|
|
56
56
|
};
|
|
57
57
|
var templateObject_1, templateObject_2, templateObject_3;
|
|
@@ -83,7 +83,7 @@ var Autocomplete = function (_a) {
|
|
|
83
83
|
})
|
|
84
84
|
: options;
|
|
85
85
|
}, [updatedText, text, options]);
|
|
86
|
-
var inputIconUI = text ? (_jsx(ClearIcon, __assign({ clickable: true, dim: 24, centered: true,
|
|
86
|
+
var inputIconUI = text ? (_jsx(ClearIcon, __assign({ clickable: true, dim: 24, centered: true, id: id ? "".concat(id, "-clear") : null, onClick: function (evt) {
|
|
87
87
|
evt.preventDefault();
|
|
88
88
|
evt.stopPropagation();
|
|
89
89
|
onChange(undefined);
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
2
|
import { DivCSSProps } from "../../styled/utils";
|
|
3
|
-
export declare const handleInputPaste: (event: any) => void;
|
|
4
3
|
export declare const HTMLInput: import("styled-components").StyledComponent<"input", import("styled-components").DefaultTheme, {
|
|
5
4
|
padding?: string;
|
|
6
5
|
}, never>;
|
|
@@ -31,14 +31,6 @@ import { FormInputLabel } from "..";
|
|
|
31
31
|
import { useDebounce } from "../../hooks";
|
|
32
32
|
import { Div } from "../../styled/utils";
|
|
33
33
|
import Tooltip from "./tooltip";
|
|
34
|
-
export var handleInputPaste = function (event) {
|
|
35
|
-
var clipboardData = event.clipboardData;
|
|
36
|
-
var pastedData = clipboardData.getData("text");
|
|
37
|
-
if (pastedData.includes("\t") || pastedData.includes("\n")) {
|
|
38
|
-
event.preventDefault();
|
|
39
|
-
event.stopPropagation();
|
|
40
|
-
}
|
|
41
|
-
};
|
|
42
34
|
export var HTMLInput = styled.input(templateObject_3 || (templateObject_3 = __makeTemplateObject(["\n position: relative;\n\n padding: ", ";\n height: 68px;\n margin: 0px;\n box-shadow: none;\n\n outline: none;\n\n border: 1px solid ", ";\n box-sizing: border-box;\n border-radius: 8px;\n width: 100%;\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 ", ";\n\n ::placeholder {\n color: ", ";\n }\n\n :focus {\n border: 2px solid ", ";\n\n /* 3d at the end adds .24 opacity (using 8 digit hex)*/\n box-shadow: 0px 0px 8px ", "3d;\n }\n\n :hover {\n box-shadow: none;\n background: transparent;\n }\n\n ", "\n ", "\n"], ["\n position: relative;\n\n padding: ", ";\n height: 68px;\n margin: 0px;\n box-shadow: none;\n\n outline: none;\n\n border: 1px solid ", ";\n box-sizing: border-box;\n border-radius: 8px;\n width: 100%;\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 ", ";\n\n ::placeholder {\n color: ", ";\n }\n\n :focus {\n border: 2px solid ", ";\n\n /* 3d at the end adds .24 opacity (using 8 digit hex)*/\n box-shadow: 0px 0px 8px ", "3d;\n }\n\n :hover {\n box-shadow: none;\n background: transparent;\n }\n\n ", "\n ", "\n"])), function (_a) {
|
|
43
35
|
var padding = _a.padding;
|
|
44
36
|
return (padding ? padding : "20px 16px");
|
|
@@ -61,7 +53,7 @@ var TextInput = function (_a) {
|
|
|
61
53
|
: isPasswordField || icon
|
|
62
54
|
? "20px 35px 20px 16px"
|
|
63
55
|
: null;
|
|
64
|
-
return (_jsxs(Div, __assign({ w100: true }, props, { children: [showLabel ? (_jsx(FormInputLabel, __assign({ isDisabled: isDisabled, mb: 8, htmlFor: id, h: 20 }, { children: _jsxs(Div, __assign({ dflex: true }, { children: [_jsx(Div, __assign({ centered: true }, { children: label })), labelTooltip ? _jsx(Tooltip, { ml: 4, tooltip: labelTooltip }) : null] })) }))) : null, _jsxs(Div, __assign({ pRelative: true }, { children: [_jsx(HTMLInput, __assign({
|
|
56
|
+
return (_jsxs(Div, __assign({ w100: true }, props, { children: [showLabel ? (_jsx(FormInputLabel, __assign({ isDisabled: isDisabled, mb: 8, htmlFor: id, h: 20 }, { children: _jsxs(Div, __assign({ dflex: true }, { children: [_jsx(Div, __assign({ centered: true }, { children: label })), labelTooltip ? _jsx(Tooltip, { ml: 4, tooltip: labelTooltip }) : null] })) }))) : null, _jsxs(Div, __assign({ pRelative: true }, { children: [_jsx(HTMLInput, __assign({}, {
|
|
65
57
|
placeholder: placeholder,
|
|
66
58
|
isDisabled: isDisabled,
|
|
67
59
|
onFocus: onFocus,
|
|
@@ -71,7 +63,7 @@ var TextInput = function (_a) {
|
|
|
71
63
|
id: id,
|
|
72
64
|
padding: padding,
|
|
73
65
|
name: name,
|
|
74
|
-
}, {
|
|
66
|
+
}, { autoComplete: "off", type: isPasswordVisible ? "text" : type, value: _value || "", onChange: function (_a) {
|
|
75
67
|
var value = _a.target.value;
|
|
76
68
|
return set_Value(value);
|
|
77
69
|
}, ref: setInputRef, onBlur: function () {
|
package/lib/esm/index.js
CHANGED
|
@@ -99,7 +99,7 @@ var FuseImporter = /** @class */ (function () {
|
|
|
99
99
|
case 0: return [4 /*yield*/, this.configureI18n()];
|
|
100
100
|
case 1:
|
|
101
101
|
_a.sent();
|
|
102
|
-
isRunningTest =
|
|
102
|
+
isRunningTest = typeof (window === null || window === void 0 ? void 0 : window.Cypress) !== "undefined";
|
|
103
103
|
if (isRunningTest) {
|
|
104
104
|
this.renderImporterComponent();
|
|
105
105
|
i18n.reloadResources();
|
package/lib/esm/locales/de.d.ts
CHANGED
|
@@ -129,15 +129,5 @@ declare const _default: {
|
|
|
129
129
|
title: string;
|
|
130
130
|
};
|
|
131
131
|
};
|
|
132
|
-
warnings_banner: {
|
|
133
|
-
trial_mode: {
|
|
134
|
-
info_text: string;
|
|
135
|
-
button_text: string;
|
|
136
|
-
};
|
|
137
|
-
invalid_submit_fn: {
|
|
138
|
-
info_text: string;
|
|
139
|
-
button_text: string;
|
|
140
|
-
};
|
|
141
|
-
};
|
|
142
132
|
};
|
|
143
133
|
export default _default;
|
package/lib/esm/locales/de.js
CHANGED
|
@@ -130,14 +130,4 @@ export default {
|
|
|
130
130
|
title: "Sie sind derzeit im Vorschau-Modus.",
|
|
131
131
|
},
|
|
132
132
|
},
|
|
133
|
-
warnings_banner: {
|
|
134
|
-
trial_mode: {
|
|
135
|
-
info_text: "Dieses Konto befindet sich im Testmodus. Importe sind auf 100 Datensätze beschränkt.",
|
|
136
|
-
button_text: "Plan auswählen",
|
|
137
|
-
},
|
|
138
|
-
invalid_submit_fn: {
|
|
139
|
-
info_text: "Senden ist deaktiviert. Schalten Sie den Inkognito-Modus aus oder fügen Sie einen onSubmit-Hook hinzu, um das Senden zu aktivieren.",
|
|
140
|
-
button_text: "Wie geht das?",
|
|
141
|
-
},
|
|
142
|
-
},
|
|
143
133
|
};
|
package/lib/esm/locales/en.d.ts
CHANGED
|
@@ -141,16 +141,6 @@ declare const _default: {
|
|
|
141
141
|
preview_mode_banner: {
|
|
142
142
|
title: string;
|
|
143
143
|
};
|
|
144
|
-
warnings_banner: {
|
|
145
|
-
trial_mode: {
|
|
146
|
-
info_text: string;
|
|
147
|
-
button_text: string;
|
|
148
|
-
};
|
|
149
|
-
invalid_submit_fn: {
|
|
150
|
-
info_text: string;
|
|
151
|
-
button_text: string;
|
|
152
|
-
};
|
|
153
|
-
};
|
|
154
144
|
};
|
|
155
145
|
};
|
|
156
146
|
export default _default;
|
package/lib/esm/locales/en.js
CHANGED
|
@@ -142,15 +142,5 @@ export default {
|
|
|
142
142
|
preview_mode_banner: {
|
|
143
143
|
title: "You’re currently in Preview mode.",
|
|
144
144
|
},
|
|
145
|
-
warnings_banner: {
|
|
146
|
-
trial_mode: {
|
|
147
|
-
info_text: "This account is in trial mode. Imports are limited to 100 records.",
|
|
148
|
-
button_text: "Select plan",
|
|
149
|
-
},
|
|
150
|
-
invalid_submit_fn: {
|
|
151
|
-
info_text: "Submit is disabled. Turn off Incognito Mode or add an onSubmit hook to enable submit.",
|
|
152
|
-
button_text: "How to do it?",
|
|
153
|
-
},
|
|
154
|
-
},
|
|
155
145
|
},
|
|
156
146
|
};
|
package/lib/esm/locales/es.d.ts
CHANGED
|
@@ -128,16 +128,6 @@ declare const _default: {
|
|
|
128
128
|
preview_mode_banner: {
|
|
129
129
|
title: string;
|
|
130
130
|
};
|
|
131
|
-
warnings_banner: {
|
|
132
|
-
trial_mode: {
|
|
133
|
-
info_text: string;
|
|
134
|
-
button_text: string;
|
|
135
|
-
};
|
|
136
|
-
invalid_submit_fn: {
|
|
137
|
-
info_text: string;
|
|
138
|
-
button_text: string;
|
|
139
|
-
};
|
|
140
|
-
};
|
|
141
131
|
};
|
|
142
132
|
};
|
|
143
133
|
export default _default;
|
package/lib/esm/locales/es.js
CHANGED
|
@@ -129,15 +129,5 @@ export default {
|
|
|
129
129
|
preview_mode_banner: {
|
|
130
130
|
title: "Actualmente estás en modo de vista previa.",
|
|
131
131
|
},
|
|
132
|
-
warnings_banner: {
|
|
133
|
-
trial_mode: {
|
|
134
|
-
info_text: "Esta cuenta está en modo de prueba. Las importaciones están limitadas a 100 registros.",
|
|
135
|
-
button_text: "Seleccionar plan",
|
|
136
|
-
},
|
|
137
|
-
invalid_submit_fn: {
|
|
138
|
-
info_text: "Enviar está desactivado. Desactive el modo incógnito o agregue un hook onSubmit para habilitar el envío.",
|
|
139
|
-
button_text: "¿Cómo hacerlo?",
|
|
140
|
-
},
|
|
141
|
-
},
|
|
142
132
|
},
|
|
143
133
|
};
|
package/lib/esm/locales/fr.d.ts
CHANGED
|
@@ -128,16 +128,6 @@ declare const _default: {
|
|
|
128
128
|
preview_mode_banner: {
|
|
129
129
|
title: string;
|
|
130
130
|
};
|
|
131
|
-
warnings_banner: {
|
|
132
|
-
trial_mode: {
|
|
133
|
-
info_text: string;
|
|
134
|
-
button_text: string;
|
|
135
|
-
};
|
|
136
|
-
invalid_submit_fn: {
|
|
137
|
-
info_text: string;
|
|
138
|
-
button_text: string;
|
|
139
|
-
};
|
|
140
|
-
};
|
|
141
131
|
};
|
|
142
132
|
};
|
|
143
133
|
export default _default;
|
package/lib/esm/locales/fr.js
CHANGED
|
@@ -129,15 +129,5 @@ export default {
|
|
|
129
129
|
preview_mode_banner: {
|
|
130
130
|
title: "Vous êtes actuellement en mode Aperçu.",
|
|
131
131
|
},
|
|
132
|
-
warnings_banner: {
|
|
133
|
-
trial_mode: {
|
|
134
|
-
info_text: "Ce compte est en mode d'essai. Les imports sont limités à 100 enregistrements.",
|
|
135
|
-
button_text: "Sélectionner un plan",
|
|
136
|
-
},
|
|
137
|
-
invalid_submit_fn: {
|
|
138
|
-
info_text: "L'envoi est désactivé. Désactivez le mode incognito ou ajoutez un hook onSubmit pour activer l'envoi.",
|
|
139
|
-
button_text: "Comment faire ?",
|
|
140
|
-
},
|
|
141
|
-
},
|
|
142
132
|
},
|
|
143
133
|
};
|