ordering-ui-external 10.6.2 → 10.7.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/_bundles/{0.ordering-ui.fd929d6879c63ef1ff62.js → 0.ordering-ui.69ebaa12d869719caa38.js} +1 -1
- package/_bundles/{4.ordering-ui.fd929d6879c63ef1ff62.js → 4.ordering-ui.69ebaa12d869719caa38.js} +1 -1
- package/_bundles/{7.ordering-ui.fd929d6879c63ef1ff62.js → 7.ordering-ui.69ebaa12d869719caa38.js} +1 -1
- package/_bundles/ordering-ui.69ebaa12d869719caa38.js +2 -0
- package/_modules/themes/callcenterOriginal/src/components/AddressForm/index.js +31 -17
- package/_modules/themes/callcenterOriginal/src/components/AddressForm/styles.js +8 -5
- package/_modules/themes/callcenterOriginal/src/components/AddressList/index.js +21 -11
- package/_modules/themes/callcenterOriginal/src/components/AddressList/styles.js +15 -5
- package/_modules/themes/callcenterOriginal/src/components/PhoneAutocomplete/index.js +183 -59
- package/_modules/themes/callcenterOriginal/src/components/PhoneAutocomplete/styles.js +55 -9
- package/_modules/themes/five/src/components/BusinessProductsListing/index.js +25 -3
- package/_modules/themes/five/src/components/MyOrders/index.js +11 -2
- package/_modules/themes/five/src/components/OrderDetails/index.js +4 -2
- package/_modules/themes/five/src/components/OrdersOption/index.js +21 -18
- package/_modules/themes/five/src/components/PageBanner/index.js +23 -9
- package/_modules/themes/five/src/components/PhoneAutocomplete/index.js +1 -1
- package/_modules/themes/five/src/components/ProductItemAccordion/index.js +5 -2
- package/_modules/themes/five/src/components/RenderProductsLayout/index.js +5 -2
- package/_modules/themes/five/src/components/UserDetails/styles.js +2 -2
- package/_modules/themes/five/src/components/WebsocketStatus/index.js +6 -3
- package/package.json +2 -2
- package/src/themes/callcenterOriginal/src/components/AddressForm/index.js +22 -13
- package/src/themes/callcenterOriginal/src/components/AddressForm/styles.js +20 -7
- package/src/themes/callcenterOriginal/src/components/AddressList/index.js +26 -14
- package/src/themes/callcenterOriginal/src/components/AddressList/styles.js +13 -5
- package/src/themes/callcenterOriginal/src/components/PhoneAutocomplete/index.js +210 -68
- package/src/themes/callcenterOriginal/src/components/PhoneAutocomplete/styles.js +127 -11
- package/src/themes/five/src/components/BusinessProductsListing/index.js +21 -0
- package/src/themes/five/src/components/BusinessesListing/layouts/OriginalBusinessesListing/index.js +1 -1
- package/src/themes/five/src/components/MyOrders/index.js +5 -1
- package/src/themes/five/src/components/OrderDetails/index.js +2 -0
- package/src/themes/five/src/components/OrdersOption/index.js +5 -3
- package/src/themes/five/src/components/PageBanner/index.js +14 -4
- package/src/themes/five/src/components/PhoneAutocomplete/index.js +1 -2
- package/src/themes/five/src/components/ProductItemAccordion/index.js +4 -0
- package/src/themes/five/src/components/RenderProductsLayout/index.js +4 -1
- package/src/themes/five/src/components/UserDetails/styles.js +2 -2
- package/src/themes/five/src/components/WebsocketStatus/index.js +4 -4
- package/_bundles/ordering-ui.fd929d6879c63ef1ff62.js +0 -2
- /package/_bundles/{1.ordering-ui.fd929d6879c63ef1ff62.js → 1.ordering-ui.69ebaa12d869719caa38.js} +0 -0
- /package/_bundles/{2.ordering-ui.fd929d6879c63ef1ff62.js → 2.ordering-ui.69ebaa12d869719caa38.js} +0 -0
- /package/_bundles/{5.ordering-ui.fd929d6879c63ef1ff62.js → 5.ordering-ui.69ebaa12d869719caa38.js} +0 -0
- /package/_bundles/{6.ordering-ui.fd929d6879c63ef1ff62.js → 6.ordering-ui.69ebaa12d869719caa38.js} +0 -0
- /package/_bundles/{7.ordering-ui.fd929d6879c63ef1ff62.js.LICENSE.txt → 7.ordering-ui.69ebaa12d869719caa38.js.LICENSE.txt} +0 -0
- /package/_bundles/{8.ordering-ui.fd929d6879c63ef1ff62.js → 8.ordering-ui.69ebaa12d869719caa38.js} +0 -0
- /package/_bundles/{9.ordering-ui.fd929d6879c63ef1ff62.js → 9.ordering-ui.69ebaa12d869719caa38.js} +0 -0
- /package/_bundles/{ordering-ui.fd929d6879c63ef1ff62.js.LICENSE.txt → ordering-ui.69ebaa12d869719caa38.js.LICENSE.txt} +0 -0
|
@@ -9,18 +9,15 @@ var _react = _interopRequireWildcard(require("react"));
|
|
|
9
9
|
var _reactSelect = _interopRequireDefault(require("react-select"));
|
|
10
10
|
var _orderingComponentsExternal = require("ordering-components-external");
|
|
11
11
|
var _styledComponents = require("styled-components");
|
|
12
|
-
var
|
|
13
|
-
var
|
|
14
|
-
var _Buttons = require("../../styles/Buttons");
|
|
15
|
-
var _Confirm = require("../Confirm");
|
|
16
|
-
var _UserDetails = require("../UserDetails");
|
|
12
|
+
var _Confirm = require("../../../../five/src/components/Confirm");
|
|
13
|
+
var _five = require("../../../../five");
|
|
17
14
|
var _AddressList = require("../AddressList");
|
|
15
|
+
var _UserDetails = require("../UserDetails");
|
|
18
16
|
var _styles = require("./styles");
|
|
19
17
|
var _MdcCellphoneAndroid = _interopRequireDefault(require("@meronex/icons/mdc/MdcCellphoneAndroid"));
|
|
20
18
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
21
19
|
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); }
|
|
22
20
|
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; }
|
|
23
|
-
function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
|
|
24
21
|
function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); }
|
|
25
22
|
function _nonIterableSpread() { throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
|
|
26
23
|
function _iterableToArray(iter) { if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter); }
|
|
@@ -37,20 +34,27 @@ function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len
|
|
|
37
34
|
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; } }
|
|
38
35
|
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
39
36
|
var PhoneAutocompleteUI = function PhoneAutocompleteUI(props) {
|
|
40
|
-
var
|
|
37
|
+
var _orderState$options, _configState$configs, _customersPhones$user2, _orderState$options4, _orderState$options7, _theme$images, _theme$images2, _orderState$options8, _orderState$options9, _orderState$options11, _orderState$options12, _theme$colors, _theme$images3, _customerState$result, _customerState$result2;
|
|
41
38
|
var phone = props.phone,
|
|
42
39
|
customerState = props.customerState,
|
|
43
40
|
customersPhones = props.customersPhones,
|
|
44
41
|
setCustomersPhones = props.setCustomersPhones,
|
|
45
42
|
openModal = props.openModal,
|
|
43
|
+
limitPhoneLength = props.limitPhoneLength,
|
|
46
44
|
setOpenModal = props.setOpenModal,
|
|
47
45
|
onChangeNumber = props.onChangeNumber,
|
|
48
46
|
setCustomerState = props.setCustomerState,
|
|
49
47
|
countryCallingCode = props.countryCallingCode,
|
|
50
|
-
onRedirectPage = props.onRedirectPage
|
|
48
|
+
onRedirectPage = props.onRedirectPage,
|
|
49
|
+
urlPhone = props.urlPhone,
|
|
50
|
+
orderTypes = props.orderTypes,
|
|
51
|
+
localPhoneCode = props.localPhoneCode;
|
|
52
|
+
var allOrderTypes = [1, 2, 3, 4, 5];
|
|
53
|
+
var pickupTypes = [2, 3, 4, 5];
|
|
51
54
|
var _useOrder = (0, _orderingComponentsExternal.useOrder)(),
|
|
52
|
-
_useOrder2 = _slicedToArray(_useOrder,
|
|
53
|
-
orderState = _useOrder2[0]
|
|
55
|
+
_useOrder2 = _slicedToArray(_useOrder, 2),
|
|
56
|
+
orderState = _useOrder2[0],
|
|
57
|
+
changeType = _useOrder2[1].changeType;
|
|
54
58
|
var _useLanguage = (0, _orderingComponentsExternal.useLanguage)(),
|
|
55
59
|
_useLanguage2 = _slicedToArray(_useLanguage, 2),
|
|
56
60
|
t = _useLanguage2[1];
|
|
@@ -58,6 +62,9 @@ var PhoneAutocompleteUI = function PhoneAutocompleteUI(props) {
|
|
|
58
62
|
var _useCustomer = (0, _orderingComponentsExternal.useCustomer)(),
|
|
59
63
|
_useCustomer2 = _slicedToArray(_useCustomer, 2),
|
|
60
64
|
deleteUserCustomer = _useCustomer2[1].deleteUserCustomer;
|
|
65
|
+
var _useConfig = (0, _orderingComponentsExternal.useConfig)(),
|
|
66
|
+
_useConfig2 = _slicedToArray(_useConfig, 1),
|
|
67
|
+
configState = _useConfig2[0];
|
|
61
68
|
var _useState = (0, _react.useState)({
|
|
62
69
|
open: false,
|
|
63
70
|
content: []
|
|
@@ -65,7 +72,7 @@ var PhoneAutocompleteUI = function PhoneAutocompleteUI(props) {
|
|
|
65
72
|
_useState2 = _slicedToArray(_useState, 2),
|
|
66
73
|
alertState = _useState2[0],
|
|
67
74
|
setAlertState = _useState2[1];
|
|
68
|
-
var _useState3 = (0, _react.useState)(''),
|
|
75
|
+
var _useState3 = (0, _react.useState)(urlPhone !== null && urlPhone !== void 0 ? urlPhone : ''),
|
|
69
76
|
_useState4 = _slicedToArray(_useState3, 2),
|
|
70
77
|
inputValue = _useState4[0],
|
|
71
78
|
setInputValue = _useState4[1];
|
|
@@ -81,7 +88,16 @@ var PhoneAutocompleteUI = function PhoneAutocompleteUI(props) {
|
|
|
81
88
|
_useState10 = _slicedToArray(_useState9, 2),
|
|
82
89
|
isAddressFormOpen = _useState10[0],
|
|
83
90
|
setIsAddressFormOpen = _useState10[1];
|
|
91
|
+
var _useState11 = (0, _react.useState)(pickupTypes.includes(orderState === null || orderState === void 0 || (_orderState$options = orderState.options) === null || _orderState$options === void 0 ? void 0 : _orderState$options.type)),
|
|
92
|
+
_useState12 = _slicedToArray(_useState11, 2),
|
|
93
|
+
isPickupSelected = _useState12[0],
|
|
94
|
+
setIsPickupSelected = _useState12[1];
|
|
84
95
|
var userCustomer = JSON.parse(window.localStorage.getItem('user-customer'));
|
|
96
|
+
var configTypes = (configState === null || configState === void 0 || (_configState$configs = configState.configs) === null || _configState$configs === void 0 || (_configState$configs = _configState$configs.order_types_allowed) === null || _configState$configs === void 0 ? void 0 : _configState$configs.value.split('|').filter(function (value) {
|
|
97
|
+
return allOrderTypes.includes(Number(value));
|
|
98
|
+
}).map(function (value) {
|
|
99
|
+
return Number(value);
|
|
100
|
+
})) || [];
|
|
85
101
|
var userName = userCustomer !== null && userCustomer !== void 0 && userCustomer.lastname ? "".concat(userCustomer === null || userCustomer === void 0 ? void 0 : userCustomer.name, " ").concat(userCustomer === null || userCustomer === void 0 ? void 0 : userCustomer.lastname) : userCustomer === null || userCustomer === void 0 ? void 0 : userCustomer.name;
|
|
86
102
|
var handleCloseAlert = function handleCloseAlert() {
|
|
87
103
|
setCustomersPhones(_objectSpread(_objectSpread({}, customersPhones), {}, {
|
|
@@ -105,8 +121,8 @@ var PhoneAutocompleteUI = function PhoneAutocompleteUI(props) {
|
|
|
105
121
|
});
|
|
106
122
|
};
|
|
107
123
|
var handleFindClick = function handleFindClick() {
|
|
108
|
-
var _orderState$
|
|
109
|
-
if (userCustomer !== null && userCustomer !== void 0 && userCustomer.id && orderState !== null && orderState !== void 0 && (_orderState$
|
|
124
|
+
var _orderState$options2;
|
|
125
|
+
if (userCustomer !== null && userCustomer !== void 0 && userCustomer.id && orderState !== null && orderState !== void 0 && (_orderState$options2 = orderState.options) !== null && _orderState$options2 !== void 0 && (_orderState$options2 = _orderState$options2.address) !== null && _orderState$options2 !== void 0 && _orderState$options2.address) {
|
|
110
126
|
onRedirectPage && onRedirectPage('search');
|
|
111
127
|
} else {
|
|
112
128
|
setAlertState({
|
|
@@ -115,6 +131,14 @@ var PhoneAutocompleteUI = function PhoneAutocompleteUI(props) {
|
|
|
115
131
|
});
|
|
116
132
|
}
|
|
117
133
|
};
|
|
134
|
+
var handleChangeType = function handleChangeType(value) {
|
|
135
|
+
if (!(orderState !== null && orderState !== void 0 && orderState.loading)) {
|
|
136
|
+
changeType(value);
|
|
137
|
+
if (value === 1) {
|
|
138
|
+
setIsPickupSelected(false);
|
|
139
|
+
}
|
|
140
|
+
}
|
|
141
|
+
};
|
|
118
142
|
(0, _react.useEffect)(function () {
|
|
119
143
|
if (customersPhones !== null && customersPhones !== void 0 && customersPhones.error) {
|
|
120
144
|
setAlertState({
|
|
@@ -125,13 +149,14 @@ var PhoneAutocompleteUI = function PhoneAutocompleteUI(props) {
|
|
|
125
149
|
}, [customersPhones === null || customersPhones === void 0 ? void 0 : customersPhones.error]);
|
|
126
150
|
var onInputChange = function onInputChange(inputValue, _ref) {
|
|
127
151
|
var action = _ref.action;
|
|
128
|
-
if (action === 'menu-close' || action === 'input-blur' || action === 'set-value') {
|
|
152
|
+
if (action === 'menu-close' || action === 'input-blur' || action === 'set-value' || inputValue.charAt(0) === '0') {
|
|
129
153
|
return;
|
|
130
154
|
}
|
|
131
155
|
if (!inputValue) {
|
|
132
156
|
setInputValue(inputValue);
|
|
157
|
+
onChangeNumber(inputValue);
|
|
133
158
|
}
|
|
134
|
-
if (inputValue && inputValue.length >
|
|
159
|
+
if (inputValue && inputValue.length > limitPhoneLength || !/^[0-9]+$/.test(inputValue)) {
|
|
135
160
|
return;
|
|
136
161
|
}
|
|
137
162
|
setInputValue(inputValue);
|
|
@@ -141,6 +166,10 @@ var PhoneAutocompleteUI = function PhoneAutocompleteUI(props) {
|
|
|
141
166
|
var _customersPhones$user;
|
|
142
167
|
setOptSelected(option);
|
|
143
168
|
setInputValue(option ? option === null || option === void 0 ? void 0 : option.value : '');
|
|
169
|
+
if (!option) {
|
|
170
|
+
onChangeNumber('');
|
|
171
|
+
return;
|
|
172
|
+
}
|
|
144
173
|
var user = (_customersPhones$user = customersPhones.users) === null || _customersPhones$user === void 0 ? void 0 : _customersPhones$user.find(function (user) {
|
|
145
174
|
return user.cellphone === (option === null || option === void 0 ? void 0 : option.value) || user.phone === (option === null || option === void 0 ? void 0 : option.value);
|
|
146
175
|
});
|
|
@@ -148,29 +177,39 @@ var PhoneAutocompleteUI = function PhoneAutocompleteUI(props) {
|
|
|
148
177
|
setCustomerState(_objectSpread(_objectSpread({}, customerState), {}, {
|
|
149
178
|
result: user
|
|
150
179
|
}));
|
|
151
|
-
setOpenModal(
|
|
180
|
+
setOpenModal({
|
|
181
|
+
signup: false,
|
|
152
182
|
customer: true
|
|
183
|
+
});
|
|
184
|
+
} else {
|
|
185
|
+
setCustomerState(_objectSpread(_objectSpread({}, customerState), {}, {
|
|
186
|
+
result: {
|
|
187
|
+
error: false
|
|
188
|
+
}
|
|
153
189
|
}));
|
|
190
|
+
setOpenModal({
|
|
191
|
+
customer: false,
|
|
192
|
+
signup: true
|
|
193
|
+
});
|
|
154
194
|
}
|
|
155
195
|
};
|
|
156
196
|
var createNewUser = function createNewUser() {
|
|
157
197
|
var _optSelected$value;
|
|
158
|
-
if (optSelected && (optSelected === null || optSelected === void 0 || (_optSelected$value = optSelected.value) === null || _optSelected$value === void 0 ? void 0 : _optSelected$value.length) ===
|
|
198
|
+
if (optSelected && (optSelected === null || optSelected === void 0 || (_optSelected$value = optSelected.value) === null || _optSelected$value === void 0 ? void 0 : _optSelected$value.length) === limitPhoneLength || !optSelected && phone.length === limitPhoneLength) {
|
|
159
199
|
setOpenModal(_objectSpread(_objectSpread({}, openModal), {}, {
|
|
160
200
|
signup: true
|
|
161
201
|
}));
|
|
162
202
|
} else {
|
|
163
203
|
setAlertState({
|
|
164
204
|
open: true,
|
|
165
|
-
content: t('ERROR_MIN_CHARACTERS_PHONE', 'The Phone / Mobile must be
|
|
205
|
+
content: t('ERROR_MIN_CHARACTERS_PHONE', 'The Phone / Mobile must be :length: characters').replace(':length:', limitPhoneLength)
|
|
166
206
|
});
|
|
167
207
|
}
|
|
168
208
|
};
|
|
169
209
|
var handleCloseAddressList = function handleCloseAddressList() {
|
|
170
|
-
setOpenModal({
|
|
171
|
-
openModal: openModal,
|
|
210
|
+
setOpenModal(_objectSpread(_objectSpread({}, openModal), {}, {
|
|
172
211
|
customer: false
|
|
173
|
-
});
|
|
212
|
+
}));
|
|
174
213
|
setCustomerState(_objectSpread(_objectSpread({}, customerState), {}, {
|
|
175
214
|
result: {
|
|
176
215
|
error: false
|
|
@@ -178,24 +217,88 @@ var PhoneAutocompleteUI = function PhoneAutocompleteUI(props) {
|
|
|
178
217
|
}));
|
|
179
218
|
deleteUserCustomer(true);
|
|
180
219
|
};
|
|
220
|
+
var handleChangeToPickup = function handleChangeToPickup() {
|
|
221
|
+
var _orderTypes$find;
|
|
222
|
+
var firstEnabledPickupType = (_orderTypes$find = orderTypes.find(function (type) {
|
|
223
|
+
return (configTypes === null || configTypes === void 0 ? void 0 : configTypes.includes(type.value)) && type.value !== 1;
|
|
224
|
+
})) === null || _orderTypes$find === void 0 ? void 0 : _orderTypes$find.value;
|
|
225
|
+
handleChangeType(firstEnabledPickupType);
|
|
226
|
+
setIsPickupSelected(true);
|
|
227
|
+
};
|
|
181
228
|
var optionsToSelect = customersPhones.users.map(function (user) {
|
|
182
229
|
var obj = {};
|
|
183
230
|
obj.value = user.cellphone || user.phone;
|
|
184
231
|
obj.label = "".concat(user !== null && user !== void 0 && user.country_phone_code ? "(".concat(user === null || user === void 0 ? void 0 : user.country_phone_code, ")") : '', " ").concat(user !== null && user !== void 0 && user.phone && !(user !== null && user !== void 0 && user.cellphone) ? "".concat(user === null || user === void 0 ? void 0 : user.phone) : '', " ").concat(user !== null && user !== void 0 && user.cellphone ? "".concat(user.cellphone) : '', " - {").concat(user.name, "}");
|
|
185
232
|
return obj;
|
|
186
233
|
}) || [];
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
234
|
+
(0, _react.useEffect)(function () {
|
|
235
|
+
if (!urlPhone) return;
|
|
236
|
+
onInputChange(urlPhone, {
|
|
237
|
+
action: 'url'
|
|
238
|
+
});
|
|
239
|
+
onChange({
|
|
240
|
+
value: urlPhone,
|
|
241
|
+
label: urlPhone
|
|
242
|
+
});
|
|
243
|
+
}, [urlPhone, customersPhones === null || customersPhones === void 0 || (_customersPhones$user2 = customersPhones.users) === null || _customersPhones$user2 === void 0 ? void 0 : _customersPhones$user2.length]);
|
|
244
|
+
(0, _react.useEffect)(function () {
|
|
245
|
+
var _orderState$options3;
|
|
246
|
+
if (pickupTypes.includes(orderState === null || orderState === void 0 || (_orderState$options3 = orderState.options) === null || _orderState$options3 === void 0 ? void 0 : _orderState$options3.type)) {
|
|
247
|
+
setIsPickupSelected(true);
|
|
248
|
+
}
|
|
249
|
+
}, [orderState === null || orderState === void 0 || (_orderState$options4 = orderState.options) === null || _orderState$options4 === void 0 ? void 0 : _orderState$options4.type]);
|
|
250
|
+
var OrderTypesComponent = function OrderTypesComponent() {
|
|
251
|
+
return /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, orderTypes && (configTypes ? orderTypes.filter(function (type) {
|
|
252
|
+
return (configTypes === null || configTypes === void 0 ? void 0 : configTypes.includes(type.value)) && type.value !== 1;
|
|
253
|
+
}) : orderTypes).map(function (item, i) {
|
|
254
|
+
var _orderState$options5, _orderState$options6;
|
|
255
|
+
return /*#__PURE__*/_react.default.createElement(_five.Button, {
|
|
256
|
+
key: item.value,
|
|
257
|
+
onClick: function onClick() {
|
|
258
|
+
return handleChangeType(item.value);
|
|
259
|
+
},
|
|
260
|
+
color: (orderState === null || orderState === void 0 || (_orderState$options5 = orderState.options) === null || _orderState$options5 === void 0 ? void 0 : _orderState$options5.type) === (item === null || item === void 0 ? void 0 : item.value) ? 'primary' : 'secondary',
|
|
261
|
+
disabled: orderState === null || orderState === void 0 ? void 0 : orderState.loading,
|
|
262
|
+
className: (orderState === null || orderState === void 0 || (_orderState$options6 = orderState.options) === null || _orderState$options6 === void 0 ? void 0 : _orderState$options6.type) !== (item === null || item === void 0 ? void 0 : item.value) ? 'activated' : ''
|
|
263
|
+
}, item.text);
|
|
264
|
+
}));
|
|
265
|
+
};
|
|
266
|
+
return /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, /*#__PURE__*/_react.default.createElement(_styles.PhoneContainer, null, /*#__PURE__*/_react.default.createElement(_styles.ContentWrapper, null, /*#__PURE__*/_react.default.createElement(_styles.Title, null, t('TITLE_HOME_CALLCENTER', 'Welcome to your Ordering Call Center.')), /*#__PURE__*/_react.default.createElement(_styles.Slogan, null, t('SUBTITLE_HOME_CALLCENTER', 'Start first by selecting a delivery type')), !(userCustomer && orderState !== null && orderState !== void 0 && (_orderState$options7 = orderState.options) !== null && _orderState$options7 !== void 0 && (_orderState$options7 = _orderState$options7.address) !== null && _orderState$options7 !== void 0 && _orderState$options7.address) && /*#__PURE__*/_react.default.createElement(_styles.TypesContainer, null, configTypes.includes(1) && /*#__PURE__*/_react.default.createElement(_styles.TypeButton, {
|
|
267
|
+
onClick: function onClick() {
|
|
268
|
+
return handleChangeType(1);
|
|
269
|
+
},
|
|
270
|
+
disabled: orderState === null || orderState === void 0 ? void 0 : orderState.loading,
|
|
271
|
+
activated: !isPickupSelected
|
|
272
|
+
}, /*#__PURE__*/_react.default.createElement(_styles.IconTypeButton, {
|
|
273
|
+
activated: !isPickupSelected
|
|
274
|
+
}, /*#__PURE__*/_react.default.createElement("img", {
|
|
275
|
+
src: theme === null || theme === void 0 || (_theme$images = theme.images) === null || _theme$images === void 0 || (_theme$images = _theme$images.general) === null || _theme$images === void 0 ? void 0 : _theme$images.deliveryIco,
|
|
276
|
+
width: 20,
|
|
277
|
+
height: 20
|
|
278
|
+
})), /*#__PURE__*/_react.default.createElement("p", null, t('DELIVERY', 'Delivery'))), configTypes.some(function (type) {
|
|
279
|
+
return pickupTypes.includes(type);
|
|
280
|
+
}) && /*#__PURE__*/_react.default.createElement(_styles.TypeButton, {
|
|
281
|
+
disabled: orderState === null || orderState === void 0 ? void 0 : orderState.loading,
|
|
282
|
+
activated: isPickupSelected,
|
|
283
|
+
onClick: function onClick() {
|
|
284
|
+
return handleChangeToPickup();
|
|
285
|
+
}
|
|
286
|
+
}, /*#__PURE__*/_react.default.createElement(_styles.IconTypeButton, {
|
|
287
|
+
activated: isPickupSelected
|
|
288
|
+
}, /*#__PURE__*/_react.default.createElement("img", {
|
|
289
|
+
src: theme === null || theme === void 0 || (_theme$images2 = theme.images) === null || _theme$images2 === void 0 || (_theme$images2 = _theme$images2.general) === null || _theme$images2 === void 0 ? void 0 : _theme$images2.pickupIco,
|
|
290
|
+
width: 22,
|
|
291
|
+
height: 22
|
|
292
|
+
})), /*#__PURE__*/_react.default.createElement("p", null, t('PICKUP', 'Pickup')))), isPickupSelected && /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, /*#__PURE__*/_react.default.createElement("p", null, t('WHAT_PICKUP_YOU_NEED', 'What kind of pickup do you need?')), /*#__PURE__*/_react.default.createElement(_styles.AdditionalTypesContainer, null, /*#__PURE__*/_react.default.createElement(OrderTypesComponent, null))), configTypes.includes(orderState === null || orderState === void 0 || (_orderState$options8 = orderState.options) === null || _orderState$options8 === void 0 ? void 0 : _orderState$options8.type) && /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, !userCustomer && /*#__PURE__*/_react.default.createElement(_styles.PhoneAutocompleteContainer, null, /*#__PURE__*/_react.default.createElement("h2", null, t('ADDING_CUSTOMERS_PHONE_NUMBER', 'Adding the customers’ phone number')), /*#__PURE__*/_react.default.createElement(_styles.WrappBtn, null, /*#__PURE__*/_react.default.createElement(_five.Button, {
|
|
293
|
+
color: inputValue || userCustomer && orderState !== null && orderState !== void 0 && (_orderState$options9 = orderState.options) !== null && _orderState$options9 !== void 0 && (_orderState$options9 = _orderState$options9.address) !== null && _orderState$options9 !== void 0 && _orderState$options9.address ? 'primary' : 'secundary',
|
|
294
|
+
onMouseDown: function onMouseDown() {
|
|
295
|
+
var _orderState$options10;
|
|
296
|
+
return !(userCustomer && orderState !== null && orderState !== void 0 && (_orderState$options10 = orderState.options) !== null && _orderState$options10 !== void 0 && (_orderState$options10 = _orderState$options10.address) !== null && _orderState$options10 !== void 0 && _orderState$options10.address) ? createNewUser() : handleFindClick();
|
|
297
|
+
},
|
|
298
|
+
disabled: !inputValue && !(userCustomer && orderState !== null && orderState !== void 0 && (_orderState$options11 = orderState.options) !== null && _orderState$options11 !== void 0 && (_orderState$options11 = _orderState$options11.address) !== null && _orderState$options11 !== void 0 && _orderState$options11.address)
|
|
299
|
+
}, !(userCustomer && orderState !== null && orderState !== void 0 && (_orderState$options12 = orderState.options) !== null && _orderState$options12 !== void 0 && (_orderState$options12 = _orderState$options12.address) !== null && _orderState$options12 !== void 0 && _orderState$options12.address) ? t('CREATE_CUSTOMER', 'Create new customer') : "".concat(t('CONTINUE_WITH', 'Continue with'), " ").concat(userName))), /*#__PURE__*/_react.default.createElement(_styles.SelectContainer, null, /*#__PURE__*/_react.default.createElement(_MdcCellphoneAndroid.default, {
|
|
300
|
+
size: 18,
|
|
301
|
+
color: theme === null || theme === void 0 || (_theme$colors = theme.colors) === null || _theme$colors === void 0 ? void 0 : _theme$colors.primary
|
|
199
302
|
}), /*#__PURE__*/_react.default.createElement(_reactSelect.default, {
|
|
200
303
|
isSearchable: true,
|
|
201
304
|
isClearable: true,
|
|
@@ -211,29 +314,29 @@ var PhoneAutocompleteUI = function PhoneAutocompleteUI(props) {
|
|
|
211
314
|
onInputChange: onInputChange,
|
|
212
315
|
isLoading: customersPhones === null || customersPhones === void 0 ? void 0 : customersPhones.loading,
|
|
213
316
|
options: optionsToSelect
|
|
214
|
-
})
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
var _orderState$options3;
|
|
218
|
-
return !(userCustomer && orderState !== null && orderState !== void 0 && (_orderState$options3 = orderState.options) !== null && _orderState$options3 !== void 0 && (_orderState$options3 = _orderState$options3.address) !== null && _orderState$options3 !== void 0 && _orderState$options3.address) ? createNewUser() : handleFindClick();
|
|
317
|
+
}), optSelected && /*#__PURE__*/_react.default.createElement(_styles.ContinueButton, null, /*#__PURE__*/_react.default.createElement(_five.Button, {
|
|
318
|
+
onClick: function onClick() {
|
|
319
|
+
return onChange(optSelected);
|
|
219
320
|
},
|
|
220
|
-
|
|
221
|
-
},
|
|
321
|
+
color: "primary"
|
|
322
|
+
}, t('CONTINUE', 'Continue'))))))), /*#__PURE__*/_react.default.createElement(_styles.ImageWrapper, {
|
|
323
|
+
bgimage: theme === null || theme === void 0 || (_theme$images3 = theme.images) === null || _theme$images3 === void 0 || (_theme$images3 = _theme$images3.general) === null || _theme$images3 === void 0 ? void 0 : _theme$images3.phoneHero
|
|
324
|
+
})), /*#__PURE__*/_react.default.createElement(_five.Modal, {
|
|
222
325
|
open: openModal.signup,
|
|
223
326
|
width: "80%",
|
|
224
327
|
onClose: function onClose() {
|
|
225
|
-
return setOpenModal({
|
|
226
|
-
openModal: openModal,
|
|
328
|
+
return setOpenModal(_objectSpread(_objectSpread({}, openModal), {}, {
|
|
227
329
|
signup: false
|
|
228
|
-
});
|
|
330
|
+
}));
|
|
229
331
|
}
|
|
230
|
-
}, /*#__PURE__*/_react.default.createElement(
|
|
231
|
-
externalPhoneNumber: "".concat(countryCallingCode, " ").concat((optSelected === null || optSelected === void 0 ? void 0 : optSelected.value) || phone),
|
|
332
|
+
}, /*#__PURE__*/_react.default.createElement(_five.SignUpForm, {
|
|
333
|
+
externalPhoneNumber: "".concat(localPhoneCode || countryCallingCode, " ").concat((optSelected === null || optSelected === void 0 ? void 0 : optSelected.value) || phone),
|
|
232
334
|
saveCustomerUser: saveCustomerUser,
|
|
233
335
|
fieldsNotValid: props.fieldsNotValid,
|
|
234
336
|
useChekoutFileds: true,
|
|
235
|
-
isCustomerMode:
|
|
236
|
-
|
|
337
|
+
isCustomerMode: true,
|
|
338
|
+
isPopup: true
|
|
339
|
+
})), /*#__PURE__*/_react.default.createElement(_five.Modal, {
|
|
237
340
|
open: openModal.customer,
|
|
238
341
|
width: "80%",
|
|
239
342
|
onClose: function onClose() {
|
|
@@ -256,7 +359,8 @@ var PhoneAutocompleteUI = function PhoneAutocompleteUI(props) {
|
|
|
256
359
|
userId: customerState === null || customerState === void 0 || (_customerState$result2 = customerState.result) === null || _customerState$result2 === void 0 ? void 0 : _customerState$result2.id,
|
|
257
360
|
changeOrderAddressWithDefault: true,
|
|
258
361
|
userCustomerSetup: _objectSpread(_objectSpread({}, customerState === null || customerState === void 0 ? void 0 : customerState.result), {}, {
|
|
259
|
-
phone: phone
|
|
362
|
+
phone: phone,
|
|
363
|
+
urlPhone: urlPhone
|
|
260
364
|
}),
|
|
261
365
|
isEnableContinueButton: true,
|
|
262
366
|
isCustomerMode: true,
|
|
@@ -269,20 +373,40 @@ var PhoneAutocompleteUI = function PhoneAutocompleteUI(props) {
|
|
|
269
373
|
content: alertState.content,
|
|
270
374
|
onClose: handleCloseAlert,
|
|
271
375
|
onAccept: handleCloseAlert
|
|
272
|
-
}), (_props$afterComponent = props.afterComponents) === null || _props$afterComponent === void 0 ? void 0 : _props$afterComponent.map(function (AfterComponent, i) {
|
|
273
|
-
return /*#__PURE__*/_react.default.createElement(AfterComponent, _extends({
|
|
274
|
-
key: i
|
|
275
|
-
}, props));
|
|
276
|
-
}), (_props$afterElements = props.afterElements) === null || _props$afterElements === void 0 ? void 0 : _props$afterElements.map(function (AfterElement, i) {
|
|
277
|
-
return /*#__PURE__*/_react.default.createElement(_react.default.Fragment, {
|
|
278
|
-
key: i
|
|
279
|
-
}, AfterElement);
|
|
280
376
|
}));
|
|
281
377
|
};
|
|
282
378
|
var PhoneAutocomplete = function PhoneAutocomplete(props) {
|
|
283
|
-
var
|
|
379
|
+
var _useLanguage3 = (0, _orderingComponentsExternal.useLanguage)(),
|
|
380
|
+
_useLanguage4 = _slicedToArray(_useLanguage3, 2),
|
|
381
|
+
t = _useLanguage4[1];
|
|
382
|
+
var phoneProps = _objectSpread(_objectSpread({
|
|
284
383
|
UIComponent: PhoneAutocompleteUI
|
|
285
|
-
}, props)
|
|
384
|
+
}, props), {}, {
|
|
385
|
+
orderTypes: props.orderTypes || [{
|
|
386
|
+
value: 1,
|
|
387
|
+
text: t('DELIVERY', 'Delivery'),
|
|
388
|
+
description: t('ORDERTYPE_DESCRIPTION_DELIVERY', 'Delivery description')
|
|
389
|
+
}, {
|
|
390
|
+
value: 2,
|
|
391
|
+
text: t('PICKUP', 'Pickup'),
|
|
392
|
+
description: t('ORDERTYPE_DESCRIPTION_PICKUP', 'Pickup description')
|
|
393
|
+
}, {
|
|
394
|
+
value: 3,
|
|
395
|
+
text: t('EAT_IN', 'Eat in'),
|
|
396
|
+
description: t('ORDERTYPE_DESCRIPTION_EATIN', 'Eat in description')
|
|
397
|
+
}, {
|
|
398
|
+
value: 4,
|
|
399
|
+
text: t('CURBSIDE', 'Curbside'),
|
|
400
|
+
description: t('ORDERTYPE_DESCRIPTION_CURBSIDE', 'Curbside description')
|
|
401
|
+
}, {
|
|
402
|
+
value: 5,
|
|
403
|
+
text: t('DRIVE_THRU', 'Drive thru'),
|
|
404
|
+
description: t('ORDERTYPE_DESCRIPTION_DRIVETHRU', 'Drive Thru description')
|
|
405
|
+
}]
|
|
406
|
+
});
|
|
286
407
|
return /*#__PURE__*/_react.default.createElement(_orderingComponentsExternal.PhoneAutocomplete, phoneProps);
|
|
287
408
|
};
|
|
288
|
-
exports.PhoneAutocomplete = PhoneAutocomplete;
|
|
409
|
+
exports.PhoneAutocomplete = PhoneAutocomplete;
|
|
410
|
+
PhoneAutocompleteUI.defaultProps = {
|
|
411
|
+
limitPhoneLength: 10
|
|
412
|
+
};
|
|
@@ -4,18 +4,21 @@ function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" =
|
|
|
4
4
|
Object.defineProperty(exports, "__esModule", {
|
|
5
5
|
value: true
|
|
6
6
|
});
|
|
7
|
-
exports.WrappBtn = exports.WrapInput = exports.UserEdit = exports.Title = exports.Slogan = exports.SelectContainer = exports.SearchContainer = exports.PhoneContainer = exports.Info = exports.ContentWrapper = exports.AutoComplete = void 0;
|
|
7
|
+
exports.WrappBtn = exports.WrapInput = exports.UserEdit = exports.TypesContainer = exports.TypeButton = exports.Title = exports.Slogan = exports.SelectContainer = exports.SearchContainer = exports.PhoneContainer = exports.PhoneAutocompleteContainer = exports.Info = exports.ImageWrapper = exports.IconTypeButton = exports.ContinueButton = exports.ContentWrapper = exports.AutoComplete = exports.AdditionalTypesContainer = void 0;
|
|
8
|
+
var _react = _interopRequireDefault(require("react"));
|
|
8
9
|
var _styledComponents = _interopRequireWildcard(require("styled-components"));
|
|
9
|
-
var _templateObject, _templateObject2, _templateObject3, _templateObject4, _templateObject5, _templateObject6, _templateObject7, _templateObject8, _templateObject9, _templateObject10, _templateObject11, _templateObject12, _templateObject13, _templateObject14, _templateObject15, _templateObject16, _templateObject17, _templateObject18, _templateObject19, _templateObject20, _templateObject21, _templateObject22;
|
|
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;
|
|
10
11
|
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
|
11
12
|
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; }
|
|
13
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
14
|
+
function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
|
|
12
15
|
function _taggedTemplateLiteral(strings, raw) { if (!raw) { raw = strings.slice(0); } return Object.freeze(Object.defineProperties(strings, { raw: { value: Object.freeze(raw) } })); }
|
|
13
|
-
var PhoneContainer = _styledComponents.default.div(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n width: 100%;\n height: calc(100vh - 97px);\n
|
|
16
|
+
var PhoneContainer = _styledComponents.default.div(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n width: 100%;\n height: calc(100vh - 97px);\n display: flex;\n ", "\n\n .spinner-content{\n > div{\n width: 40px;\n height: 40px;\n border-width: 5px;\n }\n }\n\n .autocomplete {\n /*the container must be positioned relative:*/\n position: relative;\n }\n input {\n border: 1px solid transparent;\n background-color: #f1f1f1;\n padding: 10px;\n font-size: 16px;\n }\n input[type=text] {\n background-color: #f1f1f1;\n width: 100%;\n }\n input[type=submit] {\n background-color: #f1f1f1;\n width: 100%;\n }\n .autocomplete-items {\n position: absolute;\n border: 1px solid #d4d4d4;\n border-bottom: none;\n border-top: none;\n z-index: 99;\n /*position the autocomplete items to be the same width as the container:*/\n top: 100%;\n left: 0;\n right: 0;\n overflow: auto;\n max-height: 200px\n }\n .autocomplete-items div {\n padding: 10px;\n cursor: pointer;\n background-color: #fff;\n border-bottom: 1px solid #d4d4d4;\n }\n .autocomplete-items div:hover {\n /*when hovering an item:*/\n background-color: #e9e9e9;\n }\n .autocomplete-active {\n /*when navigating through the items using the arrow keys:*/\n background-color: DodgerBlue !important;\n color: #ffffff;\n }\n\n @media (min-width: 821px) {\n height: calc(100vh - 65px);\n }\n"])), function (_ref) {
|
|
14
17
|
var bgimage = _ref.bgimage;
|
|
15
18
|
return bgimage && (0, _styledComponents.css)(_templateObject2 || (_templateObject2 = _taggedTemplateLiteral(["\n background-repeat: no-repeat, repeat;\n background-size: cover;\n object-fit: cover;\n background-position: bottom;\n background-image: url(", ");\n "])), bgimage);
|
|
16
19
|
});
|
|
17
20
|
exports.PhoneContainer = PhoneContainer;
|
|
18
|
-
var ContentWrapper = _styledComponents.default.div(_templateObject3 || (_templateObject3 = _taggedTemplateLiteral(["\n display: flex;\n flex-direction: column;\n justify-content: center;\n height: 100%;\n padding: 0px 20px 0px;\n
|
|
21
|
+
var ContentWrapper = _styledComponents.default.div(_templateObject3 || (_templateObject3 = _taggedTemplateLiteral(["\n display: flex;\n flex-direction: column;\n justify-content: center;\n height: 100%;\n padding: 0px 20px 0px;\n width: 70%;\n position: relative;\n .select__control {\n border-radius: 30px;\n }\n\n .select__control.select__control--is-focused {\n border-color: ", " !important;\n box-shadow: 0 0 0 1px ", " !important;\n }\n\n .select__value-container {\n padding: 10px 8px 0;\n }\n .select__indicator.select__loading-indicator {\n color: ", " !important;\n }\n\n .select__indicator.select__dropdown-indicator,\n .select__indicator-separator {\n display: none;\n }\n\n ", "\n\n input {\n width: 90%;\n margin-bottom: 15px;\n }\n\n @media (min-width: 425px) {\n input {\n width: 45%;\n }\n }\n\n @media (min-width: 768px) {\n padding: 0px 40px 0px;\n\n ", "\n }\n @media (min-width: 1400px){\n width: 60%;\n }\n"])), function (props) {
|
|
19
22
|
var _props$theme;
|
|
20
23
|
return (_props$theme = props.theme) === null || _props$theme === void 0 || (_props$theme = _props$theme.colors) === null || _props$theme === void 0 ? void 0 : _props$theme.primary;
|
|
21
24
|
}, function (props) {
|
|
@@ -32,9 +35,9 @@ var ContentWrapper = _styledComponents.default.div(_templateObject3 || (_templat
|
|
|
32
35
|
return ((_props$theme5 = props.theme) === null || _props$theme5 === void 0 ? void 0 : _props$theme5.rtl) && (0, _styledComponents.css)(_templateObject5 || (_templateObject5 = _taggedTemplateLiteral(["\n padding: 0px 40px 0px;\n "])));
|
|
33
36
|
});
|
|
34
37
|
exports.ContentWrapper = ContentWrapper;
|
|
35
|
-
var WrappBtn = _styledComponents.default.div(_templateObject6 || (_templateObject6 = _taggedTemplateLiteral(["\n width: 50%;\n
|
|
38
|
+
var WrappBtn = _styledComponents.default.div(_templateObject6 || (_templateObject6 = _taggedTemplateLiteral(["\n width: 50%;\n position: relative;\n button {\n position: absolute;\n top: 55px;\n min-width: 130px;\n max-width: 400px;\n overflow: hidden;\n text-overflow: ellipsis;\n white-space: nowrap;\n z-index: 100;\n }\n"])));
|
|
36
39
|
exports.WrappBtn = WrappBtn;
|
|
37
|
-
var Title = _styledComponents.default.h1(_templateObject7 || (_templateObject7 = _taggedTemplateLiteral(["\n margin: 0px;\n text-align: left;\n font: normal normal normal 80px ", ";\n letter-spacing: 0px;\n
|
|
40
|
+
var Title = _styledComponents.default.h1(_templateObject7 || (_templateObject7 = _taggedTemplateLiteral(["\n margin: 0px;\n text-align: left;\n font: normal normal normal 80px ", ";\n letter-spacing: 0px;\n text-shadow: 0px 3px 6px #00000029;\n opacity: 1;\n font-size: 35px;\n\n ", "\n"])), function (props) {
|
|
38
41
|
var _props$theme$fonts$sp;
|
|
39
42
|
return ((_props$theme$fonts$sp = props.theme.fonts.special) === null || _props$theme$fonts$sp === void 0 ? void 0 : _props$theme$fonts$sp.name) || 'Georgia';
|
|
40
43
|
}, function (props) {
|
|
@@ -42,7 +45,7 @@ var Title = _styledComponents.default.h1(_templateObject7 || (_templateObject7 =
|
|
|
42
45
|
return ((_props$theme6 = props.theme) === null || _props$theme6 === void 0 ? void 0 : _props$theme6.rtl) && (0, _styledComponents.css)(_templateObject8 || (_templateObject8 = _taggedTemplateLiteral(["\n text-align: right;\n "])));
|
|
43
46
|
});
|
|
44
47
|
exports.Title = Title;
|
|
45
|
-
var Slogan = _styledComponents.default.p(_templateObject9 || (_templateObject9 = _taggedTemplateLiteral(["\n margin: 0px;\n text-align: left;\n font-size: 18px;\n letter-spacing: 0px;\n
|
|
48
|
+
var Slogan = _styledComponents.default.p(_templateObject9 || (_templateObject9 = _taggedTemplateLiteral(["\n margin: 0px;\n text-align: left;\n font-size: 18px;\n letter-spacing: 0px;\n opacity: 1;\n margin-bottom: 15px;\n\n ", "\n\n @media (min-width: 480px) {\n font-size: 24px;\n }\n"])), function (props) {
|
|
46
49
|
var _props$theme7;
|
|
47
50
|
return ((_props$theme7 = props.theme) === null || _props$theme7 === void 0 ? void 0 : _props$theme7.rtl) && (0, _styledComponents.css)(_templateObject10 || (_templateObject10 = _taggedTemplateLiteral(["\n text-align: right;\n "])));
|
|
48
51
|
});
|
|
@@ -70,7 +73,50 @@ var UserEdit = _styledComponents.default.div(_templateObject19 || (_templateObje
|
|
|
70
73
|
exports.UserEdit = UserEdit;
|
|
71
74
|
var Info = _styledComponents.default.p(_templateObject20 || (_templateObject20 = _taggedTemplateLiteral([""])));
|
|
72
75
|
exports.Info = Info;
|
|
73
|
-
var SelectContainer = _styledComponents.default.div(_templateObject21 || (_templateObject21 = _taggedTemplateLiteral(["\n display: flex;\n width: 60%;\n position: relative;\n align-items: center;\n svg{\n position: absolute;\n top: 0;\n left:
|
|
76
|
+
var SelectContainer = _styledComponents.default.div(_templateObject21 || (_templateObject21 = _taggedTemplateLiteral(["\n display: flex;\n width: 60%;\n position: relative;\n align-items: center;\n svg{\n position: absolute;\n top: 0;\n left: 20px;\n transform: translate(50%, 70%);\n z-index: 10;\n }\n > div {\n width: 100%;\n .select__placeholder, .select__single-value, input {\n margin-left: 40px;\n z-index: 100;\n bottom: -10px;\n }\n .select__menu {\n position: relative;\n padding: 20px;\n }\n .select__clear-indicator {\n position: relative;\n left: 0;\n transform: translate(-300%, -165%);\n svg{\n width: 30px;\n height: 30px;\n }\n }\n .select__control {\n height: 45px;\n padding-left: 10px;\n }\n .select__indicator {\n bottom: 8px;\n position: relative;\n }\n .select__menu{\n top: 45px;\n }\n input {\n position: relative;\n top: -5px;\n }\n }\n"])));
|
|
74
77
|
exports.SelectContainer = SelectContainer;
|
|
75
78
|
var SearchContainer = _styledComponents.default.div(_templateObject22 || (_templateObject22 = _taggedTemplateLiteral(["\n position: absolute;\n top: 0;\n width: 90%;\n"])));
|
|
76
|
-
exports.SearchContainer = SearchContainer;
|
|
79
|
+
exports.SearchContainer = SearchContainer;
|
|
80
|
+
var ImageWrapperStyled = _styledComponents.default.div(_templateObject23 || (_templateObject23 = _taggedTemplateLiteral(["\n width: 30%;\n ", "\n @media (min-width: 1400px){\n width: 40%;\n }\n"])), function (_ref3) {
|
|
81
|
+
var bgimage = _ref3.bgimage;
|
|
82
|
+
return bgimage && (0, _styledComponents.css)(_templateObject24 || (_templateObject24 = _taggedTemplateLiteral(["\n background-repeat: no-repeat, repeat;\n background-size: cover;\n object-fit: cover;\n background-position: center;\n "])));
|
|
83
|
+
});
|
|
84
|
+
var ImageWrapper = function ImageWrapper(props) {
|
|
85
|
+
var style = {};
|
|
86
|
+
style.backgroundImage = "url(".concat(props.bgimage, ")");
|
|
87
|
+
return /*#__PURE__*/_react.default.createElement(ImageWrapperStyled, _extends({}, props, {
|
|
88
|
+
style: style
|
|
89
|
+
}), props.children);
|
|
90
|
+
};
|
|
91
|
+
exports.ImageWrapper = ImageWrapper;
|
|
92
|
+
var TypeButton = _styledComponents.default.div(_templateObject25 || (_templateObject25 = _taggedTemplateLiteral(["\n display: flex;\n align-items: center;\n width: 215px;\n height: 75px;\n border-radius: 7.6px;\n padding: 16px;\n box-shadow: 0px 1px 4px 0px rgba(0, 0, 0, 0.10);\n margin-right: 32px;\n margin-bottom: 32px;\n cursor: pointer;\n background: ", ";\n p{\n margin: 0;\n margin-left: 33px;\n ", "\n }\n"])), function (_ref4) {
|
|
93
|
+
var _theme$colors, _theme$colors2;
|
|
94
|
+
var activated = _ref4.activated,
|
|
95
|
+
theme = _ref4.theme;
|
|
96
|
+
return activated ? theme === null || theme === void 0 || (_theme$colors = theme.colors) === null || _theme$colors === void 0 ? void 0 : _theme$colors.primary : theme === null || theme === void 0 || (_theme$colors2 = theme.colors) === null || _theme$colors2 === void 0 ? void 0 : _theme$colors2.white;
|
|
97
|
+
}, function (_ref5) {
|
|
98
|
+
var _theme$colors3;
|
|
99
|
+
var activated = _ref5.activated,
|
|
100
|
+
theme = _ref5.theme;
|
|
101
|
+
return activated && (0, _styledComponents.css)(_templateObject26 || (_templateObject26 = _taggedTemplateLiteral(["\n color: ", ";\n "])), theme === null || theme === void 0 || (_theme$colors3 = theme.colors) === null || _theme$colors3 === void 0 ? void 0 : _theme$colors3.white);
|
|
102
|
+
});
|
|
103
|
+
exports.TypeButton = TypeButton;
|
|
104
|
+
var IconTypeButton = _styledComponents.default.div(_templateObject27 || (_templateObject27 = _taggedTemplateLiteral(["\n display: flex;\n justify-content: center;\n align-items: center;\n width: 44px;\n height: 44px;\n background: ", ";\n border-radius: 44px;\n"])), function (_ref6) {
|
|
105
|
+
var _theme$colors4;
|
|
106
|
+
var activated = _ref6.activated,
|
|
107
|
+
theme = _ref6.theme;
|
|
108
|
+
return activated ? theme === null || theme === void 0 || (_theme$colors4 = theme.colors) === null || _theme$colors4 === void 0 ? void 0 : _theme$colors4.white : '#F3F9FF';
|
|
109
|
+
});
|
|
110
|
+
exports.IconTypeButton = IconTypeButton;
|
|
111
|
+
var TypesContainer = _styledComponents.default.div(_templateObject28 || (_templateObject28 = _taggedTemplateLiteral(["\n display: flex;\n"])));
|
|
112
|
+
exports.TypesContainer = TypesContainer;
|
|
113
|
+
var AdditionalTypesContainer = _styledComponents.default.div(_templateObject29 || (_templateObject29 = _taggedTemplateLiteral(["\n width: 60%;\n display: flex;\n margin-bottom: 20px;\n button {\n padding: 4px 10px;\n border-radius: 50px;\n font-size: 10px;\n line-height: 0;\n height: 25px;\n margin-right: 20px;\n }\n .activated {\n color: ", "\n }\n"])), function (_ref7) {
|
|
114
|
+
var _theme$colors5;
|
|
115
|
+
var theme = _ref7.theme;
|
|
116
|
+
return theme === null || theme === void 0 || (_theme$colors5 = theme.colors) === null || _theme$colors5 === void 0 ? void 0 : _theme$colors5.darkTextColor;
|
|
117
|
+
});
|
|
118
|
+
exports.AdditionalTypesContainer = AdditionalTypesContainer;
|
|
119
|
+
var PhoneAutocompleteContainer = _styledComponents.default.div(_templateObject30 || (_templateObject30 = _taggedTemplateLiteral(["\n position: relative;\n h2 {\n font-size: 20px;\n margin-bottom: 20px;\n }\n"])));
|
|
120
|
+
exports.PhoneAutocompleteContainer = PhoneAutocompleteContainer;
|
|
121
|
+
var ContinueButton = _styledComponents.default.span(_templateObject31 || (_templateObject31 = _taggedTemplateLiteral(["\n position: absolute;\n right: 35px;\n bottom: 5px;\n width: \n button {\n cursor: pointer;\n }\n"])));
|
|
122
|
+
exports.ContinueButton = ContinueButton;
|
|
@@ -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_view2, _theme$business_view3, _theme$header, _theme$defaultLanguag, _theme$defaultLanguag2, _theme$defaultLanguag3, _theme$defaultLanguag4, _theme$defaultLanguag5, _theme$defaultLanguag6, _currentCart$taxes, _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$
|
|
48
|
+
var _configs$add_product_, _configs$checkout_mul, _Object$values$find, _businessState$busine, _theme$business_view, _theme$business_view2, _theme$business_view3, _theme$header, _theme$defaultLanguag, _theme$defaultLanguag2, _theme$defaultLanguag3, _theme$defaultLanguag4, _theme$defaultLanguag5, _theme$defaultLanguag6, _currentCart$taxes, _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$professiona3, _currentCart$products7, _currentCart$products8;
|
|
49
49
|
var errors = props.errors,
|
|
50
50
|
openCategories = props.openCategories,
|
|
51
51
|
isInitialRender = props.isInitialRender,
|
|
@@ -265,6 +265,27 @@ var BusinessProductsListingUI = function BusinessProductsListingUI(props) {
|
|
|
265
265
|
return _ref.apply(this, arguments);
|
|
266
266
|
};
|
|
267
267
|
}();
|
|
268
|
+
var handleCustomProductBannerClick = function handleCustomProductBannerClick(product) {
|
|
269
|
+
var _business$professiona2;
|
|
270
|
+
if (!((product === null || product === void 0 ? void 0 : product.type) === 'service' && (business === null || business === void 0 || (_business$professiona2 = business.professionals) === null || _business$professiona2 === void 0 ? void 0 : _business$professiona2.length) > 0)) {
|
|
271
|
+
if (site !== null && site !== void 0 && site.product_url_template) {
|
|
272
|
+
var _product$category2;
|
|
273
|
+
onProductRedirect({
|
|
274
|
+
slug: business === null || business === void 0 ? void 0 : business.slug,
|
|
275
|
+
product: site.product_url_template.includes('product_slug') ? product === null || product === void 0 ? void 0 : product.slug : product.id,
|
|
276
|
+
category: site.product_url_template.includes('category_slug') ? product === null || product === void 0 || (_product$category2 = product.category) === null || _product$category2 === void 0 ? void 0 : _product$category2.slug : product.category_id
|
|
277
|
+
});
|
|
278
|
+
} else {
|
|
279
|
+
onProductRedirect({
|
|
280
|
+
slug: business === null || business === void 0 ? void 0 : business.slug,
|
|
281
|
+
product: product.id,
|
|
282
|
+
category: product.category_id
|
|
283
|
+
});
|
|
284
|
+
}
|
|
285
|
+
}
|
|
286
|
+
setCurProduct(product);
|
|
287
|
+
setModalIsOpen(true);
|
|
288
|
+
};
|
|
268
289
|
var handlerProductAction = function handlerProductAction(product) {
|
|
269
290
|
if (Object.keys(product).length) {
|
|
270
291
|
setModalIsOpen(false);
|
|
@@ -505,7 +526,8 @@ var BusinessProductsListingUI = function BusinessProductsListingUI(props) {
|
|
|
505
526
|
handleChangePriceFilterValues: handleChangePriceFilterValues,
|
|
506
527
|
productToIdLoading: productToIdLoading,
|
|
507
528
|
handleUpdateProfessionals: handleUpdateProfessionals,
|
|
508
|
-
isCustomerMode: isCustomerMode
|
|
529
|
+
isCustomerMode: isCustomerMode,
|
|
530
|
+
handleCustomProductBannerClick: handleCustomProductBannerClick
|
|
509
531
|
}), isMounted && !loading && business && !Object.keys(business).length && /*#__PURE__*/_react.default.createElement(_NotFoundSource.NotFoundSource, {
|
|
510
532
|
content: t('NOT_FOUND_BUSINESS_PRODUCTS', (theme === null || theme === void 0 || (_theme$defaultLanguag7 = theme.defaultLanguages) === null || _theme$defaultLanguag7 === void 0 ? void 0 : _theme$defaultLanguag7.NOT_FOUND_BUSINESS_PRODUCTS) || 'No products to show at this business, please try with other business.'),
|
|
511
533
|
btnTitle: t('SEARCH_REDIRECT', (theme === null || theme === void 0 || (_theme$defaultLanguag8 = theme.defaultLanguages) === null || _theme$defaultLanguag8 === void 0 ? void 0 : _theme$defaultLanguag8.SEARCH_REDIRECT) || 'Go to Businesses'),
|
|
@@ -578,7 +600,7 @@ var BusinessProductsListingUI = function BusinessProductsListingUI(props) {
|
|
|
578
600
|
content: ((_productModal$error$ = productModal.error[0]) === null || _productModal$error$ === void 0 ? void 0 : _productModal$error$.message) || productModal.error[0]
|
|
579
601
|
}), isInitialRender && !productModal.loading && !productModal.error && !productModal.product && notFound && /*#__PURE__*/_react.default.createElement(_NotFoundSource.NotFoundSource, {
|
|
580
602
|
content: t('ERROR_GET_PRODUCT', (theme === null || theme === void 0 || (_theme$defaultLanguag16 = theme.defaultLanguages) === null || _theme$defaultLanguag16 === void 0 ? void 0 : _theme$defaultLanguag16.ERROR_GET_PRODUCT) || 'Sorry, we couldn\'t find the requested product.')
|
|
581
|
-
}), (productModal.product || curProduct) && /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, ((productModal === null || productModal === void 0 || (_productModal$product2 = productModal.product) === null || _productModal$product2 === void 0 ? void 0 : _productModal$product2.type) === 'service' || (curProduct === null || curProduct === void 0 ? void 0 : curProduct.type) === 'service') && (business === null || business === void 0 || (_business$
|
|
603
|
+
}), (productModal.product || curProduct) && /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, ((productModal === null || productModal === void 0 || (_productModal$product2 = productModal.product) === null || _productModal$product2 === void 0 ? void 0 : _productModal$product2.type) === 'service' || (curProduct === null || curProduct === void 0 ? void 0 : curProduct.type) === 'service') && (business === null || business === void 0 || (_business$professiona3 = business.professionals) === null || _business$professiona3 === void 0 ? void 0 : _business$professiona3.length) > 0 ? /*#__PURE__*/_react.default.createElement(_ServiceForm.ServiceForm, {
|
|
582
604
|
businessSlug: business === null || business === void 0 ? void 0 : business.slug,
|
|
583
605
|
useKioskApp: props.useKioskApp,
|
|
584
606
|
product: productModal.product || curProduct,
|
|
@@ -31,7 +31,8 @@ var MyOrders = function MyOrders(props) {
|
|
|
31
31
|
var hideOrders = props.hideOrders,
|
|
32
32
|
isFromBusinessListingSearch = props.isFromBusinessListingSearch,
|
|
33
33
|
businessesSearchList = props.businessesSearchList,
|
|
34
|
-
onProductRedirect = props.onProductRedirect
|
|
34
|
+
onProductRedirect = props.onProductRedirect,
|
|
35
|
+
onRedirectPage = props.onRedirectPage;
|
|
35
36
|
var _useLanguage = (0, _orderingComponentsExternal.useLanguage)(),
|
|
36
37
|
_useLanguage2 = _slicedToArray(_useLanguage, 2),
|
|
37
38
|
t = _useLanguage2[1];
|
|
@@ -130,7 +131,15 @@ var MyOrders = function MyOrders(props) {
|
|
|
130
131
|
setIsEmptyActive: setIsEmptyActive
|
|
131
132
|
})), !isEmptyActive && /*#__PURE__*/_react.default.createElement(_styles.Divider, null), /*#__PURE__*/_react.default.createElement(_OrdersOption.OrdersOption, _extends({}, props, {
|
|
132
133
|
pastOrders: true,
|
|
133
|
-
setIsEmptyPast: setIsEmptyPast
|
|
134
|
+
setIsEmptyPast: setIsEmptyPast,
|
|
135
|
+
handleRedirectToCheckout: function handleRedirectToCheckout(uuid) {
|
|
136
|
+
onRedirectPage && onRedirectPage({
|
|
137
|
+
page: 'checkout',
|
|
138
|
+
params: {
|
|
139
|
+
cartUuid: uuid
|
|
140
|
+
}
|
|
141
|
+
});
|
|
142
|
+
}
|
|
134
143
|
})), !isEmptyPast && /*#__PURE__*/_react.default.createElement(_styles.Divider, null))), notOrderOptions.includes(selectedOption) && /*#__PURE__*/_react.default.createElement(_OrdersOption.OrdersOption, _extends({}, props, {
|
|
135
144
|
titleContent: t('PREVIOUSLY_ORDERED', 'Previously ordered'),
|
|
136
145
|
hideOrders: true,
|