@pisell/private-materials 6.11.62 → 6.11.63

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.
@@ -33,7 +33,7 @@ import useLogger from "../../hooks/useLogger";
33
33
  import { filterVariantGroupByVariants } from "../../components/shoppingCart/utils";
34
34
  import { cloneDeep } from 'lodash';
35
35
  var SkuDetailModal = function SkuDetailModal(_ref, ref) {
36
- var _context$appHelper, _store$getState, _context$engine, _bookingState$booking3, _bookingState$booking6, _bookingState$booking9, _productData$_extend2, _bookingState$booking13, _bookingState$booking14;
36
+ var _context$appHelper, _context$engine, _bookingState$booking3, _bookingState$booking6, _bookingState$booking9, _productData$_extend2, _bookingState$booking13, _bookingState$booking14;
37
37
  var onConfirm = _ref.onConfirm,
38
38
  onRemove = _ref.onRemove,
39
39
  onClose = _ref.onClose;
@@ -137,7 +137,7 @@ var SkuDetailModal = function SkuDetailModal(_ref, ref) {
137
137
  */
138
138
  var _ref3 = useContext(BookingContext) || {},
139
139
  bookingState = _ref3.state;
140
- var symbol = (store === null || store === void 0 || (_store$getState = store.getState) === null || _store$getState === void 0 || (_store$getState = _store$getState.call(store)) === null || _store$getState === void 0 || (_store$getState = _store$getState.global) === null || _store$getState === void 0 ? void 0 : _store$getState.symbol) || '$';
140
+ var symbol = getData('shop_symbol');
141
141
  locales.init(localeTexts, (context === null || context === void 0 || (_context$engine = context.engine) === null || _context$engine === void 0 || (_context$engine = _context$engine.props) === null || _context$engine === void 0 ? void 0 : _context$engine.locale) || 'en');
142
142
  var getDetailData = /*#__PURE__*/function () {
143
143
  var _ref4 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(data, open_deposit) {
@@ -52,7 +52,7 @@ var import_useLogger = __toESM(require("../../hooks/useLogger"));
52
52
  var import_utils3 = require("../../components/shoppingCart/utils");
53
53
  var import_lodash = require("lodash");
54
54
  var SkuDetailModal = ({ onConfirm, onRemove, onClose }, ref) => {
55
- var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k, _l, _m, _n, _o, _p;
55
+ var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k, _l, _m;
56
56
  const [open, setOpen] = (0, import_react.useState)(false);
57
57
  const [productData, setProductData] = (0, import_react.useState)(null);
58
58
  const [note, setNote] = (0, import_react.useState)("");
@@ -91,8 +91,8 @@ var SkuDetailModal = ({ onConfirm, onRemove, onClose }, ref) => {
91
91
  const context = (0, import_useEngineContext.default)();
92
92
  const { store, getData, isWebPos } = ((_a = context.appHelper) == null ? void 0 : _a.utils) || {};
93
93
  const { state: bookingState } = (0, import_react.useContext)(import_model.Context) || {};
94
- const symbol = ((_d = (_c = (_b = store == null ? void 0 : store.getState) == null ? void 0 : _b.call(store)) == null ? void 0 : _c.global) == null ? void 0 : _d.symbol) || "$";
95
- import_utils.locales.init(import_locales.default, ((_f = (_e = context == null ? void 0 : context.engine) == null ? void 0 : _e.props) == null ? void 0 : _f.locale) || "en");
94
+ const symbol = getData("shop_symbol");
95
+ import_utils.locales.init(import_locales.default, ((_c = (_b = context == null ? void 0 : context.engine) == null ? void 0 : _b.props) == null ? void 0 : _c.locale) || "en");
96
96
  const getDetailData = async (data, open_deposit) => {
97
97
  var _a2;
98
98
  const isCallProductDetail = ((_a2 = data == null ? void 0 : data.skuDetailConfig) == null ? void 0 : _a2.isCallProductDetail) ?? false;
@@ -115,19 +115,19 @@ var SkuDetailModal = ({ onConfirm, onRemove, onClose }, ref) => {
115
115
  return Number(
116
116
  ((_c2 = (_b2 = (_a2 = bookingState == null ? void 0 : bookingState.bookingConfig) == null ? void 0 : _a2.config) == null ? void 0 : _b2.stock_setting) == null ? void 0 : _c2.stock_validation) ?? 0
117
117
  );
118
- }, [(_h = (_g = bookingState == null ? void 0 : bookingState.bookingConfig) == null ? void 0 : _g.config) == null ? void 0 : _h.stock_setting]);
118
+ }, [(_e = (_d = bookingState == null ? void 0 : bookingState.bookingConfig) == null ? void 0 : _d.config) == null ? void 0 : _e.stock_setting]);
119
119
  const allowAddToCartWhenOutStock = (0, import_react.useMemo)(() => {
120
120
  var _a2, _b2, _c2;
121
121
  return Number(
122
122
  ((_c2 = (_b2 = (_a2 = bookingState == null ? void 0 : bookingState.bookingConfig) == null ? void 0 : _a2.config) == null ? void 0 : _b2.stock_setting) == null ? void 0 : _c2.allow_add_to_cart_when_out_stock) ?? 0
123
123
  );
124
- }, [(_j = (_i = bookingState == null ? void 0 : bookingState.bookingConfig) == null ? void 0 : _i.config) == null ? void 0 : _j.stock_setting]);
124
+ }, [(_g = (_f = bookingState == null ? void 0 : bookingState.bookingConfig) == null ? void 0 : _f.config) == null ? void 0 : _g.stock_setting]);
125
125
  const enableDontShowAgainToday = (0, import_react.useMemo)(() => {
126
126
  var _a2, _b2, _c2;
127
127
  return Number(
128
128
  ((_c2 = (_b2 = (_a2 = bookingState == null ? void 0 : bookingState.bookingConfig) == null ? void 0 : _a2.config) == null ? void 0 : _b2.stock_setting) == null ? void 0 : _c2.do_not_show_again_today) ?? 0
129
129
  );
130
- }, [(_l = (_k = bookingState == null ? void 0 : bookingState.bookingConfig) == null ? void 0 : _k.config) == null ? void 0 : _l.stock_setting]);
130
+ }, [(_i = (_h = bookingState == null ? void 0 : bookingState.bookingConfig) == null ? void 0 : _h.config) == null ? void 0 : _i.stock_setting]);
131
131
  const hasSkuOptions = (0, import_react.useMemo)(() => {
132
132
  const data = productData;
133
133
  const hasVariantGroup = Array.isArray(data == null ? void 0 : data.variant_group) && data.variant_group.length > 0;
@@ -314,7 +314,7 @@ var SkuDetailModal = ({ onConfirm, onRemove, onClose }, ref) => {
314
314
  const price = ((_a2 = productData == null ? void 0 : productData._extend) == null ? void 0 : _a2.price) || 0;
315
315
  const priceSign = Number(price) < 0 ? "-" : "";
316
316
  return `${priceSign}${symbol}${Math.abs(Number(price))}`;
317
- }, [(_m = productData == null ? void 0 : productData._extend) == null ? void 0 : _m.price, symbol]);
317
+ }, [(_j = productData == null ? void 0 : productData._extend) == null ? void 0 : _j.price, symbol]);
318
318
  const unitPrice = (0, import_react.useMemo)(() => {
319
319
  const activeSkuValue = (skuValue == null ? void 0 : skuValue.product_id) ? skuValue : skuDefaultValue;
320
320
  return getSelectedUnitPrice({ productData, skuValue: activeSkuValue });
@@ -817,7 +817,7 @@ var SkuDetailModal = ({ onConfirm, onRemove, onClose }, ref) => {
817
817
  onCancel: handleStockAlertCancel
818
818
  },
819
819
  /* @__PURE__ */ import_react.default.createElement("div", { style: { padding: "40px 0 0 0" } }, /* @__PURE__ */ import_react.default.createElement("div", { style: { color: "#344054", fontSize: 14, lineHeight: "22px" } }, import_utils.locales.getText("pisell2.text.sku.detail.modal.stock.alert.desc")), Number(
820
- ((_p = (_o = (_n = bookingState == null ? void 0 : bookingState.bookingConfig) == null ? void 0 : _n.config) == null ? void 0 : _o.stock_setting) == null ? void 0 : _p.do_not_show_again_today) ?? 0
820
+ ((_m = (_l = (_k = bookingState == null ? void 0 : bookingState.bookingConfig) == null ? void 0 : _k.config) == null ? void 0 : _l.stock_setting) == null ? void 0 : _m.do_not_show_again_today) ?? 0
821
821
  ) === 1 && /* @__PURE__ */ import_react.default.createElement("div", { style: { marginTop: 16 } }, /* @__PURE__ */ import_react.default.createElement(
822
822
  import_materials.Checkbox,
823
823
  {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pisell/private-materials",
3
- "version": "6.11.62",
3
+ "version": "6.11.63",
4
4
  "main": "./lib/index.js",
5
5
  "module": "./es/index.js",
6
6
  "types": "./lib/index.d.ts",