ordering-ui-external 10.4.0 → 10.5.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.
Files changed (80) hide show
  1. package/_bundles/{0.ordering-ui.487a31b3537d90f69a9d.js → 0.ordering-ui.cc1d13aa04732fde3671.js} +1 -1
  2. package/_bundles/{1.ordering-ui.487a31b3537d90f69a9d.js → 1.ordering-ui.cc1d13aa04732fde3671.js} +1 -1
  3. package/_bundles/{2.ordering-ui.487a31b3537d90f69a9d.js → 2.ordering-ui.cc1d13aa04732fde3671.js} +1 -1
  4. package/_bundles/{4.ordering-ui.487a31b3537d90f69a9d.js → 4.ordering-ui.cc1d13aa04732fde3671.js} +1 -1
  5. package/_bundles/{5.ordering-ui.487a31b3537d90f69a9d.js → 5.ordering-ui.cc1d13aa04732fde3671.js} +1 -1
  6. package/_bundles/{6.ordering-ui.487a31b3537d90f69a9d.js → 6.ordering-ui.cc1d13aa04732fde3671.js} +1 -1
  7. package/_bundles/{7.ordering-ui.487a31b3537d90f69a9d.js → 7.ordering-ui.cc1d13aa04732fde3671.js} +2 -2
  8. package/_bundles/{8.ordering-ui.487a31b3537d90f69a9d.js → 8.ordering-ui.cc1d13aa04732fde3671.js} +1 -1
  9. package/_bundles/{9.ordering-ui.487a31b3537d90f69a9d.js → 9.ordering-ui.cc1d13aa04732fde3671.js} +1 -1
  10. package/_bundles/ordering-ui.cc1d13aa04732fde3671.js +2 -0
  11. package/_modules/themes/callcenterOriginal/src/components/Orders/DeliveriesManager/index.js +4 -2
  12. package/_modules/themes/callcenterOriginal/src/components/Orders/OrdersDashboardControls/index.js +3 -1
  13. package/_modules/themes/callcenterOriginal/src/components/Orders/OrdersManager/index.js +2 -0
  14. package/_modules/themes/five/src/components/BusinessItemAccordion/index.js +5 -2
  15. package/_modules/themes/five/src/components/BusinessItemAccordion/styles.js +25 -19
  16. package/_modules/themes/five/src/components/BusinessProductsList/index.js +35 -13
  17. package/_modules/themes/five/src/components/BusinessProductsList/styles.js +7 -3
  18. package/_modules/themes/five/src/components/BusinessProductsListing/index.js +2 -0
  19. package/_modules/themes/five/src/components/BusinessesListing/layouts/OriginalBusinessesListing/index.js +133 -31
  20. package/_modules/themes/five/src/components/BusinessesListing/layouts/OriginalBusinessesListing/styles.js +37 -3
  21. package/_modules/themes/five/src/components/Cart/index.js +10 -6
  22. package/_modules/themes/five/src/components/Checkout/index.js +67 -22
  23. package/_modules/themes/five/src/components/GiftCard/GiftCardOrdersList/index.js +53 -0
  24. package/_modules/themes/five/src/components/GiftCard/GiftCardOrdersList/styles.js +16 -0
  25. package/_modules/themes/five/src/components/GiftCard/HorizontalGiftCardOrdersLayout/index.js +69 -0
  26. package/_modules/themes/five/src/components/GiftCard/HorizontalGiftCardOrdersLayout/styles.js +16 -0
  27. package/_modules/themes/five/src/components/GiftCard/SingleGiftCard/index.js +90 -0
  28. package/_modules/themes/five/src/components/GiftCard/SingleGiftCard/styles.js +43 -0
  29. package/_modules/themes/five/src/components/GiftCard/VerticalGiftCardOrdersLayout/index.js +75 -0
  30. package/_modules/themes/five/src/components/GiftCard/VerticalGiftCardOrdersLayout/styles.js +19 -0
  31. package/_modules/themes/five/src/components/MyOrders/index.js +6 -1
  32. package/_modules/themes/five/src/components/OrderProgress/index.js +1 -1
  33. package/_modules/themes/five/src/components/OrdersOption/index.js +1 -0
  34. package/_modules/themes/five/src/components/PhoneAutocomplete/index.js +165 -31
  35. package/_modules/themes/five/src/components/PhoneAutocomplete/styles.js +53 -9
  36. package/_modules/themes/five/src/components/ProductForm/index.js +1 -0
  37. package/_modules/themes/five/src/components/RenderProductsLayout/index.js +3 -2
  38. package/_modules/themes/five/src/components/SingleProductCard/layouts/original/styles.js +1 -1
  39. package/_modules/themes/five/src/components/UserFormDetails/index.js +5 -17
  40. package/_modules/themes/five/src/components/UserFormDetails/styles.js +3 -7
  41. package/index-template.js +9 -1
  42. package/package.json +2 -2
  43. package/src/themes/callcenterOriginal/src/components/Orders/DeliveriesManager/index.js +3 -1
  44. package/src/themes/callcenterOriginal/src/components/Orders/OrdersDashboardControls/index.js +5 -1
  45. package/src/themes/callcenterOriginal/src/components/Orders/OrdersManager/index.js +2 -0
  46. package/src/themes/five/src/components/BusinessItemAccordion/index.js +2 -2
  47. package/src/themes/five/src/components/BusinessItemAccordion/styles.js +8 -7
  48. package/src/themes/five/src/components/BusinessProductsList/index.js +36 -3
  49. package/src/themes/five/src/components/BusinessProductsList/styles.js +20 -0
  50. package/src/themes/five/src/components/BusinessProductsListing/index.js +2 -0
  51. package/src/themes/five/src/components/BusinessesListing/layouts/OriginalBusinessesListing/index.js +156 -36
  52. package/src/themes/five/src/components/BusinessesListing/layouts/OriginalBusinessesListing/styles.js +66 -0
  53. package/src/themes/five/src/components/Cart/index.js +7 -4
  54. package/src/themes/five/src/components/Checkout/index.js +61 -35
  55. package/src/themes/five/src/components/GiftCard/GiftCardOrdersList/index.js +50 -0
  56. package/src/themes/five/src/components/GiftCard/GiftCardOrdersList/styles.js +34 -0
  57. package/src/themes/five/src/components/GiftCard/HorizontalGiftCardOrdersLayout/index.js +75 -0
  58. package/src/themes/five/src/components/GiftCard/HorizontalGiftCardOrdersLayout/styles.js +29 -0
  59. package/src/themes/five/src/components/GiftCard/SingleGiftCard/index.js +79 -0
  60. package/src/themes/five/src/components/GiftCard/SingleGiftCard/styles.js +79 -0
  61. package/src/themes/five/src/components/GiftCard/VerticalGiftCardOrdersLayout/index.js +72 -0
  62. package/src/themes/five/src/components/GiftCard/VerticalGiftCardOrdersLayout/styles.js +31 -0
  63. package/src/themes/five/src/components/MyOrders/index.js +6 -1
  64. package/src/themes/five/src/components/OrderProgress/index.js +1 -1
  65. package/src/themes/five/src/components/OrdersOption/index.js +1 -0
  66. package/src/themes/five/src/components/PhoneAutocomplete/index.js +195 -46
  67. package/src/themes/five/src/components/PhoneAutocomplete/styles.js +106 -10
  68. package/src/themes/five/src/components/ProductForm/index.js +1 -0
  69. package/src/themes/five/src/components/RenderProductsLayout/index.js +1 -0
  70. package/src/themes/five/src/components/SingleProductCard/layouts/original/styles.js +1 -1
  71. package/src/themes/five/src/components/UserFormDetails/index.js +6 -27
  72. package/src/themes/five/src/components/UserFormDetails/styles.js +0 -16
  73. package/template/assets/images/delivery.svg +11 -0
  74. package/template/assets/images/phone-hero-callcenter.png +0 -0
  75. package/template/assets/images/phone.svg +11 -0
  76. package/template/assets/images/pickup.svg +17 -0
  77. package/template/pages/BusinessProductsList/index.js +2 -1
  78. package/_bundles/ordering-ui.487a31b3537d90f69a9d.js +0 -2
  79. /package/_bundles/{7.ordering-ui.487a31b3537d90f69a9d.js.LICENSE.txt → 7.ordering-ui.cc1d13aa04732fde3671.js.LICENSE.txt} +0 -0
  80. /package/_bundles/{ordering-ui.487a31b3537d90f69a9d.js.LICENSE.txt → ordering-ui.cc1d13aa04732fde3671.js.LICENSE.txt} +0 -0
