thm-p3-configurator 0.0.333 → 0.0.335
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/dist/src/shared/__api__/queries.js +0 -1
- package/dist/src/shared/__components__/Cards/Card.js +4 -4
- package/dist/src/shared/__components__/Error.js +6 -5
- package/dist/src/shared/__components__/Form/RadioButtons.js +4 -4
- package/dist/src/shared/__components__/Header.js +1 -3
- package/dist/src/shared/__components__/Navbar.js +3 -4
- package/dist/src/shared/__components__/ProductCard/ProductCardCheckbox.js +2 -2
- package/dist/src/shared/__components__/Spinners/FullPageSpinner.js +3 -4
- package/dist/src/shared/__constants__/index.js +3 -2
- package/dist/src/shared/__containers__/ANWBMembershipInput.js +24 -4
- package/dist/src/shared/__containers__/DiscountProductsSelector.js +1 -1
- package/dist/src/shared/__containers__/ProductDiscountCard.js +1 -1
- package/dist/src/shared/__containers__/StyleWrapper.js +2 -2
- package/dist/src/shared/__containers__/internal/InternalAppointmentForm.js +1 -1
- package/dist/src/shared/__containers__/internal/InternalQuotationForm.js +13 -4
- package/dist/src/shared/__context__/OrderSessionContext.js +11 -0
- package/dist/src/shared/__helpers__/dossier.js +7 -0
- package/dist/src/shared/__helpers__/index.js +44 -2
- package/dist/src/shared/__hooks__/useBranchTheme.js +5 -1
- package/dist/src/shared/__pages__/AppointmentPage.js +3 -3
- package/dist/src/shared/__pages__/AppointmentThanksPage.js +7 -4
- package/dist/src/shared/__pages__/ExtraProductsPage.js +3 -3
- package/dist/src/shared/__pages__/LicensePlatePage.js +8 -5
- package/dist/src/shared/__pages__/LocationsPage.js +3 -3
- package/dist/src/shared/__pages__/ManualSelectionPage.js +8 -5
- package/dist/src/shared/__pages__/NoProductsPage.js +7 -2
- package/dist/src/shared/__pages__/OverviewPage.js +3 -3
- package/dist/src/shared/__pages__/ProductsPage.js +3 -3
- package/dist/src/shared/__pages__/QuotationPage.js +7 -4
- package/dist/src/shared/__pages__/QuotationThanksPage.js +7 -4
- package/dist/src/shared/__pages__/internal/InternalAppointmentPage.js +3 -3
- package/dist/src/shared/__pages__/internal/InternalExtraProductsPage.js +3 -3
- package/dist/src/shared/__pages__/internal/InternalLicensePlatePage.js +3 -6
- package/dist/src/shared/__pages__/internal/InternalLocationsPage.js +3 -3
- package/dist/src/shared/__pages__/internal/InternalManualSelectionPage.js +2 -5
- package/dist/src/shared/__pages__/internal/InternalNoDossierPage.js +3 -4
- package/dist/src/shared/__pages__/internal/InternalNoProductsPage.js +2 -2
- package/dist/src/shared/__pages__/internal/InternalOverviewPage.js +3 -3
- package/dist/src/shared/__pages__/internal/InternalProductsPage.js +3 -3
- package/dist/src/shared/__pages__/internal/InternalQuotationPage.js +3 -3
- package/dist/src/shared/__pages__/internal/InternalSessionEditPage.js +10 -2
- package/dist/src/shared/__pages__/internal/InternalSingleOrderPage.js +2 -1
- package/dist/src/shared/__services__/AuthRuntime.js +29 -0
- package/dist/src/shared/__style__/_variables-external.scss +6 -2
- package/dist/src/shared/__style__/_variables.scss +6 -2
- package/dist/src/shared/__style__/components/_navbar.scss +4 -0
- package/dist/src/shared/__style__/configurator/_configurator.scss +152 -3
- package/package.json +1 -1
|
@@ -38,7 +38,6 @@ var _FormulaContext = require("../__context__/FormulaContext");
|
|
|
38
38
|
var _OrderSessionContext = require("../__context__/OrderSessionContext");
|
|
39
39
|
var _helpers__ = require("../__helpers__");
|
|
40
40
|
var _singleOrderArticles = require("../__helpers__/singleOrderArticles");
|
|
41
|
-
var _AuthRuntime = require("../__services__/AuthRuntime");
|
|
42
41
|
var _authenticatedProxyApi = require("./authenticatedProxyApi");
|
|
43
42
|
var _orderApi = require("./orderApi");
|
|
44
43
|
var _publicProxyApi = require("./publicProxyApi");
|
|
@@ -5,9 +5,8 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
5
5
|
});
|
|
6
6
|
exports.default = void 0;
|
|
7
7
|
var _react = _interopRequireDefault(require("react"));
|
|
8
|
-
var _constants__ = require("../../__constants__");
|
|
9
|
-
var _FormulaContext = require("../../__context__/FormulaContext");
|
|
10
8
|
var _helpers__ = require("../../__helpers__");
|
|
9
|
+
var _useBranchTheme = require("../../__hooks__/useBranchTheme");
|
|
11
10
|
function _interopRequireDefault(e) {
|
|
12
11
|
return e && e.__esModule ? e : {
|
|
13
12
|
default: e
|
|
@@ -22,9 +21,10 @@ const Card = _ref => {
|
|
|
22
21
|
isWide = false,
|
|
23
22
|
isNarrow = false
|
|
24
23
|
} = _ref;
|
|
25
|
-
const
|
|
24
|
+
const theme = (0, _useBranchTheme.useBranchTheme)();
|
|
25
|
+
const themeClass = (0, _helpers__.getConfiguratorThemeClass)(theme);
|
|
26
26
|
return /*#__PURE__*/_react.default.createElement("div", {
|
|
27
|
-
className: (0, _helpers__.withStyle)("".concat(isCentered ? 'modal-dialog-centered' : '', " ").concat(isScrollable ? 'modal-dialog-scrollable' : '', " ").concat(isWide ? 'modal-dialog__questions' : 'modal-dialog', " ").concat(isNarrow ? 'modal--narrow' : '', " ").concat(
|
|
27
|
+
className: (0, _helpers__.withStyle)("".concat(isCentered ? 'modal-dialog-centered' : '', " ").concat(isScrollable ? 'modal-dialog-scrollable' : '', " ").concat(isWide ? 'modal-dialog__questions' : 'modal-dialog', " ").concat(isNarrow ? 'modal--narrow' : '', " ").concat(themeClass))
|
|
28
28
|
}, /*#__PURE__*/_react.default.createElement("div", {
|
|
29
29
|
className: (0, _helpers__.withStyle)('modal-content')
|
|
30
30
|
}, title && /*#__PURE__*/_react.default.createElement("div", {
|
|
@@ -7,9 +7,8 @@ exports.default = void 0;
|
|
|
7
7
|
var _react = _interopRequireDefault(require("react"));
|
|
8
8
|
var _reactLottie = _interopRequireDefault(require("react-lottie"));
|
|
9
9
|
var _animation = _interopRequireDefault(require("../../../public/assets/lottie/animation"));
|
|
10
|
-
var _constants__ = require("../__constants__");
|
|
11
|
-
var _FormulaContext = require("../__context__/FormulaContext");
|
|
12
10
|
var _helpers__ = require("../__helpers__");
|
|
11
|
+
var _useBranchTheme = require("../__hooks__/useBranchTheme");
|
|
13
12
|
var _NavigationButton = _interopRequireDefault(require("./Buttons/NavigationButton"));
|
|
14
13
|
function _interopRequireDefault(e) {
|
|
15
14
|
return e && e.__esModule ? e : {
|
|
@@ -28,7 +27,9 @@ const Error = () => {
|
|
|
28
27
|
const handleRedirectToWebsite = () => {
|
|
29
28
|
window.location.href = APP_CONFIG.websiteHost;
|
|
30
29
|
};
|
|
31
|
-
const
|
|
30
|
+
const theme = (0, _useBranchTheme.useBranchTheme)();
|
|
31
|
+
const primaryVariant = (0, _helpers__.getConfiguratorButtonVariant)(theme);
|
|
32
|
+
const outlineVariant = (0, _helpers__.getConfiguratorButtonVariant)(theme, true);
|
|
32
33
|
return /*#__PURE__*/_react.default.createElement("div", {
|
|
33
34
|
className: "".concat((0, _helpers__.withStyle)('d-flex flex-column'))
|
|
34
35
|
}, /*#__PURE__*/_react.default.createElement("div", {
|
|
@@ -52,14 +53,14 @@ const Error = () => {
|
|
|
52
53
|
}, "Indien de error zich blijft voordoen, gelieve contact op te nemen met de administrator"), /*#__PURE__*/_react.default.createElement("div", {
|
|
53
54
|
className: (0, _helpers__.withStyle)('d-flex align-items-center gap-2 w-100 justify-content-center')
|
|
54
55
|
}, /*#__PURE__*/_react.default.createElement(_NavigationButton.default, {
|
|
55
|
-
variant:
|
|
56
|
+
variant: primaryVariant,
|
|
56
57
|
to: "/configurator",
|
|
57
58
|
label: "Start de configurator opnieuw"
|
|
58
59
|
}), /*#__PURE__*/_react.default.createElement(_NavigationButton.default, {
|
|
59
60
|
to: "#",
|
|
60
61
|
onClick: handleRedirectToWebsite,
|
|
61
62
|
label: "Ga naar de homepage",
|
|
62
|
-
variant:
|
|
63
|
+
variant: outlineVariant
|
|
63
64
|
}))))))));
|
|
64
65
|
};
|
|
65
66
|
var _default = exports.default = Error;
|
|
@@ -11,9 +11,8 @@ exports.default = void 0;
|
|
|
11
11
|
require("core-js/modules/esnext.iterator.map.js");
|
|
12
12
|
require("core-js/modules/web.dom-collections.iterator.js");
|
|
13
13
|
var _react = _interopRequireWildcard(require("react"));
|
|
14
|
-
var _constants__ = require("../../__constants__");
|
|
15
|
-
var _FormulaContext = require("../../__context__/FormulaContext");
|
|
16
14
|
var _helpers__ = require("../../__helpers__");
|
|
15
|
+
var _useBranchTheme = require("../../__hooks__/useBranchTheme");
|
|
17
16
|
var _ErrorMessage = _interopRequireDefault(require("./ErrorMessage"));
|
|
18
17
|
function _interopRequireDefault(e) {
|
|
19
18
|
return e && e.__esModule ? e : {
|
|
@@ -57,7 +56,8 @@ const RadioButtons = _ref => {
|
|
|
57
56
|
errorMessage
|
|
58
57
|
} = _ref;
|
|
59
58
|
const [value, setValue] = (0, _react.useState)(initialValue);
|
|
60
|
-
const
|
|
59
|
+
const theme = (0, _useBranchTheme.useBranchTheme)();
|
|
60
|
+
const buttonVariant = (0, _helpers__.getConfiguratorButtonVariant)(theme, true);
|
|
61
61
|
const handleChange = event => {
|
|
62
62
|
const {
|
|
63
63
|
value
|
|
@@ -76,7 +76,7 @@ const RadioButtons = _ref => {
|
|
|
76
76
|
"aria-label": label
|
|
77
77
|
}, options.map((optionName, key) => /*#__PURE__*/_react.default.createElement("label", {
|
|
78
78
|
key: key,
|
|
79
|
-
className: (0, _helpers__.withStyle)("form__radio-item form__radio-item--flexible btn btn-sm ".concat(
|
|
79
|
+
className: (0, _helpers__.withStyle)("form__radio-item form__radio-item--flexible btn btn-sm btn-".concat(buttonVariant, " ").concat(value === optionName ? 'active' : '')),
|
|
80
80
|
htmlFor: "".concat(name, "[").concat(key, "]")
|
|
81
81
|
}, /*#__PURE__*/_react.default.createElement("input", {
|
|
82
82
|
type: "radio",
|
|
@@ -10,7 +10,6 @@ var _logoThcWhite = _interopRequireDefault(require("../../../public/assets/image
|
|
|
10
10
|
var _logoTmgPrimary = _interopRequireDefault(require("../../../public/assets/images/logo-tmg-primary.png"));
|
|
11
11
|
var _tmLogo = _interopRequireDefault(require("../../../public/assets/images/tm-logo.png"));
|
|
12
12
|
var _constants__ = require("../__constants__");
|
|
13
|
-
var _FormulaContext = require("../__context__/FormulaContext");
|
|
14
13
|
var _helpers__ = require("../__helpers__");
|
|
15
14
|
var _useBranchTheme = require("../__hooks__/useBranchTheme");
|
|
16
15
|
function _interopRequireDefault(e) {
|
|
@@ -24,7 +23,6 @@ const Header = _ref => {
|
|
|
24
23
|
subtitle = ''
|
|
25
24
|
} = _ref;
|
|
26
25
|
const theme = (0, _useBranchTheme.useBranchTheme)();
|
|
27
|
-
const formula = (0, _FormulaContext.useFormula)();
|
|
28
26
|
return /*#__PURE__*/_react.default.createElement("div", {
|
|
29
27
|
className: (0, _helpers__.withStyle)("hero hero--offset")
|
|
30
28
|
}, /*#__PURE__*/_react.default.createElement("div", {
|
|
@@ -35,7 +33,7 @@ const Header = _ref => {
|
|
|
35
33
|
className: (0, _helpers__.withStyle)('col hero__logo-container')
|
|
36
34
|
}, /*#__PURE__*/_react.default.createElement("img", {
|
|
37
35
|
className: (0, _helpers__.withStyle)("hero__logo ".concat(theme === _constants__.BRANCH_THEME_BY_FORMULA.TowMotiveGroup ? 'hero__logo--tmg' : '')),
|
|
38
|
-
src:
|
|
36
|
+
src: theme === _constants__.BRANCH_THEME_BY_FORMULA.TowMotive ? _tmLogo.default : theme === _constants__.BRANCH_THEME_BY_FORMULA.Trekhaakcentrum ? _logoThcWhite.default : theme === _constants__.BRANCH_THEME_BY_FORMULA.TowMotiveGroup ? _logoTmgPrimary.default : _logoPrimaryIcon.default,
|
|
39
37
|
alt: "Trekhaak Montage"
|
|
40
38
|
}), /*#__PURE__*/_react.default.createElement("div", {
|
|
41
39
|
className: (0, _helpers__.withStyle)('hero__inner d-none d-lg-block')
|
|
@@ -10,7 +10,6 @@ var _logoTmgPrimary = _interopRequireDefault(require("../../../public/assets/ima
|
|
|
10
10
|
var _logoWhite = _interopRequireDefault(require("../../../public/assets/images/logo-white.svg"));
|
|
11
11
|
var _tmLogo = _interopRequireDefault(require("../../../public/assets/images/tm-logo.png"));
|
|
12
12
|
var _constants__ = require("../__constants__");
|
|
13
|
-
var _FormulaContext = require("../__context__/FormulaContext");
|
|
14
13
|
var _helpers__ = require("../__helpers__");
|
|
15
14
|
var _useBranchTheme = require("../__hooks__/useBranchTheme");
|
|
16
15
|
function _interopRequireDefault(e) {
|
|
@@ -23,9 +22,9 @@ const Navbar = _ref => {
|
|
|
23
22
|
onPhoneClicked
|
|
24
23
|
} = _ref;
|
|
25
24
|
const theme = (0, _useBranchTheme.useBranchTheme)();
|
|
26
|
-
const
|
|
25
|
+
const themeClass = (0, _helpers__.getConfiguratorThemeClass)(theme);
|
|
27
26
|
return /*#__PURE__*/_react.default.createElement("nav", {
|
|
28
|
-
className: (0, _helpers__.withStyle)("navbar fixed-top ".concat(
|
|
27
|
+
className: (0, _helpers__.withStyle)("navbar fixed-top ".concat(themeClass))
|
|
29
28
|
}, /*#__PURE__*/_react.default.createElement("div", {
|
|
30
29
|
className: (0, _helpers__.withStyle)('container-fluid')
|
|
31
30
|
}, /*#__PURE__*/_react.default.createElement("a", {
|
|
@@ -33,7 +32,7 @@ const Navbar = _ref => {
|
|
|
33
32
|
href: APP_CONFIG.websiteHost
|
|
34
33
|
}, /*#__PURE__*/_react.default.createElement("img", {
|
|
35
34
|
className: (0, _helpers__.withStyle)('img-fluid'),
|
|
36
|
-
src:
|
|
35
|
+
src: theme === _constants__.BRANCH_THEME_BY_FORMULA.TowMotive ? _tmLogo.default : theme === _constants__.BRANCH_THEME_BY_FORMULA.Trekhaakcentrum ? _logoThcWhite.default : theme === _constants__.BRANCH_THEME_BY_FORMULA.TowMotiveGroup ? _logoTmgPrimary.default : _logoWhite.default,
|
|
37
36
|
alt: "Trekhaakmontage"
|
|
38
37
|
})), /*#__PURE__*/_react.default.createElement("div", {
|
|
39
38
|
className: (0, _helpers__.withStyle)('navbar__phone ms-10 d-none d-sm-flex')
|
|
@@ -5,7 +5,6 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
5
5
|
});
|
|
6
6
|
exports.default = void 0;
|
|
7
7
|
var _react = _interopRequireDefault(require("react"));
|
|
8
|
-
var _constants__ = require("../../__constants__");
|
|
9
8
|
var _useBranchTheme = require("../../__hooks__/useBranchTheme");
|
|
10
9
|
var _helpers__ = require("../../__helpers__");
|
|
11
10
|
function _interopRequireDefault(e) {
|
|
@@ -20,6 +19,7 @@ const ProductCardCheckbox = _ref => {
|
|
|
20
19
|
id
|
|
21
20
|
} = _ref;
|
|
22
21
|
const theme = (0, _useBranchTheme.useBranchTheme)();
|
|
22
|
+
const buttonVariant = (0, _helpers__.getConfiguratorButtonVariant)(theme, true);
|
|
23
23
|
return /*#__PURE__*/_react.default.createElement("div", {
|
|
24
24
|
className: (0, _helpers__.withStyle)('align-items-center d-flex position-relative')
|
|
25
25
|
}, /*#__PURE__*/_react.default.createElement("input", {
|
|
@@ -30,7 +30,7 @@ const ProductCardCheckbox = _ref => {
|
|
|
30
30
|
readOnly: true,
|
|
31
31
|
checked: defaultChecked
|
|
32
32
|
}), /*#__PURE__*/_react.default.createElement("label", {
|
|
33
|
-
className: (0, _helpers__.withStyle)("btn ".concat(
|
|
33
|
+
className: (0, _helpers__.withStyle)("btn btn-".concat(buttonVariant)),
|
|
34
34
|
htmlFor: "btn-check-".concat(id),
|
|
35
35
|
disabled: isDisabled
|
|
36
36
|
}, defaultChecked ? 'Geselecteerd' : 'Selecteer'));
|
|
@@ -16,7 +16,6 @@ var _logoWhite = _interopRequireDefault(require("../../../../public/assets/image
|
|
|
16
16
|
var _constants__ = require("../../__constants__");
|
|
17
17
|
var _helpers__ = require("../../__helpers__");
|
|
18
18
|
var _useBranchTheme = require("../../__hooks__/useBranchTheme");
|
|
19
|
-
var _FormulaContext = require("../../__context__/FormulaContext");
|
|
20
19
|
function _interopRequireDefault(e) {
|
|
21
20
|
return e && e.__esModule ? e : {
|
|
22
21
|
default: e
|
|
@@ -53,12 +52,12 @@ const FullPageSpinner = _ref => {
|
|
|
53
52
|
} = _ref;
|
|
54
53
|
const [hasRendered, setHasRendered] = (0, _react.useState)();
|
|
55
54
|
const theme = (0, _useBranchTheme.useBranchTheme)();
|
|
56
|
-
const
|
|
55
|
+
const themeClass = (0, _helpers__.getConfiguratorThemeClass)(theme);
|
|
57
56
|
(0, _react.useEffect)(() => {
|
|
58
57
|
setHasRendered(true);
|
|
59
58
|
}, []);
|
|
60
59
|
return /*#__PURE__*/_react.default.createElement("div", {
|
|
61
|
-
className: (0, _helpers__.withStyle)("loader ".concat(
|
|
60
|
+
className: (0, _helpers__.withStyle)("loader ".concat(themeClass))
|
|
62
61
|
}, hasRendered !== true ? /*#__PURE__*/_react.default.createElement("span", null, /*#__PURE__*/_react.default.createElement("i", {
|
|
63
62
|
className: (0, _helpers__.withStyle)('loader__icon')
|
|
64
63
|
})) : /*#__PURE__*/_react.default.createElement("span", {
|
|
@@ -67,7 +66,7 @@ const FullPageSpinner = _ref => {
|
|
|
67
66
|
className: "fas fa-cog fa-spin"
|
|
68
67
|
}), ' '), children ? children : /*#__PURE__*/_react.default.createElement("img", {
|
|
69
68
|
className: (0, _helpers__.withStyle)('loader__logo'),
|
|
70
|
-
src:
|
|
69
|
+
src: theme === _constants__.BRANCH_THEME_BY_FORMULA.TowMotive ? _tmLogo.default : theme === _constants__.BRANCH_THEME_BY_FORMULA.Trekhaakcentrum ? _logoThcWhite.default : theme === _constants__.BRANCH_THEME_BY_FORMULA.TowMotiveGroup ? _logoTmgPrimary.default : _logoWhite.default,
|
|
71
70
|
alt: "Trekhaak Montage - Configurator"
|
|
72
71
|
}));
|
|
73
72
|
};
|
|
@@ -31,12 +31,13 @@ const BRANCH_THEME_BY_FORMULA = exports.BRANCH_THEME_BY_FORMULA = {
|
|
|
31
31
|
Trekhaakcentrum: 'thc',
|
|
32
32
|
Trekhaakmontage: 'thm',
|
|
33
33
|
TowMotiveGroup: 'tmg',
|
|
34
|
-
TowMotive: '
|
|
34
|
+
TowMotive: 'tm'
|
|
35
35
|
};
|
|
36
36
|
const PARTNER_PORTAL_PAGE_TITLES_BY_THEME = exports.PARTNER_PORTAL_PAGE_TITLES_BY_THEME = {
|
|
37
37
|
[BRANCH_THEME_BY_FORMULA.Trekhaakmontage]: 'Trekhaakmontage - Partner Portal',
|
|
38
38
|
[BRANCH_THEME_BY_FORMULA.Trekhaakcentrum]: 'Trekhaakcentrum - Partner Portal',
|
|
39
|
-
[BRANCH_THEME_BY_FORMULA.TowMotiveGroup]: 'TowMotive Group - Partner Portal'
|
|
39
|
+
[BRANCH_THEME_BY_FORMULA.TowMotiveGroup]: 'TowMotive Group - Partner Portal',
|
|
40
|
+
[BRANCH_THEME_BY_FORMULA.TowMotive]: 'TowMotive - Partner Portal'
|
|
40
41
|
};
|
|
41
42
|
const DAY_NAMES = exports.DAY_NAMES = {
|
|
42
43
|
monday: 'Maandag',
|
|
@@ -51,17 +51,18 @@ function _interopRequireWildcard(e, r) {
|
|
|
51
51
|
return n.default = e, t && t.set(e, n), n;
|
|
52
52
|
}
|
|
53
53
|
const ANWBMembershipValidator = _ref => {
|
|
54
|
-
var _customer$
|
|
54
|
+
var _customer$anwbId2;
|
|
55
55
|
let {
|
|
56
56
|
discountProducts = []
|
|
57
57
|
} = _ref;
|
|
58
58
|
const [{
|
|
59
59
|
customer,
|
|
60
|
-
discountCode
|
|
60
|
+
discountCode,
|
|
61
|
+
anwbDiscountValidated,
|
|
62
|
+
selectedDiscountedProducts
|
|
61
63
|
}, dispatch] = (0, _OrderSessionContext.useOrderSession)();
|
|
62
64
|
const [isNumberValid, setIsNumberValid] = (0, _react.useState)();
|
|
63
65
|
const clearDiscountProducts = () => {
|
|
64
|
-
console.log('clearDiscountProducts');
|
|
65
66
|
dispatch({
|
|
66
67
|
type: _OrderSessionContext.orderSessionActions.SET_SELECTED_DISCOUNT_PRODUCTS,
|
|
67
68
|
payload: {
|
|
@@ -76,6 +77,9 @@ const ANWBMembershipValidator = _ref => {
|
|
|
76
77
|
});
|
|
77
78
|
};
|
|
78
79
|
const handleMembershipChange = number => {
|
|
80
|
+
if (number === (customer === null || customer === void 0 ? void 0 : customer.anwbId)) {
|
|
81
|
+
return;
|
|
82
|
+
}
|
|
79
83
|
dispatch({
|
|
80
84
|
type: _OrderSessionContext.orderSessionActions.SET_CUSTOMER_ANWB_ID,
|
|
81
85
|
payload: {
|
|
@@ -84,6 +88,22 @@ const ANWBMembershipValidator = _ref => {
|
|
|
84
88
|
});
|
|
85
89
|
clearDiscountProducts();
|
|
86
90
|
};
|
|
91
|
+
(0, _react.useEffect)(() => {
|
|
92
|
+
var _selectedDiscountedPr, _customer$anwbId$leng, _customer$anwbId;
|
|
93
|
+
const hasAnwbProducts = ((_selectedDiscountedPr = selectedDiscountedProducts === null || selectedDiscountedProducts === void 0 ? void 0 : selectedDiscountedProducts.length) !== null && _selectedDiscountedPr !== void 0 ? _selectedDiscountedPr : 0) > 0;
|
|
94
|
+
const hasPrefilledMembership = ((_customer$anwbId$leng = customer === null || customer === void 0 || (_customer$anwbId = customer.anwbId) === null || _customer$anwbId === void 0 ? void 0 : _customer$anwbId.length) !== null && _customer$anwbId$leng !== void 0 ? _customer$anwbId$leng : 0) === 9;
|
|
95
|
+
const isAnwbCode = discountCode === null || discountCode === void 0 ? void 0 : discountCode.toLocaleLowerCase().includes('anwb');
|
|
96
|
+
|
|
97
|
+
// Keep a previously validated ANWB state active after hydration.
|
|
98
|
+
if (isAnwbCode && hasPrefilledMembership && hasAnwbProducts && anwbDiscountValidated !== true) {
|
|
99
|
+
dispatch({
|
|
100
|
+
type: _OrderSessionContext.orderSessionActions.SET_ANWB_DISCOUNT_VALIDATED,
|
|
101
|
+
payload: {
|
|
102
|
+
anwbDiscountValidated: true
|
|
103
|
+
}
|
|
104
|
+
});
|
|
105
|
+
}
|
|
106
|
+
}, [anwbDiscountValidated, customer === null || customer === void 0 ? void 0 : customer.anwbId, discountCode, dispatch, selectedDiscountedProducts]);
|
|
87
107
|
const handleSubmit = number => {
|
|
88
108
|
const isValid = _ANWBValidator.anwbValidator.validate(0, {
|
|
89
109
|
number
|
|
@@ -136,7 +156,7 @@ const ANWBMembershipValidator = _ref => {
|
|
|
136
156
|
onClick: () => {
|
|
137
157
|
handleSubmit(customer === null || customer === void 0 ? void 0 : customer.anwbId);
|
|
138
158
|
},
|
|
139
|
-
isDisabled: (customer === null || customer === void 0 || (_customer$
|
|
159
|
+
isDisabled: (customer === null || customer === void 0 || (_customer$anwbId2 = customer.anwbId) === null || _customer$anwbId2 === void 0 ? void 0 : _customer$anwbId2.length) !== 9,
|
|
140
160
|
label: 'Verzilver!'
|
|
141
161
|
})), ' '), isNumberValid != null && /*#__PURE__*/_react.default.createElement("div", {
|
|
142
162
|
className: (0, _helpers__.withStyle)("alert w-100 ".concat(isNumberValid === true ? 'alert-success' : 'alert-danger'))
|
|
@@ -124,7 +124,7 @@ const DiscountProductsSelector = _ref => {
|
|
|
124
124
|
});
|
|
125
125
|
};
|
|
126
126
|
const isAnwbCode = discountCode === null || discountCode === void 0 ? void 0 : discountCode.toLocaleLowerCase().includes('anwb');
|
|
127
|
-
const inputsDisabled = isAnwbCode &&
|
|
127
|
+
const inputsDisabled = isAnwbCode && anwbDiscountValidated === false;
|
|
128
128
|
if (!(discountProducts !== null && discountProducts !== void 0 && discountProducts.length)) {
|
|
129
129
|
return null;
|
|
130
130
|
}
|
|
@@ -87,7 +87,7 @@ const ProductDiscountCard = () => {
|
|
|
87
87
|
discountCode: code,
|
|
88
88
|
anwbDiscountValidated: validated
|
|
89
89
|
} = anwbStateRef.current;
|
|
90
|
-
if (code !== null && code !== void 0 && code.toLocaleLowerCase().includes('anwb') &&
|
|
90
|
+
if (code !== null && code !== void 0 && code.toLocaleLowerCase().includes('anwb') && validated === false) {
|
|
91
91
|
dispatch({
|
|
92
92
|
type: _OrderSessionContext.orderSessionActions.SET_DISCOUNT_CODE,
|
|
93
93
|
payload: {
|
|
@@ -10,7 +10,6 @@ exports.default = void 0;
|
|
|
10
10
|
require("core-js/modules/web.dom-collections.iterator.js");
|
|
11
11
|
var _react = _interopRequireWildcard(require("react"));
|
|
12
12
|
var _reactRouter = require("react-router");
|
|
13
|
-
var _constants__ = require("../__constants__");
|
|
14
13
|
var _ThemeContext = require("../__context__/ThemeContext");
|
|
15
14
|
var _helpers__ = require("../__helpers__");
|
|
16
15
|
var _useBranchTheme = require("../__hooks__/useBranchTheme");
|
|
@@ -48,6 +47,7 @@ const StyleWrapper = _ref => {
|
|
|
48
47
|
const themeFromHook = (0, _useBranchTheme.useBranchTheme)();
|
|
49
48
|
// Allow parent to override theme via prop (needed when used as npm package)
|
|
50
49
|
const theme = themeProp || themeFromHook;
|
|
50
|
+
const themeClass = (0, _helpers__.getConfiguratorThemeClass)(theme);
|
|
51
51
|
(0, _react.useLayoutEffect)(() => {
|
|
52
52
|
window.addEventListener('resize', handleResize);
|
|
53
53
|
handleResize();
|
|
@@ -74,7 +74,7 @@ const StyleWrapper = _ref => {
|
|
|
74
74
|
return /*#__PURE__*/_react.default.createElement(_ThemeContext.ThemeProvider, {
|
|
75
75
|
theme: theme
|
|
76
76
|
}, /*#__PURE__*/_react.default.createElement("main", {
|
|
77
|
-
className: (0, _helpers__.withStyle)("thm-configurator ".concat(APP_CONFIG.internal ? 'thm-configurator--offset' : '', " ").concat(
|
|
77
|
+
className: (0, _helpers__.withStyle)("thm-configurator ".concat(APP_CONFIG.internal ? 'thm-configurator--offset' : '', " ").concat(themeClass)),
|
|
78
78
|
style: height
|
|
79
79
|
}, children));
|
|
80
80
|
};
|
|
@@ -1577,7 +1577,7 @@ const InternalAppointmentForm = _ref => {
|
|
|
1577
1577
|
className: (0, _helpers__.withStyle)('col-12 col-md-6')
|
|
1578
1578
|
}, /*#__PURE__*/_react.default.createElement(_TextAreaInput.default, {
|
|
1579
1579
|
placeholder: "",
|
|
1580
|
-
|
|
1580
|
+
initialValue: contextCustomer === null || contextCustomer === void 0 ? void 0 : contextCustomer.note,
|
|
1581
1581
|
name: "note",
|
|
1582
1582
|
onChange: value => dispatch({
|
|
1583
1583
|
type: _OrderSessionContext.orderSessionActions.SET_CUSTOMER_NOTE,
|
|
@@ -1,7 +1,9 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
+
require("core-js/modules/es.array.includes.js");
|
|
3
4
|
require("core-js/modules/es.promise.js");
|
|
4
5
|
require("core-js/modules/es.regexp.exec.js");
|
|
6
|
+
require("core-js/modules/es.string.includes.js");
|
|
5
7
|
require("core-js/modules/es.string.replace.js");
|
|
6
8
|
require("core-js/modules/es.weak-map.js");
|
|
7
9
|
require("core-js/modules/esnext.iterator.constructor.js");
|
|
@@ -16,8 +18,10 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
16
18
|
value: true
|
|
17
19
|
});
|
|
18
20
|
exports.default = void 0;
|
|
21
|
+
require("core-js/modules/es.array.includes.js");
|
|
19
22
|
require("core-js/modules/es.promise.js");
|
|
20
23
|
require("core-js/modules/es.regexp.exec.js");
|
|
24
|
+
require("core-js/modules/es.string.includes.js");
|
|
21
25
|
require("core-js/modules/es.string.replace.js");
|
|
22
26
|
require("core-js/modules/esnext.iterator.constructor.js");
|
|
23
27
|
require("core-js/modules/esnext.iterator.find.js");
|
|
@@ -130,6 +134,7 @@ const getEmptyCustomerState = () => ({
|
|
|
130
134
|
lastName: '',
|
|
131
135
|
email: '',
|
|
132
136
|
phoneNumber: '',
|
|
137
|
+
anwbId: '',
|
|
133
138
|
zipCode: '',
|
|
134
139
|
houseNumber: '',
|
|
135
140
|
houseNumberAddition: '',
|
|
@@ -239,6 +244,7 @@ const InternalQuotationForm = _ref => {
|
|
|
239
244
|
lastName: (contextCustomer === null || contextCustomer === void 0 ? void 0 : contextCustomer.lastName) || '',
|
|
240
245
|
email: (contextCustomer === null || contextCustomer === void 0 ? void 0 : contextCustomer.email) || '',
|
|
241
246
|
phoneNumber: (contextCustomer === null || contextCustomer === void 0 ? void 0 : contextCustomer.phoneNumber) || '',
|
|
247
|
+
anwbId: (contextCustomer === null || contextCustomer === void 0 ? void 0 : contextCustomer.anwbId) || '',
|
|
242
248
|
zipCode: (contextCustomer === null || contextCustomer === void 0 ? void 0 : contextCustomer.zipCode) || '',
|
|
243
249
|
houseNumber: (contextCustomer === null || contextCustomer === void 0 ? void 0 : contextCustomer.houseNumber) || '',
|
|
244
250
|
houseNumberAddition: (contextCustomer === null || contextCustomer === void 0 ? void 0 : contextCustomer.houseNumberAddition) || '',
|
|
@@ -301,6 +307,7 @@ const InternalQuotationForm = _ref => {
|
|
|
301
307
|
lastName: _OrderSessionContext.orderSessionActions.SET_CUSTOMER_LAST_NAME,
|
|
302
308
|
email: _OrderSessionContext.orderSessionActions.SET_CUSTOMER_EMAIL,
|
|
303
309
|
phoneNumber: _OrderSessionContext.orderSessionActions.SET_CUSTOMER_PHONE_NUMBER,
|
|
310
|
+
anwbId: _OrderSessionContext.orderSessionActions.SET_CUSTOMER_ANWB_ID,
|
|
304
311
|
zipCode: _OrderSessionContext.orderSessionActions.SET_CUSTOMER_ZIP_CODE,
|
|
305
312
|
houseNumber: _OrderSessionContext.orderSessionActions.SET_CUSTOMER_HOUSE_NUMBER,
|
|
306
313
|
houseNumberAddition: _OrderSessionContext.orderSessionActions.SET_CUSTOMER_HOUSE_NUMBER_ADDITION,
|
|
@@ -449,7 +456,7 @@ const InternalQuotationForm = _ref => {
|
|
|
449
456
|
*/
|
|
450
457
|
const handleSubmit = async () => {
|
|
451
458
|
try {
|
|
452
|
-
var _customer$firstName, _customer$lastName, _customer$phoneNumber, _customer$houseNumber, _customer$houseNumber2, _customer$streetName, _customer$countryId, _customer$city, _customer$email, _contextCustomer$note, _customer$zipCode, _customer$companyName,
|
|
459
|
+
var _customer$firstName, _customer$lastName, _customer$phoneNumber, _customer$houseNumber, _customer$houseNumber2, _customer$streetName, _customer$countryId, _customer$city, _customer$email, _ref3, _contextCustomer$anwb, _contextCustomer$note, _customer$zipCode, _customer$companyName, _ref4;
|
|
453
460
|
setErrors(null);
|
|
454
461
|
if (!model) {
|
|
455
462
|
// Note: this does not throw on error.
|
|
@@ -488,6 +495,7 @@ const InternalQuotationForm = _ref => {
|
|
|
488
495
|
isTmg
|
|
489
496
|
}
|
|
490
497
|
});
|
|
498
|
+
const isAnwbCode = discountCode === null || discountCode === void 0 ? void 0 : discountCode.toLocaleLowerCase().includes('anwb');
|
|
491
499
|
const payload = (0, _helpers__.removeNullishProps)(_objectSpread(_objectSpread({
|
|
492
500
|
vehicle,
|
|
493
501
|
customer: (0, _helpers__.removeNullishProps)(_objectSpread(_objectSpread({}, customer), {}, {
|
|
@@ -500,13 +508,14 @@ const InternalQuotationForm = _ref => {
|
|
|
500
508
|
countryId: (_customer$countryId = customer === null || customer === void 0 ? void 0 : customer.countryId) !== null && _customer$countryId !== void 0 ? _customer$countryId : undefined,
|
|
501
509
|
city: (_customer$city = customer === null || customer === void 0 ? void 0 : customer.city) !== null && _customer$city !== void 0 ? _customer$city : undefined,
|
|
502
510
|
email: (_customer$email = customer === null || customer === void 0 ? void 0 : customer.email) !== null && _customer$email !== void 0 ? _customer$email : undefined,
|
|
511
|
+
anwbId: isAnwbCode ? (_ref3 = (_contextCustomer$anwb = contextCustomer === null || contextCustomer === void 0 ? void 0 : contextCustomer.anwbId) !== null && _contextCustomer$anwb !== void 0 ? _contextCustomer$anwb : customer === null || customer === void 0 ? void 0 : customer.anwbId) !== null && _ref3 !== void 0 ? _ref3 : undefined : undefined,
|
|
503
512
|
note: (_contextCustomer$note = contextCustomer === null || contextCustomer === void 0 ? void 0 : contextCustomer.note) !== null && _contextCustomer$note !== void 0 ? _contextCustomer$note : undefined,
|
|
504
513
|
zipCode: (_customer$zipCode = customer === null || customer === void 0 ? void 0 : customer.zipCode) !== null && _customer$zipCode !== void 0 ? _customer$zipCode : undefined,
|
|
505
514
|
companyName: activeOwnershipType !== _constants__.VEHICLE_OWNERSHIP_TYPE.Leasemaatschappij ? (_customer$companyName = customer === null || customer === void 0 ? void 0 : customer.companyName) !== null && _customer$companyName !== void 0 ? _customer$companyName : undefined : undefined
|
|
506
515
|
})),
|
|
507
516
|
chassisNumber: chassisNumber !== null && chassisNumber !== void 0 ? chassisNumber : undefined,
|
|
508
517
|
channel,
|
|
509
|
-
licensePlate: (
|
|
518
|
+
licensePlate: (_ref4 = licensePlate || _licensePlate) === null || _ref4 === void 0 ? void 0 : _ref4.replace(/-/g, ''),
|
|
510
519
|
model,
|
|
511
520
|
answers: (0, _helpers__.removeNullishProps)({
|
|
512
521
|
duration: durationAnswer,
|
|
@@ -619,12 +628,12 @@ const InternalQuotationForm = _ref => {
|
|
|
619
628
|
placeholder: "Maak een keuze",
|
|
620
629
|
errorMessage: (errors === null || errors === void 0 ? void 0 : errors['channelId']) || (errors === null || errors === void 0 ? void 0 : errors['channelType']),
|
|
621
630
|
initialValue: initialChannel,
|
|
622
|
-
onChange:
|
|
631
|
+
onChange: _ref5 => {
|
|
623
632
|
var _value$kanaalType, _value$kanaalType2;
|
|
624
633
|
let {
|
|
625
634
|
label,
|
|
626
635
|
value
|
|
627
|
-
} =
|
|
636
|
+
} = _ref5;
|
|
628
637
|
return dispatch({
|
|
629
638
|
type: _OrderSessionContext.orderSessionActions.SET_MARKETING_CHANNEL,
|
|
630
639
|
payload: {
|
|
@@ -1371,6 +1371,9 @@ const AuthSessionRuntimeSync = () => {
|
|
|
1371
1371
|
(0, _react.useLayoutEffect)(() => {
|
|
1372
1372
|
var _ref;
|
|
1373
1373
|
if (!APP_CONFIG.internal || !initialized) {
|
|
1374
|
+
if (APP_CONFIG.internal) {
|
|
1375
|
+
_AuthRuntime.authRuntime.setSessionContextReady(false);
|
|
1376
|
+
}
|
|
1374
1377
|
return;
|
|
1375
1378
|
}
|
|
1376
1379
|
_AuthRuntime.authRuntime.setActiveBranchId((_ref = selectedBranch !== null && selectedBranch !== void 0 ? selectedBranch : branch === null || branch === void 0 ? void 0 : branch.entityId) !== null && _ref !== void 0 ? _ref : null);
|
|
@@ -1378,11 +1381,15 @@ const AuthSessionRuntimeSync = () => {
|
|
|
1378
1381
|
(0, _react.useEffect)(() => {
|
|
1379
1382
|
var _ref2;
|
|
1380
1383
|
if (!APP_CONFIG.internal || !initialized) {
|
|
1384
|
+
if (APP_CONFIG.internal) {
|
|
1385
|
+
_AuthRuntime.authRuntime.setSessionContextReady(false);
|
|
1386
|
+
}
|
|
1381
1387
|
return;
|
|
1382
1388
|
}
|
|
1383
1389
|
const branchId = (_ref2 = selectedBranch !== null && selectedBranch !== void 0 ? selectedBranch : branch === null || branch === void 0 ? void 0 : branch.entityId) !== null && _ref2 !== void 0 ? _ref2 : null;
|
|
1384
1390
|
if (!authenticated || !branchId || !formula) {
|
|
1385
1391
|
lastSyncedContextRef.current = null;
|
|
1392
|
+
_AuthRuntime.authRuntime.setSessionContextReady(false);
|
|
1386
1393
|
return;
|
|
1387
1394
|
}
|
|
1388
1395
|
const normalizedFormula = formula === _constants__.CONFIGURATOR_FORMULAS.THM ? _constants__.CONFIGURATOR_FORMULAS.TM : formula;
|
|
@@ -1392,9 +1399,11 @@ const AuthSessionRuntimeSync = () => {
|
|
|
1392
1399
|
module: module !== null && module !== void 0 ? module : null
|
|
1393
1400
|
});
|
|
1394
1401
|
if (lastSyncedContextRef.current === nextContextKey) {
|
|
1402
|
+
_AuthRuntime.authRuntime.setSessionContextReady(true);
|
|
1395
1403
|
return;
|
|
1396
1404
|
}
|
|
1397
1405
|
let isCancelled = false;
|
|
1406
|
+
_AuthRuntime.authRuntime.setSessionContextReady(false);
|
|
1398
1407
|
_authenticatedProxyApi.authenticatedProxyApi.putSessionContext({
|
|
1399
1408
|
branchEntityId: branchId,
|
|
1400
1409
|
formula: normalizedFormula,
|
|
@@ -1402,9 +1411,11 @@ const AuthSessionRuntimeSync = () => {
|
|
|
1402
1411
|
}).then(() => {
|
|
1403
1412
|
if (!isCancelled) {
|
|
1404
1413
|
lastSyncedContextRef.current = nextContextKey;
|
|
1414
|
+
_AuthRuntime.authRuntime.setSessionContextReady(true);
|
|
1405
1415
|
}
|
|
1406
1416
|
}).catch(error => {
|
|
1407
1417
|
console.warn('Failed to sync authenticated session context', error);
|
|
1418
|
+
_AuthRuntime.authRuntime.setSessionContextReady(false);
|
|
1408
1419
|
});
|
|
1409
1420
|
return () => {
|
|
1410
1421
|
isCancelled = true;
|
|
@@ -69,6 +69,10 @@ function _toPrimitive(t, r) {
|
|
|
69
69
|
}
|
|
70
70
|
return ("string" === r ? String : Number)(t);
|
|
71
71
|
}
|
|
72
|
+
const isAnwbDiscountCode = function isAnwbDiscountCode() {
|
|
73
|
+
let discountCode = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : '';
|
|
74
|
+
return discountCode === null || discountCode === void 0 ? void 0 : discountCode.toLocaleLowerCase().includes('anwb');
|
|
75
|
+
};
|
|
72
76
|
const getDossierPrimaryEmail = exports.getDossierPrimaryEmail = function getDossierPrimaryEmail() {
|
|
73
77
|
var _dossier$email, _ref, _dossier$klant$email, _dossier$klant, _dossier$klant2;
|
|
74
78
|
let dossier = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
@@ -98,6 +102,8 @@ const parseDossierToOrderSession = exports.parseDossierToOrderSession = function
|
|
|
98
102
|
let dossier = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
99
103
|
// Detect meerprijs (extra price) line from dossier lines
|
|
100
104
|
const meerprijsLine = dossier === null || dossier === void 0 || (_dossier$lines = dossier.lines) === null || _dossier$lines === void 0 ? void 0 : _dossier$lines.find(line => line.articleNumber === 'MEERPRIJS' && line.activeArticle);
|
|
105
|
+
const hasAnwbMembershipId = Boolean(dossier === null || dossier === void 0 ? void 0 : dossier.anwbId);
|
|
106
|
+
const anwbDiscountValidated = isAnwbDiscountCode(dossier === null || dossier === void 0 ? void 0 : dossier.discountCode) && hasAnwbMembershipId;
|
|
101
107
|
return {
|
|
102
108
|
canAlterQuantity: (dossier === null || dossier === void 0 || (_dossier$statusBeoord = dossier.statusBeoordeling) === null || _dossier$statusBeoord === void 0 ? void 0 : _dossier$statusBeoord.title) === _constants__.STATUS_ASSESSMENT.Open,
|
|
103
109
|
licensePlate: dossier === null || dossier === void 0 ? void 0 : dossier.kenteken,
|
|
@@ -137,6 +143,7 @@ const parseDossierToOrderSession = exports.parseDossierToOrderSession = function
|
|
|
137
143
|
})) !== null && _dossier$lines$some !== void 0 ? _dossier$lines$some : false,
|
|
138
144
|
selectedBranch: dossier === null || dossier === void 0 || (_dossier$vestiging = dossier.vestiging) === null || _dossier$vestiging === void 0 ? void 0 : _dossier$vestiging.entityId,
|
|
139
145
|
discountCode: dossier === null || dossier === void 0 ? void 0 : dossier.discountCode,
|
|
146
|
+
anwbDiscountValidated,
|
|
140
147
|
chassisNumber: (_dossier$chassisnumme = dossier === null || dossier === void 0 ? void 0 : dossier.chassisnummer) !== null && _dossier$chassisnumme !== void 0 ? _dossier$chassisnumme : null,
|
|
141
148
|
vehicle: {
|
|
142
149
|
ownershipType: dossier === null || dossier === void 0 || (_dossier$typeEigendom = dossier.typeEigendomAuto) === null || _dossier$typeEigendom === void 0 ? void 0 : _dossier$typeEigendom.title,
|
|
@@ -16,7 +16,7 @@ require("core-js/modules/web.dom-collections.iterator.js");
|
|
|
16
16
|
Object.defineProperty(exports, "__esModule", {
|
|
17
17
|
value: true
|
|
18
18
|
});
|
|
19
|
-
exports.withStyle = exports.truncateAtPipe = exports.removeNullishProps = exports.reduceYupErrorsToObject = exports.pushToDataLayer = exports.parseJson = exports.parseDateAndTimeToTimestamp = exports.parseArrayToInputOptions = exports.normalizeArray = exports.groupByKey = exports.getProxyApiErrorMessage = exports.formatPrice = exports.formatMontageTime = exports.createSlug = void 0;
|
|
19
|
+
exports.withStyle = exports.truncateAtPipe = exports.removeNullishProps = exports.reduceYupErrorsToObject = exports.pushToDataLayer = exports.parseJson = exports.parseDateAndTimeToTimestamp = exports.parseArrayToInputOptions = exports.normalizeArray = exports.groupByKey = exports.getProxyApiErrorMessage = exports.getConfiguratorThemeClassByFormula = exports.getConfiguratorThemeClass = exports.getConfiguratorButtonVariant = exports.formatPrice = exports.formatMontageTime = exports.createSlug = void 0;
|
|
20
20
|
require("core-js/modules/es.array.reduce.js");
|
|
21
21
|
require("core-js/modules/es.json.stringify.js");
|
|
22
22
|
require("core-js/modules/es.object.from-entries.js");
|
|
@@ -31,6 +31,7 @@ require("core-js/modules/esnext.iterator.map.js");
|
|
|
31
31
|
require("core-js/modules/esnext.iterator.reduce.js");
|
|
32
32
|
require("core-js/modules/web.dom-collections.iterator.js");
|
|
33
33
|
var _slugify = _interopRequireDefault(require("slugify"));
|
|
34
|
+
var _constants__ = require("../__constants__");
|
|
34
35
|
function _interopRequireDefault(e) {
|
|
35
36
|
return e && e.__esModule ? e : {
|
|
36
37
|
default: e
|
|
@@ -89,11 +90,52 @@ const withStyle = classes => {
|
|
|
89
90
|
return (_window$styles = window.styles) === null || _window$styles === void 0 ? void 0 : _window$styles[className];
|
|
90
91
|
}).join(' ');
|
|
91
92
|
};
|
|
93
|
+
exports.withStyle = withStyle;
|
|
94
|
+
const getConfiguratorThemeClass = theme => {
|
|
95
|
+
switch (theme) {
|
|
96
|
+
case _constants__.BRANCH_THEME_BY_FORMULA.Trekhaakcentrum:
|
|
97
|
+
return 'thc';
|
|
98
|
+
case _constants__.BRANCH_THEME_BY_FORMULA.TowMotive:
|
|
99
|
+
return 'tm';
|
|
100
|
+
case _constants__.BRANCH_THEME_BY_FORMULA.TowMotiveGroup:
|
|
101
|
+
return 'tmg';
|
|
102
|
+
default:
|
|
103
|
+
return '';
|
|
104
|
+
}
|
|
105
|
+
};
|
|
106
|
+
exports.getConfiguratorThemeClass = getConfiguratorThemeClass;
|
|
107
|
+
const getConfiguratorThemeClassByFormula = formula => {
|
|
108
|
+
switch (formula) {
|
|
109
|
+
case 'THC':
|
|
110
|
+
return 'thc';
|
|
111
|
+
case 'TMG':
|
|
112
|
+
return 'tmg';
|
|
113
|
+
case 'TOW':
|
|
114
|
+
case 'TH':
|
|
115
|
+
case 'TowMotive':
|
|
116
|
+
return 'tm';
|
|
117
|
+
default:
|
|
118
|
+
return '';
|
|
119
|
+
}
|
|
120
|
+
};
|
|
121
|
+
exports.getConfiguratorThemeClassByFormula = getConfiguratorThemeClassByFormula;
|
|
122
|
+
const getConfiguratorButtonVariant = exports.getConfiguratorButtonVariant = function getConfiguratorButtonVariant(theme) {
|
|
123
|
+
let outline = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;
|
|
124
|
+
switch (theme) {
|
|
125
|
+
case _constants__.BRANCH_THEME_BY_FORMULA.Trekhaakcentrum:
|
|
126
|
+
return outline ? 'outline-custom-primary' : 'custom-primary';
|
|
127
|
+
case _constants__.BRANCH_THEME_BY_FORMULA.TowMotive:
|
|
128
|
+
return outline ? 'outline-tm-primary' : 'tm-primary';
|
|
129
|
+
case _constants__.BRANCH_THEME_BY_FORMULA.TowMotiveGroup:
|
|
130
|
+
return outline ? 'outline-tmg-primary' : 'tmg-primary';
|
|
131
|
+
default:
|
|
132
|
+
return outline ? 'outline-primary' : 'primary';
|
|
133
|
+
}
|
|
134
|
+
};
|
|
92
135
|
|
|
93
136
|
/**
|
|
94
137
|
* @description Formats a given number to a price string
|
|
95
138
|
*/
|
|
96
|
-
exports.withStyle = withStyle;
|
|
97
139
|
const formatPrice = price => {
|
|
98
140
|
return price == null || Number.isNaN(price) || price === 'N.v.t' ? 'N.v.t' : new Intl.NumberFormat('nl-NL', {
|
|
99
141
|
style: 'currency',
|
|
@@ -50,11 +50,15 @@ const useBranchTheme = () => {
|
|
|
50
50
|
}
|
|
51
51
|
case _constants__.BRANCH_FORMULAS.TowMotiveGroup:
|
|
52
52
|
case _constants__.CONFIGURATOR_FORMULAS.TMG:
|
|
53
|
+
{
|
|
54
|
+
return _constants__.BRANCH_THEME_BY_FORMULA.TowMotiveGroup;
|
|
55
|
+
}
|
|
56
|
+
case _constants__.BRANCH_FORMULAS.TowMotive:
|
|
53
57
|
case _constants__.CONFIGURATOR_FORMULAS.TOW:
|
|
54
58
|
case _constants__.CONFIGURATOR_FORMULAS.TH:
|
|
55
59
|
case _constants__.CONFIGURATOR_FORMULAS.TowMotive:
|
|
56
60
|
{
|
|
57
|
-
return _constants__.BRANCH_THEME_BY_FORMULA.
|
|
61
|
+
return _constants__.BRANCH_THEME_BY_FORMULA.TowMotive;
|
|
58
62
|
}
|
|
59
63
|
default:
|
|
60
64
|
{
|