@importcsv/react 0.1.13 → 0.1.14
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.
|
@@ -6,7 +6,7 @@ export declare const StepEnum: {
|
|
|
6
6
|
Validation: number;
|
|
7
7
|
Complete: number;
|
|
8
8
|
};
|
|
9
|
-
declare function useStepNavigation(initialStep: number, skipHeader: boolean, useConsolidated?: boolean): {
|
|
9
|
+
declare function useStepNavigation(initialStep: number, skipHeader: boolean, useConsolidated?: boolean, isDemoMode?: boolean): {
|
|
10
10
|
currentStep: any;
|
|
11
11
|
setStep: (newStep: number) => void;
|
|
12
12
|
goBack: (backStep?: number) => void;
|
package/build/index.esm.js
CHANGED
|
@@ -30186,13 +30186,19 @@ var getStepConfig = function (skipHeader, useConsolidated) {
|
|
|
30186
30186
|
{ label: "Validation", id: Steps.Validation },
|
|
30187
30187
|
];
|
|
30188
30188
|
};
|
|
30189
|
-
function useStepNavigation(initialStep, skipHeader, useConsolidated) {
|
|
30189
|
+
function useStepNavigation(initialStep, skipHeader, useConsolidated, isDemoMode) {
|
|
30190
30190
|
var _a;
|
|
30191
30191
|
if (useConsolidated === void 0) { useConsolidated = true; }
|
|
30192
|
+
if (isDemoMode === void 0) { isDemoMode = false; }
|
|
30192
30193
|
var t = useTranslation().t;
|
|
30193
30194
|
var translatedSteps = getStepConfig(skipHeader, useConsolidated).map(function (step) { return (__assign$1(__assign$1({}, step), { label: t(step.label) })); });
|
|
30194
|
-
|
|
30195
|
-
var
|
|
30195
|
+
// Map initial step to stepper index for consolidated flow
|
|
30196
|
+
var initialStepperIndex = useConsolidated && initialStep === StepEnum.MapColumns ? 1 :
|
|
30197
|
+
useConsolidated && initialStep === StepEnum.Validation ? 2 :
|
|
30198
|
+
useConsolidated && initialStep === StepEnum.Complete ? 3 : 0;
|
|
30199
|
+
var stepper = useStepper(translatedSteps, initialStepperIndex, skipHeader);
|
|
30200
|
+
// Don't use localStorage in demo mode
|
|
30201
|
+
var _b = useMutableLocalStorage("tf_steps", isDemoMode ? "" : ""), storageStep = _b[0], setStorageStep = _b[1];
|
|
30196
30202
|
var _c = useState$1(initialStep), currentStep = _c[0], setCurrentStep = _c[1];
|
|
30197
30203
|
var goBack = function (backStep) {
|
|
30198
30204
|
var targetStep = backStep !== undefined ? backStep : Math.max(0, currentStep - 1);
|
|
@@ -30217,6 +30223,10 @@ function useStepNavigation(initialStep, skipHeader, useConsolidated) {
|
|
|
30217
30223
|
stepper.setCurrent(stepperIndex);
|
|
30218
30224
|
};
|
|
30219
30225
|
useEffect$2(function () {
|
|
30226
|
+
// In demo mode, don't use localStorage
|
|
30227
|
+
if (isDemoMode) {
|
|
30228
|
+
return;
|
|
30229
|
+
}
|
|
30220
30230
|
var step = storageStep || 0;
|
|
30221
30231
|
// Map the step to the correct stepper index for consolidated flow
|
|
30222
30232
|
var stepperIndex = useConsolidated ?
|
|
@@ -30227,9 +30237,9 @@ function useStepNavigation(initialStep, skipHeader, useConsolidated) {
|
|
|
30227
30237
|
: step;
|
|
30228
30238
|
stepper.setCurrent(stepperIndex);
|
|
30229
30239
|
setCurrentStep(step);
|
|
30230
|
-
}, [storageStep]);
|
|
30240
|
+
}, [storageStep, isDemoMode]);
|
|
30231
30241
|
return {
|
|
30232
|
-
currentStep: storageStep || currentStep,
|
|
30242
|
+
currentStep: isDemoMode ? currentStep : (storageStep || currentStep),
|
|
30233
30243
|
setStep: setStep,
|
|
30234
30244
|
goBack: goBack,
|
|
30235
30245
|
goNext: goNext,
|
|
@@ -35783,7 +35793,7 @@ function Main(props) {
|
|
|
35783
35793
|
var useConsolidatedFlow = true; // Using consolidated flow to combine header selection and mapping
|
|
35784
35794
|
// Start at MapColumns step if demo mode is active
|
|
35785
35795
|
var initialStep = isDemoMode ? StepEnum.MapColumns : StepEnum.Upload;
|
|
35786
|
-
var _e = useStepNavigation(initialStep, skipHeader, useConsolidatedFlow), currentStep = _e.currentStep, setStep = _e.setStep, goNext = _e.goNext, goBack = _e.goBack, stepper = _e.stepper;
|
|
35796
|
+
var _e = useStepNavigation(initialStep, skipHeader, useConsolidatedFlow, isDemoMode), currentStep = _e.currentStep, setStep = _e.setStep, goNext = _e.goNext, goBack = _e.goBack, stepper = _e.stepper;
|
|
35787
35797
|
// Error handling
|
|
35788
35798
|
var _f = useState$1(null), initializationError = _f[0], setInitializationError = _f[1];
|
|
35789
35799
|
var _g = useState$1(null), dataError = _g[0], setDataError = _g[1];
|
|
@@ -35823,6 +35833,10 @@ function Main(props) {
|
|
|
35823
35833
|
sheetList: [],
|
|
35824
35834
|
errors: results.errors.map(function (error) { return error.message; }),
|
|
35825
35835
|
});
|
|
35836
|
+
// Ensure we're on the correct step after data is loaded
|
|
35837
|
+
if (currentStep === StepEnum.Upload) {
|
|
35838
|
+
setStep(StepEnum.MapColumns);
|
|
35839
|
+
}
|
|
35826
35840
|
},
|
|
35827
35841
|
});
|
|
35828
35842
|
}
|