@tripian/react 8.2.2 → 8.2.3
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/index.js
CHANGED
|
@@ -72955,10 +72955,9 @@ var StepDestination_1 = __importDefault(__webpack_require__(747));
|
|
|
72955
72955
|
var StepTravelerInfo_1 = __importDefault(__webpack_require__(751));
|
|
72956
72956
|
var ArrowRight_1 = __importDefault(__webpack_require__(761));
|
|
72957
72957
|
var FormTemplateTripNext = function (_a) {
|
|
72958
|
-
var
|
|
72958
|
+
var tripProfile = _a.tripProfile, tripQuestions = _a.tripQuestions, cities = _a.cities, _b = _a.isTripEdit, isTripEdit = _b === void 0 ? false : _b, callbackTripProfile = _a.callbackTripProfile, userCompanionQuestions = _a.userCompanionQuestions, userCompanions = _a.userCompanions, companionLoadingList = _a.companionLoadingList, callbackUserCompanionAdd = _a.callbackUserCompanionAdd, _c = _a.showTripModeQuestion, showTripModeQuestion = _c === void 0 ? false : _c, stepHeaders = _a.stepHeaders, destinationTips = _a.destinationTips, questionDefaultTip = _a.questionDefaultTip, travelerInfoTips = _a.travelerInfoTips, onSubmitText = _a.onSubmitText, onSubmit = _a.onSubmit, onCancel = _a.onCancel;
|
|
72959
72959
|
var _d = (0, react_1.useState)(-1), stepId = _d[0], setStepId = _d[1];
|
|
72960
|
-
var _e = (0, react_1.useState)(
|
|
72961
|
-
var _f = (0, react_1.useState)(), bound = _f[0], setBound = _f[1];
|
|
72960
|
+
var _e = (0, react_1.useState)(), bound = _e[0], setBound = _e[1];
|
|
72962
72961
|
// const tripModeQuestion = tripQuestions.find((question) => question.id === 19);
|
|
72963
72962
|
var filteredQuestions = (0, react_1.useMemo)(function () { return (showTripModeQuestion ? tripQuestions : tripQuestions.filter(function (x) { return x.id !== 19; })); }, [tripQuestions, showTripModeQuestion]);
|
|
72964
72963
|
var stepQuestions = (0, react_1.useMemo)(function () { return filteredQuestions.filter(function (x) { return x.stepId === stepId; }).sort(function (a, b) { return a.order - b.order; }); }, [filteredQuestions, stepId]);
|
|
@@ -72968,9 +72967,8 @@ var FormTemplateTripNext = function (_a) {
|
|
|
72968
72967
|
var callbackTripAnswers = (0, react_1.useCallback)(function (answers) {
|
|
72969
72968
|
var newTripProfile = __assign({}, tripProfile);
|
|
72970
72969
|
newTripProfile.answers = answers;
|
|
72971
|
-
setTripProfile(newTripProfile);
|
|
72972
72970
|
callbackTripProfile(newTripProfile);
|
|
72973
|
-
}, [
|
|
72971
|
+
}, [callbackTripProfile, tripProfile]);
|
|
72974
72972
|
var setBoundMemo = (0, react_1.useCallback)(function (newBound) { return setBound(newBound); }, []);
|
|
72975
72973
|
var stepClass;
|
|
72976
72974
|
switch (stepId) {
|
|
@@ -73008,14 +73006,8 @@ var FormTemplateTripNext = function (_a) {
|
|
|
73008
73006
|
stepH.stepId < 2 && react_1.default.createElement(ArrowRight_1.default, { className: FormTemplateTripNext_scss_1.default.stepArrowRight })));
|
|
73009
73007
|
}))),
|
|
73010
73008
|
react_1.default.createElement("div", { className: "container pt5 ".concat(FormTemplateTripNext_scss_1.default.stepDestination) },
|
|
73011
|
-
stepId === -1 && cities.length > 0 &&
|
|
73012
|
-
|
|
73013
|
-
callbackTripProfile(newTripProfile);
|
|
73014
|
-
}, isTripEdit: isTripEdit, destinationTips: destinationTips })),
|
|
73015
|
-
stepId === 0 && (react_1.default.createElement(StepTravelerInfo_1.default, { tripProfile: tripProfile, cities: cities, bound: bound, setBound: setBoundMemo, setTripProfile: function (newTripProfile) {
|
|
73016
|
-
setTripProfile(newTripProfile);
|
|
73017
|
-
callbackTripProfile(newTripProfile);
|
|
73018
|
-
}, callbackUserCompanionAdd: callbackUserCompanionAdd, companionLoadingList: companionLoadingList, userCompanionQuestions: userCompanionQuestions, userCompanions: userCompanions, travelerInfoTips: travelerInfoTips })),
|
|
73009
|
+
stepId === -1 && cities.length > 0 && react_1.default.createElement(StepDestination_1.default, { tripProfile: tripProfile, destinations: destinations, setTripProfile: callbackTripProfile, isTripEdit: isTripEdit, destinationTips: destinationTips }),
|
|
73010
|
+
stepId === 0 && (react_1.default.createElement(StepTravelerInfo_1.default, { tripProfile: tripProfile, cities: cities, bound: bound, setBound: setBoundMemo, setTripProfile: callbackTripProfile, callbackUserCompanionAdd: callbackUserCompanionAdd, companionLoadingList: companionLoadingList, userCompanionQuestions: userCompanionQuestions, userCompanions: userCompanions, travelerInfoTips: travelerInfoTips })),
|
|
73019
73011
|
stepId > 0 && react_1.default.createElement(StepComponent_1.default, { defaultTip: questionDefaultTip, header: stepHeader.header, stepQuestions: stepQuestions, stepId: stepId, tripProfile: tripProfile, callbackTripAnswers: callbackTripAnswers }),
|
|
73020
73012
|
react_1.default.createElement("div", { className: "row ".concat(FormTemplateTripNext_scss_1.default.formTempButtons) },
|
|
73021
73013
|
react_1.default.createElement("div", { className: "col col12 col8-m mb0" },
|
|
@@ -74505,7 +74497,7 @@ var RSelectMulti = function (_a) {
|
|
|
74505
74497
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
74506
74498
|
var customFilter = function (option, searchText) { return model_1.helper.toEngChars(option.label).toLowerCase().includes(model_1.helper.toEngChars(searchText).toLowerCase()); };
|
|
74507
74499
|
return (react_1.default.createElement(react_1.default.Fragment, null,
|
|
74508
|
-
react_1.default.createElement(react_select_1.default, { isMulti: true, options: options,
|
|
74500
|
+
react_1.default.createElement(react_select_1.default, { isMulti: true, options: options, value: selectedOptions, onChange: handleChange, onInputChange: onInputChange, filterOption: customFilter, placeholder: placeHolder, className: "trpReactSelect", classNamePrefix: "trpReactSelect", isDisabled: disabled, isClearable: false,
|
|
74509
74501
|
// isOptionDisabled={(option) => option.isSelected === true}
|
|
74510
74502
|
// isOptionSelected={(option) => option.isSelected === true}
|
|
74511
74503
|
onFocus: function () { return onFocus && onFocus(); }, onBlur: function () { return onBlur && onBlur(); } })));
|
|
@@ -74587,15 +74579,11 @@ var Button_1 = __importDefault(__webpack_require__(9));
|
|
|
74587
74579
|
var StepDestinationWidget_1 = __importDefault(__webpack_require__(763));
|
|
74588
74580
|
var FormTemplateTripNextWidget_scss_1 = __importDefault(__webpack_require__(765));
|
|
74589
74581
|
var FormTemplateTripNextWidget = function (_a) {
|
|
74590
|
-
var
|
|
74591
|
-
var _b = (0, react_1.useState)(tripProfileInitial), tripProfile = _b[0], setTripProfile = _b[1];
|
|
74582
|
+
var tripProfile = _a.tripProfile, cities = _a.cities, uniqueUserId = _a.uniqueUserId, callbackTripProfile = _a.callbackTripProfile, onSubmitText = _a.onSubmitText, onSubmit = _a.onSubmit;
|
|
74592
74583
|
var isNextButtonDisabledStep1 = (0, react_1.useMemo)(function () { return !tripProfile.cityId || (0, moment_1.default)(tripProfile.arrivalDatetime).utcOffset(0) < (0, moment_1.default)().utcOffset(0); }, [tripProfile.arrivalDatetime, tripProfile.cityId]);
|
|
74593
74584
|
return (react_1.default.createElement(react_1.default.Fragment, null,
|
|
74594
74585
|
react_1.default.createElement("div", { className: "pt5 ".concat(FormTemplateTripNextWidget_scss_1.default.stepDestination) },
|
|
74595
|
-
react_1.default.createElement(StepDestinationWidget_1.default, { uniqueUserId: uniqueUserId, tripProfile: tripProfile, cities: cities, setTripProfile:
|
|
74596
|
-
setTripProfile(newTripProfile);
|
|
74597
|
-
callbackTripProfile(newTripProfile);
|
|
74598
|
-
}, isTripEdit: false }),
|
|
74586
|
+
react_1.default.createElement(StepDestinationWidget_1.default, { uniqueUserId: uniqueUserId, tripProfile: tripProfile, cities: cities, setTripProfile: callbackTripProfile, isTripEdit: false }),
|
|
74599
74587
|
react_1.default.createElement("div", { className: "row center ".concat(FormTemplateTripNextWidget_scss_1.default.formTempButtons) },
|
|
74600
74588
|
react_1.default.createElement("div", { className: "col col6 p0" },
|
|
74601
74589
|
react_1.default.createElement(Button_1.default, { text: onSubmitText, color: "primary",
|