ordering-ui-admin-external 1.1.1 → 1.3.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (182) hide show
  1. package/_bundles/main.css +2868 -1994
  2. package/_bundles/{ordering-ui-admin.2a3c1a73c2eac0c338db.js → ordering-ui-admin.977451ddd1e3c8d3a2d7.js} +2 -2
  3. package/_bundles/{ordering-ui-admin.2a3c1a73c2eac0c338db.js.LICENSE.txt → ordering-ui-admin.977451ddd1e3c8d3a2d7.js.LICENSE.txt} +10 -4
  4. package/_modules/components/BusinessIntelligence/AnalyticsProductCategories/index.js +1 -1
  5. package/_modules/components/BusinessIntelligence/Reports/index.js +27 -3
  6. package/_modules/components/BusinessIntelligence/Reports/styles.js +9 -2
  7. package/_modules/components/BusinessIntelligence/ReviewsListing/index.js +9 -1
  8. package/_modules/components/DisabledFeatureAlert/index.js +63 -0
  9. package/_modules/components/DisabledFeatureAlert/styles.js +42 -0
  10. package/_modules/components/Loyalty/RewardsPrograms/index.js +38 -12
  11. package/_modules/components/Loyalty/RewardsPrograms/styles.js +13 -6
  12. package/_modules/components/Marketing/CampaignHeader/index.js +5 -2
  13. package/_modules/components/Marketing/CampaignHeader/styles.js +7 -4
  14. package/_modules/components/Marketing/CampaignList/index.js +8 -4
  15. package/_modules/components/Marketing/CampaignList/styles.js +30 -22
  16. package/_modules/components/Marketing/CampaignListing/index.js +29 -3
  17. package/_modules/components/Marketing/EnterprisePromotionConditions/index.js +7 -2
  18. package/_modules/components/Marketing/EnterprisePromotionList/index.js +8 -4
  19. package/_modules/components/Marketing/EnterprisePromotionList/styles.js +36 -26
  20. package/_modules/components/Marketing/EnterprisePromotionListing/index.js +46 -22
  21. package/_modules/components/Marketing/EnterprisePromotionListing/styles.js +1 -1
  22. package/_modules/components/OrderingProducts/OrderingProductDetails/index.js +24 -426
  23. package/_modules/components/OrderingProducts/OrderingProductDetails/styles.js +35 -114
  24. package/_modules/components/OrderingProducts/OrderingProductGeneralDetails/index.js +480 -0
  25. package/_modules/components/OrderingProducts/OrderingProductGeneralDetails/styles.js +127 -0
  26. package/_modules/components/OrderingProducts/OrderingProductsListing/index.js +3 -1
  27. package/_modules/components/OrderingProducts/OrderingProductsListing/styles.js +23 -3
  28. package/_modules/components/OrderingProducts/SiteTheme/ThemeComponent.js +119 -0
  29. package/_modules/components/OrderingProducts/SiteTheme/ThemeImage.js +267 -0
  30. package/_modules/components/OrderingProducts/SiteTheme/ThemeOption.js +135 -0
  31. package/_modules/components/OrderingProducts/SiteTheme/index.js +266 -0
  32. package/_modules/components/OrderingProducts/SiteTheme/styles.js +114 -0
  33. package/_modules/components/Orders/Appointments/CalendarHeader.js +103 -0
  34. package/_modules/components/Orders/Appointments/EventComponent.js +63 -0
  35. package/_modules/components/Orders/Appointments/index.js +174 -0
  36. package/_modules/components/Orders/Appointments/styles.js +88 -0
  37. package/_modules/components/Orders/CountryFilter/index.js +114 -0
  38. package/_modules/components/Orders/CountryFilter/styles.js +34 -0
  39. package/_modules/components/Orders/CurrencyFilter/index.js +114 -0
  40. package/_modules/components/Orders/CurrencyFilter/styles.js +34 -0
  41. package/_modules/components/Orders/DeliveriesLocation/index.js +22 -12
  42. package/_modules/components/Orders/DriversLocation/index.js +13 -7
  43. package/_modules/components/Orders/OrderContactInformation/index.js +3 -2
  44. package/_modules/components/Orders/OrderDetails/index.js +4 -1
  45. package/_modules/components/Orders/OrderDetailsHeader/index.js +4 -3
  46. package/_modules/components/Orders/OrderDetailsHeader/styles.js +1 -1
  47. package/_modules/components/Orders/OrdersFilterGroup/index.js +13 -1
  48. package/_modules/components/Orders/OrdersListing/index.js +8 -2
  49. package/_modules/components/Orders/OrdersTable/index.js +296 -174
  50. package/_modules/components/Orders/OrdersTable/styles.js +30 -4
  51. package/_modules/components/Orders/index.js +17 -1
  52. package/_modules/components/Settings/SettingItemUI/index.js +3 -1
  53. package/_modules/components/Settings/SettingItemUI/styles.js +18 -11
  54. package/_modules/components/Settings/Settings/index.js +1 -11
  55. package/_modules/components/Settings/SettingsDetail/index.js +40 -3
  56. package/_modules/components/Settings/SettingsDetail/styles.js +27 -8
  57. package/_modules/components/Settings/SettingsList/index.js +43 -6
  58. package/_modules/components/Shared/ColorPicker/styles.js +3 -1
  59. package/_modules/components/Shared/ColumnAllowSettingPopover/index.js +4 -2
  60. package/_modules/components/Shared/SearchBar/index.js +4 -2
  61. package/_modules/components/SidebarMenu/index.js +32 -16
  62. package/_modules/components/SidebarMenu/styles.js +19 -9
  63. package/_modules/components/Stores/BusinessMenu/index.js +36 -5
  64. package/_modules/components/Stores/BusinessMenu/styles.js +27 -16
  65. package/_modules/components/Stores/BusinessMenuOptions/styles.js +9 -4
  66. package/_modules/components/Stores/BusinessPaymentMethods/index.js +53 -16
  67. package/_modules/components/Stores/BusinessProductList/index.js +7 -10
  68. package/_modules/components/Stores/BusinessProductsCategories/index.js +2 -2
  69. package/_modules/components/Stores/BusinessProductsListing/index.js +44 -21
  70. package/_modules/components/Stores/BusinessProductsListing/styles.js +20 -16
  71. package/_modules/components/Stores/BusinessesListing/index.js +4 -1
  72. package/_modules/components/Stores/BusinessesListingHeader/index.js +20 -3
  73. package/_modules/components/Stores/BusinessesListingHeader/styles.js +6 -2
  74. package/_modules/components/Stores/ImportersList/index.js +5 -2
  75. package/_modules/components/Stores/ImportersList/styles.js +18 -15
  76. package/_modules/components/Stores/ImportersListing/index.js +31 -4
  77. package/_modules/components/Stores/PaymentOption/index.js +12 -7
  78. package/_modules/components/Stores/PaymentOption/styles.js +9 -4
  79. package/_modules/components/Stores/PaymentOptionMethods/index.js +9 -4
  80. package/_modules/components/Stores/PaymentOptionMethods/styles.js +10 -5
  81. package/_modules/components/Stores/PaymentOptionPaypal/index.js +9 -4
  82. package/_modules/components/Stores/PaymentOptionSquare/index.js +10 -5
  83. package/_modules/components/Stores/PaymentOptionStripeDirect/index.js +10 -5
  84. package/_modules/components/Stores/PaymentOptionStripeDirect/styles.js +10 -5
  85. package/_modules/components/Stores/PaymethodOptionPaypalExpress/index.js +9 -4
  86. package/_modules/components/Stores/PaymethodOptionStripeConnect/index.js +9 -4
  87. package/_modules/components/Stores/PaymethodOptionStripeRedirect/index.js +9 -4
  88. package/_modules/components/Users/UsersList/index.js +8 -2
  89. package/_modules/components/Users/UsersList/styles.js +15 -12
  90. package/_modules/index.js +6 -0
  91. package/package.json +3 -2
  92. package/src/components/BusinessIntelligence/AnalyticsProductCategories/index.js +1 -1
  93. package/src/components/BusinessIntelligence/Reports/index.js +18 -4
  94. package/src/components/BusinessIntelligence/Reports/styles.js +11 -0
  95. package/src/components/BusinessIntelligence/ReviewsListing/index.js +12 -0
  96. package/src/components/DisabledFeatureAlert/index.js +37 -0
  97. package/src/components/DisabledFeatureAlert/styles.js +32 -0
  98. package/src/components/Loyalty/RewardsPrograms/index.js +18 -5
  99. package/src/components/Loyalty/RewardsPrograms/styles.js +10 -0
  100. package/src/components/Marketing/CampaignHeader/index.js +3 -2
  101. package/src/components/Marketing/CampaignHeader/styles.js +8 -0
  102. package/src/components/Marketing/CampaignList/index.js +5 -3
  103. package/src/components/Marketing/CampaignList/styles.js +16 -0
  104. package/src/components/Marketing/CampaignListing/index.js +18 -2
  105. package/src/components/Marketing/EnterprisePromotionConditions/index.js +2 -1
  106. package/src/components/Marketing/EnterprisePromotionList/index.js +5 -3
  107. package/src/components/Marketing/EnterprisePromotionList/styles.js +12 -2
  108. package/src/components/Marketing/EnterprisePromotionListing/index.js +17 -4
  109. package/src/components/Marketing/EnterprisePromotionListing/styles.js +5 -1
  110. package/src/components/OrderingProducts/OrderingProductDetails/index.js +34 -497
  111. package/src/components/OrderingProducts/OrderingProductDetails/styles.js +38 -288
  112. package/src/components/OrderingProducts/OrderingProductGeneralDetails/index.js +514 -0
  113. package/src/components/OrderingProducts/OrderingProductGeneralDetails/styles.js +279 -0
  114. package/src/components/OrderingProducts/OrderingProductsListing/index.js +14 -2
  115. package/src/components/OrderingProducts/OrderingProductsListing/styles.js +62 -0
  116. package/src/components/OrderingProducts/SiteTheme/ThemeComponent.js +104 -0
  117. package/src/components/OrderingProducts/SiteTheme/ThemeImage.js +151 -0
  118. package/src/components/OrderingProducts/SiteTheme/ThemeOption.js +118 -0
  119. package/src/components/OrderingProducts/SiteTheme/index.js +221 -0
  120. package/src/components/OrderingProducts/SiteTheme/styles.js +160 -0
  121. package/src/components/Orders/Appointments/CalendarHeader.js +74 -0
  122. package/src/components/Orders/Appointments/EventComponent.js +40 -0
  123. package/src/components/Orders/Appointments/index.js +135 -0
  124. package/src/components/Orders/Appointments/styles.js +192 -0
  125. package/src/components/Orders/CountryFilter/index.js +68 -0
  126. package/src/components/Orders/CountryFilter/styles.js +29 -0
  127. package/src/components/Orders/CurrencyFilter/index.js +68 -0
  128. package/src/components/Orders/CurrencyFilter/styles.js +29 -0
  129. package/src/components/Orders/DeliveriesLocation/index.js +60 -8
  130. package/src/components/Orders/DriversLocation/index.js +32 -4
  131. package/src/components/Orders/OrderContactInformation/index.js +3 -2
  132. package/src/components/Orders/OrderDetails/index.js +4 -1
  133. package/src/components/Orders/OrderDetailsHeader/index.js +31 -26
  134. package/src/components/Orders/OrderDetailsHeader/styles.js +1 -1
  135. package/src/components/Orders/OrdersFilterGroup/index.js +15 -1
  136. package/src/components/Orders/OrdersListing/index.js +8 -1
  137. package/src/components/Orders/OrdersTable/index.js +297 -252
  138. package/src/components/Orders/OrdersTable/styles.js +33 -0
  139. package/src/components/Orders/index.js +5 -1
  140. package/src/components/Settings/SettingItemUI/index.js +2 -1
  141. package/src/components/Settings/SettingItemUI/styles.js +5 -0
  142. package/src/components/Settings/Settings/index.js +0 -11
  143. package/src/components/Settings/SettingsDetail/index.js +23 -4
  144. package/src/components/Settings/SettingsDetail/styles.js +9 -2
  145. package/src/components/Settings/SettingsList/index.js +30 -3
  146. package/src/components/Shared/ColorPicker/styles.js +1 -0
  147. package/src/components/Shared/ColumnAllowSettingPopover/index.js +2 -2
  148. package/src/components/Shared/SearchBar/index.js +3 -2
  149. package/src/components/SidebarMenu/index.js +29 -8
  150. package/src/components/SidebarMenu/styles.js +13 -0
  151. package/src/components/Stores/BusinessMenu/index.js +21 -3
  152. package/src/components/Stores/BusinessMenu/styles.js +19 -0
  153. package/src/components/Stores/BusinessMenuOptions/styles.js +6 -0
  154. package/src/components/Stores/BusinessPaymentMethods/index.js +62 -32
  155. package/src/components/Stores/BusinessProductList/index.js +2 -1
  156. package/src/components/Stores/BusinessProductsCategories/index.js +2 -2
  157. package/src/components/Stores/BusinessProductsListing/index.js +18 -4
  158. package/src/components/Stores/BusinessProductsListing/styles.js +40 -10
  159. package/src/components/Stores/BusinessesListing/index.js +3 -0
  160. package/src/components/Stores/BusinessesListingHeader/index.js +15 -3
  161. package/src/components/Stores/BusinessesListingHeader/styles.js +38 -0
  162. package/src/components/Stores/ImportersList/index.js +3 -2
  163. package/src/components/Stores/ImportersList/styles.js +8 -1
  164. package/src/components/Stores/ImportersListing/index.js +25 -1
  165. package/src/components/Stores/PaymentOption/index.js +9 -5
  166. package/src/components/Stores/PaymentOption/styles.js +8 -0
  167. package/src/components/Stores/PaymentOptionMethods/index.js +8 -3
  168. package/src/components/Stores/PaymentOptionMethods/styles.js +8 -0
  169. package/src/components/Stores/PaymentOptionPaypal/index.js +8 -3
  170. package/src/components/Stores/PaymentOptionSquare/index.js +183 -176
  171. package/src/components/Stores/PaymentOptionStripeDirect/index.js +8 -3
  172. package/src/components/Stores/PaymentOptionStripeDirect/styles.js +8 -0
  173. package/src/components/Stores/PaymethodOptionPaypalExpress/index.js +8 -3
  174. package/src/components/Stores/PaymethodOptionStripeConnect/index.js +8 -3
  175. package/src/components/Stores/PaymethodOptionStripeRedirect/index.js +8 -3
  176. package/src/components/Users/UsersList/index.js +10 -1
  177. package/src/components/Users/UsersList/styles.js +9 -0
  178. package/src/index.js +2 -0
  179. package/template/app.js +12 -8
  180. package/template/components/ListenPageChanges/index.js +1 -0
  181. package/template/helmetdata.json +7 -0
  182. package/template/pages/Appointments/index.js +12 -0
