ordering-ui-external 14.0.10 → 14.0.12

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 (38) hide show
  1. package/_bundles/{7.ordering-ui.fc88deb82a8d88cf484a.js → 7.ordering-ui.404d677b1657ca9f8da5.js} +1 -1
  2. package/_bundles/ordering-ui.404d677b1657ca9f8da5.js +2 -0
  3. package/_modules/components/Checkout/index.js +2 -1
  4. package/_modules/themes/callcenterOriginal/src/components/Header/index.js +4 -2
  5. package/_modules/themes/callcenterOriginal/src/components/PhoneAutocomplete/index.js +1 -3
  6. package/_modules/themes/callcenterOriginal/src/components/SignUpForm/index.js +16 -14
  7. package/_modules/themes/five/src/components/BusinessBasicInformation/BusinessInfoComponent.js +3 -1
  8. package/_modules/themes/five/src/components/BusinessBasicInformation/styles.js +36 -30
  9. package/_modules/themes/five/src/components/BusinessProductsListing/index.js +2 -1
  10. package/_modules/themes/five/src/components/BusinessesListing/layouts/OriginalBusinessesListing/index.js +17 -9
  11. package/_modules/themes/five/src/components/PageBanner/index.js +1 -3
  12. package/_modules/themes/five/src/components/SingleProductCard/layouts/original/styles.js +1 -1
  13. package/_modules/themes/three/src/components/Checkout/index.js +2 -1
  14. package/_modules/themes/two/src/components/Checkout/index.js +2 -1
  15. package/package.json +2 -2
  16. package/src/components/Checkout/index.js +1 -0
  17. package/src/themes/callcenterOriginal/src/components/Header/index.js +2 -2
  18. package/src/themes/callcenterOriginal/src/components/PhoneAutocomplete/index.js +1 -3
  19. package/src/themes/callcenterOriginal/src/components/SignUpForm/index.js +15 -17
  20. package/src/themes/five/src/components/BusinessBasicInformation/BusinessInfoComponent.js +2 -1
  21. package/src/themes/five/src/components/BusinessBasicInformation/styles.js +8 -1
  22. package/src/themes/five/src/components/BusinessProductsListing/index.js +2 -1
  23. package/src/themes/five/src/components/BusinessesListing/layouts/OriginalBusinessesListing/index.js +9 -1
  24. package/src/themes/five/src/components/PageBanner/index.js +20 -26
  25. package/src/themes/five/src/components/SingleProductCard/layouts/original/styles.js +1 -1
  26. package/src/themes/three/src/components/Checkout/index.js +1 -0
  27. package/src/themes/two/src/components/Checkout/index.js +1 -0
  28. package/_bundles/ordering-ui.fc88deb82a8d88cf484a.js +0 -2
  29. /package/_bundles/{0.ordering-ui.fc88deb82a8d88cf484a.js → 0.ordering-ui.404d677b1657ca9f8da5.js} +0 -0
  30. /package/_bundles/{1.ordering-ui.fc88deb82a8d88cf484a.js → 1.ordering-ui.404d677b1657ca9f8da5.js} +0 -0
  31. /package/_bundles/{2.ordering-ui.fc88deb82a8d88cf484a.js → 2.ordering-ui.404d677b1657ca9f8da5.js} +0 -0
  32. /package/_bundles/{4.ordering-ui.fc88deb82a8d88cf484a.js → 4.ordering-ui.404d677b1657ca9f8da5.js} +0 -0
  33. /package/_bundles/{5.ordering-ui.fc88deb82a8d88cf484a.js → 5.ordering-ui.404d677b1657ca9f8da5.js} +0 -0
  34. /package/_bundles/{6.ordering-ui.fc88deb82a8d88cf484a.js → 6.ordering-ui.404d677b1657ca9f8da5.js} +0 -0
  35. /package/_bundles/{7.ordering-ui.fc88deb82a8d88cf484a.js.LICENSE.txt → 7.ordering-ui.404d677b1657ca9f8da5.js.LICENSE.txt} +0 -0
  36. /package/_bundles/{8.ordering-ui.fc88deb82a8d88cf484a.js → 8.ordering-ui.404d677b1657ca9f8da5.js} +0 -0
  37. /package/_bundles/{9.ordering-ui.fc88deb82a8d88cf484a.js → 9.ordering-ui.404d677b1657ca9f8da5.js} +0 -0
  38. /package/_bundles/{ordering-ui.fc88deb82a8d88cf484a.js.LICENSE.txt → ordering-ui.404d677b1657ca9f8da5.js.LICENSE.txt} +0 -0
