ordering-ui-external 1.5.3 → 1.5.5
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.cb87b9b647114f245c57.js +1 -0
- package/_bundles/{1.ordering-ui.5de718771fdf8a9bc402.js → 1.ordering-ui.cb87b9b647114f245c57.js} +0 -0
- package/_bundles/{2.ordering-ui.5de718771fdf8a9bc402.js → 2.ordering-ui.cb87b9b647114f245c57.js} +0 -0
- package/_bundles/{4.ordering-ui.5de718771fdf8a9bc402.js → 4.ordering-ui.cb87b9b647114f245c57.js} +0 -0
- package/_bundles/{5.ordering-ui.5de718771fdf8a9bc402.js → 5.ordering-ui.cb87b9b647114f245c57.js} +1 -1
- package/_bundles/{6.ordering-ui.5de718771fdf8a9bc402.js → 6.ordering-ui.cb87b9b647114f245c57.js} +0 -0
- package/_bundles/{7.ordering-ui.5de718771fdf8a9bc402.js → 7.ordering-ui.cb87b9b647114f245c57.js} +2 -2
- package/_bundles/{7.ordering-ui.5de718771fdf8a9bc402.js.LICENSE.txt → 7.ordering-ui.cb87b9b647114f245c57.js.LICENSE.txt} +0 -0
- package/_bundles/{8.ordering-ui.5de718771fdf8a9bc402.js → 8.ordering-ui.cb87b9b647114f245c57.js} +0 -0
- package/_bundles/{9.ordering-ui.5de718771fdf8a9bc402.js → 9.ordering-ui.cb87b9b647114f245c57.js} +0 -0
- package/_bundles/ordering-ui.cb87b9b647114f245c57.js +2 -0
- package/_bundles/{ordering-ui.5de718771fdf8a9bc402.js.LICENSE.txt → ordering-ui.cb87b9b647114f245c57.js.LICENSE.txt} +0 -0
- package/_modules/styles/Switch/index.js +46 -0
- package/_modules/styles/Switch/styles.js +23 -0
- package/_modules/themes/five/src/components/Cart/index.js +13 -2
- package/_modules/themes/five/src/components/ServiceForm/index.js +33 -7
- package/_modules/themes/five/src/components/ServiceForm/styles.js +8 -3
- package/package.json +2 -2
- package/src/styles/Switch/index.js +39 -0
- package/src/styles/Switch/styles.js +58 -0
- package/src/themes/five/src/components/Cart/index.js +24 -9
- package/src/themes/five/src/components/ServiceForm/index.js +162 -139
- package/src/themes/five/src/components/ServiceForm/styles.js +10 -0
- package/_bundles/0.ordering-ui.5de718771fdf8a9bc402.js +0 -1
- package/_bundles/ordering-ui.5de718771fdf8a9bc402.js +0 -2
|
File without changes
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); }
|
|
4
|
+
Object.defineProperty(exports, "__esModule", {
|
|
5
|
+
value: true
|
|
6
|
+
});
|
|
7
|
+
exports.Switch = void 0;
|
|
8
|
+
var _react = _interopRequireWildcard(require("react"));
|
|
9
|
+
var _styles = require("./styles");
|
|
10
|
+
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
|
+
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; }
|
|
12
|
+
function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
|
|
13
|
+
function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
|
|
14
|
+
function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
|
|
15
|
+
function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; }
|
|
16
|
+
function _iterableToArrayLimit(arr, i) { var _i = arr == null ? null : typeof Symbol !== "undefined" && arr[Symbol.iterator] || arr["@@iterator"]; if (_i == null) return; var _arr = []; var _n = true; var _d = false; var _s, _e; try { for (_i = _i.call(arr); !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i["return"] != null) _i["return"](); } finally { if (_d) throw _e; } } return _arr; }
|
|
17
|
+
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
18
|
+
var Switch = function Switch(props) {
|
|
19
|
+
var defaultChecked = props.defaultChecked,
|
|
20
|
+
disabled = props.disabled,
|
|
21
|
+
onChange = props.onChange,
|
|
22
|
+
className = props.className,
|
|
23
|
+
notAsync = props.notAsync;
|
|
24
|
+
var _useState = (0, _react.useState)(false),
|
|
25
|
+
_useState2 = _slicedToArray(_useState, 2),
|
|
26
|
+
checked = _useState2[0],
|
|
27
|
+
setChecked = _useState2[1];
|
|
28
|
+
(0, _react.useEffect)(function () {
|
|
29
|
+
setChecked(defaultChecked);
|
|
30
|
+
}, [defaultChecked]);
|
|
31
|
+
var handleCheckBoxChange = function handleCheckBoxChange(evt) {
|
|
32
|
+
if (!notAsync) {
|
|
33
|
+
setChecked(evt.target.checked);
|
|
34
|
+
}
|
|
35
|
+
onChange && onChange(evt.target.checked);
|
|
36
|
+
};
|
|
37
|
+
return /*#__PURE__*/_react.default.createElement(_styles.ToggleSwitchContainer, {
|
|
38
|
+
className: className,
|
|
39
|
+
disabled: disabled
|
|
40
|
+
}, /*#__PURE__*/_react.default.createElement("input", {
|
|
41
|
+
type: "checkbox",
|
|
42
|
+
checked: checked,
|
|
43
|
+
onChange: handleCheckBoxChange
|
|
44
|
+
}), /*#__PURE__*/_react.default.createElement(_styles.Slider, null));
|
|
45
|
+
};
|
|
46
|
+
exports.Switch = Switch;
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); }
|
|
4
|
+
Object.defineProperty(exports, "__esModule", {
|
|
5
|
+
value: true
|
|
6
|
+
});
|
|
7
|
+
exports.ToggleSwitchContainer = exports.Slider = void 0;
|
|
8
|
+
var _styledComponents = _interopRequireWildcard(require("styled-components"));
|
|
9
|
+
var _templateObject, _templateObject2, _templateObject3;
|
|
10
|
+
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
|
+
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; }
|
|
12
|
+
function _taggedTemplateLiteral(strings, raw) { if (!raw) { raw = strings.slice(0); } return Object.freeze(Object.defineProperties(strings, { raw: { value: Object.freeze(raw) } })); }
|
|
13
|
+
var ToggleSwitchContainer = _styledComponents.default.label(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n position: relative;\n display: inline-block;\n width: 40px;\n height: 26px;\n margin-bottom: 0px;\n\n ", "\n\n input {\n opacity: 0;\n width: 0;\n height: 0;\n\n &:checked + span {\n background-color: ", ";\n }\n &:focus + span {\n box-shadow: 0 0 1px ", ";\n }\n &:checked + span:before {\n -webkit-transform: translateX(13px);\n -ms-transform: translateX(13px);\n transform: translateX(13px);\n }\n }\n"])), function (_ref) {
|
|
14
|
+
var disabled = _ref.disabled;
|
|
15
|
+
return disabled && (0, _styledComponents.css)(_templateObject2 || (_templateObject2 = _taggedTemplateLiteral(["\n opacity: 0.6;\n pointer-events: none;\n "])));
|
|
16
|
+
}, function (props) {
|
|
17
|
+
return props.theme.colors.primary;
|
|
18
|
+
}, function (props) {
|
|
19
|
+
return props.theme.colors.primary;
|
|
20
|
+
});
|
|
21
|
+
exports.ToggleSwitchContainer = ToggleSwitchContainer;
|
|
22
|
+
var Slider = _styledComponents.default.span(_templateObject3 || (_templateObject3 = _taggedTemplateLiteral(["\n position: absolute;\n cursor: pointer;\n top: 0;\n left: 0;\n right: 0;\n bottom: 0;\n background-color: #ccc;\n -webkit-transition: .4s;\n transition: .4s;\n border-radius: 15px;\n\n &:before {\n position: absolute;\n content: \"\";\n height: 20px;\n width: 20px;\n left: 3px;\n bottom: 3px;\n background-color: white;\n -webkit-transition: .4s;\n transition: .4s;\n border-radius: 50%;\n }\n"])));
|
|
23
|
+
exports.Slider = Slider;
|
|
@@ -22,6 +22,7 @@ var _Inputs = require("../../styles/Inputs");
|
|
|
22
22
|
var _SpinnerLoader = require("../../../../../components/SpinnerLoader");
|
|
23
23
|
var _CartStoresListing = require("../../../../franchise/src/components/CartStoresListing");
|
|
24
24
|
var _DriverTips = require("../DriverTips");
|
|
25
|
+
var _ServiceForm = require("../ServiceForm");
|
|
25
26
|
var _styles = require("./styles");
|
|
26
27
|
var _utils = require("../../../../../utils");
|
|
27
28
|
var _BsInfoCircle = _interopRequireDefault(require("@meronex/icons/bs/BsInfoCircle"));
|
|
@@ -40,7 +41,7 @@ function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len
|
|
|
40
41
|
function _iterableToArrayLimit(arr, i) { var _i = arr == null ? null : typeof Symbol !== "undefined" && arr[Symbol.iterator] || arr["@@iterator"]; if (_i == null) return; var _arr = []; var _n = true; var _d = false; var _s, _e; try { for (_i = _i.call(arr); !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i["return"] != null) _i["return"](); } finally { if (_d) throw _e; } } return _arr; }
|
|
41
42
|
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
42
43
|
var CartUI = function CartUI(props) {
|
|
43
|
-
var _configs$driver_tip_o, _configs$driver_tip_o2, _configs$driver_tip_o3, _validationFields$fie, _validationFields$fie2, _validationFields$fie3, _configs$checkout_mul, _Object$values, _orderState$carts, _orderingTheme$theme, _orderingTheme$theme$, _orderingTheme$theme$2, _orderingTheme$theme$3, _orderingTheme$theme$4, _orderingTheme$theme$5, _orderState$option, _orderState$option2, _props$beforeElements, _props$beforeComponen, _cart$products2, _cart$offers, _cart$offers2, _cart$offers3, _cart$offers3$filter, _cart$offers4, _cart$offers4$filter, _cart$business, _ref, _cart$subtotal_with_d, _cart$taxes2, _cart$taxes3, _cart$fees, _cart$fees2, _cart$offers5, _cart$offers6, _cart$offers6$filter, _orderState$options, _cart$offers7, _cart$offers8, _cart$offers8$filter, _configs$driver_tip_t, _configs$driver_tip_u, _orderState$options2, _validationFields$fie4, _validationFields$fie5, _validationFields$fie6, _configs$driver_tip_t2, _configs$driver_tip_u2, _configs$driver_tip_t3, _cart$payment_events, _cart$payment_events2, _cart$business2, _openTaxModal$data, _openTaxModal$data2, _openTaxModal$data3, _openTaxModal$data4, _openTaxModal$data$fi, _openTaxModal$data5, _openTaxModal$data6, _props$afterComponent, _props$afterElements;
|
|
44
|
+
var _configs$driver_tip_o, _configs$driver_tip_o2, _configs$driver_tip_o3, _validationFields$fie, _validationFields$fie2, _validationFields$fie3, _configs$checkout_mul, _Object$values, _orderState$carts, _orderingTheme$theme, _orderingTheme$theme$, _orderingTheme$theme$2, _orderingTheme$theme$3, _orderingTheme$theme$4, _orderingTheme$theme$5, _orderState$option, _orderState$option2, _props$beforeElements, _props$beforeComponen, _cart$products2, _cart$offers, _cart$offers2, _cart$offers3, _cart$offers3$filter, _cart$offers4, _cart$offers4$filter, _cart$business, _ref, _cart$subtotal_with_d, _cart$taxes2, _cart$taxes3, _cart$fees, _cart$fees2, _cart$offers5, _cart$offers6, _cart$offers6$filter, _orderState$options, _cart$offers7, _cart$offers8, _cart$offers8$filter, _configs$driver_tip_t, _configs$driver_tip_u, _orderState$options2, _validationFields$fie4, _validationFields$fie5, _validationFields$fie6, _configs$driver_tip_t2, _configs$driver_tip_u2, _configs$driver_tip_t3, _cart$payment_events, _cart$payment_events2, _cart$business2, _cart$business3, _curProduct$calendar_, _openTaxModal$data, _openTaxModal$data2, _openTaxModal$data3, _openTaxModal$data4, _openTaxModal$data$fi, _openTaxModal$data5, _openTaxModal$data6, _props$afterComponent, _props$afterElements;
|
|
44
45
|
var currentCartUuid = props.currentCartUuid,
|
|
45
46
|
clearCart = props.clearCart,
|
|
46
47
|
isProducts = props.isProducts,
|
|
@@ -534,7 +535,7 @@ var CartUI = function CartUI(props) {
|
|
|
534
535
|
return setModalIsOpen(false);
|
|
535
536
|
},
|
|
536
537
|
disableOverflowX: true
|
|
537
|
-
}, /*#__PURE__*/_react.default.createElement(_ProductForm.ProductForm, {
|
|
538
|
+
}, !(curProduct !== null && curProduct !== void 0 && curProduct.calendar_event) ? /*#__PURE__*/_react.default.createElement(_ProductForm.ProductForm, {
|
|
538
539
|
isCartProduct: true,
|
|
539
540
|
productCart: curProduct,
|
|
540
541
|
businessSlug: cart === null || cart === void 0 ? void 0 : (_cart$business2 = cart.business) === null || _cart$business2 === void 0 ? void 0 : _cart$business2.slug,
|
|
@@ -542,6 +543,16 @@ var CartUI = function CartUI(props) {
|
|
|
542
543
|
categoryId: curProduct === null || curProduct === void 0 ? void 0 : curProduct.category_id,
|
|
543
544
|
productId: curProduct === null || curProduct === void 0 ? void 0 : curProduct.id,
|
|
544
545
|
onSave: handlerProductAction
|
|
546
|
+
}) : /*#__PURE__*/_react.default.createElement(_ServiceForm.ServiceForm, {
|
|
547
|
+
isCartProduct: true,
|
|
548
|
+
isService: true,
|
|
549
|
+
productCart: curProduct,
|
|
550
|
+
businessSlug: cart === null || cart === void 0 ? void 0 : (_cart$business3 = cart.business) === null || _cart$business3 === void 0 ? void 0 : _cart$business3.slug,
|
|
551
|
+
businessId: cart === null || cart === void 0 ? void 0 : cart.business_id,
|
|
552
|
+
categoryId: curProduct === null || curProduct === void 0 ? void 0 : curProduct.category_id,
|
|
553
|
+
productId: curProduct === null || curProduct === void 0 ? void 0 : curProduct.id,
|
|
554
|
+
onSave: handlerProductAction,
|
|
555
|
+
professionalSelected: curProduct === null || curProduct === void 0 ? void 0 : (_curProduct$calendar_ = curProduct.calendar_event) === null || _curProduct$calendar_ === void 0 ? void 0 : _curProduct$calendar_.professional
|
|
545
556
|
})), /*#__PURE__*/_react.default.createElement(_Modal.Modal, {
|
|
546
557
|
width: "70%",
|
|
547
558
|
open: openTaxModal.open,
|
|
@@ -8,6 +8,7 @@ exports.ServiceForm = void 0;
|
|
|
8
8
|
var _react = _interopRequireWildcard(require("react"));
|
|
9
9
|
var _react2 = require("swiper/react");
|
|
10
10
|
var _orderingComponentsExternal = require("ordering-components-external");
|
|
11
|
+
var _reactLoadingSkeleton = _interopRequireDefault(require("react-loading-skeleton"));
|
|
11
12
|
var _Confirm = require("../Confirm");
|
|
12
13
|
var _Modal = require("../Modal");
|
|
13
14
|
var _LoginForm = require("../LoginForm");
|
|
@@ -38,14 +39,18 @@ function _iterableToArrayLimit(arr, i) { var _i = arr == null ? null : typeof Sy
|
|
|
38
39
|
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
39
40
|
_swiper.default.use([_swiper.Navigation]);
|
|
40
41
|
var ServiceFormUI = function ServiceFormUI(props) {
|
|
41
|
-
var _theme$defaultLanguag, _theme$defaultLanguag2, _theme$defaultLanguag3, _theme$defaultLanguag4, _theme$defaultLanguag5, _theme$defaultLanguag6;
|
|
42
|
-
var
|
|
42
|
+
var _professionalListStat3, _theme$defaultLanguag, _theme$defaultLanguag2, _theme$defaultLanguag3, _theme$defaultLanguag4, _theme$defaultLanguag5, _theme$defaultLanguag6;
|
|
43
|
+
var productObject = props.productObject,
|
|
43
44
|
professionalSelected = props.professionalSelected,
|
|
44
45
|
handleSave = props.handleSave,
|
|
45
46
|
isSoldOut = props.isSoldOut,
|
|
46
47
|
maxProductQuantity = props.maxProductQuantity,
|
|
47
48
|
productCart = props.productCart,
|
|
48
|
-
|
|
49
|
+
isCartProduct = props.isCartProduct,
|
|
50
|
+
professionalListState = props.professionalListState;
|
|
51
|
+
var product = productObject.product,
|
|
52
|
+
loading = productObject.loading,
|
|
53
|
+
error = productObject.error;
|
|
49
54
|
var theme = (0, _styledComponents.useTheme)();
|
|
50
55
|
var _useLanguage = (0, _orderingComponentsExternal.useLanguage)(),
|
|
51
56
|
_useLanguage2 = _slicedToArray(_useLanguage, 2),
|
|
@@ -179,10 +184,31 @@ var ServiceFormUI = function ServiceFormUI(props) {
|
|
|
179
184
|
};
|
|
180
185
|
}, [isDropDown]);
|
|
181
186
|
(0, _react.useEffect)(function () {
|
|
182
|
-
if (!professionalSelected) return;
|
|
187
|
+
if (!(professionalSelected !== null && professionalSelected !== void 0 && professionalSelected.schedule)) return;
|
|
183
188
|
setCurrentProfessional(professionalSelected);
|
|
184
189
|
}, [professionalSelected]);
|
|
185
|
-
|
|
190
|
+
(0, _react.useEffect)(function () {
|
|
191
|
+
var _professionalListStat;
|
|
192
|
+
if (isCartProduct && (professionalListState === null || professionalListState === void 0 ? void 0 : (_professionalListStat = professionalListState.professionals) === null || _professionalListStat === void 0 ? void 0 : _professionalListStat.length) > 0) {
|
|
193
|
+
var _professionalListStat2;
|
|
194
|
+
var professional = professionalListState === null || professionalListState === void 0 ? void 0 : (_professionalListStat2 = professionalListState.professionals) === null || _professionalListStat2 === void 0 ? void 0 : _professionalListStat2.find(function (item) {
|
|
195
|
+
return item.id === (professionalSelected === null || professionalSelected === void 0 ? void 0 : professionalSelected.id);
|
|
196
|
+
});
|
|
197
|
+
setCurrentProfessional(professional);
|
|
198
|
+
}
|
|
199
|
+
}, [isCartProduct, professionalListState === null || professionalListState === void 0 ? void 0 : professionalListState.professionals]);
|
|
200
|
+
return /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, /*#__PURE__*/_react.default.createElement(_styles.Container, null, loading && !error && /*#__PURE__*/_react.default.createElement(_styles.SkeletonBlock, {
|
|
201
|
+
width: 90
|
|
202
|
+
}, /*#__PURE__*/_react.default.createElement(_reactLoadingSkeleton.default, {
|
|
203
|
+
variant: "rect",
|
|
204
|
+
height: 50
|
|
205
|
+
}), /*#__PURE__*/_react.default.createElement(_reactLoadingSkeleton.default, {
|
|
206
|
+
variant: "rect",
|
|
207
|
+
height: 50
|
|
208
|
+
}), /*#__PURE__*/_react.default.createElement(_reactLoadingSkeleton.default, {
|
|
209
|
+
variant: "rect",
|
|
210
|
+
height: 200
|
|
211
|
+
})), product && !loading && /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, /*#__PURE__*/_react.default.createElement(_styles.ImageWrapper, null, /*#__PURE__*/_react.default.createElement(_styles.SwiperWrapper, null, /*#__PURE__*/_react.default.createElement(_styles.ArrowButtonWrapper, {
|
|
186
212
|
className: "button-prev"
|
|
187
213
|
}, /*#__PURE__*/_react.default.createElement(_reactBootstrapIcons.ChevronLeft, null)), /*#__PURE__*/_react.default.createElement(_react2.Swiper, {
|
|
188
214
|
spaceBetween: 0,
|
|
@@ -221,7 +247,7 @@ var ServiceFormUI = function ServiceFormUI(props) {
|
|
|
221
247
|
className: "status"
|
|
222
248
|
}, t('BUSY_ON_SELECTED_TIME', 'Busy on selected time'))) : /*#__PURE__*/_react.default.createElement("span", {
|
|
223
249
|
className: "status"
|
|
224
|
-
}, t('AVAILABLE', 'Available'))))) : /*#__PURE__*/_react.default.createElement("p", null, t('SELECT_PROFESSIONAL', 'Select professional')), /*#__PURE__*/_react.default.createElement(_reactBootstrapIcons.ChevronDown, null)), isDropDown && /*#__PURE__*/_react.default.createElement(_styles.DropDownWrapper, null, /*#__PURE__*/_react.default.createElement(_styles.DropDownTitle, null, t('ANY_PROFESSIONAL_MEMBER', 'Any professional member')),
|
|
250
|
+
}, t('AVAILABLE', 'Available'))))) : /*#__PURE__*/_react.default.createElement("p", null, t('SELECT_PROFESSIONAL', 'Select professional')), /*#__PURE__*/_react.default.createElement(_reactBootstrapIcons.ChevronDown, null)), isDropDown && /*#__PURE__*/_react.default.createElement(_styles.DropDownWrapper, null, /*#__PURE__*/_react.default.createElement(_styles.DropDownTitle, null, t('ANY_PROFESSIONAL_MEMBER', 'Any professional member')), professionalListState === null || professionalListState === void 0 ? void 0 : (_professionalListStat3 = professionalListState.professionals) === null || _professionalListStat3 === void 0 ? void 0 : _professionalListStat3.map(function (professional) {
|
|
225
251
|
return /*#__PURE__*/_react.default.createElement(_styles.SelectedItem, {
|
|
226
252
|
key: professional === null || professional === void 0 ? void 0 : professional.id,
|
|
227
253
|
isDropDown: true,
|
|
@@ -260,7 +286,7 @@ var ServiceFormUI = function ServiceFormUI(props) {
|
|
|
260
286
|
onClick: function onClick() {
|
|
261
287
|
return setModalIsOpen(true);
|
|
262
288
|
}
|
|
263
|
-
}, isSoldOut || maxProductQuantity <= 0 ? t('SOLD_OUT', (theme === null || theme === void 0 ? void 0 : (_theme$defaultLanguag = theme.defaultLanguages) === null || _theme$defaultLanguag === void 0 ? void 0 : _theme$defaultLanguag.SOLD_OUT) || 'Sold out') : t('LOGIN_SIGNUP', (theme === null || theme === void 0 ? void 0 : (_theme$defaultLanguag2 = theme.defaultLanguages) === null || _theme$defaultLanguag2 === void 0 ? void 0 : _theme$defaultLanguag2.LOGIN_SIGNUP) || 'Login / Sign Up'))), modalIsOpen && !auth && /*#__PURE__*/_react.default.createElement(_Modal.Modal, {
|
|
289
|
+
}, isSoldOut || maxProductQuantity <= 0 ? t('SOLD_OUT', (theme === null || theme === void 0 ? void 0 : (_theme$defaultLanguag = theme.defaultLanguages) === null || _theme$defaultLanguag === void 0 ? void 0 : _theme$defaultLanguag.SOLD_OUT) || 'Sold out') : t('LOGIN_SIGNUP', (theme === null || theme === void 0 ? void 0 : (_theme$defaultLanguag2 = theme.defaultLanguages) === null || _theme$defaultLanguag2 === void 0 ? void 0 : _theme$defaultLanguag2.LOGIN_SIGNUP) || 'Login / Sign Up')))), modalIsOpen && !auth && /*#__PURE__*/_react.default.createElement(_Modal.Modal, {
|
|
264
290
|
open: modalIsOpen,
|
|
265
291
|
onClose: function onClose() {
|
|
266
292
|
return closeModal();
|
|
@@ -4,10 +4,10 @@ function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" =
|
|
|
4
4
|
Object.defineProperty(exports, "__esModule", {
|
|
5
5
|
value: true
|
|
6
6
|
});
|
|
7
|
-
exports.SwiperWrapper = exports.StatusInfo = exports.SelectedItem = exports.SectionHeader = exports.ScheduleWrapper = exports.ProfessionalSelectWrapper = exports.ProfessionalPhoto = exports.ProfessionalInfoWrapper = exports.PriceAndDuration = exports.NameWrapper = exports.InfoWrapper = exports.ImageWrapper = exports.HeaderInfoWrapper = exports.EmptyProfessional = exports.DropDownWrapper = exports.DropDownTitle = exports.Divider = exports.Container = exports.ButtonWrapper = exports.ArrowButtonWrapper = void 0;
|
|
7
|
+
exports.SwiperWrapper = exports.StatusInfo = exports.SkeletonBlock = exports.SelectedItem = exports.SectionHeader = exports.ScheduleWrapper = exports.ProfessionalSelectWrapper = exports.ProfessionalPhoto = exports.ProfessionalInfoWrapper = exports.PriceAndDuration = exports.NameWrapper = exports.InfoWrapper = exports.ImageWrapper = exports.HeaderInfoWrapper = exports.EmptyProfessional = exports.DropDownWrapper = exports.DropDownTitle = exports.Divider = exports.Container = exports.ButtonWrapper = exports.ArrowButtonWrapper = void 0;
|
|
8
8
|
var _styledComponents = _interopRequireWildcard(require("styled-components"));
|
|
9
9
|
var _react = _interopRequireDefault(require("react"));
|
|
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;
|
|
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;
|
|
11
11
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
12
12
|
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); }
|
|
13
13
|
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; }
|
|
@@ -100,4 +100,9 @@ var StatusInfo = _styledComponents.default.div(_templateObject22 || (_templateOb
|
|
|
100
100
|
});
|
|
101
101
|
exports.StatusInfo = StatusInfo;
|
|
102
102
|
var EmptyProfessional = _styledComponents.default.div(_templateObject24 || (_templateObject24 = _taggedTemplateLiteral(["\n min-height: 100px;\n margin-bottom: 100px;\n text-align: center;\n display: flex;\n align-items: center;\n justify-content: center;\n"])));
|
|
103
|
-
exports.EmptyProfessional = EmptyProfessional;
|
|
103
|
+
exports.EmptyProfessional = EmptyProfessional;
|
|
104
|
+
var SkeletonBlock = _styledComponents.default.div(_templateObject25 || (_templateObject25 = _taggedTemplateLiteral(["\n width: ", ";\n border-radius: 16px;\n margin: 50px auto 20px auto;\n\n span {\n margin-bottom: 10px;\n }\n"])), function (_ref4) {
|
|
105
|
+
var width = _ref4.width;
|
|
106
|
+
return width && "".concat(width, "%");
|
|
107
|
+
});
|
|
108
|
+
exports.SkeletonBlock = SkeletonBlock;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "ordering-ui-external",
|
|
3
|
-
"version": "1.5.
|
|
3
|
+
"version": "1.5.5",
|
|
4
4
|
"description": "Ordering UI Components",
|
|
5
5
|
"main": "./_modules/index.js",
|
|
6
6
|
"exports": {
|
|
@@ -85,7 +85,7 @@
|
|
|
85
85
|
"libphonenumber-js": "^1.9.4",
|
|
86
86
|
"lodash": "^4.17.19",
|
|
87
87
|
"moment": "^2.29.4",
|
|
88
|
-
"ordering-components-external": "1.4.
|
|
88
|
+
"ordering-components-external": "1.4.1",
|
|
89
89
|
"polished": "^3.6.6",
|
|
90
90
|
"react-bootstrap-icons": "^1.7.2",
|
|
91
91
|
"react-calendar": "^3.3.1",
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import React, { useEffect, useState } from 'react'
|
|
2
|
+
|
|
3
|
+
import {
|
|
4
|
+
ToggleSwitchContainer,
|
|
5
|
+
Slider
|
|
6
|
+
} from './styles'
|
|
7
|
+
|
|
8
|
+
export const Switch = (props) => {
|
|
9
|
+
const {
|
|
10
|
+
defaultChecked,
|
|
11
|
+
disabled,
|
|
12
|
+
onChange,
|
|
13
|
+
className,
|
|
14
|
+
notAsync
|
|
15
|
+
} = props
|
|
16
|
+
const [checked, setChecked] = useState(false)
|
|
17
|
+
|
|
18
|
+
useEffect(() => {
|
|
19
|
+
setChecked(defaultChecked)
|
|
20
|
+
}, [defaultChecked])
|
|
21
|
+
|
|
22
|
+
const handleCheckBoxChange = (evt) => {
|
|
23
|
+
if (!notAsync) {
|
|
24
|
+
setChecked(evt.target.checked)
|
|
25
|
+
}
|
|
26
|
+
onChange && onChange(evt.target.checked)
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
return (
|
|
30
|
+
<ToggleSwitchContainer className={className} disabled={disabled}>
|
|
31
|
+
<input
|
|
32
|
+
type='checkbox'
|
|
33
|
+
checked={checked}
|
|
34
|
+
onChange={handleCheckBoxChange}
|
|
35
|
+
/>
|
|
36
|
+
<Slider />
|
|
37
|
+
</ToggleSwitchContainer>
|
|
38
|
+
)
|
|
39
|
+
}
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
import styled, { css } from 'styled-components'
|
|
2
|
+
|
|
3
|
+
export const ToggleSwitchContainer = styled.label`
|
|
4
|
+
position: relative;
|
|
5
|
+
display: inline-block;
|
|
6
|
+
width: 40px;
|
|
7
|
+
height: 26px;
|
|
8
|
+
margin-bottom: 0px;
|
|
9
|
+
|
|
10
|
+
${({ disabled }) => disabled && css`
|
|
11
|
+
opacity: 0.6;
|
|
12
|
+
pointer-events: none;
|
|
13
|
+
`}
|
|
14
|
+
|
|
15
|
+
input {
|
|
16
|
+
opacity: 0;
|
|
17
|
+
width: 0;
|
|
18
|
+
height: 0;
|
|
19
|
+
|
|
20
|
+
&:checked + span {
|
|
21
|
+
background-color: ${props => props.theme.colors.primary};
|
|
22
|
+
}
|
|
23
|
+
&:focus + span {
|
|
24
|
+
box-shadow: 0 0 1px ${props => props.theme.colors.primary};
|
|
25
|
+
}
|
|
26
|
+
&:checked + span:before {
|
|
27
|
+
-webkit-transform: translateX(13px);
|
|
28
|
+
-ms-transform: translateX(13px);
|
|
29
|
+
transform: translateX(13px);
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
`
|
|
33
|
+
|
|
34
|
+
export const Slider = styled.span`
|
|
35
|
+
position: absolute;
|
|
36
|
+
cursor: pointer;
|
|
37
|
+
top: 0;
|
|
38
|
+
left: 0;
|
|
39
|
+
right: 0;
|
|
40
|
+
bottom: 0;
|
|
41
|
+
background-color: #ccc;
|
|
42
|
+
-webkit-transition: .4s;
|
|
43
|
+
transition: .4s;
|
|
44
|
+
border-radius: 15px;
|
|
45
|
+
|
|
46
|
+
&:before {
|
|
47
|
+
position: absolute;
|
|
48
|
+
content: "";
|
|
49
|
+
height: 20px;
|
|
50
|
+
width: 20px;
|
|
51
|
+
left: 3px;
|
|
52
|
+
bottom: 3px;
|
|
53
|
+
background-color: white;
|
|
54
|
+
-webkit-transition: .4s;
|
|
55
|
+
transition: .4s;
|
|
56
|
+
border-radius: 50%;
|
|
57
|
+
}
|
|
58
|
+
`
|
|
@@ -15,6 +15,7 @@ import { TextArea } from '../../styles/Inputs'
|
|
|
15
15
|
import { SpinnerLoader } from '../../../../../components/SpinnerLoader'
|
|
16
16
|
import { CartStoresListing } from '../../../../franchise/src/components/CartStoresListing'
|
|
17
17
|
import { DriverTips } from '../DriverTips'
|
|
18
|
+
import { ServiceForm } from '../ServiceForm'
|
|
18
19
|
import {
|
|
19
20
|
CartContainer,
|
|
20
21
|
OrderBill,
|
|
@@ -565,15 +566,29 @@ const CartUI = (props) => {
|
|
|
565
566
|
onClose={() => setModalIsOpen(false)}
|
|
566
567
|
disableOverflowX
|
|
567
568
|
>
|
|
568
|
-
|
|
569
|
-
|
|
570
|
-
|
|
571
|
-
|
|
572
|
-
|
|
573
|
-
|
|
574
|
-
|
|
575
|
-
|
|
576
|
-
|
|
569
|
+
{!curProduct?.calendar_event ? (
|
|
570
|
+
<ProductForm
|
|
571
|
+
isCartProduct
|
|
572
|
+
productCart={curProduct}
|
|
573
|
+
businessSlug={cart?.business?.slug}
|
|
574
|
+
businessId={cart?.business_id}
|
|
575
|
+
categoryId={curProduct?.category_id}
|
|
576
|
+
productId={curProduct?.id}
|
|
577
|
+
onSave={handlerProductAction}
|
|
578
|
+
/>
|
|
579
|
+
) : (
|
|
580
|
+
<ServiceForm
|
|
581
|
+
isCartProduct
|
|
582
|
+
isService
|
|
583
|
+
productCart={curProduct}
|
|
584
|
+
businessSlug={cart?.business?.slug}
|
|
585
|
+
businessId={cart?.business_id}
|
|
586
|
+
categoryId={curProduct?.category_id}
|
|
587
|
+
productId={curProduct?.id}
|
|
588
|
+
onSave={handlerProductAction}
|
|
589
|
+
professionalSelected={curProduct?.calendar_event?.professional}
|
|
590
|
+
/>
|
|
591
|
+
)}
|
|
577
592
|
</Modal>
|
|
578
593
|
<Modal
|
|
579
594
|
width='70%'
|