ordering-ui-external 14.1.8 → 14.1.10
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/{7.ordering-ui.8668ba2c7ba56b89cbdd.js → 7.ordering-ui.8deae335e250e653c308.js} +1 -1
- package/_bundles/ordering-ui.8deae335e250e653c308.js +2 -0
- package/_modules/themes/callcenterOriginal/src/components/AddressForm/index.js +27 -10
- package/_modules/themes/callcenterOriginal/src/components/AddressForm/styles.js +3 -5
- package/_modules/themes/callcenterOriginal/src/components/AddressList/index.js +1 -4
- package/_modules/themes/callcenterOriginal/src/components/AddressList/styles.js +1 -1
- package/_modules/themes/callcenterOriginal/src/components/Header/index.js +0 -1
- package/_modules/themes/callcenterOriginal/src/components/Header/styles.js +4 -4
- package/_modules/themes/callcenterOriginal/src/components/InputPhoneNumber/styles.js +1 -1
- package/_modules/themes/callcenterOriginal/src/components/OrderTypeSelectorHeader/styles.js +1 -1
- package/_modules/themes/callcenterOriginal/src/components/PhoneAutocomplete/index.js +20 -18
- package/_modules/themes/callcenterOriginal/src/components/PhoneAutocomplete/styles.js +20 -18
- package/_modules/themes/five/src/components/BusinessPreorder/index.js +3 -1
- package/_modules/themes/five/src/components/BusinessPreorder/styles.js +3 -3
- package/_modules/themes/five/src/components/Cart/index.js +1 -1
- package/_modules/themes/five/src/components/Cart/styles.js +5 -2
- package/_modules/themes/five/src/components/Checkout/index.js +1 -1
- package/_modules/themes/five/src/components/Checkout/styles.js +5 -4
- package/_modules/themes/five/src/components/MomentControl/index.js +3 -1
- package/_modules/themes/five/src/components/MomentControl/styles.js +3 -3
- package/_modules/themes/five/src/components/OrderDetails/index.js +12 -5
- package/_modules/themes/five/src/components/ProductOptionSubOption/index.js +6 -5
- package/_modules/themes/five/src/components/UserFormDetails/index.js +5 -5
- package/package.json +2 -2
- package/src/themes/callcenterOriginal/src/components/AddressForm/index.js +46 -17
- package/src/themes/callcenterOriginal/src/components/AddressForm/styles.js +5 -6
- package/src/themes/callcenterOriginal/src/components/AddressList/index.js +5 -4
- package/src/themes/callcenterOriginal/src/components/AddressList/styles.js +1 -1
- package/src/themes/callcenterOriginal/src/components/Header/index.js +0 -2
- package/src/themes/callcenterOriginal/src/components/Header/styles.js +6 -6
- package/src/themes/callcenterOriginal/src/components/InputPhoneNumber/styles.js +1 -1
- package/src/themes/callcenterOriginal/src/components/OrderTypeSelectorHeader/styles.js +0 -1
- package/src/themes/callcenterOriginal/src/components/PhoneAutocomplete/index.js +14 -16
- package/src/themes/callcenterOriginal/src/components/PhoneAutocomplete/styles.js +10 -6
- package/src/themes/five/src/components/BusinessPreorder/index.js +1 -1
- package/src/themes/five/src/components/BusinessPreorder/styles.js +9 -4
- package/src/themes/five/src/components/Cart/index.js +7 -1
- package/src/themes/five/src/components/Cart/styles.js +6 -0
- package/src/themes/five/src/components/Checkout/index.js +19 -19
- package/src/themes/five/src/components/Checkout/styles.js +8 -0
- package/src/themes/five/src/components/FavoriteList/index.js +9 -8
- package/src/themes/five/src/components/FavoriteList/styles.js +1 -0
- package/src/themes/five/src/components/MomentControl/index.js +1 -1
- package/src/themes/five/src/components/MomentControl/styles.js +9 -4
- package/src/themes/five/src/components/OrderDetails/index.js +38 -3
- package/src/themes/five/src/components/ProductOptionSubOption/index.js +2 -1
- package/src/themes/five/src/components/SingleProductCard/layouts/original/index.js +1 -1
- package/src/themes/five/src/components/UserFormDetails/index.js +2 -4
- package/_bundles/ordering-ui.8668ba2c7ba56b89cbdd.js +0 -2
- /package/_bundles/{0.ordering-ui.8668ba2c7ba56b89cbdd.js → 0.ordering-ui.8deae335e250e653c308.js} +0 -0
- /package/_bundles/{1.ordering-ui.8668ba2c7ba56b89cbdd.js → 1.ordering-ui.8deae335e250e653c308.js} +0 -0
- /package/_bundles/{2.ordering-ui.8668ba2c7ba56b89cbdd.js → 2.ordering-ui.8deae335e250e653c308.js} +0 -0
- /package/_bundles/{4.ordering-ui.8668ba2c7ba56b89cbdd.js → 4.ordering-ui.8deae335e250e653c308.js} +0 -0
- /package/_bundles/{5.ordering-ui.8668ba2c7ba56b89cbdd.js → 5.ordering-ui.8deae335e250e653c308.js} +0 -0
- /package/_bundles/{6.ordering-ui.8668ba2c7ba56b89cbdd.js → 6.ordering-ui.8deae335e250e653c308.js} +0 -0
- /package/_bundles/{7.ordering-ui.8668ba2c7ba56b89cbdd.js.LICENSE.txt → 7.ordering-ui.8deae335e250e653c308.js.LICENSE.txt} +0 -0
- /package/_bundles/{8.ordering-ui.8668ba2c7ba56b89cbdd.js → 8.ordering-ui.8deae335e250e653c308.js} +0 -0
- /package/_bundles/{9.ordering-ui.8668ba2c7ba56b89cbdd.js → 9.ordering-ui.8deae335e250e653c308.js} +0 -0
- /package/_bundles/{ordering-ui.8668ba2c7ba56b89cbdd.js.LICENSE.txt → ordering-ui.8deae335e250e653c308.js.LICENSE.txt} +0 -0
|
@@ -272,7 +272,9 @@ var MomentControlUI = function MomentControlUI(props) {
|
|
|
272
272
|
}, /*#__PURE__*/_react.default.createElement("span", null, cateringPreorder && /*#__PURE__*/_react.default.createElement(_styles.CheckIcon, null, timeSelected === time.value ? /*#__PURE__*/_react.default.createElement(_styles.CheckedIcon, {
|
|
273
273
|
ref: scheduleItemRef,
|
|
274
274
|
cateringPreorder: cateringPreorder
|
|
275
|
-
}) : /*#__PURE__*/_react.default.createElement(_CgRadioCheck.default, null)), /*#__PURE__*/_react.default.createElement("p",
|
|
275
|
+
}) : /*#__PURE__*/_react.default.createElement(_CgRadioCheck.default, null)), /*#__PURE__*/_react.default.createElement("p", {
|
|
276
|
+
id: "time"
|
|
277
|
+
}, time.text, " ", cateringPreorder && "- ".concat(time.endText))));
|
|
276
278
|
})) : /*#__PURE__*/_react.default.createElement(_styles.ClosedBusinessMsg, null, !business ? t('ERROR_SHEDULE_UNAVAILABLE', 'There are no schedules for this date') : t('ERROR_ADD_PRODUCT_BUSINESS_CLOSED', 'The business is closed at the moment')))) : /*#__PURE__*/_react.default.createElement(_CustomLayout.CustomLayout, {
|
|
277
279
|
handleChangeDate: handleChangeDate,
|
|
278
280
|
datesList: datesList,
|
|
@@ -65,19 +65,19 @@ var DayNumber = exports.DayNumber = _styledComponents.default.div(_templateObjec
|
|
|
65
65
|
var isAppoint = _ref7.isAppoint;
|
|
66
66
|
return isAppoint && (0, _styledComponents.css)(_templateObject24 || (_templateObject24 = _taggedTemplateLiteral(["\n font-weight: 400;\n font-size: 16px;\n line-height: 26px;\n "])));
|
|
67
67
|
});
|
|
68
|
-
var TimeItem = exports.TimeItem = _styledComponents.default.div(_templateObject25 || (_templateObject25 = _taggedTemplateLiteral(["\n cursor: pointer;\n display: flex;\n span {\n font-size: 14px;\n white-space: nowrap;\n }\n ", "\n", "\n"])), function (_ref8) {
|
|
68
|
+
var TimeItem = exports.TimeItem = _styledComponents.default.div(_templateObject25 || (_templateObject25 = _taggedTemplateLiteral(["\n cursor: pointer;\n display: flex;\n span {\n font-size: 14px;\n white-space: nowrap;\n\n p#time {\n margin: auto;\n padding: 10px;\n }\n }\n ", "\n", "\n"])), function (_ref8) {
|
|
69
69
|
var active = _ref8.active;
|
|
70
70
|
return active && (0, _styledComponents.css)(_templateObject26 || (_templateObject26 = _taggedTemplateLiteral(["\n background: #F5F9FF;\n color: ", ";\n "])), function (props) {
|
|
71
71
|
return props.theme.colors.primary;
|
|
72
72
|
});
|
|
73
73
|
}, function (_ref9) {
|
|
74
74
|
var cateringPreorder = _ref9.cateringPreorder;
|
|
75
|
-
return cateringPreorder ? (0, _styledComponents.css)(_templateObject27 || (_templateObject27 = _taggedTemplateLiteral(["\n background: #fff;\n width: 100%;\n min-width: 100%;\n height: 50px;\n
|
|
75
|
+
return cateringPreorder ? (0, _styledComponents.css)(_templateObject27 || (_templateObject27 = _taggedTemplateLiteral(["\n background: #fff;\n width: 100%;\n min-width: 100%;\n height: 50px;\n\n span {\n font-size: 18px;\n display: flex;\n align-items: center;\n margin: 10px 0;\n margin-left: 15px;\n p{\n position: relative;\n bottom: 2px;\n }\n }\n ", "\n "])), function (_ref10) {
|
|
76
76
|
var active = _ref10.active;
|
|
77
77
|
return active && (0, _styledComponents.css)(_templateObject28 || (_templateObject28 = _taggedTemplateLiteral(["\n background: #F5F9FF;\n color: ", ";\n span {\n p{\n bottom: 0;\n margin-left: 2px;\n }\n }\n "])), function (props) {
|
|
78
78
|
return props.theme.colors.primary;
|
|
79
79
|
});
|
|
80
|
-
}) : (0, _styledComponents.css)(_templateObject29 || (_templateObject29 = _taggedTemplateLiteral(["\n justify-content: center;\n align-items: center;\n background: #E9ECEF;\n border-radius: 7.6px;\n padding: 5px 15px;\n margin: 12px;\n width: calc(50% - 24px);\n min-width: calc(50% - 24px);\n box-sizing: border-box;\n user-select: none;\n
|
|
80
|
+
}) : (0, _styledComponents.css)(_templateObject29 || (_templateObject29 = _taggedTemplateLiteral(["\n justify-content: center;\n align-items: center;\n background: #E9ECEF;\n border-radius: 7.6px;\n padding: 5px 15px;\n margin: 12px;\n width: calc(50% - 24px);\n min-width: calc(50% - 24px);\n box-sizing: border-box;\n user-select: none;\n\n @media (min-width: 400px) {\n width: calc(33.33% - 24px);\n min-width: calc(33.33% - 24px);\n }\n\n @media (min-width: 576px) {\n width: calc(25% - 24px);\n min-width: calc(25% - 24px);\n }\n\n @media (min-width: 769px) {\n width: calc(33.33% - 24px);\n min-width: calc(33.33% - 24px);\n ", "\n }\n "])), function (_ref11) {
|
|
81
81
|
var isAppoint = _ref11.isAppoint;
|
|
82
82
|
return isAppoint && (0, _styledComponents.css)(_templateObject30 || (_templateObject30 = _taggedTemplateLiteral(["\n width: calc(33.33% - 24px);\n min-width: calc(33.33% - 24px);\n span {\n font-size: 12px;\n }\n "])));
|
|
83
83
|
});
|
|
@@ -59,7 +59,7 @@ function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len
|
|
|
59
59
|
function _iterableToArrayLimit(r, l) { var t = null == r ? null : "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (null != t) { var e, n, i, u, a = [], f = !0, o = !1; try { if (i = (t = t.call(r)).next, 0 === l) { if (Object(t) !== t) return; f = !1; } else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0); } catch (r) { o = !0, n = r; } finally { try { if (!f && null != t.return && (u = t.return(), Object(u) !== u)) return; } finally { if (o) throw n; } } return a; } }
|
|
60
60
|
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
61
61
|
var OrderDetailsUI = function OrderDetailsUI(props) {
|
|
62
|
-
var _configs$google_maps_, _configs$powered_by_o, _configs$alternative_, _configs$change_order, _theme$confirmation, _theme$confirmation2, _theme$confirmation3, _theme$confirmation4, _theme$confirmation5, _theme$confirmation6, _theme$confirmation7, _theme$confirmation8, _theme$confirmation9, _theme$confirmation10, _theme$confirmation11, _theme$confirmation12, _theme$confirmation13, _theme$confirmation14, _theme$confirmation15, _theme$confirmation16, _theme$confirmation17, _theme$confirmation18, _order$driver, _order$driver2, _theme$images, _order$business2, _order$business3, _theme$images2, _order$customer, _order$customer2, _theme$images3, _order$driver3, _order$driver4, _theme$defaultLanguag, _configs$guest_uuid_a, _order$business4, _order$business5, _orderTypes$find, _configs$general_hour, _order$reporting_data, _configs$general_hour2, _order$debug_payment_, _order$debug_payment_2, _progressBarObjt, _progressBarObjt2, _theme$defaultLanguag2, _order$business6, _order$business7, _order$business8, _order$business9, _order$business10, _order$place, _order$place2, _progressBarObjt3, _progressBarObjt4, _order$business12, _order$business13, _progressBarObjt5, _progressBarObjt6, _order$customer3, _order$customer4, _order$customer5, _order$customer6, _order$customer7, _order$customer8, _order$customer9, _order$customer10, _order$customer11, _order$customer12, _order$customer13, _order$customer14, _theme$defaultLanguag3, _order$driver5, _order$driver6, _order$driver7, _order$driver8, _order$driver9, _order$driver10, _order$driver11, _order$driver12, _order$driver13, _order$driver14, _configs$google_maps_2, _order$products$, _order$products$2, _theme$defaultLanguag4, _theme$defaultLanguag5, _theme$defaultLanguag6, _openTaxModal$data, _openTaxModal$data2, _openTaxModal$data3, _openTaxModal$data4, _openTaxModal$data$fi, _openTaxModal$data5, _openTaxModal$data6;
|
|
62
|
+
var _configs$google_maps_, _configs$powered_by_o, _configs$alternative_, _configs$change_order, _theme$confirmation, _theme$confirmation2, _theme$confirmation3, _theme$confirmation4, _theme$confirmation5, _theme$confirmation6, _theme$confirmation7, _theme$confirmation8, _theme$confirmation9, _theme$confirmation10, _theme$confirmation11, _theme$confirmation12, _theme$confirmation13, _theme$confirmation14, _theme$confirmation15, _theme$confirmation16, _theme$confirmation17, _theme$confirmation18, _order$driver, _order$driver2, _theme$images, _order$business2, _order$business3, _theme$images2, _order$customer, _order$customer2, _theme$images3, _order$driver3, _order$driver4, _theme$defaultLanguag, _configs$guest_uuid_a, _order$business4, _order$business5, _orderTypes$find, _configs$general_hour, _order$reporting_data, _configs$general_hour2, _order$debug_payment_, _order$debug_payment_2, _progressBarObjt, _progressBarObjt2, _theme$defaultLanguag2, _order$business6, _order$business7, _order$business8, _order$business9, _order$business10, _order$place, _order$place2, _progressBarObjt3, _progressBarObjt4, _order$business12, _order$business13, _progressBarObjt5, _progressBarObjt6, _order$business14, _order$business15, _order$business16, _order$business17, _order$business18, _order$business19, _order$place3, _order$place4, _order$customer3, _order$customer4, _order$customer5, _order$customer6, _order$customer7, _order$customer8, _order$customer9, _order$customer10, _order$customer11, _order$customer12, _order$customer13, _order$customer14, _theme$defaultLanguag3, _order$driver5, _order$driver6, _order$driver7, _order$driver8, _order$driver9, _order$driver10, _order$driver11, _order$driver12, _order$driver13, _order$driver14, _configs$google_maps_2, _order$products$, _order$products$2, _theme$defaultLanguag4, _theme$defaultLanguag5, _theme$defaultLanguag6, _openTaxModal$data, _openTaxModal$data2, _openTaxModal$data3, _openTaxModal$data4, _openTaxModal$data$fi, _openTaxModal$data5, _openTaxModal$data6;
|
|
63
63
|
var userCustomerId = props.userCustomerId,
|
|
64
64
|
handleChangeOrderStatus = props.handleChangeOrderStatus,
|
|
65
65
|
handleBusinessRedirect = props.handleBusinessRedirect,
|
|
@@ -74,7 +74,8 @@ var OrderDetailsUI = function OrderDetailsUI(props) {
|
|
|
74
74
|
reorderState = props.reorderState,
|
|
75
75
|
handleReorder = props.handleReorder,
|
|
76
76
|
orderTypes = props.orderTypes,
|
|
77
|
-
handleRemoveCart = props.handleRemoveCart
|
|
77
|
+
handleRemoveCart = props.handleRemoveCart,
|
|
78
|
+
hideStaticMap = props.hideStaticMap;
|
|
78
79
|
var _useLanguage = (0, _orderingComponentsExternal.useLanguage)(),
|
|
79
80
|
_useLanguage2 = _slicedToArray(_useLanguage, 2),
|
|
80
81
|
t = _useLanguage2[1];
|
|
@@ -242,8 +243,8 @@ var OrderDetailsUI = function OrderDetailsUI(props) {
|
|
|
242
243
|
}
|
|
243
244
|
try {
|
|
244
245
|
var image = new Image();
|
|
246
|
+
image.onload = resolve;
|
|
245
247
|
image.src = src;
|
|
246
|
-
image.complete ? resolve(true) : resolve(false);
|
|
247
248
|
} catch (err) {
|
|
248
249
|
resolve(false);
|
|
249
250
|
}
|
|
@@ -582,7 +583,7 @@ var OrderDetailsUI = function OrderDetailsUI(props) {
|
|
|
582
583
|
active: [].concat(acceptedStatus, [16]).includes(parseInt(order === null || order === void 0 ? void 0 : order.status, 10)) && (!(order !== null && order !== void 0 && order.review) || order.driver && !(order !== null && order !== void 0 && order.user_review)) && (!isOrderReviewed || !isProductReviewed || isService && !isProReviewed || !isDriverReviewed)
|
|
583
584
|
}, /*#__PURE__*/_react.default.createElement("span", {
|
|
584
585
|
onClick: handleOpenReview
|
|
585
|
-
}, t('REVIEW_ORDER', (theme === null || theme === void 0 || (_theme$defaultLanguag2 = theme.defaultLanguages) === null || _theme$defaultLanguag2 === void 0 ? void 0 : _theme$defaultLanguag2.REVIEW_ORDER) || 'Review your Order'))))))), !isGiftCardOrder && /*#__PURE__*/_react.default.createElement(_styles.OrderBusiness, null, /*#__PURE__*/_react.default.createElement(_styles.BusinessExternalWrapper, null, /*#__PURE__*/_react.default.createElement(_styles.BusinessWrapper, {
|
|
586
|
+
}, t('REVIEW_ORDER', (theme === null || theme === void 0 || (_theme$defaultLanguag2 = theme.defaultLanguages) === null || _theme$defaultLanguag2 === void 0 ? void 0 : _theme$defaultLanguag2.REVIEW_ORDER) || 'Review your Order'))))))), !isGiftCardOrder && !hideStaticMap && /*#__PURE__*/_react.default.createElement(_styles.OrderBusiness, null, /*#__PURE__*/_react.default.createElement(_styles.BusinessExternalWrapper, null, /*#__PURE__*/_react.default.createElement(_styles.BusinessWrapper, {
|
|
586
587
|
w: "calc(100% - 20px)",
|
|
587
588
|
borderTop: !hideDeliveryType && placeSpotTypes.includes(order === null || order === void 0 ? void 0 : order.delivery_type)
|
|
588
589
|
}, isShowBusinessLogo && /*#__PURE__*/_react.default.createElement("img", {
|
|
@@ -644,7 +645,13 @@ var OrderDetailsUI = function OrderDetailsUI(props) {
|
|
|
644
645
|
external: order === null || order === void 0 ? void 0 : order.external_id
|
|
645
646
|
},
|
|
646
647
|
showReview: [].concat(acceptedStatus, [16]).includes(parseInt(order === null || order === void 0 ? void 0 : order.status, 10)) && (!(order !== null && order !== void 0 && order.review) || order.driver && !(order !== null && order !== void 0 && order.user_review)) && (!isOrderReviewed || !isDriverReviewed)
|
|
647
|
-
}), /*#__PURE__*/_react.default.createElement(_styles.OrderCustomer, null, /*#__PURE__*/_react.default.createElement(_styles.WrapperDriver, null,
|
|
648
|
+
}), hideStaticMap && /*#__PURE__*/_react.default.createElement(_styles.OrderCustomer, null, /*#__PURE__*/_react.default.createElement(_styles.WrapperDriver, null, isShowBusinessLogo && (order === null || order === void 0 || (_order$business14 = order.business) === null || _order$business14 === void 0 ? void 0 : _order$business14.logo) && /*#__PURE__*/_react.default.createElement(_styles.PhotoBlock, {
|
|
649
|
+
src: order === null || order === void 0 || (_order$business15 = order.business) === null || _order$business15 === void 0 ? void 0 : _order$business15.logo
|
|
650
|
+
}), /*#__PURE__*/_react.default.createElement("div", null, /*#__PURE__*/_react.default.createElement("p", null, order === null || order === void 0 || (_order$business16 = order.business) === null || _order$business16 === void 0 ? void 0 : _order$business16.name), /*#__PURE__*/_react.default.createElement(_ActionsSection.ActionsSection, _extends({}, ActionsSectionProps, {
|
|
651
|
+
actionType: "business",
|
|
652
|
+
showPhone: !hideBusinessPhone,
|
|
653
|
+
showMessages: !hideBusinessMessages
|
|
654
|
+
})), !hideBusinessEmail && /*#__PURE__*/_react.default.createElement("p", null, order === null || order === void 0 || (_order$business17 = order.business) === null || _order$business17 === void 0 ? void 0 : _order$business17.email), !hideBusinessPhone && /*#__PURE__*/_react.default.createElement("p", null, order === null || order === void 0 || (_order$business18 = order.business) === null || _order$business18 === void 0 ? void 0 : _order$business18.cellphone), !hideBusinessAddress && /*#__PURE__*/_react.default.createElement("p", null, order === null || order === void 0 || (_order$business19 = order.business) === null || _order$business19 === void 0 ? void 0 : _order$business19.address), (order === null || order === void 0 || (_order$place3 = order.place) === null || _order$place3 === void 0 ? void 0 : _order$place3.name) && /*#__PURE__*/_react.default.createElement(_styles.PlaceSpotSection, null, /*#__PURE__*/_react.default.createElement("p", null, yourSpotString, ": ", order === null || order === void 0 || (_order$place4 = order.place) === null || _order$place4 === void 0 ? void 0 : _order$place4.name))))), /*#__PURE__*/_react.default.createElement(_styles.OrderCustomer, null, /*#__PURE__*/_react.default.createElement(_styles.WrapperDriver, null, !hideCustomerPhoto && (order === null || order === void 0 || (_order$customer3 = order.customer) === null || _order$customer3 === void 0 ? void 0 : _order$customer3.photo) && /*#__PURE__*/_react.default.createElement(_styles.PhotoBlock, {
|
|
648
655
|
src: order === null || order === void 0 || (_order$customer4 = order.customer) === null || _order$customer4 === void 0 ? void 0 : _order$customer4.photo
|
|
649
656
|
}), /*#__PURE__*/_react.default.createElement("div", null, /*#__PURE__*/_react.default.createElement("p", null, order === null || order === void 0 || (_order$customer5 = order.customer) === null || _order$customer5 === void 0 ? void 0 : _order$customer5.name, " ", order === null || order === void 0 || (_order$customer6 = order.customer) === null || _order$customer6 === void 0 ? void 0 : _order$customer6.lastname), !hideCustomerEmail && /*#__PURE__*/_react.default.createElement("p", null, order !== null && order !== void 0 && (_order$customer7 = order.customer) !== null && _order$customer7 !== void 0 && _order$customer7.guest_id ? order === null || order === void 0 || (_order$customer8 = order.customer) === null || _order$customer8 === void 0 ? void 0 : _order$customer8.guest_email : order === null || order === void 0 || (_order$customer9 = order.customer) === null || _order$customer9 === void 0 ? void 0 : _order$customer9.email), !hideCustomerPhone && /*#__PURE__*/_react.default.createElement("p", null, order !== null && order !== void 0 && (_order$customer10 = order.customer) !== null && _order$customer10 !== void 0 && _order$customer10.guest_id ? order === null || order === void 0 || (_order$customer11 = order.customer) === null || _order$customer11 === void 0 ? void 0 : _order$customer11.guest_cellphone : (order === null || order === void 0 || (_order$customer12 = order.customer) === null || _order$customer12 === void 0 ? void 0 : _order$customer12.cellphone) || (order === null || order === void 0 || (_order$customer13 = order.customer) === null || _order$customer13 === void 0 ? void 0 : _order$customer13.phone)), !hideCustomerAddress && /*#__PURE__*/_react.default.createElement("p", null, order === null || order === void 0 || (_order$customer14 = order.customer) === null || _order$customer14 === void 0 ? void 0 : _order$customer14.address)))), (order === null || order === void 0 ? void 0 : order.driver) && /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, /*#__PURE__*/_react.default.createElement(_styles.OrderDriver, null, /*#__PURE__*/_react.default.createElement(_styles.SectionTitleContainer, null, /*#__PURE__*/_react.default.createElement("h2", null, t('DRIVER', (theme === null || theme === void 0 || (_theme$defaultLanguag3 = theme.defaultLanguages) === null || _theme$defaultLanguag3 === void 0 ? void 0 : _theme$defaultLanguag3.DRIVER) || 'Driver')), /*#__PURE__*/_react.default.createElement(_ActionsSection.ActionsSection, _extends({}, ActionsSectionProps, {
|
|
650
657
|
actionType: "driver",
|
|
@@ -36,7 +36,7 @@ var ProductOptionSubOptionPropsAreEqual = function ProductOptionSubOptionPropsAr
|
|
|
36
36
|
return JSON.stringify(prevProps.state) === JSON.stringify(nextProps.state) && JSON.stringify(prevProps.pizzaState) === JSON.stringify(nextProps.pizzaState) && prevProps.balance === nextProps.balance && JSON.stringify(prevProps.productCart) === JSON.stringify(nextProps.productCart);
|
|
37
37
|
};
|
|
38
38
|
var ProductOptionSubOptionUI = /*#__PURE__*/_react.default.memo(function (props) {
|
|
39
|
-
var _pizzaState, _pizzaState2, _props$beforeElements, _props$beforeComponen, _option$
|
|
39
|
+
var _pizzaState, _option$name, _option$name$toLowerC, _pizzaState2, _props$beforeElements, _props$beforeComponen, _option$name3, _pizzaState3, _pizzaState4, _props$afterComponent, _props$afterElements;
|
|
40
40
|
var state = props.state,
|
|
41
41
|
increment = props.increment,
|
|
42
42
|
decrement = props.decrement,
|
|
@@ -52,6 +52,7 @@ var ProductOptionSubOptionUI = /*#__PURE__*/_react.default.memo(function (props)
|
|
|
52
52
|
changeQuantity = props.changeQuantity,
|
|
53
53
|
isAlsea = props.isAlsea;
|
|
54
54
|
var disableIncrement = option !== null && option !== void 0 && option.with_half_option ? (pizzaState === null || pizzaState === void 0 || (_pizzaState = pizzaState["option:".concat(option === null || option === void 0 ? void 0 : option.id)]) === null || _pizzaState === void 0 ? void 0 : _pizzaState.value) >= (option === null || option === void 0 ? void 0 : option.max) : option !== null && option !== void 0 && option.limit_suboptions_by_max ? balance === (option === null || option === void 0 ? void 0 : option.max) || state.quantity === suboption.max : state.quantity === (suboption === null || suboption === void 0 ? void 0 : suboption.max) || !state.selected && balance === (option === null || option === void 0 ? void 0 : option.max);
|
|
55
|
+
var quesoYSalsa = (option === null || option === void 0 || (_option$name = option.name) === null || _option$name === void 0 || (_option$name$toLowerC = _option$name.toLowerCase) === null || _option$name$toLowerC === void 0 ? void 0 : _option$name$toLowerC.call(_option$name)) === 'queso y salsa';
|
|
55
56
|
var price = option !== null && option !== void 0 && option.with_half_option && suboption !== null && suboption !== void 0 && suboption.half_price && state.position !== 'whole' ? suboption === null || suboption === void 0 ? void 0 : suboption.half_price : suboption === null || suboption === void 0 ? void 0 : suboption.price;
|
|
56
57
|
var _useLanguage = (0, _orderingComponentsExternal.useLanguage)(),
|
|
57
58
|
_useLanguage2 = _slicedToArray(_useLanguage, 2),
|
|
@@ -119,10 +120,10 @@ var ProductOptionSubOptionUI = /*#__PURE__*/_react.default.memo(function (props)
|
|
|
119
120
|
}, props));
|
|
120
121
|
}), /*#__PURE__*/_react.default.createElement(_styles.Container, {
|
|
121
122
|
onClick: function onClick(e) {
|
|
122
|
-
var _option$
|
|
123
|
-
return (option === null || option === void 0 || (_option$
|
|
123
|
+
var _option$name2;
|
|
124
|
+
return (option === null || option === void 0 || (_option$name2 = option.name) === null || _option$name2 === void 0 ? void 0 : _option$name2.toLowerCase()) === 'queso y salsa' && isAlsea ? handleChangeQuantity(e, state.quantity === 0 ? 1 : 0) : handleSuboptionClick();
|
|
124
125
|
}
|
|
125
|
-
}, /*#__PURE__*/_react.default.createElement(_styles.LeftOptionContainer, null, /*#__PURE__*/_react.default.createElement(_styles.IconControl, null, (option === null || option === void 0 ? void 0 : option.min) === 0 && (option === null || option === void 0 ? void 0 : option.max) === 1 || (option === null || option === void 0 ? void 0 : option.max) > 1 ? state !== null && state !== void 0 && state.selected && !((option === null || option === void 0 || (_option$
|
|
126
|
+
}, /*#__PURE__*/_react.default.createElement(_styles.LeftOptionContainer, null, /*#__PURE__*/_react.default.createElement(_styles.IconControl, null, (option === null || option === void 0 ? void 0 : option.min) === 0 && (option === null || option === void 0 ? void 0 : option.max) === 1 || (option === null || option === void 0 ? void 0 : option.max) > 1 ? state !== null && state !== void 0 && state.selected && !((option === null || option === void 0 || (_option$name3 = option.name) === null || _option$name3 === void 0 ? void 0 : _option$name3.toLowerCase()) === 'queso y salsa' && isAlsea && state.quantity === 0) ? /*#__PURE__*/_react.default.createElement(_MdCheckBox.default, null) : /*#__PURE__*/_react.default.createElement(_MdCheckBoxOutlineBlank.default, {
|
|
126
127
|
disabled: true
|
|
127
128
|
}) : state !== null && state !== void 0 && state.selected ? /*#__PURE__*/_react.default.createElement(_RiRadioButtonFill.default, null) : /*#__PURE__*/_react.default.createElement(_MdRadioButtonUnchecked.default, {
|
|
128
129
|
disabled: true
|
|
@@ -155,7 +156,7 @@ var ProductOptionSubOptionUI = /*#__PURE__*/_react.default.memo(function (props)
|
|
|
155
156
|
onClick: function onClick(e) {
|
|
156
157
|
return handlePosition(e, 'right');
|
|
157
158
|
}
|
|
158
|
-
}))), (option === null || option === void 0 ? void 0 : option.with_half_option) && (state === null || state === void 0 ? void 0 : state.selected) && isAlsea && /*#__PURE__*/_react.default.createElement(_styles.ExtraControl, null, state.quantity >= 2 ? /*#__PURE__*/_react.default.createElement(_styles.ExtraItem, {
|
|
159
|
+
}))), ((option === null || option === void 0 ? void 0 : option.with_half_option) || quesoYSalsa) && (state === null || state === void 0 ? void 0 : state.selected) && isAlsea && /*#__PURE__*/_react.default.createElement(_styles.ExtraControl, null, state.quantity >= 2 ? /*#__PURE__*/_react.default.createElement(_styles.ExtraItem, {
|
|
159
160
|
onClick: function onClick(e) {
|
|
160
161
|
return handleChangeQuantity(e, 1);
|
|
161
162
|
}
|
|
@@ -43,7 +43,7 @@ function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len
|
|
|
43
43
|
function _iterableToArrayLimit(r, l) { var t = null == r ? null : "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (null != t) { var e, n, i, u, a = [], f = !0, o = !1; try { if (i = (t = t.call(r)).next, 0 === l) { if (Object(t) !== t) return; f = !1; } else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0); } catch (r) { o = !0, n = r; } finally { try { if (!f && null != t.return && (u = t.return(), Object(u) !== u)) return; } finally { if (o) throw n; } } return a; } }
|
|
44
44
|
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
45
45
|
var UserFormDetailsUI = exports.UserFormDetailsUI = function UserFormDetailsUI(props) {
|
|
46
|
-
var _formState$result, _formState$result2, _formState$changes$se, _formState$changes, _user$settings, _formState$result3, _formState$result4, _formState$changes$se2, _formState$changes2, _user$settings2, _formState$result5, _formState$result6, _formState$changes$se3, _formState$changes3, _user$settings3, _theme$profile, _theme$profile2, _theme$profile3, _theme$profile4, _theme$profile5, _checkoutFields$find, _validationFields$fie, _validationFields$fie2, _checkoutFields$find2, _validationFields$fie3, _validationFields$fie4, _configs$verification3, _props$beforeElements, _props$beforeComponen, _props$beforeMidEleme, _props$beforeMidCompo, _validationFields$
|
|
46
|
+
var _formState$result, _formState$result2, _formState$changes$se, _formState$changes, _user$settings, _formState$result3, _formState$result4, _formState$changes$se2, _formState$changes2, _user$settings2, _formState$result5, _formState$result6, _formState$changes$se3, _formState$changes3, _user$settings3, _theme$profile, _theme$profile2, _theme$profile3, _theme$profile4, _theme$profile5, _checkoutFields$find, _validationFields$fie, _validationFields$fie2, _checkoutFields$find2, _validationFields$fie3, _validationFields$fie4, _configs$verification3, _props$beforeElements, _props$beforeComponen, _props$beforeMidEleme, _props$beforeMidCompo, _validationFields$fie7, _requiredFields$inclu6, _requiredFields$inclu7, _props$afterMidElemen, _props$afterMidCompon, _props$afterComponent, _props$afterElements;
|
|
47
47
|
var isEdit = props.isEdit,
|
|
48
48
|
formState = props.formState,
|
|
49
49
|
onCancel = props.onCancel,
|
|
@@ -182,14 +182,14 @@ var UserFormDetailsUI = exports.UserFormDetailsUI = function UserFormDetailsUI(p
|
|
|
182
182
|
setUserPhoneNumber(cellphone || '');
|
|
183
183
|
};
|
|
184
184
|
var onSubmit = function onSubmit() {
|
|
185
|
-
var _requiredFields$inclu, _validationFields$fie5, _validationFields$fie6, _requiredFields$inclu2,
|
|
185
|
+
var _requiredFields$inclu, _validationFields$fie5, _validationFields$fie6, _requiredFields$inclu2, _configs$verification;
|
|
186
186
|
var isPhoneNumberValid = userPhoneNumber && showInputPhoneNumber ? isValidPhoneNumber : true;
|
|
187
|
-
var requiredPhone = (user === null || user === void 0 ? void 0 : user.guest_id) && (requiredFields === null || requiredFields === void 0 || (_requiredFields$inclu = requiredFields.includes) === null || _requiredFields$inclu === void 0 ? void 0 : _requiredFields$inclu.call(requiredFields, 'cellphone')) || (validationFields === null || validationFields === void 0 || (_validationFields$fie5 = validationFields.fields) === null || _validationFields$fie5 === void 0 || (_validationFields$fie5 = _validationFields$fie5.checkout) === null || _validationFields$fie5 === void 0 || (_validationFields$fie5 = _validationFields$fie5.cellphone) === null || _validationFields$fie5 === void 0 ? void 0 : _validationFields$fie5.enabled) && (validationFields === null || validationFields === void 0 || (_validationFields$fie6 = validationFields.fields) === null || _validationFields$fie6 === void 0 || (_validationFields$fie6 = _validationFields$fie6.checkout) === null || _validationFields$fie6 === void 0 || (_validationFields$fie6 = _validationFields$fie6.cellphone) === null || _validationFields$fie6 === void 0 ? void 0 : _validationFields$fie6.required);
|
|
187
|
+
var requiredPhone = (user === null || user === void 0 ? void 0 : user.guest_id) && (requiredFields === null || requiredFields === void 0 || (_requiredFields$inclu = requiredFields.includes) === null || _requiredFields$inclu === void 0 ? void 0 : _requiredFields$inclu.call(requiredFields, 'cellphone')) || (validationFields === null || validationFields === void 0 || (_validationFields$fie5 = validationFields.fields) === null || _validationFields$fie5 === void 0 || (_validationFields$fie5 = _validationFields$fie5.checkout) === null || _validationFields$fie5 === void 0 || (_validationFields$fie5 = _validationFields$fie5.cellphone) === null || _validationFields$fie5 === void 0 ? void 0 : _validationFields$fie5.enabled) && (validationFields === null || validationFields === void 0 || (_validationFields$fie6 = validationFields.fields) === null || _validationFields$fie6 === void 0 || (_validationFields$fie6 = _validationFields$fie6.checkout) === null || _validationFields$fie6 === void 0 || (_validationFields$fie6 = _validationFields$fie6.cellphone) === null || _validationFields$fie6 === void 0 ? void 0 : _validationFields$fie6.required) && !(user !== null && user !== void 0 && user.guest_id);
|
|
188
188
|
var content = [];
|
|
189
189
|
if (requiredFields !== null && requiredFields !== void 0 && (_requiredFields$inclu2 = requiredFields.includes) !== null && _requiredFields$inclu2 !== void 0 && _requiredFields$inclu2.call(requiredFields, 'birthdate') && !birthdate) {
|
|
190
190
|
content.push(t('VALIDATION_ERROR_BIRTHDATE_REQUIRED', 'Birthdate is required'));
|
|
191
191
|
}
|
|
192
|
-
if (!userPhoneNumber && (
|
|
192
|
+
if (!userPhoneNumber && (requiredPhone || (configs === null || configs === void 0 || (_configs$verification = configs.verification_phone_required) === null || _configs$verification === void 0 ? void 0 : _configs$verification.value) === '1')) {
|
|
193
193
|
content.push(t('VALIDATION_ERROR_MOBILE_PHONE_REQUIRED', 'The field Phone Number is required.'));
|
|
194
194
|
setAlertState({
|
|
195
195
|
open: true,
|
|
@@ -369,7 +369,7 @@ var UserFormDetailsUI = exports.UserFormDetailsUI = function UserFormDetailsUI(p
|
|
|
369
369
|
key: i
|
|
370
370
|
}, props));
|
|
371
371
|
}), (0, _utils.sortInputFields)({
|
|
372
|
-
values: isOrderTypeValidationField ? checkoutFields : validationFields === null || validationFields === void 0 || (_validationFields$
|
|
372
|
+
values: isOrderTypeValidationField ? checkoutFields : validationFields === null || validationFields === void 0 || (_validationFields$fie7 = validationFields.fields) === null || _validationFields$fie7 === void 0 ? void 0 : _validationFields$fie7.checkout
|
|
373
373
|
}).map(function (item) {
|
|
374
374
|
var _requiredFields$inclu4, _ref2, _formState$changes$fi, _requiredFields$inclu5, _ref3, _formState$changes$fi2;
|
|
375
375
|
var field = (item === null || item === void 0 ? void 0 : item.validation_field) || item;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "ordering-ui-external",
|
|
3
|
-
"version": "14.1.
|
|
3
|
+
"version": "14.1.10",
|
|
4
4
|
"description": "Ordering UI Components",
|
|
5
5
|
"main": "./_modules/index.js",
|
|
6
6
|
"exports": {
|
|
@@ -88,7 +88,7 @@
|
|
|
88
88
|
"lodash": "^4.17.19",
|
|
89
89
|
"moment": "^2.29.4",
|
|
90
90
|
"nanoid": "^4.0.0",
|
|
91
|
-
"ordering-components-external": "13.0.
|
|
91
|
+
"ordering-components-external": "13.0.21",
|
|
92
92
|
"payment": "^2.4.6",
|
|
93
93
|
"polished": "^3.6.6",
|
|
94
94
|
"react-bootstrap-icons": "^1.7.2",
|
|
@@ -69,6 +69,7 @@ const AddressFormUI = (props) => {
|
|
|
69
69
|
const [alertState, setAlertState] = useState({ open: false, content: [] })
|
|
70
70
|
const [addressValue, setAddressValue] = useState(formState.changes?.address ?? addressState.address?.address ?? '')
|
|
71
71
|
const [firstLocationNoEdit, setFirstLocationNoEdit] = useState({ value: null })
|
|
72
|
+
const [showMap, setShowMap] = useState(false)
|
|
72
73
|
const isEditing = !!addressState.address?.id
|
|
73
74
|
const googleInputRef = useRef()
|
|
74
75
|
|
|
@@ -438,23 +439,51 @@ const AddressFormUI = (props) => {
|
|
|
438
439
|
/>
|
|
439
440
|
</AddressWrap>
|
|
440
441
|
|
|
441
|
-
{
|
|
442
|
-
<WrapperMap
|
|
443
|
-
|
|
444
|
-
|
|
445
|
-
|
|
446
|
-
|
|
447
|
-
|
|
448
|
-
|
|
449
|
-
|
|
450
|
-
|
|
451
|
-
|
|
452
|
-
|
|
453
|
-
|
|
454
|
-
|
|
455
|
-
|
|
456
|
-
|
|
457
|
-
|
|
442
|
+
{(addressState?.address?.location || formState?.changes?.location) && (
|
|
443
|
+
<WrapperMap notUseCustomerInfo={notUseCustomerInfo} addFormRestrictions={addFormRestrictions}>
|
|
444
|
+
{!showMap && (
|
|
445
|
+
<section>
|
|
446
|
+
<GeoAlt style={{ fontSize: 25, marginRight: 5 }} />
|
|
447
|
+
{(addressState?.address?.address || formState?.changes?.address) && (
|
|
448
|
+
<span>{addressState?.address?.address || formState?.changes?.address}{', '}</span>
|
|
449
|
+
)}
|
|
450
|
+
{(addressState?.address?.country || formState?.changes?.country) && (
|
|
451
|
+
<span>{addressState?.address?.country || formState?.changes?.country}{', '}</span>
|
|
452
|
+
)}
|
|
453
|
+
{(addressState?.address?.address_notes || formState?.changes?.address_notes) && (
|
|
454
|
+
<span>{addressState?.address?.address_notes || formState?.changes?.address_notes}{', '}</span>
|
|
455
|
+
)}
|
|
456
|
+
{(addressState?.address?.internal_number || formState?.changes?.internal_number) && (
|
|
457
|
+
<span>{addressState?.address?.internal_number || formState?.changes?.internal_number}{', '}</span>
|
|
458
|
+
)}
|
|
459
|
+
{(addressState?.address?.zipcode || formState?.changes?.zipcode) && (
|
|
460
|
+
<span>{addressState?.address?.zipcode || formState?.changes?.zipcode}{', '}</span>
|
|
461
|
+
)}
|
|
462
|
+
<a
|
|
463
|
+
style={{ textDecoration: 'underline', color: 'blue', cursor: 'pointer' }}
|
|
464
|
+
onClick={() => setShowMap(!showMap)}
|
|
465
|
+
>
|
|
466
|
+
{t('SHOW_MAP', 'Show Map')}
|
|
467
|
+
</a>
|
|
468
|
+
</section>
|
|
469
|
+
)}
|
|
470
|
+
{locationChange && showMap && (
|
|
471
|
+
<GoogleMapsMap
|
|
472
|
+
useMapWithBusinessZones
|
|
473
|
+
deactiveAlerts
|
|
474
|
+
avoidFitBounds
|
|
475
|
+
apiKey={googleMapsApiKey}
|
|
476
|
+
location={locationChange}
|
|
477
|
+
locations={businessesList?.businesses}
|
|
478
|
+
fixedLocation={!isEditing ? firstLocationNoEdit.value : null}
|
|
479
|
+
mapControls={googleMapsControls}
|
|
480
|
+
handleChangeAddressMap={handleChangeAddress}
|
|
481
|
+
setErrors={setMapErrors}
|
|
482
|
+
maxLimitLocation={parseInt(maxLimitLocation, 10)}
|
|
483
|
+
businessZones={businessesList?.businesses?.map(business => business?.zones)}
|
|
484
|
+
fallbackIcon={theme.images?.dummies?.businessLogo}
|
|
485
|
+
/>
|
|
486
|
+
)}
|
|
458
487
|
</WrapperMap>
|
|
459
488
|
)}
|
|
460
489
|
</React.Fragment>
|
|
@@ -204,12 +204,11 @@ export const WrapperMap = styled.div`
|
|
|
204
204
|
bottom: 2%;
|
|
205
205
|
right: 0;
|
|
206
206
|
padding-right: 20px;
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
: '480px'
|
|
207
|
+
padding-top: 30px;
|
|
208
|
+
height: ${({ notUseCustomerInfo }) =>
|
|
209
|
+
notUseCustomerInfo
|
|
210
|
+
? '370px'
|
|
211
|
+
: '480px'
|
|
213
212
|
};
|
|
214
213
|
|
|
215
214
|
> div {
|
|
@@ -227,7 +227,6 @@ const AddressListUI = (props) => {
|
|
|
227
227
|
halfWidth={addressOpen}
|
|
228
228
|
isOpenUserData={isOpenUserData}
|
|
229
229
|
isHeader={isHeader}
|
|
230
|
-
isEnableContinueButton={isEnableContinueButton}
|
|
231
230
|
notUseCustomerInfo={notUseCustomerInfo}
|
|
232
231
|
addFormRestrictions={addFormRestrictions}
|
|
233
232
|
>
|
|
@@ -236,7 +235,7 @@ const AddressListUI = (props) => {
|
|
|
236
235
|
<Button
|
|
237
236
|
className='add'
|
|
238
237
|
outline
|
|
239
|
-
color={
|
|
238
|
+
color={addressList?.addresses?.length > 0 ? 'secondary' : 'primary'}
|
|
240
239
|
onClick={() => openAddress({})}
|
|
241
240
|
disabled={orderState?.loading || actionStatus.loading}
|
|
242
241
|
hoverColor='#CCC'
|
|
@@ -344,7 +343,6 @@ const AddressListUI = (props) => {
|
|
|
344
343
|
onCancel={() => handleCloseAddressForm()}
|
|
345
344
|
onSaveAddress={handleSaveAddress}
|
|
346
345
|
userCustomerSetup={userCustomerSetup}
|
|
347
|
-
isEnableContinueButton={isEnableContinueButton}
|
|
348
346
|
notUseCustomerInfo={notUseCustomerInfo}
|
|
349
347
|
franchiseId={franchiseId}
|
|
350
348
|
addFormRestrictions={addFormRestrictions}
|
|
@@ -353,7 +351,10 @@ const AddressListUI = (props) => {
|
|
|
353
351
|
)}
|
|
354
352
|
</List>
|
|
355
353
|
{addressOpen && !notUseCustomerInfo && (
|
|
356
|
-
<AddressFormContainer
|
|
354
|
+
<AddressFormContainer
|
|
355
|
+
width='50%'
|
|
356
|
+
addFormRestrictions={addFormRestrictions}
|
|
357
|
+
>
|
|
357
358
|
<TitleFormContainer>
|
|
358
359
|
{!addFormRestrictions && (
|
|
359
360
|
<CloseIcon>
|
|
@@ -221,7 +221,7 @@ export const AddressFormContainer = styled.div`
|
|
|
221
221
|
`}
|
|
222
222
|
${({ isEnableContinueButton, addFormRestrictions }) => isEnableContinueButton && css`
|
|
223
223
|
position: relative;
|
|
224
|
-
bottom:
|
|
224
|
+
bottom: 164px;
|
|
225
225
|
`}
|
|
226
226
|
`
|
|
227
227
|
|
|
@@ -4,7 +4,6 @@ import { useLocation } from 'react-router-dom'
|
|
|
4
4
|
import { useSession, useLanguage, useOrder, useEvent, useConfig, useCustomer, useUtils } from 'ordering-components-external'
|
|
5
5
|
import { useTheme } from 'styled-components'
|
|
6
6
|
import { GeoAlt } from 'react-bootstrap-icons'
|
|
7
|
-
import TiWarningOutline from '@meronex/icons/ti/TiWarningOutline'
|
|
8
7
|
import { OrderTypeSelectorContent } from '../OrderTypeSelectorContent'
|
|
9
8
|
import { LanguageSelector } from '../LanguageSelector'
|
|
10
9
|
import AiOutlineClose from '@meronex/icons/ai/AiOutlineClose'
|
|
@@ -22,7 +21,6 @@ import {
|
|
|
22
21
|
UserEdit,
|
|
23
22
|
AddressMenu,
|
|
24
23
|
MomentMenu,
|
|
25
|
-
FarAwayMessage,
|
|
26
24
|
Divider
|
|
27
25
|
} from './styles'
|
|
28
26
|
import { useWindowSize } from '../../../../../hooks/useWindowSize'
|
|
@@ -123,7 +123,7 @@ export const Menu = styled.div`
|
|
|
123
123
|
margin-left: 35px;
|
|
124
124
|
margin-right: 10px;
|
|
125
125
|
}
|
|
126
|
-
|
|
126
|
+
|
|
127
127
|
@media (min-width: 1200px) {
|
|
128
128
|
padding: 0 30px;
|
|
129
129
|
margin-left: 50px;
|
|
@@ -157,7 +157,7 @@ export const Menu = styled.div`
|
|
|
157
157
|
@media (min-width: 1175px) {
|
|
158
158
|
width: 250px;
|
|
159
159
|
}
|
|
160
|
-
|
|
160
|
+
|
|
161
161
|
@media (min-width: 1400px) {
|
|
162
162
|
width: 400px;
|
|
163
163
|
}
|
|
@@ -262,8 +262,8 @@ export const CustomerInfo = styled.div`
|
|
|
262
262
|
color: #909BA9;
|
|
263
263
|
margin: 0;
|
|
264
264
|
}
|
|
265
|
-
svg {
|
|
266
|
-
color: #748194;
|
|
265
|
+
svg {
|
|
266
|
+
color: #748194;
|
|
267
267
|
margin: 0;
|
|
268
268
|
font-size: 20px;
|
|
269
269
|
}
|
|
@@ -277,7 +277,7 @@ export const UserEdit = styled.div`
|
|
|
277
277
|
width: 100%;
|
|
278
278
|
${props => !props.isOpenUserData && css`
|
|
279
279
|
position: absolute;
|
|
280
|
-
`
|
|
280
|
+
`}
|
|
281
281
|
}
|
|
282
282
|
`
|
|
283
283
|
|
|
@@ -326,7 +326,7 @@ export const MomentMenu = styled.div`
|
|
|
326
326
|
justify-content: center;
|
|
327
327
|
width: 200px;
|
|
328
328
|
display: none;
|
|
329
|
-
|
|
329
|
+
|
|
330
330
|
@media (min-width: 821px) {
|
|
331
331
|
display: flex;
|
|
332
332
|
}
|
|
@@ -4,7 +4,6 @@ import {
|
|
|
4
4
|
PhoneAutocomplete as PhoneAutocompleteController,
|
|
5
5
|
useLanguage,
|
|
6
6
|
useOrder,
|
|
7
|
-
useCustomer,
|
|
8
7
|
useConfig,
|
|
9
8
|
useEvent
|
|
10
9
|
} from 'ordering-components-external'
|
|
@@ -62,7 +61,6 @@ const PhoneAutocompleteUI = (props) => {
|
|
|
62
61
|
const [orderState, { changeType }] = useOrder()
|
|
63
62
|
const [, t] = useLanguage()
|
|
64
63
|
const theme = useTheme()
|
|
65
|
-
const [, { deleteUserCustomer }] = useCustomer()
|
|
66
64
|
const [configState] = useConfig()
|
|
67
65
|
const [events] = useEvent()
|
|
68
66
|
const [alertState, setAlertState] = useState({ open: false, content: [] })
|
|
@@ -78,7 +76,7 @@ const PhoneAutocompleteUI = (props) => {
|
|
|
78
76
|
value: userCustomer.cellphone || userCustomer.phone,
|
|
79
77
|
label: `${countryPhoneCode ? `(${countryPhoneCode})` : ''} ${userCustomer?.phone && !userCustomer?.cellphone ? `${userCustomer?.phone}` : ''} ${userCustomer?.cellphone ? `${userCustomer.cellphone}` : ''} - {${userCustomer.name}}`,
|
|
80
78
|
flag: userCustomer?.imported_address_text && userCustomer?.addresses?.length === 0,
|
|
81
|
-
lastname: userCustomer.lastname
|
|
79
|
+
lastname: `${userCustomer.name} ${userCustomer.lastname}`
|
|
82
80
|
} : null)
|
|
83
81
|
const configTypes = configState?.configs?.order_types_allowed?.value.split('|').filter(value => (allOrderTypes.includes(Number(value)))).map(value => Number(value)) || []
|
|
84
82
|
const userName = userCustomer?.lastname
|
|
@@ -99,8 +97,7 @@ const PhoneAutocompleteUI = (props) => {
|
|
|
99
97
|
const handleFindClick = () => {
|
|
100
98
|
if (optSelected && !(userCustomer?.id && orderState?.options?.address?.address)) {
|
|
101
99
|
onChange(optSelected)
|
|
102
|
-
}
|
|
103
|
-
else if (userCustomer?.id && orderState?.options?.address?.address) {
|
|
100
|
+
} else if (userCustomer?.id && orderState?.options?.address?.address) {
|
|
104
101
|
onRedirectPage && onRedirectPage('search')
|
|
105
102
|
} else {
|
|
106
103
|
setAlertState({ open: true, content: t('SELECT_ADDRESS_CUSTOMER', 'Please select an address for the selected customer') })
|
|
@@ -142,6 +139,7 @@ const PhoneAutocompleteUI = (props) => {
|
|
|
142
139
|
setOptSelected(null)
|
|
143
140
|
setCustomersPhones({ ...customersPhones, users: [] })
|
|
144
141
|
setInputValue('')
|
|
142
|
+
onChangeNumber('')
|
|
145
143
|
return
|
|
146
144
|
}
|
|
147
145
|
let user
|
|
@@ -150,7 +148,7 @@ const PhoneAutocompleteUI = (props) => {
|
|
|
150
148
|
}
|
|
151
149
|
setOptSelected({
|
|
152
150
|
...option,
|
|
153
|
-
lastname: user?.
|
|
151
|
+
lastname: `${user?.name} ${user?.lastname}`
|
|
154
152
|
})
|
|
155
153
|
setInputValue(option ? option?.value : '')
|
|
156
154
|
if (!option) {
|
|
@@ -182,7 +180,6 @@ const PhoneAutocompleteUI = (props) => {
|
|
|
182
180
|
const handleCloseAddressList = () => {
|
|
183
181
|
setOpenModal({ ...openModal, customer: false })
|
|
184
182
|
setCustomerState({ ...customerState, result: { error: false } })
|
|
185
|
-
deleteUserCustomer(true)
|
|
186
183
|
if (isFromUrlPhone) {
|
|
187
184
|
onRedirectPhoneUrlPage && onRedirectPhoneUrlPage('home')
|
|
188
185
|
}
|
|
@@ -198,7 +195,7 @@ const PhoneAutocompleteUI = (props) => {
|
|
|
198
195
|
const countryPhoneCode = user?.country_phone_code ?? user?.country_code
|
|
199
196
|
const obj = {}
|
|
200
197
|
obj.value = user.cellphone || user.phone
|
|
201
|
-
obj.label = `${countryPhoneCode ? `(${countryPhoneCode})` : ''} ${user?.phone && !user?.cellphone ? `${user?.phone}` : ''} ${user?.cellphone ? `${user.cellphone}` : ''} - {${user.name}}`
|
|
198
|
+
obj.label = `${countryPhoneCode ? `(${countryPhoneCode})` : ''} ${user?.phone && !user?.cellphone ? `${user?.phone}` : ''} ${user?.cellphone ? `${user.cellphone}` : ''} - {${user.name} ${user?.lastname ?? ''}}`
|
|
202
199
|
obj.flag = user?.imported_address_text && user?.addresses?.length === 0
|
|
203
200
|
return obj
|
|
204
201
|
}) || []
|
|
@@ -329,7 +326,7 @@ const PhoneAutocompleteUI = (props) => {
|
|
|
329
326
|
onChange={onChange}
|
|
330
327
|
onInputChange={onInputChange}
|
|
331
328
|
isLoading={customersPhones?.loading}
|
|
332
|
-
options={optionsToSelect}
|
|
329
|
+
options={optionsToSelect.filter(opt => inputValue ? opt.value.toString().includes(inputValue) : opt)}
|
|
333
330
|
components={{ Option }}
|
|
334
331
|
/>
|
|
335
332
|
{optSelected && (
|
|
@@ -352,7 +349,7 @@ const PhoneAutocompleteUI = (props) => {
|
|
|
352
349
|
onClose={() => setOpenModal({ ...openModal, signup: false })}
|
|
353
350
|
>
|
|
354
351
|
<SignUpForm
|
|
355
|
-
externalPhoneNumber={`${
|
|
352
|
+
externalPhoneNumber={`${countryCallingCode || localPhoneCode} ${optSelected?.value || phone}`}
|
|
356
353
|
saveCustomerUser={saveCustomerUser}
|
|
357
354
|
fieldsNotValid={props.fieldsNotValid}
|
|
358
355
|
useChekoutFileds
|
|
@@ -367,17 +364,19 @@ const PhoneAutocompleteUI = (props) => {
|
|
|
367
364
|
hideCloseDefault
|
|
368
365
|
padding='20px'
|
|
369
366
|
>
|
|
370
|
-
<UserEdit>
|
|
367
|
+
<UserEdit isOpenUserData={isOpenUserData}>
|
|
371
368
|
{!customerState?.loading && !customersPhones?.loading && (
|
|
372
369
|
<>
|
|
373
370
|
<UserDetails
|
|
374
371
|
isAddressFormOpen={isAddressFormOpen}
|
|
375
|
-
|
|
372
|
+
userData={customerState?.result}
|
|
376
373
|
userId={customerState?.result?.id}
|
|
374
|
+
isOpenUserData={isOpenUserData}
|
|
377
375
|
isCustomerMode
|
|
378
376
|
isModal
|
|
379
377
|
setIsOpenUserData={setIsOpenUserData}
|
|
380
378
|
onClose={() => handleCloseAddressList()}
|
|
379
|
+
franchiseId={franchiseId}
|
|
381
380
|
/>
|
|
382
381
|
<AddressList
|
|
383
382
|
isModal
|
|
@@ -388,14 +387,13 @@ const PhoneAutocompleteUI = (props) => {
|
|
|
388
387
|
phone,
|
|
389
388
|
urlPhone
|
|
390
389
|
}}
|
|
391
|
-
isEnableContinueButton
|
|
392
|
-
isCustomerMode
|
|
393
|
-
isFromPhoneAutocomplete
|
|
394
390
|
isOpenUserData={isOpenUserData}
|
|
391
|
+
isEnableContinueButton
|
|
395
392
|
setIsOpenUserData={setIsOpenUserData}
|
|
393
|
+
setIsSavedAddress={setIsSavedAddress}
|
|
396
394
|
setIsAddressFormOpen={setIsAddressFormOpen}
|
|
397
395
|
franchiseId={franchiseId}
|
|
398
|
-
|
|
396
|
+
isHeader
|
|
399
397
|
/>
|
|
400
398
|
</>
|
|
401
399
|
)}
|
|
@@ -201,7 +201,7 @@ export const WrapInput = styled.div`
|
|
|
201
201
|
width: calc(50% - 20px);
|
|
202
202
|
}
|
|
203
203
|
`}
|
|
204
|
-
|
|
204
|
+
|
|
205
205
|
div{
|
|
206
206
|
color: #FFF;
|
|
207
207
|
position: relative;
|
|
@@ -234,17 +234,21 @@ export const WrapInput = styled.div`
|
|
|
234
234
|
`
|
|
235
235
|
|
|
236
236
|
export const AutoComplete = styled.div`
|
|
237
|
-
width: 45%;
|
|
237
|
+
width: 45%;
|
|
238
238
|
button {
|
|
239
239
|
position: absolute;
|
|
240
240
|
left: 100%;
|
|
241
|
-
transform: translate(-90%, -165%)
|
|
241
|
+
transform: translate(-90%, -165%);
|
|
242
242
|
}
|
|
243
243
|
`
|
|
244
244
|
|
|
245
245
|
export const UserEdit = styled.div`
|
|
246
|
-
> :first-child{
|
|
247
|
-
margin-bottom: 20px;
|
|
246
|
+
> :first-child {
|
|
247
|
+
margin-bottom: 20px;
|
|
248
|
+
width: 100%;
|
|
249
|
+
${props => !props.isOpenUserData && css`
|
|
250
|
+
position: absolute;
|
|
251
|
+
`}
|
|
248
252
|
}
|
|
249
253
|
`
|
|
250
254
|
|
|
@@ -394,7 +398,7 @@ export const ContinueButton = styled.span`
|
|
|
394
398
|
position: absolute;
|
|
395
399
|
right: 35px;
|
|
396
400
|
bottom: 5px;
|
|
397
|
-
width:
|
|
401
|
+
width:
|
|
398
402
|
button {
|
|
399
403
|
cursor: pointer;
|
|
400
404
|
}
|
|
@@ -291,7 +291,7 @@ const BusinessPreorderUI = (props) => {
|
|
|
291
291
|
{timeSelected === time.value ? <CheckedIcon cateringPreorder={cateringPreorder} /> : <CgRadioCheck />}
|
|
292
292
|
</CheckIcon>
|
|
293
293
|
)}
|
|
294
|
-
<p>
|
|
294
|
+
<p id='time'>
|
|
295
295
|
{time.text} {cateringPreorder && `- ${time.endText}`}
|
|
296
296
|
</p>
|
|
297
297
|
</span>
|