@salesgenterp/ui-components 0.4.556 → 0.4.557

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/dist/index.js CHANGED
@@ -683,6 +683,63 @@ function useSystemFeatureList(_ref) {
683
683
  status: status
684
684
  };
685
685
  }
686
+ function useSystemFeatureByFieldName(_ref2) {
687
+ var apiEndPoint = _ref2.apiEndPoint,
688
+ token = _ref2.token,
689
+ moduleName = _ref2.moduleName,
690
+ featureName = _ref2.featureName,
691
+ listUpdate = _ref2.listUpdate;
692
+ var _useState5 = React.useState(),
693
+ data = _useState5[0],
694
+ setData = _useState5[1];
695
+ var _useState6 = React.useState(false),
696
+ loading = _useState6[0],
697
+ setLoading = _useState6[1];
698
+ var _useState7 = React.useState(false),
699
+ error = _useState7[0],
700
+ setError = _useState7[1];
701
+ var _useState8 = React.useState(false),
702
+ status = _useState8[0],
703
+ setStatus = _useState8[1];
704
+ var _useSystemFeatureList = useSystemFeatureList({
705
+ apiEndPoint: apiEndPoint,
706
+ token: token,
707
+ moduleName: moduleName,
708
+ listUpdate: listUpdate
709
+ }),
710
+ systemFeatureList = _useSystemFeatureList.systemFeatureList;
711
+ React.useEffect(function () {
712
+ try {
713
+ if (apiEndPoint && token && moduleName && systemFeatureList) {
714
+ setError(false);
715
+ setStatus(null);
716
+ setLoading(true);
717
+ try {
718
+ var _systemFeatureList$fi, _systemFeatureList$fi2;
719
+ var modifyData = systemFeatureList === null || systemFeatureList === void 0 ? void 0 : (_systemFeatureList$fi = systemFeatureList.find(function (item) {
720
+ return (item === null || item === void 0 ? void 0 : item.moduleName) === moduleName;
721
+ })) === null || _systemFeatureList$fi === void 0 ? void 0 : (_systemFeatureList$fi2 = _systemFeatureList$fi.systemFeatureList) === null || _systemFeatureList$fi2 === void 0 ? void 0 : _systemFeatureList$fi2.find(function (item) {
722
+ return (item === null || item === void 0 ? void 0 : item.featureName) === featureName;
723
+ });
724
+ setData(modifyData);
725
+ setLoading(false);
726
+ } catch (e) {
727
+ setLoading(false);
728
+ setError(true);
729
+ setStatus(403);
730
+ }
731
+ }
732
+ } catch (e) {
733
+ Promise.reject(e);
734
+ }
735
+ }, [moduleName, listUpdate, systemFeatureList]);
736
+ return {
737
+ systemFeatureData: data,
738
+ systemFeatureDataLoading: loading,
739
+ error: error,
740
+ status: status
741
+ };
742
+ }
686
743
  function useAllSystemFeatureValues(_ref4) {
687
744
  var apiEndPoint = _ref4.apiEndPoint,
688
745
  token = _ref4.token,
@@ -3138,7 +3195,7 @@ var ExcessPaymentDialog = function ExcessPaymentDialog(_ref2) {
3138
3195
  textAlign: 'center',
3139
3196
  padding: '16px 8px'
3140
3197
  }
3141
- }, "This excess payment link has already been used. An excess payment was previously added using this link.");
3198
+ }, "This payment link has expired because it has already been used. The payment may have been completed by you or another recipient.");
3142
3199
  }