@@ -49,7 +49,7 @@ function _iterableToArrayLimit(arr, i) { var _i = null == arr ? null : "undefine
49
49
  function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
50
50
  var layoutOne = 'groceries';
51
51
  var RenderProductsLayout = function RenderProductsLayout(props) {
52
- var _configs$use_parent_c, _configs$use_parent_c2, _theme$business_view, _theme$business_view2, _theme$business_view3, _theme$business_view4, _theme$business_view5, _theme$business_view6, _theme$business_view$, _theme$business_view7, _theme$business_view8, _businessState$busine, _businessState$busine2, _businessState$busine3, _businessState$busine4, _business$previously_, _business$professiona, _business$categories, _theme$defaultLanguag, _theme$defaultLanguag2, _business$professiona2, _business$categories2, _theme$defaultLanguag4, _theme$defaultLanguag5, _business$professiona3, _currentCart$products, _business$professiona4, _business$categories3, _theme$defaultLanguag6, _theme$defaultLanguag7, _business$previously_2, _theme$defaultLanguag8, _theme$defaultLanguag9, _currentCart$products2, _currentCart$products3;
52
+ var _configs$use_parent_c, _configs$use_parent_c2, _theme$business_view, _theme$business_view2, _theme$business_view3, _theme$business_view4, _theme$business_view5, _theme$business_view6, _theme$business_view$, _theme$business_view7, _theme$business_view8, _businessState$busine, _businessState$busine2, _businessState$busine3, _businessState$busine4, _business$previously_, _business$professiona, _business$categories, _theme$defaultLanguag, _theme$defaultLanguag2, _business$professiona2, _business$categories2, _theme$defaultLanguag4, _theme$defaultLanguag5, _businessState$busine5, _business$professiona3, _currentCart$products, _business$professiona4, _business$categories3, _theme$defaultLanguag6, _theme$defaultLanguag7, _business$previously_2, _theme$defaultLanguag8, _theme$defaultLanguag9, _currentCart$products2, _currentCart$products3;
53
53
  var errors = props.errors,
54
54
  isError = props.isError,
55
55
  isLoading = props.isLoading,
@@ -294,7 +294,8 @@ var RenderProductsLayout = function RenderProductsLayout(props) {
294
294
  onClickCategory: onClickCategory,
295
295
  handleUpdateProducts: handleUpdateProducts,
296
296
  professionalSelected: professionalSelected,
297
- handleChangeProfessionalSelected: handleChangeProfessionalSelected
297
+ handleChangeProfessionalSelected: handleChangeProfessionalSelected,
298
+ previouslyProducts: businessState === null || businessState === void 0 || (_businessState$busine5 = businessState.business) === null || _businessState$busine5 === void 0 ? void 0 : _businessState$busine5.previously_products
298
299
  }))), windowSize.width >= 1000 && windowSize.height >= 600 && showCartOnProductList && /*#__PURE__*/_react.default.createElement(_styles.BusinessCartContainer, {
299
300
  isProfessional: (business === null || business === void 0 || (_business$professiona3 = business.professionals) === null || _business$professiona3 === void 0 ? void 0 : _business$professiona3.length) > 0 && !useKioskApp
300
301
  }, /*#__PURE__*/_react.default.createElement(_styles.BusinessCartContent, {
@@ -106,7 +106,7 @@ var PriceWrapper = _styledComponents.default.div(_templateObject27 || (_template
106
106
  return isOffPrice && (0, _styledComponents.css)(_templateObject30 || (_templateObject30 = _taggedTemplateLiteral(["\n min-width: 64px;\n "])));
107
107
  });
108
108
  exports.PriceWrapper = PriceWrapper;
109
- var QuantityContainer = _styledComponents.default.div(_templateObject31 || (_templateObject31 = _taggedTemplateLiteral(["\n background: ", ";\n color: ", ";\n position: absolute;\n left: 100%;\n bottom: 100%;\n width: 25px;\n height: 25px;\n text-align: center;\n border-radius: 50%;\n transform: translate(-20px, 50%);\n @media (min-width: 768px) {\n transform: translate(-50%, 50%);\n }\n"])), function (_ref14) {
109
+ var QuantityContainer = _styledComponents.default.div(_templateObject31 || (_templateObject31 = _taggedTemplateLiteral(["\n background: ", ";\n color: ", ";\n position: absolute;\n left: 100%;\n bottom: 98%;\n width: 25px;\n height: 25px;\n text-align: center;\n border-radius: 50%;\n transform: translate(-20px, 50%);\n @media (min-width: 768px) {\n transform: translate(-50%, 50%);\n }\n"])), function (_ref14) {
110
110
  var theme = _ref14.theme;
111
111
  return theme.colors.primary;
112
112
  }, function (_ref15) {
@@ -365,7 +365,7 @@ var UserFormDetailsUI = function UserFormDetailsUI(props) {
365
365
  values: validationFields === null || validationFields === void 0 || (_validationFields$fie7 = validationFields.fields) === null || _validationFields$fie7 === void 0 ? void 0 : _validationFields$fie7.checkout
366
366
  }).map(function (field) {
367
367
  var _ref3, _formState$changes$fi, _ref4, _formState$changes$fi2;
368
- return showField && showField(field.code) && showFieldWithTheme(field.code) && /*#__PURE__*/_react.default.createElement(_react.default.Fragment, {
368
+ return (showField && showField(field.code) && showFieldWithTheme(field.code) || (user === null || user === void 0 ? void 0 : user.guest_id)) && /*#__PURE__*/_react.default.createElement(_react.default.Fragment, {
369
369
  key: field.id
370
370
  }, field.code === 'email' ? (requiredFields && requiredFields.includes(field.code) || !requiredFields) && /*#__PURE__*/_react.default.createElement(_styles.InputGroup, null, /*#__PURE__*/_react.default.createElement("p", null, t(field.code.toUpperCase(), field === null || field === void 0 ? void 0 : field.name)), /*#__PURE__*/_react.default.createElement(_Inputs.Input, {
371
371
  key: field.id,
@@ -396,7 +396,7 @@ var UserFormDetailsUI = function UserFormDetailsUI(props) {
396
396
  }),
397
397
  autoComplete: "off"
398
398
  })));
399
- }), showInputBirthday && /*#__PURE__*/_react.default.createElement(_styles.InputPhoneNumberWrapper, null, /*#__PURE__*/_react.default.createElement("p", null, t('BIRTHDATE', 'Birthdate')), /*#__PURE__*/_react.default.createElement(_Inputs.Input, {
399
+ }), (!(user !== null && user !== void 0 && user.guest_id) && showInputBirthday || (user === null || user === void 0 ? void 0 : user.guest_id) && requiredFields.includes('birthdate')) && /*#__PURE__*/_react.default.createElement(_styles.InputPhoneNumberWrapper, null, /*#__PURE__*/_react.default.createElement("p", null, t('BIRTHDATE', 'Birthdate')), /*#__PURE__*/_react.default.createElement(_Inputs.Input, {
400
400
  borderBottom: true,
401
401
  className: "form",
402
402
  value: birthdate ? (0, _moment.default)(birthdate).format('YYYY/MM/DD') : '',
@@ -408,7 +408,7 @@ var UserFormDetailsUI = function UserFormDetailsUI(props) {
408
408
  value: birthdate,
409
409
  onChange: _handleChangeDate,
410
410
  name: 'birthdate'
411
- })), !!showInputPhoneNumber && showCustomerCellphone && (requiredFields && requiredFields.includes('cellphone') || !requiredFields) && /*#__PURE__*/_react.default.createElement(_styles.InputPhoneNumberWrapper, null, /*#__PURE__*/_react.default.createElement("p", null, t('PHONE', 'Phone')), /*#__PURE__*/_react.default.createElement(_InputPhoneNumber.InputPhoneNumber, {
411
+ })), (!(user !== null && user !== void 0 && user.guest_id) && !!showInputPhoneNumber || (user === null || user === void 0 ? void 0 : user.guest_id) && requiredFields.includes('cellphone')) && showCustomerCellphone && (requiredFields && requiredFields.includes('cellphone') || !requiredFields) && /*#__PURE__*/_react.default.createElement(_styles.InputPhoneNumberWrapper, null, /*#__PURE__*/_react.default.createElement("p", null, t('PHONE', 'Phone')), /*#__PURE__*/_react.default.createElement(_InputPhoneNumber.InputPhoneNumber, {
412
412
  user: user,
413
413
  value: userPhoneNumber,
414
414
  setValue: handleChangePhoneNumber,
@@ -464,24 +464,12 @@ var UserFormDetailsUI = function UserFormDetailsUI(props) {
464
464
  color: "primary",
465
465
  type: "submit",
466
466
  disabled: formState.loading
467
- }, formState.loading ? t('UPDATING', 'Updating...') : t('UPDATE', 'Update')), requiredFields && !(userSession !== null && userSession !== void 0 && userSession.guest_id) && /*#__PURE__*/_react.default.createElement(_Buttons.Button, {
467
+ }, formState.loading ? t('UPDATING', 'Updating...') : t('UPDATE', 'Update')), requiredFields && /*#__PURE__*/_react.default.createElement(_Buttons.Button, {
468
468
  id: "form-btn",
469
469
  color: "primary",
470
470
  type: "submit",
471
471
  disabled: formState.loading
472
- }, formState.loading ? t('UPDATING', 'Updating...') : t('CONTINUE', 'Continue'))), requiredFields && isCheckout && (userSession === null || userSession === void 0 ? void 0 : userSession.guest_id) && /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, /*#__PURE__*/_react.default.createElement(_Buttons.Button, {
473
- id: "form-btn",
474
- color: "primary",
475
- type: "button",
476
- onClick: function onClick() {
477
- return setModalIsOpen(true);
478
- },
479
- disabled: formState.loading
480
- }, formState.loading ? t('UPDATING', 'Updating...') : t('SIGN_UP_AND_PLACE_ORDER', 'Sign up and place order')), isAllowGuest && /*#__PURE__*/_react.default.createElement(_styles.TextLinkWrapper, null, /*#__PURE__*/_react.default.createElement("span", {
481
- onClick: function onClick() {
482
- return handlePlaceOrderAsGuest();
483
- }
484
- }, t('PLACE_ORDER_AS_GUEST', 'Place order as guest'))))) : /*#__PURE__*/_react.default.createElement(_styles.SkeletonForm, null, _toConsumableArray(Array(6)).map(function (item, i) {
472
+ }, formState.loading ? t('UPDATING', 'Updating...') : t('CONTINUE', 'Continue')))) : /*#__PURE__*/_react.default.createElement(_styles.SkeletonForm, null, _toConsumableArray(Array(6)).map(function (item, i) {
485
473
  return /*#__PURE__*/_react.default.createElement(_reactLoadingSkeleton.default, {
486
474
  key: i
487
475
  });
@@ -4,9 +4,9 @@ function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" =
4
4
  Object.defineProperty(exports, "__esModule", {
5
5
  value: true
6
6
  });
7
- exports.TextLinkWrapper = exports.SwitchWrapper = exports.SkeletonForm = exports.PromotionsWrapper = exports.NotificationsGroupSwitchWrapper = exports.LanguageSelectorWrapper = exports.InputPhoneNumberWrapper = exports.InputGroup = exports.FormInput = exports.Divider = exports.ActionsForm = void 0;
7
+ exports.SwitchWrapper = exports.SkeletonForm = exports.PromotionsWrapper = exports.NotificationsGroupSwitchWrapper = exports.LanguageSelectorWrapper = exports.InputPhoneNumberWrapper = exports.InputGroup = exports.FormInput = exports.Divider = exports.ActionsForm = void 0;
8
8
  var _styledComponents = _interopRequireWildcard(require("styled-components"));
9
- var _templateObject, _templateObject2, _templateObject3, _templateObject4, _templateObject5, _templateObject6, _templateObject7, _templateObject8, _templateObject9, _templateObject10, _templateObject11, _templateObject12, _templateObject13, _templateObject14, _templateObject15, _templateObject16;
9
+ var _templateObject, _templateObject2, _templateObject3, _templateObject4, _templateObject5, _templateObject6, _templateObject7, _templateObject8, _templateObject9, _templateObject10, _templateObject11, _templateObject12, _templateObject13, _templateObject14, _templateObject15;
10
10
  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); }
11
11
  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; }
12
12
  function _taggedTemplateLiteral(strings, raw) { if (!raw) { raw = strings.slice(0); } return Object.freeze(Object.defineProperties(strings, { raw: { value: Object.freeze(raw) } })); }
@@ -44,8 +44,4 @@ var NotificationsGroupSwitchWrapper = _styledComponents.default.div(_templateObj
44
44
  });
45
45
  exports.NotificationsGroupSwitchWrapper = NotificationsGroupSwitchWrapper;
46
46
  var SwitchWrapper = _styledComponents.default.div(_templateObject15 || (_templateObject15 = _taggedTemplateLiteral(["\n display: flex;\n align-items: center;\n justify-content: space-between;\n width: 100%;\n"])));
47
- exports.SwitchWrapper = SwitchWrapper;
48
- var TextLinkWrapper = _styledComponents.default.span(_templateObject16 || (_templateObject16 = _taggedTemplateLiteral(["\n width: 100%;\n display: flex;\n justify-content: center;\n margin-top: 15px;\n span {\n font-size: 14px;\n text-align: center;\n cursor: pointer;\n color: ", ";\n &:hover {\n text-decoration: underline;\n }\n }\n"])), function (props) {
49
- return props.theme.colors.primary;
50
- });
51
- exports.TextLinkWrapper = TextLinkWrapper;
47
+ exports.SwitchWrapper = SwitchWrapper;
package/index-template.js CHANGED
@@ -40,6 +40,10 @@ import credit from './template/assets/images/credit.png'
40
40
  import businessSignUpHero from './template/assets/images/business_signup.png'
41
41
  import driverSignUpHero from './template/assets/images/driver-signup-hero.png'
42
42
  import loyaltyLevel from './template/assets/images/loyalty_level.png'
43
+ import phoneHero from './template/assets/images/phone-hero-callcenter.png'
44
+ import deliveryIco from './template/assets/images/delivery.svg'
45
+ import pickupIco from './template/assets/images/pickup.svg'
46
+ import phone from './template/assets/images/phone.svg'
43
47
 
44
48
  import orderStatus0 from './template/assets/images/order/status-0.svg'
45
49
  import orderStatus1 from './template/assets/images/order/status-1.svg'
@@ -136,7 +140,11 @@ theme.images = {
136
140
  businessSignUpHero,
137
141
  driverSignUpHero,
138
142
  leftArrow,
139
- rightArrow
143
+ rightArrow,
144
+ phoneHero,
145
+ deliveryIco,
146
+ pickupIco,
147
+ phone
140
148
  },
141
149
 
142
150
  order: {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "ordering-ui-external",
3
- "version": "10.4.0",
3
+ "version": "10.5.0",
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": "9.4.0",
91
+ "ordering-components-external": "9.5.0",
92
92
  "payment": "^2.4.6",
93
93
  "polished": "^3.6.6",
94
94
  "react-bootstrap-icons": "^1.7.2",
@@ -30,7 +30,8 @@ const DeliveriesManagerUI = (props) => {
30
30
  handleSelectedSubOrderStatus,
31
31
  onOrderRedirect,
32
32
  numberOfOrdersByStatus,
33
- numberOfOrdersBySubstatus
33
+ numberOfOrdersBySubstatus,
34
+ franchiseId
34
35
  } = props
35
36
 
36
37
  const [, t] = useLanguage()
@@ -105,6 +106,7 @@ const DeliveriesManagerUI = (props) => {
105
106
  timeStatus={timeStatus}
106
107
  numberOfOrdersByStatus={numberOfOrdersByStatus}
107
108
  numberOfOrdersBySubstatus={numberOfOrdersBySubstatus}
109
+ franchiseId={franchiseId}
108
110
  />
109
111
  </WrapItemView>
110
112
  </OrdersContent>
@@ -14,6 +14,7 @@ export const OrdersDashboardControls = (props) => {
14
14
  const {
15
15
  selectedOrderNumber,
16
16
  filterValues,
17
+ franchiseId,
17
18
  handleDeleteMultiOrders,
18
19
  handleChangeMultiOrdersStatus,
19
20
  handleOpenCustomOrderDetail
@@ -26,7 +27,10 @@ export const OrdersDashboardControls = (props) => {
26
27
  <OrderDashboardControlsContainer>
27
28
  <InnerContnet>
28
29
  <CreateCustomOrder handleOpenCustomOrderDetail={handleOpenCustomOrderDetail} />
29
- <OrdersExportCSV filterValues={filterValues} />
30
+ <OrdersExportCSV
31
+ filterValues={filterValues}
32
+ franchiseId={franchiseId}
33
+ />
30
34
  {selectedOrderNumber > 0 && (
31
35
  <>
32
36
  {user?.level !== 5 && (
@@ -202,6 +202,7 @@ const OrdersManagerUI = (props) => {
202
202
  <OrdersDashboardControls
203
203
  selectedOrderNumber={selectedOrderIds?.length}
204
204
  filterValues={filterValues}
205
+ franchiseId={props.franchiseId}
205
206
  handleChangeMultiOrdersStatus={handleChangeMultiOrdersStatus}
206
207
  handleDeleteMultiOrders={handleDeleteMultiOrders}
207
208
  handleOpenCustomOrderDetail={(id) => {
@@ -219,6 +220,7 @@ const OrdersManagerUI = (props) => {
219
220
  driverId={props.driverId}
220
221
  customerId={props.customerId}
221
222
  businessId={props.businessId}
223
+ franchiseId={props.franchiseId}
222
224
  searchValue={searchValue}
223
225
  filterValues={filterValues}
224
226
  selectedOrderIds={selectedOrderIds}
@@ -145,7 +145,7 @@ export const BusinessItemAccordion = (props) => {
145
145
  className={`accordion ${setActive}`}
146
146
  onClick={(e) => toggleAccordion(e)}
147
147
  >
148
- <BusinessInfo>
148
+ <BusinessInfo isOtherInfo={(isClosed && !isStore) || (!isClosed && !isProducts && !isStore)}>
149
149
  {!hideBusinessLogo && (
150
150
  <WrapperBusinessLogo>
151
151
  <BusinessLogo
@@ -153,7 +153,7 @@ export const BusinessItemAccordion = (props) => {
153
153
  />
154
154
  </WrapperBusinessLogo>
155
155
  )}
156
- <ContentInfo className='info' isStore={isStore}>
156
+ <ContentInfo className='info' isStore={isStore} isLogo={!hideBusinessLogo}>
157
157
  <h2>{business?.name}</h2>
158
158
  {!hideBusinessTime && (
159
159
  <TimeContainer>
@@ -47,6 +47,9 @@ export const ContentInfo = styled.div`
47
47
  flex-direction: column;
48
48
  justify-content: center;
49
49
  width: 100%;
50
+ ${({ isLogo }) => isLogo && css`
51
+ width: calc(100% - 80px);
52
+ `}
50
53
 
51
54
  > div {
52
55
  display: flex;
@@ -141,18 +144,16 @@ export const AccordionText = styled.div`
141
144
  export const BusinessInfo = styled.div`
142
145
  display: flex;
143
146
  align-items: center;
144
- width: 80%;
147
+ width: calc(100% - 30px);
148
+ ${({ isOtherInfo }) => isOtherInfo && css`
149
+ width: calc(100% - 100px);
150
+ `}
145
151
 
146
152
  h2 {
147
153
  overflow: hidden;
148
154
  text-overflow: ellipsis;
149
155
  white-space: nowrap;
150
156
  }
151
-
152
- @media (min-width: 576px) {
153
- width: 75%;
154
- }
155
-
156
157
  `
157
158
 
158
159
  export const BusinessTotal = styled.div`
@@ -186,7 +187,7 @@ export const BusinessTotal = styled.div`
186
187
  `
187
188
 
188
189
  export const BusinessActions = styled.div`
189
- max-width: 30%;
190
+ max-width: 30px;
190
191
  display: flex;
191
192
  align-items: center;
192
193
  justify-content: flex-end;
@@ -22,7 +22,9 @@ import {
22
22
  CategoryDescription,
23
23
  DescriptionContainer,
24
24
  SubcategorySearchContainer,
25
- SubCategoriesInnerContainer
25
+ SubCategoriesInnerContainer,
26
+ PreviouslyOrderedContainer,
27
+ PreviouslyOrderedWrapper
26
28
  } from './styles'
27
29
  import { Button } from '../../styles/Buttons'
28
30
 
@@ -49,7 +51,8 @@ const BusinessProductsListUI = (props) => {
49
51
  onClickCategory,
50
52
  handleUpdateProducts,
51
53
  isSearchMode,
52
- business
54
+ business,
55
+ previouslyProducts
53
56
  } = props
54
57
 
55
58
  const [, t] = useLanguage()
@@ -171,7 +174,37 @@ const BusinessProductsListUI = (props) => {
171
174
  ))}
172
175
  </>
173
176
  )}
174
-
177
+ {
178
+ !category?.id && previouslyProducts?.length > 0 && (
179
+ <WrapAllCategories id='previously_block'>
180
+ <h3>{t('ORDER_IT_AGAIN', 'Order it again')}</h3>
181
+ <CategoryDescription maxWidth={headerRef?.current?.clientWidth}>
182
+ <p>
183
+ {t('ORDER_IT_AGAIN_DESC', 'Quickly add items from your past orders.')}
184
+ </p>
185
+ </CategoryDescription>
186
+ <PreviouslyOrderedContainer>
187
+ <PreviouslyOrderedWrapper>
188
+ <AutoScroll scrollId='previously_ordered'>
189
+ {previouslyProducts?.map((product, i) => (
190
+ <SingleProductCard
191
+ key={i}
192
+ isSoldOut={(product.inventoried && !product.quantity)}
193
+ product={product}
194
+ useKioskApp={useKioskApp}
195
+ businessId={businessId}
196
+ onProductClick={onProductClick}
197
+ isCartOnProductsList={isCartOnProductsList}
198
+ handleUpdateProducts={handleUpdateProducts}
199
+ productAddedToCartLength={currentCart?.products?.reduce((productsLength, Cproduct) => { return productsLength + (Cproduct?.id === product?.id ? Cproduct?.quantity : 0) }, 0)}
200
+ />
201
+ ))}
202
+ </AutoScroll>
203
+ </PreviouslyOrderedWrapper>
204
+ </PreviouslyOrderedContainer>
205
+ </WrapAllCategories>
206
+ )
207
+ }
175
208
  {
176
209
  !category?.id && (
177
210
  <>
@@ -205,3 +205,23 @@ export const SubcategorySearchContainer = styled.div`
205
205
  flex-direction: column;
206
206
  margin-left: 30px;
207
207
  `
208
+
209
+ export const PreviouslyOrderedContainer = styled.div`
210
+ display: flex;
211
+ overflow: scroll hidden;
212
+ ::-webkit-scrollbar {
213
+ width: 0px;
214
+ height: 0px;
215
+ }
216
+ `
217
+
218
+ export const PreviouslyOrderedWrapper = styled.div`
219
+ display: flex;
220
+ box-sizing: border-box;
221
+
222
+ .product-card {
223
+ width: 270px;
224
+ max-width: 270px;
225
+ }
226
+
227
+ `
@@ -306,6 +306,8 @@ const BusinessProductsListingUI = (props) => {
306
306
  onChangeMetaTag && onChangeMetaTag(curProduct?.seo_title, curProduct?.seo_description, curProduct?.seo_keywords)
307
307
  } else {
308
308
  onChangeMetaTag && onChangeMetaTag(business?.slug, business?.description, business?.name)
309
+ updateProductModal(null)
310
+ setCurProduct(null)
309
311
  }
310
312
  }, [openProduct, loading, business, curProduct])
311
313
 
@@ -23,7 +23,13 @@ import {
23
23
  BusinessLogosContainer,
24
24
  BusinessBanner,
25
25
  BusinessLogosWrapper,
26
- AddressFormWrapper
26
+ AddressFormWrapper,
27
+ Title,
28
+ TypesContainer,
29
+ TypeButton,
30
+ IconTypeButton,
31
+ TypesWrapper,
32
+ AdditionalTypesContainer
27
33
  } from './styles'
28
34
  import { useWindowSize } from '../../../../../../../hooks/useWindowSize'
29
35
  import { Button } from '../../../../styles/Buttons'
@@ -70,11 +76,13 @@ const BusinessesListingUI = (props) => {
70
76
  getCities,
71
77
  citiesState,
72
78
  logosLayout,
73
- actualSlug
79
+ actualSlug,
80
+ orderTypes
74
81
  } = props
75
-
82
+ const allOrderTypes = [1, 2, 3, 4, 5]
83
+ const pickupTypes = [2, 3, 4, 5]
76
84
  const [, t] = useLanguage()
77
- const [orderState, { changeCityFilter }] = useOrder()
85
+ const [orderState, { changeCityFilter, changeType }] = useOrder()
78
86
  const [{ auth }] = useSession()
79
87
  const [{ configs }] = useConfig()
80
88
  const windowSize = useWindowSize()
@@ -86,6 +94,7 @@ const BusinessesListingUI = (props) => {
86
94
  const [isPreorder, setIsPreorder] = useState(false)
87
95
  const [preorderBusiness, setPreorderBusiness] = useState(null)
88
96
  const [hasHighRatedBusiness, setHasHighRatedBusiness] = useState(true)
97
+ const [isPickupSelected, setIsPickupSelected] = useState(pickupTypes.includes(orderState?.options?.type))
89
98
  const userCustomer = JSON.parse(window.localStorage.getItem('user-customer'))
90
99
  const [favoriteIds, setFavoriteIds] = useState([])
91
100
  const allCitiesDisabled = citiesState?.cities?.every(city => !city.enabled)
@@ -105,7 +114,7 @@ const BusinessesListingUI = (props) => {
105
114
  : orderState?.options?.type === 8
106
115
  ? 'catering_pickup'
107
116
  : null
108
-
117
+ const configTypes = configs?.order_types_allowed?.value.split('|').filter(value => (allOrderTypes.includes(Number(value)))).map(value => Number(value)) || []
109
118
  const cateringValues = preorderBusiness?.configs && getCateringValues(cateringTypeString, preorderBusiness?.configs)
110
119
 
111
120
  const handleScroll = useCallback(() => {
@@ -173,6 +182,21 @@ const BusinessesListingUI = (props) => {
173
182
  changeCityFilter(cityId === orderState?.options?.city_id ? null : cityId)
174
183
  }
175
184
 
185
+ const handleChangeType = (value) => {
186
+ if (!orderState?.loading) {
187
+ changeType(value)
188
+ if (value === 1) {
189
+ setIsPickupSelected(false)
190
+ }
191
+ }
192
+ }
193
+
194
+ const handleChangeToPickup = () => {
195
+ const firstEnabledPickupType = orderTypes.find(type => configTypes?.includes(type.value) && type.value !== 1)?.value
196
+ handleChangeType(firstEnabledPickupType)
197
+ setIsPickupSelected(true)
198
+ }
199
+
176
200
  useEffect(() => {
177
201
  if (preorderBusiness) setIsPreorder(true)
178
202
  }, [preorderBusiness])
@@ -195,6 +219,30 @@ const BusinessesListingUI = (props) => {
195
219
  if (!selectedCity || !selectedCity?.enabled) changeCityFilter(null)
196
220
  }, [citiesState, orderState?.options?.city_id])
197
221
 
222
+ useEffect(() => {
223
+ if (pickupTypes.includes(orderState?.options?.type) && isCustomerMode) {
224
+ setIsPickupSelected(true)
225
+ }
226
+ }, [orderState?.options?.type])
227
+
228
+ const OrderTypesComponent = () => {
229
+ return (
230
+ <>
231
+ {orderTypes && (configTypes ? orderTypes.filter(type => configTypes?.includes(type.value) && type.value !== 1) : orderTypes).map((item, i) => (
232
+ <Button
233
+ key={item.value}
234
+ onClick={() => handleChangeType(item.value)}
235
+ color={orderState?.options?.type === item?.value ? 'primary' : 'secondary'}
236
+ disabled={orderState?.loading}
237
+ className={orderState?.options?.type !== item?.value ? 'activated' : ''}
238
+ >
239
+ {item.text}
240
+ </Button>
241
+ ))}
242
+ </>
243
+ )
244
+ }
245
+
198
246
  if (logosLayout) {
199
247
  return (
200
248
  <BusinessLogosWrapper>
@@ -234,7 +282,7 @@ const BusinessesListingUI = (props) => {
234
282
  {windowSize.width < 576 && (
235
283
  <OrderContextUI isBusinessList hideHero={(configs?.business_listing_hide_image?.value !== '1' && !isChew) && !hideHero} />
236
284
  )}
237
- {(configs?.business_listing_hide_image?.value !== '1' && !isChew) && !hideHero && (
285
+ {(configs?.business_listing_hide_image?.value !== '1' && !isChew) && !hideHero && !isCustomerMode && (
238
286
  <BusinessHeroImg
239
287
  bgimage={theme.images?.general?.businessHero}
240
288
  height={theme?.business_listing_view?.components?.business_hero?.style?.height}
@@ -242,13 +290,58 @@ const BusinessesListingUI = (props) => {
242
290
  )}
243
291
  </BusinessBanner>
244
292
  )}
245
- <OrderProgress
246
- isChew={isChew}
247
- franchiseId={props.franchiseId}
248
- userCustomerId={userCustomer?.id}
249
- asDashboard={isCustomerMode}
250
- isCustomerMode={isCustomerMode}
251
- />
293
+ {(userCustomer && orderState?.options?.address?.address && isCustomerMode) && (
294
+ <>
295
+ <Title>{t('DELIVERY_TYPE', 'Delivery Type')}</Title>
296
+ <TypesContainer>
297
+ {configTypes.includes(1) && (
298
+ <TypeButton onClick={() => handleChangeType(1)} disabled={orderState?.loading} activated={!isPickupSelected}>
299
+ <IconTypeButton activated={!isPickupSelected}>
300
+ <img
301
+ src={theme?.images?.general?.deliveryIco}
302
+ width={20}
303
+ height={20}
304
+ />
305
+ </IconTypeButton>
306
+ <p>{t('DELIVERY', 'Delivery')}</p>
307
+ </TypeButton>
308
+ )}
309
+ {configTypes.some(type => pickupTypes.includes(type)) && (
310
+ <TypeButton
311
+ disabled={orderState?.loading}
312
+ activated={isPickupSelected}
313
+ onClick={() => handleChangeToPickup()}
314
+ >
315
+ <IconTypeButton activated={isPickupSelected}>
316
+ <img
317
+ src={theme?.images?.general?.pickupIco}
318
+ width={22}
319
+ height={22}
320
+ />
321
+ </IconTypeButton>
322
+ <p>{t('PICKUP', 'Pickup')}</p>
323
+ </TypeButton>
324
+ )}
325
+ </TypesContainer>
326
+ {isPickupSelected && (
327
+ <TypesWrapper>
328
+ <p>{t('WHAT_PICKUP_YOU_NEED', 'What kind of pickup do you need?')}</p>
329
+ <AdditionalTypesContainer>
330
+ <OrderTypesComponent />
331
+ </AdditionalTypesContainer>
332
+ </TypesWrapper>
333
+ )}
334
+ </>
335
+ )}
336
+ {!isCustomerMode && (
337
+ <OrderProgress
338
+ isChew={isChew}
339
+ franchiseId={props.franchiseId}
340
+ userCustomerId={userCustomer?.id}
341
+ asDashboard={isCustomerMode}
342
+ isCustomerMode={isCustomerMode}
343
+ />
344
+ )}
252
345
  {(configs?.business_listing_hide_image?.value !== '1' && isChew) && (
253
346
  <BusinessHeroImg
254
347
  bgimage={theme.images?.general?.businessHero}
@@ -455,28 +548,27 @@ const BusinessesListingUI = (props) => {
455
548
  open={modals.formOpen || modals.listOpen}
456
549
  width='70%'
457
550
  onClose={() => setModals({ ...modals, formOpen: false, listOpen: false })}
458
- >
459
- {modals.listOpen ? (
460
- <AddressList
461
- isModal
462
- changeOrderAddressWithDefault
463
- userId={isNaN(userCustomer?.id) ? null : userCustomer?.id}
464
- onCancel={() => setModals({ ...modals, listOpen: false })}
465
- isCustomerMode={isCustomerMode}
466
- />
467
- ) : (
468
- <AddressFormWrapper>
469
- <AddressForm
470
- useValidationFileds
471
- address={orderState?.options?.address || {}}
472
- onCancel={() => setModals({ ...modals, formOpen: false })}
473
- onSaveAddress={() => setModals({ ...modals, formOpen: false })}
474
- isCustomerMode={isCustomerMode}
475
- />
476
- </AddressFormWrapper>
477
- )
478
- }
479
- </Modal>
551
+ >
552
+ {modals.listOpen ? (
553
+ <AddressList
554
+ isModal
555
+ changeOrderAddressWithDefault
556
+ userId={isNaN(userCustomer?.id) ? null : userCustomer?.id}
557
+ onCancel={() => setModals({ ...modals, listOpen: false })}
558
+ isCustomerMode={isCustomerMode}
559
+ />
560
+ ) : (
561
+ <AddressFormWrapper>
562
+ <AddressForm
563
+ useValidationFileds
564
+ address={orderState?.options?.address || {}}
565
+ onCancel={() => setModals({ ...modals, formOpen: false })}
566
+ onSaveAddress={() => setModals({ ...modals, formOpen: false })}
567
+ isCustomerMode={isCustomerMode}
568
+ />
569
+ </AddressFormWrapper>
570
+ )}
571
+ </Modal>
480
572
 
481
573
  <Alert
482
574
  title={!mapErrors ? t('SEARCH', 'Search') : t('BUSINESSES_MAP', 'Businesses Map')}
@@ -492,10 +584,38 @@ const BusinessesListingUI = (props) => {
492
584
  }
493
585
 
494
586
  export const OriginalBusinessesListing = (props) => {
587
+ const [, t] = useLanguage()
495
588
  const businessListingProps = {
496
589
  ...props,
497
590
  UIComponent: BusinessesListingUI,
498
- paginationSettings: { initialPage: 1, pageSize: 25, controlType: 'infinity' }
591
+ paginationSettings: { initialPage: 1, pageSize: 25, controlType: 'infinity' },
592
+ orderTypes: props.orderTypes || [
593
+ {
594
+ value: 1,
595
+ text: t('DELIVERY', 'Delivery'),
596
+ description: t('ORDERTYPE_DESCRIPTION_DELIVERY', 'Delivery description'),
597
+ },
598
+ {
599
+ value: 2,
600
+ text: t('PICKUP', 'Pickup'),
601
+ description: t('ORDERTYPE_DESCRIPTION_PICKUP', 'Pickup description')
602
+ },
603
+ {
604
+ value: 3,
605
+ text: t('EAT_IN', 'Eat in'),
606
+ description: t('ORDERTYPE_DESCRIPTION_EATIN', 'Eat in description')
607
+ },
608
+ {
609
+ value: 4,
610
+ text: t('CURBSIDE', 'Curbside'),
611
+ description: t('ORDERTYPE_DESCRIPTION_CURBSIDE', 'Curbside description')
612
+ },
613
+ {
614
+ value: 5,
615
+ text: t('DRIVE_THRU', 'Drive thru'),
616
+ description: t('ORDERTYPE_DESCRIPTION_DRIVETHRU', 'Drive Thru description')
617
+ }
618
+ ]
499
619
  }
500
620
  return <BusinessListController {...businessListingProps} />
501
621
  }