ordering-ui-external 2.6.7 → 2.7.0
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/_bundles/0.ordering-ui.0a58ae9fc1a4bce64c6e.js +1 -0
- package/_bundles/{1.ordering-ui.fd1dc326de89a8eb39f9.js → 1.ordering-ui.0a58ae9fc1a4bce64c6e.js} +1 -1
- package/_bundles/4.ordering-ui.0a58ae9fc1a4bce64c6e.js +1 -0
- package/_bundles/{5.ordering-ui.fd1dc326de89a8eb39f9.js → 5.ordering-ui.0a58ae9fc1a4bce64c6e.js} +1 -1
- package/_bundles/{6.ordering-ui.fd1dc326de89a8eb39f9.js → 6.ordering-ui.0a58ae9fc1a4bce64c6e.js} +1 -1
- package/_bundles/{7.ordering-ui.fd1dc326de89a8eb39f9.js → 7.ordering-ui.0a58ae9fc1a4bce64c6e.js} +2 -2
- package/_bundles/ordering-ui.0a58ae9fc1a4bce64c6e.js +2 -0
- package/_modules/components/LanguageSelector/index.js +1 -0
- package/_modules/components/OrderTypeSelectorHeader/index.js +3 -1
- package/_modules/components/SmartAppBanner/index.js +5 -2
- package/_modules/contexts/ThemeContext/index.js +1 -1
- package/_modules/styles/Select/index.js +14 -2
- package/_modules/styles/Selects/index.js +11 -8
- package/_modules/themes/five/index.js +21 -0
- package/_modules/themes/five/src/components/BusinessBasicInformation/BusinessInfoComponent.js +168 -0
- package/_modules/themes/five/src/components/BusinessBasicInformation/SearchComponent.js +39 -0
- package/_modules/themes/five/src/components/BusinessBasicInformation/SocialNetWork.js +19 -0
- package/_modules/themes/five/src/components/BusinessBasicInformation/index.js +35 -156
- package/_modules/themes/five/src/components/BusinessBasicInformation/styles.js +45 -35
- package/_modules/themes/five/src/components/BusinessController/index.js +6 -2
- package/_modules/themes/five/src/components/BusinessProductsCategories/index.js +1 -1
- package/_modules/themes/five/src/components/BusinessProductsListing/index.js +5 -4
- package/_modules/themes/five/src/components/CardForm/index.js +16 -3
- package/_modules/themes/five/src/components/CardForm/styles.js +13 -9
- package/_modules/themes/five/src/components/CardFormCustom/cardUtils.js +102 -0
- package/_modules/themes/five/src/components/CardFormCustom/index.js +148 -0
- package/_modules/themes/five/src/components/CardFormCustom/styles.js +16 -0
- package/_modules/themes/five/src/components/Cart/index.js +1 -1
- package/_modules/themes/five/src/components/CartPopover/styles.js +1 -1
- package/_modules/themes/five/src/components/Checkout/index.js +41 -27
- package/_modules/themes/five/src/components/Header/index.js +10 -4
- package/_modules/themes/five/src/components/LanguageSelector/index.js +4 -1
- package/_modules/themes/five/src/components/LoginForm/index.js +11 -8
- package/_modules/themes/five/src/components/Modal/styles.js +1 -1
- package/_modules/themes/five/src/components/OrderContextUI/index.js +13 -1
- package/_modules/themes/five/src/components/OrderDetails/OrderBillSection.js +1 -1
- package/_modules/themes/five/src/components/OrderDetails/OrderEta.js +18 -8
- package/_modules/themes/five/src/components/OrderDetails/OrderHistory.js +7 -3
- package/_modules/themes/five/src/components/OrderDetails/index.js +4 -2
- package/_modules/themes/five/src/components/PaymentOptionCard/index.js +84 -0
- package/_modules/themes/five/src/components/PaymentOptionStripe/index.js +48 -22
- package/_modules/themes/five/src/components/PaymentOptionStripe/styles.js +3 -1
- package/_modules/themes/five/src/components/PaymentOptions/index.js +46 -24
- package/_modules/themes/five/src/components/ProductForm/styles.js +1 -1
- package/_modules/themes/five/src/components/RenderProductsLayout/index.js +2 -2
- package/_modules/themes/five/src/components/SearchProducts/styles.js +1 -1
- package/_modules/themes/five/src/components/UserDetails/index.js +1 -1
- package/_modules/themes/five/src/components/UserPopover/styles.js +1 -1
- package/_modules/themes/five/src/styles/Select/index.js +4 -2
- package/_modules/themes/five/src/styles/Selects/index.js +7 -4
- package/_modules/themes/pwa/src/components/MomentPopover/styles.js +1 -1
- package/index.html +1 -1
- package/package.json +4 -2
- package/src/components/LanguageSelector/index.js +1 -0
- package/src/components/OrderTypeSelectorHeader/index.js +3 -1
- package/src/components/SmartAppBanner/index.js +4 -2
- package/src/contexts/ThemeContext/index.js +1 -1
- package/src/styles/Select/index.js +11 -2
- package/src/styles/Selects/index.js +1 -1
- package/src/themes/five/index.js +6 -0
- package/src/themes/five/src/components/BusinessBasicInformation/BusinessInfoComponent.js +230 -0
- package/src/themes/five/src/components/BusinessBasicInformation/SearchComponent.js +40 -0
- package/src/themes/five/src/components/BusinessBasicInformation/SocialNetWork.js +10 -0
- package/src/themes/five/src/components/BusinessBasicInformation/index.js +39 -247
- package/src/themes/five/src/components/BusinessBasicInformation/styles.js +14 -4
- package/src/themes/five/src/components/BusinessController/index.js +2 -2
- package/src/themes/five/src/components/BusinessProductsCategories/index.js +1 -1
- package/src/themes/five/src/components/BusinessProductsListing/index.js +5 -4
- package/src/themes/five/src/components/CardForm/index.js +25 -4
- package/src/themes/five/src/components/CardForm/styles.js +35 -0
- package/src/themes/five/src/components/CardFormCustom/cardUtils.js +111 -0
- package/src/themes/five/src/components/CardFormCustom/index.js +161 -0
- package/src/themes/five/src/components/CardFormCustom/styles.js +20 -0
- package/src/themes/five/src/components/Cart/index.js +1 -1
- package/src/themes/five/src/components/CartPopover/styles.js +1 -1
- package/src/themes/five/src/components/Checkout/index.js +42 -30
- package/src/themes/five/src/components/Header/index.js +9 -4
- package/src/themes/five/src/components/LanguageSelector/index.js +2 -1
- package/src/themes/five/src/components/LoginForm/index.js +6 -4
- package/src/themes/five/src/components/Modal/styles.js +1 -0
- package/src/themes/five/src/components/OrderContextUI/index.js +10 -3
- package/src/themes/five/src/components/OrderDetails/OrderBillSection.js +1 -1
- package/src/themes/five/src/components/OrderDetails/OrderEta.js +21 -9
- package/src/themes/five/src/components/OrderDetails/OrderHistory.js +4 -3
- package/src/themes/five/src/components/OrderDetails/index.js +1 -1
- package/src/themes/five/src/components/PaymentOptionCard/index.js +70 -0
- package/src/themes/five/src/components/PaymentOptionStripe/index.js +46 -20
- package/src/themes/five/src/components/PaymentOptionStripe/styles.js +6 -1
- package/src/themes/five/src/components/PaymentOptions/index.js +28 -3
- package/src/themes/five/src/components/ProductForm/index.js +0 -1
- package/src/themes/five/src/components/ProductForm/styles.js +1 -1
- package/src/themes/five/src/components/RenderProductsLayout/index.js +2 -2
- package/src/themes/five/src/components/SearchProducts/styles.js +1 -1
- package/src/themes/five/src/components/UserDetails/index.js +1 -1
- package/src/themes/five/src/components/UserPopover/styles.js +1 -1
- package/src/themes/five/src/styles/Select/index.js +3 -2
- package/src/themes/five/src/styles/Selects/index.js +1 -1
- package/src/themes/pwa/src/components/MomentPopover/styles.js +4 -1
- package/template/app.js +13 -7
- package/template/pages/BusinessProductsList/index.js +4 -3
- package/template/pages/BusinessesList/index.js +2 -1
- package/template/pages/Checkout/index.js +1 -0
- package/template/pages/MyOrders/index.js +1 -0
- package/template/theme.json +3 -1
- package/_bundles/0.ordering-ui.fd1dc326de89a8eb39f9.js +0 -1
- package/_bundles/4.ordering-ui.fd1dc326de89a8eb39f9.js +0 -1
- package/_bundles/ordering-ui.fd1dc326de89a8eb39f9.js +0 -2
- /package/_bundles/{2.ordering-ui.fd1dc326de89a8eb39f9.js → 2.ordering-ui.0a58ae9fc1a4bce64c6e.js} +0 -0
- /package/_bundles/{7.ordering-ui.fd1dc326de89a8eb39f9.js.LICENSE.txt → 7.ordering-ui.0a58ae9fc1a4bce64c6e.js.LICENSE.txt} +0 -0
- /package/_bundles/{8.ordering-ui.fd1dc326de89a8eb39f9.js → 8.ordering-ui.0a58ae9fc1a4bce64c6e.js} +0 -0
- /package/_bundles/{9.ordering-ui.fd1dc326de89a8eb39f9.js → 9.ordering-ui.0a58ae9fc1a4bce64c6e.js} +0 -0
- /package/_bundles/{ordering-ui.fd1dc326de89a8eb39f9.js.LICENSE.txt → ordering-ui.0a58ae9fc1a4bce64c6e.js.LICENSE.txt} +0 -0
|
@@ -46,7 +46,7 @@ function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len
|
|
|
46
46
|
function _iterableToArrayLimit(arr, i) { var _i = null == arr ? null : "undefined" != typeof Symbol && arr[Symbol.iterator] || arr["@@iterator"]; if (null != _i) { var _s, _e, _x, _r, _arr = [], _n = !0, _d = !1; try { if (_x = (_i = _i.call(arr)).next, 0 === i) { if (Object(_i) !== _i) return; _n = !1; } else for (; !(_n = (_s = _x.call(_i)).done) && (_arr.push(_s.value), _arr.length !== i); _n = !0); } catch (err) { _d = !0, _e = err; } finally { try { if (!_n && null != _i.return && (_r = _i.return(), Object(_r) !== _r)) return; } finally { if (_d) throw _e; } } return _arr; } }
|
|
47
47
|
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
48
48
|
var LoginFormUI = function LoginFormUI(props) {
|
|
49
|
-
var _configs$google_login,
|
|
49
|
+
var _configs$google_login, _optimizationLoad$res, _optimizationLoad$res2, _optimizationLoad$res3, _optimizationLoad$res4, _optimizationLoad$res5, _optimizationLoad$res6, _optimizationLoad$res7, _optimizationLoad$res8, _optimizationLoad$res9, _configs$spoonity_tit, _configs$facebook_log, _configs$facebook_log2, _configs$facebook_id, _configs$google_login2, _configs$google_login3, _configs$google_login4, _configs$apple_login_, _configs$twilio_servi, _configs$twilio_servi2, _props$beforeElements, _props$beforeComponen, _theme$images, _theme$images$general, _theme$images2, _theme$images2$logos, _props$beforeMidEleme, _props$beforeMidCompo, _formMethods$errors, _formMethods$errors$e, _formMethods$errors2, _formMethods$errors2$, _formMethods$errors3, _formMethods$errors3$, _formMethods$errors4, _formMethods$errors5, _formMethods$errors6, _formMethods$errors6$, _formMethods$errors7, _formMethods$errors7$, _formMethods$errors8, _formMethods$errors9, _formMethods$errors10, _formMethods$errors11, _formMethods$errors12, _formMethods$errors13, _formMethods$errors14, _props$afterMidElemen, _props$afterMidCompon, _theme$defaultLanguag, _configs$facebook_log3, _configs$facebook_log4, _configs$facebook_id2, _configs$facebook_id3, _configs$google_login5, _configs$google_login6, _configs$google_login7, _configs$apple_login_2, _configs$twilio_servi3, _configs$twilio_servi4, _props$afterComponent, _props$afterElements;
|
|
50
50
|
var useLoginByEmail = props.useLoginByEmail,
|
|
51
51
|
useLoginByCellphone = props.useLoginByCellphone,
|
|
52
52
|
handleChangeInput = props.handleChangeInput,
|
|
@@ -90,6 +90,9 @@ var LoginFormUI = function LoginFormUI(props) {
|
|
|
90
90
|
var _useConfig = (0, _orderingComponentsExternal.useConfig)(),
|
|
91
91
|
_useConfig2 = _slicedToArray(_useConfig, 1),
|
|
92
92
|
configs = _useConfig2[0].configs;
|
|
93
|
+
var _useOptimizationLoad = (0, _orderingComponentsExternal.useOptimizationLoad)(),
|
|
94
|
+
_useOptimizationLoad2 = _slicedToArray(_useOptimizationLoad, 1),
|
|
95
|
+
optimizationLoad = _useOptimizationLoad2[0];
|
|
93
96
|
var formMethods = (0, _reactHookForm.useForm)();
|
|
94
97
|
var _useRecaptcha = (0, _useRecaptcha3.useRecaptcha)(enableReCaptcha),
|
|
95
98
|
_useRecaptcha2 = _slicedToArray(_useRecaptcha, 1),
|
|
@@ -146,11 +149,11 @@ var LoginFormUI = function LoginFormUI(props) {
|
|
|
146
149
|
cookiepolicy: 'single_host_origin',
|
|
147
150
|
scope: 'profile'
|
|
148
151
|
};
|
|
149
|
-
var googleLoginEnabled = (
|
|
150
|
-
var facebookLoginEnabled = (
|
|
151
|
-
var appleLoginEnabled = (
|
|
152
|
+
var googleLoginEnabled = (optimizationLoad === null || optimizationLoad === void 0 ? void 0 : (_optimizationLoad$res = optimizationLoad.result) === null || _optimizationLoad$res === void 0 ? void 0 : (_optimizationLoad$res2 = _optimizationLoad$res.configs) === null || _optimizationLoad$res2 === void 0 ? void 0 : (_optimizationLoad$res3 = _optimizationLoad$res2.google_login_enabled) === null || _optimizationLoad$res3 === void 0 ? void 0 : _optimizationLoad$res3.value) === '1';
|
|
153
|
+
var facebookLoginEnabled = (optimizationLoad === null || optimizationLoad === void 0 ? void 0 : (_optimizationLoad$res4 = optimizationLoad.result) === null || _optimizationLoad$res4 === void 0 ? void 0 : (_optimizationLoad$res5 = _optimizationLoad$res4.configs) === null || _optimizationLoad$res5 === void 0 ? void 0 : (_optimizationLoad$res6 = _optimizationLoad$res5.facebook_login_enabled) === null || _optimizationLoad$res6 === void 0 ? void 0 : _optimizationLoad$res6.value) === '1';
|
|
154
|
+
var appleLoginEnabled = (optimizationLoad === null || optimizationLoad === void 0 ? void 0 : (_optimizationLoad$res7 = optimizationLoad.result) === null || _optimizationLoad$res7 === void 0 ? void 0 : (_optimizationLoad$res8 = _optimizationLoad$res7.configs) === null || _optimizationLoad$res8 === void 0 ? void 0 : (_optimizationLoad$res9 = _optimizationLoad$res8.apple_login_enabled) === null || _optimizationLoad$res9 === void 0 ? void 0 : _optimizationLoad$res9.value) === '1';
|
|
152
155
|
var spoonityTitle = configs === null || configs === void 0 ? void 0 : (_configs$spoonity_tit = configs.spoonity_title) === null || _configs$spoonity_tit === void 0 ? void 0 : _configs$spoonity_tit.value;
|
|
153
|
-
var hasSocialLogin = ((configs === null || configs === void 0 ? void 0 : (_configs$
|
|
156
|
+
var hasSocialLogin = ((configs === null || configs === void 0 ? void 0 : (_configs$facebook_log = configs.facebook_login) === null || _configs$facebook_log === void 0 ? void 0 : _configs$facebook_log.value) === 'true' || (configs === null || configs === void 0 ? void 0 : (_configs$facebook_log2 = configs.facebook_login) === null || _configs$facebook_log2 === void 0 ? void 0 : _configs$facebook_log2.value) === '1') && (configs === null || configs === void 0 ? void 0 : (_configs$facebook_id = configs.facebook_id) === null || _configs$facebook_id === void 0 ? void 0 : _configs$facebook_id.value) || (configs === null || configs === void 0 ? void 0 : (_configs$google_login2 = configs.google_login_client_id) === null || _configs$google_login2 === void 0 ? void 0 : _configs$google_login2.value) && (configs === null || configs === void 0 ? void 0 : (_configs$google_login3 = configs.google_login_auth_domain) === null || _configs$google_login3 === void 0 ? void 0 : _configs$google_login3.value) && (configs === null || configs === void 0 ? void 0 : (_configs$google_login4 = configs.google_login_api_key) === null || _configs$google_login4 === void 0 ? void 0 : _configs$google_login4.value) && googleLoginEnabled || (configs === null || configs === void 0 ? void 0 : (_configs$apple_login_ = configs.apple_login_client_id) === null || _configs$apple_login_ === void 0 ? void 0 : _configs$apple_login_.value) && appleLoginEnabled || loginTab === 'cellphone' && ((configs === null || configs === void 0 ? void 0 : (_configs$twilio_servi = configs.twilio_service_enabled) === null || _configs$twilio_servi === void 0 ? void 0 : _configs$twilio_servi.value) === 'true' || (configs === null || configs === void 0 ? void 0 : (_configs$twilio_servi2 = configs.twilio_service_enabled) === null || _configs$twilio_servi2 === void 0 ? void 0 : _configs$twilio_servi2.value) === '1');
|
|
154
157
|
var hasSocialEnabled = googleLoginEnabled || facebookLoginEnabled || appleLoginEnabled;
|
|
155
158
|
var onSubmit = /*#__PURE__*/function () {
|
|
156
159
|
var _ref = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee() {
|
|
@@ -588,13 +591,13 @@ var LoginFormUI = function LoginFormUI(props) {
|
|
|
588
591
|
isPopup: isPopup
|
|
589
592
|
}, /*#__PURE__*/_react.default.createElement(_styles.DividerLine, null), /*#__PURE__*/_react.default.createElement("p", null, t('OR', 'or')), /*#__PURE__*/_react.default.createElement(_styles.DividerLine, null)), !props.isDisableButtons && !loginWithOtpState && (Object.keys(configs).length > 0 ? /*#__PURE__*/_react.default.createElement(_styles.SocialButtons, {
|
|
590
593
|
isPopup: isPopup
|
|
591
|
-
}, ((configs === null || configs === void 0 ? void 0 : (_configs$
|
|
594
|
+
}, ((configs === null || configs === void 0 ? void 0 : (_configs$facebook_log3 = configs.facebook_login) === null || _configs$facebook_log3 === void 0 ? void 0 : _configs$facebook_log3.value) === 'true' || (configs === null || configs === void 0 ? void 0 : (_configs$facebook_log4 = configs.facebook_login) === null || _configs$facebook_log4 === void 0 ? void 0 : _configs$facebook_log4.value) === '1') && (configs === null || configs === void 0 ? void 0 : (_configs$facebook_id2 = configs.facebook_id) === null || _configs$facebook_id2 === void 0 ? void 0 : _configs$facebook_id2.value) && facebookLoginEnabled && /*#__PURE__*/_react.default.createElement(_FacebookLogin.FacebookLoginButton, {
|
|
592
595
|
appId: configs === null || configs === void 0 ? void 0 : (_configs$facebook_id3 = configs.facebook_id) === null || _configs$facebook_id3 === void 0 ? void 0 : _configs$facebook_id3.value,
|
|
593
596
|
handleSuccessFacebookLogin: handleSuccessFacebook
|
|
594
|
-
}), (configs === null || configs === void 0 ? void 0 : (_configs$
|
|
597
|
+
}), (configs === null || configs === void 0 ? void 0 : (_configs$google_login5 = configs.google_login_client_id) === null || _configs$google_login5 === void 0 ? void 0 : _configs$google_login5.value) && (configs === null || configs === void 0 ? void 0 : (_configs$google_login6 = configs.google_login_auth_domain) === null || _configs$google_login6 === void 0 ? void 0 : _configs$google_login6.value) && (configs === null || configs === void 0 ? void 0 : (_configs$google_login7 = configs.google_login_api_key) === null || _configs$google_login7 === void 0 ? void 0 : _configs$google_login7.value) && googleLoginEnabled && /*#__PURE__*/_react.default.createElement(_GoogleLogin.GoogleLoginButton, {
|
|
595
598
|
initParams: initParams,
|
|
596
599
|
handleSuccessGoogleLogin: handleSuccessGoogle
|
|
597
|
-
}), (configs === null || configs === void 0 ? void 0 : (_configs$
|
|
600
|
+
}), (configs === null || configs === void 0 ? void 0 : (_configs$apple_login_2 = configs.apple_login_client_id) === null || _configs$apple_login_2 === void 0 ? void 0 : _configs$apple_login_2.value) && appleLoginEnabled && /*#__PURE__*/_react.default.createElement(_AppleLogin.AppleLogin, {
|
|
598
601
|
onSuccess: handleSuccessApple,
|
|
599
602
|
onFailure: function onFailure(data) {
|
|
600
603
|
return setAlertState({
|
|
@@ -16,7 +16,7 @@ var Container = _styledComponents.default.div(_templateObject || (_templateObjec
|
|
|
16
16
|
return zx && (0, _styledComponents.css)(_templateObject2 || (_templateObject2 = _taggedTemplateLiteral(["\n .popup {\n z-index: ", " !important;\n }\n "])), zx);
|
|
17
17
|
});
|
|
18
18
|
exports.Container = Container;
|
|
19
|
-
var ModalDialog = _styledComponents.default.div(_templateObject3 || (_templateObject3 = _taggedTemplateLiteral(["\n position: relative;\n background-color: ", ";\n padding: ", ";\n width: 100vw;\n border-radius: 0px;\n box-sizing: border-box;\n margin-top: auto;\n margin-bottom: auto;\n height: ", ";;\n max-height: 100vh;\n overflow: auto;\n overflow-x: ", ";\n @media (min-width: 769px) {\n width: ", ";\n max-height: 90vh;\n border-radius: 10px;\n height: auto;\n ", "\n }\n"])), function (_ref2) {
|
|
19
|
+
var ModalDialog = _styledComponents.default.div(_templateObject3 || (_templateObject3 = _taggedTemplateLiteral(["\n position: relative;\n background-color: ", ";\n padding: ", ";\n width: 100vw;\n border-radius: 0px;\n box-sizing: border-box;\n margin-top: auto;\n margin-bottom: auto;\n height: ", ";;\n max-height: 100vh;\n overflow: auto;\n overflow-x: ", ";\n z-index: 10001;\n @media (min-width: 769px) {\n width: ", ";\n max-height: 90vh;\n border-radius: 10px;\n height: auto;\n ", "\n }\n"])), function (_ref2) {
|
|
20
20
|
var isTransparent = _ref2.isTransparent;
|
|
21
21
|
return isTransparent ? 'transparent' : '#FFF';
|
|
22
22
|
}, function (_ref3) {
|
|
@@ -15,6 +15,7 @@ var _AddressForm = require("../AddressForm");
|
|
|
15
15
|
var _AddressList = require("../AddressList");
|
|
16
16
|
var _Confirm = require("../Confirm");
|
|
17
17
|
var _styles = require("./styles");
|
|
18
|
+
var _useWindowSize = require("../../../../../hooks/useWindowSize");
|
|
18
19
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
19
20
|
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
|
20
21
|
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
|
@@ -66,6 +67,7 @@ var OrderContextUI = function OrderContextUI(props) {
|
|
|
66
67
|
_useState6 = _slicedToArray(_useState5, 2),
|
|
67
68
|
alertState = _useState6[0],
|
|
68
69
|
setAlertState = _useState6[1];
|
|
70
|
+
var windowSize = (0, _useWindowSize.useWindowSize)();
|
|
69
71
|
var userCustomer = JSON.parse(window.localStorage.getItem('user-customer'));
|
|
70
72
|
var configTypes = (configState === null || configState === void 0 ? void 0 : (_configState$configs = configState.configs) === null || _configState$configs === void 0 ? void 0 : (_configState$configs$ = _configState$configs.order_types_allowed) === null || _configState$configs$ === void 0 ? void 0 : _configState$configs$.value.split('|').map(function (value) {
|
|
71
73
|
return Number(value);
|
|
@@ -109,6 +111,15 @@ var OrderContextUI = function OrderContextUI(props) {
|
|
|
109
111
|
}));
|
|
110
112
|
}
|
|
111
113
|
};
|
|
114
|
+
(0, _react.useEffect)(function () {
|
|
115
|
+
var handleCloseallPopovers = function handleCloseallPopovers() {
|
|
116
|
+
return handleClosePopover('moment');
|
|
117
|
+
};
|
|
118
|
+
window.addEventListener('scroll', handleCloseallPopovers);
|
|
119
|
+
return function () {
|
|
120
|
+
return window.removeEventListener('scroll', handleCloseallPopovers);
|
|
121
|
+
};
|
|
122
|
+
}, []);
|
|
112
123
|
return /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, /*#__PURE__*/_react.default.createElement(_styles.Container, {
|
|
113
124
|
isBusinessList: isBusinessList,
|
|
114
125
|
hero: props.hideHero,
|
|
@@ -119,7 +130,8 @@ var OrderContextUI = function OrderContextUI(props) {
|
|
|
119
130
|
},
|
|
120
131
|
isCheckOut: isCheckOut
|
|
121
132
|
}, /*#__PURE__*/_react.default.createElement(_FaMapMarkerAlt.default, null), /*#__PURE__*/_react.default.createElement("span", null, ((_orderState$options2 = orderState.options) === null || _orderState$options2 === void 0 ? void 0 : (_orderState$options2$ = _orderState$options2.address) === null || _orderState$options2$ === void 0 ? void 0 : _orderState$options2$.address) || t('WHERE_DO_WE_DELIVERY', 'Where do we delivery?'))), /*#__PURE__*/_react.default.createElement(_styles.FeatureItems, null, /*#__PURE__*/_react.default.createElement(_styles.ItemInline, null, /*#__PURE__*/_react.default.createElement(_OrderTypeSelectorHeader.OrderTypeSelectorHeader, {
|
|
122
|
-
configTypes: configTypes
|
|
133
|
+
configTypes: configTypes,
|
|
134
|
+
autoCloseWhenScroll: windowSize.width < 576
|
|
123
135
|
})), isPreOrderSetting && /*#__PURE__*/_react.default.createElement(_styles.ItemInline, null, /*#__PURE__*/_react.default.createElement(_MomentPopover.MomentPopover, {
|
|
124
136
|
open: openPopover.moment,
|
|
125
137
|
onClick: function onClick() {
|
|
@@ -134,7 +134,7 @@ var OrderBillSection = function OrderBillSection(props) {
|
|
|
134
134
|
size: "20",
|
|
135
135
|
color: theme.colors.primary
|
|
136
136
|
}))), /*#__PURE__*/_react.default.createElement("td", null, "- ", parsePrice(offer === null || offer === void 0 ? void 0 : (_offer$summary2 = offer.summary) === null || _offer$summary2 === void 0 ? void 0 : _offer$summary2.discount)));
|
|
137
|
-
})), (order === null || order === void 0 ? void 0 : (_order$summary12 = order.summary) === null || _order$summary12 === void 0 ? void 0 : _order$summary12.delivery_price)
|
|
137
|
+
})), typeof (order === null || order === void 0 ? void 0 : (_order$summary12 = order.summary) === null || _order$summary12 === void 0 ? void 0 : _order$summary12.delivery_price) === 'number' && /*#__PURE__*/_react.default.createElement("tr", null, /*#__PURE__*/_react.default.createElement("td", null, t('DELIVERY_FEE', (theme === null || theme === void 0 ? void 0 : (_theme$defaultLanguag4 = theme.defaultLanguages) === null || _theme$defaultLanguag4 === void 0 ? void 0 : _theme$defaultLanguag4.DELIVERY_FEE) || 'Delivery Fee')), /*#__PURE__*/_react.default.createElement("td", null, parsePrice(order === null || order === void 0 ? void 0 : (_order$summary13 = order.summary) === null || _order$summary13 === void 0 ? void 0 : _order$summary13.delivery_price))), (order === null || order === void 0 ? void 0 : (_order$offers6 = order.offers) === null || _order$offers6 === void 0 ? void 0 : _order$offers6.length) > 0 && (order === null || order === void 0 ? void 0 : (_order$offers7 = order.offers) === null || _order$offers7 === void 0 ? void 0 : (_order$offers7$filter = _order$offers7.filter(function (offer) {
|
|
138
138
|
return (offer === null || offer === void 0 ? void 0 : offer.target) === 2;
|
|
139
139
|
})) === null || _order$offers7$filter === void 0 ? void 0 : _order$offers7$filter.map(function (offer) {
|
|
140
140
|
var _offer$name3, _offer$name3$toUpperC, _offer$summary3;
|
|
@@ -28,13 +28,27 @@ var OrderEta = function OrderEta(props) {
|
|
|
28
28
|
estimatedDeliveryTime = _useState2[0],
|
|
29
29
|
setEstimatedDeliveryTime = _useState2[1];
|
|
30
30
|
var getEstimatedDeliveryTime = function getEstimatedDeliveryTime() {
|
|
31
|
-
var
|
|
31
|
+
var estimatedUtcTime = null;
|
|
32
32
|
var totalEta = 0;
|
|
33
|
+
if (order !== null && order !== void 0 && order.delivered_in) totalEta += order === null || order === void 0 ? void 0 : order.delivered_in;
|
|
34
|
+
if (order !== null && order !== void 0 && order.prepared_in) totalEta += order === null || order === void 0 ? void 0 : order.prepared_in;
|
|
35
|
+
if ((order === null || order === void 0 ? void 0 : order.delivery_type) === 1 && order !== null && order !== void 0 && order.eta_drive_time) {
|
|
36
|
+
totalEta += order === null || order === void 0 ? void 0 : order.eta_drive_time;
|
|
37
|
+
}
|
|
33
38
|
var _delivery = order !== null && order !== void 0 && order.delivery_datetime_utc ? order === null || order === void 0 ? void 0 : order.delivery_datetime_utc : order === null || order === void 0 ? void 0 : order.delivery_datetime;
|
|
34
39
|
if (order !== null && order !== void 0 && order.eta_current_status_time) {
|
|
35
40
|
var _order$reporting_data;
|
|
36
41
|
var currentStatueEta = order === null || order === void 0 ? void 0 : order.eta_current_status_time;
|
|
37
42
|
totalEta += currentStatueEta;
|
|
43
|
+
var previousStatusTimes = 0;
|
|
44
|
+
if (order !== null && order !== void 0 && order.eta_previous_status_times) {
|
|
45
|
+
Object.keys(order.eta_previous_status_times).map(function (key) {
|
|
46
|
+
if (!key.includes('status_penalty')) {
|
|
47
|
+
previousStatusTimes += order.eta_previous_status_times[key];
|
|
48
|
+
}
|
|
49
|
+
});
|
|
50
|
+
}
|
|
51
|
+
totalEta += previousStatusTimes;
|
|
38
52
|
var nextStatusTimes = 0;
|
|
39
53
|
if (order !== null && order !== void 0 && order.eta_next_status_times) {
|
|
40
54
|
Object.keys(order.eta_next_status_times).map(function (key) {
|
|
@@ -49,15 +63,11 @@ var OrderEta = function OrderEta(props) {
|
|
|
49
63
|
if (diffTimeAsMinutes <= 0) {
|
|
50
64
|
totalEta += Math.floor(Math.abs(diffTimeAsMinutes / (order === null || order === void 0 ? void 0 : order.eta_current_status_time)) + 1) * (order === null || order === void 0 ? void 0 : order.eta_current_status_penalty_time);
|
|
51
65
|
}
|
|
52
|
-
_estimatedTime = _moment.default.utc(_delivery).add(totalEta, 'minutes');
|
|
53
66
|
} else {
|
|
54
|
-
|
|
55
|
-
if (order !== null && order !== void 0 && order.delivered_in) timesToAdd += order === null || order === void 0 ? void 0 : order.delivered_in;
|
|
56
|
-
if (order !== null && order !== void 0 && order.prepared_in) timesToAdd += order === null || order === void 0 ? void 0 : order.prepared_in;
|
|
57
|
-
var _etaTime = (order === null || order === void 0 ? void 0 : order.eta_time) + timesToAdd;
|
|
58
|
-
_estimatedTime = _moment.default.utc(_delivery).add(_etaTime, 'minutes');
|
|
67
|
+
totalEta = (order === null || order === void 0 ? void 0 : order.eta_time) + totalEta;
|
|
59
68
|
}
|
|
60
|
-
|
|
69
|
+
estimatedUtcTime = _moment.default.utc(_delivery).add(totalEta, 'minutes');
|
|
70
|
+
var _estimatedTime = outputFormat ? (0, _moment.default)(estimatedUtcTime).local().format(outputFormat) : parseDate(estimatedUtcTime, {
|
|
61
71
|
utc: false
|
|
62
72
|
});
|
|
63
73
|
setEstimatedDeliveryTime(_estimatedTime);
|
|
@@ -18,6 +18,7 @@ function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len
|
|
|
18
18
|
function _iterableToArrayLimit(arr, i) { var _i = null == arr ? null : "undefined" != typeof Symbol && arr[Symbol.iterator] || arr["@@iterator"]; if (null != _i) { var _s, _e, _x, _r, _arr = [], _n = !0, _d = !1; try { if (_x = (_i = _i.call(arr)).next, 0 === i) { if (Object(_i) !== _i) return; _n = !1; } else for (; !(_n = (_s = _x.call(_i)).done) && (_arr.push(_s.value), _arr.length !== i); _n = !0); } catch (err) { _d = !0, _e = err; } finally { try { if (!_n && null != _i.return && (_r = _i.return(), Object(_r) !== _r)) return; } finally { if (_d) throw _e; } } return _arr; } }
|
|
19
19
|
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
20
20
|
var OrderHistory = function OrderHistory(props) {
|
|
21
|
+
var _configs$general_hour;
|
|
21
22
|
var messages = props.messages,
|
|
22
23
|
order = props.order,
|
|
23
24
|
handleOpenReview = props.handleOpenReview,
|
|
@@ -29,6 +30,9 @@ var OrderHistory = function OrderHistory(props) {
|
|
|
29
30
|
var _useUtils = (0, _orderingComponentsExternal.useUtils)(),
|
|
30
31
|
_useUtils2 = _slicedToArray(_useUtils, 1),
|
|
31
32
|
parseDate = _useUtils2[0].parseDate;
|
|
33
|
+
var _useConfig = (0, _orderingComponentsExternal.useConfig)(),
|
|
34
|
+
_useConfig2 = _slicedToArray(_useConfig, 1),
|
|
35
|
+
configs = _useConfig2[0].configs;
|
|
32
36
|
var getLogisticTagStatus = function getLogisticTagStatus(status) {
|
|
33
37
|
switch (status) {
|
|
34
38
|
case 0:
|
|
@@ -107,13 +111,13 @@ var OrderHistory = function OrderHistory(props) {
|
|
|
107
111
|
}
|
|
108
112
|
};
|
|
109
113
|
return /*#__PURE__*/_react.default.createElement(_styles.OrderHistoryContainer, null, !(messages !== null && messages !== void 0 && messages.loading) && order && /*#__PURE__*/_react.default.createElement(_styles.HistoryItemWrapper, null, /*#__PURE__*/_react.default.createElement(_reactBootstrapIcons.CheckCircleFill, null), /*#__PURE__*/_react.default.createElement(_styles.DetailWrapper, null, /*#__PURE__*/_react.default.createElement("h3", null, t('ORDER_PLACED', 'Order placed'), " ", ' ', t('VIA', 'Via'), ' ', order.app_id ? t(order.app_id.toUpperCase(), order.app_id) : t('OTHER', 'Other')), /*#__PURE__*/_react.default.createElement("p", null, parseDate(order.created_at, {
|
|
110
|
-
outputFormat:
|
|
114
|
+
outputFormat: "MMM DD, ".concat(configs === null || configs === void 0 ? void 0 : (_configs$general_hour = configs.general_hour_format) === null || _configs$general_hour === void 0 ? void 0 : _configs$general_hour.value)
|
|
111
115
|
})))), messages && (messages === null || messages === void 0 ? void 0 : messages.messages.map(function (message, i) {
|
|
112
|
-
var _message$change, _message$change2, _message$change3, _message$change4, _message$driver, _message$driver2;
|
|
116
|
+
var _message$change, _message$change2, _message$change3, _message$change4, _message$driver, _message$driver2, _configs$general_hour2;
|
|
113
117
|
return message.type === 1 && /*#__PURE__*/_react.default.createElement(_styles.HistoryItemWrapper, {
|
|
114
118
|
key: i
|
|
115
119
|
}, /*#__PURE__*/_react.default.createElement(_reactBootstrapIcons.CheckCircleFill, null), /*#__PURE__*/_react.default.createElement(_styles.DetailWrapper, null, ((_message$change = message.change) === null || _message$change === void 0 ? void 0 : _message$change.attribute) !== 'driver_id' ? /*#__PURE__*/_react.default.createElement("h3", null, ((_message$change2 = message.change) === null || _message$change2 === void 0 ? void 0 : _message$change2.attribute) === 'logistic_status' ? getLogisticTagStatus(parseInt(message.change.new, 10)) : ((_message$change3 = message.change) === null || _message$change3 === void 0 ? void 0 : _message$change3.attribute) === 'delivered_in' ? /*#__PURE__*/_react.default.createElement("h3", null, /*#__PURE__*/_react.default.createElement("strong", null, t('TIME_ADDED_BY_DRIVER', 'Time added by driver')), /*#__PURE__*/_react.default.createElement("br", null), (0, _utils.formatSeconds)(parseInt(message.change.new, 10))) : ((_message$change4 = message.change) === null || _message$change4 === void 0 ? void 0 : _message$change4.attribute) === 'prepared_in' ? /*#__PURE__*/_react.default.createElement("h3", null, /*#__PURE__*/_react.default.createElement("strong", null, t('TIME_ADDED_BY_BUSINESS', 'Time added by business')), /*#__PURE__*/_react.default.createElement("br", null), (0, _utils.formatSeconds)(parseInt(message.change.new, 10))) : t(getStatus(parseInt(message.change.new, 10)))) : /*#__PURE__*/_react.default.createElement("h3", null, message.change.new ? /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, /*#__PURE__*/_react.default.createElement("strong", null, (_message$driver = message.driver) === null || _message$driver === void 0 ? void 0 : _message$driver.name, " ", ' ', " ", ((_message$driver2 = message.driver) === null || _message$driver2 === void 0 ? void 0 : _message$driver2.lastname) && message.driver.lastname, " "), t('WAS_ASSIGNED_AS_DRIVER', 'Was assigned as driver')) : /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, t('DRIVER_UNASSIGNED', 'Driver unassigned'))), /*#__PURE__*/_react.default.createElement("p", null, parseDate(message.created_at, {
|
|
116
|
-
outputFormat:
|
|
120
|
+
outputFormat: "MMM DD, ".concat(configs === null || configs === void 0 ? void 0 : (_configs$general_hour2 = configs.general_hour_format) === null || _configs$general_hour2 === void 0 ? void 0 : _configs$general_hour2.value)
|
|
117
121
|
}))));
|
|
118
122
|
})), /*#__PURE__*/_react.default.createElement(_styles.ButtonWrapper, null, /*#__PURE__*/_react.default.createElement(_Buttons.Button, {
|
|
119
123
|
onClick: handleReview,
|
|
@@ -57,7 +57,7 @@ function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len
|
|
|
57
57
|
function _iterableToArrayLimit(arr, i) { var _i = null == arr ? null : "undefined" != typeof Symbol && arr[Symbol.iterator] || arr["@@iterator"]; if (null != _i) { var _s, _e, _x, _r, _arr = [], _n = !0, _d = !1; try { if (_x = (_i = _i.call(arr)).next, 0 === i) { if (Object(_i) !== _i) return; _n = !1; } else for (; !(_n = (_s = _x.call(_i)).done) && (_arr.push(_s.value), _arr.length !== i); _n = !0); } catch (err) { _d = !0, _e = err; } finally { try { if (!_n && null != _i.return && (_r = _i.return(), Object(_r) !== _r)) return; } finally { if (_d) throw _e; } } return _arr; } }
|
|
58
58
|
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
59
59
|
var OrderDetailsUI = function OrderDetailsUI(props) {
|
|
60
|
-
var _configs$google_maps_, _configs$powered_by_o, _orderingTheme$theme, _orderingTheme$theme$, _orderingTheme$theme$2, _orderingTheme$theme$3, _theme$confirmation, _theme$confirmation$c, _theme$confirmation$c2, _theme$confirmation$c3, _theme$confirmation$c4, _theme$confirmation2, _theme$confirmation2$, _theme$confirmation2$2, _theme$confirmation2$3, _theme$confirmation2$4, _theme$confirmation3, _theme$confirmation3$, _theme$confirmation3$2, _theme$confirmation3$3, _theme$confirmation3$4, _theme$confirmation4, _theme$confirmation4$, _theme$confirmation4$2, _theme$confirmation4$3, _theme$confirmation4$4, _theme$confirmation5, _theme$confirmation5$, _theme$confirmation5$2, _theme$confirmation5$3, _theme$confirmation5$4, _theme$confirmation6, _theme$confirmation6$, _theme$confirmation6$2, _theme$confirmation6$3, _theme$confirmation6$4, _theme$confirmation7, _theme$confirmation7$, _theme$confirmation7$2, _theme$confirmation7$3, _theme$confirmation7$4, _theme$confirmation8, _theme$confirmation8$, _theme$confirmation8$2, _theme$confirmation8$3, _theme$confirmation8$4, _theme$confirmation9, _theme$confirmation9$, _theme$confirmation9$2, _theme$confirmation9$3, _theme$confirmation9$4, _theme$confirmation10, _theme$confirmation11, _theme$confirmation12, _theme$confirmation13, _theme$confirmation14, _theme$confirmation15, _theme$confirmation16, _theme$confirmation17, _theme$confirmation18, _theme$confirmation19, _theme$confirmation20, _theme$confirmation21, _theme$confirmation22, _theme$confirmation23, _theme$confirmation24, _theme$confirmation25, _theme$confirmation26, _theme$confirmation27, _theme$confirmation28, _theme$confirmation29, _theme$confirmation30, _theme$confirmation31, _theme$confirmation32, _theme$confirmation33, _theme$confirmation34, _theme$confirmation35, _theme$confirmation36, _theme$confirmation37, _theme$confirmation38, _theme$confirmation39, _theme$confirmation40, _theme$confirmation41, _theme$confirmation42, _theme$confirmation43, _theme$confirmation44, _theme$confirmation45, _theme$confirmation46, _theme$confirmation47, _theme$confirmation48, _theme$confirmation49, _order$driver, _order$driver2, _theme$images, _theme$images$dummies, _order$business2, _order$business3, _theme$images2, _theme$images2$dummie, _order$customer, _order$customer2, _theme$images3, _theme$images3$dummie, _order$driver3, _order$driver3$locati, _order$driver4, _order$driver4$locati, _order$driver4$locati2, _theme$defaultLanguag, _configs$guest_uuid_a, _order$business4, _order$business5, _orderTypes$find, _order$reporting_data, _getOrderStatus, _getOrderStatus2, _theme$defaultLanguag2, _order$business6, _order$business7, _order$business8, _order$business9, _order$business10, _order$place, _order$place2, _getOrderStatus3, _getOrderStatus4, _order$business12, _order$customer3, _order$customer4, _order$customer5, _order$customer6, _order$customer7, _order$customer8, _order$customer9, _order$customer10, _theme$defaultLanguag3, _order$driver5, _order$driver6, _order$driver7, _order$driver8, _order$driver9, _order$driver10, _order$driver11, _order$driver12, _order$driver13, _order$driver13$locat, _order$driver14, _configs$google_maps_2, _order$products$, _order$products$$gift, _order$products$2, _order$products$2$gif, _theme$defaultLanguag4, _theme$defaultLanguag5, _theme$defaultLanguag6, _openTaxModal$data, _openTaxModal$data2, _openTaxModal$data3, _openTaxModal$data4, _openTaxModal$data$fi, _openTaxModal$data5, _openTaxModal$data6;
|
|
60
|
+
var _configs$google_maps_, _configs$powered_by_o, _orderingTheme$theme, _orderingTheme$theme$, _orderingTheme$theme$2, _orderingTheme$theme$3, _theme$confirmation, _theme$confirmation$c, _theme$confirmation$c2, _theme$confirmation$c3, _theme$confirmation$c4, _theme$confirmation2, _theme$confirmation2$, _theme$confirmation2$2, _theme$confirmation2$3, _theme$confirmation2$4, _theme$confirmation3, _theme$confirmation3$, _theme$confirmation3$2, _theme$confirmation3$3, _theme$confirmation3$4, _theme$confirmation4, _theme$confirmation4$, _theme$confirmation4$2, _theme$confirmation4$3, _theme$confirmation4$4, _theme$confirmation5, _theme$confirmation5$, _theme$confirmation5$2, _theme$confirmation5$3, _theme$confirmation5$4, _theme$confirmation6, _theme$confirmation6$, _theme$confirmation6$2, _theme$confirmation6$3, _theme$confirmation6$4, _theme$confirmation7, _theme$confirmation7$, _theme$confirmation7$2, _theme$confirmation7$3, _theme$confirmation7$4, _theme$confirmation8, _theme$confirmation8$, _theme$confirmation8$2, _theme$confirmation8$3, _theme$confirmation8$4, _theme$confirmation9, _theme$confirmation9$, _theme$confirmation9$2, _theme$confirmation9$3, _theme$confirmation9$4, _theme$confirmation10, _theme$confirmation11, _theme$confirmation12, _theme$confirmation13, _theme$confirmation14, _theme$confirmation15, _theme$confirmation16, _theme$confirmation17, _theme$confirmation18, _theme$confirmation19, _theme$confirmation20, _theme$confirmation21, _theme$confirmation22, _theme$confirmation23, _theme$confirmation24, _theme$confirmation25, _theme$confirmation26, _theme$confirmation27, _theme$confirmation28, _theme$confirmation29, _theme$confirmation30, _theme$confirmation31, _theme$confirmation32, _theme$confirmation33, _theme$confirmation34, _theme$confirmation35, _theme$confirmation36, _theme$confirmation37, _theme$confirmation38, _theme$confirmation39, _theme$confirmation40, _theme$confirmation41, _theme$confirmation42, _theme$confirmation43, _theme$confirmation44, _theme$confirmation45, _theme$confirmation46, _theme$confirmation47, _theme$confirmation48, _theme$confirmation49, _order$driver, _order$driver2, _theme$images, _theme$images$dummies, _order$business2, _order$business3, _theme$images2, _theme$images2$dummie, _order$customer, _order$customer2, _theme$images3, _theme$images3$dummie, _order$driver3, _order$driver3$locati, _order$driver4, _order$driver4$locati, _order$driver4$locati2, _theme$defaultLanguag, _configs$guest_uuid_a, _order$business4, _order$business5, _orderTypes$find, _order$reporting_data, _configs$general_hour, _getOrderStatus, _getOrderStatus2, _theme$defaultLanguag2, _order$business6, _order$business7, _order$business8, _order$business9, _order$business10, _order$place, _order$place2, _getOrderStatus3, _getOrderStatus4, _order$business12, _order$customer3, _order$customer4, _order$customer5, _order$customer6, _order$customer7, _order$customer8, _order$customer9, _order$customer10, _theme$defaultLanguag3, _order$driver5, _order$driver6, _order$driver7, _order$driver8, _order$driver9, _order$driver10, _order$driver11, _order$driver12, _order$driver13, _order$driver13$locat, _order$driver14, _configs$google_maps_2, _order$products$, _order$products$$gift, _order$products$2, _order$products$2$gif, _theme$defaultLanguag4, _theme$defaultLanguag5, _theme$defaultLanguag6, _openTaxModal$data, _openTaxModal$data2, _openTaxModal$data3, _openTaxModal$data4, _openTaxModal$data$fi, _openTaxModal$data5, _openTaxModal$data6;
|
|
61
61
|
var userCustomerId = props.userCustomerId,
|
|
62
62
|
handleChangeOrderStatus = props.handleChangeOrderStatus,
|
|
63
63
|
handleBusinessRedirect = props.handleBusinessRedirect,
|
|
@@ -528,7 +528,9 @@ var OrderDetailsUI = function OrderDetailsUI(props) {
|
|
|
528
528
|
className: "date"
|
|
529
529
|
}, activeStatus.includes(order === null || order === void 0 ? void 0 : order.status) ? /*#__PURE__*/_react.default.createElement(_OrderEta.OrderEta, {
|
|
530
530
|
order: order
|
|
531
|
-
}) : parseDate(order === null || order === void 0 ? void 0 : (_order$reporting_data = order.reporting_data) === null || _order$reporting_data === void 0 ? void 0 : _order$reporting_data.at["status:".concat(order.status)]
|
|
531
|
+
}) : parseDate(order === null || order === void 0 ? void 0 : (_order$reporting_data = order.reporting_data) === null || _order$reporting_data === void 0 ? void 0 : _order$reporting_data.at["status:".concat(order.status)], {
|
|
532
|
+
outputFormat: "YYYY-MM-DD ".concat(configs === null || configs === void 0 ? void 0 : (_configs$general_hour = configs.general_hour_format) === null || _configs$general_hour === void 0 ? void 0 : _configs$general_hour.value)
|
|
533
|
+
})), (acceptedStatus.includes(parseInt(order === null || order === void 0 ? void 0 : order.status, 10)) || !isOriginalLayout) && !isGiftCardOrder && /*#__PURE__*/_react.default.createElement(_styles.ReOrder, null, /*#__PURE__*/_react.default.createElement(_Buttons.Button, {
|
|
532
534
|
color: "primary",
|
|
533
535
|
outline: true,
|
|
534
536
|
onClick: function onClick() {
|
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); }
|
|
4
|
+
Object.defineProperty(exports, "__esModule", {
|
|
5
|
+
value: true
|
|
6
|
+
});
|
|
7
|
+
exports.PaymentOptionCard = void 0;
|
|
8
|
+
var _orderingComponentsExternal = require("ordering-components-external");
|
|
9
|
+
var _react = _interopRequireWildcard(require("react"));
|
|
10
|
+
var _CardFormCustom = require("../CardFormCustom");
|
|
11
|
+
var _Modal = _interopRequireDefault(require("../Modal"));
|
|
12
|
+
var _PaymentOptionStripe = require("../PaymentOptionStripe");
|
|
13
|
+
var _styles = require("../PaymentOptionStripe/styles");
|
|
14
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
15
|
+
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
|
16
|
+
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
|
17
|
+
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
18
|
+
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
19
|
+
function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
20
|
+
function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _typeof(key) === "symbol" ? key : String(key); }
|
|
21
|
+
function _toPrimitive(input, hint) { if (_typeof(input) !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (_typeof(res) !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); }
|
|
22
|
+
function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
|
|
23
|
+
function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
|
|
24
|
+
function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
|
|
25
|
+
function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; }
|
|
26
|
+
function _iterableToArrayLimit(arr, i) { var _i = null == arr ? null : "undefined" != typeof Symbol && arr[Symbol.iterator] || arr["@@iterator"]; if (null != _i) { var _s, _e, _x, _r, _arr = [], _n = !0, _d = !1; try { if (_x = (_i = _i.call(arr)).next, 0 === i) { if (Object(_i) !== _i) return; _n = !1; } else for (; !(_n = (_s = _x.call(_i)).done) && (_arr.push(_s.value), _arr.length !== i); _n = !0); } catch (err) { _d = !0, _e = err; } finally { try { if (!_n && null != _i.return && (_r = _i.return(), Object(_r) !== _r)) return; } finally { if (_d) throw _e; } } return _arr; } }
|
|
27
|
+
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
28
|
+
var PaymentOptionCardUI = function PaymentOptionCardUI(props) {
|
|
29
|
+
var deleteCard = props.deleteCard,
|
|
30
|
+
cardsList = props.cardsList,
|
|
31
|
+
handleCardClick = props.handleCardClick,
|
|
32
|
+
handleNewCard = props.handleNewCard,
|
|
33
|
+
paymethodSelected = props.paymethodSelected,
|
|
34
|
+
cardSelected = props.cardSelected,
|
|
35
|
+
gateway = props.gateway,
|
|
36
|
+
paymethodsWithoutSaveCards = props.paymethodsWithoutSaveCards,
|
|
37
|
+
onSelectCard = props.onSelectCard;
|
|
38
|
+
var _useLanguage = (0, _orderingComponentsExternal.useLanguage)(),
|
|
39
|
+
_useLanguage2 = _slicedToArray(_useLanguage, 2),
|
|
40
|
+
t = _useLanguage2[1];
|
|
41
|
+
var _useSession = (0, _orderingComponentsExternal.useSession)(),
|
|
42
|
+
_useSession2 = _slicedToArray(_useSession, 1),
|
|
43
|
+
token = _useSession2[0].token;
|
|
44
|
+
var _useState = (0, _react.useState)(false),
|
|
45
|
+
_useState2 = _slicedToArray(_useState, 2),
|
|
46
|
+
addCardOpen = _useState2[0],
|
|
47
|
+
setAddCardOpen = _useState2[1];
|
|
48
|
+
(0, _react.useEffect)(function () {
|
|
49
|
+
var _cardsList$cards;
|
|
50
|
+
if ((cardsList === null || cardsList === void 0 ? void 0 : (_cardsList$cards = cardsList.cards) === null || _cardsList$cards === void 0 ? void 0 : _cardsList$cards.length) > 0) {
|
|
51
|
+
setAddCardOpen(true);
|
|
52
|
+
}
|
|
53
|
+
}, [cardsList === null || cardsList === void 0 ? void 0 : cardsList.cards]);
|
|
54
|
+
return /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, /*#__PURE__*/_react.default.createElement(_PaymentOptionStripe.PaymentOptionStripeUI, {
|
|
55
|
+
deleteCard: deleteCard,
|
|
56
|
+
cardsList: cardsList,
|
|
57
|
+
handleCardClick: handleCardClick,
|
|
58
|
+
handleNewCard: handleNewCard,
|
|
59
|
+
paymethodSelected: paymethodSelected,
|
|
60
|
+
cardSelected: cardSelected,
|
|
61
|
+
gateway: gateway,
|
|
62
|
+
onSelectCard: onSelectCard
|
|
63
|
+
}), token && !cardsList.loading && (!cardSelected || !paymethodsWithoutSaveCards.includes(gateway)) && /*#__PURE__*/_react.default.createElement(_styles.AddNewCard, null, /*#__PURE__*/_react.default.createElement("span", {
|
|
64
|
+
onClick: function onClick() {
|
|
65
|
+
return setAddCardOpen(true);
|
|
66
|
+
}
|
|
67
|
+
}, t('ADD_NEW_CARD', 'Add new card'))), /*#__PURE__*/_react.default.createElement(_Modal.default, {
|
|
68
|
+
open: addCardOpen,
|
|
69
|
+
onClose: function onClose() {
|
|
70
|
+
return setAddCardOpen(false);
|
|
71
|
+
},
|
|
72
|
+
title: t('ADD_NEW_CARD', 'Add new card')
|
|
73
|
+
}, /*#__PURE__*/_react.default.createElement(_CardFormCustom.CardFormCustom, {
|
|
74
|
+
handleNewCard: handleNewCard,
|
|
75
|
+
setAddCardOpen: setAddCardOpen
|
|
76
|
+
})));
|
|
77
|
+
};
|
|
78
|
+
var PaymentOptionCard = function PaymentOptionCard(props) {
|
|
79
|
+
var paymentOptionStripeProps = _objectSpread(_objectSpread({}, props), {}, {
|
|
80
|
+
UIComponent: PaymentOptionCardUI
|
|
81
|
+
});
|
|
82
|
+
return /*#__PURE__*/_react.default.createElement(_orderingComponentsExternal.PaymentOptionStripe, paymentOptionStripeProps);
|
|
83
|
+
};
|
|
84
|
+
exports.PaymentOptionCard = PaymentOptionCard;
|
|
@@ -4,11 +4,13 @@ function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" =
|
|
|
4
4
|
Object.defineProperty(exports, "__esModule", {
|
|
5
5
|
value: true
|
|
6
6
|
});
|
|
7
|
-
exports.PaymentOptionStripe = exports.PaymentCard = void 0;
|
|
7
|
+
exports.PaymentOptionStripeUI = exports.PaymentOptionStripe = exports.PaymentCard = void 0;
|
|
8
8
|
var _react = _interopRequireWildcard(require("react"));
|
|
9
9
|
var _reactLoadingSkeleton = _interopRequireDefault(require("react-loading-skeleton"));
|
|
10
10
|
var _orderingComponentsExternal = require("ordering-components-external");
|
|
11
|
-
var
|
|
11
|
+
var _IosRadioButtonOn = _interopRequireDefault(require("@meronex/icons/ios/IosRadioButtonOn"));
|
|
12
|
+
var _IosRadioButtonOff = _interopRequireDefault(require("@meronex/icons/ios/IosRadioButtonOff"));
|
|
13
|
+
var _reactBootstrapIcons = require("react-bootstrap-icons");
|
|
12
14
|
var _styledComponents = require("styled-components");
|
|
13
15
|
var _Modal = require("../Modal");
|
|
14
16
|
var _Confirm = require("../Confirm");
|
|
@@ -36,11 +38,14 @@ function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len
|
|
|
36
38
|
function _iterableToArrayLimit(arr, i) { var _i = null == arr ? null : "undefined" != typeof Symbol && arr[Symbol.iterator] || arr["@@iterator"]; if (null != _i) { var _s, _e, _x, _r, _arr = [], _n = !0, _d = !1; try { if (_x = (_i = _i.call(arr)).next, 0 === i) { if (Object(_i) !== _i) return; _n = !1; } else for (; !(_n = (_s = _x.call(_i)).done) && (_arr.push(_s.value), _arr.length !== i); _n = !0); } catch (err) { _d = !0, _e = err; } finally { try { if (!_n && null != _i.return && (_r = _i.return(), Object(_r) !== _r)) return; } finally { if (_d) throw _e; } } return _arr; } }
|
|
37
39
|
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
38
40
|
var PaymentOptionStripeUI = function PaymentOptionStripeUI(props) {
|
|
39
|
-
var _props$beforeElements, _props$beforeComponen, _cardsList$error$, _cardsList$
|
|
41
|
+
var _props$beforeElements, _props$beforeComponen, _cardsList$error$, _cardsList$cards2, _props$afterComponent, _props$afterElements;
|
|
40
42
|
var deleteCard = props.deleteCard,
|
|
41
43
|
cardsList = props.cardsList,
|
|
42
44
|
_handleCardClick = props.handleCardClick,
|
|
43
|
-
handleNewCard = props.handleNewCard
|
|
45
|
+
handleNewCard = props.handleNewCard,
|
|
46
|
+
paymethodSelected = props.paymethodSelected,
|
|
47
|
+
cardSelected = props.cardSelected,
|
|
48
|
+
gateway = props.gateway;
|
|
44
49
|
var _useSession = (0, _orderingComponentsExternal.useSession)(),
|
|
45
50
|
_useSession2 = _slicedToArray(_useSession, 1),
|
|
46
51
|
token = _useSession2[0].token;
|
|
@@ -59,6 +64,7 @@ var PaymentOptionStripeUI = function PaymentOptionStripeUI(props) {
|
|
|
59
64
|
_useState4 = _slicedToArray(_useState3, 2),
|
|
60
65
|
addCartOpen = _useState4[0],
|
|
61
66
|
setAddCardOpen = _useState4[1];
|
|
67
|
+
var paymethodsWithoutSaveCards = ['credomatic'];
|
|
62
68
|
var _handleNewCard = function _handleNewCard(card) {
|
|
63
69
|
setAddCardOpen(false);
|
|
64
70
|
handleNewCard(card);
|
|
@@ -75,6 +81,12 @@ var PaymentOptionStripeUI = function PaymentOptionStripeUI(props) {
|
|
|
75
81
|
}
|
|
76
82
|
});
|
|
77
83
|
};
|
|
84
|
+
(0, _react.useEffect)(function () {
|
|
85
|
+
var _cardsList$cards;
|
|
86
|
+
if (!(cardsList !== null && cardsList !== void 0 && cardsList.loading) && (cardsList === null || cardsList === void 0 ? void 0 : (_cardsList$cards = cardsList.cards) === null || _cardsList$cards === void 0 ? void 0 : _cardsList$cards.length) === 0 && !paymethodsWithoutSaveCards.includes(gateway)) {
|
|
87
|
+
setAddCardOpen(true);
|
|
88
|
+
}
|
|
89
|
+
}, [cardsList === null || cardsList === void 0 ? void 0 : cardsList.loading]);
|
|
78
90
|
return /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, (_props$beforeElements = props.beforeElements) === null || _props$beforeElements === void 0 ? void 0 : _props$beforeElements.map(function (BeforeElement, i) {
|
|
79
91
|
return /*#__PURE__*/_react.default.createElement(_react.default.Fragment, {
|
|
80
92
|
key: i
|
|
@@ -85,7 +97,7 @@ var PaymentOptionStripeUI = function PaymentOptionStripeUI(props) {
|
|
|
85
97
|
}, props));
|
|
86
98
|
}), /*#__PURE__*/_react.default.createElement(_styles.OptionStripeContainer, null, !token && /*#__PURE__*/_react.default.createElement(_styles.WarningMessage, null, t('NEED_LOGIN_TO_USE', 'Sorry, you need to login to use this method')), token && !cardsList.loading && cardsList.cards && cardsList.cards.length === 0 && /*#__PURE__*/_react.default.createElement(_styles.CardItem, null, /*#__PURE__*/_react.default.createElement("span", null, t('NO_CARDS', 'No cards'))), token && cardsList.error && cardsList.error.length > 0 && /*#__PURE__*/_react.default.createElement(_NotFoundSource.NotFoundSource, {
|
|
87
99
|
content: (cardsList === null || cardsList === void 0 ? void 0 : (_cardsList$error$ = cardsList.error[0]) === null || _cardsList$error$ === void 0 ? void 0 : _cardsList$error$.message) || (cardsList === null || cardsList === void 0 ? void 0 : cardsList.error[0])
|
|
88
|
-
}), token && cardsList.cards && cardsList.cards.length > 0 && /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, cardsList === null || cardsList === void 0 ? void 0 : (_cardsList$
|
|
100
|
+
}), token && cardsList.cards && cardsList.cards.length > 0 && /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, cardsList === null || cardsList === void 0 ? void 0 : (_cardsList$cards2 = cardsList.cards) === null || _cardsList$cards2 === void 0 ? void 0 : _cardsList$cards2.map(function (card, i) {
|
|
89
101
|
return /*#__PURE__*/_react.default.createElement(PaymentCard, _extends({}, props, {
|
|
90
102
|
key: i,
|
|
91
103
|
handleCardClick: function handleCardClick() {
|
|
@@ -95,9 +107,12 @@ var PaymentOptionStripeUI = function PaymentOptionStripeUI(props) {
|
|
|
95
107
|
return _handleDeleteCard(card);
|
|
96
108
|
},
|
|
97
109
|
card: card,
|
|
98
|
-
defaultSelected: i === 0
|
|
110
|
+
defaultSelected: i === 0,
|
|
111
|
+
active: (paymethodSelected || (cardSelected === null || cardSelected === void 0 ? void 0 : cardSelected.id)) === card.id,
|
|
112
|
+
cardSelected: cardSelected,
|
|
113
|
+
paymethodSelected: paymethodSelected
|
|
99
114
|
}));
|
|
100
|
-
})), token && !cardsList.loading && /*#__PURE__*/_react.default.createElement(_styles.AddNewCard, null, /*#__PURE__*/_react.default.createElement("span", {
|
|
115
|
+
})), token && !cardsList.loading && !paymethodsWithoutSaveCards.includes(gateway) && /*#__PURE__*/_react.default.createElement(_styles.AddNewCard, null, /*#__PURE__*/_react.default.createElement("span", {
|
|
101
116
|
onClick: function onClick() {
|
|
102
117
|
return setAddCardOpen(true);
|
|
103
118
|
}
|
|
@@ -151,21 +166,21 @@ var PaymentOptionStripeUI = function PaymentOptionStripeUI(props) {
|
|
|
151
166
|
}, AfterElement);
|
|
152
167
|
}));
|
|
153
168
|
};
|
|
169
|
+
exports.PaymentOptionStripeUI = PaymentOptionStripeUI;
|
|
154
170
|
var PaymentCard = function PaymentCard(props) {
|
|
155
171
|
var handleDeleteCard = props.handleDeleteCard,
|
|
156
172
|
card = props.card,
|
|
157
173
|
handleCardClick = props.handleCardClick,
|
|
158
|
-
onSelectCard = props.onSelectCard
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
t = _useLanguage4[1];
|
|
162
|
-
var theme = (0, _styledComponents.useTheme)();
|
|
174
|
+
onSelectCard = props.onSelectCard,
|
|
175
|
+
active = props.active,
|
|
176
|
+
cardSelected = props.cardSelected;
|
|
163
177
|
var _useState5 = (0, _react.useState)(false),
|
|
164
178
|
_useState6 = _slicedToArray(_useState5, 2),
|
|
165
179
|
isShowActions = _useState6[0],
|
|
166
180
|
setIsShowActions = _useState6[1];
|
|
167
181
|
var cardActionsRef = (0, _react.useRef)(null);
|
|
168
182
|
var actionWrapperRef = (0, _react.useRef)(null);
|
|
183
|
+
var theme = (0, _styledComponents.useTheme)();
|
|
169
184
|
var handleClickOutside = function handleClickOutside(e) {
|
|
170
185
|
var _cardActionsRef$curre;
|
|
171
186
|
if (!isShowActions) return;
|
|
@@ -178,15 +193,26 @@ var PaymentCard = function PaymentCard(props) {
|
|
|
178
193
|
var _actionWrapperRef$cur;
|
|
179
194
|
if ((_actionWrapperRef$cur = actionWrapperRef.current) !== null && _actionWrapperRef$cur !== void 0 && _actionWrapperRef$cur.contains(e.target)) return;
|
|
180
195
|
handleCardClick(card);
|
|
181
|
-
onSelectCard({
|
|
196
|
+
onSelectCard && onSelectCard(_objectSpread(_objectSpread({}, cardSelected), {}, {
|
|
182
197
|
id: card.id,
|
|
183
198
|
type: 'card',
|
|
184
199
|
card: {
|
|
185
200
|
brand: card.brand,
|
|
186
201
|
last4: card.last4
|
|
187
202
|
}
|
|
188
|
-
});
|
|
203
|
+
}));
|
|
189
204
|
};
|
|
205
|
+
(0, _react.useEffect)(function () {
|
|
206
|
+
if (!cardSelected) return;
|
|
207
|
+
onSelectCard && onSelectCard(_objectSpread(_objectSpread({}, cardSelected), {}, {
|
|
208
|
+
id: cardSelected === null || cardSelected === void 0 ? void 0 : cardSelected.id,
|
|
209
|
+
type: 'card',
|
|
210
|
+
card: {
|
|
211
|
+
brand: cardSelected === null || cardSelected === void 0 ? void 0 : cardSelected.brand,
|
|
212
|
+
last4: cardSelected === null || cardSelected === void 0 ? void 0 : cardSelected.last4
|
|
213
|
+
}
|
|
214
|
+
}));
|
|
215
|
+
}, [cardSelected]);
|
|
190
216
|
(0, _react.useEffect)(function () {
|
|
191
217
|
window.addEventListener('click', handleClickOutside);
|
|
192
218
|
return function () {
|
|
@@ -196,21 +222,21 @@ var PaymentCard = function PaymentCard(props) {
|
|
|
196
222
|
return /*#__PURE__*/_react.default.createElement(_styles.CardItem, {
|
|
197
223
|
onClick: handleChangeDefaultCard,
|
|
198
224
|
isCursor: true
|
|
199
|
-
}, /*#__PURE__*/_react.default.createElement(_styles.CardItemContent, null, /*#__PURE__*/_react.default.createElement("
|
|
225
|
+
}, /*#__PURE__*/_react.default.createElement(_styles.CardItemContent, null, /*#__PURE__*/_react.default.createElement("span", {
|
|
226
|
+
className: "checks"
|
|
227
|
+
}, active ? /*#__PURE__*/_react.default.createElement(_IosRadioButtonOn.default, null) : /*#__PURE__*/_react.default.createElement(_IosRadioButtonOff.default, null)), /*#__PURE__*/_react.default.createElement("div", null, /*#__PURE__*/_react.default.createElement("img", {
|
|
200
228
|
src: (0, _utils.getIconCard)(card === null || card === void 0 ? void 0 : card.brand),
|
|
201
229
|
alt: card === null || card === void 0 ? void 0 : card.brand
|
|
202
|
-
})), /*#__PURE__*/_react.default.createElement("span", null, card === null || card === void 0 ? void 0 : card.
|
|
230
|
+
})), /*#__PURE__*/_react.default.createElement("span", null, "XXXX-XXXX-XXXX-", card === null || card === void 0 ? void 0 : card.last4)), /*#__PURE__*/_react.default.createElement(_styles.CardItemActions, null, /*#__PURE__*/_react.default.createElement(_styles.CardItemActionsWrapper, {
|
|
203
231
|
ref: actionWrapperRef
|
|
204
232
|
}, /*#__PURE__*/_react.default.createElement("span", {
|
|
205
233
|
ref: cardActionsRef
|
|
206
|
-
}, /*#__PURE__*/_react.default.createElement(
|
|
234
|
+
}, /*#__PURE__*/_react.default.createElement(_reactBootstrapIcons.Trash, {
|
|
235
|
+
color: theme.colors.lightGray,
|
|
207
236
|
onClick: function onClick() {
|
|
208
|
-
return
|
|
237
|
+
return handleDeleteCard();
|
|
209
238
|
}
|
|
210
|
-
}))
|
|
211
|
-
className: "delete",
|
|
212
|
-
onClick: handleDeleteCard
|
|
213
|
-
}, t('DELETE', 'Delete'))))));
|
|
239
|
+
})))));
|
|
214
240
|
};
|
|
215
241
|
exports.PaymentCard = PaymentCard;
|
|
216
242
|
var PaymentOptionStripe = function PaymentOptionStripe(props) {
|
|
@@ -22,7 +22,9 @@ var CardItem = _styledComponents.default.div(_templateObject4 || (_templateObjec
|
|
|
22
22
|
return isCursor && (0, _styledComponents.css)(_templateObject5 || (_templateObject5 = _taggedTemplateLiteral(["\n cursor: pointer;\n\n &:hover {\n background-color: #F8F9FA;\n }\n "])));
|
|
23
23
|
});
|
|
24
24
|
exports.CardItem = CardItem;
|
|
25
|
-
var CardItemContent = _styledComponents.default.div(_templateObject6 || (_templateObject6 = _taggedTemplateLiteral(["\n display: flex;\n align-items: center;\n\n > div {\n display: flex;\n align-items: center;\n margin
|
|
25
|
+
var CardItemContent = _styledComponents.default.div(_templateObject6 || (_templateObject6 = _taggedTemplateLiteral(["\n display: flex;\n align-items: center;\n \n .checks svg {\n color: ", ";\n font-size: 22px;\n }\n\n > div {\n display: flex;\n align-items: center;\n margin: 0 13px 0 5px;\n ", "\n\n img {\n width: 24px;\n height: 20px;\n }\n }\n\n span {\n font-size: 14px;\n color: ", ";\n }\n"])), function (props) {
|
|
26
|
+
return props.theme.colors.primary;
|
|
27
|
+
}, function (props) {
|
|
26
28
|
var _props$theme2;
|
|
27
29
|
return ((_props$theme2 = props.theme) === null || _props$theme2 === void 0 ? void 0 : _props$theme2.rtl) && (0, _styledComponents.css)(_templateObject7 || (_templateObject7 = _taggedTemplateLiteral(["\n margin-left: 13px;\n margin-right: 0;\n "])));
|
|
28
30
|
}, function (props) {
|