@salesgenterp/ui-components 0.4.365 → 0.4.366
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 +26 -7
- package/dist/index.js.map +1 -1
- package/dist/index.modern.js +27 -8
- package/dist/index.modern.js.map +1 -1
- package/package.json +1 -1
package/dist/index.modern.js
CHANGED
|
@@ -3,7 +3,7 @@ import React__default, { useState, useEffect, forwardRef, createElement, memo, u
|
|
|
3
3
|
import { AiOutlineHome, AiOutlineRight, AiOutlinePlus, AiOutlineRise, AiOutlineShoppingCart, AiOutlineLeft, AiOutlineMinus, AiOutlineDelete, AiOutlineShop, AiOutlineCheckCircle, AiOutlineCheck } from 'react-icons/ai';
|
|
4
4
|
import styled, { ThemeProvider } from 'styled-components';
|
|
5
5
|
import axios from 'axios';
|
|
6
|
-
import { isEmpty, get, isString, template, isPlainObject, includes, values, cloneDeep, omit, sortBy, uniqBy, filter, isObject, isNumber, remove, sumBy } from 'lodash';
|
|
6
|
+
import { isEmpty, get, isString, isArray, some, toLower, template, isPlainObject, includes, values, cloneDeep, omit, sortBy, uniqBy, filter, isObject, isNumber, remove, sumBy } from 'lodash';
|
|
7
7
|
import ReCAPTCHA from 'react-google-recaptcha';
|
|
8
8
|
import { Controller, useForm } from 'react-hook-form';
|
|
9
9
|
import moment from 'moment';
|
|
@@ -823,6 +823,19 @@ var isVideo = function isVideo(filename) {
|
|
|
823
823
|
var extension = filename === null || filename === void 0 ? void 0 : filename.slice(((filename === null || filename === void 0 ? void 0 : filename.lastIndexOf('.')) - 1 >>> 0) + 2);
|
|
824
824
|
return videoExtensions === null || videoExtensions === void 0 ? void 0 : videoExtensions.includes('.' + (extension === null || extension === void 0 ? void 0 : extension.toLowerCase()));
|
|
825
825
|
};
|
|
826
|
+
function includesCaseInsensitive(source, target) {
|
|
827
|
+
if (isArray(source)) {
|
|
828
|
+
return some(source, function (element) {
|
|
829
|
+
var _toLower, _toLower2, _toLower3, _toLower3$replace, _toLower4, _toLower4$replace;
|
|
830
|
+
return ((_toLower = toLower(element)) === null || _toLower === void 0 ? void 0 : _toLower.trim()) === ((_toLower2 = toLower(target)) === null || _toLower2 === void 0 ? void 0 : _toLower2.trim()) || ((_toLower3 = toLower(element)) === null || _toLower3 === void 0 ? void 0 : (_toLower3$replace = _toLower3.replace(/ /g, '')) === null || _toLower3$replace === void 0 ? void 0 : _toLower3$replace.trim()) === ((_toLower4 = toLower(target)) === null || _toLower4 === void 0 ? void 0 : (_toLower4$replace = _toLower4.replace(/ /g, '')) === null || _toLower4$replace === void 0 ? void 0 : _toLower4$replace.trim());
|
|
831
|
+
});
|
|
832
|
+
} else if (isString(source)) {
|
|
833
|
+
var _toLower5, _toLower6, _toLower7, _toLower7$replace, _toLower8, _toLower8$replace;
|
|
834
|
+
return ((_toLower5 = toLower(source)) === null || _toLower5 === void 0 ? void 0 : _toLower5.trim()) === ((_toLower6 = toLower(target)) === null || _toLower6 === void 0 ? void 0 : _toLower6.trim()) || ((_toLower7 = toLower(source)) === null || _toLower7 === void 0 ? void 0 : (_toLower7$replace = _toLower7.replace(/ /g, '')) === null || _toLower7$replace === void 0 ? void 0 : _toLower7$replace.trim()) === ((_toLower8 = toLower(target)) === null || _toLower8 === void 0 ? void 0 : (_toLower8$replace = _toLower8.replace(/ /g, '')) === null || _toLower8$replace === void 0 ? void 0 : _toLower8$replace.trim());
|
|
835
|
+
} else {
|
|
836
|
+
return false;
|
|
837
|
+
}
|
|
838
|
+
}
|
|
826
839
|
|
|
827
840
|
var _templateObject$2;
|
|
828
841
|
var FormTextField = function FormTextField(props) {
|
|
@@ -10778,7 +10791,8 @@ var Step3 = function Step3(_ref) {
|
|
|
10778
10791
|
states = _ref.states,
|
|
10779
10792
|
countries = _ref.countries,
|
|
10780
10793
|
setSelectedCountry = _ref.setSelectedCountry,
|
|
10781
|
-
customer = _ref.customer
|
|
10794
|
+
customer = _ref.customer,
|
|
10795
|
+
disabledPaymentOnMoreThanAmount = _ref.disabledPaymentOnMoreThanAmount;
|
|
10782
10796
|
var _useState = useState(),
|
|
10783
10797
|
selectedMethod = _useState[0],
|
|
10784
10798
|
setSelectedMethod = _useState[1];
|
|
@@ -10800,6 +10814,9 @@ var Step3 = function Step3(_ref) {
|
|
|
10800
10814
|
setAddNewCard = _useState6[1];
|
|
10801
10815
|
var isCard = selectedMethod === null || selectedMethod === void 0 ? void 0 : (_selectedMethod$name = selectedMethod.name) === null || _selectedMethod$name === void 0 ? void 0 : _selectedMethod$name.toLowerCase().includes('card');
|
|
10802
10816
|
var storeCr = storeCredits > ((orderTotal === null || orderTotal === void 0 ? void 0 : orderTotal.totalAmount) || 0) ? (orderTotal === null || orderTotal === void 0 ? void 0 : orderTotal.totalAmount) || 0 : storeCredits;
|
|
10817
|
+
var paymentMethods = filter(payments, function (item) {
|
|
10818
|
+
return disabledPaymentOnMoreThanAmount && (orderTotal === null || orderTotal === void 0 ? void 0 : orderTotal.totalAmount) > disabledPaymentOnMoreThanAmount ? includesCaseInsensitive(item === null || item === void 0 ? void 0 : item.name, 'pay in person') : true;
|
|
10819
|
+
});
|
|
10803
10820
|
useEffect(function () {
|
|
10804
10821
|
(function () {
|
|
10805
10822
|
try {
|
|
@@ -10869,17 +10886,17 @@ var Step3 = function Step3(_ref) {
|
|
|
10869
10886
|
className: "medium"
|
|
10870
10887
|
}, "Use Store Credits:", ' ', /*#__PURE__*/React__default.createElement("span", {
|
|
10871
10888
|
className: "bold "
|
|
10872
|
-
}, renderMoney(storeCr)), "(", renderMoney(storeCredits), ")")) : /*#__PURE__*/React__default.createElement(React__default.Fragment, null), /*#__PURE__*/React__default.createElement(StepsContent, null, (_filter = filter(
|
|
10889
|
+
}, renderMoney(storeCr)), "(", renderMoney(storeCredits), ")")) : /*#__PURE__*/React__default.createElement(React__default.Fragment, null), /*#__PURE__*/React__default.createElement(StepsContent, null, (_filter = filter(paymentMethods, {
|
|
10873
10890
|
ecommerce: true
|
|
10874
10891
|
})) === null || _filter === void 0 ? void 0 : _filter.map(function (payment, i) {
|
|
10875
|
-
var
|
|
10876
|
-
if (payment
|
|
10892
|
+
var _toLower;
|
|
10893
|
+
if ((_toLower = toLower(payment === null || payment === void 0 ? void 0 : payment.name)) !== null && _toLower !== void 0 && _toLower.includes('card')) {
|
|
10877
10894
|
var _styles$input, _styles$button, _creditCardListData$p, _creditCardListData$p2;
|
|
10878
10895
|
return /*#__PURE__*/React__default.createElement(React__default.Fragment, {
|
|
10879
10896
|
key: i
|
|
10880
10897
|
}, /*#__PURE__*/React__default.createElement(PaymentLi, {
|
|
10881
10898
|
style: storeCredits >= (orderTotal === null || orderTotal === void 0 ? void 0 : orderTotal.totalAmount) && useStoreCr ? {
|
|
10882
|
-
opacity: '.5'
|
|
10899
|
+
opacity: '0.5'
|
|
10883
10900
|
} : {},
|
|
10884
10901
|
onClick: function onClick() {
|
|
10885
10902
|
if (storeCredits >= (orderTotal === null || orderTotal === void 0 ? void 0 : orderTotal.totalAmount) && useStoreCr) return;
|
|
@@ -11658,7 +11675,8 @@ var CheckoutPageComponent = function CheckoutPageComponent(_ref) {
|
|
|
11658
11675
|
shippingText = _ref.shippingText,
|
|
11659
11676
|
showShippingPriceRangeLimit = _ref.showShippingPriceRangeLimit,
|
|
11660
11677
|
_ref$taxExempt = _ref.taxExempt,
|
|
11661
|
-
taxExempt = _ref$taxExempt === void 0 ? false : _ref$taxExempt
|
|
11678
|
+
taxExempt = _ref$taxExempt === void 0 ? false : _ref$taxExempt,
|
|
11679
|
+
disabledPaymentOnMoreThanAmount = _ref.disabledPaymentOnMoreThanAmount;
|
|
11662
11680
|
var _useState = useState(false),
|
|
11663
11681
|
loginLoading = _useState[0],
|
|
11664
11682
|
setLoginLoading = _useState[1];
|
|
@@ -12178,7 +12196,8 @@ var CheckoutPageComponent = function CheckoutPageComponent(_ref) {
|
|
|
12178
12196
|
storeCredits: customer === null || customer === void 0 ? void 0 : (_customer$customerDto9 = customer.customerDto) === null || _customer$customerDto9 === void 0 ? void 0 : _customer$customerDto9.storeCredit,
|
|
12179
12197
|
orderTotal: orderTotal,
|
|
12180
12198
|
styles: styles,
|
|
12181
|
-
setSelectedCountry: setSelectedCountry
|
|
12199
|
+
setSelectedCountry: setSelectedCountry,
|
|
12200
|
+
disabledPaymentOnMoreThanAmount: disabledPaymentOnMoreThanAmount
|
|
12182
12201
|
})), index === 4 && /*#__PURE__*/React__default.createElement(StepContent, {
|
|
12183
12202
|
sx: {
|
|
12184
12203
|
padding: 0
|