ordering-ui-external 2.7.3 → 3.0.1

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 (32) hide show
  1. package/_bundles/{7.ordering-ui.7365de53b98736c4f829.js → 7.ordering-ui.b278a053085145d78d36.js} +1 -1
  2. package/_bundles/ordering-ui.b278a053085145d78d36.js +2 -0
  3. package/_modules/themes/five/src/components/BusinessInformation/index.js +9 -9
  4. package/_modules/themes/five/src/components/Header/index.js +1 -1
  5. package/_modules/themes/five/src/components/ProductForm/styles.js +1 -1
  6. package/_modules/themes/five/src/components/ScheduleAccordion/index.js +3 -3
  7. package/package.json +2 -2
  8. package/src/components/MomentContent/index.js +1 -1
  9. package/src/themes/callcenterOriginal/src/components/Shared/Modal/index.js +1 -1
  10. package/src/themes/five/src/components/BusinessInformation/index.js +7 -5
  11. package/src/themes/five/src/components/Header/index.js +1 -1
  12. package/src/themes/five/src/components/ProductForm/styles.js +2 -2
  13. package/src/themes/five/src/components/ScheduleAccordion/index.js +4 -4
  14. package/src/themes/two/src/components/Header/index.js +1 -1
  15. package/template/app.js +10 -6
  16. package/template/pages/BusinessProductsList/index.js +10 -4
  17. package/template/pages/BusinessesList/index.js +11 -4
  18. package/template/pages/Checkout/index.js +7 -2
  19. package/template/pages/Home/index.js +5 -2
  20. package/template/pages/MessagesList/index.js +7 -2
  21. package/template/pages/MyOrders/index.js +10 -3
  22. package/_bundles/ordering-ui.7365de53b98736c4f829.js +0 -2
  23. /package/_bundles/{0.ordering-ui.7365de53b98736c4f829.js → 0.ordering-ui.b278a053085145d78d36.js} +0 -0
  24. /package/_bundles/{1.ordering-ui.7365de53b98736c4f829.js → 1.ordering-ui.b278a053085145d78d36.js} +0 -0
  25. /package/_bundles/{2.ordering-ui.7365de53b98736c4f829.js → 2.ordering-ui.b278a053085145d78d36.js} +0 -0
  26. /package/_bundles/{4.ordering-ui.7365de53b98736c4f829.js → 4.ordering-ui.b278a053085145d78d36.js} +0 -0
  27. /package/_bundles/{5.ordering-ui.7365de53b98736c4f829.js → 5.ordering-ui.b278a053085145d78d36.js} +0 -0
  28. /package/_bundles/{6.ordering-ui.7365de53b98736c4f829.js → 6.ordering-ui.b278a053085145d78d36.js} +0 -0
  29. /package/_bundles/{7.ordering-ui.7365de53b98736c4f829.js.LICENSE.txt → 7.ordering-ui.b278a053085145d78d36.js.LICENSE.txt} +0 -0
  30. /package/_bundles/{8.ordering-ui.7365de53b98736c4f829.js → 8.ordering-ui.b278a053085145d78d36.js} +0 -0
  31. /package/_bundles/{9.ordering-ui.7365de53b98736c4f829.js → 9.ordering-ui.b278a053085145d78d36.js} +0 -0
  32. /package/_bundles/{ordering-ui.7365de53b98736c4f829.js.LICENSE.txt → ordering-ui.b278a053085145d78d36.js.LICENSE.txt} +0 -0
@@ -13,6 +13,7 @@ var _styles = require("./styles");
13
13
  var _MdClose = _interopRequireDefault(require("@meronex/icons/md/MdClose"));
14
14
  var _ScheduleAccordion = require("../ScheduleAccordion");
15
15
  var _styledComponents = require("styled-components");
16
+ var _moment = _interopRequireDefault(require("moment"));
16
17
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
17
18
  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); }
18
19
  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; }
@@ -29,7 +30,7 @@ function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len
29
30
  function _iterableToArrayLimit(arr, i) { var _i = null == arr ? null : "undefined" != typeof Symbol && arr[Symbol.iterator] || arr["@@iterator"]; if (null != _i) { var _s, _e, _x, _r, _arr = [], _n = !0, _d = !1; try { if (_x = (_i = _i.call(arr)).next, 0 === i) { if (Object(_i) !== _i) return; _n = !1; } else for (; !(_n = (_s = _x.call(_i)).done) && (_arr.push(_s.value), _arr.length !== i); _n = !0); } catch (err) { _d = !0, _e = err; } finally { try { if (!_n && null != _i.return && (_r = _i.return(), Object(_r) !== _r)) return; } finally { if (_d) throw _e; } } return _arr; } }
30
31
  function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
