@salesgenterp/ui-components 0.4.463 → 0.4.464

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.js CHANGED
@@ -59,56 +59,39 @@ var ReCAPTCHA = _interopDefault(require('react-google-recaptcha'));
59
59
  var paramCase = require('param-case');
60
60
  var cg = require('react-icons/cg');
61
61
  var fi = require('react-icons/fi');
62
- var Confetti = _interopDefault(require('react-confetti'));
63
62
  var fa6 = require('react-icons/fa6');
64
63
 
65
64
  function _extends() {
66
- _extends = Object.assign ? Object.assign.bind() : function (target) {
67
- for (var i = 1; i < arguments.length; i++) {
68
- var source = arguments[i];
69
- for (var key in source) {
70
- if (Object.prototype.hasOwnProperty.call(source, key)) {
71
- target[key] = source[key];
72
- }
73
- }
65
+ return _extends = Object.assign ? Object.assign.bind() : function (n) {
66
+ for (var e = 1; e < arguments.length; e++) {
67
+ var t = arguments[e];
68
+ for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]);
74
69
  }
75
- return target;
76
- };
77
- return _extends.apply(this, arguments);
70
+ return n;
71
+ }, _extends.apply(null, arguments);
78
72
  }
79
- function _inheritsLoose(subClass, superClass) {
80
- subClass.prototype = Object.create(superClass.prototype);
81
- subClass.prototype.constructor = subClass;
82
- _setPrototypeOf(subClass, superClass);
83
- }
84
- function _setPrototypeOf(o, p) {
85
- _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) {
86
- o.__proto__ = p;
87
- return o;
88
- };
89
- return _setPrototypeOf(o, p);
73
+ function _inheritsLoose(t, o) {
74
+ t.prototype = Object.create(o.prototype), t.prototype.constructor = t, _setPrototypeOf(t, o);
90
75
  }
