@pelcro/react-pelcro-js 4.0.0-alpha.84 → 4.0.0-alpha.85

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/index.cjs.js CHANGED
@@ -28460,10 +28460,11 @@ const SubscriptionCreateSummary = () => {
28460
28460
  const autoRenewed = plan.auto_renew;
28461
28461
  const {
28462
28462
  interval_translated: intervalTranslated,
28463
- interval_count: intervalCount
28463
+ interval_count: intervalCount,
28464
+ interval
28464
28465
  } = plan;
28465
28466
  const intervalText = t("labels.interval", {
28466
- interval: intervalTranslated,
28467
+ interval: intervalTranslated !== null && intervalTranslated !== void 0 ? intervalTranslated : interval,
28467
28468
  count: intervalCount
28468
28469
  });
28469
28470
  const priceFormatted = getFormattedPriceByLocal((plan === null || plan === void 0 ? void 0 : plan.amount) * ((_plan$quantity = plan === null || plan === void 0 ? void 0 : plan.quantity) !== null && _plan$quantity !== void 0 ? _plan$quantity : 1), plan === null || plan === void 0 ? void 0 : plan.currency, getPageOrDefaultLanguage());
@@ -33049,9 +33050,16 @@ const OrderCreateContainer = props => /*#__PURE__*/React__default['default'].cre
33049
33050
  const OrderCreateSummary = ({
33050
33051
  order
33051
33052
  }) => {
33052
- var _calcAndFormatItemsTo, _order$;
33053
+ const [items, setItems] = React.useState([]);
33054
+ const [orderTotal, setOrderTotal] = React.useState("");
33055
+ React.useEffect(() => {
33056
+ if ((order === null || order === void 0 ? void 0 : order.length) > 0) {
33057
+ var _calcAndFormatItemsTo, _order$;
33053
33058
 
33054
- const items = (order === null || order === void 0 ? void 0 : order.length) > 0 ? order : [];
33059
+ setItems(order);
33060
+ setOrderTotal((_calcAndFormatItemsTo = calcAndFormatItemsTotal(order, (_order$ = order[0]) === null || _order$ === void 0 ? void 0 : _order$.currency)) !== null && _calcAndFormatItemsTo !== void 0 ? _calcAndFormatItemsTo : getFormattedPriceByLocal(order === null || order === void 0 ? void 0 : order.price, order === null || order === void 0 ? void 0 : order.currency, getPageOrDefaultLanguage()));
33061
+ }
33062
+ }, []);
33055
33063
  return /*#__PURE__*/React__default['default'].createElement("div", {
33056
33064
  className: "plc-px-8 md:plc-px-0"
33057
33065
  }, /*#__PURE__*/React__default['default'].createElement("div", {
@@ -33094,7 +33102,7 @@ const OrderCreateSummary = ({
33094
33102
  className: "plc-text-base"
33095
33103
  }, "Total"), /*#__PURE__*/React__default['default'].createElement("dd", {
33096
33104
  className: "plc-text-base"
33097
- }, order && ((_calcAndFormatItemsTo = calcAndFormatItemsTotal(order, (_order$ = order[0]) === null || _order$ === void 0 ? void 0 : _order$.currency)) !== null && _calcAndFormatItemsTo !== void 0 ? _calcAndFormatItemsTo : getFormattedPriceByLocal(order === null || order === void 0 ? void 0 : order.price, order === null || order === void 0 ? void 0 : order.currency, getPageOrDefaultLanguage()))))));
33105
+ }, orderTotal))));
33098
33106
  };
33099
33107
 
33100
33108
  const OrderCreateView = props => {
package/dist/index.esm.js CHANGED
@@ -28430,10 +28430,11 @@ const SubscriptionCreateSummary = () => {
28430
28430
  const autoRenewed = plan.auto_renew;
28431
28431
  const {
28432
28432
  interval_translated: intervalTranslated,
28433
- interval_count: intervalCount
28433
+ interval_count: intervalCount,
28434
+ interval
28434
28435
  } = plan;
28435
28436
  const intervalText = t("labels.interval", {
28436
- interval: intervalTranslated,
28437
+ interval: intervalTranslated !== null && intervalTranslated !== void 0 ? intervalTranslated : interval,
28437
28438
  count: intervalCount
28438
28439
  });
28439
28440
  const priceFormatted = getFormattedPriceByLocal((plan === null || plan === void 0 ? void 0 : plan.amount) * ((_plan$quantity = plan === null || plan === void 0 ? void 0 : plan.quantity) !== null && _plan$quantity !== void 0 ? _plan$quantity : 1), plan === null || plan === void 0 ? void 0 : plan.currency, getPageOrDefaultLanguage());
@@ -33019,9 +33020,16 @@ const OrderCreateContainer = props => /*#__PURE__*/React__default.createElement(
33019
33020
  const OrderCreateSummary = ({
33020
33021
  order
33021
33022
  }) => {
33022
- var _calcAndFormatItemsTo, _order$;
33023
+ const [items, setItems] = useState([]);
33024
+ const [orderTotal, setOrderTotal] = useState("");
33025
+ useEffect(() => {
33026
+ if ((order === null || order === void 0 ? void 0 : order.length) > 0) {
33027
+ var _calcAndFormatItemsTo, _order$;
33023
33028
 
33024
- const items = (order === null || order === void 0 ? void 0 : order.length) > 0 ? order : [];
33029
+ setItems(order);
33030
+ setOrderTotal((_calcAndFormatItemsTo = calcAndFormatItemsTotal(order, (_order$ = order[0]) === null || _order$ === void 0 ? void 0 : _order$.currency)) !== null && _calcAndFormatItemsTo !== void 0 ? _calcAndFormatItemsTo : getFormattedPriceByLocal(order === null || order === void 0 ? void 0 : order.price, order === null || order === void 0 ? void 0 : order.currency, getPageOrDefaultLanguage()));
33031
+ }
33032
+ }, []);
33025
33033
  return /*#__PURE__*/React__default.createElement("div", {
33026
33034
  className: "plc-px-8 md:plc-px-0"
33027
33035
  }, /*#__PURE__*/React__default.createElement("div", {
@@ -33064,7 +33072,7 @@ const OrderCreateSummary = ({
33064
33072
  className: "plc-text-base"
33065
33073
  }, "Total"), /*#__PURE__*/React__default.createElement("dd", {
33066
33074
  className: "plc-text-base"
33067
- }, order && ((_calcAndFormatItemsTo = calcAndFormatItemsTotal(order, (_order$ = order[0]) === null || _order$ === void 0 ? void 0 : _order$.currency)) !== null && _calcAndFormatItemsTo !== void 0 ? _calcAndFormatItemsTo : getFormattedPriceByLocal(order === null || order === void 0 ? void 0 : order.price, order === null || order === void 0 ? void 0 : order.currency, getPageOrDefaultLanguage()))))));
33075
+ }, orderTotal))));
33068
33076
  };
33069
33077
 
33070
33078
  const OrderCreateView = props => {
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@pelcro/react-pelcro-js",
3
3
  "description": "Pelcro's React UI Elements",
4
- "version": "4.0.0-alpha.84",
4
+ "version": "4.0.0-alpha.85",
5
5
  "license": "MIT",
6
6
  "private": false,
7
7
  "main": "dist/index.cjs.js",