@@ -243,7 +243,8 @@ var CheckoutUI = function CheckoutUI(props) {
243
243
  businessId: cart === null || cart === void 0 ? void 0 : cart.business_id,
244
244
  apiKey: configs === null || configs === void 0 || (_configs$google_maps_ = configs.google_maps_api_key) === null || _configs$google_maps_ === void 0 ? void 0 : _configs$google_maps_.value,
245
245
  mapConfigs: mapConfigs,
246
- isCustomerMode: isCustomerMode
246
+ isCustomerMode: isCustomerMode,
247
+ cart: cart
247
248
  })), (_props$beforeElements3 = props.beforeElementsSectionTwo) === null || _props$beforeElements3 === void 0 ? void 0 : _props$beforeElements3.map(function (BeforeElement, i) {
248
249
  return /*#__PURE__*/_react.default.createElement(_react.default.Fragment, {
249
250
  key: i
@@ -73,7 +73,9 @@ var Header = exports.Header = function Header(props) {
73
73
  var _useOrder = (0, _orderingComponentsExternal.useOrder)(),
74
74
  _useOrder2 = _slicedToArray(_useOrder, 2),
75
75
  orderState = _useOrder2[0],
76
- refreshOrderOptions = _useOrder2[1].refreshOrderOptions;
76
+ _useOrder2$ = _useOrder2[1],
77
+ refreshOrderOptions = _useOrder2$.refreshOrderOptions,
78
+ changeType = _useOrder2$.changeType;
77
79
  var _useState = (0, _react.useState)({}),
78
80
  _useState2 = _slicedToArray(_useState, 2),
79
81
  openPopover = _useState2[0],
@@ -141,7 +143,7 @@ var Header = exports.Header = function Header(props) {
141
143
  content: t('QUESTION_CLEAR_CUSTOMER', (theme === null || theme === void 0 || (_theme$defaultLanguag = theme.defaultLanguages) === null || _theme$defaultLanguag === void 0 ? void 0 : _theme$defaultLanguag.QUESTION_CLEAR_CUSTOMER) || 'Are you sure that you want to clear the customer?'),
142
144
  handleOnAccept: function handleOnAccept() {
143
145
  deleteUserCustomer(true);
144
- // refreshOrderOptions()
146
+ changeType(1);
145
147
  handleGoToPage({
146
148
  page: 'home'
147
149
  });
@@ -294,9 +294,7 @@ var PhoneAutocompleteUI = function PhoneAutocompleteUI(props) {
294
294
  }, [urlPhone, customersPhones === null || customersPhones === void 0 ? void 0 : customersPhones.loading]);
295
295
  (0, _react.useEffect)(function () {
296
296
  var _orderState$options4;
297
- if (pickupTypes.includes(orderState === null || orderState === void 0 || (_orderState$options4 = orderState.options) === null || _orderState$options4 === void 0 ? void 0 : _orderState$options4.type)) {
298
- setIsPickupSelected(true);
299
- }
297
+ setIsPickupSelected(!!pickupTypes.includes(orderState === null || orderState === void 0 || (_orderState$options4 = orderState.options) === null || _orderState$options4 === void 0 ? void 0 : _orderState$options4.type));
300
298
  }, [orderState === null || orderState === void 0 || (_orderState$options5 = orderState.options) === null || _orderState$options5 === void 0 ? void 0 : _orderState$options5.type]);
301
299
  (0, _react.useEffect)(function () {
302
300
  var _orderState$options6, _orderState$options7;
@@ -172,6 +172,11 @@ var SignUpFormUI = function SignUpFormUI(props) {
172
172
  emailInput.current.value = e.target.value.toLowerCase().replace(/[&,()%";:ç?<>{}\\[\]\s]/g, '');
173
173
  }
174
174
  };
175
+ var preventWhiteSpaceOnKeyDown = function preventWhiteSpaceOnKeyDown(e) {
176
+ if (e.key === " ") {
177
+ e.preventDefault();
178
+ }
179
+ };
175
180
  (0, _react.useEffect)(function () {
176
181
  var _formState$result, _formState$result4, _formState$result5;
177
182
  if (!formState.loading && (_formState$result = formState.result) !== null && _formState$result !== void 0 && _formState$result.error) {
@@ -219,15 +224,9 @@ var SignUpFormUI = function SignUpFormUI(props) {
219
224
  if (!validationFields.loading) {
220
225
  var _validationFields$fie5;
221
226
  Object.values(validationFields === null || validationFields === void 0 || (_validationFields$fie5 = validationFields.fields) === null || _validationFields$fie5 === void 0 ? void 0 : _validationFields$fie5.checkout).map(function (field) {
222
- return !notValidationFields.includes(field.code) && (field.code === 'email' ? formMethods.register('email', {
223
- required: isRequiredField(field.code) ? t('VALIDATION_ERROR_EMAIL_REQUIRED', 'The field Email is required').replace('_attribute_', t('EMAIL', 'Email')) : null,
224
- pattern: {
225
- value: /^[A-Z0-9._%+-]+@[A-Z0-9.-]+\.[A-Z]{2,}$/i,
226
- message: t('INVALID_ERROR_EMAIL', 'Invalid email address').replace('_attribute_', t('EMAIL', 'Email'))
227
- }
228
- }) : formMethods.register(field.code, {
227
+ return !notValidationFields.includes(field.code) && field.code !== 'email' && formMethods.register(field.code, {
229
228
  required: isRequiredField(field.code) ? t("VALIDATION_ERROR_".concat(field.code.toUpperCase(), "_REQUIRED"), "".concat(field.name, " is required")).replace('_attribute_', t(field.name, field.code)) : null
230
- }));
229
+ });
231
230
  });
232
231
  }
233
232
  }, [formMethods]);
@@ -289,6 +288,7 @@ var SignUpFormUI = function SignUpFormUI(props) {
289
288
  }), !(useChekoutFileds && validationFields !== null && validationFields !== void 0 && validationFields.loading) ? /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, (validationFields === null || validationFields === void 0 || (_validationFields$fie7 = validationFields.fields) === null || _validationFields$fie7 === void 0 ? void 0 : _validationFields$fie7.checkout) && (0, _utils.sortInputFields)({
290
289
  values: validationFields === null || validationFields === void 0 || (_validationFields$fie8 = validationFields.fields) === null || _validationFields$fie8 === void 0 ? void 0 : _validationFields$fie8.checkout
291
290
  }).map(function (field) {
291
+ var _formMethods$errors;
292
292
  return showField && showField(field.code) && /*#__PURE__*/_react.default.createElement(_react.default.Fragment, {
293
293
  key: field.id
294
294
  }, field.code === 'email' ? /*#__PURE__*/_react.default.createElement(_styles.InputWrapper, null, /*#__PURE__*/_react.default.createElement(_Inputs.Input, {
@@ -296,13 +296,15 @@ var SignUpFormUI = function SignUpFormUI(props) {
296
296
  name: field.code,
297
297
  "aria-label": field.code,
298
298
  className: "form",
299
- placeholder: !field.required ? t(field.code.toUpperCase() + '_OPTIONAL', field.name + ' (Optional)') : t(field.code.toUpperCase(), field.name),
299
+ placeholder: t(field.code.toUpperCase() + '_OPTIONAL', field.name + ' (Optional)'),
300
300
  onChange: handleChangeInputEmail,
301
- ref: function ref(e) {
302
- emailInput.current = e;
303
- },
304
- required: !!field.required,
305
- autoComplete: "off"
301
+ ref: formMethods.register({
302
+ required: null,
303
+ pattern: /^[A-Z0-9._%+-]+@[A-Z0-9.-]+\.[A-Z]{2,}$/i
304
+ }),
305
+ onKeyDown: preventWhiteSpaceOnKeyDown,
306
+ autoComplete: "on",
307
+ isError: ((_formMethods$errors = formMethods.errors) === null || _formMethods$errors === void 0 ? void 0 : _formMethods$errors.email) && !notValidationFields.includes(field.code)
306
308
  }), /*#__PURE__*/_react.default.createElement(_styles.InputBeforeIcon, null, /*#__PURE__*/_react.default.createElement(_reactBootstrapIcons.Envelope, null))) : /*#__PURE__*/_react.default.createElement(_styles.InputWrapper, {
307
309
  isHalf: fieldNumber % 2 === 0
308
310
  }, /*#__PURE__*/_react.default.createElement(_Inputs.Input, {
@@ -67,6 +67,7 @@ var BusinessInfoComponent = exports.BusinessInfoComponent = function BusinessInf
67
67
  var layoutsWithOldSearch = ['starbucks', 'old', 'floating'];
68
68
  var hideSearch = layoutsWithOldSearch.includes(theme === null || theme === void 0 || (_theme$business_view7 = theme.business_view) === null || _theme$business_view7 === void 0 || (_theme$business_view7 = _theme$business_view7.components) === null || _theme$business_view7 === void 0 || (_theme$business_view7 = _theme$business_view7.product_search) === null || _theme$business_view7 === void 0 || (_theme$business_view7 = _theme$business_view7.components) === null || _theme$business_view7 === void 0 || (_theme$business_view7 = _theme$business_view7.layout) === null || _theme$business_view7 === void 0 ? void 0 : _theme$business_view7.type);
69
69
  var isPreOrderSetting = (configs === null || configs === void 0 || (_configs$preorder_sta = configs.preorder_status_enabled) === null || _configs$preorder_sta === void 0 ? void 0 : _configs$preorder_sta.value) === '1';
70
+ var singleBusinessRedirect = window.localStorage.getItem('single_business');
70
71
  var searchComponentProps = {
71
72
  setOpenSearchProducts: setOpenSearchProducts,
72
73
  handleChangeSortBy: handleChangeSortBy,
@@ -81,7 +82,8 @@ var BusinessInfoComponent = exports.BusinessInfoComponent = function BusinessInf
81
82
  }, /*#__PURE__*/_react.default.createElement(_styles.BusinessInfoItem, {
82
83
  isInfoShrunken: isInfoShrunken
83
84
  }, !loading ? /*#__PURE__*/_react.default.createElement(_styles.TitleWrapper, {
84
- isCustomLayout: isCustomLayout
85
+ isCustomLayout: isCustomLayout,
86
+ disableLeftSpace: singleBusinessRedirect
85
87
  }, /*#__PURE__*/_react.default.createElement("h2", {
86
88
  className: "bold",
87
89
  id: "business_name"
@@ -7,7 +7,7 @@ Object.defineProperty(exports, "__esModule", {
7
7
  exports.WrapperSearch = exports.WrapperFloatingSearch = exports.WrapperBusinessLogo = exports.TitleWrapper = exports.SocialList = exports.SearchWrapper = exports.SearchIconWrapper = exports.SearchComponentContainer = exports.RibbonBox = exports.IconWrapper = exports.CategorySelectedContainer = exports.BusinessMoreDetail = exports.BusinessLogo = exports.BusinessInfoWrapper = exports.BusinessInfoItem = exports.BusinessInfoContent = exports.BusinessInfoContainer = exports.BusinessInfo = exports.BusinessDetail = exports.BusinessContent = exports.BusinessContainer = exports.BackButton = void 0;
8
8
  var _react = _interopRequireDefault(require("react"));
9
9
  var _styledComponents = _interopRequireWildcard(require("styled-components"));
10
- var _templateObject, _templateObject2, _templateObject3, _templateObject4, _templateObject5, _templateObject6, _templateObject7, _templateObject8, _templateObject9, _templateObject10, _templateObject11, _templateObject12, _templateObject13, _templateObject14, _templateObject15, _templateObject16, _templateObject17, _templateObject18, _templateObject19, _templateObject20, _templateObject21, _templateObject22, _templateObject23, _templateObject24, _templateObject25, _templateObject26, _templateObject27, _templateObject28, _templateObject29, _templateObject30, _templateObject31, _templateObject32, _templateObject33, _templateObject34, _templateObject35, _templateObject36, _templateObject37, _templateObject38, _templateObject39, _templateObject40, _templateObject41, _templateObject42, _templateObject43, _templateObject44, _templateObject45, _templateObject46, _templateObject47, _templateObject48, _templateObject49, _templateObject50, _templateObject51, _templateObject52, _templateObject53, _templateObject54, _templateObject55;
10
+ var _templateObject, _templateObject2, _templateObject3, _templateObject4, _templateObject5, _templateObject6, _templateObject7, _templateObject8, _templateObject9, _templateObject10, _templateObject11, _templateObject12, _templateObject13, _templateObject14, _templateObject15, _templateObject16, _templateObject17, _templateObject18, _templateObject19, _templateObject20, _templateObject21, _templateObject22, _templateObject23, _templateObject24, _templateObject25, _templateObject26, _templateObject27, _templateObject28, _templateObject29, _templateObject30, _templateObject31, _templateObject32, _templateObject33, _templateObject34, _templateObject35, _templateObject36, _templateObject37, _templateObject38, _templateObject39, _templateObject40, _templateObject41, _templateObject42, _templateObject43, _templateObject44, _templateObject45, _templateObject46, _templateObject47, _templateObject48, _templateObject49, _templateObject50, _templateObject51, _templateObject52, _templateObject53, _templateObject54, _templateObject55, _templateObject56, _templateObject57, _templateObject58;
11
11
  function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(e) { return e ? t : r; })(e); }
12
12
  function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != _typeof(e) && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && Object.prototype.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
13
13
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
@@ -103,7 +103,7 @@ var BusinessMoreDetail = exports.BusinessMoreDetail = _styledComponents.default.
103
103
  }, function (props) {
104
104
  return props.position ? 'black' : 'white';
105
105
  });
106
- var TitleWrapper = exports.TitleWrapper = _styledComponents.default.div(_templateObject32 || (_templateObject32 = _taggedTemplateLiteral(["\n display: flex;\n align-items: center;\n flex-wrap: wrap;\n\n h2 {\n font-size: 24px;\n line-height: 36px;\n margin: 0 0 10px 0;\n font-weight: 600;\n width: 100%;\n overflow: hidden;\n white-space: nowrap;\n text-overflow: ellipsis;\n background: ", ";\n &.fixed-name {\n z-index: 10001;\n position: fixed;\n top: 0;\n padding: 10px 0;\n font-size: 18px;\n ", "\n }\n @media (min-width: 768px) {\n font-size: 32px;\n }\n }\n"])), function (_ref5) {
106
+ var TitleWrapper = exports.TitleWrapper = _styledComponents.default.div(_templateObject32 || (_templateObject32 = _taggedTemplateLiteral(["\n display: flex;\n align-items: center;\n flex-wrap: wrap;\n\n h2 {\n font-size: 24px;\n line-height: 36px;\n margin: 0 0 10px 0;\n font-weight: 600;\n width: 100%;\n overflow: hidden;\n white-space: nowrap;\n text-overflow: ellipsis;\n background: ", ";\n &.fixed-name {\n z-index: 10001;\n position: fixed;\n top: 0;\n padding: 10px 0;\n font-size: 18px;\n ", "\n ", "\n }\n @media (min-width: 768px) {\n font-size: 32px;\n }\n }\n"])), function (_ref5) {
107
107
  var _theme$colors;
108
108
  var theme = _ref5.theme;
109
109
  return theme === null || theme === void 0 || (_theme$colors = theme.colors) === null || _theme$colors === void 0 ? void 0 : _theme$colors.backgroundPage;
@@ -116,57 +116,63 @@ var TitleWrapper = exports.TitleWrapper = _styledComponents.default.div(_templat
116
116
  var _props$theme12;
117
117
  return (_props$theme12 = props.theme) !== null && _props$theme12 !== void 0 && _props$theme12.rtl ? (0, _styledComponents.css)(_templateObject37 || (_templateObject37 = _taggedTemplateLiteral(["\n right: 10px;\n "]))) : (0, _styledComponents.css)(_templateObject38 || (_templateObject38 = _taggedTemplateLiteral(["\n left: 10px;\n "])));
118
118
  });
119
+ }, function (_ref7) {
120
+ var disableLeftSpace = _ref7.disableLeftSpace;
121
+ return disableLeftSpace && (0, _styledComponents.css)(_templateObject39 || (_templateObject39 = _taggedTemplateLiteral(["\n ", "\n "])), function (props) {
122
+ var _props$theme13;
123
+ return (_props$theme13 = props.theme) !== null && _props$theme13 !== void 0 && _props$theme13.rtl ? (0, _styledComponents.css)(_templateObject40 || (_templateObject40 = _taggedTemplateLiteral(["\n right: 48px;\n "]))) : (0, _styledComponents.css)(_templateObject41 || (_templateObject41 = _taggedTemplateLiteral(["\n left: 48px;\n "])));
124
+ });
119
125
  });
120
- var RibbonBox = exports.RibbonBox = _styledComponents.default.div(_templateObject39 || (_templateObject39 = _taggedTemplateLiteral(["\n padding: 2px 8px;\n box-sizing: border-box;\n z-index: 10;\n color: ", ";\n font-weight: 400;\n font-size: 10px;\n line-height: 13px;\n background-color: ", ";\n max-width: 200px;\n display: -webkit-box;\n -webkit-box-orient: vertical;\n -webkit-line-clamp: 2;\n overflow: hidden;\n margin-left: 5px;\n margin-bottom: 10px;\n\n ", "\n\n ", "\n\n ", "\n\n ", "\n\n ", "\n\n ", "\n"])), function (props) {
126
+ var RibbonBox = exports.RibbonBox = _styledComponents.default.div(_templateObject42 || (_templateObject42 = _taggedTemplateLiteral(["\n padding: 2px 8px;\n box-sizing: border-box;\n z-index: 10;\n color: ", ";\n font-weight: 400;\n font-size: 10px;\n line-height: 13px;\n background-color: ", ";\n max-width: 200px;\n display: -webkit-box;\n -webkit-box-orient: vertical;\n -webkit-line-clamp: 2;\n overflow: hidden;\n margin-left: 5px;\n margin-bottom: 10px;\n\n ", "\n\n ", "\n\n ", "\n\n ", "\n\n ", "\n\n ", "\n"])), function (props) {
121
127
  return props.theme.colors.colorTextSignForm;
122
128
  }, function (props) {
123
129
  return props.theme.colors.primary;
124
130
  }, function (props) {
125
- return props.theme.rtl && (0, _styledComponents.css)(_templateObject40 || (_templateObject40 = _taggedTemplateLiteral(["\n margin-left: 0px;\n margin-right: 5px;\n "])));
126
- }, function (_ref7) {
127
- var bgColor = _ref7.bgColor;
128
- return bgColor && (0, _styledComponents.css)(_templateObject41 || (_templateObject41 = _taggedTemplateLiteral(["\n background-color: ", ";\n "])), bgColor);
131
+ return props.theme.rtl && (0, _styledComponents.css)(_templateObject43 || (_templateObject43 = _taggedTemplateLiteral(["\n margin-left: 0px;\n margin-right: 5px;\n "])));
129
132
  }, function (_ref8) {
130
- var isRoundRect = _ref8.isRoundRect;
131
- return isRoundRect && (0, _styledComponents.css)(_templateObject42 || (_templateObject42 = _taggedTemplateLiteral(["\n border-radius: 7.6px;\n "])));
133
+ var bgColor = _ref8.bgColor;
134
+ return bgColor && (0, _styledComponents.css)(_templateObject44 || (_templateObject44 = _taggedTemplateLiteral(["\n background-color: ", ";\n "])), bgColor);
132
135
  }, function (_ref9) {
133
- var isCapsule = _ref9.isCapsule;
134
- return isCapsule && (0, _styledComponents.css)(_templateObject43 || (_templateObject43 = _taggedTemplateLiteral(["\n border-radius: 50px;\n "])));
136
+ var isRoundRect = _ref9.isRoundRect;
137
+ return isRoundRect && (0, _styledComponents.css)(_templateObject45 || (_templateObject45 = _taggedTemplateLiteral(["\n border-radius: 7.6px;\n "])));
135
138
  }, function (_ref10) {
136
- var colorText = _ref10.colorText;
137
- return colorText && (0, _styledComponents.css)(_templateObject44 || (_templateObject44 = _taggedTemplateLiteral(["\n color: ", ";\n "])), colorText ? 'black' : 'white');
139
+ var isCapsule = _ref10.isCapsule;
140
+ return isCapsule && (0, _styledComponents.css)(_templateObject46 || (_templateObject46 = _taggedTemplateLiteral(["\n border-radius: 50px;\n "])));
138
141
  }, function (_ref11) {
139
- var borderRibbon = _ref11.borderRibbon;
140
- return borderRibbon && (0, _styledComponents.css)(_templateObject45 || (_templateObject45 = _taggedTemplateLiteral(["\n border: 1px solid ", ";\n "])), borderRibbon ? 'black' : 'white');
142
+ var colorText = _ref11.colorText;
143
+ return colorText && (0, _styledComponents.css)(_templateObject47 || (_templateObject47 = _taggedTemplateLiteral(["\n color: ", ";\n "])), colorText ? 'black' : 'white');
144
+ }, function (_ref12) {
145
+ var borderRibbon = _ref12.borderRibbon;
146
+ return borderRibbon && (0, _styledComponents.css)(_templateObject48 || (_templateObject48 = _taggedTemplateLiteral(["\n border: 1px solid ", ";\n "])), borderRibbon ? 'black' : 'white');
141
147
  });
142
- var SearchIconWrapper = exports.SearchIconWrapper = _styledComponents.default.div(_templateObject46 || (_templateObject46 = _taggedTemplateLiteral(["\n cursor: pointer;\n background-color: ", ";\n width: 36px;\n height: 36px;\n border-radius: 50%;\n display: flex;\n align-items: center;\n justify-content: center;\n\n svg {\n font-size: 18px;\n }\n"])), function (props) {
148
+ var SearchIconWrapper = exports.SearchIconWrapper = _styledComponents.default.div(_templateObject49 || (_templateObject49 = _taggedTemplateLiteral(["\n cursor: pointer;\n background-color: ", ";\n width: 36px;\n height: 36px;\n border-radius: 50%;\n display: flex;\n align-items: center;\n justify-content: center;\n\n svg {\n font-size: 18px;\n }\n"])), function (props) {
143
149
  return props.theme.colors.gray200;
144
150
  });
145
- var SearchComponentContainer = exports.SearchComponentContainer = _styledComponents.default.div(_templateObject47 || (_templateObject47 = _taggedTemplateLiteral(["\n position: absolute;\n top: 10px;\n right: 60px;\n color: ", ";\n #select-input {\n color: #FFFFFF !important;\n }\n svg {\n color: #FFFFFF;\n }\n"])), function (_ref12) {
146
- var theme = _ref12.theme;
151
+ var SearchComponentContainer = exports.SearchComponentContainer = _styledComponents.default.div(_templateObject50 || (_templateObject50 = _taggedTemplateLiteral(["\n position: absolute;\n top: 10px;\n right: 60px;\n color: ", ";\n #select-input {\n color: #FFFFFF !important;\n }\n svg {\n color: #FFFFFF;\n }\n"])), function (_ref13) {
152
+ var theme = _ref13.theme;
147
153
  return theme.colors.white;
148
154
  });
149
- var SocialList = exports.SocialList = _styledComponents.default.div(_templateObject48 || (_templateObject48 = _taggedTemplateLiteral(["\n display: flex;\n align-items: center;\n margin-left: -3px;\n ", "\n"])), function (props) {
150
- return props.theme.rtl && (0, _styledComponents.css)(_templateObject49 || (_templateObject49 = _taggedTemplateLiteral(["\n margin-right: -3px;\n margin-left: 0px;\n "])));
155
+ var SocialList = exports.SocialList = _styledComponents.default.div(_templateObject51 || (_templateObject51 = _taggedTemplateLiteral(["\n display: flex;\n align-items: center;\n margin-left: -3px;\n ", "\n"])), function (props) {
156
+ return props.theme.rtl && (0, _styledComponents.css)(_templateObject52 || (_templateObject52 = _taggedTemplateLiteral(["\n margin-right: -3px;\n margin-left: 0px;\n "])));
151
157
  });
152
- var CategorySelectedContainer = exports.CategorySelectedContainer = _styledComponents.default.div(_templateObject50 || (_templateObject50 = _taggedTemplateLiteral(["\n display: inline;\n margin-left: 10px;\n color: ", ";\n padding-right: 5px;\n cursor: pointer;\n p{\n margin: 0;\n }\n svg {\n position: relative;\n top: 2px;\n margin-right: 3px;\n width: 14px;\n height: 14px;\n }\n"])), function (_ref13) {
158
+ var CategorySelectedContainer = exports.CategorySelectedContainer = _styledComponents.default.div(_templateObject53 || (_templateObject53 = _taggedTemplateLiteral(["\n display: inline;\n margin-left: 10px;\n color: ", ";\n padding-right: 5px;\n cursor: pointer;\n p{\n margin: 0;\n }\n svg {\n position: relative;\n top: 2px;\n margin-right: 3px;\n width: 14px;\n height: 14px;\n }\n"])), function (_ref14) {
153
159
  var _theme$colors2;
154
- var theme = _ref13.theme;
160
+ var theme = _ref14.theme;
155
161
  return theme === null || theme === void 0 || (_theme$colors2 = theme.colors) === null || _theme$colors2 === void 0 ? void 0 : _theme$colors2.primary;
156
162
  });
157
- var IconWrapper = exports.IconWrapper = _styledComponents.default.a(_templateObject51 || (_templateObject51 = _taggedTemplateLiteral(["\n margin: 0px 3px 10px 3px;\n border-radius: 3px;\n border: 0.5px solid ", ";\n width: 27px;\n height: 27px;\n min-width: 27px;\n display: flex;\n align-items: center;\n justify-content: center;\n cursor: pointer;\n transition: all 0.2s linear;\n\n ", "\n\n svg {\n height: 18px;\n font-size: 18px;\n transition: all 0.2s ease-in;\n color: ", ";\n }\n &:hover {\n background-color: ", ";\n svg {\n transform: scale(1.07);\n }\n }\n"])), function (props) {
163
+ var IconWrapper = exports.IconWrapper = _styledComponents.default.a(_templateObject54 || (_templateObject54 = _taggedTemplateLiteral(["\n margin: 0px 3px 10px 3px;\n border-radius: 3px;\n border: 0.5px solid ", ";\n width: 27px;\n height: 27px;\n min-width: 27px;\n display: flex;\n align-items: center;\n justify-content: center;\n cursor: pointer;\n transition: all 0.2s linear;\n\n ", "\n\n svg {\n height: 18px;\n font-size: 18px;\n transition: all 0.2s ease-in;\n color: ", ";\n }\n &:hover {\n background-color: ", ";\n svg {\n transform: scale(1.07);\n }\n }\n"])), function (props) {
158
164
  return props.theme.colors.gray200;
159
- }, function (_ref14) {
160
- var isSkeleton = _ref14.isSkeleton;
161
- return isSkeleton && (0, _styledComponents.css)(_templateObject52 || (_templateObject52 = _taggedTemplateLiteral(["\n border: none;\n "])));
165
+ }, function (_ref15) {
166
+ var isSkeleton = _ref15.isSkeleton;
167
+ return isSkeleton && (0, _styledComponents.css)(_templateObject55 || (_templateObject55 = _taggedTemplateLiteral(["\n border: none;\n "])));
162
168
  }, function (props) {
163
169
  return props.theme.colors.headingColor;
164
170
  }, function (props) {
165
171
  return props.theme.colors.gray200;
166
172
  });
167
- var BusinessInfoWrapper = exports.BusinessInfoWrapper = _styledComponents.default.div(_templateObject53 || (_templateObject53 = _taggedTemplateLiteral(["\n display: flex;\n flex-direction: column-reverse;\n @media (min-width: 768px) {\n flex-direction: column;\n }\n"])));
168
- var WrapperFloatingSearch = exports.WrapperFloatingSearch = _styledComponents.default.div(_templateObject54 || (_templateObject54 = _taggedTemplateLiteral(["\n position: absolute;\n color: ", ";\n display: flex;\n background: rgba(0,0,0,0.2);\n top: 80px;\n right: 10px;\n width: 80%;\n border-bottom: 1px solid #FFFFFF;\n #select-input {\n color: #FFFFFF !important;\n background: transparent;\n }\n svg, span {\n color: #FFFFFF !important;\n }\n @media (min-width: 681px){\n top: 23px;\n right: 60px;\n width: 300px;\n input {\n width: 80%;\n }\n }\n"])), function (_ref15) {
169
- var theme = _ref15.theme;
173
+ var BusinessInfoWrapper = exports.BusinessInfoWrapper = _styledComponents.default.div(_templateObject56 || (_templateObject56 = _taggedTemplateLiteral(["\n display: flex;\n flex-direction: column-reverse;\n @media (min-width: 768px) {\n flex-direction: column;\n }\n"])));
174
+ var WrapperFloatingSearch = exports.WrapperFloatingSearch = _styledComponents.default.div(_templateObject57 || (_templateObject57 = _taggedTemplateLiteral(["\n position: absolute;\n color: ", ";\n display: flex;\n background: rgba(0,0,0,0.2);\n top: 80px;\n right: 10px;\n width: 80%;\n border-bottom: 1px solid #FFFFFF;\n #select-input {\n color: #FFFFFF !important;\n background: transparent;\n }\n svg, span {\n color: #FFFFFF !important;\n }\n @media (min-width: 681px){\n top: 23px;\n right: 60px;\n width: 300px;\n input {\n width: 80%;\n }\n }\n"])), function (_ref16) {
175
+ var theme = _ref16.theme;
170
176
  return theme.colors.white;
171
177
  });
172
- var BackButton = exports.BackButton = _styledComponents.default.div(_templateObject55 || (_templateObject55 = _taggedTemplateLiteral(["\n button {\n display: flex;\n flex-direction: row;\n align-items: center;}\n margin-top: 10px;\n svg {\n margin-right: 10px;\n }\n }\n"])));
178
+ var BackButton = exports.BackButton = _styledComponents.default.div(_templateObject58 || (_templateObject58 = _taggedTemplateLiteral(["\n button {\n display: flex;\n flex-direction: row;\n align-items: center;}\n margin-top: 10px;\n svg {\n margin-right: 10px;\n }\n }\n"])));
@@ -165,6 +165,7 @@ var BusinessProductsListingUI = function BusinessProductsListingUI(props) {
165
165
  })) !== null && _Object$values$find !== void 0 ? _Object$values$find : {};
166
166
  var isLazy = businessState === null || businessState === void 0 || (_businessState$busine = businessState.business) === null || _businessState$busine === void 0 ? void 0 : _businessState$busine.lazy_load_products_recommended;
167
167
  var showViewOrderButton = !(theme !== null && theme !== void 0 && (_theme$business_view = theme.business_view) !== null && _theme$business_view !== void 0 && (_theme$business_view = _theme$business_view.components) !== null && _theme$business_view !== void 0 && (_theme$business_view = _theme$business_view.order_view_button) !== null && _theme$business_view !== void 0 && _theme$business_view.hidden);
168
+ var singleBusinessRedirect = window.localStorage.getItem('single_business');
168
169
  var headerThemeType = theme === null || theme === void 0 || (_theme$business_view2 = theme.business_view) === null || _theme$business_view2 === void 0 || (_theme$business_view2 = _theme$business_view2.components) === null || _theme$business_view2 === void 0 || (_theme$business_view2 = _theme$business_view2.header) === null || _theme$business_view2 === void 0 || (_theme$business_view2 = _theme$business_view2.components) === null || _theme$business_view2 === void 0 || (_theme$business_view2 = _theme$business_view2.layout) === null || _theme$business_view2 === void 0 ? void 0 : _theme$business_view2.type;
169
170
  var searchThemeType = theme === null || theme === void 0 || (_theme$business_view3 = theme.business_view) === null || _theme$business_view3 === void 0 || (_theme$business_view3 = _theme$business_view3.components) === null || _theme$business_view3 === void 0 || (_theme$business_view3 = _theme$business_view3.product_search) === null || _theme$business_view3 === void 0 || (_theme$business_view3 = _theme$business_view3.components) === null || _theme$business_view3 === void 0 || (_theme$business_view3 = _theme$business_view3.layout) === null || _theme$business_view3 === void 0 ? void 0 : _theme$business_view3.type;
170
171
  var fullWidthArrowThemes = ['starbucks', 'old', 'red'];
@@ -475,7 +476,7 @@ var BusinessProductsListingUI = function BusinessProductsListingUI(props) {
475
476
  }, [cateringPreorder, business]);
476
477
  return /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, /*#__PURE__*/_react.default.createElement(_styles.ProductsContainer, null, !props.useKioskApp && /*#__PURE__*/_react.default.createElement(_styles.HeaderContent, {
477
478
  useFullWidth: fullWidthArrowThemes.includes(searchThemeType) || fullWidthArrowThemes.includes(headerThemeType)
478
- }, !isCustomLayout && !location.pathname.includes('/marketplace') && /*#__PURE__*/_react.default.createElement("div", {
479
+ }, !isCustomLayout && !location.pathname.includes('/marketplace') && !singleBusinessRedirect && /*#__PURE__*/_react.default.createElement("div", {
479
480
  id: "back-arrow"
480
481
  }, /*#__PURE__*/_react.default.createElement(_reactBootstrapIcons.ArrowLeft, {
481
482
  className: "back-arrow",
@@ -53,7 +53,7 @@ function _iterableToArrayLimit(r, l) { var t = null == r ? null : "undefined" !=
53
53
  function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
54
54
  var PIXELS_TO_SCROLL = 300;
55
55
  var BusinessesListingUI = function BusinessesListingUI(props) {
56
- var _orderState$options, _citiesState$cities, _ref, _theme$business_listi, _orderState$options2, _theme$business_listi2, _theme$business_listi3, _theme$business_listi4, _theme$business_listi5, _theme$business_listi6, _theme$business_listi7, _businessesList$busin, _theme$header, _orderState$options3, _orderState$options4, _configs$order_types_, _businessesList$busin3, _orderState$options8, _orderState$options10, _configs$business_lis, _configs$business_lis2, _configs$business_lis3, _theme$images2, _theme$business_listi8, _orderState$options13, _theme$images3, _theme$images4, _configs$business_lis4, _theme$images5, _theme$business_listi9, _citiesState$cities5, _citiesState$cities6, _orderState$options15, _configs$advanced_bus2, _citiesState$cities7, _citiesState$cities8, _orderState$options17, _businessesList$busin5, _businessesList$busin6, _orderState$options20;
56
+ var _orderState$options, _citiesState$cities, _ref, _theme$business_listi, _orderState$options2, _theme$business_listi2, _theme$business_listi3, _theme$business_listi4, _theme$business_listi5, _theme$business_listi6, _theme$business_listi7, _businessesList$busin, _theme$header, _orderState$options3, _orderState$options4, _configs$order_types_, _businessesList$busin4, _orderState$options8, _orderState$options10, _configs$business_lis, _configs$business_lis2, _configs$business_lis3, _theme$images2, _theme$business_listi8, _orderState$options13, _theme$images3, _theme$images4, _configs$business_lis4, _theme$images5, _theme$business_listi9, _citiesState$cities5, _citiesState$cities6, _orderState$options15, _configs$advanced_bus2, _citiesState$cities7, _citiesState$cities8, _orderState$options17, _businessesList$busin6, _businessesList$busin7, _orderState$options20;
57
57
  var businessesList = props.businessesList,
58
58
  paginationProps = props.paginationProps,
59
59
  searchValue = props.searchValue,
@@ -244,9 +244,15 @@ var BusinessesListingUI = function BusinessesListingUI(props) {
244
244
  if (preorderBusiness) setIsPreorder(true);
245
245
  }, [preorderBusiness]);
246
246
  (0, _react.useEffect)(function () {
247
- var _businessesList$busin2;
247
+ var _businessesList$busin2, _businessesList$busin3, _configs$activate_sin;
248
248
  setActiveMap(false);
249
249
  if (!(businessesList !== null && businessesList !== void 0 && (_businessesList$busin2 = businessesList.businesses) !== null && _businessesList$busin2 !== void 0 && _businessesList$busin2.length)) return;
250
+ if ((businessesList === null || businessesList === void 0 || (_businessesList$busin3 = businessesList.businesses) === null || _businessesList$busin3 === void 0 ? void 0 : _businessesList$busin3.length) === 1 && (configs === null || configs === void 0 || (_configs$activate_sin = configs.activate_single_store_automatically) === null || _configs$activate_sin === void 0 ? void 0 : _configs$activate_sin.value) === '1') {
251
+ onBusinessClick(businessesList === null || businessesList === void 0 ? void 0 : businessesList.businesses[0]);
252
+ window.localStorage.setItem('single_business', true);
253
+ return;
254
+ }
255
+ window.localStorage.removeItem('single_business');
250
256
  var ids = _toConsumableArray(favoriteIds);
251
257
  businessesList.businesses.forEach(function (business) {
252
258
  if (business !== null && business !== void 0 && business.favorite) {
@@ -254,7 +260,7 @@ var BusinessesListingUI = function BusinessesListingUI(props) {
254
260
  }
255
261
  });
256
262
  setFavoriteIds(_toConsumableArray(new Set(ids)));
257
- }, [businessesList === null || businessesList === void 0 || (_businessesList$busin3 = businessesList.businesses) === null || _businessesList$busin3 === void 0 ? void 0 : _businessesList$busin3.length]);
263
+ }, [businessesList === null || businessesList === void 0 || (_businessesList$busin4 = businessesList.businesses) === null || _businessesList$busin4 === void 0 ? void 0 : _businessesList$busin4.length]);
258
264
  (0, _react.useEffect)(function () {
259
265
  var _citiesState$cities3, _orderState$options6, _citiesState$cities4;
260
266
  if (!(citiesState !== null && citiesState !== void 0 && (_citiesState$cities3 = citiesState.cities) !== null && _citiesState$cities3 !== void 0 && _citiesState$cities3.length) || !(orderState !== null && orderState !== void 0 && (_orderState$options6 = orderState.options) !== null && _orderState$options6 !== void 0 && _orderState$options6.city_id)) return;
@@ -287,16 +293,16 @@ var BusinessesListingUI = function BusinessesListingUI(props) {
287
293
  }));
288
294
  };
289
295
  if (logosLayout) {
290
- var _businessesList$busin4;
296
+ var _businessesList$busin5;
291
297
  return /*#__PURE__*/_react.default.createElement(_styles.BusinessLogosWrapper, null, /*#__PURE__*/_react.default.createElement(_styles.BusinessLogosContainer, null, /*#__PURE__*/_react.default.createElement(_AutoScroll.AutoScroll, {
292
298
  scrollId: "businessLogos"
293
299
  }, businessesList !== null && businessesList !== void 0 && businessesList.loading ? /*#__PURE__*/_react.default.createElement(_reactLoadingSkeleton.default, {
294
300
  count: 12,
295
301
  height: 75,
296
302
  width: 75
297
- }) : /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, (_businessesList$busin4 = businessesList.businesses) === null || _businessesList$busin4 === void 0 || (_businessesList$busin4 = _businessesList$busin4.filter(function (business) {
303
+ }) : /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, (_businessesList$busin5 = businessesList.businesses) === null || _businessesList$busin5 === void 0 || (_businessesList$busin5 = _businessesList$busin5.filter(function (business) {
298
304
  return business === null || business === void 0 ? void 0 : business.open;
299
- })) === null || _businessesList$busin4 === void 0 ? void 0 : _businessesList$busin4.map(function (business) {
305
+ })) === null || _businessesList$busin5 === void 0 ? void 0 : _businessesList$busin5.map(function (business) {
300
306
  var _theme$images;
301
307
  return /*#__PURE__*/_react.default.createElement(_styles.BusinessLogo, {
302
308
  key: business === null || business === void 0 ? void 0 : business.id,
@@ -317,7 +323,9 @@ var BusinessesListingUI = function BusinessesListingUI(props) {
317
323
  }), (configs === null || configs === void 0 || (_configs$business_lis3 = configs.business_listing_hide_image) === null || _configs$business_lis3 === void 0 ? void 0 : _configs$business_lis3.value) !== '1' && !isChew && !hideHero && !isCustomerMode && /*#__PURE__*/_react.default.createElement(_styles.BusinessHeroImg, {
318
324
  bgimage: (_theme$images2 = theme.images) === null || _theme$images2 === void 0 || (_theme$images2 = _theme$images2.general) === null || _theme$images2 === void 0 ? void 0 : _theme$images2.businessHero,
319
325
  height: theme === null || theme === void 0 || (_theme$business_listi8 = theme.business_listing_view) === null || _theme$business_listi8 === void 0 || (_theme$business_listi8 = _theme$business_listi8.components) === null || _theme$business_listi8 === void 0 || (_theme$business_listi8 = _theme$business_listi8.business_hero) === null || _theme$business_listi8 === void 0 || (_theme$business_listi8 = _theme$business_listi8.style) === null || _theme$business_listi8 === void 0 ? void 0 : _theme$business_listi8.height
320
- })), userCustomer && (orderState === null || orderState === void 0 || (_orderState$options13 = orderState.options) === null || _orderState$options13 === void 0 || (_orderState$options13 = _orderState$options13.address) === null || _orderState$options13 === void 0 ? void 0 : _orderState$options13.address) && isCustomerMode && /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, /*#__PURE__*/_react.default.createElement(_styles.Title, null, t('DELIVERY_TYPE', 'Delivery Type')), /*#__PURE__*/_react.default.createElement(_styles.TypesContainer, null, configTypes.includes(1) && /*#__PURE__*/_react.default.createElement(_styles.TypeButton, {
326
+ })), userCustomer && (orderState === null || orderState === void 0 || (_orderState$options13 = orderState.options) === null || _orderState$options13 === void 0 || (_orderState$options13 = _orderState$options13.address) === null || _orderState$options13 === void 0 ? void 0 : _orderState$options13.address) && isCustomerMode && /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, (configTypes.includes(1) || configTypes.some(function (type) {
327
+ return pickupTypes.includes(type);
328
+ })) && /*#__PURE__*/_react.default.createElement(_styles.Title, null, t('DELIVERY_TYPE', 'Delivery Type')), /*#__PURE__*/_react.default.createElement(_styles.TypesContainer, null, configTypes.includes(1) && /*#__PURE__*/_react.default.createElement(_styles.TypeButton, {
321
329
  onClick: function onClick() {
322
330
  return handleChangeType(1);
323
331
  },
@@ -431,7 +439,7 @@ var BusinessesListingUI = function BusinessesListingUI(props) {
431
439
  businessList: businessesList.businesses,
432
440
  userLocation: orderState === null || orderState === void 0 || (_orderState$options17 = orderState.options) === null || _orderState$options17 === void 0 || (_orderState$options17 = _orderState$options17.address) === null || _orderState$options17 === void 0 ? void 0 : _orderState$options17.location,
433
441
  setErrors: setMapErrors
434
- }), /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, (!isCustomLayout && isCustomerMode && (businessesList === null || businessesList === void 0 || (_businessesList$busin5 = businessesList.businesses) === null || _businessesList$busin5 === void 0 ? void 0 : _businessesList$busin5.length) > 0 || isChew) && /*#__PURE__*/_react.default.createElement(_styles.BusinessesTitle, null, t('BUSINESSES', 'Businesses')), /*#__PURE__*/_react.default.createElement(_styles.BusinessList, null, !businessesList.loading && businessesList.businesses.length === 0 && (businessesList === null || businessesList === void 0 ? void 0 : businessesList.fetched) && /*#__PURE__*/_react.default.createElement(_NotFoundSource.NotFoundSource, {
442
+ }), /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, (!isCustomLayout && isCustomerMode && (businessesList === null || businessesList === void 0 || (_businessesList$busin6 = businessesList.businesses) === null || _businessesList$busin6 === void 0 ? void 0 : _businessesList$busin6.length) > 0 || isChew) && /*#__PURE__*/_react.default.createElement(_styles.BusinessesTitle, null, t('BUSINESSES', 'Businesses')), /*#__PURE__*/_react.default.createElement(_styles.BusinessList, null, !businessesList.loading && businessesList.businesses.length === 0 && (businessesList === null || businessesList === void 0 ? void 0 : businessesList.fetched) && /*#__PURE__*/_react.default.createElement(_NotFoundSource.NotFoundSource, {
435
443
  content: t('NOT_FOUND_BUSINESSES', 'No businesses to delivery / pick up at this address, please change filters or change address.')
436
444
  }, /*#__PURE__*/_react.default.createElement(_Buttons.Button, {
437
445
  outline: true,
@@ -442,7 +450,7 @@ var BusinessesListingUI = function BusinessesListingUI(props) {
442
450
  style: {
443
451
  height: '44px'
444
452
  }
445
- }, t('CHANGE_ADDRESS', 'Select other Address'))), (_businessesList$busin6 = businessesList.businesses) === null || _businessesList$busin6 === void 0 ? void 0 : _businessesList$busin6.map(function (business) {
453
+ }, t('CHANGE_ADDRESS', 'Select other Address'))), (_businessesList$busin7 = businessesList.businesses) === null || _businessesList$busin7 === void 0 ? void 0 : _businessesList$busin7.map(function (business) {
446
454
  var _orderState$options18, _business$reviews;
447
455
  return /*#__PURE__*/_react.default.createElement(_BusinessController.BusinessController, {
448
456
  key: business.id,
@@ -168,9 +168,7 @@ var PageBannerUI = function PageBannerUI(props) {
168
168
  }
169
169
  }
170
170
  };
171
- return /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, pageBannerState.loading ? /*#__PURE__*/_react.default.createElement(_styles.BannerContainer, null, /*#__PURE__*/_react.default.createElement(_reactLoadingSkeleton.default, {
172
- height: 250
173
- })) : ((_pageBannerState$bann = pageBannerState.banner) === null || _pageBannerState$bann === void 0 || (_pageBannerState$bann = _pageBannerState$bann.items) === null || _pageBannerState$bann === void 0 ? void 0 : _pageBannerState$bann.length) > 0 && /*#__PURE__*/_react.default.createElement(_styles.BannerContainer, null, /*#__PURE__*/_react.default.createElement(_react2.Swiper, {
171
+ return /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, ((_pageBannerState$bann = pageBannerState.banner) === null || _pageBannerState$bann === void 0 || (_pageBannerState$bann = _pageBannerState$bann.items) === null || _pageBannerState$bann === void 0 ? void 0 : _pageBannerState$bann.length) > 0 && /*#__PURE__*/_react.default.createElement(_styles.BannerContainer, null, /*#__PURE__*/_react.default.createElement(_react2.Swiper, {
174
172
  navigation: ((_pageBannerState$bann2 = pageBannerState.banner) === null || _pageBannerState$bann2 === void 0 || (_pageBannerState$bann2 = _pageBannerState$bann2.items) === null || _pageBannerState$bann2 === void 0 ? void 0 : _pageBannerState$bann2.length) > 1,
175
173
  spaceBetween: 0,
176
174
  shortSwipes: false,
@@ -29,7 +29,7 @@ var CardContainer = exports.CardContainer = _styledComponents.default.div(_templ
29
29
  var productsRows = _ref4.productsRows;
30
30
  return productsRows ? (0, _styledComponents.css)(_templateObject5 || (_templateObject5 = _taggedTemplateLiteral(["\n width: ", ";\n margin: 10px 0;\n "])), function () {
31
31
  return productsRows === 3 ? 'calc(33% - 20px)' : 'calc(50% - 20px)';
32
- }) : (0, _styledComponents.css)(_templateObject6 || (_templateObject6 = _taggedTemplateLiteral(["\n width: 100%;\n margin: 10px;\n @media (min-width: 576px) {\n margin: 10px;\n width: calc(100% - 20px);\n }\n ", "\n\n "])), function (_ref5) {
32
+ }) : (0, _styledComponents.css)(_templateObject6 || (_templateObject6 = _taggedTemplateLiteral(["\n width: 100%;\n margin: 10px;\n @media (min-width: 576px) {\n margin: 10px;\n width: calc(100% - 20px);\n }\n ", "\n \n "])), function (_ref5) {
33
33
  var isCartOnProductsList = _ref5.isCartOnProductsList;
34
34
  return isCartOnProductsList ? (0, _styledComponents.css)(_templateObject7 || (_templateObject7 = _taggedTemplateLiteral(["\n @media (min-width: 993px) {\n width: calc(50% - 20px);\n margin: 10px 20px 10px 0px;\n ", "\n }\n "])), function (props) {
35
35
  var _props$theme;
@@ -263,7 +263,8 @@ var CheckoutUI = function CheckoutUI(props) {
263
263
  businessId: cart === null || cart === void 0 ? void 0 : cart.business_id,
264
264
  apiKey: configs === null || configs === void 0 || (_configs$google_maps_ = configs.google_maps_api_key) === null || _configs$google_maps_ === void 0 ? void 0 : _configs$google_maps_.value,
265
265
  mapConfigs: mapConfigs,
266
- isCustomerMode: isCustomerMode
266
+ isCustomerMode: isCustomerMode,
267
+ cart: cart
267
268
  })), (_props$beforeElements3 = props.beforeElementsSectionTwo) === null || _props$beforeElements3 === void 0 ? void 0 : _props$beforeElements3.map(function (BeforeElement, i) {
268
269
  return /*#__PURE__*/_react.default.createElement(_react.default.Fragment, {
269
270
  key: i
@@ -248,7 +248,8 @@ var CheckoutUI = function CheckoutUI(props) {
248
248
  businessId: cart === null || cart === void 0 ? void 0 : cart.business_id,
249
249
  apiKey: (_configState$configs5 = configState.configs) === null || _configState$configs5 === void 0 || (_configState$configs5 = _configState$configs5.google_maps_api_key) === null || _configState$configs5 === void 0 ? void 0 : _configState$configs5.value,
250
250
  mapConfigs: mapConfigs,
251
- isCustomerMode: isCustomerMode
251
+ isCustomerMode: isCustomerMode,
252
+ cart: cart
252
253
  })), (_props$beforeElements3 = props.beforeElementsSectionTwo) === null || _props$beforeElements3 === void 0 ? void 0 : _props$beforeElements3.map(function (BeforeElement, i) {
253
254
  return /*#__PURE__*/_react.default.createElement(_react.default.Fragment, {
254
255
  key: i
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "ordering-ui-external",
3
- "version": "14.0.10",
3
+ "version": "14.0.12",
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.8",
91
+ "ordering-components-external": "13.0.10",
92
92
  "payment": "^2.4.6",
93
93
  "polished": "^3.6.6",
94
94
  "react-bootstrap-icons": "^1.7.2",
@@ -227,6 +227,7 @@ const CheckoutUI = (props) => {
227
227
  apiKey={configs?.google_maps_api_key?.value}
228
228
  mapConfigs={mapConfigs}
229
229
  isCustomerMode={isCustomerMode}
230
+ cart={cart}
230
231
  />
231
232
  )
232
233
  )}
@@ -59,7 +59,7 @@ export const Header = (props) => {
59
59
  const [{ parseDate }] = useUtils()
60
60
  const [, t] = useLanguage()
61
61
  const [{ auth, user }] = useSession()
62
- const [orderState, { refreshOrderOptions }] = useOrder()
62
+ const [orderState, { refreshOrderOptions, changeType }] = useOrder()
63
63
  const [openPopover, setOpenPopover] = useState({})
64
64
  const theme = useTheme()
65
65
  const [configState] = useConfig()
@@ -93,7 +93,7 @@ export const Header = (props) => {
93
93
  content: t('QUESTION_CLEAR_CUSTOMER', theme?.defaultLanguages?.QUESTION_CLEAR_CUSTOMER || 'Are you sure that you want to clear the customer?'),
94
94
  handleOnAccept: () => {
95
95
  deleteUserCustomer(true)
96
- // refreshOrderOptions()
96
+ changeType(1)
97
97
  handleGoToPage({ page: 'home' })
98
98
  setConfirm({ ...confirm, open: false })
99
99
  }
@@ -219,9 +219,7 @@ const PhoneAutocompleteUI = (props) => {
219
219
  }, [urlPhone, customersPhones?.loading])
220
220
 
221
221
  useEffect(() => {
222
- if (pickupTypes.includes(orderState?.options?.type)) {
223
- setIsPickupSelected(true)
224
- }
222
+ setIsPickupSelected(!!pickupTypes.includes(orderState?.options?.type))
225
223
  }, [orderState?.options?.type])
226
224
 
227
225
  useEffect(() => {
@@ -153,6 +153,12 @@ const SignUpFormUI = (props) => {
153
153
  }
154
154
  }
155
155
 
156
+ const preventWhiteSpaceOnKeyDown = (e) => {
157
+ if (e.key === " ") {
158
+ e.preventDefault()
159
+ }
160
+ }
161
+
156
162
  useEffect(() => {
157
163
  if (!formState.loading && formState.result?.error) {
158
164
  if (formState.result?.result?.[0] === 'ERROR_AUTH_VERIFICATION_CODE') {
@@ -192,17 +198,7 @@ const SignUpFormUI = (props) => {
192
198
  useEffect(() => {
193
199
  if (!validationFields.loading) {
194
200
  Object.values(validationFields?.fields?.checkout).map(field => !notValidationFields.includes(field.code) && (
195
- field.code === 'email' ? (
196
- formMethods.register('email', {
197
- required: isRequiredField(field.code)
198
- ? t('VALIDATION_ERROR_EMAIL_REQUIRED', 'The field Email is required').replace('_attribute_', t('EMAIL', 'Email'))
199
- : null,
200
- pattern: {
201
- value: /^[A-Z0-9._%+-]+@[A-Z0-9.-]+\.[A-Z]{2,}$/i,
202
- message: t('INVALID_ERROR_EMAIL', 'Invalid email address').replace('_attribute_', t('EMAIL', 'Email'))
203
- }
204
- })
205
- ) : (
201
+ field.code !== 'email' && (
206
202
  formMethods.register(field.code, {
207
203
  required: isRequiredField(field.code)
208
204
  ? t(`VALIDATION_ERROR_${field.code.toUpperCase()}_REQUIRED`, `${field.name} is required`).replace('_attribute_', t(field.name, field.code))
@@ -278,13 +274,15 @@ const SignUpFormUI = (props) => {
278
274
  name={field.code}
279
275
  aria-label={field.code}
280
276
  className='form'
281
- placeholder={!field.required ? t(field.code.toUpperCase() + '_OPTIONAL', field.name + ' (Optional)') : t(field.code.toUpperCase(), field.name)}
277
+ placeholder={t(field.code.toUpperCase() + '_OPTIONAL', field.name + ' (Optional)')}
282
278
  onChange={handleChangeInputEmail}
283
- ref={(e) => {
284
- emailInput.current = e
285
- }}
286
- required={!!field.required}
287
- autoComplete='off'
279
+ ref={formMethods.register({
280
+ required: null,
281
+ pattern: /^[A-Z0-9._%+-]+@[A-Z0-9.-]+\.[A-Z]{2,}$/i
282
+ })}
283
+ onKeyDown={preventWhiteSpaceOnKeyDown}
284
+ autoComplete='on'
285
+ isError={formMethods.errors?.email && !notValidationFields.includes(field.code)}
288
286
  />
289
287
  <InputBeforeIcon>
290
288
  <Envelope />
@@ -42,6 +42,7 @@ export const BusinessInfoComponent = (props) => {
42
42
  const layoutsWithOldSearch = ['starbucks', 'old', 'floating']
43
43
  const hideSearch = layoutsWithOldSearch.includes(theme?.business_view?.components?.product_search?.components?.layout?.type)
44
44
  const isPreOrderSetting = configs?.preorder_status_enabled?.value === '1'
45
+ const singleBusinessRedirect = window.localStorage.getItem('single_business')
45
46
 
46
47
  const searchComponentProps = {
47
48
  setOpenSearchProducts,
@@ -56,7 +57,7 @@ export const BusinessInfoComponent = (props) => {
56
57
  <BusinessInfo className='info'>
57
58
  <BusinessInfoItem isInfoShrunken={isInfoShrunken}>
58
59
  {!loading ? (
59
- <TitleWrapper isCustomLayout={isCustomLayout}>
60
+ <TitleWrapper isCustomLayout={isCustomLayout} disableLeftSpace={singleBusinessRedirect}>
60
61
  <h2 className='bold' id='business_name'>{business?.name}</h2>
61
62
  {business?.ribbon?.enabled && (
62
63
  <RibbonBox
@@ -187,7 +187,7 @@ export const BusinessInfoContainer = styled.div`
187
187
  ${({ isChew }) => isChew && css`
188
188
  background: none;
189
189
  `
190
- }
190
+ }
191
191
  }
192
192
 
193
193
  @media (min-width: 576px) {
@@ -399,6 +399,13 @@ export const TitleWrapper = styled.div`
399
399
  left: 10px;
400
400
  `}
401
401
  `}
402
+ ${({ disableLeftSpace }) => disableLeftSpace && css`
403
+ ${props => props.theme?.rtl ? css`
404
+ right: 48px;
405
+ ` : css`
406
+ left: 48px;
407
+ `}
408
+ `}
402
409
  }
403
410
  @media (min-width: 768px) {
404
411
  font-size: 32px;
@@ -118,6 +118,7 @@ const BusinessProductsListingUI = (props) => {
118
118
  const currentCart = Object.values(carts).find(cart => cart?.business?.slug === business?.slug) ?? {}
119
119
  const isLazy = businessState?.business?.lazy_load_products_recommended
120
120
  const showViewOrderButton = !theme?.business_view?.components?.order_view_button?.hidden
121
+ const singleBusinessRedirect = window.localStorage.getItem('single_business')
121
122
  const headerThemeType = theme?.business_view?.components?.header?.components?.layout?.type
122
123
  const searchThemeType = theme?.business_view?.components?.product_search?.components?.layout?.type
123
124
  const fullWidthArrowThemes = ['starbucks', 'old', 'red']
@@ -377,7 +378,7 @@ const BusinessProductsListingUI = (props) => {
377
378
  <ProductsContainer>
378
379
  {!props.useKioskApp && (
379
380
  <HeaderContent useFullWidth={fullWidthArrowThemes.includes(searchThemeType) || fullWidthArrowThemes.includes(headerThemeType)}>
380
- {!isCustomLayout && !location.pathname.includes('/marketplace') && (
381
+ {!isCustomLayout && !location.pathname.includes('/marketplace') && !singleBusinessRedirect && (
381
382
  <div id='back-arrow'>
382
383
  <ArrowLeft className='back-arrow' onClick={() => handleGoToBusinessList()} />
383
384
  </div>