thm-p3-configurator 0.0.123 → 0.0.124

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.
@@ -124,7 +124,6 @@ function _toPrimitive(t, r) {
124
124
  return ("string" === r ? String : Number)(t);
125
125
  }
126
126
  const ProductCartTable = () => {
127
- var _marketCorrection$con, _marketCorrection$con2;
128
127
  const formula = (0, _FormulaContext.useFormula)();
129
128
  const [isToggled, setIsToggled] = (0, _react.useState)(false);
130
129
  const [{
@@ -334,14 +333,14 @@ const ProductCartTable = () => {
334
333
  text: (0, _helpers__.formatPrice)(totals === null || totals === void 0 ? void 0 : totals.totalMontageExclVat),
335
334
  className: 'cart__table-price text-end'
336
335
  }] : [{}, {}, {
337
- text: (0, _helpers__.formatPrice)(totals === null || totals === void 0 ? void 0 : totals.montagePricePlusMarketCorrectionInclVat),
336
+ text: (0, _helpers__.formatPrice)(totals === null || totals === void 0 ? void 0 : totals.montagePriceInclVat),
338
337
  className: 'cart__table-price text-end'
339
338
  }])]
340
339
  }), isToggled && marketCorrection && /*#__PURE__*/_react.default.createElement(_ProductTableStaticRow.default, {
341
340
  productTitle: 'Marktcorrectie',
342
341
  productImage: _montagePlaceholder.default,
343
342
  extraCells: [{}, {}, {}, ...(isToggled ? [{
344
- text: (marketCorrection === null || marketCorrection === void 0 ? void 0 : marketCorrection.locationTotal) > 0 ? "".concat((0, _helpers__.formatPrice)(((_marketCorrection$con = marketCorrection === null || marketCorrection === void 0 ? void 0 : marketCorrection.consumerTotal) !== null && _marketCorrection$con !== void 0 ? _marketCorrection$con : 0) / 1.21 - marketCorrection.locationTotal), " (").concat(Math.round((((_marketCorrection$con2 = marketCorrection === null || marketCorrection === void 0 ? void 0 : marketCorrection.consumerTotal) !== null && _marketCorrection$con2 !== void 0 ? _marketCorrection$con2 : 0) / 1.21 - marketCorrection.locationTotal) / marketCorrection.locationTotal * 10000) / 100, "%)") : 'N.v.t.',
343
+ text: (marketCorrection === null || marketCorrection === void 0 ? void 0 : marketCorrection.locationTotal) > 0 ? "".concat((0, _helpers__.formatPrice)(marketCorrection === null || marketCorrection === void 0 ? void 0 : marketCorrection.locationTotal), " (").concat(Math.round(((marketCorrection === null || marketCorrection === void 0 ? void 0 : marketCorrection.consumerTotal) - (marketCorrection === null || marketCorrection === void 0 ? void 0 : marketCorrection.locationTotal)) / (marketCorrection === null || marketCorrection === void 0 ? void 0 : marketCorrection.locationTotal) * 100 * 100) / 100, "%)") : 'N.v.t.',
345
344
  className: 'cart__table-price text-end'
346
345
  }, {
347
346
  text: (marketCorrection === null || marketCorrection === void 0 ? void 0 : marketCorrection.locationTotal) > 0 ? (0, _helpers__.formatPrice)(marketCorrection === null || marketCorrection === void 0 ? void 0 : marketCorrection.locationTotal) : 'N.v.t.',
@@ -376,7 +375,7 @@ const ProductCartTable = () => {
376
375
  text: (0, _helpers__.formatPrice)(totals === null || totals === void 0 ? void 0 : totals.subtotalMontageExclVat),
377
376
  className: 'fw-bold text-end pb-2'
378
377
  }] : [{
379
- text: (0, _helpers__.formatPrice)(totals === null || totals === void 0 ? void 0 : totals.subtotalMontageInclVat),
378
+ text: (0, _helpers__.formatPrice)((totals === null || totals === void 0 ? void 0 : totals.subtotalMontageInclVat) - (totals === null || totals === void 0 ? void 0 : totals.totalMarketCorrectionInclVat)),
380
379
  className: 'fw-bold text-end pb-2'
381
380
  }])]
382
381
  })), accessoireProducts.length > 0 && /*#__PURE__*/_react.default.createElement(_ProductTableSection.default, {
@@ -571,6 +571,20 @@ const InternalAppointmentForm = _ref => {
571
571
  isRequired: true,
572
572
  label: "Telefoonnummer:",
573
573
  errorMessage: errors === null || errors === void 0 ? void 0 : errors['phoneNumber']
574
+ }), /*#__PURE__*/_react.default.createElement(_TextInput.default, {
575
+ placeholder: "",
576
+ initialValue: customer.city,
577
+ name: "city",
578
+ onChange: value => dispatch({
579
+ type: _OrderSessionContext.orderSessionActions.SET_CUSTOMER_CITY,
580
+ payload: {
581
+ city: value
582
+ }
583
+ }),
584
+ key: "city",
585
+ isRequired: true,
586
+ label: "Stad:",
587
+ errorMessage: errors === null || errors === void 0 ? void 0 : errors['city']
574
588
  }), /*#__PURE__*/_react.default.createElement(_DropdownInput.default, {
575
589
  options: countryOptions,
576
590
  name: "country",
@@ -771,6 +785,27 @@ const InternalAppointmentForm = _ref => {
771
785
  isRequired: true,
772
786
  label: "Stad:",
773
787
  errorMessage: errors === null || errors === void 0 ? void 0 : errors['city']
788
+ }), /*#__PURE__*/_react.default.createElement(_DropdownInput.default, {
789
+ options: countryOptions,
790
+ name: "country",
791
+ label: "Land:",
792
+ isRequired: false,
793
+ isLoading: isLoadingCountries,
794
+ noOptionsMessage: "Geen landen beschikbaar",
795
+ placeholder: "Selecteer een land",
796
+ errorMessage: errors === null || errors === void 0 ? void 0 : errors['countryId'],
797
+ initialValue: initialCountry,
798
+ onChange: _ref6 => {
799
+ let {
800
+ value
801
+ } = _ref6;
802
+ return dispatch({
803
+ type: _OrderSessionContext.orderSessionActions.SET_CUSTOMER_COUNTRY_ID,
804
+ payload: {
805
+ countryId: value
806
+ }
807
+ });
808
+ }
774
809
  })) : /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, /*#__PURE__*/_react.default.createElement(_TextInput.default, {
775
810
  placeholder: "",
776
811
  initialValue: customer.phoneNumber,
@@ -781,7 +816,6 @@ const InternalAppointmentForm = _ref => {
781
816
  phoneNumber: value
782
817
  }
783
818
  }),
784
- key: "phoneNumber",
785
819
  isRequired: true,
786
820
  label: "Telefoonnummer:",
787
821
  errorMessage: errors === null || errors === void 0 ? void 0 : errors['phoneNumber']
@@ -865,18 +899,17 @@ const InternalAppointmentForm = _ref => {
865
899
  placeholder: "Selecteer een land",
866
900
  errorMessage: errors === null || errors === void 0 ? void 0 : errors['countryId'],
867
901
  initialValue: initialCountry,
868
- onChange: _ref6 => {
902
+ onChange: _ref7 => {
869
903
  let {
870
904
  value
871
- } = _ref6;
905
+ } = _ref7;
872
906
  return dispatch({
873
907
  type: _OrderSessionContext.orderSessionActions.SET_CUSTOMER_COUNTRY_ID,
874
908
  payload: {
875
909
  countryId: value
876
910
  }
877
911
  });
878
- },
879
- key: "country"
912
+ }
880
913
  })))))), /*#__PURE__*/_react.default.createElement("div", {
881
914
  className: (0, _helpers__.withStyle)('col-12 mb-4')
882
915
  }, /*#__PURE__*/_react.default.createElement(_CardWide.default, null, /*#__PURE__*/_react.default.createElement("div", {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "thm-p3-configurator",
3
- "version": "0.0.123",
3
+ "version": "0.0.124",
4
4
  "main": "dist/index.js",
5
5
  "module": "dist/index.js",
6
6
  "author": "EnoRm.",