3143
3200
  return /*#__PURE__*/React__default.createElement(AsyncDataLoadComponent, {
3144
3201
  apiEndPoint: apiEndPoint,
@@ -3187,8 +3244,41 @@ var totalIcons = [{
3187
3244
  name: 'Excess Payment',
3188
3245
  icon: /*#__PURE__*/React__default.createElement(tb.TbFileDollar, null)
3189
3246
  }];
3247
+ var DASHBOARD_ORDER_LIST_BY_NAME = {
3248
+ 'Sales Order List': {
3249
+ tabValue: 0,
3250
+ label: 'Sales Orders'
3251
+ },
3252
+ 'Invoice List': {
3253
+ tabValue: 1,
3254
+ label: 'Recent Invoices'
3255
+ },
3256
+ 'Quotation List': {
3257
+ tabValue: 2,
3258
+ label: 'Quotations'
3259
+ },
3260
+ 'Credit Memo RMA List': {
3261
+ tabValue: 3,
3262
+ label: 'Return Orders'
3263
+ }
3264
+ };
3265
+ var parseDashboardOrderListIds = function parseDashboardOrderListIds(value) {
3266
+ if (value == null || value === '' || value === false) return [];
3267
+ if (Array.isArray(value)) {
3268
+ return value.map(function (id) {
3269
+ return Number(id);
3270
+ }).filter(function (id) {
3271
+ return !Number.isNaN(id);
3272
+ });
3273
+ }
3274
+ return String(value).split(',').map(function (id) {
3275
+ return Number(String(id).trim());
3276
+ }).filter(function (id) {
3277
+ return !Number.isNaN(id);
3278
+ });
3279
+ };
3190
3280
  var Dashboard = function Dashboard(_ref) {
3191
- var _queryParams$excessPa, _customerData$custome, _selectDates$salesOrd, _selectDates$recentIn, _selectDates$salesOrd2, _selectDates$recentIn2, _customerData$custome2, _customerData$custome3, _customerData$custome4;
3281
+ var _queryParams$excessPa, _customerData$custome, _selectDates$getDateK, _selectDates$getDateK2, _customerData$custome2, _customerData$custome3, _customerData$custome4;
3192
3282
  var apiEndPoint = _ref.apiEndPoint,
3193
3283
  serviceApiEndPoint = _ref.serviceApiEndPoint,
3194
3284
  token = _ref.token,
@@ -3214,9 +3304,7 @@ var Dashboard = function Dashboard(_ref) {
3214
3304
  hideTotalCardInDashboardSummary = _ref.hideTotalCardInDashboardSummary,
3215
3305
  _ref$showOnlyRecentOr = _ref.showOnlyRecentOrder,
3216
3306
  showOnlyRecentOrder = _ref$showOnlyRecentOr === void 0 ? false : _ref$showOnlyRecentOr,
3217
- hidePayActionButton = _ref.hidePayActionButton,
3218
- hideInvoiceTab = _ref.hideInvoiceTab,
3219
- hideSalesOrderTab = _ref.hideSalesOrderTab;
3307
+ hidePayActionButton = _ref.hidePayActionButton;
3220
3308
  var _useState = React.useState({}),
3221
3309
  customerData = _useState[0],
3222
3310
  setCustomerData = _useState[1];
@@ -3234,6 +3322,14 @@ var Dashboard = function Dashboard(_ref) {
3234
3322
  salesOrders: {
3235
3323
  startDate: null,
3236
3324
  endDate: null
3325
+ },
3326
+ quotations: {
3327
+ startDate: null,
3328
+ endDate: null
3329
+ },
3330
+ returnOrders: {
3331
+ startDate: null,
3332
+ endDate: null
3237
3333
  }
3238
3334
  }),
3239
3335
  selectDates = _useState4[0],
@@ -3251,19 +3347,47 @@ var Dashboard = function Dashboard(_ref) {
3251
3347
  }),
3252
3348
  isExcessPaymentModal = _useState7[0],
3253
3349
  setIsExcessPaymentModal = _useState7[1];
3254
- var _useState8 = React.useState(0),
3350
+ var _ref2 = useSystemFeatureByFieldName({
3351
+ apiEndPoint: apiEndPoint,
3352
+ token: token,
3353
+ moduleName: 'Ecommerce',
3354
+ featureName: 'dashboardOrderList'
3355
+ }) || {},
3356
+ dashboardOrderListFeature = _ref2.systemFeatureData;
3357
+ var selectedDashboardOrderIds = React.useMemo(function () {
3358
+ return parseDashboardOrderListIds(dashboardOrderListFeature === null || dashboardOrderListFeature === void 0 ? void 0 : dashboardOrderListFeature.featureValue);
3359
+ }, [dashboardOrderListFeature === null || dashboardOrderListFeature === void 0 ? void 0 : dashboardOrderListFeature.featureValue]);
3360
+ var featureValueListById = React.useMemo(function () {
3361
+ var list = dashboardOrderListFeature === null || dashboardOrderListFeature === void 0 ? void 0 : dashboardOrderListFeature.featureValueList;
3362
+ if (!Array.isArray(list)) return {};
3363
+ return list.reduce(function (acc, item) {
3364
+ if ((item === null || item === void 0 ? void 0 : item.id) != null && item !== null && item !== void 0 && item.name) {
3365
+ acc[Number(item.id)] = item.name;
3366
+ }
3367
+ return acc;
3368
+ }, {});
3369
+ }, [dashboardOrderListFeature === null || dashboardOrderListFeature === void 0 ? void 0 : dashboardOrderListFeature.featureValueList]);
3370
+ var visibleTabs = React.useMemo(function () {
3371
+ if (!(selectedDashboardOrderIds !== null && selectedDashboardOrderIds !== void 0 && selectedDashboardOrderIds.length)) return [];
3372
+ return selectedDashboardOrderIds.map(function (id) {
3373
+ var featureName = featureValueListById === null || featureValueListById === void 0 ? void 0 : featureValueListById[id];
3374
+ return featureName ? DASHBOARD_ORDER_LIST_BY_NAME === null || DASHBOARD_ORDER_LIST_BY_NAME === void 0 ? void 0 : DASHBOARD_ORDER_LIST_BY_NAME[featureName] : null;
3375
+ }).filter(Boolean);
3376
+ }, [selectedDashboardOrderIds, featureValueListById]);
3377
+ var _useState8 = React.useState(null),
3255
3378
  value = _useState8[0],
3256
3379
  setValue = _useState8[1];
3257
- var showSalesOrderTable = !hideSalesOrderTab;
3258
- var showInvoiceTable = !hideInvoiceTab;
3259
- var showTableSection = showSalesOrderTable || showInvoiceTable;
3260
3380
  React.useEffect(function () {
3261
- if (hideSalesOrderTab && !hideInvoiceTab) {
3262
- setValue(1);
3263
- } else if (hideInvoiceTab && !hideSalesOrderTab) {
3264
- setValue(0);
3381
+ if (!(visibleTabs !== null && visibleTabs !== void 0 && visibleTabs.length)) return;
3382
+ var isCurrentVisible = value != null && visibleTabs.some(function (tab) {
3383
+ return (tab === null || tab === void 0 ? void 0 : tab.tabValue) === value;
3384
+ });
3385
+ if (!isCurrentVisible) {
3386
+ var _visibleTabs$0$tabVal, _visibleTabs$;
3387
+ setValue((_visibleTabs$0$tabVal = visibleTabs === null || visibleTabs === void 0 ? void 0 : (_visibleTabs$ = visibleTabs[0]) === null || _visibleTabs$ === void 0 ? void 0 : _visibleTabs$.tabValue) != null ? _visibleTabs$0$tabVal : null);
3388
+ setTriggerTableData(getRandomString());
3265
3389
  }
3266
- }, [hideSalesOrderTab, hideInvoiceTab]);
3390
+ }, [visibleTabs, value]);
3267
3391
  var handleChange = function handleChange(event, newValue) {
3268
3392
  setValue(newValue);
3269
3393
  setTriggerTableData(getRandomString());
@@ -3274,11 +3398,23 @@ var Dashboard = function Dashboard(_ref) {
3274
3398
  'aria-controls': "simple-tabpanel-" + index
3275
3399
  };
3276
3400
  }
3401
+ var getInvoicePathByTab = function getInvoicePathByTab(tabValue) {
3402
+ if (tabValue === 0) return 'salesOrder';
3403
+ if (tabValue === 1) return 'sales-order';
3404
+ if (tabValue === 2) return 'quotation';
3405
+ if (tabValue === 3) return 'rma/product';
3406
+ };
3277
3407
  var openInvoiceData = function openInvoiceData(orderId) {
3278
3408
  if (serviceApiEndPoint) {
3279
- window.open(serviceApiEndPoint + "/" + (value === 0 ? 'salesOrder' : 'sales-order') + "/invoice/" + orderId + "?token=" + token + "&defaultStoreId=" + defaultStoreId + "&storeIdList=" + storeIdList + "&isEcommerce=true", '_blank', 'noopener,noreferrer');
3409
+ window.open(serviceApiEndPoint + "/" + getInvoicePathByTab(value) + "/invoice/" + orderId + "?token=" + token + "&defaultStoreId=" + defaultStoreId + "&storeIdList=" + storeIdList + "&isEcommerce=true", '_blank', 'noopener,noreferrer');
3280
3410
  }
3281
3411
  };
3412
+ var getDateKey = function getDateKey(tabValue) {
3413
+ if (tabValue === 0) return 'salesOrders';
3414
+ if (tabValue === 1) return 'recentInvoices';
3415
+ if (tabValue === 2) return 'quotations';
3416
+ if (tabValue === 3) return 'returnOrders';
3417
+ };
3282
3418
  var onDateChange = function onDateChange(data) {
3283
3419
  var startDate = moment(data === null || data === void 0 ? void 0 : data.startDate).startOf('day');
3284
3420
  var endDate = moment(data === null || data === void 0 ? void 0 : data.endDate).endOf('day');
@@ -3292,7 +3428,7 @@ var Dashboard = function Dashboard(_ref) {
3292
3428
  };
3293
3429
  setSelectDates(function (prev) {
3294
3430
  var _extends2;
3295
- return _extends({}, prev, (_extends2 = {}, _extends2[value === 0 ? 'recentInvoices' : 'salesOrders'] = newDates, _extends2));
3431
+ return _extends({}, prev, (_extends2 = {}, _extends2[getDateKey(value)] = newDates, _extends2));
3296
3432
  });
3297
3433
  setTriggerTableData(getRandomString());
3298
3434
  };
@@ -3305,6 +3441,7 @@ var Dashboard = function Dashboard(_ref) {
3305
3441
  token: token
3306
3442
  })).then(function (data) {
3307
3443
  if (data) {
3444
+ var _link$parentNode;
3308
3445
  var blob = new Blob([data]);
3309
3446
  var url1 = window.URL.createObjectURL(blob);
3310
3447
  var link = document.createElement('a');
@@ -3312,7 +3449,7 @@ var Dashboard = function Dashboard(_ref) {
3312
3449
  link.setAttribute('download', "invoice-" + orderId + ".xls");
3313
3450
  document.body.appendChild(link);
3314
3451
  link.click();
3315
- link.parentNode.removeChild(link);
3452
+ (_link$parentNode = link.parentNode) === null || _link$parentNode === void 0 ? void 0 : _link$parentNode.removeChild(link);
3316
3453
  }
3317
3454
  });
3318
3455
  } catch (e) {
@@ -3362,13 +3499,11 @@ var Dashboard = function Dashboard(_ref) {
3362
3499
  }, {
3363
3500
  id: 'trackingNumber',
3364
3501
  label: 'Tracking No.',
3365
- format: function format(value, _ref2) {
3366
- var trackingNumber = _ref2.trackingNumber,
3367
- trackingNumberUrl = _ref2.trackingNumberUrl;
3502
+ format: function format(value, record) {
3368
3503
  return /*#__PURE__*/React__default.createElement("a", {
3369
- href: trackingNumberUrl,
3504
+ href: record === null || record === void 0 ? void 0 : record.trackingNumberUrl,
3370
3505
  target: '_blank'
3371
- }, trackingNumber);
3506
+ }, record === null || record === void 0 ? void 0 : record.trackingNumber);
3372
3507
  }
3373
3508
  }, !hideInvoiceAction && {
3374
3509
  id: 'orderId',
@@ -3465,6 +3600,101 @@ var Dashboard = function Dashboard(_ref) {
3465
3600
  })));
