ordering-ui-admin-external 1.43.90 → 1.43.91
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/{ordering-ui-admin.e0529306f54a0a36fc1e.js → ordering-ui-admin.dc064962f316b673482a.js} +2 -2
- package/_modules/components/Stores/BusinessMenu/index.js +24 -12
- package/_modules/components/Stores/BusinessMenu/styles.js +22 -19
- package/package.json +2 -2
- package/src/components/Stores/BusinessMenu/index.js +14 -6
- package/src/components/Stores/BusinessMenu/styles.js +5 -0
- /package/_bundles/{ordering-ui-admin.e0529306f54a0a36fc1e.js.LICENSE.txt → ordering-ui-admin.dc064962f316b673482a.js.LICENSE.txt} +0 -0
|
@@ -19,15 +19,15 @@ var _styles2 = require("./styles");
|
|
|
19
19
|
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
20
20
|
function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(e) { return e ? t : r; })(e); }
|
|
21
21
|
function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != _typeof(e) && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && {}.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
|
|
22
|
+
function _toConsumableArray(r) { return _arrayWithoutHoles(r) || _iterableToArray(r) || _unsupportedIterableToArray(r) || _nonIterableSpread(); }
|
|
23
|
+
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."); }
|
|
24
|
+
function _iterableToArray(r) { if ("undefined" != typeof Symbol && null != r[Symbol.iterator] || null != r["@@iterator"]) return Array.from(r); }
|
|
25
|
+
function _arrayWithoutHoles(r) { if (Array.isArray(r)) return _arrayLikeToArray(r); }
|
|
22
26
|
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
23
27
|
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
24
28
|
function _defineProperty(e, r, t) { return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e; }
|
|
25
29
|
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : i + ""; }
|
|
26
30
|
function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
|
|
27
|
-
function _toConsumableArray(r) { return _arrayWithoutHoles(r) || _iterableToArray(r) || _unsupportedIterableToArray(r) || _nonIterableSpread(); }
|
|
28
|
-
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."); }
|
|
29
|
-
function _iterableToArray(r) { if ("undefined" != typeof Symbol && null != r[Symbol.iterator] || null != r["@@iterator"]) return Array.from(r); }
|
|
30
|
-
function _arrayWithoutHoles(r) { if (Array.isArray(r)) return _arrayLikeToArray(r); }
|
|
31
31
|
function _slicedToArray(r, e) { return _arrayWithHoles(r) || _iterableToArrayLimit(r, e) || _unsupportedIterableToArray(r, e) || _nonIterableRest(); }
|
|
32
32
|
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."); }
|
|
33
33
|
function _unsupportedIterableToArray(r, a) { if (r) { if ("string" == typeof r) return _arrayLikeToArray(r, a); var t = {}.toString.call(r).slice(8, -1); return "Object" === t && r.constructor && (t = r.constructor.name), "Map" === t || "Set" === t ? Array.from(r) : "Arguments" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? _arrayLikeToArray(r, a) : void 0; } }
|
|
@@ -62,10 +62,13 @@ var BusinessMenuUI = function BusinessMenuUI(props) {
|
|
|
62
62
|
_useState4 = _slicedToArray(_useState3, 2),
|
|
63
63
|
showOption = _useState4[0],
|
|
64
64
|
setShowOption = _useState4[1];
|
|
65
|
-
var _useState5 = (0, _react.useState)(
|
|
65
|
+
var _useState5 = (0, _react.useState)({
|
|
66
|
+
menu: null,
|
|
67
|
+
loading: false
|
|
68
|
+
}),
|
|
66
69
|
_useState6 = _slicedToArray(_useState5, 2),
|
|
67
|
-
|
|
68
|
-
|
|
70
|
+
currentMenuState = _useState6[0],
|
|
71
|
+
setCurrentMenuState = _useState6[1];
|
|
69
72
|
var _useState7 = (0, _react.useState)(false),
|
|
70
73
|
_useState8 = _slicedToArray(_useState7, 2),
|
|
71
74
|
isOpenSharedProduct = _useState8[0],
|
|
@@ -82,8 +85,13 @@ var BusinessMenuUI = function BusinessMenuUI(props) {
|
|
|
82
85
|
_useState14 = _slicedToArray(_useState13, 2),
|
|
83
86
|
initMenuId = _useState14[0],
|
|
84
87
|
setInitMenuId = _useState14[1];
|
|
88
|
+
var setCurrentMenu = function setCurrentMenu(data) {
|
|
89
|
+
setCurrentMenuState(_objectSpread(_objectSpread({}, currentMenuState), data));
|
|
90
|
+
};
|
|
85
91
|
var handleOpenOptions = function handleOpenOptions(name, menu) {
|
|
86
|
-
setCurrentMenu(
|
|
92
|
+
setCurrentMenu({
|
|
93
|
+
menu: menu
|
|
94
|
+
});
|
|
87
95
|
setIsExtendExtraOpen(true);
|
|
88
96
|
setShowOption(name);
|
|
89
97
|
};
|
|
@@ -91,7 +99,9 @@ var BusinessMenuUI = function BusinessMenuUI(props) {
|
|
|
91
99
|
setShowOption(null);
|
|
92
100
|
setIsExtendExtraOpen(false);
|
|
93
101
|
setIsOpenSharedProduct(false);
|
|
94
|
-
setCurrentMenu(
|
|
102
|
+
setCurrentMenu({
|
|
103
|
+
menu: null
|
|
104
|
+
});
|
|
95
105
|
if (!isTab) {
|
|
96
106
|
setInitMenuId(null);
|
|
97
107
|
(0, _utils.removeQueryToUrl)(['menu', 'product']);
|
|
@@ -182,10 +192,12 @@ var BusinessMenuUI = function BusinessMenuUI(props) {
|
|
|
182
192
|
height: 24
|
|
183
193
|
}));
|
|
184
194
|
}), !(businessMenusState !== null && businessMenusState !== void 0 && businessMenusState.loading) && menuList.map(function (menu, index) {
|
|
195
|
+
var _currentMenuState$men;
|
|
185
196
|
return /*#__PURE__*/_react.default.createElement(_styles2.MeunItem, {
|
|
197
|
+
disabled: currentMenuState === null || currentMenuState === void 0 ? void 0 : currentMenuState.loading,
|
|
186
198
|
key: menu.id,
|
|
187
199
|
isBorderTop: index === 0,
|
|
188
|
-
active: menu.id === (
|
|
200
|
+
active: menu.id === (currentMenuState === null || currentMenuState === void 0 || (_currentMenuState$men = currentMenuState.menu) === null || _currentMenuState$men === void 0 ? void 0 : _currentMenuState$men.id),
|
|
189
201
|
onClick: function onClick(e) {
|
|
190
202
|
return handleOpenEdit(e, menu);
|
|
191
203
|
}
|
|
@@ -205,7 +217,7 @@ var BusinessMenuUI = function BusinessMenuUI(props) {
|
|
|
205
217
|
}, t('ADD_MENU', 'Add menu')))), width >= 1000 ? /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, showOption === 'option' && /*#__PURE__*/_react.default.createElement(_BusinessMenuOptions.BusinessMenuOptions, {
|
|
206
218
|
open: showOption === 'option',
|
|
207
219
|
business: business,
|
|
208
|
-
menu:
|
|
220
|
+
menu: (currentMenuState === null || currentMenuState === void 0 ? void 0 : currentMenuState.menu) || {},
|
|
209
221
|
onClose: function onClose() {
|
|
210
222
|
return handleCloseOption();
|
|
211
223
|
},
|
|
@@ -227,7 +239,7 @@ var BusinessMenuUI = function BusinessMenuUI(props) {
|
|
|
227
239
|
}, /*#__PURE__*/_react.default.createElement(_BusinessMenuOptions.BusinessMenuOptions, {
|
|
228
240
|
open: showOption === 'option',
|
|
229
241
|
business: business,
|
|
230
|
-
menu:
|
|
242
|
+
menu: (currentMenuState === null || currentMenuState === void 0 ? void 0 : currentMenuState.menu) || {},
|
|
231
243
|
onClose: function onClose() {
|
|
232
244
|
return handleCloseOption();
|
|
233
245
|
},
|
|
@@ -6,7 +6,7 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
6
6
|
});
|
|
7
7
|
exports.Title = exports.TabsContainer = exports.Tab = exports.SelectButtonGroup = exports.SearchBarWrapper = exports.MeunItem = exports.MenuName = exports.MenuContainer = exports.MainContainer = exports.Header = exports.CheckboxWrapper = exports.AddMenuButtonWrapper = void 0;
|
|
8
8
|
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, _templateObject23, _templateObject24, _templateObject25, _templateObject26, _templateObject27, _templateObject28, _templateObject29;
|
|
9
|
+
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;
|
|
10
10
|
function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(e) { return e ? t : r; })(e); }
|
|
11
11
|
function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != _typeof(e) && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && {}.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
|
|
12
12
|
function _taggedTemplateLiteral(e, t) { return t || (t = e.slice(0)), Object.freeze(Object.defineProperties(e, { raw: { value: Object.freeze(t) } })); }
|
|
@@ -25,7 +25,7 @@ var Header = exports.Header = _styledComponents.default.div(_templateObject7 ||
|
|
|
25
25
|
var Title = exports.Title = _styledComponents.default.h1(_templateObject10 || (_templateObject10 = _taggedTemplateLiteral(["\n font-size: 20px;\n font-weight: 700;\n color: ", ";\n margin: 0px;\n"])), function (props) {
|
|
26
26
|
return props.theme.colors.headingColor;
|
|
27
27
|
});
|
|
28
|
-
var MeunItem = exports.MeunItem = _styledComponents.default.div(_templateObject11 || (_templateObject11 = _taggedTemplateLiteral(["\n display: flex;\n align-items: center;\n justify-content: space-between;\n padding: 12px 0;\n border-bottom: 1px solid ", ";\n cursor: pointer;\n user-select: none;\n\n &:hover {\n background-color: ", ";\n }\n\n ", "\n\n ", "\n\n > svg {\n color: ", ";\n margin: 0 3px;\n font-size: 13px;\n }\n"])), function (props) {
|
|
28
|
+
var MeunItem = exports.MeunItem = _styledComponents.default.div(_templateObject11 || (_templateObject11 = _taggedTemplateLiteral(["\n display: flex;\n align-items: center;\n justify-content: space-between;\n padding: 12px 0;\n border-bottom: 1px solid ", ";\n cursor: pointer;\n user-select: none;\n\n &:hover {\n background-color: ", ";\n }\n\n ", "\n\n ", "\n\n ", "\n\n > svg {\n color: ", ";\n margin: 0 3px;\n font-size: 13px;\n }\n"])), function (props) {
|
|
29
29
|
return props.theme.colors.borderColor;
|
|
30
30
|
}, function (props) {
|
|
31
31
|
return props.theme.colors.lightPrimary;
|
|
@@ -43,41 +43,44 @@ var MeunItem = exports.MeunItem = _styledComponents.default.div(_templateObject1
|
|
|
43
43
|
}, function (props) {
|
|
44
44
|
return props.theme.colors.primary;
|
|
45
45
|
});
|
|
46
|
+
}, function (_ref5) {
|
|
47
|
+
var disabled = _ref5.disabled;
|
|
48
|
+
return disabled && (0, _styledComponents.css)(_templateObject14 || (_templateObject14 = _taggedTemplateLiteral(["\n opacity: 0.7;\n pointer-events: none;\n "])));
|
|
46
49
|
}, function (props) {
|
|
47
50
|
return props.theme.colors.secundaryLight;
|
|
48
51
|
});
|
|
49
|
-
var MenuName = exports.MenuName = _styledComponents.default.span(
|
|
50
|
-
var CheckboxWrapper = exports.CheckboxWrapper = _styledComponents.default.div(
|
|
52
|
+
var MenuName = exports.MenuName = _styledComponents.default.span(_templateObject15 || (_templateObject15 = _taggedTemplateLiteral(["\n flex: 1;\n font-size: 14px;\n"])));
|
|
53
|
+
var CheckboxWrapper = exports.CheckboxWrapper = _styledComponents.default.div(_templateObject16 || (_templateObject16 = _taggedTemplateLiteral(["\n display: flex;\n align-items: center;\n ", "\n"])), function (props) {
|
|
51
54
|
var _props$theme2;
|
|
52
|
-
return (_props$theme2 = props.theme) !== null && _props$theme2 !== void 0 && _props$theme2.rtl ? (0, _styledComponents.css)(
|
|
55
|
+
return (_props$theme2 = props.theme) !== null && _props$theme2 !== void 0 && _props$theme2.rtl ? (0, _styledComponents.css)(_templateObject17 || (_templateObject17 = _taggedTemplateLiteral(["\n margin-left: 20px;\n "]))) : (0, _styledComponents.css)(_templateObject18 || (_templateObject18 = _taggedTemplateLiteral(["\n margin-right: 20px;\n "])));
|
|
53
56
|
});
|
|
54
|
-
var AddMenuButtonWrapper = exports.AddMenuButtonWrapper = _styledComponents.default.div(
|
|
55
|
-
var TabsContainer = exports.TabsContainer = _styledComponents.default.div(
|
|
57
|
+
var AddMenuButtonWrapper = exports.AddMenuButtonWrapper = _styledComponents.default.div(_templateObject19 || (_templateObject19 = _taggedTemplateLiteral(["\n margin: 15px 0;\n"])));
|
|
58
|
+
var TabsContainer = exports.TabsContainer = _styledComponents.default.div(_templateObject20 || (_templateObject20 = _taggedTemplateLiteral(["\n width: 100%;\n display: flex;\n border-bottom: 1px solid ", ";\n margin-bottom: 10px;\n"])), function (props) {
|
|
56
59
|
return props.theme.colors.borderColor;
|
|
57
60
|
});
|
|
58
|
-
var Tab = exports.Tab = _styledComponents.default.div(
|
|
61
|
+
var Tab = exports.Tab = _styledComponents.default.div(_templateObject21 || (_templateObject21 = _taggedTemplateLiteral(["\n user-select: none;\n padding: 10px 0px;\n cursor: pointer;\n color: ", ";\n font-size: 14px;\n white-space: nowrap;\n ", "\n\n ", "\n\n ", "\n\n ", "\n"])), function (props) {
|
|
59
62
|
var _props$theme$colors;
|
|
60
63
|
return (_props$theme$colors = props.theme.colors) === null || _props$theme$colors === void 0 ? void 0 : _props$theme$colors.headingColor;
|
|
61
64
|
}, function (props) {
|
|
62
65
|
var _props$theme3;
|
|
63
|
-
return (_props$theme3 = props.theme) !== null && _props$theme3 !== void 0 && _props$theme3.rtl ? (0, _styledComponents.css)(
|
|
64
|
-
}, function (_ref5) {
|
|
65
|
-
var active = _ref5.active;
|
|
66
|
-
return active && (0, _styledComponents.css)(_templateObject23 || (_templateObject23 = _taggedTemplateLiteral(["\n border-bottom: 2px solid;\n font-weight: 500;\n "])));
|
|
66
|
+
return (_props$theme3 = props.theme) !== null && _props$theme3 !== void 0 && _props$theme3.rtl ? (0, _styledComponents.css)(_templateObject22 || (_templateObject22 = _taggedTemplateLiteral(["\n margin-left: 30px;\n "]))) : (0, _styledComponents.css)(_templateObject23 || (_templateObject23 = _taggedTemplateLiteral(["\n margin-right: 30px;\n "])));
|
|
67
67
|
}, function (_ref6) {
|
|
68
68
|
var active = _ref6.active;
|
|
69
|
-
return
|
|
69
|
+
return active && (0, _styledComponents.css)(_templateObject24 || (_templateObject24 = _taggedTemplateLiteral(["\n border-bottom: 2px solid;\n font-weight: 500;\n "])));
|
|
70
|
+
}, function (_ref7) {
|
|
71
|
+
var active = _ref7.active;
|
|
72
|
+
return !active && (0, _styledComponents.css)(_templateObject25 || (_templateObject25 = _taggedTemplateLiteral(["\n color: ", ";\n "])), function (props) {
|
|
70
73
|
var _props$theme$colors2;
|
|
71
74
|
return (_props$theme$colors2 = props.theme.colors) === null || _props$theme$colors2 === void 0 ? void 0 : _props$theme$colors2.lightGray;
|
|
72
75
|
});
|
|
73
|
-
}, function (
|
|
74
|
-
var disabledFeature =
|
|
75
|
-
return disabledFeature && (0, _styledComponents.css)(
|
|
76
|
+
}, function (_ref8) {
|
|
77
|
+
var disabledFeature = _ref8.disabledFeature;
|
|
78
|
+
return disabledFeature && (0, _styledComponents.css)(_templateObject26 || (_templateObject26 = _taggedTemplateLiteral(["\n cursor: not-allowed;\n "])));
|
|
76
79
|
});
|
|
77
|
-
var SearchBarWrapper = exports.SearchBarWrapper = _styledComponents.default.div(
|
|
78
|
-
var SelectButtonGroup = exports.SelectButtonGroup = _styledComponents.default.div(
|
|
80
|
+
var SearchBarWrapper = exports.SearchBarWrapper = _styledComponents.default.div(_templateObject27 || (_templateObject27 = _taggedTemplateLiteral(["\n margin-bottom: 15px;\n"])));
|
|
81
|
+
var SelectButtonGroup = exports.SelectButtonGroup = _styledComponents.default.div(_templateObject28 || (_templateObject28 = _taggedTemplateLiteral(["\n display: flex;\n align-items: center;\n padding-bottom: 15px;\n border-bottom: 1px solid ", ";\n button {\n font-size: 12px;\n\n &:first-child {\n ", "\n }\n }\n"])), function (props) {
|
|
79
82
|
return props.theme.colors.borderColor;
|
|
80
83
|
}, function (props) {
|
|
81
84
|
var _props$theme4;
|
|
82
|
-
return (_props$theme4 = props.theme) !== null && _props$theme4 !== void 0 && _props$theme4.rtl ? (0, _styledComponents.css)(
|
|
85
|
+
return (_props$theme4 = props.theme) !== null && _props$theme4 !== void 0 && _props$theme4.rtl ? (0, _styledComponents.css)(_templateObject29 || (_templateObject29 = _taggedTemplateLiteral(["\n margin-left: 16px;\n "]))) : (0, _styledComponents.css)(_templateObject30 || (_templateObject30 = _taggedTemplateLiteral(["\n margin-right: 16px;\n "])));
|
|
83
86
|
});
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "ordering-ui-admin-external",
|
|
3
|
-
"version": "1.43.
|
|
3
|
+
"version": "1.43.91",
|
|
4
4
|
"description": "Ordering UI Admin Components",
|
|
5
5
|
"main": "./_modules/index.js",
|
|
6
6
|
"exports": {
|
|
@@ -83,7 +83,7 @@
|
|
|
83
83
|
"lodash": "^4.17.20",
|
|
84
84
|
"moment": "^2.29.1",
|
|
85
85
|
"moment-range": "^4.0.2",
|
|
86
|
-
"ordering-components-admin-external": "1.43.
|
|
86
|
+
"ordering-components-admin-external": "1.43.59",
|
|
87
87
|
"polished": "^3.6.7",
|
|
88
88
|
"prop-types": "^15.7.2",
|
|
89
89
|
"react-big-calendar": "^1.4.2",
|
|
@@ -42,14 +42,21 @@ const BusinessMenuUI = (props) => {
|
|
|
42
42
|
|
|
43
43
|
const [confirm, setConfirm] = useState({ open: false, content: null, handleOnAccept: null })
|
|
44
44
|
const [showOption, setShowOption] = useState(null)
|
|
45
|
-
const [
|
|
45
|
+
const [currentMenuState, setCurrentMenuState] = useState({ menu: null, loading: false })
|
|
46
46
|
const [isOpenSharedProduct, setIsOpenSharedProduct] = useState(false)
|
|
47
47
|
const [searchValue, setSearchValue] = useState('')
|
|
48
48
|
const [menuList, setMenuList] = useState([])
|
|
49
49
|
const [initMenuId, setInitMenuId] = useState(null)
|
|
50
50
|
|
|
51
|
+
const setCurrentMenu = (data) => {
|
|
52
|
+
setCurrentMenuState({
|
|
53
|
+
...currentMenuState,
|
|
54
|
+
...data
|
|
55
|
+
})
|
|
56
|
+
}
|
|
57
|
+
|
|
51
58
|
const handleOpenOptions = (name, menu) => {
|
|
52
|
-
setCurrentMenu(menu)
|
|
59
|
+
setCurrentMenu({ menu })
|
|
53
60
|
setIsExtendExtraOpen(true)
|
|
54
61
|
setShowOption(name)
|
|
55
62
|
}
|
|
@@ -58,7 +65,7 @@ const BusinessMenuUI = (props) => {
|
|
|
58
65
|
setShowOption(null)
|
|
59
66
|
setIsExtendExtraOpen(false)
|
|
60
67
|
setIsOpenSharedProduct(false)
|
|
61
|
-
setCurrentMenu(null)
|
|
68
|
+
setCurrentMenu({ menu: null })
|
|
62
69
|
if (!isTab) {
|
|
63
70
|
setInitMenuId(null)
|
|
64
71
|
removeQueryToUrl(['menu', 'product'])
|
|
@@ -171,9 +178,10 @@ const BusinessMenuUI = (props) => {
|
|
|
171
178
|
)}
|
|
172
179
|
{!businessMenusState?.loading && menuList.map((menu, index) => (
|
|
173
180
|
<MeunItem
|
|
181
|
+
disabled={currentMenuState?.loading}
|
|
174
182
|
key={menu.id}
|
|
175
183
|
isBorderTop={index === 0}
|
|
176
|
-
active={menu.id ===
|
|
184
|
+
active={menu.id === currentMenuState?.menu?.id}
|
|
177
185
|
onClick={(e) => handleOpenEdit(e, menu)}
|
|
178
186
|
>
|
|
179
187
|
<CheckboxWrapper
|
|
@@ -205,7 +213,7 @@ const BusinessMenuUI = (props) => {
|
|
|
205
213
|
<BusinessMenuOptions
|
|
206
214
|
open={showOption === 'option'}
|
|
207
215
|
business={business}
|
|
208
|
-
menu={
|
|
216
|
+
menu={currentMenuState?.menu || {}}
|
|
209
217
|
onClose={() => handleCloseOption()}
|
|
210
218
|
handleUpdateBusinessState={handleSuccessBusinessMenu}
|
|
211
219
|
isSelectedSharedMenus={isSelectedSharedMenus}
|
|
@@ -230,7 +238,7 @@ const BusinessMenuUI = (props) => {
|
|
|
230
238
|
<BusinessMenuOptions
|
|
231
239
|
open={showOption === 'option'}
|
|
232
240
|
business={business}
|
|
233
|
-
menu={
|
|
241
|
+
menu={currentMenuState?.menu || {}}
|
|
234
242
|
onClose={() => handleCloseOption()}
|
|
235
243
|
handleUpdateBusinessState={handleSuccessBusinessMenu}
|
|
236
244
|
isSelectedSharedMenus={isSelectedSharedMenus}
|
|
@@ -68,6 +68,11 @@ export const MeunItem = styled.div`
|
|
|
68
68
|
border-bottom: 1px solid ${props => props.theme.colors.primary};
|
|
69
69
|
`}
|
|
70
70
|
|
|
71
|
+
${({ disabled }) => disabled && css`
|
|
72
|
+
opacity: 0.7;
|
|
73
|
+
pointer-events: none;
|
|
74
|
+
`}
|
|
75
|
+
|
|
71
76
|
> svg {
|
|
72
77
|
color: ${props => props.theme.colors.secundaryLight};
|
|
73
78
|
margin: 0 3px;
|