@bjsdistribution/dms-client-return 0.0.34 → 0.0.36

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.
@@ -3956,14 +3956,6 @@ var atomItemsPerReturnPage = /*#__PURE__*/atom(50);
3956
3956
  var useItemsPerReturnPage = function useItemsPerReturnPage() {
3957
3957
  return useAtom(atomItemsPerReturnPage);
3958
3958
  };
3959
- //stats data overview
3960
- var UsePaginationOverviewData = function UsePaginationOverviewData() {
3961
- return useAtom(atomPaginationData);
3962
- };
3963
- var atomItemsPerOverviewPage = /*#__PURE__*/atom(50);
3964
- var useItemsPerOverviewPage = function useItemsPerOverviewPage() {
3965
- return useAtom(atomItemsPerOverviewPage);
3966
- };
3967
3959
  var countStatus = /*#__PURE__*/atom([]);
3968
3960
  var useCountData = function useCountData() {
3969
3961
  return useAtom(countStatus);
@@ -8888,23 +8880,6 @@ function SelectionFilter() {
8888
8880
  localStorage.setItem('clientName', option == null ? void 0 : option.label);
8889
8881
  localStorage.setItem('clientId', value == null ? void 0 : value.toString());
8890
8882
  localStorage.setItem('account_number', option == null ? void 0 : option.account_number);
8891
- var selectedClient = clientOptions == null ? void 0 : clientOptions.find(function (client) {
8892
- return (client == null ? void 0 : client.value) === value;
8893
- });
8894
- var clientActions = (selectedClient == null ? void 0 : selectedClient.actions) || [];
8895
- var clientLocations = (selectedClient == null ? void 0 : selectedClient.return_locations) || [];
8896
- setActionTypeOptions(clientActions == null ? void 0 : clientActions.map(function (action) {
8897
- return {
8898
- label: action,
8899
- value: action
8900
- };
8901
- }));
8902
- setLocationOptions(clientLocations == null ? void 0 : clientLocations.map(function (action) {
8903
- return {
8904
- label: action,
8905
- value: action
8906
- };
8907
- }));
8908
8883
  //set payload
8909
8884
  setReturnPayload(function (prevState) {
8910
8885
  return _extends({}, prevState, {
@@ -8974,6 +8949,23 @@ function SelectionFilter() {
8974
8949
  if (storedName) {
8975
8950
  setTableName(storedName);
8976
8951
  }
8952
+ var selectedClientValue = clientOptions == null ? void 0 : clientOptions.find(function (client) {
8953
+ return (client == null ? void 0 : client.value) === selectedClient;
8954
+ });
8955
+ var clientActions = (selectedClientValue == null ? void 0 : selectedClientValue.actions) || [];
8956
+ var clientLocations = (selectedClientValue == null ? void 0 : selectedClientValue.return_locations) || [];
8957
+ setActionTypeOptions(Array.isArray(clientActions) ? clientActions == null ? void 0 : clientActions.map(function (action) {
8958
+ return {
8959
+ label: action,
8960
+ value: action
8961
+ };
8962
+ }) : []);
8963
+ setLocationOptions(Array.isArray(clientLocations) ? clientLocations == null ? void 0 : clientLocations.map(function (location) {
8964
+ return {
8965
+ label: location,
8966
+ value: location
8967
+ };
8968
+ }) : []);
8977
8969
  //client value
8978
8970
  if (storedClientId) {
8979
8971
  dispatch({
@@ -9002,7 +8994,7 @@ function SelectionFilter() {
9002
8994
  });
9003
8995
  }
9004
8996
  //location value
9005
- if (selectedLocationValue && selectedLocationValue.length > 0) {
8997
+ if (selectedLocationValue && (selectedLocationValue == null ? void 0 : selectedLocationValue.length) > 0) {
9006
8998
  dispatch({
9007
8999
  type: 'SET_LOCATION_FILTER',
9008
9000
  payload: selectedLocationValue
@@ -11239,21 +11231,18 @@ var overviewfiltersReducerAtom = /*#__PURE__*/atom(function (get) {
11239
11231
  });
11240
11232
 
11241
11233
  var _templateObject$24, _templateObject2$1z, _templateObject3$T;
11234
+ // import { notification } from 'antd';
11235
+ // import Pagination from './table-view/Pagination';
11242
11236
  // import Pagination from './table-view/Pagination';
11243
11237
  // import { overviewfiltersReducerAtom } from './header-filters/overViewFilter';
11244
11238
  function ReturnMainTable() {
11245
11239
  var _useAtom = useAtom(overviewfiltersReducerAtom),
11246
11240
  state = _useAtom[0];
11247
- var _UsePaginationOvervie = UsePaginationOverviewData(),
11248
- paginationObj = _UsePaginationOvervie[0];
11249
- var _useState = useState(1),
11250
- setCurrentPage = _useState[1];
11251
- var _useItemsPerOverviewP = useItemsPerOverviewPage(),
11252
- itemsPerPage = _useItemsPerOverviewP[0],
11253
- setItemsPerPage = _useItemsPerOverviewP[1];
11241
+ // const [paginationObj] = UsePaginationOverviewData();
11242
+ // const [, setCurrentPage] = useState(1);
11243
+ // const [itemsPerPage, setItemsPerPage] = useItemsPerOverviewPage();
11254
11244
  var pagination = state['x-pagination'];
11255
- var page = paginationObj.page,
11256
- total = paginationObj.total;
11245
+ // const { page, total } = paginationObj;
11257
11246
  // const [selectedClient] = useTableName();
11258
11247
  var _useStickyStatus = useStickyStatus(),
11259
11248
  isScrolled = _useStickyStatus[0];
@@ -11263,12 +11252,12 @@ function ReturnMainTable() {
11263
11252
  setClientData = _useClientData[1];
11264
11253
  var _useTableName = useTableName(),
11265
11254
  tableName = _useTableName[0];
11266
- var handlePageChange = function handlePageChange(page) {
11267
- setCurrentPage(page);
11268
- };
11269
- var handleItemsPerPageChange = function handleItemsPerPageChange(itemsPerPage) {
11270
- setItemsPerPage(itemsPerPage);
11271
- };
11255
+ // const handlePageChange = (page: number) => {
11256
+ // setCurrentPage(page);
11257
+ // };
11258
+ // const handleItemsPerPageChange = (itemsPerPage: number) => {
11259
+ // setItemsPerPage(itemsPerPage);
11260
+ // };
11272
11261
  var _useApiHook = useApiHook({
11273
11262
  endpoint: "/return_orders/stats/",
11274
11263
  method: 'GET',
@@ -11297,13 +11286,7 @@ function ReturnMainTable() {
11297
11286
  className: " " + (isScrolled ? 'stickyTableHead' : '')
11298
11287
  }, React.createElement("div", {
11299
11288
  className: "Tableconatiner"
11300
- }, React.createElement(HeaderFilter, null), React.createElement(Container$18, null, React.createElement(Row$7, null, React.createElement(Text$8, null, "Client Return"), tableName ? React.createElement(ReturnFilter, null) : React.createElement(Filters, null)), React.createElement(ReturnTable$1, null)), total > 0 && React.createElement(Pagination, {
11301
- currentPage: page,
11302
- totalItems: total,
11303
- itemsPerPage: itemsPerPage,
11304
- onPageChange: handlePageChange,
11305
- onItemsPerPageChange: handleItemsPerPageChange
11306
- }))));
11289
+ }, React.createElement(HeaderFilter, null), React.createElement(Container$18, null, React.createElement(Row$7, null, React.createElement(Text$8, null, "Client Return"), tableName ? React.createElement(ReturnFilter, null) : React.createElement(Filters, null)), React.createElement(ReturnTable$1, null)))));
11307
11290
  }
11308
11291
  var Row$7 = /*#__PURE__*/styled.div(_templateObject$24 || (_templateObject$24 = /*#__PURE__*/_taggedTemplateLiteralLoose(["\n display: flex;\n justify-content: space-between;\n align-items: center;\n"])));
11309
11292
  var Container$18 = /*#__PURE__*/styled.div(_templateObject2$1z || (_templateObject2$1z = /*#__PURE__*/_taggedTemplateLiteralLoose(["\n position: relative;\n top: -46px;\n"])));