3466
3601
  }
3467
3602
  }];
3603
+ var quotaionColumns = [{
3604
+ id: 'quotationId',
3605
+ label: 'ID'
3606
+ }, {
3607
+ id: 'insertedTimestamp',
3608
+ label: 'Date',
3609
+ format: function format(value) {
3610
+ return getLocalTime({
3611
+ time: value
3612
+ });
3613
+ }
3614
+ }, {
3615
+ id: 'totalAmount',
3616
+ label: 'Total Amount',
3617
+ format: function format(value) {
3618
+ return renderMoney(value);
3619
+ }
3620
+ }, {
3621
+ id: 'status',
3622
+ label: 'Status',
3623
+ format: function format(value) {
3624
+ return /*#__PURE__*/React__default.createElement(material.Grid, {
3625
+ container: true
3626
+ }, /*#__PURE__*/React__default.createElement(StatusContainer, {
3627
+ item: true,
3628
+ primaryColor: primaryColor
3629
+ }, value));
3630
+ }
3631
+ }, !hideInvoiceAction && {
3632
+ id: 'quotationId',
3633
+ label: 'Action',
3634
+ align: 'center',
3635
+ format: function format(value, record) {
3636
+ return /*#__PURE__*/React__default.createElement("span", null, /*#__PURE__*/React__default.createElement(material.IconButton, {
3637
+ onClick: function onClick() {
3638
+ return openInvoiceData(value);
3639
+ },
3640
+ style: {
3641
+ color: primaryColor,
3642
+ padding: 2
3643
+ }
3644
+ }, /*#__PURE__*/React__default.createElement(md.MdRemoveRedEye, {
3645
+ style: {
3646
+ fontSize: '1.6rem'
3647
+ }
3648
+ })));
3649
+ }
3650
+ }];
3651
+ var returnOrderColumns = [{
3652
+ id: 'returnOrderId',
3653
+ label: 'ID'
3654
+ }, {
3655
+ id: 'insertedTimestamp',
3656
+ label: 'Date',
3657
+ format: function format(value) {
3658
+ return getLocalTime({
3659
+ time: value
3660
+ });
3661
+ }
3662
+ }, {
3663
+ id: 'totalAmount',
3664
+ label: 'Total Amount',
3665
+ format: function format(value) {
3666
+ return renderMoney(value);
3667
+ }
3668
+ }, {
3669
+ id: 'status',
3670
+ label: 'Status',
3671
+ format: function format(value) {
3672
+ return /*#__PURE__*/React__default.createElement(material.Grid, {
3673
+ container: true
3674
+ }, /*#__PURE__*/React__default.createElement(StatusContainer, {
3675
+ item: true,
3676
+ primaryColor: primaryColor
3677
+ }, value));
3678
+ }
3679
+ }];
3680
+ var tableColumnsByTab = {
3681
+ 0: salesOrderColumns,
3682
+ 1: columns,
3683
+ 2: quotaionColumns,
3684
+ 3: returnOrderColumns
3685
+ };
3686
+ var tableApiPathByTab = {
3687
+ 0: 'salesOrderTable',
3688
+ 1: 'orderTable',
3689
+ 2: 'quotationTable',
3690
+ 3: 'returnOrderTable'
3691
+ };
3692
+ var tableTitleByTab = {
3693
+ 0: 'Sales orders',
3694
+ 1: 'Recent Invoices',
3695
+ 2: 'Quotations',
3696
+ 3: 'Return Orders'
3697
+ };
3468
3698
  React.useEffect(function () {
3469
3699
  (function () {
3470
3700
  try {
@@ -3701,10 +3931,10 @@ var Dashboard = function Dashboard(_ref) {
3701
3931
  style: {
3702
3932
  marginTop: '1rem'
3703
3933
  }
3704
- })))))), showTableSection && /*#__PURE__*/React__default.createElement(TableContainer, null, /*#__PURE__*/React__default.createElement(APITable, {
3934
+ })))))), (visibleTabs === null || visibleTabs === void 0 ? void 0 : visibleTabs.length) > 0 && value != null && /*#__PURE__*/React__default.createElement(TableContainer, null, /*#__PURE__*/React__default.createElement(APITable, {
3705
3935
  key: value,
3706
3936
  cacheFilters: true,
3707
- extraFilterParams: value === 0 ? selectDates.recentInvoices : selectDates.salesOrders,
3937
+ extraFilterParams: selectDates === null || selectDates === void 0 ? void 0 : selectDates[getDateKey(value)],
3708
3938
  tableHeaderContent: /*#__PURE__*/React__default.createElement(material.Grid, {
3709
3939
  container: true,
3710
3940
  justifyContent: "space-between",
@@ -3712,7 +3942,7 @@ var Dashboard = function Dashboard(_ref) {
3712
3942
  }, /*#__PURE__*/React__default.createElement(material.Grid, {
3713
3943
  item: true,
3714
3944
  xs: 12
3715
- }, showSalesOrderTable && showInvoiceTable && /*#__PURE__*/React__default.createElement(material.Box, {
3945
+ }, /*#__PURE__*/React__default.createElement(material.Box, {
3716
3946
  sx: {
3717
3947
  borderBottom: 1,
3718
3948
  borderColor: 'divider'
@@ -3723,11 +3953,13 @@ var Dashboard = function Dashboard(_ref) {
3723
3953
  "aria-label": "basic tabs example",
3724
3954
  primaryColor: primaryColor,
3725
3955
  fontColor: fontColor
3726
- }, /*#__PURE__*/React__default.createElement(material.Tab, _extends({
3727
- label: "Sales Orders"
3728
- }, a11yProps(0))), /*#__PURE__*/React__default.createElement(material.Tab, _extends({
3729
- label: "Recent Invoices"
3730
- }, a11yProps(1)))))), /*#__PURE__*/React__default.createElement(TypographyContainer$2, {
3956
+ }, visibleTabs === null || visibleTabs === void 0 ? void 0 : visibleTabs.map(function (tab) {
3957
+ return /*#__PURE__*/React__default.createElement(material.Tab, _extends({
3958
+ key: tab === null || tab === void 0 ? void 0 : tab.tabValue,
3959
+ label: tab === null || tab === void 0 ? void 0 : tab.label,
3960
+ value: tab === null || tab === void 0 ? void 0 : tab.tabValue
3961
+ }, a11yProps(tab === null || tab === void 0 ? void 0 : tab.tabValue)));
3962
+ })))), /*#__PURE__*/React__default.createElement(TypographyContainer$2, {
3731
3963
  variant: "h4",
3732
3964
  gutterBottom: true,
3733
3965
  fontColor: fontColor,
@@ -3737,14 +3969,14 @@ var Dashboard = function Dashboard(_ref) {
3737
3969
  padding: '1rem 0',
3738
3970
  margin: 0
3739
3971
  }
3740
- }, value === 0 ? 'Sales orders' : 'Recent Invoices'), /*#__PURE__*/React__default.createElement(material.Grid, {
3972
+ }, tableTitleByTab === null || tableTitleByTab === void 0 ? void 0 : tableTitleByTab[value]), /*#__PURE__*/React__default.createElement(material.Grid, {
3741
3973
  item: true
3742
3974
  }, /*#__PURE__*/React__default.createElement(DateRangePicker, {
3743
3975
  fontColor: fontColor,
3744
3976
  primaryColor: primaryColor,
3745
3977
  onChange: onDateChange,
3746
- initialStartDate: value === 0 ? selectDates === null || selectDates === void 0 ? void 0 : (_selectDates$salesOrd = selectDates.salesOrders) === null || _selectDates$salesOrd === void 0 ? void 0 : _selectDates$salesOrd.startDate : selectDates === null || selectDates === void 0 ? void 0 : (_selectDates$recentIn = selectDates.recentInvoices) === null || _selectDates$recentIn === void 0 ? void 0 : _selectDates$recentIn.startDate,
3747
- initialEndDate: value === 0 ? selectDates === null || selectDates === void 0 ? void 0 : (_selectDates$salesOrd2 = selectDates.salesOrders) === null || _selectDates$salesOrd2 === void 0 ? void 0 : _selectDates$salesOrd2.endDate : selectDates === null || selectDates === void 0 ? void 0 : (_selectDates$recentIn2 = selectDates.recentInvoices) === null || _selectDates$recentIn2 === void 0 ? void 0 : _selectDates$recentIn2.endDate
3978
+ initialStartDate: selectDates === null || selectDates === void 0 ? void 0 : (_selectDates$getDateK = selectDates[getDateKey(value)]) === null || _selectDates$getDateK === void 0 ? void 0 : _selectDates$getDateK.startDate,
3979
+ initialEndDate: selectDates === null || selectDates === void 0 ? void 0 : (_selectDates$getDateK2 = selectDates[getDateKey(value)]) === null || _selectDates$getDateK2 === void 0 ? void 0 : _selectDates$getDateK2.endDate
3748
3980
  }))),
3749
3981
  listUpdate: triggerTableData,
3750
3982
  pagination: false,
@@ -3752,9 +3984,9 @@ var Dashboard = function Dashboard(_ref) {
3752
3984
  x: 1000
3753
3985
  },
3754
3986
  tableId: "master-child-map",
3755
- columns: value === 0 ? salesOrderColumns : columns,
3987
+ columns: (tableColumnsByTab === null || tableColumnsByTab === void 0 ? void 0 : tableColumnsByTab[value]) || salesOrderColumns,
3756
3988
  apiData: {
3757
- url: "/ecommerce/dashboard/" + (value === 0 ? 'salesOrderTable' : 'orderTable'),
3989
+ url: "/ecommerce/dashboard/" + ((tableApiPathByTab === null || tableApiPathByTab === void 0 ? void 0 : tableApiPathByTab[value]) || 'salesOrderTable'),
3758
3990
  apiEndPoint: apiEndPoint,
3759
3991
  token: token
3760
3992
  },
@@ -5726,7 +5958,7 @@ var UpcomingACHPayments = function UpcomingACHPayments(_ref) {
5726
5958
  var TableContainer$2 = styled__default.div(_templateObject$l || (_templateObject$l = _taggedTemplateLiteralLoose(["\n margin: 1.2rem 0;\n border-radius: 14px;\n"])));
5727
5959
 
5728
5960
  var _templateObject$m, _templateObject2$d, _templateObject3$9, _templateObject4$7;
5729
- var _excluded$5 = ["apiEndPoint", "serviceApiEndPoint", "token", "primaryColor", "secondaryColor", "backgroundColor", "fontColor", "darkMode", "onChangeColors", "path", "onChangePath", "maxWidth", "logoUrl", "sectionLeftImageSection", "exploreCategoryImage", "sectionRightImageSection", "discountImageSection", "disabledUpdateProfileFromDashboard", "hideTotalCardInDashboardSummary", "showOnlyRecentOrder", "hidePayActionButton", "hideSalesOrderTab", "hideInvoiceTab", "hideAddAccessPaymentButton"];
5961
+ var _excluded$5 = ["apiEndPoint", "serviceApiEndPoint", "token", "primaryColor", "secondaryColor", "backgroundColor", "fontColor", "darkMode", "onChangeColors", "path", "onChangePath", "maxWidth", "logoUrl", "sectionLeftImageSection", "exploreCategoryImage", "sectionRightImageSection", "discountImageSection", "disabledUpdateProfileFromDashboard", "hideTotalCardInDashboardSummary", "showOnlyRecentOrder", "hidePayActionButton", "hideAddAccessPaymentButton"];
5730
5962
  var AccountDetails = function AccountDetails(_ref) {
5731
5963
  var _storeData$map, _storeData$find, _storeData$;
5732
5964
  var apiEndPoint = _ref.apiEndPoint,
@@ -5756,10 +5988,6 @@ var AccountDetails = function AccountDetails(_ref) {
5756
5988
  showOnlyRecentOrder = _ref$showOnlyRecentOr === void 0 ? false : _ref$showOnlyRecentOr,
5757
5989
  _ref$hidePayActionBut = _ref.hidePayActionButton,
5758
5990
  hidePayActionButton = _ref$hidePayActionBut === void 0 ? false : _ref$hidePayActionBut,
5759
- _ref$hideSalesOrderTa = _ref.hideSalesOrderTab,
5760
- hideSalesOrderTab = _ref$hideSalesOrderTa === void 0 ? false : _ref$hideSalesOrderTa,
5761
- _ref$hideInvoiceTab = _ref.hideInvoiceTab,
5762
- hideInvoiceTab = _ref$hideInvoiceTab === void 0 ? false : _ref$hideInvoiceTab,
5763
5991
  _ref$hideAddAccessPay = _ref.hideAddAccessPaymentButton,
5764
5992
  hideAddAccessPaymentButton = _ref$hideAddAccessPay === void 0 ? false : _ref$hideAddAccessPay,
5765
5993
  props = _objectWithoutPropertiesLoose(_ref, _excluded$5);
@@ -5934,8 +6162,6 @@ var AccountDetails = function AccountDetails(_ref) {
5934
6162
  hideTotalCardInDashboardSummary: hideTotalCardInDashboardSummary,
5935
6163
  showOnlyRecentOrder: showOnlyRecentOrder,
5936
6164
  hidePayActionButton: hidePayActionButton,
5937
- hideSalesOrderTab: hideSalesOrderTab,
5938
- hideInvoiceTab: hideInvoiceTab,
5939
6165
  hideAddAccessPaymentButton: hideAddAccessPaymentButton
5940
6166
  });
5941
6167
  case 'myProfile':
@@ -10520,7 +10746,7 @@ var checkMinMaxQty = function checkMinMaxQty(_ref2) {
10520
10746
  };
10521
10747
 
10522
10748
  var _templateObject$B, _templateObject2$r, _templateObject3$l;
10523
- var CartDrawerProduct = styled__default.div(_templateObject$B || (_templateObject$B = _taggedTemplateLiteralLoose(["\n width: 100%;\n max-width: 100%;\n display: flex;\n flex-direction: row;\n height: 100px;\n justify-content: space-around;\n align-items: center;\n overflow: hidden;\n margin-bottom: 1rem;\n user-select: none;\n background: #f2f2f290;\n border: 1px solid #f2f2f290;\n padding: 0.5rem;\n border-radius: 12px;\n box-sizing: border-box;\n\n img {\n width: 20%;\n max-height: 100%;\n /* aspect-ratio: 1; */\n object-fit: contain;\n }\n .middleSection {\n width: 60%;\n padding-left: 0.8rem;\n height: 100%;\n h6 {\n font-size: 1.1rem;\n font-weight: bold;\n margin: 0;\n }\n .name {\n font-size: 0.9rem;\n line-height: 1.2rem;\n width: 100%;\n word-wrap: break-word;\n overflow: hidden;\n text-overflow: ellipsis;\n transition: 0.3s;\n cursor: pointer;\n &:hover {\n color: ", ";\n }\n }\n }\n .endSection {\n // width: 20%;\n height: 95%;\n .icon {\n cursor: pointer;\n transition: 0.4s;\n &:hover {\n color: red;\n }\n }\n }\n @media only screen and (max-width: 768px) {\n .closeIcon {\n font-size: 1rem;\n }\n }\n @media only screen and (max-width: 340px) {\n .middleSection {\n h6 {\n font-size: 0.9rem;\n }\n }\n }\n"])), function (props) {
10749
+ var CartDrawerProduct = styled__default.div(_templateObject$B || (_templateObject$B = _taggedTemplateLiteralLoose(["\n width: 100%;\n max-width: 100%;\n display: flex;\n flex-direction: row;\n height: 113px;\n justify-content: space-around;\n align-items: center;\n overflow: hidden;\n margin-bottom: 1rem;\n user-select: none;\n background: #f2f2f290;\n border: 1px solid #f2f2f290;\n padding: 0.5rem;\n border-radius: 12px;\n box-sizing: border-box;\n\n img {\n width: 20%;\n max-height: 100%;\n /* aspect-ratio: 1; */\n object-fit: contain;\n }\n .middleSection {\n width: 60%;\n padding-left: 0.8rem;\n height: 100%;\n h6 {\n font-size: 1.1rem;\n font-weight: bold;\n margin: 0;\n }\n .name {\n font-size: 0.9rem;\n line-height: 1.2rem;\n width: 100%;\n word-wrap: break-word;\n overflow: hidden;\n text-overflow: ellipsis;\n transition: 0.3s;\n cursor: pointer;\n &:hover {\n color: ", ";\n }\n }\n }\n .endSection {\n // width: 20%;\n height: 95%;\n .icon {\n cursor: pointer;\n transition: 0.4s;\n &:hover {\n color: red;\n }\n }\n }\n @media only screen and (max-width: 768px) {\n .closeIcon {\n font-size: 1rem;\n }\n }\n @media only screen and (max-width: 340px) {\n .middleSection {\n h6 {\n font-size: 0.9rem;\n }\n }\n }\n"])), function (props) {
10524
10750
  return props.color || 'grey';
10525
10751
  });
10526
10752
  var CartDrawerQtBox = styled__default.div(_templateObject2$r || (_templateObject2$r = _taggedTemplateLiteralLoose(["\n height: 30px;\n width: 86px;\n border: 1px solid rgb(211, 210, 210);\n display: flex;\n align-items: center;\n justify-content: space-between;\n font-size: 13.5px;\n color: #323232;\n padding: 0 0.5rem;\n border-radius: 5px;\n max-width: 100%;\n span {\n cursor: pointer;\n height: 100%;\n display: grid;\n place-items: center;\n }\n .qt {\n font-size: 12px;\n color: black;\n font-weight: 500;\n cursor: auto;\n input {\n width: 40px;\n height: 100%;\n text-align: center;\n border: none;\n }\n }\n @media only screen and (max-width: 600px) {\n min-width: 55px;\n aspect-ratio: 1/2;\n font-size: 10px;\n }\n @media only screen and (max-width: 340px) {\n min-width: 50px;\n aspect-ratio: 1/2;\n height: 22px;\n font-size: 8px;\n }\n"])));