@tripian/react 9.0.8 → 9.0.10
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/components/FormTemplate/FormTemplateTripNext/StepComponent/StepComponent.d.ts +1 -0
- package/components/QuestionTemplate/Question/Question2.d.ts +2 -0
- package/components/QuestionTemplate/QuestionTemplate2.d.ts +1 -0
- package/components/QuestionTemplateNext/Question/Question2.d.ts +2 -0
- package/components/QuestionTemplateNext/QuestionTemplate2.d.ts +1 -0
- package/components/base/SideNavigation/SideNavigation.d.ts +1 -1
- package/index.js +11 -11
- package/index.js.map +1 -1
- package/min.css +1 -1
- package/package.json +2 -2
|
@@ -11,6 +11,7 @@ export interface StepComponentProps {
|
|
|
11
11
|
stepId: number;
|
|
12
12
|
tripProfile: Model.TripProfile;
|
|
13
13
|
callbackTripAnswers: (answers: number[]) => void;
|
|
14
|
+
t: (value: Model.TranslationKey) => string;
|
|
14
15
|
}
|
|
15
16
|
declare const StepComponent: React.FC<StepComponentProps>;
|
|
16
17
|
export default StepComponent;
|
|
@@ -1,7 +1,9 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
+
import Model from '@tripian/model';
|
|
2
3
|
interface IQuestion2 {
|
|
3
4
|
changed: (answers: Array<number>) => void;
|
|
4
5
|
flexDirection: 'column' | 'row';
|
|
6
|
+
t: (value: Model.TranslationKey) => string;
|
|
5
7
|
}
|
|
6
8
|
declare const Question2: React.FC<IQuestion2>;
|
|
7
9
|
export default Question2;
|
|
@@ -5,6 +5,7 @@ interface IQuestionTemplate2 {
|
|
|
5
5
|
answers: Array<number>;
|
|
6
6
|
callbackAnswers: (answers: Array<number>) => void;
|
|
7
7
|
flexDirection?: 'column' | 'row';
|
|
8
|
+
t: (value: Model.TranslationKey) => string;
|
|
8
9
|
}
|
|
9
10
|
declare const QuestionTemplate2: React.FC<IQuestionTemplate2>;
|
|
10
11
|
export default QuestionTemplate2;
|
|
@@ -1,7 +1,9 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
+
import Model from '@tripian/model';
|
|
2
3
|
interface IQuestion2 {
|
|
3
4
|
changed: (answers: Array<number>) => void;
|
|
4
5
|
flexDirection: 'column' | 'row';
|
|
6
|
+
t: (value: Model.TranslationKey) => string;
|
|
5
7
|
}
|
|
6
8
|
declare const Question2: React.FC<IQuestion2>;
|
|
7
9
|
export default Question2;
|
|
@@ -7,6 +7,7 @@ interface IQuestionTemplate2 {
|
|
|
7
7
|
onFocus?: () => void;
|
|
8
8
|
onBlur?: () => void;
|
|
9
9
|
flexDirection?: 'column' | 'row';
|
|
10
|
+
t: (value: Model.TranslationKey) => string;
|
|
10
11
|
}
|
|
11
12
|
declare const QuestionTemplate2: React.FC<IQuestionTemplate2>;
|
|
12
13
|
export default QuestionTemplate2;
|
|
@@ -20,7 +20,7 @@ interface ISideNavigation {
|
|
|
20
20
|
showThemeSwitch: boolean;
|
|
21
21
|
showFeedbackModal: boolean;
|
|
22
22
|
setShowFeedbackModal: (show: boolean) => void;
|
|
23
|
-
languageOptions?: Model.
|
|
23
|
+
languageOptions?: Model.LangCode[];
|
|
24
24
|
selectedLanguage: string;
|
|
25
25
|
onSelectedLanguage: (value: string) => void;
|
|
26
26
|
t: (value: Model.TranslationKey) => string;
|
package/index.js
CHANGED
|
@@ -75798,7 +75798,7 @@ var FormTemplateTripNext = function (_a) {
|
|
|
75798
75798
|
react_1.default.createElement("div", { className: "container pt5 ".concat(FormTemplateTripNext_scss_1.default.stepDestination) },
|
|
75799
75799
|
stepId === -1 && cities.length > 0 && react_1.default.createElement(StepDestination_1.default, { tripProfile: tripProfile, destinations: destinations, setTripProfile: callbackTripProfile, isTripEdit: isTripEdit, destinationTips: destinationTips, t: t }),
|
|
75800
75800
|
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, t: t })),
|
|
75801
|
-
stepId > 0 && react_1.default.createElement(StepComponent_1.default, { defaultTip: questionDefaultTip, header: stepHeader.header, stepQuestions: stepQuestions, stepId: stepId, tripProfile: tripProfile, callbackTripAnswers: callbackTripAnswers }),
|
|
75801
|
+
stepId > 0 && react_1.default.createElement(StepComponent_1.default, { defaultTip: questionDefaultTip, header: stepHeader.header, stepQuestions: stepQuestions, stepId: stepId, tripProfile: tripProfile, callbackTripAnswers: callbackTripAnswers, t: t }),
|
|
75802
75802
|
react_1.default.createElement("div", { className: "row ".concat(FormTemplateTripNext_scss_1.default.formTempButtons) },
|
|
75803
75803
|
react_1.default.createElement("div", { className: "col col12 col8-m mb0" },
|
|
75804
75804
|
react_1.default.createElement("div", { className: "row center m0" },
|
|
@@ -75875,7 +75875,7 @@ var QuestionTemplate_1 = __importDefault(__webpack_require__(750));
|
|
|
75875
75875
|
var QuestionTemplate2_1 = __importDefault(__webpack_require__(759));
|
|
75876
75876
|
var StepComponent_scss_1 = __importDefault(__webpack_require__(762));
|
|
75877
75877
|
var StepComponent = function (_a) {
|
|
75878
|
-
var /* header, */ defaultTip = _a.defaultTip, stepQuestions = _a.stepQuestions, /* stepId, */ tripProfile = _a.tripProfile, callbackTripAnswers = _a.callbackTripAnswers;
|
|
75878
|
+
var /* header, */ defaultTip = _a.defaultTip, stepQuestions = _a.stepQuestions, /* stepId, */ tripProfile = _a.tripProfile, callbackTripAnswers = _a.callbackTripAnswers, t = _a.t;
|
|
75879
75879
|
var _b = (0, react_1.useState)(defaultTip), tip = _b[0], setTip = _b[1];
|
|
75880
75880
|
var onFocus = function (qId) {
|
|
75881
75881
|
var focusedQ = stepQuestions.find(function (x) { return x.id === qId; });
|
|
@@ -75893,7 +75893,7 @@ var StepComponent = function (_a) {
|
|
|
75893
75893
|
otherQuestions.map(function (q) { return (react_1.default.createElement(QuestionTemplate_1.default, { key: q.id, question: q, answers: tripProfile.answers, callbackAnswers: callbackTripAnswers, flexDirection: "row", onFocus: function () { return onFocus(q.id); }, onBlur: function () { return setTip(defaultTip); } })); }),
|
|
75894
75894
|
exploreQuestion && react_1.default.createElement(QuestionTemplate_1.default, { question: exploreQuestion, answers: tripProfile.answers, callbackAnswers: callbackTripAnswers, flexDirection: "column", onFocus: function () { return onFocus(exploreQuestion.id); }, onBlur: function () { return setTip(defaultTip); } }),
|
|
75895
75895
|
restaurantsQuestions.length > 0 ? (react_1.default.createElement("div", { key: restaurantsQuestions[0].id, className: "col col12 col12-m" },
|
|
75896
|
-
react_1.default.createElement(QuestionTemplate2_1.default, { questions: restaurantsQuestions, answers: tripProfile.answers, callbackAnswers: callbackTripAnswers, onFocus: function () { return onFocus(restaurantsQuestions[0].id); }, onBlur: function () { return setTip(defaultTip); } }))) : null),
|
|
75896
|
+
react_1.default.createElement(QuestionTemplate2_1.default, { questions: restaurantsQuestions, answers: tripProfile.answers, callbackAnswers: callbackTripAnswers, onFocus: function () { return onFocus(restaurantsQuestions[0].id); }, onBlur: function () { return setTip(defaultTip); }, t: t }))) : null),
|
|
75897
75897
|
react_1.default.createElement("div", { className: "col col12 col4-m py5 hide-s ".concat(StepComponent_scss_1.default.stepCompRight) },
|
|
75898
75898
|
react_1.default.createElement(InfoBox_1.default, { title: tip.title, description: tip.description, iconUrl: tip.iconUrl })))));
|
|
75899
75899
|
};
|
|
@@ -76364,7 +76364,7 @@ var react_1 = __importDefault(__webpack_require__(0));
|
|
|
76364
76364
|
var QuestionContext2_1 = __importDefault(__webpack_require__(398));
|
|
76365
76365
|
var Question2_1 = __importDefault(__webpack_require__(760));
|
|
76366
76366
|
var QuestionTemplate2 = function (_a) {
|
|
76367
|
-
var questions = _a.questions, answers = _a.answers, callbackAnswers = _a.callbackAnswers, onFocus = _a.onFocus, onBlur = _a.onBlur, _b = _a.flexDirection, flexDirection = _b === void 0 ? 'row' : _b;
|
|
76367
|
+
var questions = _a.questions, answers = _a.answers, callbackAnswers = _a.callbackAnswers, onFocus = _a.onFocus, onBlur = _a.onBlur, _b = _a.flexDirection, flexDirection = _b === void 0 ? 'row' : _b, t = _a.t;
|
|
76368
76368
|
return (react_1.default.createElement(react_1.default.Fragment, null,
|
|
76369
76369
|
react_1.default.createElement("div", { key: questions[0].id, onFocus: function () {
|
|
76370
76370
|
if (onFocus)
|
|
@@ -76377,7 +76377,7 @@ var QuestionTemplate2 = function (_a) {
|
|
|
76377
76377
|
questions: questions,
|
|
76378
76378
|
defaultAnswers: answers,
|
|
76379
76379
|
} },
|
|
76380
|
-
react_1.default.createElement(Question2_1.default, { changed: callbackAnswers, flexDirection: flexDirection })))));
|
|
76380
|
+
react_1.default.createElement(Question2_1.default, { changed: callbackAnswers, flexDirection: flexDirection, t: t })))));
|
|
76381
76381
|
};
|
|
76382
76382
|
exports.default = QuestionTemplate2;
|
|
76383
76383
|
|
|
@@ -76430,7 +76430,7 @@ var QuestionContext2_1 = __importDefault(__webpack_require__(398));
|
|
|
76430
76430
|
var SelectQuestion_1 = __importDefault(__webpack_require__(761));
|
|
76431
76431
|
var Question2 = function (_a) {
|
|
76432
76432
|
var _b, _c;
|
|
76433
|
-
var changed = _a.changed, flexDirection = _a.flexDirection;
|
|
76433
|
+
var changed = _a.changed, flexDirection = _a.flexDirection, t = _a.t;
|
|
76434
76434
|
var _d = (0, react_1.useContext)(QuestionContext2_1.default), questions = _d.questions, defaultAnswers = _d.defaultAnswers;
|
|
76435
76435
|
var defaultAnswer1 = (_b = questions[0].answers.find(function (option) { return defaultAnswers.includes(option.id); })) === null || _b === void 0 ? void 0 : _b.id;
|
|
76436
76436
|
var defaultAnswer2 = (_c = questions[1].answers.find(function (option) { return defaultAnswers.includes(option.id); })) === null || _c === void 0 ? void 0 : _c.id;
|
|
@@ -76444,10 +76444,10 @@ var Question2 = function (_a) {
|
|
|
76444
76444
|
changed(newAnswers);
|
|
76445
76445
|
};
|
|
76446
76446
|
return (react_1.default.createElement(react_1.default.Fragment, null,
|
|
76447
|
-
react_1.default.createElement("h4", { className: "mt7 mb5" },
|
|
76448
|
-
react_1.default.createElement("h5", { className: "my2" },
|
|
76447
|
+
react_1.default.createElement("h4", { className: "mt7 mb5" }, t('trips.createNewTrip.restaurantQuestion.title')),
|
|
76448
|
+
react_1.default.createElement("h5", { className: "my2" }, t('trips.createNewTrip.restaurantQuestion.lunchBrunch')),
|
|
76449
76449
|
react_1.default.createElement(SelectQuestion_1.default, { question: questions[0], defaultAnswer: defaultAnswer1, selectionChanged: selectionChanged, flexDirection: flexDirection }),
|
|
76450
|
-
react_1.default.createElement("h4", { className: "my2" },
|
|
76450
|
+
react_1.default.createElement("h4", { className: "my2" }, t('trips.createNewTrip.restaurantQuestion.dinner')),
|
|
76451
76451
|
react_1.default.createElement(SelectQuestion_1.default, { question: questions[1], defaultAnswer: defaultAnswer2, selectionChanged: selectionChanged, flexDirection: flexDirection })));
|
|
76452
76452
|
};
|
|
76453
76453
|
exports.default = Question2;
|
|
@@ -82856,8 +82856,8 @@ var SideNavigation = function (_a) {
|
|
|
82856
82856
|
} })),
|
|
82857
82857
|
showThemeSwitch && (react_1.default.createElement("div", { className: SideNavigation_scss_1.default.themeToggle },
|
|
82858
82858
|
react_1.default.createElement(ToggleSwitch_1.default, { checked: themeSwitchChecked, optionLabels: [t('theme.dark'), t('theme.light')], onChange: function () { return themeSwitchCheckedOnchange(themeSwitchChecked); } })))),
|
|
82859
|
-
languageOptions &&
|
|
82860
|
-
react_1.default.createElement("select", { value: selectedLanguage, onChange: function (e) { return onSelectedLanguage(e.target.value); } },
|
|
82859
|
+
languageOptions && languageOptions.length > 0 && (react_1.default.createElement("div", { className: SideNavigation_scss_1.default.languageSelect },
|
|
82860
|
+
react_1.default.createElement("select", { value: selectedLanguage, onChange: function (e) { return onSelectedLanguage(e.target.value); } }, languageOptions.map(function (option) { return (react_1.default.createElement("option", { key: option.value, value: option.value }, option.label)); })))),
|
|
82861
82861
|
react_1.default.createElement("ul", { className: "".concat(SideNavigation_scss_1.default.sidenavList, " ").concat(showBbButton ? SideNavigation_scss_1.default.sideNavCustomHeight : '') },
|
|
82862
82862
|
menuItems.some(function (menuItem) { return !menuItem.hide && menuItem.header === MENUITEMS.TRIPS; }) && (react_1.default.createElement("li", null,
|
|
82863
82863
|
react_1.default.createElement("h3", { className: "m4" }, t('trips.title').toUpperCase()))),
|