91
- function _objectDestructuringEmpty(obj) {
92
- if (obj == null) throw new TypeError("Cannot destructure " + obj);
76
+ function _objectDestructuringEmpty(t) {
77
+ if (null == t) throw new TypeError("Cannot destructure " + t);
93
78
  }
94
- function _objectWithoutPropertiesLoose(source, excluded) {
95
- if (source == null) return {};
96
- var target = {};
97
- var sourceKeys = Object.keys(source);
98
- var key, i;
99
- for (i = 0; i < sourceKeys.length; i++) {
100
- key = sourceKeys[i];
101
- if (excluded.indexOf(key) >= 0) continue;
102
- target[key] = source[key];
79
+ function _objectWithoutPropertiesLoose(r, e) {
80
+ if (null == r) return {};
81
+ var t = {};
82
+ for (var n in r) if ({}.hasOwnProperty.call(r, n)) {
83
+ if (e.includes(n)) continue;
84
+ t[n] = r[n];
103
85
  }
104
- return target;
86
+ return t;
105
87
  }
106
- function _taggedTemplateLiteralLoose(strings, raw) {
107
- if (!raw) {
108
- raw = strings.slice(0);
109
- }
110
- strings.raw = raw;
111
- return strings;
88
+ function _setPrototypeOf(t, e) {
89
+ return _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function (t, e) {
90
+ return t.__proto__ = e, t;
91
+ }, _setPrototypeOf(t, e);
92
+ }
93
+ function _taggedTemplateLiteralLoose(e, t) {
94
+ return t || (t = e.slice(0)), e.raw = t, e;
112
95
  }
113
96
 
114
97
  // A type of promise-like that resolves synchronously and supports only one observer
@@ -719,16 +702,16 @@ function useAllSystemFeatureValues(_ref4) {
719
702
  setStatus(null);
720
703
  setLoading(true);
721
704
  try {
722
- var flattenData = function flattenData(data) {
705
+ var _flattenData = function flattenData(data) {
723
706
  return lodash.reduce(data, function (acc, item) {
724
707
  acc = lodash.concat(acc, lodash.omit(item, 'systemFeatureList'));
725
708
  if (item !== null && item !== void 0 && item.systemFeatureList) {
726
- acc = lodash.concat(acc, flattenData(item === null || item === void 0 ? void 0 : item.systemFeatureList));
709
+ acc = lodash.concat(acc, _flattenData(item === null || item === void 0 ? void 0 : item.systemFeatureList));
727
710
  }
728
711
  return acc;
729
712
  }, []);
730
713
  };
731
- var flatArray = flattenData(systemFeatureListData);
714
+ var flatArray = _flattenData(systemFeatureListData);
732
715
  var result = lodash.reduce(flatArray, function (acc, item) {
733
716
  if (item !== null && item !== void 0 && item.featureName) {
734
717
  acc[item === null || item === void 0 ? void 0 : item.featureName] = isNaN(item === null || item === void 0 ? void 0 : item.featureValue) ? item === null || item === void 0 ? void 0 : item.featureValue : Number(item === null || item === void 0 ? void 0 : item.featureValue) === 0 || Number(item === null || item === void 0 ? void 0 : item.featureValue) === 1 ? convertToBoolean(Number(item === null || item === void 0 ? void 0 : item.featureValue)) : Number(item === null || item === void 0 ? void 0 : item.featureValue);
@@ -3722,7 +3705,7 @@ var SideMenuItemComponent = function SideMenuItemComponent(props) {
3722
3705
  to: link
3723
3706
  });
3724
3707
  };
3725
- var SideMenuItem = function SideMenuItem(props) {
3708
+ var _SideMenuItem = function SideMenuItem(props) {
3726
3709
  var name = props.name,
3727
3710
  path = props.path,
3728
3711
  link = props.link,
@@ -3767,7 +3750,7 @@ var SideMenuItem = function SideMenuItem(props) {
3767
3750
  component: "div",
3768
3751
  disablePadding: true
3769
3752
  }, items === null || items === void 0 ? void 0 : items.map(function (item, index) {
3770
- return /*#__PURE__*/React__default.createElement(SideMenuItem, _extends({}, item, {
3753
+ return /*#__PURE__*/React__default.createElement(_SideMenuItem, _extends({}, item, {
3771
3754
  key: index,
3772
3755
  primaryColor: primaryColor,
3773
3756
  fontColor: fontColor,
@@ -3841,7 +3824,7 @@ var SideMenu = function SideMenu(props) {
3841
3824
  component: "nav",
3842
3825
  disablePadding: true
3843
3826
  }, ((props === null || props === void 0 ? void 0 : (_props$menuItems = props.menuItems) === null || _props$menuItems === void 0 ? void 0 : _props$menuItems.length) > 0 ? props === null || props === void 0 ? void 0 : props.menuItems : sideMenuItems).map(function (item, index) {
3844
- return /*#__PURE__*/React__default.createElement(SideMenuItem, _extends({}, item, {
3827
+ return /*#__PURE__*/React__default.createElement(_SideMenuItem, _extends({}, item, {
3845
3828
  key: index,
3846
3829
  primaryColor: props.primaryColor,
3847
3830
  fontColor: props.fontColor,
@@ -9009,9 +8992,9 @@ var AsyncSelectField = function AsyncSelectField(_ref) {
9009
8992
  var _temp11 = function _temp11() {
9010
8993
  setSearchText(searchValue || '');
9011
8994
  setOptions(options);
9012
- return _optionsFromAPI;
8995
+ return optionsFromAPI;
9013
8996
  };
9014
- var _optionsFromAPI = [];
8997
+ var optionsFromAPI = [];
9015
8998
  var _temp10 = _catch(function () {
9016
8999
  var _temp9 = function () {
9017
9000
  if (isSearchProduct && apiData && apiData.url && searchValue.length >= minSearchChar) {
@@ -9022,9 +9005,9 @@ var AsyncSelectField = function AsyncSelectField(_ref) {
9022
9005
  size: DEFAULT_SEARCH_RESULT_SIZE
9023
9006
  })
9024
9007
  }))).then(function (_API3) {
9025
- _optionsFromAPI = _API3 || [];
9026
- _optionsFromAPI = _optionsFromAPI.productCoreDtoList || _optionsFromAPI.content || _optionsFromAPI;
9027
- _optionsFromAPI = _optionsFromAPI.map(function (option) {
9008
+ optionsFromAPI = _API3 || [];
9009
+ optionsFromAPI = optionsFromAPI.productCoreDtoList || optionsFromAPI.content || optionsFromAPI;
9010
+ optionsFromAPI = optionsFromAPI.map(function (option) {
9028
9011
  return _extends({}, option, {
9029
9012
  label: getLabelValue({
9030
9013
  labelKey: labelKey,
@@ -9032,26 +9015,26 @@ var AsyncSelectField = function AsyncSelectField(_ref) {
9032
9015
  })
9033
9016
  });
9034
9017
  });
9035
- if (_optionsFromAPI.length === 1 && isSearchProduct) {
9018
+ if (optionsFromAPI.length === 1 && isSearchProduct) {
9036
9019
  var quantity = function quantity() {
9037
9020
  var _optionsFromAPI$, _optionsFromAPI$2, _optionsFromAPI$3, _optionsFromAPI$4;
9038
9021
  switch (searchValue) {
9039
- case (_optionsFromAPI$ = _optionsFromAPI[0]) === null || _optionsFromAPI$ === void 0 ? void 0 : _optionsFromAPI$.boxUpc:
9040
- return (_optionsFromAPI$2 = _optionsFromAPI[0]) === null || _optionsFromAPI$2 === void 0 ? void 0 : _optionsFromAPI$2.boxQuantity;
9041
- case (_optionsFromAPI$3 = _optionsFromAPI[0]) === null || _optionsFromAPI$3 === void 0 ? void 0 : _optionsFromAPI$3.caseUpc:
9042
- return (_optionsFromAPI$4 = _optionsFromAPI[0]) === null || _optionsFromAPI$4 === void 0 ? void 0 : _optionsFromAPI$4.caseQuantity;
9022
+ case (_optionsFromAPI$ = optionsFromAPI[0]) === null || _optionsFromAPI$ === void 0 ? void 0 : _optionsFromAPI$.boxUpc:
9023
+ return (_optionsFromAPI$2 = optionsFromAPI[0]) === null || _optionsFromAPI$2 === void 0 ? void 0 : _optionsFromAPI$2.boxQuantity;
9024
+ case (_optionsFromAPI$3 = optionsFromAPI[0]) === null || _optionsFromAPI$3 === void 0 ? void 0 : _optionsFromAPI$3.caseUpc:
9025
+ return (_optionsFromAPI$4 = optionsFromAPI[0]) === null || _optionsFromAPI$4 === void 0 ? void 0 : _optionsFromAPI$4.caseQuantity;
9043
9026
  default:
9044
9027
  return null;
9045
9028
  }
9046
9029
  };
9047
9030
  var sound = new Audio(beepSound);
9048
9031
  sound.play();
9049
- onSelectValueChange(_extends({}, _optionsFromAPI[0], {
9032
+ onSelectValueChange(_extends({}, optionsFromAPI[0], {
9050
9033
  quantity: quantity()
9051
9034
  }));
9052
9035
  setSelectedValue(null);
9053
9036
  onClickChange();
9054
- } else if (_optionsFromAPI.length === 0 && isSearchProduct) {
9037
+ } else if (optionsFromAPI.length === 0 && isSearchProduct) {
9055
9038
  var _sound = new Audio(notFoundSound);
9056
9039
  _sound.play();
9057
9040
  onScanProductChange('no_option');
@@ -9063,7 +9046,7 @@ var AsyncSelectField = function AsyncSelectField(_ref) {
9063
9046
  }();
9064
9047
  if (_temp9 && _temp9.then) return _temp9.then(function () {});
9065
9048
  }, function () {
9066
- _optionsFromAPI = [];
9049
+ optionsFromAPI = [];
9067
9050
  });
9068
9051
  return Promise.resolve(_temp10 && _temp10.then ? _temp10.then(_temp11) : _temp11(_temp10));
9069
9052
  } catch (e) {
@@ -9071,9 +9054,9 @@ var AsyncSelectField = function AsyncSelectField(_ref) {
9071
9054
  }
9072
9055
  };
9073
9056
  var defaultOptionsData = function defaultOptionsData() {
9074
- var _optionsFromAPI2;
9057
+ var _optionsFromAPI;
9075
9058
  var optionsFromAPI = defaultOptions || [];
9076
- optionsFromAPI = (_optionsFromAPI2 = optionsFromAPI) === null || _optionsFromAPI2 === void 0 ? void 0 : _optionsFromAPI2.map(function (option) {
9059
+ optionsFromAPI = (_optionsFromAPI = optionsFromAPI) === null || _optionsFromAPI === void 0 ? void 0 : _optionsFromAPI.map(function (option) {
9077
9060
  return _extends({}, option, {
9078
9061
  label: getLabelValue({
9079
9062
  labelKey: labelKey,
@@ -9964,12 +9947,12 @@ var APIStaticPage = function APIStaticPage(_ref) {
9964
9947
  if (id || pageData || alias) {
9965
9948
  var _temp3 = function _temp3() {
9966
9949
  if (pageData) {
9967
- _response3 = pageData;
9950
+ response = pageData;
9968
9951
  }
9969
- setStaticPage(_response3);
9952
+ setStaticPage(response);
9970
9953
  setContactUsForm(false);
9971
9954
  var _temp = function (_response, _response$title, _response2, _response2$urlAlias) {
9972
- if (((_response = _response3) === null || _response === void 0 ? void 0 : (_response$title = _response.title) === null || _response$title === void 0 ? void 0 : _response$title.toLowerCase()) === 'contact us' || ((_response2 = _response3) === null || _response2 === void 0 ? void 0 : (_response2$urlAlias = _response2.urlAlias) === null || _response2$urlAlias === void 0 ? void 0 : _response2$urlAlias.toLowerCase()) === 'contact-us') {
9955
+ if (((_response = response) === null || _response === void 0 ? void 0 : (_response$title = _response.title) === null || _response$title === void 0 ? void 0 : _response$title.toLowerCase()) === 'contact us' || ((_response2 = response) === null || _response2 === void 0 ? void 0 : (_response2$urlAlias = _response2.urlAlias) === null || _response2$urlAlias === void 0 ? void 0 : _response2$urlAlias.toLowerCase()) === 'contact-us') {
9973
9956
  return Promise.resolve(API({
9974
9957
  apiEndPoint: apiEndPoint,
9975
9958
  url: "/store"
@@ -9982,7 +9965,7 @@ var APIStaticPage = function APIStaticPage(_ref) {
9982
9965
  }();
9983
9966
  if (_temp && _temp.then) return _temp.then(function () {});
9984
9967
  };
9985
- var _response3;
9968
+ var response;
9986
9969
  var _temp2 = function () {
9987
9970
  if (id || alias) {
9988
9971
  return Promise.resolve(API({
@@ -9993,7 +9976,7 @@ var APIStaticPage = function APIStaticPage(_ref) {
9993
9976
  alias: alias
9994
9977
  }
9995
9978
  })).then(function (_API) {
9996
- _response3 = _API;
9979
+ response = _API;
9997
9980
  });
9998
9981
  }
9999
9982
  }();
@@ -10508,21 +10491,7 @@ var DiscountSummaryModal = function DiscountSummaryModal(_ref) {
10508
10491
  primaryColor = _ref.primaryColor,
10509
10492
  open = _ref.open,
10510
10493
  onCancel = _ref.onCancel;
10511
- var _useState = React.useState(false),
10512
- showConfetti = _useState[0],
10513
- setShowConfetti = _useState[1];
10514
- React.useEffect(function () {
10515
- if (open) {
10516
- setShowConfetti(true);
10517
- setTimeout(function () {
10518
- return setShowConfetti(false);
10519
- }, 5000);
10520
- }
10521
- }, [open]);
10522
- return /*#__PURE__*/React__default.createElement("div", null, showConfetti && /*#__PURE__*/React__default.createElement(Confetti, {
10523
- width: window.innerWidth,
10524
- height: window.innerHeight
10525
- }), /*#__PURE__*/React__default.createElement(material.Dialog, {
10494
+ return /*#__PURE__*/React__default.createElement("div", null, /*#__PURE__*/React__default.createElement(material.Dialog, {
10526
10495
  open: open,
10527
10496
  onClose: onCancel,
10528
10497
  fullWidth: true,
@@ -11929,7 +11898,6 @@ var CreditCardForm = function CreditCardForm(_ref) {
11929
11898
  };
11930
11899
 
11931
11900
  var PaymentForm = /*#__PURE__*/function (_React$Component) {
11932
- _inheritsLoose(PaymentForm, _React$Component);
11933
11901
  function PaymentForm() {
11934
11902
  var _this;
11935
11903
  for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
@@ -11967,6 +11935,7 @@ var PaymentForm = /*#__PURE__*/function (_React$Component) {
11967
11935
  };
11968
11936
  return _this;
11969
11937
  }
11938
+ _inheritsLoose(PaymentForm, _React$Component);
11970
11939
  var _proto = PaymentForm.prototype;
11971
11940
  _proto.render = function render() {
11972
11941
  var _this2 = this;