ordering-ui-external 5.0.1 → 5.0.2

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 (20) hide show
  1. package/_bundles/{0.ordering-ui.dc2501dcf51ed5b7b821.js → 0.ordering-ui.8c316b0ca048fa16f4bf.js} +1 -1
  2. package/_bundles/{4.ordering-ui.dc2501dcf51ed5b7b821.js → 4.ordering-ui.8c316b0ca048fa16f4bf.js} +1 -1
  3. package/_bundles/{7.ordering-ui.dc2501dcf51ed5b7b821.js → 7.ordering-ui.8c316b0ca048fa16f4bf.js} +1 -1
  4. package/_bundles/ordering-ui.8c316b0ca048fa16f4bf.js +2 -0
  5. package/_modules/themes/five/src/components/BusinessBasicInformation/index.js +2 -2
  6. package/_modules/themes/five/src/components/BusinessProductsListing/index.js +12 -1
  7. package/_modules/themes/five/src/components/BusinessProductsListing/styles.js +1 -1
  8. package/package.json +2 -2
  9. package/src/themes/five/src/components/BusinessBasicInformation/index.js +4 -4
  10. package/src/themes/five/src/components/BusinessProductsListing/index.js +12 -0
  11. package/src/themes/five/src/components/BusinessProductsListing/styles.js +3 -0
  12. package/_bundles/ordering-ui.dc2501dcf51ed5b7b821.js +0 -2
  13. /package/_bundles/{1.ordering-ui.dc2501dcf51ed5b7b821.js → 1.ordering-ui.8c316b0ca048fa16f4bf.js} +0 -0
  14. /package/_bundles/{2.ordering-ui.dc2501dcf51ed5b7b821.js → 2.ordering-ui.8c316b0ca048fa16f4bf.js} +0 -0
  15. /package/_bundles/{5.ordering-ui.dc2501dcf51ed5b7b821.js → 5.ordering-ui.8c316b0ca048fa16f4bf.js} +0 -0
  16. /package/_bundles/{6.ordering-ui.dc2501dcf51ed5b7b821.js → 6.ordering-ui.8c316b0ca048fa16f4bf.js} +0 -0
  17. /package/_bundles/{7.ordering-ui.dc2501dcf51ed5b7b821.js.LICENSE.txt → 7.ordering-ui.8c316b0ca048fa16f4bf.js.LICENSE.txt} +0 -0
  18. /package/_bundles/{8.ordering-ui.dc2501dcf51ed5b7b821.js → 8.ordering-ui.8c316b0ca048fa16f4bf.js} +0 -0
  19. /package/_bundles/{9.ordering-ui.dc2501dcf51ed5b7b821.js → 9.ordering-ui.8c316b0ca048fa16f4bf.js} +0 -0
  20. /package/_bundles/{ordering-ui.dc2501dcf51ed5b7b821.js.LICENSE.txt → ordering-ui.8c316b0ca048fa16f4bf.js.LICENSE.txt} +0 -0
