ordering-ui-admin-external 1.27.1 → 1.28.1
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.a9792b22d968cdf424d1.js → ordering-ui-admin.d6c72a98321193c34fe9.js} +2 -2
- package/_modules/components/BusinessIntelligence/AnalyticsOrdersStatus/index.js +2 -1
- package/_modules/components/BusinessIntelligence/BusinessAnalytics/index.js +4 -13
- package/_modules/components/BusinessIntelligence/CountryFilter/index.js +18 -4
- package/_modules/components/BusinessIntelligence/DriverAnalytics/index.js +4 -13
- package/_modules/components/BusinessIntelligence/ReportsBusinessDistance/index.js +4 -13
- package/_modules/components/BusinessIntelligence/ReportsBusinessSpend/index.js +4 -13
- package/_modules/components/BusinessIntelligence/ReportsDriverDistance/index.js +4 -13
- package/_modules/components/BusinessIntelligence/ReportsDriverOrder/index.js +4 -13
- package/_modules/components/BusinessIntelligence/ReportsDriverOrderTime/index.js +4 -13
- package/_modules/components/BusinessIntelligence/ReportsDriverSpend/index.js +4 -13
- package/_modules/components/BusinessIntelligence/ReportsGeneralSales/index.js +4 -13
- package/_modules/components/BusinessIntelligence/ReportsHeatMap/index.js +4 -13
- package/_modules/components/BusinessIntelligence/ReportsOrderDistance/index.js +4 -13
- package/_modules/components/BusinessIntelligence/ReportsOrderStatus/index.js +4 -13
- package/_modules/components/BusinessIntelligence/ReportsOrders/index.js +4 -13
- package/_modules/components/BusinessIntelligence/ReportsSaleAndCategory/index.js +4 -13
- package/_modules/components/BusinessIntelligence/ReportsSales/index.js +4 -13
- package/_modules/components/Delivery/DriversGroupAddForm/GeneralForm/index.js +3 -4
- package/_modules/components/Delivery/DriversGroupDetails/index.js +23 -33
- package/_modules/components/Delivery/DriversGroupGeneralForm/index.js +2 -23
- package/_modules/components/Delivery/DriversGroupGeneralForm/styles.js +3 -8
- package/_modules/components/Delivery/DriversGroupsList/index.js +8 -7
- package/_modules/components/Delivery/DriversGroupsList/styles.js +38 -35
- package/_modules/components/Delivery/UserAddForm/index.js +16 -4
- package/_modules/components/Delivery/UserFormDetails/index.js +17 -5
- package/_modules/components/MyProducts/AdvancedSettings/index.js +9 -1
- package/_modules/components/MyProducts/OrderingWebsite/index.js +7 -3
- package/_modules/components/OrderingProducts/SiteTheme/index.js +3 -3
- package/_modules/components/Orders/DeliveriesManager/index.js +6 -8
- package/_modules/components/Orders/OrdersManager/index.js +9 -11
- package/_modules/components/Stores/BusinessDeliveryGroupsDetails/index.js +15 -30
- package/_modules/components/Stores/BusinessDeliveryGroupsDetails/styles.js +4 -4
- package/_modules/components/Stores/BusinessProductsListing/index.js +6 -0
- package/_modules/components/Stores/ProductExtraOptionDetails/index.js +20 -2
- package/_modules/components/Stores/ProductExtraOptions/index.js +19 -5
- package/_modules/components/Stores/ProductExtraOptions/styles.js +19 -22
- package/_modules/components/Stores/ProductExtras/index.js +19 -18
- package/_modules/components/Stores/ProductExtras/styles.js +1 -1
- package/package.json +2 -2
- package/src/components/BusinessIntelligence/AnalyticsOrdersStatus/index.js +1 -1
- package/src/components/BusinessIntelligence/BusinessAnalytics/index.js +5 -12
- package/src/components/BusinessIntelligence/CountryFilter/index.js +72 -56
- package/src/components/BusinessIntelligence/DriverAnalytics/index.js +5 -12
- package/src/components/BusinessIntelligence/ReportsBusinessDistance/index.js +5 -12
- package/src/components/BusinessIntelligence/ReportsBusinessSpend/index.js +5 -12
- package/src/components/BusinessIntelligence/ReportsDriverDistance/index.js +5 -12
- package/src/components/BusinessIntelligence/ReportsDriverOrder/index.js +5 -12
- package/src/components/BusinessIntelligence/ReportsDriverOrderTime/index.js +5 -12
- package/src/components/BusinessIntelligence/ReportsDriverSpend/index.js +5 -12
- package/src/components/BusinessIntelligence/ReportsGeneralSales/index.js +5 -12
- package/src/components/BusinessIntelligence/ReportsHeatMap/index.js +5 -12
- package/src/components/BusinessIntelligence/ReportsOrderDistance/index.js +5 -12
- package/src/components/BusinessIntelligence/ReportsOrderStatus/index.js +5 -12
- package/src/components/BusinessIntelligence/ReportsOrders/index.js +5 -12
- package/src/components/BusinessIntelligence/ReportsSaleAndCategory/index.js +5 -12
- package/src/components/BusinessIntelligence/ReportsSales/index.js +5 -12
- package/src/components/Delivery/DriversGroupAddForm/GeneralForm/index.js +3 -2
- package/src/components/Delivery/DriversGroupDetails/index.js +2 -9
- package/src/components/Delivery/DriversGroupGeneralForm/index.js +3 -29
- package/src/components/Delivery/DriversGroupGeneralForm/styles.js +0 -15
- package/src/components/Delivery/DriversGroupsList/index.js +54 -42
- package/src/components/Delivery/DriversGroupsList/styles.js +12 -11
- package/src/components/Delivery/UserAddForm/index.js +32 -13
- package/src/components/Delivery/UserFormDetails/index.js +30 -13
- package/src/components/MyProducts/AdvancedSettings/index.js +3 -1
- package/src/components/MyProducts/OrderingWebsite/index.js +57 -50
- package/src/components/OrderingProducts/SiteTheme/index.js +4 -2
- package/src/components/Orders/DeliveriesManager/index.js +3 -2
- package/src/components/Orders/OrdersManager/index.js +3 -2
- package/src/components/Stores/BusinessDeliveryGroupsDetails/index.js +4 -16
- package/src/components/Stores/BusinessDeliveryGroupsDetails/styles.js +6 -10
- package/src/components/Stores/BusinessProductsListing/index.js +8 -0
- package/src/components/Stores/ProductExtraOptionDetails/index.js +15 -1
- package/src/components/Stores/ProductExtraOptions/index.js +16 -3
- package/src/components/Stores/ProductExtraOptions/styles.js +4 -7
- package/src/components/Stores/ProductExtras/index.js +14 -16
- package/src/components/Stores/ProductExtras/styles.js +4 -0
- /package/_bundles/{ordering-ui-admin.a9792b22d968cdf424d1.js.LICENSE.txt → ordering-ui-admin.d6c72a98321193c34fe9.js.LICENSE.txt} +0 -0
|
@@ -41,33 +41,29 @@ var DriversGroupsListingDetailsUI = function DriversGroupsListingDetailsUI(props
|
|
|
41
41
|
var _useLanguage = (0, _orderingComponentsAdminExternal.useLanguage)(),
|
|
42
42
|
_useLanguage2 = _slicedToArray(_useLanguage, 2),
|
|
43
43
|
t = _useLanguage2[1];
|
|
44
|
-
var _useState = (0, _react.useState)(
|
|
45
|
-
_useState2 = _slicedToArray(_useState, 2),
|
|
46
|
-
searchValue = _useState2[0],
|
|
47
|
-
setSearchValue = _useState2[1];
|
|
48
|
-
var _useState3 = (0, _react.useState)({
|
|
44
|
+
var _useState = (0, _react.useState)({
|
|
49
45
|
open: false,
|
|
50
46
|
content: []
|
|
51
47
|
}),
|
|
52
|
-
|
|
53
|
-
alertState =
|
|
54
|
-
setAlertState =
|
|
55
|
-
var
|
|
48
|
+
_useState2 = _slicedToArray(_useState, 2),
|
|
49
|
+
alertState = _useState2[0],
|
|
50
|
+
setAlertState = _useState2[1];
|
|
51
|
+
var _useState3 = (0, _react.useState)({
|
|
56
52
|
open: false,
|
|
57
53
|
content: null,
|
|
58
54
|
handleOnAccept: null
|
|
59
55
|
}),
|
|
56
|
+
_useState4 = _slicedToArray(_useState3, 2),
|
|
57
|
+
confirm = _useState4[0],
|
|
58
|
+
setConfirm = _useState4[1];
|
|
59
|
+
var _useState5 = (0, _react.useState)(false),
|
|
60
60
|
_useState6 = _slicedToArray(_useState5, 2),
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
var _useState7 = (0, _react.useState)(
|
|
61
|
+
isTourOpen = _useState6[0],
|
|
62
|
+
setIsTourOpen = _useState6[1];
|
|
63
|
+
var _useState7 = (0, _react.useState)(4),
|
|
64
64
|
_useState8 = _slicedToArray(_useState7, 2),
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
var _useState9 = (0, _react.useState)(4),
|
|
68
|
-
_useState10 = _slicedToArray(_useState9, 2),
|
|
69
|
-
currentTourStep = _useState10[0],
|
|
70
|
-
setCurrentTourStep = _useState10[1];
|
|
65
|
+
currentTourStep = _useState8[0],
|
|
66
|
+
setCurrentTourStep = _useState8[1];
|
|
71
67
|
(0, _react.useEffect)(function () {
|
|
72
68
|
if (!(actionState !== null && actionState !== void 0 && actionState.error)) return;
|
|
73
69
|
setAlertState({
|
|
@@ -76,7 +72,6 @@ var DriversGroupsListingDetailsUI = function DriversGroupsListingDetailsUI(props
|
|
|
76
72
|
});
|
|
77
73
|
}, [actionState === null || actionState === void 0 ? void 0 : actionState.error]);
|
|
78
74
|
var handleOpenTour = function handleOpenTour() {
|
|
79
|
-
setOpenDetails(false);
|
|
80
75
|
setCurrentTourStep(4);
|
|
81
76
|
setIsTourOpen(true);
|
|
82
77
|
};
|
|
@@ -113,19 +108,9 @@ var DriversGroupsListingDetailsUI = function DriversGroupsListingDetailsUI(props
|
|
|
113
108
|
(0, _react.useEffect)(function () {
|
|
114
109
|
getDataFromStorage();
|
|
115
110
|
}, []);
|
|
116
|
-
return /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, /*#__PURE__*/_react.default.createElement(_styles.
|
|
117
|
-
lazyLoad: true,
|
|
118
|
-
isCustomLayout: true,
|
|
119
|
-
onSearch: function onSearch(val) {
|
|
120
|
-
return setSearchValue(val);
|
|
121
|
-
},
|
|
122
|
-
search: searchValue,
|
|
123
|
-
placeholder: t('SEARCH', 'Search'),
|
|
124
|
-
customClass: "searchBar"
|
|
125
|
-
})), /*#__PURE__*/_react.default.createElement(_styles.DriversGroupsListingContainer, null, /*#__PURE__*/_react.default.createElement(_DriversGroupsList.DriversGroupsList, {
|
|
111
|
+
return /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, /*#__PURE__*/_react.default.createElement(_styles.Description, null, t('BUSINESS_IN_FOLLOWING_DRIVER_GROUPS', 'This business is in the following driver groups')), /*#__PURE__*/_react.default.createElement(_styles.DriversGroupsListingContainer, null, /*#__PURE__*/_react.default.createElement(_DriversGroupsList.DriversGroupsList, {
|
|
126
112
|
isFromStore: true,
|
|
127
113
|
driversGroupsState: driversGroupsState,
|
|
128
|
-
searchValue: searchValue,
|
|
129
114
|
handleUpdateDriversGroup: handleUpdateDriversGroup,
|
|
130
115
|
selectedGroupList: selectedGroupList,
|
|
131
116
|
handleSelectGroup: handleSelectGroup,
|
|
@@ -3,12 +3,12 @@
|
|
|
3
3
|
Object.defineProperty(exports, "__esModule", {
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
|
-
exports.
|
|
6
|
+
exports.DriversGroupsListingContainer = exports.Description = void 0;
|
|
7
7
|
var _styledComponents = _interopRequireDefault(require("styled-components"));
|
|
8
8
|
var _templateObject, _templateObject2;
|
|
9
9
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
10
10
|
function _taggedTemplateLiteral(strings, raw) { if (!raw) { raw = strings.slice(0); } return Object.freeze(Object.defineProperties(strings, { raw: { value: Object.freeze(raw) } })); }
|
|
11
|
-
var DriversGroupsListingContainer = _styledComponents.default.div(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n
|
|
11
|
+
var DriversGroupsListingContainer = _styledComponents.default.div(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n > div {\n padding: 0;\n margin-bottom: 30px;\n }\n"])));
|
|
12
12
|
exports.DriversGroupsListingContainer = DriversGroupsListingContainer;
|
|
13
|
-
var
|
|
14
|
-
exports.
|
|
13
|
+
var Description = _styledComponents.default.p(_templateObject2 || (_templateObject2 = _taggedTemplateLiteral(["\n font-size: 14px;\n"])));
|
|
14
|
+
exports.Description = Description;
|
|
@@ -146,6 +146,12 @@ var BusinessProductsListingUI = function BusinessProductsListingUI(props) {
|
|
|
146
146
|
var spreadColumnOptions = [{
|
|
147
147
|
value: 'cost_price',
|
|
148
148
|
content: t('PRODUCT_COST', 'Product cost')
|
|
149
|
+
}, {
|
|
150
|
+
value: 'inventoried',
|
|
151
|
+
content: t('INVENTORY', 'Inventory')
|
|
152
|
+
}, {
|
|
153
|
+
value: 'quantity',
|
|
154
|
+
content: t('QUANTITY', 'Quantity')
|
|
149
155
|
}];
|
|
150
156
|
var handleChangeAllowSpreadColumns = function handleChangeAllowSpreadColumns(type) {
|
|
151
157
|
setAllowSpreadColumns(_objectSpread(_objectSpread({}, allowSpreadColumns), {}, _defineProperty({}, type, !allowSpreadColumns[type])));
|
|
@@ -116,6 +116,10 @@ var ProductExtraOptionDetailsUI = function ProductExtraOptionDetailsUI(props) {
|
|
|
116
116
|
_useState12 = _slicedToArray(_useState11, 2),
|
|
117
117
|
externalId = _useState12[0],
|
|
118
118
|
setExternalId = _useState12[1];
|
|
119
|
+
var _useState13 = (0, _react.useState)(null),
|
|
120
|
+
_useState14 = _slicedToArray(_useState13, 2),
|
|
121
|
+
timer = _useState14[0],
|
|
122
|
+
setTimer = _useState14[1];
|
|
119
123
|
var handleClickSubOptionImage = function handleClickSubOptionImage(id) {
|
|
120
124
|
document.getElementById(id).click();
|
|
121
125
|
};
|
|
@@ -183,6 +187,16 @@ var ProductExtraOptionDetailsUI = function ProductExtraOptionDetailsUI(props) {
|
|
|
183
187
|
handleSubmit(handleAddOption)();
|
|
184
188
|
}
|
|
185
189
|
};
|
|
190
|
+
var onChangeAddModifierName = function onChangeAddModifierName(e) {
|
|
191
|
+
e.persist();
|
|
192
|
+
clearTimeout(timer);
|
|
193
|
+
var _timer = setTimeout(function () {
|
|
194
|
+
if (e.target.value) {
|
|
195
|
+
handleSubmit(handleAddOption)();
|
|
196
|
+
}
|
|
197
|
+
}, 750);
|
|
198
|
+
setTimer(_timer);
|
|
199
|
+
};
|
|
186
200
|
var handleUpdateExternalId = function handleUpdateExternalId() {
|
|
187
201
|
handleUpdateOption({
|
|
188
202
|
external_id: externalId
|
|
@@ -329,13 +343,17 @@ var ProductExtraOptionDetailsUI = function ProductExtraOptionDetailsUI(props) {
|
|
|
329
343
|
defaultValue: editSubOptionId === null && (changesState === null || changesState === void 0 ? void 0 : (_changesState$changes3 = changesState.changes) === null || _changesState$changes3 === void 0 ? void 0 : _changesState$changes3.name) || '',
|
|
330
344
|
ref: register({
|
|
331
345
|
required: t('NAME_REQUIRED', 'The name is required.')
|
|
332
|
-
})
|
|
346
|
+
}),
|
|
347
|
+
onChange: function onChange(e) {
|
|
348
|
+
return onChangeAddModifierName(e);
|
|
349
|
+
},
|
|
350
|
+
readOnly: optionState === null || optionState === void 0 ? void 0 : optionState.loading
|
|
333
351
|
}))), /*#__PURE__*/_react.default.createElement(_styles2.RightSubOptionContent, null, /*#__PURE__*/_react.default.createElement(_styles2.InputWrapper, {
|
|
334
352
|
primary: (optionState === null || optionState === void 0 ? void 0 : (_optionState$option8 = optionState.option) === null || _optionState$option8 === void 0 ? void 0 : (_optionState$option8$ = _optionState$option8.suboptions) === null || _optionState$option8$ === void 0 ? void 0 : _optionState$option8$.length) === 0
|
|
335
353
|
}, /*#__PURE__*/_react.default.createElement(_styles.Input, {
|
|
336
354
|
name: "price",
|
|
337
355
|
placeholder: t('PRICE', 'Price'),
|
|
338
|
-
defaultValue: editSubOptionId === null && (changesState === null || changesState === void 0 ? void 0 : (_changesState$changes4 = changesState.changes) === null || _changesState$changes4 === void 0 ? void 0 : _changesState$changes4.price) ||
|
|
356
|
+
defaultValue: editSubOptionId === null && (changesState === null || changesState === void 0 ? void 0 : (_changesState$changes4 = changesState.changes) === null || _changesState$changes4 === void 0 ? void 0 : _changesState$changes4.price) || 0,
|
|
339
357
|
ref: register(),
|
|
340
358
|
onKeyPress: function onKeyPress(e) {
|
|
341
359
|
if (!/^[0-9.]$/.test(e.key)) {
|
|
@@ -179,8 +179,18 @@ var ProductExtraOptionsUI = function ProductExtraOptionsUI(props) {
|
|
|
179
179
|
}
|
|
180
180
|
setIsMenuOpen(value);
|
|
181
181
|
};
|
|
182
|
-
var onSubmit = function onSubmit() {
|
|
183
|
-
handleAddOption();
|
|
182
|
+
var onSubmit = function onSubmit(formValues) {
|
|
183
|
+
handleAddOption(formValues);
|
|
184
|
+
};
|
|
185
|
+
var onChangeAddExtraOptionName = function onChangeAddExtraOptionName(e) {
|
|
186
|
+
e.persist();
|
|
187
|
+
clearTimeout(timer);
|
|
188
|
+
var _timer = setTimeout(function () {
|
|
189
|
+
if (e.target.value) {
|
|
190
|
+
handleSubmit(onSubmit)();
|
|
191
|
+
}
|
|
192
|
+
}, 750);
|
|
193
|
+
setTimer(_timer);
|
|
184
194
|
};
|
|
185
195
|
(0, _react.useEffect)(function () {
|
|
186
196
|
if (Object.keys(errors).length > 0) {
|
|
@@ -340,9 +350,10 @@ var ProductExtraOptionsUI = function ProductExtraOptionsUI(props) {
|
|
|
340
350
|
value: value,
|
|
341
351
|
onChange: function onChange(e) {
|
|
342
352
|
_onChange(e);
|
|
343
|
-
|
|
353
|
+
onChangeAddExtraOptionName(e);
|
|
344
354
|
},
|
|
345
|
-
autoComplete: "off"
|
|
355
|
+
autoComplete: "off",
|
|
356
|
+
readOnly: extraState === null || extraState === void 0 ? void 0 : extraState.loading
|
|
346
357
|
});
|
|
347
358
|
},
|
|
348
359
|
rules: {
|
|
@@ -397,7 +408,10 @@ var ProductExtraOptionsUI = function ProductExtraOptionsUI(props) {
|
|
|
397
408
|
required: t('MAX_PURCHASED_REQUIRED', 'The max is required.')
|
|
398
409
|
}
|
|
399
410
|
}), /*#__PURE__*/_react.default.createElement(_styles.IconButton, {
|
|
400
|
-
type: "submit"
|
|
411
|
+
type: "submit",
|
|
412
|
+
style: {
|
|
413
|
+
visibility: 'hidden'
|
|
414
|
+
}
|
|
401
415
|
}, /*#__PURE__*/_react.default.createElement(_reactBootstrapIcons.PlusCircle, null)))), /*#__PURE__*/_react.default.createElement(_Shared.Alert, {
|
|
402
416
|
title: t('WEB_APPNAME', 'Ordering'),
|
|
403
417
|
content: alertState.content,
|
|
@@ -7,7 +7,7 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
7
7
|
exports.OptionsList = exports.OptionsContainer = exports.OptionNameContainer = exports.OptionItem = exports.OptionImage = exports.MinimumPurchase = exports.MaxPurchase = exports.MainContainer = exports.Header = exports.DragImageWrapper = exports.ArrowWrpper = exports.AddOptionForm = exports.ActionSelectorWrapper = void 0;
|
|
8
8
|
var _styledComponents = _interopRequireWildcard(require("styled-components"));
|
|
9
9
|
var _polished = require("polished");
|
|
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, _templateObject32, _templateObject33, _templateObject34, _templateObject35, _templateObject36
|
|
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, _templateObject32, _templateObject33, _templateObject34, _templateObject35, _templateObject36;
|
|
11
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); }
|
|
12
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
13
|
function _taggedTemplateLiteral(strings, raw) { if (!raw) { raw = strings.slice(0); } return Object.freeze(Object.defineProperties(strings, { raw: { value: Object.freeze(raw) } })); }
|
|
@@ -23,7 +23,7 @@ var Header = _styledComponents.default.div(_templateObject5 || (_templateObject5
|
|
|
23
23
|
return (_props$theme2 = props.theme) !== null && _props$theme2 !== void 0 && _props$theme2.rtl ? (0, _styledComponents.css)(_templateObject6 || (_templateObject6 = _taggedTemplateLiteral(["\n margin-right: 10px;\n "]))) : (0, _styledComponents.css)(_templateObject7 || (_templateObject7 = _taggedTemplateLiteral(["\n margin-left: 10px;\n "])));
|
|
24
24
|
});
|
|
25
25
|
exports.Header = Header;
|
|
26
|
-
var OptionNameContainer = _styledComponents.default.div(_templateObject8 || (_templateObject8 = _taggedTemplateLiteral(["\n flex: 1;\n display: flex;\n align-items: center;\n width: 70%;\n margin: 12px 0;\n font-size: 14px;\n > input {\n flex: 1;\n height: 32px;\n width: 32px;\n padding: 5px;\n border: none;\n outline: none;\n background: ", ";\n\n &:focus {\n border: 1px dashed ", ";\n }\n ", "\n }\n\n ", "\n\n ", "\n"])), function (props) {
|
|
26
|
+
var OptionNameContainer = _styledComponents.default.div(_templateObject8 || (_templateObject8 = _taggedTemplateLiteral(["\n flex: 1;\n display: flex;\n align-items: center;\n width: 70%;\n margin: 12px 0;\n font-size: 14px;\n > input {\n flex: 1;\n height: 32px;\n width: 32px;\n padding: 5px;\n border: none;\n outline: none;\n background: ", ";\n\n &:focus {\n border: 1px dashed ", ";\n }\n &:read-only {\n background-color: #F8F9FA;\n cursor: not-allowed;\n }\n ", "\n }\n\n ", "\n\n ", "\n"])), function (props) {
|
|
27
27
|
var _props$theme$colors;
|
|
28
28
|
return ((_props$theme$colors = props.theme.colors) === null || _props$theme$colors === void 0 ? void 0 : _props$theme$colors.backgroundPage) || '#FFF';
|
|
29
29
|
}, function (props) {
|
|
@@ -66,7 +66,7 @@ var ActionSelectorWrapper = _styledComponents.default.div(_templateObject17 || (
|
|
|
66
66
|
return props.theme.colors.danger;
|
|
67
67
|
});
|
|
68
68
|
exports.ActionSelectorWrapper = ActionSelectorWrapper;
|
|
69
|
-
var AddOptionForm = _styledComponents.default.form(_templateObject18 || (_templateObject18 = _taggedTemplateLiteral(["\n display: flex;\n align-items: center;\n border-top: 13px solid ", ";\n border-bottom: 1px solid ", ";\n\n > input {\n width: 75px;\n height: 32px;\n padding: 5px;\n border: none;\n outline: none;\n font-size: 14px;\n background: ", ";\n\n &:focus {\n border: 1px dashed ", ";\n }\n }\n
|
|
69
|
+
var AddOptionForm = _styledComponents.default.form(_templateObject18 || (_templateObject18 = _taggedTemplateLiteral(["\n display: flex;\n align-items: center;\n border-top: 13px solid ", ";\n border-bottom: 1px solid ", ";\n\n > input {\n width: 75px;\n height: 32px;\n padding: 5px;\n border: none;\n outline: none;\n font-size: 14px;\n background: ", ";\n\n &:focus {\n border: 1px dashed ", ";\n }\n }\n\n @media (min-width: 450px) {\n > input {\n width: 80px;\n }\n }\n"])), function (props) {
|
|
70
70
|
return props.theme.colors.borderColor;
|
|
71
71
|
}, function (props) {
|
|
72
72
|
return props.theme.colors.borderColor;
|
|
@@ -75,23 +75,20 @@ var AddOptionForm = _styledComponents.default.form(_templateObject18 || (_templa
|
|
|
75
75
|
return ((_props$theme$colors2 = props.theme.colors) === null || _props$theme$colors2 === void 0 ? void 0 : _props$theme$colors2.backgroundPage) || '#FFF';
|
|
76
76
|
}, function (props) {
|
|
77
77
|
return props.theme.colors.lightGray;
|
|
78
|
-
}, function (props) {
|
|
79
|
-
var _props$theme6;
|
|
80
|
-
return (_props$theme6 = props.theme) !== null && _props$theme6 !== void 0 && _props$theme6.rtl ? (0, _styledComponents.css)(_templateObject19 || (_templateObject19 = _taggedTemplateLiteral(["\n margin-right: 10px;\n "]))) : (0, _styledComponents.css)(_templateObject20 || (_templateObject20 = _taggedTemplateLiteral(["\n margin-left: 10px;\n "])));
|
|
81
78
|
});
|
|
82
79
|
exports.AddOptionForm = AddOptionForm;
|
|
83
|
-
var OptionsList = _styledComponents.default.div(
|
|
80
|
+
var OptionsList = _styledComponents.default.div(_templateObject19 || (_templateObject19 = _taggedTemplateLiteral(["\n"])));
|
|
84
81
|
exports.OptionsList = OptionsList;
|
|
85
|
-
var OptionItem = _styledComponents.default.div(
|
|
82
|
+
var OptionItem = _styledComponents.default.div(_templateObject20 || (_templateObject20 = _taggedTemplateLiteral(["\n cursor: pointer;\n display: flex;\n align-items: center;\n border-bottom: 1px solid ", ";\n\n ", "\n ", "\n\n ", "\n\n ", "\n"])), function (props) {
|
|
86
83
|
return props.theme.colors.borderColor;
|
|
87
84
|
}, function (_ref2) {
|
|
88
85
|
var isHeader = _ref2.isHeader;
|
|
89
|
-
return !isHeader && (0, _styledComponents.css)(
|
|
86
|
+
return !isHeader && (0, _styledComponents.css)(_templateObject21 || (_templateObject21 = _taggedTemplateLiteral(["\n cursor: pointer;\n &:hover {\n background-color: ", ";\n }\n "])), function (props) {
|
|
90
87
|
return props.theme.colors.lightPrimary;
|
|
91
88
|
});
|
|
92
89
|
}, function (_ref3) {
|
|
93
90
|
var active = _ref3.active;
|
|
94
|
-
return active && (0, _styledComponents.css)(
|
|
91
|
+
return active && (0, _styledComponents.css)(_templateObject22 || (_templateObject22 = _taggedTemplateLiteral(["\n background-color: ", ";\n border-top: 1px solid ", ";\n border-bottom: 1px solid ", ";\n "])), function (props) {
|
|
95
92
|
return props.theme.colors.lightPrimary;
|
|
96
93
|
}, function (props) {
|
|
97
94
|
return props.theme.colors.primary;
|
|
@@ -100,35 +97,35 @@ var OptionItem = _styledComponents.default.div(_templateObject22 || (_templateOb
|
|
|
100
97
|
});
|
|
101
98
|
}, function (_ref4) {
|
|
102
99
|
var isDragOver = _ref4.isDragOver;
|
|
103
|
-
return isDragOver && (0, _styledComponents.css)(
|
|
100
|
+
return isDragOver && (0, _styledComponents.css)(_templateObject23 || (_templateObject23 = _taggedTemplateLiteral(["\n border-top: 1px solid ", ";\n "])), function (props) {
|
|
104
101
|
return props.theme.colors.primary;
|
|
105
102
|
});
|
|
106
103
|
}, function (_ref5) {
|
|
107
104
|
var isBorderBottom = _ref5.isBorderBottom;
|
|
108
|
-
return isBorderBottom && (0, _styledComponents.css)(
|
|
105
|
+
return isBorderBottom && (0, _styledComponents.css)(_templateObject24 || (_templateObject24 = _taggedTemplateLiteral(["\n border-bottom: 1px solid ", ";\n "])), function (props) {
|
|
109
106
|
return props.theme.colors.primary;
|
|
110
107
|
});
|
|
111
108
|
});
|
|
112
109
|
exports.OptionItem = OptionItem;
|
|
113
|
-
var MinimumPurchase = _styledComponents.default.div(
|
|
110
|
+
var MinimumPurchase = _styledComponents.default.div(_templateObject25 || (_templateObject25 = _taggedTemplateLiteral(["\n min-width: 75px;\n ", "\n @media (min-width: 450px) {\n min-width: 80px;\n }\n"])), function (_ref6) {
|
|
114
111
|
var isHeader = _ref6.isHeader;
|
|
115
|
-
return isHeader ? (0, _styledComponents.css)(
|
|
112
|
+
return isHeader ? (0, _styledComponents.css)(_templateObject26 || (_templateObject26 = _taggedTemplateLiteral(["\n font-size: 12px;\n font-weight: 700;\n "]))) : (0, _styledComponents.css)(_templateObject27 || (_templateObject27 = _taggedTemplateLiteral(["\n font-size: 14px;\n "])));
|
|
116
113
|
});
|
|
117
114
|
exports.MinimumPurchase = MinimumPurchase;
|
|
118
|
-
var MaxPurchase = _styledComponents.default.div(
|
|
115
|
+
var MaxPurchase = _styledComponents.default.div(_templateObject28 || (_templateObject28 = _taggedTemplateLiteral(["\n min-width: 75px;\n ", "\n @media (min-width: 450px) {\n min-width: 80px;\n }\n"])), function (_ref7) {
|
|
119
116
|
var isHeader = _ref7.isHeader;
|
|
120
|
-
return isHeader ? (0, _styledComponents.css)(
|
|
117
|
+
return isHeader ? (0, _styledComponents.css)(_templateObject29 || (_templateObject29 = _taggedTemplateLiteral(["\n font-size: 12px;\n font-weight: 700;\n "]))) : (0, _styledComponents.css)(_templateObject30 || (_templateObject30 = _taggedTemplateLiteral(["\n font-size: 14px;\n "])));
|
|
121
118
|
});
|
|
122
119
|
exports.MaxPurchase = MaxPurchase;
|
|
123
|
-
var ArrowWrpper = _styledComponents.default.div(
|
|
120
|
+
var ArrowWrpper = _styledComponents.default.div(_templateObject31 || (_templateObject31 = _taggedTemplateLiteral(["\n width: 30px;\n display: flex;\n align-items: center;\n justify-content: flex-end;\n svg {\n font-size: 13px;\n color: ", ";\n margin: 0 5px;\n }\n"])), function (props) {
|
|
124
121
|
return props.theme.colors.secundaryLight;
|
|
125
122
|
});
|
|
126
123
|
exports.ArrowWrpper = ArrowWrpper;
|
|
127
|
-
var DragImageWrapper = _styledComponents.default.div(
|
|
128
|
-
var _props$
|
|
129
|
-
return (_props$
|
|
124
|
+
var DragImageWrapper = _styledComponents.default.div(_templateObject32 || (_templateObject32 = _taggedTemplateLiteral(["\n img {\n ", "\n &:hover {\n cursor: grab;\n }\n @media (min-width: 450px) {\n ", "\n }\n }\n"])), function (props) {
|
|
125
|
+
var _props$theme6;
|
|
126
|
+
return (_props$theme6 = props.theme) !== null && _props$theme6 !== void 0 && _props$theme6.rtl ? (0, _styledComponents.css)(_templateObject33 || (_templateObject33 = _taggedTemplateLiteral(["\n margin-left: 10px;\n "]))) : (0, _styledComponents.css)(_templateObject34 || (_templateObject34 = _taggedTemplateLiteral(["\n margin-right: 10px;\n "])));
|
|
130
127
|
}, function (props) {
|
|
131
|
-
var _props$
|
|
132
|
-
return (_props$
|
|
128
|
+
var _props$theme7;
|
|
129
|
+
return (_props$theme7 = props.theme) !== null && _props$theme7 !== void 0 && _props$theme7.rtl ? (0, _styledComponents.css)(_templateObject35 || (_templateObject35 = _taggedTemplateLiteral(["\n margin-left: 20px;\n "]))) : (0, _styledComponents.css)(_templateObject36 || (_templateObject36 = _taggedTemplateLiteral(["\n margin-right: 20px;\n "])));
|
|
133
130
|
});
|
|
134
131
|
exports.DragImageWrapper = DragImageWrapper;
|
|
@@ -35,12 +35,10 @@ function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
|
35
35
|
var ProductExtrasUI = function ProductExtrasUI(props) {
|
|
36
36
|
var productState = props.productState,
|
|
37
37
|
extrasState = props.extrasState,
|
|
38
|
-
changesState = props.changesState,
|
|
39
38
|
isAddMode = props.isAddMode,
|
|
40
39
|
handleOpenAddForm = props.handleOpenAddForm,
|
|
41
40
|
handleChangeExtraInput = props.handleChangeExtraInput,
|
|
42
41
|
handleAddExtra = props.handleAddExtra,
|
|
43
|
-
handleChangeAddExtraInput = props.handleChangeAddExtraInput,
|
|
44
42
|
setIsExtendExtraOpen = props.setIsExtendExtraOpen,
|
|
45
43
|
business = props.business,
|
|
46
44
|
handleUpdateBusinessState = props.handleUpdateBusinessState,
|
|
@@ -92,6 +90,10 @@ var ProductExtrasUI = function ProductExtrasUI(props) {
|
|
|
92
90
|
_useState12 = _slicedToArray(_useState11, 2),
|
|
93
91
|
isCheckboxClicked = _useState12[0],
|
|
94
92
|
setIsCheckboxClicked = _useState12[1];
|
|
93
|
+
var _useState13 = (0, _react.useState)(null),
|
|
94
|
+
_useState14 = _slicedToArray(_useState13, 2),
|
|
95
|
+
timer = _useState14[0],
|
|
96
|
+
setTimer = _useState14[1];
|
|
95
97
|
var handleOpenExtraDetails = function handleOpenExtraDetails(e, extra, isInitialRender) {
|
|
96
98
|
var _e$target, _e$target2;
|
|
97
99
|
if (e !== null && e !== void 0 && (_e$target = e.target) !== null && _e$target !== void 0 && _e$target.closest('.extra-checkbox') || e !== null && e !== void 0 && (_e$target2 = e.target) !== null && _e$target2 !== void 0 && _e$target2.closest('.draggable-dots')) return;
|
|
@@ -114,13 +116,6 @@ var ProductExtrasUI = function ProductExtrasUI(props) {
|
|
|
114
116
|
var section = query.get('section');
|
|
115
117
|
history.replace("".concat(location.pathname, "?category=").concat(category, "&product=").concat(product, "§ion=").concat(section));
|
|
116
118
|
};
|
|
117
|
-
var addExtraListener = function addExtraListener(e) {
|
|
118
|
-
var _conatinerRef$current;
|
|
119
|
-
var outsideDropdown = !((_conatinerRef$current = conatinerRef.current) !== null && _conatinerRef$current !== void 0 && _conatinerRef$current.contains(e.target));
|
|
120
|
-
if (outsideDropdown) {
|
|
121
|
-
handleAddExtra();
|
|
122
|
-
}
|
|
123
|
-
};
|
|
124
119
|
var handleExtraState = function handleExtraState(id, checked) {
|
|
125
120
|
if (checked) {
|
|
126
121
|
setExtraIds(function (prevState) {
|
|
@@ -135,6 +130,18 @@ var ProductExtrasUI = function ProductExtrasUI(props) {
|
|
|
135
130
|
}
|
|
136
131
|
setIsCheckboxClicked(true);
|
|
137
132
|
};
|
|
133
|
+
var onChangeAddExtraInput = function onChangeAddExtraInput(e) {
|
|
134
|
+
e.persist();
|
|
135
|
+
clearTimeout(timer);
|
|
136
|
+
var _timer = setTimeout(function () {
|
|
137
|
+
if (e.target.value) {
|
|
138
|
+
handleAddExtra({
|
|
139
|
+
name: e.target.value
|
|
140
|
+
});
|
|
141
|
+
}
|
|
142
|
+
}, 750);
|
|
143
|
+
setTimer(_timer);
|
|
144
|
+
};
|
|
138
145
|
(0, _react.useEffect)(function () {
|
|
139
146
|
var _productState$product;
|
|
140
147
|
var _extraIds = [];
|
|
@@ -151,13 +158,6 @@ var ProductExtrasUI = function ProductExtrasUI(props) {
|
|
|
151
158
|
setIsCheckboxClicked(false);
|
|
152
159
|
handleProductExtraState(extraIds);
|
|
153
160
|
}, [isCheckboxClicked, extraIds]);
|
|
154
|
-
(0, _react.useEffect)(function () {
|
|
155
|
-
if (!isAddMode) return;
|
|
156
|
-
document.addEventListener('click', addExtraListener);
|
|
157
|
-
return function () {
|
|
158
|
-
return document.removeEventListener('click', addExtraListener);
|
|
159
|
-
};
|
|
160
|
-
}, [isAddMode, changesState]);
|
|
161
161
|
(0, _react.useEffect)(function () {
|
|
162
162
|
var _productState$product3, _extrasState$extras;
|
|
163
163
|
if (productState !== null && productState !== void 0 && (_productState$product3 = productState.product) !== null && _productState$product3 !== void 0 && _productState$product3.error || extrasState !== null && extrasState !== void 0 && (_extrasState$extras = extrasState.extras) !== null && _extrasState$extras !== void 0 && _extrasState$extras.error) {
|
|
@@ -231,9 +231,10 @@ var ProductExtrasUI = function ProductExtrasUI(props) {
|
|
|
231
231
|
name: "name",
|
|
232
232
|
placeholder: t('WRITE_A_NAME', 'Write a name'),
|
|
233
233
|
onChange: function onChange(e) {
|
|
234
|
-
return
|
|
234
|
+
return onChangeAddExtraInput(e);
|
|
235
235
|
},
|
|
236
|
-
autoComplete: "off"
|
|
236
|
+
autoComplete: "off",
|
|
237
|
+
readOnly: extrasState === null || extrasState === void 0 ? void 0 : extrasState.loading
|
|
237
238
|
})), /*#__PURE__*/_react.default.createElement(_styles2.AddButtonWrapper, null, /*#__PURE__*/_react.default.createElement(_styles.LinkButton, {
|
|
238
239
|
onClick: function onClick() {
|
|
239
240
|
return handleOpenAddForm();
|
|
@@ -62,7 +62,7 @@ var Details = _styledComponents.default.div(_templateObject12 || (_templateObjec
|
|
|
62
62
|
exports.Details = Details;
|
|
63
63
|
var AddButtonWrapper = _styledComponents.default.div(_templateObject13 || (_templateObject13 = _taggedTemplateLiteral(["\n padding: 12px 0;\n"])));
|
|
64
64
|
exports.AddButtonWrapper = AddButtonWrapper;
|
|
65
|
-
var ExtraAddForm = _styledComponents.default.form(_templateObject14 || (_templateObject14 = _taggedTemplateLiteral(["\n display: flex;\n justify-content: space-between;\n align-items: center;\n\n input {\n width: 100%;\n border: none;\n outline: none;\n border-bottom: 1px solid ", ";\n background: ", ";\n padding: 12px 0;\n\n &::placeholder,\n &::-webkit-input-placeholder {\n color: #B1BCCC;\n }\n &:-ms-input-placeholder {\n color: #B1BCCC;\n }\n }\n"])), function (props) {
|
|
65
|
+
var ExtraAddForm = _styledComponents.default.form(_templateObject14 || (_templateObject14 = _taggedTemplateLiteral(["\n display: flex;\n justify-content: space-between;\n align-items: center;\n\n input {\n width: 100%;\n border: none;\n outline: none;\n border-bottom: 1px solid ", ";\n background: ", ";\n padding: 12px 0;\n\n &::placeholder,\n &::-webkit-input-placeholder {\n color: #B1BCCC;\n }\n &:-ms-input-placeholder {\n color: #B1BCCC;\n }\n &:read-only {\n background-color: #F8F9FA;\n cursor: not-allowed;\n }\n }\n"])), function (props) {
|
|
66
66
|
return props.theme.colors.borderColor;
|
|
67
67
|
}, function (props) {
|
|
68
68
|
var _props$theme$colors;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "ordering-ui-admin-external",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.28.1",
|
|
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.
|
|
86
|
+
"ordering-components-admin-external": "1.28.2",
|
|
87
87
|
"polished": "^3.6.7",
|
|
88
88
|
"prop-types": "^15.7.2",
|
|
89
89
|
"react-big-calendar": "^1.4.2",
|
|
@@ -50,7 +50,7 @@ export const AnalyticsOrdersStatus = (props) => {
|
|
|
50
50
|
const generateLabels = () => {
|
|
51
51
|
const labels = [t('ALL', 'All')]
|
|
52
52
|
for (const label of orderStatusList?.data) {
|
|
53
|
-
labels.push(orderStatus[label.status]
|
|
53
|
+
labels.push(orderStatus?.[label.status]?.value)
|
|
54
54
|
}
|
|
55
55
|
return labels
|
|
56
56
|
}
|
|
@@ -194,18 +194,11 @@ const BusinessAnalyticsUI = (props) => {
|
|
|
194
194
|
onClose={() => setIsBrandFilter(false)}
|
|
195
195
|
/>
|
|
196
196
|
</Modal>
|
|
197
|
-
<
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
onClose={() => setOpenCountryFilter(false)}
|
|
203
|
-
>
|
|
204
|
-
<CountryFilter
|
|
205
|
-
{...props}
|
|
206
|
-
onClose={() => setOpenCountryFilter(false)}
|
|
207
|
-
/>
|
|
208
|
-
</Modal>
|
|
197
|
+
<CountryFilter
|
|
198
|
+
{...props}
|
|
199
|
+
openCountryFilter={openCountryFilter}
|
|
200
|
+
setOpenCountryFilter={setOpenCountryFilter}
|
|
201
|
+
/>
|
|
209
202
|
</BusinessAnalyticsContainer>
|
|
210
203
|
)
|
|
211
204
|
}
|
|
@@ -2,7 +2,7 @@ import React, { useState, useEffect } from 'react'
|
|
|
2
2
|
import { useLanguage, CountryList } from 'ordering-components-admin-external'
|
|
3
3
|
import { Button } from '../../../styles'
|
|
4
4
|
import Skeleton from 'react-loading-skeleton'
|
|
5
|
-
import { SearchBar, Pagination } from '../../Shared'
|
|
5
|
+
import { SearchBar, Pagination, Modal } from '../../Shared'
|
|
6
6
|
import { RecordCircleFill, Circle } from 'react-bootstrap-icons'
|
|
7
7
|
import {
|
|
8
8
|
Container,
|
|
@@ -20,7 +20,10 @@ const CountryFilterUI = (props) => {
|
|
|
20
20
|
onSearch,
|
|
21
21
|
handleClickFilterButton,
|
|
22
22
|
code,
|
|
23
|
-
|
|
23
|
+
openCountryFilter,
|
|
24
|
+
setOpenCountryFilter,
|
|
25
|
+
setCode,
|
|
26
|
+
actionState
|
|
24
27
|
} = props
|
|
25
28
|
|
|
26
29
|
const [, t] = useLanguage()
|
|
@@ -58,61 +61,73 @@ const CountryFilterUI = (props) => {
|
|
|
58
61
|
|
|
59
62
|
return (
|
|
60
63
|
<>
|
|
61
|
-
|
|
62
|
-
<
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
onSearch={(value) => onSearch(value)}
|
|
69
|
-
placeholder={t('SEARCH', 'Search')}
|
|
70
|
-
/>
|
|
71
|
-
</SearchWrapper>
|
|
72
|
-
<CountryListWrapper>
|
|
73
|
-
{countriesState?.loading ? (
|
|
74
|
-
<>
|
|
75
|
-
{[...Array(10).keys()].map(i => (
|
|
76
|
-
<CountryItem
|
|
77
|
-
key={i}
|
|
78
|
-
>
|
|
79
|
-
<Skeleton width={18} height={18} circle />
|
|
80
|
-
<Skeleton width={200} height={20} style={{ marginLeft: 10 }} />
|
|
81
|
-
</CountryItem>
|
|
82
|
-
))}
|
|
83
|
-
</>
|
|
84
|
-
) : (
|
|
85
|
-
<>
|
|
86
|
-
{currentPages?.map(country => (
|
|
87
|
-
<CountryItem key={country?.id} onClick={() => setCode(country?.code)}>
|
|
88
|
-
{code === country?.code ? <RecordCircleFill className='checked' /> : <Circle />}
|
|
89
|
-
<span className='name'>{country?.name}</span>
|
|
90
|
-
</CountryItem>
|
|
91
|
-
))}
|
|
92
|
-
</>
|
|
93
|
-
)}
|
|
94
|
-
</CountryListWrapper>
|
|
95
|
-
<PaginationWrapper>
|
|
96
|
-
{countriesState?.countries?.length > 0 && (
|
|
97
|
-
<Pagination
|
|
98
|
-
currentPage={currentPage}
|
|
99
|
-
totalPages={totalPages}
|
|
100
|
-
handleChangePage={handleChangePage}
|
|
101
|
-
defaultPageSize={pagesPerPage}
|
|
102
|
-
handleChangePageSize={handleChangePageSize}
|
|
103
|
-
/>
|
|
104
|
-
)}
|
|
105
|
-
</PaginationWrapper>
|
|
106
|
-
</Container>
|
|
107
|
-
<ButtonWrapper>
|
|
108
|
-
<Button
|
|
109
|
-
color='primary'
|
|
110
|
-
disabled={countriesState.loading}
|
|
111
|
-
onClick={handleClickFilterButton}
|
|
64
|
+
{!countriesState?.loading && currentPages?.length > 0 && (
|
|
65
|
+
<Modal
|
|
66
|
+
width='450px'
|
|
67
|
+
height='650px'
|
|
68
|
+
padding='25px'
|
|
69
|
+
open={openCountryFilter}
|
|
70
|
+
onClose={() => setOpenCountryFilter(false)}
|
|
112
71
|
>
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
72
|
+
<>
|
|
73
|
+
<Container>
|
|
74
|
+
<h2>{t('CHOOSE_A_COUNTRY', 'Choose a country')}</h2>
|
|
75
|
+
<SearchWrapper>
|
|
76
|
+
<SearchBar
|
|
77
|
+
search={searchValue}
|
|
78
|
+
isCustomLayout
|
|
79
|
+
lazyLoad
|
|
80
|
+
onSearch={(value) => onSearch(value)}
|
|
81
|
+
placeholder={t('SEARCH', 'Search')}
|
|
82
|
+
/>
|
|
83
|
+
</SearchWrapper>
|
|
84
|
+
<CountryListWrapper>
|
|
85
|
+
{actionState?.loading ? (
|
|
86
|
+
<>
|
|
87
|
+
{[...Array(10).keys()].map(i => (
|
|
88
|
+
<CountryItem
|
|
89
|
+
key={i}
|
|
90
|
+
>
|
|
91
|
+
<Skeleton width={18} height={18} circle />
|
|
92
|
+
<Skeleton width={200} height={20} style={{ marginLeft: 10 }} />
|
|
93
|
+
</CountryItem>
|
|
94
|
+
))}
|
|
95
|
+
</>
|
|
96
|
+
) : (
|
|
97
|
+
<>
|
|
98
|
+
{currentPages?.map(country => (
|
|
99
|
+
<CountryItem key={country?.id} onClick={() => setCode(country?.code)}>
|
|
100
|
+
{code === country?.code ? <RecordCircleFill className='checked' /> : <Circle />}
|
|
101
|
+
<span className='name'>{country?.name}</span>
|
|
102
|
+
</CountryItem>
|
|
103
|
+
))}
|
|
104
|
+
</>
|
|
105
|
+
)}
|
|
106
|
+
</CountryListWrapper>
|
|
107
|
+
<PaginationWrapper>
|
|
108
|
+
{countriesState?.countries?.length > 0 && (
|
|
109
|
+
<Pagination
|
|
110
|
+
currentPage={currentPage}
|
|
111
|
+
totalPages={totalPages}
|
|
112
|
+
handleChangePage={handleChangePage}
|
|
113
|
+
defaultPageSize={pagesPerPage}
|
|
114
|
+
handleChangePageSize={handleChangePageSize}
|
|
115
|
+
/>
|
|
116
|
+
)}
|
|
117
|
+
</PaginationWrapper>
|
|
118
|
+
</Container>
|
|
119
|
+
<ButtonWrapper>
|
|
120
|
+
<Button
|
|
121
|
+
color='primary'
|
|
122
|
+
disabled={countriesState.loading}
|
|
123
|
+
onClick={handleClickFilterButton}
|
|
124
|
+
>
|
|
125
|
+
{t('FILTER', 'Filter')}
|
|
126
|
+
</Button>
|
|
127
|
+
</ButtonWrapper>
|
|
128
|
+
</>
|
|
129
|
+
</Modal>
|
|
130
|
+
)}
|
|
116
131
|
</>
|
|
117
132
|
|
|
118
133
|
)
|
|
@@ -122,6 +137,7 @@ export const CountryFilter = (props) => {
|
|
|
122
137
|
const countryFilterProps = {
|
|
123
138
|
...props,
|
|
124
139
|
UIComponent: CountryFilterUI,
|
|
140
|
+
onClose: () => props.setOpenCountryFilter(false),
|
|
125
141
|
isSearchByName: true
|
|
126
142
|
}
|
|
127
143
|
return <CountryList {...countryFilterProps} />
|