31
32
  var BusinessInformationUI = function BusinessInformationUI(props) {
32
- var _theme$business_view, _theme$business_view$, _theme$business_view$2, _theme$business_view$3, _theme$business_view$4, _theme$business_view2, _theme$business_view3, _theme$business_view4, _theme$business_view5, _theme$business_view6, _theme$business_view7, _theme$business_view8, _theme$business_view9, _theme$business_view10, _theme$business_view11, _theme$business_view12, _theme$business_view13, _theme$business_view14, _theme$business_view15, _theme$business_view16, _theme$business_view17, _theme$business_view18, _theme$business_view19, _theme$business_view20, _theme$business_view21, _theme$business_view22, _theme$business_view23, _theme$business_view24, _theme$business_view25, _theme$business_view26, _theme$business_view27, _theme$business_view28, _theme$business_view29, _theme$business_view30, _theme$business_view31, _theme$business_view32, _theme$business_view33, _theme$business_view34, _theme$business_view35, _theme$business_view36, _theme$business_view37, _theme$business_view38, _theme$business_view39, _theme$business_view40, _theme$business_view41, _props$beforeElements, _props$beforeComponen, _configs$google_maps_, _props$afterComponent, _props$afterElements;
33
+ var _theme$business_view, _theme$business_view$, _theme$business_view$2, _theme$business_view$3, _theme$business_view$4, _theme$business_view2, _theme$business_view3, _theme$business_view4, _theme$business_view5, _theme$business_view6, _theme$business_view7, _theme$business_view8, _theme$business_view9, _theme$business_view10, _theme$business_view11, _theme$business_view12, _theme$business_view13, _theme$business_view14, _theme$business_view15, _theme$business_view16, _theme$business_view17, _theme$business_view18, _theme$business_view19, _theme$business_view20, _theme$business_view21, _theme$business_view22, _theme$business_view23, _theme$business_view24, _theme$business_view25, _theme$business_view26, _theme$business_view27, _theme$business_view28, _theme$business_view29, _theme$business_view30, _theme$business_view31, _theme$business_view32, _theme$business_view33, _theme$business_view34, _theme$business_view35, _theme$business_view36, _theme$business_view37, _theme$business_view38, _theme$business_view39, _theme$business_view40, _theme$business_view41, _configs$general_hour, _props$beforeElements, _props$beforeComponen, _configs$google_maps_, _props$afterComponent, _props$afterElements;
33
34
  var business = props.business,
34
35
  businessLocation = props.businessLocation,
35
36
  businessSchedule = props.businessSchedule,
@@ -60,13 +61,12 @@ var BusinessInformationUI = function BusinessInformationUI(props) {
60
61
  var hidePickupTime = theme === null || theme === void 0 ? void 0 : (_theme$business_view27 = theme.business_view) === null || _theme$business_view27 === void 0 ? void 0 : (_theme$business_view28 = _theme$business_view27.components) === null || _theme$business_view28 === void 0 ? void 0 : (_theme$business_view29 = _theme$business_view28.information) === null || _theme$business_view29 === void 0 ? void 0 : (_theme$business_view30 = _theme$business_view29.components) === null || _theme$business_view30 === void 0 ? void 0 : (_theme$business_view31 = _theme$business_view30.pickup_time) === null || _theme$business_view31 === void 0 ? void 0 : _theme$business_view31.hidden;
61
62
  var hideImages = theme === null || theme === void 0 ? void 0 : (_theme$business_view32 = theme.business_view) === null || _theme$business_view32 === void 0 ? void 0 : (_theme$business_view33 = _theme$business_view32.components) === null || _theme$business_view33 === void 0 ? void 0 : (_theme$business_view34 = _theme$business_view33.information) === null || _theme$business_view34 === void 0 ? void 0 : (_theme$business_view35 = _theme$business_view34.components) === null || _theme$business_view35 === void 0 ? void 0 : (_theme$business_view36 = _theme$business_view35.images) === null || _theme$business_view36 === void 0 ? void 0 : _theme$business_view36.hidden;
62
63
  var hideAddress = theme === null || theme === void 0 ? void 0 : (_theme$business_view37 = theme.business_view) === null || _theme$business_view37 === void 0 ? void 0 : (_theme$business_view38 = _theme$business_view37.components) === null || _theme$business_view38 === void 0 ? void 0 : (_theme$business_view39 = _theme$business_view38.information) === null || _theme$business_view39 === void 0 ? void 0 : (_theme$business_view40 = _theme$business_view39.components) === null || _theme$business_view40 === void 0 ? void 0 : (_theme$business_view41 = _theme$business_view40.address) === null || _theme$business_view41 === void 0 ? void 0 : _theme$business_view41.hidden;
63
- var scheduleFormatted = function scheduleFormatted(_ref) {
64
- var hour = _ref.hour,
65
- minute = _ref.minute;
66
- var checkTime = function checkTime(val) {
67
- return val < 10 ? "0".concat(val) : val;
68
- };
69
- return "".concat(checkTime(hour), ":").concat(checkTime(minute));
64
+ var formatTime = configs === null || configs === void 0 ? void 0 : (_configs$general_hour = configs.general_hour_format) === null || _configs$general_hour === void 0 ? void 0 : _configs$general_hour.value;
65
+ var checkTime = function checkTime(val) {
66
+ return val < 10 ? "0".concat(val) : val;
67
+ };
68
+ var timeFormated = function timeFormated(time) {
69
+ return (0, _moment.default)("1900-01-01 ".concat(checkTime(time.hour), ":").concat(checkTime(time.minute))).format(formatTime);
70
70
  };
71
71
  var handleModalImage = function handleModalImage(src) {
72
72
  setImage(src);
@@ -92,7 +92,7 @@ var BusinessInformationUI = function BusinessInformationUI(props) {
92
92
  return /*#__PURE__*/_react.default.createElement(_ScheduleAccordion.ScheduleAccordion, {
93
93
  key: i,
94
94
  weekIndex: i,
95
- scheduleFormatted: scheduleFormatted,
95
+ timeFormated: timeFormated,
96
96
  schedule: schedule
97
97
  });
98
98
  }))), /*#__PURE__*/_react.default.createElement(_styles.Divider, null)), /*#__PURE__*/_react.default.createElement(_styles.DeliveryInfo, null, /*#__PURE__*/_react.default.createElement("div", null, !hideDeliveryTime && /*#__PURE__*/_react.default.createElement("h5", null, t('DELIVERY_TIME', 'Delivery Time'), ": ", (0, _utils.convertHoursToMinutes)(business === null || business === void 0 ? void 0 : business.delivery_time)), !hidePickupTime && /*#__PURE__*/_react.default.createElement("h5", null, t('PICKUP_TIME', 'Pickup Time'), ": ", (0, _utils.convertHoursToMinutes)(business === null || business === void 0 ? void 0 : business.pickup_time)))), /*#__PURE__*/_react.default.createElement(_styles.Divider, null)), !hideVideos && (businessVideos === null || businessVideos === void 0 ? void 0 : businessVideos.length) > 0 && /*#__PURE__*/_react.default.createElement(_styles.BusinessMediaContent, null, /*#__PURE__*/_react.default.createElement(_styles.SectionTitle, null, t('VIDEOS', 'Videos')), /*#__PURE__*/_react.default.createElement("div", null, businessVideos.map(function (video, i) {
@@ -296,7 +296,7 @@ var Header = function Header(props) {
296
296
  alt: "Isotype",
297
297
  width: isChew ? '70px' : '35px',
298
298
  height: isChew ? '20px' : '45px',
299
- src: isChew ? theme === null || theme === void 0 ? void 0 : (_theme$images3 = theme.images) === null || _theme$images3 === void 0 ? void 0 : (_theme$images3$logos = _theme$images3.logos) === null || _theme$images3$logos === void 0 ? void 0 : _theme$images3$logos.chewLogo : isHome && windowSize.width < 576 ? theme === null || theme === void 0 ? void 0 : (_theme$images4 = theme.images) === null || _theme$images4 === void 0 ? void 0 : (_theme$images4$logos = _theme$images4.logos) === null || _theme$images4$logos === void 0 ? void 0 : _theme$images4$logos.isotypeInvert : (orderingTheme === null || orderingTheme === void 0 ? void 0 : (_orderingTheme$theme9 = orderingTheme.theme) === null || _orderingTheme$theme9 === void 0 ? void 0 : (_orderingTheme$theme10 = _orderingTheme$theme9.my_products) === null || _orderingTheme$theme10 === void 0 ? void 0 : (_orderingTheme$theme11 = _orderingTheme$theme10.components) === null || _orderingTheme$theme11 === void 0 ? void 0 : (_orderingTheme$theme12 = _orderingTheme$theme11.images) === null || _orderingTheme$theme12 === void 0 ? void 0 : (_orderingTheme$theme13 = _orderingTheme$theme12.components) === null || _orderingTheme$theme13 === void 0 ? void 0 : (_orderingTheme$theme14 = _orderingTheme$theme13.logo) === null || _orderingTheme$theme14 === void 0 ? void 0 : (_orderingTheme$theme15 = _orderingTheme$theme14.components) === null || _orderingTheme$theme15 === void 0 ? void 0 : _orderingTheme$theme15.image) || (theme === null || theme === void 0 ? void 0 : (_theme$images5 = theme.images) === null || _theme$images5 === void 0 ? void 0 : (_theme$images5$logos = _theme$images5.logos) === null || _theme$images5$logos === void 0 ? void 0 : _theme$images5$logos.isotype),
299
+ src: isChew ? theme === null || theme === void 0 ? void 0 : (_theme$images3 = theme.images) === null || _theme$images3 === void 0 ? void 0 : (_theme$images3$logos = _theme$images3.logos) === null || _theme$images3$logos === void 0 ? void 0 : _theme$images3$logos.chewLogo : windowSize.width <= 768 ? theme === null || theme === void 0 ? void 0 : (_theme$images4 = theme.images) === null || _theme$images4 === void 0 ? void 0 : (_theme$images4$logos = _theme$images4.logos) === null || _theme$images4$logos === void 0 ? void 0 : _theme$images4$logos.isotypeInvert : (orderingTheme === null || orderingTheme === void 0 ? void 0 : (_orderingTheme$theme9 = orderingTheme.theme) === null || _orderingTheme$theme9 === void 0 ? void 0 : (_orderingTheme$theme10 = _orderingTheme$theme9.my_products) === null || _orderingTheme$theme10 === void 0 ? void 0 : (_orderingTheme$theme11 = _orderingTheme$theme10.components) === null || _orderingTheme$theme11 === void 0 ? void 0 : (_orderingTheme$theme12 = _orderingTheme$theme11.images) === null || _orderingTheme$theme12 === void 0 ? void 0 : (_orderingTheme$theme13 = _orderingTheme$theme12.components) === null || _orderingTheme$theme13 === void 0 ? void 0 : (_orderingTheme$theme14 = _orderingTheme$theme13.logo) === null || _orderingTheme$theme14 === void 0 ? void 0 : (_orderingTheme$theme15 = _orderingTheme$theme14.components) === null || _orderingTheme$theme15 === void 0 ? void 0 : _orderingTheme$theme15.image) || (theme === null || theme === void 0 ? void 0 : (_theme$images5 = theme.images) === null || _theme$images5 === void 0 ? void 0 : (_theme$images5$logos = _theme$images5.logos) === null || _theme$images5$logos === void 0 ? void 0 : _theme$images5$logos.isotype),
300
300
  loading: "lazy"
301
301
  }))), isShowOrderOptions && windowSize.width >= 576 && /*#__PURE__*/_react.default.createElement(_styles.Menu, {
302
302
  id: "center-side",
@@ -72,7 +72,7 @@ var SectionTitle = _styledComponents.default.h3(_templateObject18 || (_templateO
72
72
  exports.SectionTitle = SectionTitle;
73
73
  var ProductComment = _styledComponents.default.div(_templateObject19 || (_templateObject19 = _taggedTemplateLiteral(["\n display: flex;\n flex-direction: column;\n margin-bottom: 130px;\n\n textarea {\n margin-top: 8px;\n }\n\n p {\n font-weight: 300;\n margin-bottom: 5px;\n }\n\n @media (min-width: 577px) {\n margin-bottom: 62px;\n }\n\n @media (min-width: 769px) {\n margin-bottom: 0px;\n padding-bottom: 10px;\n }\n"])));
74
74
  exports.ProductComment = ProductComment;
75
- var ProductActions = _styledComponents.default.div(_templateObject20 || (_templateObject20 = _taggedTemplateLiteral(["\n display: flex;\n flex-direction: column;\n align-items: center;\n padding: 10px 0px;\n width: 100%;\n z-index: 9999997;\n\n position: fixed;\n bottom: 0;\n right: 0;\n width: 100%;\n background-color: #FFF;\n\n div.price {\n padding-top: 10px;\n color: ", ";\n h4 {\n margin: 0;\n font-weight: 600;\n font-size: 20px;\n line-height: 20px;\n }\n span {\n font-size: 13px;\n color: #D83520;\n line-height: 15px;\n }\n }\n\n div.incdec-control {\n width: 135px;\n display: flex;\n justify-content: space-around;\n align-items: center;\n position: relative;\n\n svg {\n width: 25px;\n height: 25px;\n cursor: pointer;\n }\n }\n\n div.price-amount-block {\n display: flex;\n justify-content: space-between;\n width: 70%\n }\n\n svg {\n color: ", ";\n }\n\n svg.disabled {\n pointer-events: none;\n color: #CED4DA;\n }\n\n button:disabled,\n button.disabled {\n background: #E9ECEF;\n border: 1px solid #E9ECEF;\n color: #B1BCCC;\n }\n\n button.add {\n width: 90%;\n padding: 5px 10px;\n margin-top: 10px;\n position: relative;\n\n &.soldout {\n width: 100%;\n pointer-events: none;\n }\n }\n .qty {\n flex: 1;\n text-align: center;\n display: flex;\n align-items: center;\n height: 38px;\n min-width: 60px;\n box-sizing: border-box;\n padding: 0;\n margin: 0 10px;\n }\n\n #address_control {\n button.add {\n width: calc(100% - 20px) !important;\n margin: 10px 10px 0 10px;\n }\n }\n \n div#address_list {\n padding: 0;\n }\n\n @media (min-width: 577px) {\n position: sticky;\n }\n\n @media (min-width: 1200px) {\n bottom: 0px;\n flex-direction: row;\n justify-content: space-between;\n border-top: 1px solid #E9ECEF;\n width: calc(100% + 40px);\n transform: translateX(-20px);\n padding: 10px 20px;\n box-sizing: border-box;\n\n ", "\n\n div.price {\n width: 25%;\n }\n\n button.add {\n width: 35%;\n margin-top: 0;\n }\n\n div.incdec-control {\n margin-right: 18%;\n &.show-weight-unit{\n width: 30%;\n }\n }\n }\n"])), function (props) {
75
+ var ProductActions = _styledComponents.default.div(_templateObject20 || (_templateObject20 = _taggedTemplateLiteral(["\n display: flex;\n flex-direction: column;\n align-items: center;\n padding: 10px 0px;\n width: 100%;\n z-index: 9999997;\n\n position: fixed;\n bottom: 0;\n right: 0;\n width: 100%;\n background-color: #FFF;\n\n div.price {\n padding-top: 10px;\n color: ", ";\n h4 {\n margin: 0;\n font-weight: 600;\n font-size: 20px;\n line-height: 20px;\n }\n span {\n font-size: 13px;\n color: #D83520;\n line-height: 15px;\n }\n }\n\n div.incdec-control {\n width: 195px;\n display: flex;\n justify-content: space-around;\n align-items: center;\n position: relative;\n\n svg {\n width: 25px;\n height: 25px;\n cursor: pointer;\n }\n }\n\n div.price-amount-block {\n display: flex;\n justify-content: space-between;\n width: 70%\n }\n\n svg {\n color: ", ";\n }\n\n svg.disabled {\n pointer-events: none;\n color: #CED4DA;\n }\n\n button:disabled,\n button.disabled {\n background: #E9ECEF;\n border: 1px solid #E9ECEF;\n color: #B1BCCC;\n }\n\n button.add {\n width: 90%;\n padding: 5px 10px;\n margin-top: 10px;\n position: relative;\n\n &.soldout {\n width: 100%;\n pointer-events: none;\n }\n }\n .qty {\n flex: 1;\n text-align: center;\n display: flex;\n align-items: center;\n height: 38px;\n min-width: 60px;\n box-sizing: border-box;\n padding: 0;\n margin: 0 10px;\n }\n\n #address_control {\n button.add {\n width: calc(100% - 20px) !important;\n margin: 10px 10px 0 10px;\n }\n }\n \n div#address_list {\n padding: 0;\n }\n\n @media (min-width: 577px) {\n position: sticky;\n }\n\n @media (min-width: 1200px) {\n bottom: 0px;\n flex-direction: row;\n justify-content: space-between;\n border-top: 1px solid #E9ECEF;\n width: calc(100% + 40px);\n transform: translateX(-20px);\n padding: 10px 20px;\n box-sizing: border-box;\n\n ", "\n\n div.price {\n width: 25%;\n }\n\n button.add {\n width: 35%;\n margin-top: 0;\n }\n\n div.incdec-control {\n margin-right: 18%;\n &.show-weight-unit{\n width: 40%;\n }\n }\n }\n"])), function (props) {
76
76
  var _props$theme;
77
77
  return (_props$theme = props.theme) === null || _props$theme === void 0 ? void 0 : _props$theme.colors.darkTextColor;
78
78
  }, function (props) {
@@ -20,7 +20,7 @@ function _iterableToArrayLimit(arr, i) { var _i = null == arr ? null : "undefine
20
20
  function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
21
21
  var ScheduleAccordion = function ScheduleAccordion(props) {
22
22
  var _schedule$lapses;
23
- var scheduleFormatted = props.scheduleFormatted,
23
+ var timeFormated = props.timeFormated,
24
24
  schedule = props.schedule,
25
25
  weekIndex = props.weekIndex;
26
26
  var _useState = (0, _react.useState)(false),
@@ -42,8 +42,8 @@ var ScheduleAccordion = function ScheduleAccordion(props) {
42
42
  }
43
43
  }, schedule === null || schedule === void 0 ? void 0 : (_schedule$lapses = schedule.lapses) === null || _schedule$lapses === void 0 ? void 0 : _schedule$lapses.map(function (lapse, i) {
44
44
  return schedule !== null && schedule !== void 0 && schedule.enabled ? /*#__PURE__*/_react.default.createElement("p", {
45
- key: "".concat(i, "-").concat(scheduleFormatted(lapse.open))
46
- }, scheduleFormatted(lapse.open) + ' - ' + scheduleFormatted(lapse.close)) : /*#__PURE__*/_react.default.createElement(_styles.ClosedSchedule, null, t('CLOSED', 'Closed'));
45
+ key: "".concat(i, "-").concat(timeFormated(lapse.open))
46
+ }, timeFormated(lapse.open) + ' - ' + timeFormated(lapse.close)) : /*#__PURE__*/_react.default.createElement(_styles.ClosedSchedule, null, t('CLOSED', 'Closed'));
47
47
  }))));
48
48
  };
49
49
  exports.ScheduleAccordion = ScheduleAccordion;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "ordering-ui-external",
3
- "version": "2.7.3",
3
+ "version": "3.0.1",
4
4
  "description": "Ordering UI Components",
5
5
  "main": "./_modules/index.js",
6
6
  "exports": {
@@ -87,7 +87,7 @@
87
87
  "lodash": "^4.17.19",
88
88
  "moment": "^2.29.4",
89
89
  "nanoid": "^4.0.0",
90
- "ordering-components-external": "2.8.1",
90
+ "ordering-components-external": "3.0.1",
91
91
  "payment": "^2.4.6",
92
92
  "polished": "^3.6.6",
93
93
  "react-bootstrap-icons": "^1.7.2",
@@ -8,7 +8,7 @@ import { SpinnerLoader } from '../SpinnerLoader'
8
8
  import { useWindowSize } from '../../hooks/useWindowSize'
9
9
 
10
10
  export const MomentContent = (props) => {
11
-
11
+
12
12
  const [orderState] = useOrder()
13
13
 
14
14
  const { width } = useWindowSize()
@@ -73,7 +73,7 @@ const ModalUI = (props) => {
73
73
  {onCancel && <Button color='primary' onClick={() => onCancel()}>{cancelText || t('CANCEL')}</Button>}
74
74
  </ModalActions>)}
75
75
  </ModalDialogInnerContainer>
76
-
76
+
77
77
  </ModalDialog>
78
78
  )
79
79
  }
@@ -27,6 +27,7 @@ import {
27
27
  import MdClose from '@meronex/icons/md/MdClose'
28
28
  import { ScheduleAccordion } from '../ScheduleAccordion'
29
29
  import { useTheme } from 'styled-components'
30
+ import moment from 'moment'
30
31
 
31
32
  export const BusinessInformationUI = (props) => {
32
33
  const {
@@ -53,11 +54,12 @@ export const BusinessInformationUI = (props) => {
53
54
  const hidePickupTime = theme?.business_view?.components?.information?.components?.pickup_time?.hidden
54
55
  const hideImages = theme?.business_view?.components?.information?.components?.images?.hidden
55
56
  const hideAddress = theme?.business_view?.components?.information?.components?.address?.hidden
57
+ const formatTime = configs?.general_hour_format?.value
56
58
 
57
- const scheduleFormatted = ({ hour, minute }) => {
58
- const checkTime = (val) => val < 10 ? `0${val}` : val
59
- return `${checkTime(hour)}:${checkTime(minute)}`
60
- }
59
+ const checkTime = (val) => (val < 10 ? `0${val}` : val);
60
+ const timeFormated = (time) => {
61
+ return moment(`1900-01-01 ${checkTime(time.hour)}:${checkTime(time.minute)}`).format(formatTime)
62
+ }
61
63
 
62
64
  const handleModalImage = (src) => {
63
65
  setImage(src)
@@ -125,7 +127,7 @@ export const BusinessInformationUI = (props) => {
125
127
  <ScheduleAccordion
126
128
  key={i}
127
129
  weekIndex={i}
128
- scheduleFormatted={scheduleFormatted}
130
+ timeFormated={timeFormated}
129
131
  schedule={schedule}
130
132
  />
131
133
  ))}
@@ -240,7 +240,7 @@ export const Header = (props) => {
240
240
  isChew={isChew}
241
241
  >
242
242
  <img alt='Logotype' width='170px' height={isChew ? '35px' : '45px'} src={isChew ? theme?.images?.logos?.chewLogo : orderingTheme?.theme?.my_products?.components?.images?.components?.logo?.components?.image || theme?.images?.logos?.logotype} loading='lazy' />
243
- <img alt='Isotype' width={isChew ? '70px' : '35px'} height={isChew ? '20px' : '45px'} src={isChew ? theme?.images?.logos?.chewLogo : (isHome && windowSize.width < 576 ? theme?.images?.logos?.isotypeInvert : orderingTheme?.theme?.my_products?.components?.images?.components?.logo?.components?.image || theme?.images?.logos?.isotype)} loading='lazy' />
243
+ <img alt='Isotype' width={isChew ? '70px' : '35px'} height={isChew ? '20px' : '45px'} src={isChew ? theme?.images?.logos?.chewLogo : (windowSize.width <= 768 ? theme?.images?.logos?.isotypeInvert : orderingTheme?.theme?.my_products?.components?.images?.components?.logo?.components?.image || theme?.images?.logos?.isotype)} loading='lazy' />
244
244
  </LogoHeader>
245
245
  </LeftHeader>
246
246
  {isShowOrderOptions && windowSize.width >= 576 && (
@@ -298,7 +298,7 @@ export const ProductActions = styled.div`
298
298
  }
299
299
 
300
300
  div.incdec-control {
301
- width: 135px;
301
+ width: 195px;
302
302
  display: flex;
303
303
  justify-content: space-around;
304
304
  align-items: center;
@@ -400,7 +400,7 @@ export const ProductActions = styled.div`
400
400
  div.incdec-control {
401
401
  margin-right: 18%;
402
402
  &.show-weight-unit{
403
- width: 30%;
403
+ width: 40%;
404
404
  }
405
405
  }
406
406
  }
@@ -13,7 +13,7 @@ import IosArrowDown from '@meronex/icons/ios/IosArrowDown'
13
13
  export const ScheduleAccordion = (props) => {
14
14
 
15
15
  const {
16
- scheduleFormatted,
16
+ timeFormated,
17
17
  schedule,
18
18
  weekIndex
19
19
  } = props
@@ -43,10 +43,10 @@ export const ScheduleAccordion = (props) => {
43
43
  <HoursWrappers style={{ display: isActive ? 'flex' : 'none', paddingLeft: 60 }}>
44
44
  {schedule?.lapses?.map((lapse, i) => (
45
45
  schedule?.enabled ?
46
- <p key={`${i}-${scheduleFormatted(lapse.open)}`}>
47
- {scheduleFormatted(lapse.open) +
46
+ <p key={`${i}-${timeFormated(lapse.open)}`}>
47
+ {timeFormated(lapse.open) +
48
48
  ' - ' +
49
- scheduleFormatted(lapse.close)}
49
+ timeFormated(lapse.close)}
50
50
  </p>
51
51
  :
52
52
  <ClosedSchedule>
@@ -340,7 +340,7 @@ export const Header = (props) => {
340
340
  )}
341
341
  </AddressWrapper>
342
342
  {(isPreOrderSetting || configState?.configs?.preorder_status_enabled?.value === undefined) && (
343
- <MomentControl
343
+ <MomentControl
344
344
  isModalBehavior
345
345
  />
346
346
  )}
package/template/app.js CHANGED
@@ -170,14 +170,18 @@ export const App = () => {
170
170
  }
171
171
  }
172
172
 
173
+ const websiteThemeType = orderingTheme?.theme?.my_products?.components?.website_theme?.components?.type
174
+ const websiteThemeBusinessSlug = orderingTheme?.theme?.my_products?.components?.website_theme?.components?.business_slug
175
+ const updatedBusinessSlug = (websiteThemeType === 'single_store' && websiteThemeBusinessSlug) || settings?.businessSlug
176
+
173
177
  const businessesSlug = {
174
178
  marketplace: 'marketplace',
175
- kiosk: settings?.businessSlug,
176
- business: settings?.businessSlug
179
+ kiosk: updatedBusinessSlug,
180
+ business: updatedBusinessSlug
177
181
  }
178
182
 
179
183
  const singleBusinessConfig = {
180
- isActive: settings?.use_marketplace || settings?.businessSlug || isKioskApp,
184
+ isActive: settings?.use_marketplace || updatedBusinessSlug || isKioskApp,
181
185
  businessSlug: businessesSlug[isKioskApp ? 'kiosk' : settings?.use_marketplace ? 'marketplace' : 'business']
182
186
  }
183
187
 
@@ -421,8 +425,8 @@ export const App = () => {
421
425
  }, [configs, loaded])
422
426
 
423
427
  useEffect(() => {
424
- if (isHome && (settings?.use_marketplace || settings?.businessSlug)) {
425
- goToPage('business', { store: settings?.use_marketplace ? 'marketplace' : settings?.businessSlug })
428
+ if (isHome && (settings?.use_marketplace || updatedBusinessSlug)) {
429
+ goToPage('business', { store: settings?.use_marketplace ? 'marketplace' : updatedBusinessSlug })
426
430
  }
427
431
  }, [])
428
432
 
@@ -483,7 +487,7 @@ export const App = () => {
483
487
  singleBusinessConfig={singleBusinessConfig}
484
488
  searchValue={searchValue}
485
489
  setSearchValue={setSearchValue}
486
- businessSlug={settings?.businessSlug}
490
+ businessSlug={updatedBusinessSlug}
487
491
  notificationState={oneSignalState}
488
492
  />
489
493
  )}
@@ -1,6 +1,6 @@
1
1
  import React, { useState, useEffect } from 'react'
2
2
  import { useParams, useLocation } from 'react-router-dom'
3
- import { useApi, useEvent, useSite } from 'ordering-components-external'
3
+ import { useApi, useEvent, useSite, useOrderingTheme } from 'ordering-components-external'
4
4
  import { BusinessProductsListing } from '../../../src/themes/five/src/components/BusinessProductsListing'
5
5
  import { HelmetTags } from '../../components/HelmetTags'
6
6
  import { capitalize } from '../../../src/utils'
@@ -10,6 +10,12 @@ import { checkSiteUrl } from '../../Utils'
10
10
  export const BusinessProductsList = (props) => {
11
11
  const [{ site }] = useSite()
12
12
  const { search } = useLocation()
13
+ const [orderingTheme] = useOrderingTheme()
14
+
15
+ const websiteThemeType = orderingTheme?.theme?.my_products?.components?.website_theme?.components?.type
16
+ const websiteThemeBusinessSlug = orderingTheme?.theme?.my_products?.components?.website_theme?.components?.business_slug
17
+ const updatedBusinessSlug = (websiteThemeType === 'single_store' && websiteThemeBusinessSlug) || settings?.businessSlug
18
+
13
19
  const [helmetMetaTags, setHelmetMetaTags] = useState({
14
20
  title: '',
15
21
  description: '',
@@ -19,7 +25,7 @@ export const BusinessProductsList = (props) => {
19
25
  let businessSlug = ''
20
26
  const businessUrlTemplate = checkSiteUrl(site?.business_url_template, '/store/:business_slug')
21
27
  const productUrlTemplate = checkSiteUrl(site?.product_url_template, '/store/:business_slug?category=:category_id&product=:product_id')
22
-
28
+
23
29
  if (businessUrlTemplate.includes('?')) {
24
30
  const businessParameter = businessUrlTemplate.replace('/store?', '').replace('=:business_slug', '')
25
31
  const params = new URLSearchParams(search)
@@ -82,11 +88,11 @@ export const BusinessProductsList = (props) => {
82
88
  ...props,
83
89
  ordering,
84
90
  avoidBusinessLoading: true,
85
- isCustomLayout: settings?.use_marketplace || settings?.businessSlug,
91
+ isCustomLayout: settings?.use_marketplace || updatedBusinessSlug,
86
92
  useKioskApp: settings?.use_kiosk,
87
93
  isSearchByName: true,
88
94
  isSearchByDescription: true,
89
- slug: settings?.businessSlug || businessSlug,
95
+ slug: updatedBusinessSlug || businessSlug,
90
96
  categoryId,
91
97
  productId,
92
98
  businessProps: [
@@ -1,6 +1,6 @@
1
1
  import React from 'react'
2
2
  import { BusinessesListing } from '../../../src/themes/five/src/components/BusinessesListing'
3
- import { useEvent, useSite } from 'ordering-components-external'
3
+ import { useEvent, useSite, useOrderingTheme } from 'ordering-components-external'
4
4
  import { HelmetTags } from '../../components/HelmetTags'
5
5
  import settings from '../../config'
6
6
  import { checkSiteUrl } from '../../Utils'
@@ -8,15 +8,22 @@ import { checkSiteUrl } from '../../Utils'
8
8
  export const BusinessesList = (props) => {
9
9
  const [events] = useEvent()
10
10
  const [{ site }] = useSite()
11
+ const [orderingTheme] = useOrderingTheme()
11
12
 
12
13
  const businessUrlTemplate = checkSiteUrl(site?.business_url_template, '/store/:business_slug')
13
14
 
15
+ const websiteThemeType = orderingTheme?.theme?.my_products?.components?.website_theme?.components?.type
16
+ const websiteThemeBusinessSlug = orderingTheme?.theme?.my_products?.components?.website_theme?.components?.business_slug
17
+ const updatedBusinessSlug = (websiteThemeType === 'single_store' && websiteThemeBusinessSlug) || settings?.businessSlug
18
+ const websiteThemeFranchiseSlug = orderingTheme?.theme?.my_products?.components?.website_theme?.components?.franchise_slug
19
+ const updatedFranchiseSlug = (websiteThemeType === 'franchise' && websiteThemeFranchiseSlug) || settings?.franchiseSlug
20
+
14
21
  const businessListingProps = {
15
22
  ...props,
16
23
  isSearchByName: true,
17
24
  isSearchByDescription: true,
18
- franchiseId: settings?.franchiseSlug,
19
- businessId: settings?.businessSlug,
25
+ franchiseId: updatedFranchiseSlug,
26
+ businessId: updatedBusinessSlug,
20
27
  onBusinessClick: (business) => {
21
28
  if (businessUrlTemplate === '/store/:business_slug' || businessUrlTemplate === '/:business_slug') {
22
29
  events.emit('go_to_page', { page: 'business', params: { business_slug: business.slug } })
@@ -26,7 +33,7 @@ export const BusinessesList = (props) => {
26
33
  },
27
34
  currentPageParam: 0,
28
35
  propsToFetch: ['id', 'name', 'header', 'logo', 'location', 'address', 'ribbon', 'timezone', 'schedule', 'open', 'delivery_price', 'distance', 'delivery_time', 'pickup_time', 'reviews', 'featured', 'offers', 'food', 'laundry', 'alcohol', 'groceries', 'slug', 'city', 'city_id', 'menus'],
29
- onRedirectPage: (data) => events.emit('go_to_page', data),
36
+ onRedirectPage: (data) => events.emit('go_to_page', data)
30
37
  }
31
38
 
32
39
  return (
@@ -4,7 +4,7 @@ import { useParams, useLocation } from 'react-router-dom'
4
4
  import { HelmetTags } from '../../components/HelmetTags'
5
5
 
6
6
  import { Checkout } from '../../../src/themes/five/src/components/Checkout'
7
- import { useEvent, useOrder, useLanguage, useSite } from 'ordering-components-external'
7
+ import { useEvent, useOrder, useLanguage, useSite, useOrderingTheme } from 'ordering-components-external'
8
8
  import settings from '../../config'
9
9
  import { checkSiteUrl } from '../../Utils'
10
10
 
@@ -15,6 +15,11 @@ export const CheckoutPage = (props) => {
15
15
  const [orderState, { confirmCart, changeMoment }] = useOrder()
16
16
  const [, t] = useLanguage()
17
17
  const [{ site }] = useSite()
18
+ const [orderingTheme] = useOrderingTheme()
19
+ const websiteThemeType = orderingTheme?.theme?.my_products?.components?.website_theme?.components?.type
20
+ const websiteThemeBusinessSlug = orderingTheme?.theme?.my_products?.components?.website_theme?.components?.business_slug
21
+ const updatedBusinessSlug = (websiteThemeType === 'single_store' && websiteThemeBusinessSlug) || settings?.businessSlug
22
+
18
23
  const stripePayments = ['stripe', 'stripe_connect', 'stripe_direct', 'google_pay', 'apple_pay']
19
24
  const businessUrlTemplate = checkSiteUrl(site?.business_url_template, '/store/:business_slug')
20
25
 
@@ -101,7 +106,7 @@ export const CheckoutPage = (props) => {
101
106
  useValidationFields: true,
102
107
  validationFieldsType: 'checkout',
103
108
  useKioskApp: settings?.use_kiosk,
104
- businessSlug: settings?.businessSlug,
109
+ businessSlug: updatedBusinessSlug,
105
110
  onPlaceOrderClick: (data, paymethod, cart) => {
106
111
  if (cart?.order?.uuid) {
107
112
  if (orderState?.options?.moment) {
@@ -26,6 +26,9 @@ export const HomePage = (props) => {
26
26
  const [events] = useEvent()
27
27
  const [{ site }] = useSite()
28
28
  const [{ theme }] = useOrderingTheme()
29
+ const websiteThemeType = theme?.my_products?.components?.website_theme?.components?.type
30
+ const websiteThemeBusinessSlug = theme?.my_products?.components?.website_theme?.components?.business_slug
31
+ const updatedBusinessSlug = (websiteThemeType === 'single_store' && websiteThemeBusinessSlug) || settings?.businessSlug
29
32
 
30
33
  const requestsState = {}
31
34
  const isKioskApp = settings?.use_kiosk
@@ -38,9 +41,9 @@ export const HomePage = (props) => {
38
41
 
39
42
  const handleGoToBusiness = () => {
40
43
  if (businessUrlTemplate === '/store/:business_slug' || businessUrlTemplate === '/:business_slug') {
41
- events.emit('go_to_page', { page: 'business', params: { business_slug: settings?.businessSlug } })
44
+ events.emit('go_to_page', { page: 'business', params: { business_slug: updatedBusinessSlug } })
42
45
  } else {
43
- events.emit('go_to_page', { page: 'business', search: `?${businessUrlTemplate.split('?')[1].replace(':business_slug', '')}${settings?.businessSlug}` })
46
+ events.emit('go_to_page', { page: 'business', search: `?${businessUrlTemplate.split('?')[1].replace(':business_slug', '')}${updatedBusinessSlug}` })
44
47
  }
45
48
  }
46
49
 
@@ -2,14 +2,19 @@ import React from 'react'
2
2
  import { MessagesListing } from '../../../src/themes/five/src/components/MessagesListing'
3
3
 
4
4
  import { HelmetTags } from '../../components/HelmetTags'
5
- import { useEvent } from 'ordering-components-external'
5
+ import { useEvent, useOrderingTheme } from 'ordering-components-external'
6
6
  import settings from '../../config'
7
7
 
8
8
  export const MessagesList = (props) => {
9
9
  const [events] = useEvent()
10
+ const [orderingTheme] = useOrderingTheme()
11
+ const websiteThemeType = orderingTheme?.theme?.my_products?.components?.website_theme?.components?.type
12
+ const websiteThemeFranchiseSlug = orderingTheme?.theme?.my_products?.components?.website_theme?.components?.franchise_slug
13
+ const updatedFranchiseSlug = (websiteThemeType === 'franchise' && websiteThemeFranchiseSlug) || settings?.franchiseSlug
14
+
10
15
  const messageprops = {
11
16
  ...props,
12
- franchiseId: settings?.franchiseSlug,
17
+ franchiseId: updatedFranchiseSlug,
13
18
  onRedirectPage: (data) => events.emit('go_to_page', data)
14
19
  }
15
20
  return (
@@ -1,5 +1,5 @@
1
1
  import React from 'react'
2
- import { useSite, useEvent } from 'ordering-components-external'
2
+ import { useSite, useEvent, useOrderingTheme } from 'ordering-components-external'
3
3
  import { MyOrders as MyOrdersController } from '../../../src/themes/five/src/components/MyOrders'
4
4
  import { HelmetTags } from '../../components/HelmetTags'
5
5
  import settings from '../../config'
@@ -9,14 +9,21 @@ import { useWindowSize } from '../../../src/hooks/useWindowSize'
9
9
  export const MyOrders = (props) => {
10
10
  const [events] = useEvent()
11
11
  const [{ site }] = useSite()
12
+ const [orderingTheme] = useOrderingTheme()
13
+ const websiteThemeType = orderingTheme?.theme?.my_products?.components?.website_theme?.components?.type
14
+ const websiteThemeBusinessSlug = orderingTheme?.theme?.my_products?.components?.website_theme?.components?.business_slug
15
+ const updatedBusinessSlug = (websiteThemeType === 'single_store' && websiteThemeBusinessSlug) || settings?.businessSlug
16
+ const websiteThemeFranchiseSlug = orderingTheme?.theme?.my_products?.components?.website_theme?.components?.franchise_slug
17
+ const updatedFranchiseSlug = (websiteThemeType === 'franchise' && websiteThemeFranchiseSlug) || settings?.franchiseSlug
18
+
12
19
  const windowSize = useWindowSize()
13
20
  const businessUrlTemplate = checkSiteUrl(site?.business_url_template, '/store/:business_slug')
14
21
  const productUrlTemplate = checkSiteUrl(site?.product_url_template, '/store/:business_slug?category=:category_id&product=:product_id')
15
22
 
16
23
  const ordersProps = {
17
24
  ...props,
18
- franchiseId: settings?.franchiseSlug,
19
- businessId: settings?.businessSlug,
25
+ franchiseId: updatedFranchiseSlug,
26
+ businessId: updatedBusinessSlug,
20
27
  hideOptions: windowSize.width < 576,
21
28
  onRedirectPage: (data) => {
22
29
  if (data.page === 'business') {