ordering-ui-external 2.5.1 → 2.5.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/_bundles/{0.ordering-ui.5488030edb520175432d.js → 0.ordering-ui.b041abea697214292027.js} +1 -1
- package/_bundles/{1.ordering-ui.5488030edb520175432d.js → 1.ordering-ui.b041abea697214292027.js} +1 -1
- package/_bundles/{2.ordering-ui.5488030edb520175432d.js → 2.ordering-ui.b041abea697214292027.js} +1 -1
- package/_bundles/{4.ordering-ui.5488030edb520175432d.js → 4.ordering-ui.b041abea697214292027.js} +1 -1
- package/_bundles/{5.ordering-ui.5488030edb520175432d.js → 5.ordering-ui.b041abea697214292027.js} +1 -1
- package/_bundles/{6.ordering-ui.5488030edb520175432d.js → 6.ordering-ui.b041abea697214292027.js} +1 -1
- package/_bundles/{7.ordering-ui.5488030edb520175432d.js → 7.ordering-ui.b041abea697214292027.js} +2 -2
- package/_bundles/{8.ordering-ui.5488030edb520175432d.js → 8.ordering-ui.b041abea697214292027.js} +1 -1
- package/_bundles/{9.ordering-ui.5488030edb520175432d.js → 9.ordering-ui.b041abea697214292027.js} +1 -1
- package/_bundles/ordering-ui.b041abea697214292027.js +2 -0
- package/_modules/themes/five/src/components/CartContent/index.js +1 -1
- package/_modules/themes/five/src/components/Header/index.js +4 -3
- package/_modules/themes/five/src/components/OrderProgress/index.js +11 -5
- package/package.json +1 -1
- package/src/themes/five/src/components/CartContent/index.js +3 -0
- package/src/themes/five/src/components/Header/index.js +16 -10
- package/src/themes/five/src/components/OrderProgress/index.js +9 -3
- package/_bundles/ordering-ui.5488030edb520175432d.js +0 -2
- /package/_bundles/{7.ordering-ui.5488030edb520175432d.js.LICENSE.txt → 7.ordering-ui.b041abea697214292027.js.LICENSE.txt} +0 -0
- /package/_bundles/{ordering-ui.5488030edb520175432d.js.LICENSE.txt → ordering-ui.b041abea697214292027.js.LICENSE.txt} +0 -0
|
@@ -135,7 +135,7 @@ var CartContent = function CartContent(props) {
|
|
|
135
135
|
return sum + (cart === null || cart === void 0 ? void 0 : cart.driver_tip);
|
|
136
136
|
}, 0) > 0 && (configs === null || configs === void 0 ? void 0 : (_configs$multi_busine5 = configs.multi_business_checkout_show_combined_driver_tip) === null || _configs$multi_busine5 === void 0 ? void 0 : _configs$multi_busine5.value) === '1' && /*#__PURE__*/_react.default.createElement("span", null, /*#__PURE__*/_react.default.createElement("p", null, t('DRIVER_TIP', 'Driver tip')), /*#__PURE__*/_react.default.createElement("p", null, parsePrice(carts.reduce(function (sum, cart) {
|
|
137
137
|
return sum + (cart === null || cart === void 0 ? void 0 : cart.driver_tip);
|
|
138
|
-
}, 0)))), /*#__PURE__*/_react.default.createElement("div", null, /*#__PURE__*/_react.default.createElement("h4", null, t('TOTAL_FOR_ALL_CARTS', 'Total for all Carts')), /*#__PURE__*/_react.default.createElement("h4", null, parsePrice(totalCartsPrice))))), (!carts || (carts === null || carts === void 0 ? void 0 : carts.length) === 0) && /*#__PURE__*/_react.default.createElement(_styles.NotCarts, null, /*#__PURE__*/_react.default.createElement("img", {
|
|
138
|
+
}, 0)))), /*#__PURE__*/_react.default.createElement("div", null, /*#__PURE__*/_react.default.createElement("h4", null, t('TOTAL_FOR_ALL_CARTS', 'Total for all Carts')), /*#__PURE__*/_react.default.createElement("h4", null, parsePrice(totalCartsPrice))), /*#__PURE__*/_react.default.createElement("span", null, /*#__PURE__*/_react.default.createElement("p", null, t('CART_GROUP_MESSAGE_ALERT', 'Discounts may be applied at the time of payment for this group.'))))), (!carts || (carts === null || carts === void 0 ? void 0 : carts.length) === 0) && /*#__PURE__*/_react.default.createElement(_styles.NotCarts, null, /*#__PURE__*/_react.default.createElement("img", {
|
|
139
139
|
src: (_theme$images = theme.images) === null || _theme$images === void 0 ? void 0 : (_theme$images$general = _theme$images.general) === null || _theme$images$general === void 0 ? void 0 : _theme$images$general.notFound,
|
|
140
140
|
alt: "Not Found",
|
|
141
141
|
width: "200px",
|
|
@@ -51,7 +51,7 @@ function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len
|
|
|
51
51
|
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; } }
|
|
52
52
|
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
53
53
|
var Header = function Header(props) {
|
|
54
|
-
var _configState$configs, _configState$configs$, _configState$configs2, _configState$configs3, _orderingTheme$theme, _orderingTheme$theme$, _orderingTheme$theme$2, _orderingTheme$theme$3, _orderingTheme$theme$4, _theme$header, _theme$header$compone, _theme$header$compone2, _orderState$options, _orderState$options2, _Object$keys, _customerState$user, _orderState$options5, _orderState$options5$, _theme$images, _theme$images$logos, _orderingTheme$theme2, _orderingTheme$theme3, _orderingTheme$theme4, _orderingTheme$theme5, _orderingTheme$theme6, _orderingTheme$theme7, _orderingTheme$theme8, _theme$images2, _theme$images2$logos, _theme$images3, _theme$images3$logos, _theme$images4, _theme$images4$logos, _orderingTheme$theme9, _orderingTheme$theme10, _orderingTheme$theme11, _orderingTheme$theme12, _orderingTheme$theme13, _orderingTheme$theme14, _orderingTheme$theme15, _theme$images5, _theme$images5$logos, _orderState$options7, _orderState$options7$, _orderState$options8, _orderState$options8$, _configState$configs4, _configState$configs5, _configState$configs6, _configState$configs7, _configState$configs8, _configState$configs9, _orderState$options9, _orderState$options10, _configState$configs10, _configState$configs11, _theme$defaultLanguag2, _theme$defaultLanguag3, _orderState$options11, _orderState$options12, _configState$configs12, _configState$configs13, _orderState$options13, _configState$configs14, _configState$configs15, _configState$configs16, _configState$configs17, _orderState$options14, _orderState$options15, _configState$configs18, _configState$configs19, _orderState$options16, _configState$configs20, _configState$configs21, _configState$configs22, _configState$configs23, _orderState$options17, _orderState$options18, _customerState$user2, _customerState$user3, _theme$defaultLanguag4, _theme$defaultLanguag5, _theme$defaultLanguag6, _theme$defaultLanguag7, _theme$defaultLanguag8, _theme$defaultLanguag9;
|
|
54
|
+
var _window$location$path, _configState$configs, _configState$configs$, _configState$configs2, _configState$configs3, _orderingTheme$theme, _orderingTheme$theme$, _orderingTheme$theme$2, _orderingTheme$theme$3, _orderingTheme$theme$4, _theme$header, _theme$header$compone, _theme$header$compone2, _orderState$options, _orderState$options2, _Object$keys, _customerState$user, _orderState$options5, _orderState$options5$, _theme$images, _theme$images$logos, _orderingTheme$theme2, _orderingTheme$theme3, _orderingTheme$theme4, _orderingTheme$theme5, _orderingTheme$theme6, _orderingTheme$theme7, _orderingTheme$theme8, _theme$images2, _theme$images2$logos, _theme$images3, _theme$images3$logos, _theme$images4, _theme$images4$logos, _orderingTheme$theme9, _orderingTheme$theme10, _orderingTheme$theme11, _orderingTheme$theme12, _orderingTheme$theme13, _orderingTheme$theme14, _orderingTheme$theme15, _theme$images5, _theme$images5$logos, _orderState$options7, _orderState$options7$, _orderState$options8, _orderState$options8$, _configState$configs4, _configState$configs5, _configState$configs6, _configState$configs7, _configState$configs8, _configState$configs9, _orderState$options9, _orderState$options10, _configState$configs10, _configState$configs11, _theme$defaultLanguag2, _theme$defaultLanguag3, _orderState$options11, _orderState$options12, _configState$configs12, _configState$configs13, _orderState$options13, _configState$configs14, _configState$configs15, _configState$configs16, _configState$configs17, _orderState$options14, _orderState$options15, _configState$configs18, _configState$configs19, _orderState$options16, _configState$configs20, _configState$configs21, _configState$configs22, _configState$configs23, _orderState$options17, _orderState$options18, _customerState$user2, _customerState$user3, _theme$defaultLanguag4, _theme$defaultLanguag5, _theme$defaultLanguag6, _theme$defaultLanguag7, _theme$defaultLanguag8, _theme$defaultLanguag9;
|
|
55
55
|
var isHome = props.isHome,
|
|
56
56
|
location = props.location,
|
|
57
57
|
isShowOrderOptions = props.isShowOrderOptions,
|
|
@@ -141,6 +141,7 @@ var Header = function Header(props) {
|
|
|
141
141
|
_useState22 = _slicedToArray(_useState21, 2),
|
|
142
142
|
isFarAway = _useState22[0],
|
|
143
143
|
setIsFarAway = _useState22[1];
|
|
144
|
+
var isMulticheckoutPage = (_window$location$path = window.location.pathname) === null || _window$location$path === void 0 ? void 0 : _window$location$path.includes('/multi-checkout');
|
|
144
145
|
var cartsWithProducts = (orderState === null || orderState === void 0 ? void 0 : orderState.carts) && Object.values(orderState === null || orderState === void 0 ? void 0 : orderState.carts).filter(function (cart) {
|
|
145
146
|
var _cart$products;
|
|
146
147
|
return cart.products && ((_cart$products = cart.products) === null || _cart$products === void 0 ? void 0 : _cart$products.length) > 0;
|
|
@@ -363,7 +364,7 @@ var Header = function Header(props) {
|
|
|
363
364
|
onClick: function onClick() {
|
|
364
365
|
return handleOpenLoginSignUp('signup');
|
|
365
366
|
}
|
|
366
|
-
}, t('SIGN_UP', (theme === null || theme === void 0 ? void 0 : (_theme$defaultLanguag3 = theme.defaultLanguages) === null || _theme$defaultLanguag3 === void 0 ? void 0 : _theme$defaultLanguag3.SIGN_UP) || 'Sign up'))), auth && /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, isShowOrderOptions && (windowSize.width > 768 ? /*#__PURE__*/_react.default.createElement(_CartPopover.CartPopover, {
|
|
367
|
+
}, t('SIGN_UP', (theme === null || theme === void 0 ? void 0 : (_theme$defaultLanguag3 = theme.defaultLanguages) === null || _theme$defaultLanguag3 === void 0 ? void 0 : _theme$defaultLanguag3.SIGN_UP) || 'Sign up'))), auth && /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, isShowOrderOptions && (windowSize.width > 768 ? /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, !isMulticheckoutPage ? /*#__PURE__*/_react.default.createElement(_CartPopover.CartPopover, {
|
|
367
368
|
open: openPopover.cart,
|
|
368
369
|
carts: cartsWithProducts,
|
|
369
370
|
onClick: function onClick() {
|
|
@@ -376,7 +377,7 @@ var Header = function Header(props) {
|
|
|
376
377
|
location: location,
|
|
377
378
|
isCustomerMode: isCustomerMode,
|
|
378
379
|
setPreorderBusiness: setPreorderBusiness
|
|
379
|
-
}) : /*#__PURE__*/_react.default.createElement(_HeaderOption.HeaderOption, {
|
|
380
|
+
}) : null) : /*#__PURE__*/_react.default.createElement(_HeaderOption.HeaderOption, {
|
|
380
381
|
variant: "cart",
|
|
381
382
|
totalCarts: cartsWithProducts === null || cartsWithProducts === void 0 ? void 0 : cartsWithProducts.length,
|
|
382
383
|
onClick: function onClick(variant) {
|
|
@@ -29,7 +29,7 @@ function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len
|
|
|
29
29
|
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
30
|
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
31
31
|
var OrderProgressUI = function OrderProgressUI(props) {
|
|
32
|
-
var _theme$header, _theme$header$compone, _theme$header$compone2, _theme$header$compone3, _orderList$orders, _lastOrder$business, _theme$images, _theme$images$dummies, _getOrderStatus, _getOrderStatus2;
|
|
32
|
+
var _theme$header, _theme$header$compone, _theme$header$compone2, _theme$header$compone3, _orderList$orders, _lastOrder$business, _theme$images, _theme$images$dummies, _getOrderStatus, _getOrderStatus2, _configs$general_hour, _lastOrder$reporting_, _configs$general_hour2;
|
|
33
33
|
var orderList = props.orderList,
|
|
34
34
|
isCustomerMode = props.isCustomerMode;
|
|
35
35
|
var _useLanguage = (0, _orderingComponentsExternal.useLanguage)(),
|
|
@@ -39,7 +39,11 @@ var OrderProgressUI = function OrderProgressUI(props) {
|
|
|
39
39
|
_useUtils2 = _slicedToArray(_useUtils, 1),
|
|
40
40
|
_useUtils2$ = _useUtils2[0],
|
|
41
41
|
optimizeImage = _useUtils2$.optimizeImage,
|
|
42
|
-
parseTime = _useUtils2$.parseTime
|
|
42
|
+
parseTime = _useUtils2$.parseTime,
|
|
43
|
+
parseDate = _useUtils2$.parseDate;
|
|
44
|
+
var _useConfig = (0, _orderingComponentsExternal.useConfig)(),
|
|
45
|
+
_useConfig2 = _slicedToArray(_useConfig, 1),
|
|
46
|
+
configs = _useConfig2[0].configs;
|
|
43
47
|
var theme = (0, _styledComponents.useTheme)();
|
|
44
48
|
var _useEvent = (0, _orderingComponentsExternal.useEvent)(),
|
|
45
49
|
_useEvent2 = _slicedToArray(_useEvent, 1),
|
|
@@ -48,7 +52,7 @@ var OrderProgressUI = function OrderProgressUI(props) {
|
|
|
48
52
|
_useState2 = _slicedToArray(_useState, 2),
|
|
49
53
|
lastOrder = _useState2[0],
|
|
50
54
|
setLastOrder = _useState2[1];
|
|
51
|
-
var statusToShow = [0, 3, 4, 7, 8, 9, 14, 18, 19, 20, 21];
|
|
55
|
+
var statusToShow = [0, 3, 4, 7, 8, 9, 13, 14, 18, 19, 20, 21, 22, 23];
|
|
52
56
|
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';
|
|
53
57
|
var handleGoToPage = function handleGoToPage(index) {
|
|
54
58
|
events.emit('go_to_page', {
|
|
@@ -99,9 +103,11 @@ var OrderProgressUI = function OrderProgressUI(props) {
|
|
|
99
103
|
utc: false
|
|
100
104
|
}) : parseTime(lastOrder === null || lastOrder === void 0 ? void 0 : lastOrder.delivery_datetime, {
|
|
101
105
|
utc: false
|
|
102
|
-
}), "\xA0-\xA0", /*#__PURE__*/_react.default.createElement(_OrderEta.OrderEta, {
|
|
106
|
+
}), "\xA0-\xA0", statusToShow.includes(lastOrder === null || lastOrder === void 0 ? void 0 : lastOrder.status) ? /*#__PURE__*/_react.default.createElement(_OrderEta.OrderEta, {
|
|
103
107
|
order: lastOrder,
|
|
104
|
-
outputFormat:
|
|
108
|
+
outputFormat: (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) || 'HH:mm'
|
|
109
|
+
}) : parseDate(lastOrder === null || lastOrder === void 0 ? void 0 : (_lastOrder$reporting_ = lastOrder.reporting_data) === null || _lastOrder$reporting_ === void 0 ? void 0 : _lastOrder$reporting_.at["status:".concat(lastOrder.status)], {
|
|
110
|
+
outputFormat: configs === null || configs === void 0 ? void 0 : (_configs$general_hour2 = configs.general_hour_format) === null || _configs$general_hour2 === void 0 ? void 0 : _configs$general_hour2.value
|
|
105
111
|
}))))))));
|
|
106
112
|
};
|
|
107
113
|
var OrderProgress = function OrderProgress(props) {
|
package/package.json
CHANGED
|
@@ -137,6 +137,9 @@ export const CartContent = (props) => {
|
|
|
137
137
|
<h4>{t('TOTAL_FOR_ALL_CARTS', 'Total for all Carts')}</h4>
|
|
138
138
|
<h4>{parsePrice(totalCartsPrice)}</h4>
|
|
139
139
|
</div>
|
|
140
|
+
<span>
|
|
141
|
+
<p>{t('CART_GROUP_MESSAGE_ALERT', 'Discounts may be applied at the time of payment for this group.')}</p>
|
|
142
|
+
</span>
|
|
140
143
|
</MultiCartPriceContainer>
|
|
141
144
|
)}
|
|
142
145
|
</>
|
|
@@ -87,6 +87,8 @@ export const Header = (props) => {
|
|
|
87
87
|
const [confirm, setConfirm] = useState({ open: false, content: null, handleOnAccept: null })
|
|
88
88
|
const [isFarAway, setIsFarAway] = useState(false)
|
|
89
89
|
|
|
90
|
+
const isMulticheckoutPage = window.location.pathname?.includes('/multi-checkout')
|
|
91
|
+
|
|
90
92
|
const cartsWithProducts = (orderState?.carts && Object.values(orderState?.carts).filter(cart => cart.products && cart.products?.length > 0)) || null
|
|
91
93
|
|
|
92
94
|
const windowSize = useWindowSize()
|
|
@@ -361,16 +363,20 @@ export const Header = (props) => {
|
|
|
361
363
|
<>
|
|
362
364
|
{isShowOrderOptions && (
|
|
363
365
|
windowSize.width > 768 ? (
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
|
|
366
|
+
<>
|
|
367
|
+
{!isMulticheckoutPage ? (
|
|
368
|
+
<CartPopover
|
|
369
|
+
open={openPopover.cart}
|
|
370
|
+
carts={cartsWithProducts}
|
|
371
|
+
onClick={() => handleTogglePopover('cart')}
|
|
372
|
+
onClose={() => handleClosePopover('cart')}
|
|
373
|
+
auth={auth}
|
|
374
|
+
location={location}
|
|
375
|
+
isCustomerMode={isCustomerMode}
|
|
376
|
+
setPreorderBusiness={setPreorderBusiness}
|
|
377
|
+
/>
|
|
378
|
+
) : null}
|
|
379
|
+
</>
|
|
374
380
|
) : (
|
|
375
381
|
<HeaderOption
|
|
376
382
|
variant='cart'
|
|
@@ -3,6 +3,7 @@ import {
|
|
|
3
3
|
useLanguage,
|
|
4
4
|
useUtils,
|
|
5
5
|
useEvent,
|
|
6
|
+
useConfig,
|
|
6
7
|
OrderList as OrderListController
|
|
7
8
|
} from 'ordering-components-external'
|
|
8
9
|
import { Button } from '../../styles/Buttons'
|
|
@@ -31,11 +32,12 @@ const OrderProgressUI = (props) => {
|
|
|
31
32
|
isCustomerMode
|
|
32
33
|
} = props
|
|
33
34
|
const [, t] = useLanguage()
|
|
34
|
-
const [{ optimizeImage, parseTime }] = useUtils()
|
|
35
|
+
const [{ optimizeImage, parseTime, parseDate }] = useUtils()
|
|
36
|
+
const [{ configs }] = useConfig()
|
|
35
37
|
const theme = useTheme()
|
|
36
38
|
const [events] = useEvent()
|
|
37
39
|
const [lastOrder, setLastOrder] = useState(null)
|
|
38
|
-
const statusToShow = [0, 3, 4, 7, 8, 9, 14, 18, 19, 20, 21]
|
|
40
|
+
const statusToShow = [0, 3, 4, 7, 8, 9, 13, 14, 18, 19, 20, 21, 22, 23]
|
|
39
41
|
|
|
40
42
|
const isChew = theme?.header?.components?.layout?.type?.toLowerCase() === 'chew'
|
|
41
43
|
|
|
@@ -110,7 +112,11 @@ const OrderProgressUI = (props) => {
|
|
|
110
112
|
? parseTime(lastOrder?.delivery_datetime_utc, { outputFormat: 'hh:mm A', utc: false })
|
|
111
113
|
: parseTime(lastOrder?.delivery_datetime, { utc: false })}
|
|
112
114
|
-
|
|
113
|
-
|
|
115
|
+
{statusToShow.includes(lastOrder?.status) ? (
|
|
116
|
+
<OrderEta order={lastOrder} outputFormat={configs?.general_hour_format?.value || 'HH:mm'} />
|
|
117
|
+
) : (
|
|
118
|
+
parseDate(lastOrder?.reporting_data?.at[`status:${lastOrder.status}`], { outputFormat: configs?.general_hour_format?.value })
|
|
119
|
+
)}
|
|
114
120
|
</span>
|
|
115
121
|
</TimeWrapper>
|
|
116
122
|
</ProgressTextWrapper>
|