@@ -62,7 +62,7 @@ function _iterableToArrayLimit(arr, i) { var _i = arr == null ? null : typeof Sy
62
62
  function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
63
63
 
64
64
  var OrdersTable = function OrdersTable(props) {
65
- var _configState$configs, _configState$configs$, _configState$configs2, _configState$configs3, _orderList$orders3;
65
+ var _orderList$orders3;
66
66
 
67
67
  var isSelectedOrders = props.isSelectedOrders,
68
68
  orderList = props.orderList,
@@ -78,7 +78,10 @@ var OrdersTable = function OrdersTable(props) {
78
78
  handleOpenTour = props.handleOpenTour,
79
79
  setIsTourOpen = props.setIsTourOpen,
80
80
  slaSettingTime = props.slaSettingTime,
81
- groupStatus = props.groupStatus;
81
+ groupStatus = props.groupStatus,
82
+ allowColumns = props.allowColumns,
83
+ setAllowColumns = props.setAllowColumns,
84
+ handleDrop = props.handleDrop;
82
85
 
83
86
  var _useLanguage = (0, _orderingComponentsAdminExternal.useLanguage)(),
84
87
  _useLanguage2 = _slicedToArray(_useLanguage, 2),
@@ -89,7 +92,6 @@ var OrdersTable = function OrdersTable(props) {
89
92
  var _useUtils = (0, _orderingComponentsAdminExternal.useUtils)(),
90
93
  _useUtils2 = _slicedToArray(_useUtils, 1),
91
94
  _useUtils2$ = _useUtils2[0],
92
- parsePrice = _useUtils2$.parsePrice,
93
95
  parseDate = _useUtils2$.parseDate,
94
96
  optimizeImage = _useUtils2$.optimizeImage,
95
97
  getTimeAgo = _useUtils2$.getTimeAgo;
@@ -103,6 +105,11 @@ var OrdersTable = function OrdersTable(props) {
103
105
  _useState4 = _slicedToArray(_useState3, 2),
104
106
  setCurrentTime = _useState4[1];
105
107
 
108
+ var _useState5 = (0, _react.useState)(''),
109
+ _useState6 = _slicedToArray(_useState5, 2),
110
+ dragOverd = _useState6[0],
111
+ setDragOverd = _useState6[1];
112
+
106
113
  var handleChangePage = function handleChangePage(page) {
107
114
  getPageOrders(pagination.pageSize, page);
108
115
  };
@@ -116,22 +123,6 @@ var OrdersTable = function OrdersTable(props) {
116
123
  _useConfig2 = _slicedToArray(_useConfig, 1),
117
124
  configState = _useConfig2[0];
118
125
 
119
- var _useState5 = (0, _react.useState)({
120
- status: true,
121
- orderNumber: true,
122
- dateTime: true,
123
- business: true,
124
- customer: true,
125
- driver: true,
126
- advanced: true,
127
- timer: (configState === null || configState === void 0 ? void 0 : (_configState$configs = configState.configs) === null || _configState$configs === void 0 ? void 0 : (_configState$configs$ = _configState$configs.order_deadlines_enabled) === null || _configState$configs$ === void 0 ? void 0 : _configState$configs$.value) === '1',
128
- slaBar: (configState === null || configState === void 0 ? void 0 : (_configState$configs2 = configState.configs) === null || _configState$configs2 === void 0 ? void 0 : (_configState$configs3 = _configState$configs2.order_deadlines_enabled) === null || _configState$configs3 === void 0 ? void 0 : _configState$configs3.value) === '1',
129
- total: true
130
- }),
131
- _useState6 = _slicedToArray(_useState5, 2),
132
- allowColumns = _useState6[0],
133
- setAllowColumns = _useState6[1];
134
-
135
126
  var optionsDefault = [{
136
127
  value: 'status',
137
128
  content: t('STATUS', 'Status')
@@ -192,10 +183,10 @@ var OrdersTable = function OrdersTable(props) {
192
183
  };
193
184
 
194
185
  var getStatusClassName = function getStatusClassName(minutes) {
195
- var _configState$configs4, _configState$configs5;
186
+ var _configState$configs, _configState$configs$;
196
187
 
197
188
  if (isNaN(Number(minutes))) return 'in_time';
198
- var delayTime = configState === null || configState === void 0 ? void 0 : (_configState$configs4 = configState.configs) === null || _configState$configs4 === void 0 ? void 0 : (_configState$configs5 = _configState$configs4.order_deadlines_delayed_time) === null || _configState$configs5 === void 0 ? void 0 : _configState$configs5.value;
189
+ var delayTime = configState === null || configState === void 0 ? void 0 : (_configState$configs = configState.configs) === null || _configState$configs === void 0 ? void 0 : (_configState$configs$ = _configState$configs.order_deadlines_delayed_time) === null || _configState$configs$ === void 0 ? void 0 : _configState$configs$.value;
199
190
  return minutes > 0 ? 'in_time' : Math.abs(minutes) <= delayTime ? 'at_risk' : 'delayed';
200
191
  };
201
192
 
@@ -333,7 +324,10 @@ var OrdersTable = function OrdersTable(props) {
333
324
  };
334
325
 
335
326
  var handleChangeAllowColumns = function handleChangeAllowColumns(type) {
336
- setAllowColumns(_objectSpread(_objectSpread({}, allowColumns), {}, _defineProperty({}, type, !allowColumns[type])));
327
+ var _column = allowColumns[type];
328
+ setAllowColumns(_objectSpread(_objectSpread({}, allowColumns), {}, _defineProperty({}, type, _objectSpread(_objectSpread({}, _column), {}, {
329
+ visable: !(_column !== null && _column !== void 0 && _column.visable)
330
+ }))));
337
331
  };
338
332
 
339
333
  var handleClickOrder = function handleClickOrder(order, e) {
@@ -359,6 +353,44 @@ var OrdersTable = function OrdersTable(props) {
359
353
  setSelectedOrderIds(updatedSelectedOrderIds);
360
354
  }
361
355
  };
356
+ /**
357
+ * Method to handle drag start
358
+ */
359
+
360
+
361
+ var handleDragStart = function handleDragStart(event, columnName) {
362
+ var _allowColumns$columnN;
363
+
364
+ event.dataTransfer.setData('transferColumnName', columnName);
365
+ var ghostEle = document.createElement('div');
366
+ ghostEle.classList.add('ghostDragging');
367
+ ghostEle.innerHTML = (_allowColumns$columnN = allowColumns[columnName]) === null || _allowColumns$columnN === void 0 ? void 0 : _allowColumns$columnN.title;
368
+ document.body.appendChild(ghostEle);
369
+ event.dataTransfer.setDragImage(ghostEle, 0, 0);
370
+ };
371
+ /**
372
+ * Method to handle drag over
373
+ */
374
+
375
+
376
+ var handleDragOver = function handleDragOver(event, columnName) {
377
+ event.preventDefault();
378
+ setDragOverd(columnName);
379
+ };
380
+ /**
381
+ * Method to handle drag end
382
+ */
383
+
384
+
385
+ var handleDragEnd = function handleDragEnd() {
386
+ var elements = document.getElementsByClassName('ghostDragging');
387
+
388
+ while (elements.length > 0) {
389
+ elements[0].parentNode.removeChild(elements[0]);
390
+ }
391
+
392
+ setDragOverd('');
393
+ };
362
394
 
363
395
  (0, _react.useEffect)(function () {
364
396
  var _orderList$orders2;
@@ -389,22 +421,6 @@ var OrdersTable = function OrdersTable(props) {
389
421
  return document.removeEventListener('keydown', handleChangeKeyboard);
390
422
  };
391
423
  }, [isTourOpen, currentTourStep]);
392
- (0, _react.useEffect)(function () {
393
- if (groupStatus === 'completed' || groupStatus === 'cancelled') {
394
- setAllowColumns(_objectSpread(_objectSpread({}, allowColumns), {}, {
395
- timer: false
396
- }));
397
- }
398
- }, [groupStatus]);
399
- (0, _react.useEffect)(function () {
400
- var _configState$configs6, _configState$configs7;
401
-
402
- var slaSettings = (configState === null || configState === void 0 ? void 0 : (_configState$configs6 = configState.configs) === null || _configState$configs6 === void 0 ? void 0 : (_configState$configs7 = _configState$configs6.order_deadlines_enabled) === null || _configState$configs7 === void 0 ? void 0 : _configState$configs7.value) === '1';
403
- setAllowColumns(_objectSpread(_objectSpread({}, allowColumns), {}, {
404
- timer: slaSettings,
405
- slaBar: slaSettings
406
- }));
407
- }, [configState.loading]);
408
424
  return /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, /*#__PURE__*/_react.default.createElement(_styles.OrdersContainer, {
409
425
  id: "orderTable",
410
426
  isSelectedOrders: isSelectedOrders,
@@ -412,39 +428,79 @@ var OrdersTable = function OrdersTable(props) {
412
428
  }, /*#__PURE__*/_react.default.createElement(_styles.Table, {
413
429
  className: "orders_table",
414
430
  noFixedHeader: !orderList.loading && ((_orderList$orders3 = orderList.orders) === null || _orderList$orders3 === void 0 ? void 0 : _orderList$orders3.length) <= 5
415
- }, !isSelectedOrders && /*#__PURE__*/_react.default.createElement("thead", null, /*#__PURE__*/_react.default.createElement("tr", null, (allowColumns === null || allowColumns === void 0 ? void 0 : allowColumns.slaBar) && /*#__PURE__*/_react.default.createElement("th", null, /*#__PURE__*/_react.default.createElement(_styles.Timestatus, null)), /*#__PURE__*/_react.default.createElement("th", {
416
- className: !(allowColumns !== null && allowColumns !== void 0 && allowColumns.orderNumber || allowColumns !== null && allowColumns !== void 0 && allowColumns.dateTime) ? 'orderNo small' : 'orderNo'
417
- }, /*#__PURE__*/_react.default.createElement(_styles.CheckBox, {
418
- isChecked: !orderList.loading && isAllChecked,
419
- onClick: function onClick() {
420
- return handleSelecteAllOrder();
421
- },
422
- className: "orderCheckBox"
423
- }, !orderList.loading && isAllChecked ? /*#__PURE__*/_react.default.createElement(_RiCheckboxFill.default, null) : /*#__PURE__*/_react.default.createElement(_RiCheckboxBlankLine.default, null)), t('ORDER', 'Order')), (allowColumns === null || allowColumns === void 0 ? void 0 : allowColumns.status) && /*#__PURE__*/_react.default.createElement("th", {
424
- className: "statusInfo"
425
- }, t('STATUS', 'Status')), (allowColumns === null || allowColumns === void 0 ? void 0 : allowColumns.business) && /*#__PURE__*/_react.default.createElement("th", {
426
- className: "businessInfo"
427
- }, t('BUSINESS', 'Business')), (allowColumns === null || allowColumns === void 0 ? void 0 : allowColumns.customer) && /*#__PURE__*/_react.default.createElement("th", {
428
- className: "customerInfo"
429
- }, t('CUSTOMER', 'Customer')), (allowColumns === null || allowColumns === void 0 ? void 0 : allowColumns.driver) && /*#__PURE__*/_react.default.createElement("th", {
430
- className: "driverInfo"
431
- }, t('DRIVER', 'Driver')), (allowColumns === null || allowColumns === void 0 ? void 0 : allowColumns.advanced) && /*#__PURE__*/_react.default.createElement("th", {
432
- colSpan: "3",
433
- className: "advanced"
434
- }, t('ADVANCED_LOGISTICS', 'Advanced logistics')), (allowColumns === null || allowColumns === void 0 ? void 0 : allowColumns.timer) && (groupStatus === 'pending' || groupStatus === 'inProgress') && /*#__PURE__*/_react.default.createElement("th", {
435
- colSpan: "2",
436
- className: "timer"
437
- }, t('SLA_TIMER', 'SLA’s timer')), /*#__PURE__*/_react.default.createElement("th", {
438
- className: "orderPrice"
439
- }, /*#__PURE__*/_react.default.createElement(_Shared.ColumnAllowSettingPopover, {
440
- allowColumns: allowColumns,
441
- optionsDefault: optionsDefault,
442
- handleChangeAllowColumns: handleChangeAllowColumns
443
- })))), orderList.loading ? _toConsumableArray(Array(10).keys()).map(function (i) {
431
+ }, !isSelectedOrders && /*#__PURE__*/_react.default.createElement("thead", null, /*#__PURE__*/_react.default.createElement("tr", null, allowColumns && Object.keys(allowColumns).filter(function (col) {
432
+ var _allowColumns$col, _allowColumns$col2;
433
+
434
+ return ((_allowColumns$col = allowColumns[col]) === null || _allowColumns$col === void 0 ? void 0 : _allowColumns$col.visable) && ((_allowColumns$col2 = allowColumns[col]) === null || _allowColumns$col2 === void 0 ? void 0 : _allowColumns$col2.order) !== 0;
435
+ }).sort(function (col1, col2) {
436
+ var _allowColumns$col3, _allowColumns$col4;
437
+
438
+ return ((_allowColumns$col3 = allowColumns[col1]) === null || _allowColumns$col3 === void 0 ? void 0 : _allowColumns$col3.order) - ((_allowColumns$col4 = allowColumns[col2]) === null || _allowColumns$col4 === void 0 ? void 0 : _allowColumns$col4.order);
439
+ }).map(function (column, i) {
440
+ var _allowColumns$column$, _allowColumns$column, _allowColumns$column2, _theme$images$icons, _allowColumns$column3;
441
+
442
+ if (column === 'slaBar') {
443
+ return /*#__PURE__*/_react.default.createElement("th", {
444
+ key: "noDragTh-".concat(i)
445
+ }, /*#__PURE__*/_react.default.createElement(_styles.Timestatus, null));
446
+ }
447
+
448
+ if (column === 'orderNumber') {
449
+ var _allowColumns$orderNu, _allowColumns$dateTim;
450
+
451
+ return /*#__PURE__*/_react.default.createElement("th", {
452
+ className: !(allowColumns !== null && allowColumns !== void 0 && (_allowColumns$orderNu = allowColumns.orderNumber) !== null && _allowColumns$orderNu !== void 0 && _allowColumns$orderNu.visable || allowColumns !== null && allowColumns !== void 0 && (_allowColumns$dateTim = allowColumns.dateTime) !== null && _allowColumns$dateTim !== void 0 && _allowColumns$dateTim.visable) ? 'orderNo small' : 'orderNo',
453
+ key: "noDragTh-".concat(i)
454
+ }, /*#__PURE__*/_react.default.createElement(_styles.CheckBox, {
455
+ isChecked: !orderList.loading && isAllChecked,
456
+ onClick: function onClick() {
457
+ return handleSelecteAllOrder();
458
+ },
459
+ className: "orderCheckBox"
460
+ }, !orderList.loading && isAllChecked ? /*#__PURE__*/_react.default.createElement(_RiCheckboxFill.default, null) : /*#__PURE__*/_react.default.createElement(_RiCheckboxBlankLine.default, null)), t('ORDER', 'Order'));
461
+ }
462
+
463
+ if (column === 'total') {
464
+ return /*#__PURE__*/_react.default.createElement("th", {
465
+ className: "orderPrice",
466
+ key: "noDragTh-".concat(i)
467
+ }, /*#__PURE__*/_react.default.createElement(_Shared.ColumnAllowSettingPopover, {
468
+ allowColumns: allowColumns,
469
+ optionsDefault: optionsDefault,
470
+ handleChangeAllowColumns: handleChangeAllowColumns
471
+ }));
472
+ }
473
+
474
+ return (column !== 'timer' || column === 'timer' && (groupStatus === 'pending' || groupStatus === 'inProgress')) && /*#__PURE__*/_react.default.createElement(_styles.DragTh, {
475
+ key: "dragTh-".concat(i),
476
+ onDragOver: function onDragOver(e) {
477
+ return handleDragOver === null || handleDragOver === void 0 ? void 0 : handleDragOver(e, column);
478
+ },
479
+ onDrop: function onDrop(e) {
480
+ return handleDrop(e, column);
481
+ },
482
+ onDragEnd: function onDragEnd(e) {
483
+ return handleDragEnd(e);
484
+ },
485
+ colSpan: (_allowColumns$column$ = (_allowColumns$column = allowColumns[column]) === null || _allowColumns$column === void 0 ? void 0 : _allowColumns$column.colSpan) !== null && _allowColumns$column$ !== void 0 ? _allowColumns$column$ : 1,
486
+ className: (_allowColumns$column2 = allowColumns[column]) === null || _allowColumns$column2 === void 0 ? void 0 : _allowColumns$column2.className,
487
+ selectedDragOver: column === dragOverd
488
+ }, /*#__PURE__*/_react.default.createElement("div", {
489
+ draggable: true,
490
+ onDragStart: function onDragStart(e) {
491
+ return handleDragStart === null || handleDragStart === void 0 ? void 0 : handleDragStart(e, column);
492
+ }
493
+ }, /*#__PURE__*/_react.default.createElement("img", {
494
+ src: (_theme$images$icons = theme.images.icons) === null || _theme$images$icons === void 0 ? void 0 : _theme$images$icons.sixDots,
495
+ alt: "six dots"
496
+ }), /*#__PURE__*/_react.default.createElement("span", null, (_allowColumns$column3 = allowColumns[column]) === null || _allowColumns$column3 === void 0 ? void 0 : _allowColumns$column3.title)));
497
+ }))), orderList.loading || !allowColumns ? _toConsumableArray(Array(10).keys()).map(function (i) {
498
+ var _allowColumns$slaBar, _allowColumns$orderNu2, _allowColumns$dateTim2, _allowColumns$orderNu3, _allowColumns$dateTim3, _allowColumns$status, _allowColumns$busines, _allowColumns$custome, _allowColumns$driver, _allowColumns$deliver, _allowColumns$status2, _allowColumns$advance, _allowColumns$advance2, _allowColumns$advance3, _allowColumns$total;
499
+
444
500
  return /*#__PURE__*/_react.default.createElement(_styles.OrderTbody, {
445
501
  key: i
446
- }, /*#__PURE__*/_react.default.createElement("tr", null, (allowColumns === null || allowColumns === void 0 ? void 0 : allowColumns.slaBar) && /*#__PURE__*/_react.default.createElement("td", null, /*#__PURE__*/_react.default.createElement(_styles.Timestatus, null)), /*#__PURE__*/_react.default.createElement("td", {
447
- className: !(allowColumns !== null && allowColumns !== void 0 && allowColumns.orderNumber || allowColumns !== null && allowColumns !== void 0 && allowColumns.dateTime) ? 'orderNo small' : 'orderNo'
502
+ }, /*#__PURE__*/_react.default.createElement("tr", null, (allowColumns === null || allowColumns === void 0 ? void 0 : (_allowColumns$slaBar = allowColumns.slaBar) === null || _allowColumns$slaBar === void 0 ? void 0 : _allowColumns$slaBar.visable) && /*#__PURE__*/_react.default.createElement("td", null, /*#__PURE__*/_react.default.createElement(_styles.Timestatus, null)), /*#__PURE__*/_react.default.createElement("td", {
503
+ className: !(allowColumns !== null && allowColumns !== void 0 && (_allowColumns$orderNu2 = allowColumns.orderNumber) !== null && _allowColumns$orderNu2 !== void 0 && _allowColumns$orderNu2.visable || allowColumns !== null && allowColumns !== void 0 && (_allowColumns$dateTim2 = allowColumns.dateTime) !== null && _allowColumns$dateTim2 !== void 0 && _allowColumns$dateTim2.visable) ? 'orderNo small' : 'orderNo'
448
504
  }, /*#__PURE__*/_react.default.createElement(_styles.OrderNumberContainer, null, /*#__PURE__*/_react.default.createElement(_styles.CheckBox, null, /*#__PURE__*/_react.default.createElement(_reactLoadingSkeleton.default, {
449
505
  width: 25,
450
506
  height: 25,
@@ -453,11 +509,11 @@ var OrdersTable = function OrdersTable(props) {
453
509
  }
454
510
  })), /*#__PURE__*/_react.default.createElement("div", {
455
511
  className: "info"
456
- }, (allowColumns === null || allowColumns === void 0 ? void 0 : allowColumns.orderNumber) && /*#__PURE__*/_react.default.createElement("p", null, /*#__PURE__*/_react.default.createElement(_reactLoadingSkeleton.default, {
512
+ }, (allowColumns === null || allowColumns === void 0 ? void 0 : (_allowColumns$orderNu3 = allowColumns.orderNumber) === null || _allowColumns$orderNu3 === void 0 ? void 0 : _allowColumns$orderNu3.visable) && /*#__PURE__*/_react.default.createElement("p", null, /*#__PURE__*/_react.default.createElement(_reactLoadingSkeleton.default, {
457
513
  width: 100
458
- })), (allowColumns === null || allowColumns === void 0 ? void 0 : allowColumns.dateTime) && /*#__PURE__*/_react.default.createElement(_reactLoadingSkeleton.default, {
514
+ })), (allowColumns === null || allowColumns === void 0 ? void 0 : (_allowColumns$dateTim3 = allowColumns.dateTime) === null || _allowColumns$dateTim3 === void 0 ? void 0 : _allowColumns$dateTim3.visable) && /*#__PURE__*/_react.default.createElement(_reactLoadingSkeleton.default, {
459
515
  width: 120
460
- })))), (allowColumns === null || allowColumns === void 0 ? void 0 : allowColumns.status) && !isSelectedOrders && /*#__PURE__*/_react.default.createElement("td", {
516
+ })))), (allowColumns === null || allowColumns === void 0 ? void 0 : (_allowColumns$status = allowColumns.status) === null || _allowColumns$status === void 0 ? void 0 : _allowColumns$status.visable) && !isSelectedOrders && /*#__PURE__*/_react.default.createElement("td", {
461
517
  className: "statusInfo"
462
518
  }, /*#__PURE__*/_react.default.createElement(_styles.StatusInfo, null, /*#__PURE__*/_react.default.createElement("div", {
463
519
  className: "info"
@@ -465,7 +521,7 @@ var OrdersTable = function OrdersTable(props) {
465
521
  className: "bold"
466
522
  }, /*#__PURE__*/_react.default.createElement(_reactLoadingSkeleton.default, {
467
523
  width: 100
468
- }))))), (allowColumns === null || allowColumns === void 0 ? void 0 : allowColumns.business) && /*#__PURE__*/_react.default.createElement("td", {
524
+ }))))), (allowColumns === null || allowColumns === void 0 ? void 0 : (_allowColumns$busines = allowColumns.business) === null || _allowColumns$busines === void 0 ? void 0 : _allowColumns$busines.visable) && /*#__PURE__*/_react.default.createElement("td", {
469
525
  className: "businessInfo"
470
526
  }, /*#__PURE__*/_react.default.createElement(_styles.BusinessInfo, null, /*#__PURE__*/_react.default.createElement(_reactLoadingSkeleton.default, {
471
527
  width: 45,
@@ -478,7 +534,7 @@ var OrdersTable = function OrdersTable(props) {
478
534
  width: 80
479
535
  })), /*#__PURE__*/_react.default.createElement("p", null, /*#__PURE__*/_react.default.createElement(_reactLoadingSkeleton.default, {
480
536
  width: 100
481
- }))))), (allowColumns === null || allowColumns === void 0 ? void 0 : allowColumns.customer) && /*#__PURE__*/_react.default.createElement("td", {
537
+ }))))), (allowColumns === null || allowColumns === void 0 ? void 0 : (_allowColumns$custome = allowColumns.customer) === null || _allowColumns$custome === void 0 ? void 0 : _allowColumns$custome.visable) && /*#__PURE__*/_react.default.createElement("td", {
482
538
  className: "customerInfo"
483
539
  }, /*#__PURE__*/_react.default.createElement(_styles.CustomerInfo, null, /*#__PURE__*/_react.default.createElement(_reactLoadingSkeleton.default, {
484
540
  width: 45,
@@ -491,7 +547,7 @@ var OrdersTable = function OrdersTable(props) {
491
547
  width: 100
492
548
  })), /*#__PURE__*/_react.default.createElement("p", null, /*#__PURE__*/_react.default.createElement(_reactLoadingSkeleton.default, {
493
549
  width: 100
494
- }))))), (allowColumns === null || allowColumns === void 0 ? void 0 : allowColumns.driver) && !isSelectedOrders && /*#__PURE__*/_react.default.createElement("td", {
550
+ }))))), (allowColumns === null || allowColumns === void 0 ? void 0 : (_allowColumns$driver = allowColumns.driver) === null || _allowColumns$driver === void 0 ? void 0 : _allowColumns$driver.visable) && !isSelectedOrders && /*#__PURE__*/_react.default.createElement("td", {
495
551
  className: "driverInfo"
496
552
  }, /*#__PURE__*/_react.default.createElement(_styles.DriversInfo, {
497
553
  className: "d-flex align-items-center"
@@ -503,17 +559,17 @@ var OrdersTable = function OrdersTable(props) {
503
559
  style: {
504
560
  margin: '10px'
505
561
  }
506
- }))), (allowColumns === null || allowColumns === void 0 ? void 0 : allowColumns.deliveryType) && !isSelectedOrders && /*#__PURE__*/_react.default.createElement("td", {
562
+ }))), (allowColumns === null || allowColumns === void 0 ? void 0 : (_allowColumns$deliver = allowColumns.deliveryType) === null || _allowColumns$deliver === void 0 ? void 0 : _allowColumns$deliver.visable) && !isSelectedOrders && /*#__PURE__*/_react.default.createElement("td", {
507
563
  className: "orderType"
508
564
  }, /*#__PURE__*/_react.default.createElement(_styles.OrderType, null, /*#__PURE__*/_react.default.createElement(_reactLoadingSkeleton.default, {
509
565
  width: 35,
510
566
  height: 35
511
- }))), (allowColumns === null || allowColumns === void 0 ? void 0 : allowColumns.status) && !isSelectedOrders && /*#__PURE__*/_react.default.createElement("td", {
567
+ }))), (allowColumns === null || allowColumns === void 0 ? void 0 : (_allowColumns$status2 = allowColumns.status) === null || _allowColumns$status2 === void 0 ? void 0 : _allowColumns$status2.visable) && !isSelectedOrders && /*#__PURE__*/_react.default.createElement("td", {
512
568
  className: "orderStatusTitle"
513
569
  }, /*#__PURE__*/_react.default.createElement(_styles.WrapOrderStatusSelector, null, /*#__PURE__*/_react.default.createElement(_reactLoadingSkeleton.default, {
514
570
  width: 100,
515
571
  height: 30
516
- }))), (allowColumns === null || allowColumns === void 0 ? void 0 : allowColumns.advanced) && !isSelectedOrders && /*#__PURE__*/_react.default.createElement("td", {
572
+ }))), (allowColumns === null || allowColumns === void 0 ? void 0 : (_allowColumns$advance = allowColumns.advanced) === null || _allowColumns$advance === void 0 ? void 0 : _allowColumns$advance.visable) && !isSelectedOrders && /*#__PURE__*/_react.default.createElement("td", {
517
573
  className: "logistic"
518
574
  }, /*#__PURE__*/_react.default.createElement("div", {
519
575
  className: "info"
@@ -523,7 +579,7 @@ var OrdersTable = function OrdersTable(props) {
523
579
  width: 60
524
580
  })), /*#__PURE__*/_react.default.createElement("p", null, /*#__PURE__*/_react.default.createElement(_reactLoadingSkeleton.default, {
525
581
  width: 60
526
- })))), (allowColumns === null || allowColumns === void 0 ? void 0 : allowColumns.advanced) && !isSelectedOrders && /*#__PURE__*/_react.default.createElement("td", {
582
+ })))), (allowColumns === null || allowColumns === void 0 ? void 0 : (_allowColumns$advance2 = allowColumns.advanced) === null || _allowColumns$advance2 === void 0 ? void 0 : _allowColumns$advance2.visable) && !isSelectedOrders && /*#__PURE__*/_react.default.createElement("td", {
527
583
  className: "attempts"
528
584
  }, /*#__PURE__*/_react.default.createElement("div", {
529
585
  className: "info"
@@ -533,7 +589,7 @@ var OrdersTable = function OrdersTable(props) {
533
589
  width: 60
534
590
  })), /*#__PURE__*/_react.default.createElement("p", null, /*#__PURE__*/_react.default.createElement(_reactLoadingSkeleton.default, {
535
591
  width: 60
536
- })))), (allowColumns === null || allowColumns === void 0 ? void 0 : allowColumns.advanced) && !isSelectedOrders && /*#__PURE__*/_react.default.createElement("td", {
592
+ })))), (allowColumns === null || allowColumns === void 0 ? void 0 : (_allowColumns$advance3 = allowColumns.advanced) === null || _allowColumns$advance3 === void 0 ? void 0 : _allowColumns$advance3.visable) && !isSelectedOrders && /*#__PURE__*/_react.default.createElement("td", {
537
593
  className: "priority"
538
594
  }, /*#__PURE__*/_react.default.createElement("div", {
539
595
  className: "info"
@@ -547,7 +603,7 @@ var OrdersTable = function OrdersTable(props) {
547
603
  className: "orderPrice"
548
604
  }, /*#__PURE__*/_react.default.createElement("div", {
549
605
  className: "info"
550
- }, (allowColumns === null || allowColumns === void 0 ? void 0 : allowColumns.total) && /*#__PURE__*/_react.default.createElement("p", {
606
+ }, (allowColumns === null || allowColumns === void 0 ? void 0 : (_allowColumns$total = allowColumns.total) === null || _allowColumns$total === void 0 ? void 0 : _allowColumns$total.visable) && /*#__PURE__*/_react.default.createElement("p", {
551
607
  className: "bold"
552
608
  }, /*#__PURE__*/_react.default.createElement(_reactLoadingSkeleton.default, {
553
609
  width: 60
@@ -555,8 +611,6 @@ var OrdersTable = function OrdersTable(props) {
555
611
  width: 100
556
612
  }))))));
557
613
  }) : orderList.orders.map(function (order, i) {
558
- var _getOrderStatus, _order$business, _theme$images, _theme$images$dummies, _order$business2, _order$business3, _order$business3$city, _order$customer, _order$customer2, _order$customer3, _order$customer4, _order$driver, _order$driver2, _order$driver3, _order$driver4, _order$summary;
559
-
560
614
  return /*#__PURE__*/_react.default.createElement(_styles.OrderTbody, {
561
615
  key: i,
562
616
  className: parseInt(orderDetailId) === order.id ? 'active' : '',
@@ -564,97 +618,165 @@ var OrdersTable = function OrdersTable(props) {
564
618
  return handleClickOrder(order, e);
565
619
  },
566
620
  "data-tour": i === 0 ? 'tour_start' : ''
567
- }, /*#__PURE__*/_react.default.createElement("tr", null, (allowColumns === null || allowColumns === void 0 ? void 0 : allowColumns.slaBar) && /*#__PURE__*/_react.default.createElement("td", null, /*#__PURE__*/_react.default.createElement(_styles.Timestatus, {
568
- timeState: getStatusClassName(getDelayMinutes(order))
569
- })), /*#__PURE__*/_react.default.createElement("td", {
570
- className: !(allowColumns !== null && allowColumns !== void 0 && allowColumns.orderNumber || allowColumns !== null && allowColumns !== void 0 && allowColumns.dateTime) ? 'small' : ''
571
- }, /*#__PURE__*/_react.default.createElement(_styles.OrderNumberContainer, null, !isSelectedOrders && /*#__PURE__*/_react.default.createElement(_styles.CheckBox, {
572
- isChecked: selectedOrderIds.includes(order === null || order === void 0 ? void 0 : order.id),
573
- onClick: function onClick() {
574
- return handleSelectedOrderIds(order.id);
575
- },
576
- className: "orderCheckBox"
577
- }, selectedOrderIds.includes(order === null || order === void 0 ? void 0 : order.id) ? /*#__PURE__*/_react.default.createElement(_RiCheckboxFill.default, null) : /*#__PURE__*/_react.default.createElement(_RiCheckboxBlankLine.default, null)), /*#__PURE__*/_react.default.createElement("div", {
578
- className: "info"
579
- }, (allowColumns === null || allowColumns === void 0 ? void 0 : allowColumns.orderNumber) && /*#__PURE__*/_react.default.createElement("p", {
580
- className: "bold"
581
- }, t('INVOICE_ORDER_NO', 'Order No.'), " ", order === null || order === void 0 ? void 0 : order.id), (allowColumns === null || allowColumns === void 0 ? void 0 : allowColumns.dateTime) && /*#__PURE__*/_react.default.createElement("p", {
582
- className: "date"
583
- }, parseDate(order === null || order === void 0 ? void 0 : order.delivery_datetime, {
584
- utc: false
585
- }))))), (allowColumns === null || allowColumns === void 0 ? void 0 : allowColumns.status) && !isSelectedOrders && /*#__PURE__*/_react.default.createElement("td", {
586
- className: "statusInfo"
587
- }, /*#__PURE__*/_react.default.createElement(_styles.StatusInfo, null, /*#__PURE__*/_react.default.createElement("p", {
588
- className: "bold"
589
- }, (_getOrderStatus = getOrderStatus(order.status)) === null || _getOrderStatus === void 0 ? void 0 : _getOrderStatus.value))), (allowColumns === null || allowColumns === void 0 ? void 0 : allowColumns.business) && /*#__PURE__*/_react.default.createElement("td", {
590
- className: "businessInfo"
591
- }, /*#__PURE__*/_react.default.createElement(_styles.BusinessInfo, null, /*#__PURE__*/_react.default.createElement(_styles.WrapperImage, null, /*#__PURE__*/_react.default.createElement("img", {
592
- src: optimizeImage(((_order$business = order.business) === null || _order$business === void 0 ? void 0 : _order$business.logo) || ((_theme$images = theme.images) === null || _theme$images === void 0 ? void 0 : (_theme$images$dummies = _theme$images.dummies) === null || _theme$images$dummies === void 0 ? void 0 : _theme$images$dummies.businessLogo), 'h_50,c_limit'),
593
- loading: "lazy",
594
- alt: ""
595
- })), /*#__PURE__*/_react.default.createElement("div", {
596
- className: "info"
597
- }, /*#__PURE__*/_react.default.createElement("p", {
598
- className: "bold"
599
- }, order === null || order === void 0 ? void 0 : (_order$business2 = order.business) === null || _order$business2 === void 0 ? void 0 : _order$business2.name), /*#__PURE__*/_react.default.createElement("p", null, order === null || order === void 0 ? void 0 : (_order$business3 = order.business) === null || _order$business3 === void 0 ? void 0 : (_order$business3$city = _order$business3.city) === null || _order$business3$city === void 0 ? void 0 : _order$business3$city.name)))), (allowColumns === null || allowColumns === void 0 ? void 0 : allowColumns.customer) && /*#__PURE__*/_react.default.createElement("td", {
600
- className: "customerInfo"
601
- }, /*#__PURE__*/_react.default.createElement(_styles.CustomerInfo, null, /*#__PURE__*/_react.default.createElement(_styles.WrapperImage, null, order !== null && order !== void 0 && (_order$customer = order.customer) !== null && _order$customer !== void 0 && _order$customer.photo ? /*#__PURE__*/_react.default.createElement("img", {
602
- src: optimizeImage(order === null || order === void 0 ? void 0 : (_order$customer2 = order.customer) === null || _order$customer2 === void 0 ? void 0 : _order$customer2.photo, 'h_50,c_limit'),
603
- loading: "lazy",
604
- alt: ""
605
- }) : /*#__PURE__*/_react.default.createElement(_FaUserAlt.default, null)), /*#__PURE__*/_react.default.createElement("div", {
606
- className: "info"
607
- }, /*#__PURE__*/_react.default.createElement("p", {
608
- className: "bold"
609
- }, order === null || order === void 0 ? void 0 : (_order$customer3 = order.customer) === null || _order$customer3 === void 0 ? void 0 : _order$customer3.name), /*#__PURE__*/_react.default.createElement("p", null, order === null || order === void 0 ? void 0 : (_order$customer4 = order.customer) === null || _order$customer4 === void 0 ? void 0 : _order$customer4.cellphone)))), isSelectedOrders && /*#__PURE__*/_react.default.createElement("td", null, /*#__PURE__*/_react.default.createElement(_reactBootstrapIcons.ChevronRight, {
610
- color: "#B1BCCC"
611
- })), (allowColumns === null || allowColumns === void 0 ? void 0 : allowColumns.driver) && !isSelectedOrders && /*#__PURE__*/_react.default.createElement("td", null, (order === null || order === void 0 ? void 0 : order.delivery_type) === 1 && /*#__PURE__*/_react.default.createElement(_styles.CustomerInfo, null, /*#__PURE__*/_react.default.createElement(_styles.WrapperImage, null, order !== null && order !== void 0 && (_order$driver = order.driver) !== null && _order$driver !== void 0 && _order$driver.photo ? /*#__PURE__*/_react.default.createElement("img", {
612
- src: optimizeImage(order === null || order === void 0 ? void 0 : (_order$driver2 = order.driver) === null || _order$driver2 === void 0 ? void 0 : _order$driver2.photo, 'h_50,c_limit'),
613
- loading: "lazy",
614
- alt: ""
615
- }) : /*#__PURE__*/_react.default.createElement(_FaUserAlt.default, null)), /*#__PURE__*/_react.default.createElement("div", {
616
- className: "info"
617
- }, order !== null && order !== void 0 && order.driver ? /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, /*#__PURE__*/_react.default.createElement("p", {
618
- className: "bold"
619
- }, order === null || order === void 0 ? void 0 : (_order$driver3 = order.driver) === null || _order$driver3 === void 0 ? void 0 : _order$driver3.name), /*#__PURE__*/_react.default.createElement("p", null, order === null || order === void 0 ? void 0 : (_order$driver4 = order.driver) === null || _order$driver4 === void 0 ? void 0 : _order$driver4.cellphone)) : /*#__PURE__*/_react.default.createElement("p", {
620
- className: "bold"
621
- }, t('NO_DRIVER', 'No Driver'))))), (allowColumns === null || allowColumns === void 0 ? void 0 : allowColumns.advanced) && !isSelectedOrders && /*#__PURE__*/_react.default.createElement("td", {
622
- className: "logistic"
623
- }, /*#__PURE__*/_react.default.createElement("div", {
624
- className: "info"
625
- }, /*#__PURE__*/_react.default.createElement("p", {
626
- className: "bold"
627
- }, t('LOGISTIC', 'Logistic')), /*#__PURE__*/_react.default.createElement("p", null, getLogisticTag(order === null || order === void 0 ? void 0 : order.logistic_status), /*#__PURE__*/_react.default.createElement(_styles.LogisticStatusDot, {
628
- status: order === null || order === void 0 ? void 0 : order.logistic_status
629
- })))), (allowColumns === null || allowColumns === void 0 ? void 0 : allowColumns.advanced) && !isSelectedOrders && /*#__PURE__*/_react.default.createElement("td", {
630
- className: "attempts"
631
- }, /*#__PURE__*/_react.default.createElement("div", {
632
- className: "info"
633
- }, /*#__PURE__*/_react.default.createElement("p", {
634
- className: "bold"
635
- }, t('ATTEMPTS', 'Attempts')), /*#__PURE__*/_react.default.createElement("p", null, order === null || order === void 0 ? void 0 : order.logistic_attemps))), (allowColumns === null || allowColumns === void 0 ? void 0 : allowColumns.advanced) && !isSelectedOrders && /*#__PURE__*/_react.default.createElement("td", {
636
- className: "priority"
637
- }, /*#__PURE__*/_react.default.createElement("div", {
638
- className: "info"
639
- }, /*#__PURE__*/_react.default.createElement("p", {
640
- className: "bold"
641
- }, t('PRIORITY', 'Priority')), /*#__PURE__*/_react.default.createElement("p", null, getPriorityTag(order === null || order === void 0 ? void 0 : order.priority), /*#__PURE__*/_react.default.createElement(_styles.PriorityDot, {
642
- priority: order === null || order === void 0 ? void 0 : order.priority
643
- })))), (allowColumns === null || allowColumns === void 0 ? void 0 : allowColumns.timer) && (groupStatus === 'pending' || groupStatus === 'inProgress') && /*#__PURE__*/_react.default.createElement("td", {
644
- className: "timer"
645
- }, /*#__PURE__*/_react.default.createElement(_styles.Timer, null, /*#__PURE__*/_react.default.createElement("p", {
646
- className: "bold"
647
- }, t('TIMER', 'Timer')), /*#__PURE__*/_react.default.createElement("p", {
648
- className: getStatusClassName(getDelayMinutes(order))
649
- }, displayDelayedTime(order)))), /*#__PURE__*/_react.default.createElement("td", {
650
- className: "orderPrice"
651
- }, /*#__PURE__*/_react.default.createElement("div", {
652
- className: "info"
653
- }, (allowColumns === null || allowColumns === void 0 ? void 0 : allowColumns.total) && /*#__PURE__*/_react.default.createElement("p", {
654
- className: "bold"
655
- }, parsePrice(order === null || order === void 0 ? void 0 : (_order$summary = order.summary) === null || _order$summary === void 0 ? void 0 : _order$summary.total)), !((order === null || order === void 0 ? void 0 : order.status) === 1 || (order === null || order === void 0 ? void 0 : order.status) === 11 || (order === null || order === void 0 ? void 0 : order.status) === 2 || (order === null || order === void 0 ? void 0 : order.status) === 5 || (order === null || order === void 0 ? void 0 : order.status) === 6 || (order === null || order === void 0 ? void 0 : order.status) === 10 || order.status === 12) && /*#__PURE__*/_react.default.createElement("p", null, order !== null && order !== void 0 && order.delivery_datetime_utc ? getTimeAgo(order === null || order === void 0 ? void 0 : order.delivery_datetime_utc) : getTimeAgo(order === null || order === void 0 ? void 0 : order.delivery_datetime, {
656
- utc: false
657
- }))))));
621
+ }, /*#__PURE__*/_react.default.createElement("tr", null, Object.keys(allowColumns).filter(function (col) {
622
+ var _allowColumns$col5;
623
+
624
+ return (_allowColumns$col5 = allowColumns[col]) === null || _allowColumns$col5 === void 0 ? void 0 : _allowColumns$col5.visable;
625
+ }).sort(function (col1, col2) {
626
+ var _allowColumns$col6, _allowColumns$col7;
627
+
628
+ return ((_allowColumns$col6 = allowColumns[col1]) === null || _allowColumns$col6 === void 0 ? void 0 : _allowColumns$col6.order) - ((_allowColumns$col7 = allowColumns[col2]) === null || _allowColumns$col7 === void 0 ? void 0 : _allowColumns$col7.order);
629
+ }).map(function (column, index) {
630
+ if (column === 'slaBar') {
631
+ return /*#__PURE__*/_react.default.createElement("td", {
632
+ key: "slaBar".concat(i, "-").concat(index)
633
+ }, /*#__PURE__*/_react.default.createElement(_styles.Timestatus, {
634
+ timeState: getStatusClassName(getDelayMinutes(order))
635
+ }));
636
+ }
637
+
638
+ if (column === 'orderNumber') {
639
+ var _allowColumns$orderNu4, _allowColumns$dateTim4, _allowColumns$orderNu5, _allowColumns$dateTim5;
640
+
641
+ return /*#__PURE__*/_react.default.createElement("td", {
642
+ className: !(allowColumns !== null && allowColumns !== void 0 && (_allowColumns$orderNu4 = allowColumns.orderNumber) !== null && _allowColumns$orderNu4 !== void 0 && _allowColumns$orderNu4.visable || allowColumns !== null && allowColumns !== void 0 && (_allowColumns$dateTim4 = allowColumns.dateTime) !== null && _allowColumns$dateTim4 !== void 0 && _allowColumns$dateTim4.visable) ? 'small' : '',
643
+ key: "orderNumber".concat(i, "-").concat(index)
644
+ }, /*#__PURE__*/_react.default.createElement(_styles.OrderNumberContainer, null, !isSelectedOrders && /*#__PURE__*/_react.default.createElement(_styles.CheckBox, {
645
+ isChecked: selectedOrderIds.includes(order === null || order === void 0 ? void 0 : order.id),
646
+ onClick: function onClick() {
647
+ return handleSelectedOrderIds(order.id);
648
+ },
649
+ className: "orderCheckBox"
650
+ }, selectedOrderIds.includes(order === null || order === void 0 ? void 0 : order.id) ? /*#__PURE__*/_react.default.createElement(_RiCheckboxFill.default, null) : /*#__PURE__*/_react.default.createElement(_RiCheckboxBlankLine.default, null)), /*#__PURE__*/_react.default.createElement("div", {
651
+ className: "info"
652
+ }, (allowColumns === null || allowColumns === void 0 ? void 0 : (_allowColumns$orderNu5 = allowColumns.orderNumber) === null || _allowColumns$orderNu5 === void 0 ? void 0 : _allowColumns$orderNu5.visable) && /*#__PURE__*/_react.default.createElement("p", {
653
+ className: "bold"
654
+ }, t('INVOICE_ORDER_NO', 'Order No.'), " ", order === null || order === void 0 ? void 0 : order.id), (allowColumns === null || allowColumns === void 0 ? void 0 : (_allowColumns$dateTim5 = allowColumns.dateTime) === null || _allowColumns$dateTim5 === void 0 ? void 0 : _allowColumns$dateTim5.visable) && /*#__PURE__*/_react.default.createElement("p", {
655
+ className: "date"
656
+ }, parseDate(order === null || order === void 0 ? void 0 : order.delivery_datetime, {
657
+ utc: false
658
+ })))));
659
+ }
660
+
661
+ if (column === 'status' && !isSelectedOrders) {
662
+ var _getOrderStatus;
663
+
664
+ return /*#__PURE__*/_react.default.createElement("td", {
665
+ className: "statusInfo",
666
+ key: "statusInfo".concat(i, "-").concat(index)
667
+ }, /*#__PURE__*/_react.default.createElement(_styles.StatusInfo, null, /*#__PURE__*/_react.default.createElement("p", {
668
+ className: "bold"
669
+ }, (_getOrderStatus = getOrderStatus(order.status)) === null || _getOrderStatus === void 0 ? void 0 : _getOrderStatus.value)));
670
+ }
671
+
672
+ if (column === 'business') {
673
+ var _order$business, _theme$images, _theme$images$dummies, _order$business2, _order$business3, _order$business3$city;
674
+
675
+ return /*#__PURE__*/_react.default.createElement("td", {
676
+ className: "businessInfo",
677
+ key: "businessInfo".concat(i, "-").concat(index)
678
+ }, /*#__PURE__*/_react.default.createElement(_styles.BusinessInfo, null, /*#__PURE__*/_react.default.createElement(_styles.WrapperImage, null, /*#__PURE__*/_react.default.createElement("img", {
679
+ src: optimizeImage(((_order$business = order.business) === null || _order$business === void 0 ? void 0 : _order$business.logo) || ((_theme$images = theme.images) === null || _theme$images === void 0 ? void 0 : (_theme$images$dummies = _theme$images.dummies) === null || _theme$images$dummies === void 0 ? void 0 : _theme$images$dummies.businessLogo), 'h_50,c_limit'),
680
+ loading: "lazy",
681
+ alt: ""
682
+ })), /*#__PURE__*/_react.default.createElement("div", {
683
+ className: "info"
684
+ }, /*#__PURE__*/_react.default.createElement("p", {
685
+ className: "bold"
686
+ }, order === null || order === void 0 ? void 0 : (_order$business2 = order.business) === null || _order$business2 === void 0 ? void 0 : _order$business2.name), /*#__PURE__*/_react.default.createElement("p", null, order === null || order === void 0 ? void 0 : (_order$business3 = order.business) === null || _order$business3 === void 0 ? void 0 : (_order$business3$city = _order$business3.city) === null || _order$business3$city === void 0 ? void 0 : _order$business3$city.name))));
687
+ }
688
+
689
+ if (column === 'customer') {
690
+ var _order$customer, _order$customer2, _order$customer3, _order$customer4, _order$customer5, _order$customer6;
691
+
692
+ return /*#__PURE__*/_react.default.createElement("td", {
693
+ className: "customerInfo",
694
+ key: "customerInfo".concat(i, "-").concat(index)
695
+ }, /*#__PURE__*/_react.default.createElement(_styles.CustomerInfo, null, /*#__PURE__*/_react.default.createElement(_styles.WrapperImage, null, order !== null && order !== void 0 && (_order$customer = order.customer) !== null && _order$customer !== void 0 && _order$customer.photo ? /*#__PURE__*/_react.default.createElement("img", {
696
+ src: optimizeImage(order === null || order === void 0 ? void 0 : (_order$customer2 = order.customer) === null || _order$customer2 === void 0 ? void 0 : _order$customer2.photo, 'h_50,c_limit'),
697
+ loading: "lazy",
698
+ alt: ""
699
+ }) : /*#__PURE__*/_react.default.createElement(_FaUserAlt.default, null), /*#__PURE__*/_react.default.createElement(_styles.OrdersCountWrapper, {
700
+ isNew: (order === null || order === void 0 ? void 0 : (_order$customer3 = order.customer) === null || _order$customer3 === void 0 ? void 0 : _order$customer3.orders_count) === 0
701
+ }, (order === null || order === void 0 ? void 0 : (_order$customer4 = order.customer) === null || _order$customer4 === void 0 ? void 0 : _order$customer4.orders_count) || t('NEW', 'New'))), /*#__PURE__*/_react.default.createElement("div", {
702
+ className: "info"
703
+ }, /*#__PURE__*/_react.default.createElement("p", {
704
+ className: "bold"
705
+ }, order === null || order === void 0 ? void 0 : (_order$customer5 = order.customer) === null || _order$customer5 === void 0 ? void 0 : _order$customer5.name), /*#__PURE__*/_react.default.createElement("p", null, order === null || order === void 0 ? void 0 : (_order$customer6 = order.customer) === null || _order$customer6 === void 0 ? void 0 : _order$customer6.cellphone))));
706
+ }
707
+
708
+ if (column === 'driver' && !isSelectedOrders) {
709
+ var _order$driver, _order$driver2, _order$driver3, _order$driver4;
710
+
711
+ return /*#__PURE__*/_react.default.createElement("td", {
712
+ key: "driver".concat(i, "-").concat(index)
713
+ }, (order === null || order === void 0 ? void 0 : order.delivery_type) === 1 && /*#__PURE__*/_react.default.createElement(_styles.CustomerInfo, null, /*#__PURE__*/_react.default.createElement(_styles.WrapperImage, null, order !== null && order !== void 0 && (_order$driver = order.driver) !== null && _order$driver !== void 0 && _order$driver.photo ? /*#__PURE__*/_react.default.createElement("img", {
714
+ src: optimizeImage(order === null || order === void 0 ? void 0 : (_order$driver2 = order.driver) === null || _order$driver2 === void 0 ? void 0 : _order$driver2.photo, 'h_50,c_limit'),
715
+ loading: "lazy",
716
+ alt: ""
717
+ }) : /*#__PURE__*/_react.default.createElement(_FaUserAlt.default, null)), /*#__PURE__*/_react.default.createElement("div", {
718
+ className: "info"
719
+ }, order !== null && order !== void 0 && order.driver ? /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, /*#__PURE__*/_react.default.createElement("p", {
720
+ className: "bold"
721
+ }, order === null || order === void 0 ? void 0 : (_order$driver3 = order.driver) === null || _order$driver3 === void 0 ? void 0 : _order$driver3.name), /*#__PURE__*/_react.default.createElement("p", null, order === null || order === void 0 ? void 0 : (_order$driver4 = order.driver) === null || _order$driver4 === void 0 ? void 0 : _order$driver4.cellphone)) : /*#__PURE__*/_react.default.createElement("p", {
722
+ className: "bold"
723
+ }, t('NO_DRIVER', 'No Driver')))));
724
+ }
725
+
726
+ if (column === 'advanced' && !isSelectedOrders) {
727
+ return /*#__PURE__*/_react.default.createElement(_react.default.Fragment, {
728
+ key: "advanced".concat(i, "-").concat(index)
729
+ }, /*#__PURE__*/_react.default.createElement("td", {
730
+ className: "logistic"
731
+ }, /*#__PURE__*/_react.default.createElement("div", {
732
+ className: "info"
733
+ }, /*#__PURE__*/_react.default.createElement("p", {
734
+ className: "bold"
735
+ }, t('LOGISTIC', 'Logistic')), /*#__PURE__*/_react.default.createElement("p", null, getLogisticTag(order === null || order === void 0 ? void 0 : order.logistic_status), /*#__PURE__*/_react.default.createElement(_styles.LogisticStatusDot, {
736
+ status: order === null || order === void 0 ? void 0 : order.logistic_status
737
+ })))), /*#__PURE__*/_react.default.createElement("td", {
738
+ className: "attempts"
739
+ }, /*#__PURE__*/_react.default.createElement("div", {
740
+ className: "info"
741
+ }, /*#__PURE__*/_react.default.createElement("p", {
742
+ className: "bold"
743
+ }, t('ATTEMPTS', 'Attempts')), /*#__PURE__*/_react.default.createElement("p", null, order === null || order === void 0 ? void 0 : order.logistic_attemps))), /*#__PURE__*/_react.default.createElement("td", {
744
+ className: "priority"
745
+ }, /*#__PURE__*/_react.default.createElement("div", {
746
+ className: "info"
747
+ }, /*#__PURE__*/_react.default.createElement("p", {
748
+ className: "bold"
749
+ }, t('PRIORITY', 'Priority')), /*#__PURE__*/_react.default.createElement("p", null, getPriorityTag(order === null || order === void 0 ? void 0 : order.priority), /*#__PURE__*/_react.default.createElement(_styles.PriorityDot, {
750
+ priority: order === null || order === void 0 ? void 0 : order.priority
751
+ })))));
752
+ }
753
+
754
+ if (column === 'timer' && (groupStatus === 'pending' || groupStatus === 'inProgress')) {
755
+ return /*#__PURE__*/_react.default.createElement("td", {
756
+ className: "timer",
757
+ key: "timer".concat(i, "-").concat(index)
758
+ }, /*#__PURE__*/_react.default.createElement(_styles.Timer, null, /*#__PURE__*/_react.default.createElement("p", {
759
+ className: "bold"
760
+ }, t('TIMER', 'Timer')), /*#__PURE__*/_react.default.createElement("p", {
761
+ className: getStatusClassName(getDelayMinutes(order))
762
+ }, displayDelayedTime(order))));
763
+ }
764
+
765
+ if (column === 'total') {
766
+ var _allowColumns$total2, _order$summary;
767
+
768
+ return /*#__PURE__*/_react.default.createElement("td", {
769
+ className: "orderPrice",
770
+ key: "total".concat(i, "-").concat(index)
771
+ }, /*#__PURE__*/_react.default.createElement("div", {
772
+ className: "info"
773
+ }, (allowColumns === null || allowColumns === void 0 ? void 0 : (_allowColumns$total2 = allowColumns.total) === null || _allowColumns$total2 === void 0 ? void 0 : _allowColumns$total2.visable) && /*#__PURE__*/_react.default.createElement("p", {
774
+ className: "bold"
775
+ }, order === null || order === void 0 ? void 0 : (_order$summary = order.summary) === null || _order$summary === void 0 ? void 0 : _order$summary.total, " ", order === null || order === void 0 ? void 0 : order.currency), !((order === null || order === void 0 ? void 0 : order.status) === 1 || (order === null || order === void 0 ? void 0 : order.status) === 11 || (order === null || order === void 0 ? void 0 : order.status) === 2 || (order === null || order === void 0 ? void 0 : order.status) === 5 || (order === null || order === void 0 ? void 0 : order.status) === 6 || (order === null || order === void 0 ? void 0 : order.status) === 10 || order.status === 12) && /*#__PURE__*/_react.default.createElement("p", null, order !== null && order !== void 0 && order.delivery_datetime_utc ? getTimeAgo(order === null || order === void 0 ? void 0 : order.delivery_datetime_utc) : getTimeAgo(order === null || order === void 0 ? void 0 : order.delivery_datetime, {
776
+ utc: false
777
+ }))));
778
+ }
779
+ })));
658
780
  }))), pagination && /*#__PURE__*/_react.default.createElement(_styles.WrapperPagination, null, /*#__PURE__*/_react.default.createElement(_Shared.Pagination, {
659
781
  currentPage: pagination.currentPage,
660
782
  totalPages: Math.ceil((pagination === null || pagination === void 0 ? void 0 : pagination.total) / pagination.pageSize),