@tripian/react 9.3.8 → 9.3.9
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.
|
@@ -19,6 +19,8 @@ interface IFormTemplateTripNext {
|
|
|
19
19
|
callbackUserCompanionAdd: (userCompoanion: Model.Companion) => void;
|
|
20
20
|
showTripModeQuestion?: boolean;
|
|
21
21
|
initialStep?: number;
|
|
22
|
+
startStep?: number;
|
|
23
|
+
onStepChange?: (stepId: number) => void;
|
|
22
24
|
stepHeaders: {
|
|
23
25
|
stepId: number;
|
|
24
26
|
header: string;
|
package/index.js
CHANGED
|
@@ -80313,10 +80313,11 @@ const StepComponent_1 = __importDefault(__webpack_require__(872));
|
|
|
80313
80313
|
const StepDestination_1 = __importDefault(__webpack_require__(893));
|
|
80314
80314
|
const StepTravelerInfo_1 = __importDefault(__webpack_require__(895));
|
|
80315
80315
|
const Stepper_1 = __importDefault(__webpack_require__(903));
|
|
80316
|
-
const FormTemplateTripNext = ({ tripProfile, tripQuestions, cities, isTripEdit = false, callbackTripProfile, userCompanionQuestions, userCompanions, loadingCompanion, callbackUserCompanionAdd, showTripModeQuestion = false, initialStep, stepHeaders, destinationTips, questionDefaultTip, travelerInfoTips, onSubmitText, onSubmit, onCancel, t,
|
|
80316
|
+
const FormTemplateTripNext = ({ tripProfile, tripQuestions, cities, isTripEdit = false, callbackTripProfile, userCompanionQuestions, userCompanions, loadingCompanion, callbackUserCompanionAdd, showTripModeQuestion = false, initialStep, startStep, onStepChange, stepHeaders, destinationTips, questionDefaultTip, travelerInfoTips, onSubmitText, onSubmit, onCancel, t,
|
|
80317
80317
|
// AI suggestion props
|
|
80318
80318
|
showAiSuggestions, citySuggestions, onCitySuggestionsSearch, isCitySearching, onSelectSuggestedCity, onClearCitySuggestions, }) => {
|
|
80319
|
-
|
|
80319
|
+
var _a;
|
|
80320
|
+
const [stepId, setStepId] = (0, react_1.useState)((_a = startStep !== null && startStep !== void 0 ? startStep : initialStep) !== null && _a !== void 0 ? _a : -1);
|
|
80320
80321
|
const [bound, setBound] = (0, react_1.useState)();
|
|
80321
80322
|
const topRef = (0, react_1.useRef)(null);
|
|
80322
80323
|
// const tripModeQuestion = tripQuestions.find((question) => question.id === 19);
|
|
@@ -80371,6 +80372,12 @@ showAiSuggestions, citySuggestions, onCitySuggestionsSearch, isCitySearching, on
|
|
|
80371
80372
|
topRef.current.scrollIntoView({ behavior: 'smooth' });
|
|
80372
80373
|
}
|
|
80373
80374
|
}, [stepId]);
|
|
80375
|
+
// Step değiştiğinde callback çağır
|
|
80376
|
+
(0, react_1.useEffect)(() => {
|
|
80377
|
+
if (onStepChange) {
|
|
80378
|
+
onStepChange(stepId);
|
|
80379
|
+
}
|
|
80380
|
+
}, [stepId, onStepChange]);
|
|
80374
80381
|
return (react_1.default.createElement(react_1.default.Fragment, null,
|
|
80375
80382
|
react_1.default.createElement("div", { ref: topRef, className: FormTemplateTripNext_scss_1.default.stepsContainer },
|
|
80376
80383
|
react_1.default.createElement("div", { className: "hide-m" },
|