@@ -139,7 +139,7 @@ var BusinessBasicInformation = function BusinessBasicInformation(props) {
139
139
  var handleScroll = function handleScroll() {
140
140
  var searchElement = document.getElementById('search-component');
141
141
  if (searchElement) {
142
- var limit = window.pageYOffset >= (searchElement === null || searchElement === void 0 ? void 0 : searchElement.offsetTop) && window.pageYOffset > 0;
142
+ var limit = window.pageYOffset >= (isChew ? (searchElement === null || searchElement === void 0 ? void 0 : searchElement.offsetTop) + 40 : searchElement === null || searchElement === void 0 ? void 0 : searchElement.offsetTop) && window.pageYOffset > 0;
143
143
  if (limit) {
144
144
  var classAdded = searchElement.classList.contains('fixed-search');
145
145
  !classAdded && searchElement.classList.add('fixed-search');
@@ -149,7 +149,7 @@ var BusinessBasicInformation = function BusinessBasicInformation(props) {
149
149
  }
150
150
  var businessNameElement = document.getElementById('business_name');
151
151
  if (businessNameElement) {
152
- var _limit = window.pageYOffset >= (businessNameElement === null || businessNameElement === void 0 ? void 0 : businessNameElement.offsetTop) - 55 && window.pageYOffset > 0;
152
+ var _limit = window.pageYOffset >= (isChew && searchElement ? (searchElement === null || searchElement === void 0 ? void 0 : searchElement.offsetTop) + 40 : (businessNameElement === null || businessNameElement === void 0 ? void 0 : businessNameElement.offsetTop) - 55) && window.pageYOffset > 0;
153
153
  if (_limit) {
154
154
  var _classAdded = businessNameElement.classList.contains('fixed-name');
155
155
  !_classAdded && businessNameElement.classList.add('fixed-name');
@@ -45,7 +45,7 @@ function _iterableToArrayLimit(arr, i) { var _i = null == arr ? null : "undefine
45
45
  function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
46
46
  var PIXELS_TO_SCROLL = 300;
47
47
  var BusinessProductsListingUI = function BusinessProductsListingUI(props) {
48
- var _configs$add_product_, _configs$checkout_mul, _Object$values$find, _businessState$busine, _theme$business_view, _theme$business_view$, _theme$business_view$2, _theme$defaultLanguag, _theme$defaultLanguag2, _theme$defaultLanguag3, _theme$defaultLanguag4, _theme$defaultLanguag5, _theme$defaultLanguag6, _currentCart$products2, _theme$defaultLanguag7, _theme$defaultLanguag8, _theme$defaultLanguag9, _theme$defaultLanguag10, _error$, _theme$defaultLanguag11, _currentCart$products3, _theme$defaultLanguag12, _theme$defaultLanguag13, _theme$defaultLanguag14, _theme$defaultLanguag15, _currentCart$products4, _currentCart$products5, _currentCart$products6, _productModal$error$, _theme$defaultLanguag16, _productModal$product2, _business$professiona2, _currentCart$products7, _currentCart$products8;
48
+ var _configs$add_product_, _configs$checkout_mul, _Object$values$find, _businessState$busine, _theme$business_view, _theme$business_view$, _theme$business_view$2, _theme$header, _theme$header$compone, _theme$header$compone2, _theme$header$compone3, _theme$defaultLanguag, _theme$defaultLanguag2, _theme$defaultLanguag3, _theme$defaultLanguag4, _theme$defaultLanguag5, _theme$defaultLanguag6, _currentCart$products2, _theme$defaultLanguag7, _theme$defaultLanguag8, _theme$defaultLanguag9, _theme$defaultLanguag10, _error$, _theme$defaultLanguag11, _currentCart$products3, _theme$defaultLanguag12, _theme$defaultLanguag13, _theme$defaultLanguag14, _theme$defaultLanguag15, _currentCart$products4, _currentCart$products5, _currentCart$products6, _productModal$error$, _theme$defaultLanguag16, _productModal$product2, _business$professiona2, _currentCart$products7, _currentCart$products8;
49
49
  var errors = props.errors,
50
50
  openCategories = props.openCategories,
51
51
  isInitialRender = props.isInitialRender,
@@ -162,6 +162,7 @@ var BusinessProductsListingUI = function BusinessProductsListingUI(props) {
162
162
  })) !== null && _Object$values$find !== void 0 ? _Object$values$find : {};
163
163
  var isLazy = businessState === null || businessState === void 0 ? void 0 : (_businessState$busine = businessState.business) === null || _businessState$busine === void 0 ? void 0 : _businessState$busine.lazy_load_products_recommended;
164
164
  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$2 = _theme$business_view$.order_view_button) !== null && _theme$business_view$2 !== void 0 && _theme$business_view$2.hidden);
165
+ var isChew = (theme === null || theme === void 0 ? void 0 : (_theme$header = theme.header) === null || _theme$header === void 0 ? void 0 : (_theme$header$compone = _theme$header.components) === null || _theme$header$compone === void 0 ? void 0 : (_theme$header$compone2 = _theme$header$compone.layout) === null || _theme$header$compone2 === void 0 ? void 0 : (_theme$header$compone3 = _theme$header$compone2.type) === null || _theme$header$compone3 === void 0 ? void 0 : _theme$header$compone3.toLowerCase()) === 'chew';
165
166
  var cateringTypes = [7, 8];
166
167
  var cateringPreorder = cateringTypes.includes(options === null || options === void 0 ? void 0 : options.type);
167
168
  var sortByOptions = [{
@@ -272,8 +273,18 @@ var BusinessProductsListingUI = function BusinessProductsListingUI(props) {
272
273
  var handleScroll = (0, _react.useCallback)(function () {
273
274
  var _document$documentEle, _document$documentEle2;
274
275
  var backArrowElement = document.getElementById('back-arrow');
276
+ var searchElement = document.getElementById('search-component');
275
277
  if (backArrowElement) {
276
278
  var limit = window.pageYOffset >= (backArrowElement === null || backArrowElement === void 0 ? void 0 : backArrowElement.offsetTop) && window.pageYOffset > 0;
279
+ var limitWidth = window.pageYOffset >= (searchElement === null || searchElement === void 0 ? void 0 : searchElement.offsetTop) + 40 && window.pageYOffset > 0;
280
+ if (isChew) {
281
+ if (limit && !limitWidth) {
282
+ var classWidthAdded = backArrowElement.classList.contains('fixed-arrow-width');
283
+ !classWidthAdded && backArrowElement.classList.add('fixed-arrow-width');
284
+ } else {
285
+ backArrowElement && backArrowElement.classList.remove('fixed-arrow-width');
286
+ }
287
+ }
277
288
  if (limit) {
278
289
  var classAdded = backArrowElement.classList.contains('fixed-arrow');
279
290
  !classAdded && backArrowElement.classList.add('fixed-arrow');
@@ -42,7 +42,7 @@ var EmptyBtnWrapper = _styledComponents.default.div(_templateObject9 || (_templa
42
42
  return props.theme.colors.darkTextColor;
43
43
  });
44
44
  exports.EmptyBtnWrapper = EmptyBtnWrapper;
45
- var HeaderContent = _styledComponents.default.div(_templateObject10 || (_templateObject10 = _taggedTemplateLiteral(["\n display: flex;\n align-items: center;\n margin-bottom: 10px;\n .back-arrow {\n font-size: 24px;\n cursor: pointer;\n }\n .fixed-arrow {\n position: fixed;\n top: 0;\n left: 0;\n z-index: 10001;\n width: 100vw;\n background-color: ", ";\n height: 56px;\n display: flex;\n align-items: center;\n ", "\n @media (min-width: 993px){\n width: 100px;\n }\n }\n"])), function (props) {
45
+ var HeaderContent = _styledComponents.default.div(_templateObject10 || (_templateObject10 = _taggedTemplateLiteral(["\n display: flex;\n align-items: center;\n margin-bottom: 10px;\n .back-arrow {\n font-size: 24px;\n cursor: pointer;\n }\n .fixed-arrow {\n position: fixed;\n top: 0;\n left: 0;\n z-index: 10001;\n width: 100vw;\n background-color: ", ";\n height: 56px;\n display: flex;\n align-items: center;\n ", "\n @media (min-width: 993px){\n width: 100px;\n }\n }\n .fixed-arrow-width{\n width: 100vw;\n }\n"])), function (props) {
46
46
  return props.theme.colors.backgroundPage;
47
47
  }, function (props) {
48
48
  var _props$theme;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "ordering-ui-external",
3
- "version": "5.0.1",
3
+ "version": "5.0.2",
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": "4.0.0",
90
+ "ordering-components-external": "4.0.1",
91
91
  "payment": "^2.4.6",
92
92
  "polished": "^3.6.6",
93
93
  "react-bootstrap-icons": "^1.7.2",
@@ -131,7 +131,7 @@ export const BusinessBasicInformation = (props) => {
131
131
  const handleScroll = () => {
132
132
  const searchElement = document.getElementById('search-component')
133
133
  if (searchElement) {
134
- const limit = window.pageYOffset >= searchElement?.offsetTop && window.pageYOffset > 0
134
+ const limit = window.pageYOffset >= (isChew ? searchElement?.offsetTop + 40 : searchElement?.offsetTop) && window.pageYOffset > 0
135
135
  if (limit) {
136
136
  const classAdded = searchElement.classList.contains('fixed-search')
137
137
  !classAdded && searchElement.classList.add('fixed-search')
@@ -142,7 +142,7 @@ export const BusinessBasicInformation = (props) => {
142
142
 
143
143
  const businessNameElement = document.getElementById('business_name')
144
144
  if (businessNameElement) {
145
- const limit = window.pageYOffset >= (businessNameElement?.offsetTop - 55) && window.pageYOffset > 0
145
+ const limit = window.pageYOffset >= (isChew && searchElement ? searchElement?.offsetTop + 40 : (businessNameElement?.offsetTop - 55)) && window.pageYOffset > 0
146
146
  if (limit) {
147
147
  const classAdded = businessNameElement.classList.contains('fixed-name')
148
148
  !classAdded && businessNameElement.classList.add('fixed-name')
@@ -249,7 +249,7 @@ export const BusinessBasicInformation = (props) => {
249
249
  )}
250
250
  </BusinessInfoWrapper>
251
251
  {(windowSize.width <= 768 && categoryClicked) && (
252
- <BackButton>
252
+ <BackButton>
253
253
  <Button
254
254
  color='primary'
255
255
  initialIcon
@@ -259,7 +259,7 @@ export const BusinessBasicInformation = (props) => {
259
259
  <div>{t('GO_TO_ALL_CATEGORIES', 'Go to all categories')}</div>
260
260
  </Button>
261
261
  </BackButton>
262
- )}
262
+ )}
263
263
  <Modal
264
264
  width='70%'
265
265
  open={openBusinessInformation}
@@ -116,6 +116,7 @@ const BusinessProductsListingUI = (props) => {
116
116
  const currentCart = Object.values(carts).find(cart => cart?.business?.slug === business?.slug) ?? {}
117
117
  const isLazy = businessState?.business?.lazy_load_products_recommended
118
118
  const showViewOrderButton = !theme?.business_view?.components?.order_view_button?.hidden
119
+ const isChew = theme?.header?.components?.layout?.type?.toLowerCase() === 'chew'
119
120
  const cateringTypes = [7, 8]
120
121
  const cateringPreorder = cateringTypes.includes(options?.type)
121
122
  const sortByOptions = [
@@ -193,8 +194,19 @@ const BusinessProductsListingUI = (props) => {
193
194
 
194
195
  const handleScroll = useCallback(() => {
195
196
  const backArrowElement = document.getElementById('back-arrow')
197
+ const searchElement = document.getElementById('search-component')
196
198
  if (backArrowElement) {
197
199
  const limit = window.pageYOffset >= backArrowElement?.offsetTop && window.pageYOffset > 0
200
+ const limitWidth = window.pageYOffset >= searchElement?.offsetTop + 40 && window.pageYOffset > 0
201
+ if (isChew) {
202
+ if (limit && !limitWidth) {
203
+ const classWidthAdded = backArrowElement.classList.contains('fixed-arrow-width')
204
+ !classWidthAdded && backArrowElement.classList.add('fixed-arrow-width')
205
+ } else {
206
+ backArrowElement && backArrowElement.classList.remove('fixed-arrow-width')
207
+ }
208
+ }
209
+
198
210
  if (limit) {
199
211
  const classAdded = backArrowElement.classList.contains('fixed-arrow')
200
212
  !classAdded && backArrowElement.classList.add('fixed-arrow')
@@ -167,6 +167,9 @@ export const HeaderContent = styled.div`
167
167
  width: 100px;
168
168
  }
169
169
  }
170
+ .fixed-arrow-width{
171
+ width: 100vw;
172
+ }
170
173
  `
171
174
  export const OrderContextUIWrapper = styled.div`
172
175
  flex: 1;