oa-componentbook 1.0.1-stage.362 → 1.0.1-stage.363

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.
@@ -51,7 +51,7 @@ function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key i
51
51
  function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return typeof key === "symbol" ? key : String(key); }
52
52
  function _toPrimitive(input, hint) { if (typeof input !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (typeof res !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); } /* eslint-disable */
53
53
  function GenricLayOut(_ref) {
54
- var _state$misc22, _imageViewer$content, _imageViewer$content2, _leftHeaderFirstButto, _leftHeaderFirstButto2, _state$customDrawer3, _state$customDrawer4, _tabs$list, _tables$columns3, _tables$columns4, _tabs$active3, _state$tables4, _tables$selectionType, _tabs$active4, _tables$selectionType2, _tables$pagination17, _drawer$data, _tabs$active5, _drawer$data$drawer$a, _drawer$data2, _tabs$active6, _tabs$active7, _nestedDrawer$data, _nestedDrawer$data$ca, _nestedDrawer$data2, _customDrawer$data, _customDrawer$data2, _contentPanel$dataSou, _tables$tableFooter, _tables$selectedRowKe, _tables$tableFooter2, _tables$tableFooter3, _tables$tableFooter5;
54
+ var _parent$children, _state$misc20, _imageViewer$content, _imageViewer$content2, _leftHeaderFirstButto, _leftHeaderFirstButto2, _customDrawer$applied12, _state$customDrawer3, _state$customDrawer4, _tabs$list, _tables$columns3, _tables$columns4, _tabs$active3, _state$tables3, _tables$selectionType, _tabs$active4, _tables$selectionType2, _tables$pagination33, _drawer$data, _tabs$active5, _drawer$data$drawer$a, _drawer$data2, _tabs$active6, _tabs$active7, _nestedDrawer$data, _nestedDrawer$data$ca, _nestedDrawer$data2, _customDrawer$data, _customDrawer$data2, _contentPanel$dataSou, _tables$tableFooter, _tables$selectedRowKe, _tables$tableFooter2, _tables$tableFooter3, _tables$tableFooter5;
55
55
  let {
56
56
  config,
57
57
  getInitialData,
@@ -76,12 +76,10 @@ function GenricLayOut(_ref) {
76
76
  handleActionOnTableCTAClick,
77
77
  handleModalCloseSuccess,
78
78
  handleSubHeadingSelectClick,
79
- handleCollapsibleKeyData,
80
- handleTableFooterApi
79
+ handleCollapsibleKeyData
81
80
  } = {}
82
81
  } = _ref;
83
82
  const [state, dispatch] = (0, _react.useReducer)(_layoutReducer.genericLayoutReducer, config !== null && config !== void 0 ? config : _layoutReducer.initialState);
84
- const [headerButtons, setHeaderButtons] = (0, _react.useState)(null);
85
83
  const stateRef = (0, _react.useRef)(state);
86
84
  const notificationRef = (0, _react.useRef)(null);
87
85
  const openNotification = (0, _react.useCallback)(params => notificationRef.current.openNotification(params), []);
@@ -110,25 +108,10 @@ function GenricLayOut(_ref) {
110
108
  (0, _react.useEffect)(() => {
111
109
  stateRef.current = state;
112
110
  }, [state]);
113
- (0, _react.useEffect)(() => {
114
- const observer = new MutationObserver(e => {
115
- const parent = document.querySelector(".oaheaderButtons");
116
- if (parent) {
117
- var _parent$children;
118
- setHeaderButtons(parent);
119
- if ((parent === null || parent === void 0 || (_parent$children = parent.children) === null || _parent$children === void 0 ? void 0 : _parent$children.length) === 1) {
120
- parent.classList.add("single-child");
121
- }
122
- }
123
- });
124
- observer.observe(document.body, {
125
- childList: true,
126
- subtree: true
127
- });
128
- return () => {
129
- observer.disconnect();
130
- };
131
- }, [headerButtons]);
111
+ const parent = document.querySelector(".oaheaderButtons");
112
+ if ((parent === null || parent === void 0 || (_parent$children = parent.children) === null || _parent$children === void 0 ? void 0 : _parent$children.length) === 1) {
113
+ parent.classList.add("single-child");
114
+ }
132
115
 
133
116
  /**
134
117
  * Initializes the layout by fetching initial data and updating the state.
@@ -245,7 +228,7 @@ function GenricLayOut(_ref) {
245
228
  });
246
229
  if (value === "") {
247
230
  if (handleInputSearchChange) {
248
- var _state$inputSearch, _state$tabs2, _customDrawer$applied, _config$tables, _config$tables2, _tables$sorting, _tables$sorting2, _header$subHeading, _header$subHeading2;
231
+ var _state$inputSearch, _state$tabs2, _customDrawer$applied, _tables$pagination, _tables$pagination2, _tables$sorting, _tables$sorting2, _header$subHeading, _header$subHeading2;
249
232
  dispatch({
250
233
  type: _layoutReducer.actionTypes.SET_LOADING,
251
234
  payload: true
@@ -255,9 +238,13 @@ function GenricLayOut(_ref) {
255
238
  data
256
239
  } = await handleInputSearchChange(_objectSpread(_objectSpread(_objectSpread(_objectSpread({}, state === null || state === void 0 || (_state$inputSearch = state.inputSearch) === null || _state$inputSearch === void 0 ? void 0 : _state$inputSearch.request), state !== null && state !== void 0 && (_state$tabs2 = state.tabs) !== null && _state$tabs2 !== void 0 && _state$tabs2.active ? {
257
240
  selectedTab: state.tabs.active
258
- } : {}), (customDrawer === null || customDrawer === void 0 ? void 0 : customDrawer.appliedFilters) && Object.keys((_customDrawer$applied = customDrawer === null || customDrawer === void 0 ? void 0 : customDrawer.appliedFilters) !== null && _customDrawer$applied !== void 0 ? _customDrawer$applied : {}).length > 0 && _objectSpread({}, customDrawer === null || customDrawer === void 0 ? void 0 : customDrawer.appliedFilters)), {}, {
259
- current: config === null || config === void 0 || (_config$tables = config.tables) === null || _config$tables === void 0 || (_config$tables = _config$tables.pagination) === null || _config$tables === void 0 ? void 0 : _config$tables.current,
260
- pageSize: config === null || config === void 0 || (_config$tables2 = config.tables) === null || _config$tables2 === void 0 || (_config$tables2 = _config$tables2.pagination) === null || _config$tables2 === void 0 ? void 0 : _config$tables2.pageSize,
241
+ } : {}), (customDrawer === null || customDrawer === void 0 ? void 0 : customDrawer.appliedFilters) && Object.keys((_customDrawer$applied = customDrawer === null || customDrawer === void 0 ? void 0 : customDrawer.appliedFilters) !== null && _customDrawer$applied !== void 0 ? _customDrawer$applied : {}).length > 0 && {
242
+ filterOn: customDrawer === null || customDrawer === void 0 ? void 0 : customDrawer.appliedFilters.filterBy,
243
+ fromDate: customDrawer === null || customDrawer === void 0 ? void 0 : customDrawer.appliedFilters.fromDate,
244
+ toDate: customDrawer === null || customDrawer === void 0 ? void 0 : customDrawer.appliedFilters.toDate
245
+ }), {}, {
246
+ current: tables === null || tables === void 0 || (_tables$pagination = tables.pagination) === null || _tables$pagination === void 0 ? void 0 : _tables$pagination.current,
247
+ pageSize: tables === null || tables === void 0 || (_tables$pagination2 = tables.pagination) === null || _tables$pagination2 === void 0 ? void 0 : _tables$pagination2.pageSize,
261
248
  field: tables === null || tables === void 0 || (_tables$sorting = tables.sorting) === null || _tables$sorting === void 0 ? void 0 : _tables$sorting.sortBy,
262
249
  order: tables === null || tables === void 0 || (_tables$sorting2 = tables.sorting) === null || _tables$sorting2 === void 0 ? void 0 : _tables$sorting2.sortDirection
263
250
  }, (header === null || header === void 0 || (_header$subHeading = header.subHeading) === null || _header$subHeading === void 0 || (_header$subHeading = _header$subHeading.jsxConfig) === null || _header$subHeading === void 0 ? void 0 : _header$subHeading.type) == "select" ? {
@@ -269,7 +256,6 @@ function GenricLayOut(_ref) {
269
256
  type: _layoutReducer.actionTypes.SET_TABLE_EMPTY
270
257
  });
271
258
  } else {
272
- var _config$tables3, _config$tables4;
273
259
  if (staticFilter !== null && staticFilter !== void 0 && staticFilter.visible) {
274
260
  setStaticFilterData(data);
275
261
  }
@@ -277,13 +263,6 @@ function GenricLayOut(_ref) {
277
263
  type: _layoutReducer.actionTypes.SET_TABLE_DATA,
278
264
  payload: data
279
265
  });
280
- dispatch({
281
- type: _layoutReducer.actionTypes.SET_PAGINATION,
282
- payload: {
283
- current: config === null || config === void 0 || (_config$tables3 = config.tables) === null || _config$tables3 === void 0 || (_config$tables3 = _config$tables3.pagination) === null || _config$tables3 === void 0 ? void 0 : _config$tables3.current,
284
- pageSize: config === null || config === void 0 || (_config$tables4 = config.tables) === null || _config$tables4 === void 0 || (_config$tables4 = _config$tables4.pagination) === null || _config$tables4 === void 0 ? void 0 : _config$tables4.pageSize
285
- }
286
- });
287
266
  }
288
267
  dispatch({
289
268
  type: _layoutReducer.actionTypes.SET_LOADING,
@@ -323,7 +302,7 @@ function GenricLayOut(_ref) {
323
302
  payload: trimedValue
324
303
  });
325
304
  if (handleInputSearchEnter) {
326
- var _state$tabs3, _config$tables5, _config$tables6, _tables$sorting3, _tables$sorting4, _customDrawer$applied2, _header$subHeading3, _header$subHeading4;
305
+ var _state$tabs3, _tables$pagination3, _tables$pagination4, _tables$sorting3, _tables$sorting4, _customDrawer$applied2, _header$subHeading3, _header$subHeading4;
327
306
  const {
328
307
  error,
329
308
  data
@@ -331,11 +310,15 @@ function GenricLayOut(_ref) {
331
310
  selectedTab: state.tabs.active
332
311
  } : {}), {}, {
333
312
  searchedValue: trimedValue,
334
- current: config === null || config === void 0 || (_config$tables5 = config.tables) === null || _config$tables5 === void 0 || (_config$tables5 = _config$tables5.pagination) === null || _config$tables5 === void 0 ? void 0 : _config$tables5.current,
335
- pageSize: config === null || config === void 0 || (_config$tables6 = config.tables) === null || _config$tables6 === void 0 || (_config$tables6 = _config$tables6.pagination) === null || _config$tables6 === void 0 ? void 0 : _config$tables6.pageSize,
313
+ current: tables === null || tables === void 0 || (_tables$pagination3 = tables.pagination) === null || _tables$pagination3 === void 0 ? void 0 : _tables$pagination3.current,
314
+ pageSize: tables === null || tables === void 0 || (_tables$pagination4 = tables.pagination) === null || _tables$pagination4 === void 0 ? void 0 : _tables$pagination4.pageSize,
336
315
  field: tables === null || tables === void 0 || (_tables$sorting3 = tables.sorting) === null || _tables$sorting3 === void 0 ? void 0 : _tables$sorting3.sortBy,
337
316
  order: tables === null || tables === void 0 || (_tables$sorting4 = tables.sorting) === null || _tables$sorting4 === void 0 ? void 0 : _tables$sorting4.sortDirection
338
- }, (customDrawer === null || customDrawer === void 0 ? void 0 : customDrawer.appliedFilters) && Object.keys((_customDrawer$applied2 = customDrawer === null || customDrawer === void 0 ? void 0 : customDrawer.appliedFilters) !== null && _customDrawer$applied2 !== void 0 ? _customDrawer$applied2 : {}).length > 0 && _objectSpread({}, customDrawer === null || customDrawer === void 0 ? void 0 : customDrawer.appliedFilters)), inputSearch !== null && inputSearch !== void 0 && inputSearch.queryField ? {
317
+ }, (customDrawer === null || customDrawer === void 0 ? void 0 : customDrawer.appliedFilters) && Object.keys((_customDrawer$applied2 = customDrawer === null || customDrawer === void 0 ? void 0 : customDrawer.appliedFilters) !== null && _customDrawer$applied2 !== void 0 ? _customDrawer$applied2 : {}).length > 0 && {
318
+ filterOn: customDrawer === null || customDrawer === void 0 ? void 0 : customDrawer.appliedFilters.filterBy,
319
+ fromDate: customDrawer === null || customDrawer === void 0 ? void 0 : customDrawer.appliedFilters.fromDate,
320
+ toDate: customDrawer === null || customDrawer === void 0 ? void 0 : customDrawer.appliedFilters.toDate
321
+ }), inputSearch !== null && inputSearch !== void 0 && inputSearch.queryField ? {
339
322
  queryField: inputSearch.queryField
340
323
  } : {}), (header === null || header === void 0 || (_header$subHeading3 = header.subHeading) === null || _header$subHeading3 === void 0 || (_header$subHeading3 = _header$subHeading3.jsxConfig) === null || _header$subHeading3 === void 0 ? void 0 : _header$subHeading3.type) == "select" ? {
341
324
  subHeadingSelectVal: header === null || header === void 0 || (_header$subHeading4 = header.subHeading) === null || _header$subHeading4 === void 0 || (_header$subHeading4 = _header$subHeading4.jsxConfig) === null || _header$subHeading4 === void 0 ? void 0 : _header$subHeading4.value
@@ -346,7 +329,6 @@ function GenricLayOut(_ref) {
346
329
  type: _layoutReducer.actionTypes.SET_TABLE_EMPTY
347
330
  });
348
331
  } else {
349
- var _config$tables7, _config$tables8;
350
332
  if (staticFilter !== null && staticFilter !== void 0 && staticFilter.visible) {
351
333
  setStaticFilterData(data);
352
334
  }
@@ -354,13 +336,6 @@ function GenricLayOut(_ref) {
354
336
  type: _layoutReducer.actionTypes.SET_TABLE_DATA,
355
337
  payload: data
356
338
  });
357
- dispatch({
358
- type: _layoutReducer.actionTypes.SET_PAGINATION,
359
- payload: {
360
- current: config === null || config === void 0 || (_config$tables7 = config.tables) === null || _config$tables7 === void 0 || (_config$tables7 = _config$tables7.pagination) === null || _config$tables7 === void 0 ? void 0 : _config$tables7.current,
361
- pageSize: config === null || config === void 0 || (_config$tables8 = config.tables) === null || _config$tables8 === void 0 || (_config$tables8 = _config$tables8.pagination) === null || _config$tables8 === void 0 ? void 0 : _config$tables8.pageSize
362
- }
363
- });
364
339
  }
365
340
  }
366
341
  };
@@ -390,7 +365,7 @@ function GenricLayOut(_ref) {
390
365
  });
391
366
  if (value === "") {
392
367
  if (handleDropdownSearchInputChange) {
393
- var _state$tabs4, _config$tables9, _config$tables10, _tables$sorting5, _tables$sorting6, _tables$filter, _staticFilter$data, _customDrawer$applied3, _header$subHeading5, _header$subHeading6, _state$misc2;
368
+ var _state$tabs4, _tables$pagination5, _tables$pagination6, _tables$sorting5, _tables$sorting6, _tables$filter, _staticFilter$data, _customDrawer$applied3, _state$misc2;
394
369
  dispatch({
395
370
  type: _layoutReducer.actionTypes.SET_LOADING,
396
371
  payload: true
@@ -398,26 +373,27 @@ function GenricLayOut(_ref) {
398
373
  const {
399
374
  error,
400
375
  data
401
- } = await handleDropdownSearchInputChange(_objectSpread(_objectSpread(_objectSpread(_objectSpread(_objectSpread({
376
+ } = await handleDropdownSearchInputChange(_objectSpread(_objectSpread(_objectSpread(_objectSpread({
402
377
  selectedTab: state === null || state === void 0 || (_state$tabs4 = state.tabs) === null || _state$tabs4 === void 0 ? void 0 : _state$tabs4.active,
403
- current: config === null || config === void 0 || (_config$tables9 = config.tables) === null || _config$tables9 === void 0 || (_config$tables9 = _config$tables9.pagination) === null || _config$tables9 === void 0 ? void 0 : _config$tables9.current,
404
- pageSize: config === null || config === void 0 || (_config$tables10 = config.tables) === null || _config$tables10 === void 0 || (_config$tables10 = _config$tables10.pagination) === null || _config$tables10 === void 0 ? void 0 : _config$tables10.pageSize,
378
+ current: tables === null || tables === void 0 || (_tables$pagination5 = tables.pagination) === null || _tables$pagination5 === void 0 ? void 0 : _tables$pagination5.current,
379
+ pageSize: tables === null || tables === void 0 || (_tables$pagination6 = tables.pagination) === null || _tables$pagination6 === void 0 ? void 0 : _tables$pagination6.pageSize,
405
380
  field: tables === null || tables === void 0 || (_tables$sorting5 = tables.sorting) === null || _tables$sorting5 === void 0 ? void 0 : _tables$sorting5.sortBy,
406
381
  order: tables === null || tables === void 0 || (_tables$sorting6 = tables.sorting) === null || _tables$sorting6 === void 0 ? void 0 : _tables$sorting6.sortDirection
407
382
  }, (tables === null || tables === void 0 || (_tables$filter = tables.filter) === null || _tables$filter === void 0 ? void 0 : _tables$filter.key) && {
408
383
  columnFilterStatus: tables === null || tables === void 0 ? void 0 : tables.filter
409
384
  }), (staticFilter === null || staticFilter === void 0 ? void 0 : staticFilter.visible) && ((_staticFilter$data = staticFilter.data) === null || _staticFilter$data === void 0 || (_staticFilter$data = _staticFilter$data.find(item => item.selected)) === null || _staticFilter$data === void 0 ? void 0 : _staticFilter$data.value) && {
410
385
  staticFilter: staticFilter.data.find(item => item.selected).value
411
- }), (customDrawer === null || customDrawer === void 0 ? void 0 : customDrawer.appliedFilters) && Object.keys((_customDrawer$applied3 = customDrawer === null || customDrawer === void 0 ? void 0 : customDrawer.appliedFilters) !== null && _customDrawer$applied3 !== void 0 ? _customDrawer$applied3 : {}).length > 0 && _objectSpread({}, customDrawer === null || customDrawer === void 0 ? void 0 : customDrawer.appliedFilters)), (header === null || header === void 0 || (_header$subHeading5 = header.subHeading) === null || _header$subHeading5 === void 0 || (_header$subHeading5 = _header$subHeading5.jsxConfig) === null || _header$subHeading5 === void 0 ? void 0 : _header$subHeading5.type) == "select" ? {
412
- subHeadingSelectVal: header === null || header === void 0 || (_header$subHeading6 = header.subHeading) === null || _header$subHeading6 === void 0 || (_header$subHeading6 = _header$subHeading6.jsxConfig) === null || _header$subHeading6 === void 0 ? void 0 : _header$subHeading6.value
413
- } : {}), (_state$misc2 = state === null || state === void 0 ? void 0 : state.misc) !== null && _state$misc2 !== void 0 ? _state$misc2 : {}));
386
+ }), (customDrawer === null || customDrawer === void 0 ? void 0 : customDrawer.appliedFilters) && Object.keys((_customDrawer$applied3 = customDrawer === null || customDrawer === void 0 ? void 0 : customDrawer.appliedFilters) !== null && _customDrawer$applied3 !== void 0 ? _customDrawer$applied3 : {}).length > 0 && {
387
+ filterOn: customDrawer === null || customDrawer === void 0 ? void 0 : customDrawer.appliedFilters.filterBy,
388
+ fromDate: customDrawer === null || customDrawer === void 0 ? void 0 : customDrawer.appliedFilters.fromDate,
389
+ toDate: customDrawer === null || customDrawer === void 0 ? void 0 : customDrawer.appliedFilters.toDate
390
+ }), (_state$misc2 = state === null || state === void 0 ? void 0 : state.misc) !== null && _state$misc2 !== void 0 ? _state$misc2 : {}));
414
391
  if (error) {
415
392
  showErrorNotification(error);
416
393
  dispatch({
417
394
  type: _layoutReducer.actionTypes.SET_TABLE_EMPTY
418
395
  });
419
396
  } else {
420
- var _config$tables11, _config$tables12;
421
397
  if (staticFilter !== null && staticFilter !== void 0 && staticFilter.visible) {
422
398
  setStaticFilterData(data);
423
399
  }
@@ -425,13 +401,6 @@ function GenricLayOut(_ref) {
425
401
  type: _layoutReducer.actionTypes.SET_TABLE_DATA,
426
402
  payload: data
427
403
  });
428
- dispatch({
429
- type: _layoutReducer.actionTypes.SET_PAGINATION,
430
- payload: {
431
- current: config === null || config === void 0 || (_config$tables11 = config.tables) === null || _config$tables11 === void 0 || (_config$tables11 = _config$tables11.pagination) === null || _config$tables11 === void 0 ? void 0 : _config$tables11.current,
432
- pageSize: config === null || config === void 0 || (_config$tables12 = config.tables) === null || _config$tables12 === void 0 || (_config$tables12 = _config$tables12.pagination) === null || _config$tables12 === void 0 ? void 0 : _config$tables12.pageSize
433
- }
434
- });
435
404
  }
436
405
  dispatch({
437
406
  type: _layoutReducer.actionTypes.SET_LOADING,
@@ -480,32 +449,33 @@ function GenricLayOut(_ref) {
480
449
  payload: value
481
450
  });
482
451
  if (handleDropdownSearchEnter) {
483
- var _state$tabs5, _config$tables13, _config$tables14, _tables$sorting7, _tables$sorting8, _tables$filter2, _staticFilter$data2, _customDrawer$applied4, _header$subHeading7, _header$subHeading8, _state$misc3;
452
+ var _state$tabs5, _tables$pagination7, _tables$pagination8, _tables$sorting7, _tables$sorting8, _tables$filter2, _staticFilter$data2, _customDrawer$applied4, _state$misc3;
484
453
  const {
485
454
  error,
486
455
  data
487
- } = await handleDropdownSearchEnter(_objectSpread(_objectSpread(_objectSpread(_objectSpread(_objectSpread({
456
+ } = await handleDropdownSearchEnter(_objectSpread(_objectSpread(_objectSpread(_objectSpread({
488
457
  searchedValue: value,
489
458
  selectedTab: state === null || state === void 0 || (_state$tabs5 = state.tabs) === null || _state$tabs5 === void 0 ? void 0 : _state$tabs5.active,
490
459
  selectedOption: state === null || state === void 0 ? void 0 : state.dropdownSearch.selectedOption,
491
- current: config === null || config === void 0 || (_config$tables13 = config.tables) === null || _config$tables13 === void 0 || (_config$tables13 = _config$tables13.pagination) === null || _config$tables13 === void 0 ? void 0 : _config$tables13.current,
492
- pageSize: config === null || config === void 0 || (_config$tables14 = config.tables) === null || _config$tables14 === void 0 || (_config$tables14 = _config$tables14.pagination) === null || _config$tables14 === void 0 ? void 0 : _config$tables14.pageSize,
460
+ current: tables === null || tables === void 0 || (_tables$pagination7 = tables.pagination) === null || _tables$pagination7 === void 0 ? void 0 : _tables$pagination7.current,
461
+ pageSize: tables === null || tables === void 0 || (_tables$pagination8 = tables.pagination) === null || _tables$pagination8 === void 0 ? void 0 : _tables$pagination8.pageSize,
493
462
  field: tables === null || tables === void 0 || (_tables$sorting7 = tables.sorting) === null || _tables$sorting7 === void 0 ? void 0 : _tables$sorting7.sortBy,
494
463
  order: tables === null || tables === void 0 || (_tables$sorting8 = tables.sorting) === null || _tables$sorting8 === void 0 ? void 0 : _tables$sorting8.sortDirection
495
464
  }, (tables === null || tables === void 0 || (_tables$filter2 = tables.filter) === null || _tables$filter2 === void 0 ? void 0 : _tables$filter2.key) && {
496
465
  columnFilterStatus: tables === null || tables === void 0 ? void 0 : tables.filter
497
466
  }), (staticFilter === null || staticFilter === void 0 ? void 0 : staticFilter.visible) && ((_staticFilter$data2 = staticFilter.data) === null || _staticFilter$data2 === void 0 || (_staticFilter$data2 = _staticFilter$data2.find(item => item.selected)) === null || _staticFilter$data2 === void 0 ? void 0 : _staticFilter$data2.value) && {
498
467
  staticFilter: staticFilter.data.find(item => item.selected).value
499
- }), (customDrawer === null || customDrawer === void 0 ? void 0 : customDrawer.appliedFilters) && Object.keys((_customDrawer$applied4 = customDrawer === null || customDrawer === void 0 ? void 0 : customDrawer.appliedFilters) !== null && _customDrawer$applied4 !== void 0 ? _customDrawer$applied4 : {}).length > 0 && _objectSpread({}, customDrawer === null || customDrawer === void 0 ? void 0 : customDrawer.appliedFilters)), (header === null || header === void 0 || (_header$subHeading7 = header.subHeading) === null || _header$subHeading7 === void 0 || (_header$subHeading7 = _header$subHeading7.jsxConfig) === null || _header$subHeading7 === void 0 ? void 0 : _header$subHeading7.type) == "select" ? {
500
- subHeadingSelectVal: header === null || header === void 0 || (_header$subHeading8 = header.subHeading) === null || _header$subHeading8 === void 0 || (_header$subHeading8 = _header$subHeading8.jsxConfig) === null || _header$subHeading8 === void 0 ? void 0 : _header$subHeading8.value
501
- } : {}), (_state$misc3 = state === null || state === void 0 ? void 0 : state.misc) !== null && _state$misc3 !== void 0 ? _state$misc3 : {}));
468
+ }), (customDrawer === null || customDrawer === void 0 ? void 0 : customDrawer.appliedFilters) && Object.keys((_customDrawer$applied4 = customDrawer === null || customDrawer === void 0 ? void 0 : customDrawer.appliedFilters) !== null && _customDrawer$applied4 !== void 0 ? _customDrawer$applied4 : {}).length > 0 && {
469
+ filterOn: customDrawer === null || customDrawer === void 0 ? void 0 : customDrawer.appliedFilters.filterBy,
470
+ fromDate: customDrawer === null || customDrawer === void 0 ? void 0 : customDrawer.appliedFilters.fromDate,
471
+ toDate: customDrawer === null || customDrawer === void 0 ? void 0 : customDrawer.appliedFilters.toDate
472
+ }), (_state$misc3 = state === null || state === void 0 ? void 0 : state.misc) !== null && _state$misc3 !== void 0 ? _state$misc3 : {}));
502
473
  if (error) {
503
474
  showErrorNotification(error);
504
475
  dispatch({
505
476
  type: _layoutReducer.actionTypes.SET_TABLE_EMPTY
506
477
  });
507
478
  } else {
508
- var _config$tables15, _config$tables16;
509
479
  if (staticFilter !== null && staticFilter !== void 0 && staticFilter.visible) {
510
480
  setStaticFilterData(data);
511
481
  }
@@ -513,13 +483,6 @@ function GenricLayOut(_ref) {
513
483
  type: _layoutReducer.actionTypes.SET_TABLE_DATA,
514
484
  payload: data
515
485
  });
516
- dispatch({
517
- type: _layoutReducer.actionTypes.SET_PAGINATION,
518
- payload: {
519
- current: config === null || config === void 0 || (_config$tables15 = config.tables) === null || _config$tables15 === void 0 || (_config$tables15 = _config$tables15.pagination) === null || _config$tables15 === void 0 ? void 0 : _config$tables15.current,
520
- pageSize: config === null || config === void 0 || (_config$tables16 = config.tables) === null || _config$tables16 === void 0 || (_config$tables16 = _config$tables16.pagination) === null || _config$tables16 === void 0 ? void 0 : _config$tables16.pageSize
521
- }
522
- });
523
486
  }
524
487
  }
525
488
  };
@@ -542,7 +505,7 @@ function GenricLayOut(_ref) {
542
505
  payload: option === null || option === void 0 ? void 0 : option.value
543
506
  });
544
507
  if (handleDropdownSearchOptionChange) {
545
- var _config$tables17, _config$tables18, _staticFilter$data3, _customDrawer$applied5, _header$subHeading9, _header$subHeading10, _state$misc4;
508
+ var _tables$pagination9, _tables$pagination10, _staticFilter$data3, _customDrawer$applied5, _state$misc4;
546
509
  dispatch({
547
510
  type: _layoutReducer.actionTypes.SET_LOADING,
548
511
  payload: true
@@ -550,22 +513,23 @@ function GenricLayOut(_ref) {
550
513
  const {
551
514
  error,
552
515
  data
553
- } = await handleDropdownSearchOptionChange(_objectSpread(_objectSpread(_objectSpread(_objectSpread({
516
+ } = await handleDropdownSearchOptionChange(_objectSpread(_objectSpread(_objectSpread({
554
517
  selectedTab: tabs === null || tabs === void 0 ? void 0 : tabs.active,
555
- current: config === null || config === void 0 || (_config$tables17 = config.tables) === null || _config$tables17 === void 0 || (_config$tables17 = _config$tables17.pagination) === null || _config$tables17 === void 0 ? void 0 : _config$tables17.current,
556
- pageSize: config === null || config === void 0 || (_config$tables18 = config.tables) === null || _config$tables18 === void 0 || (_config$tables18 = _config$tables18.pagination) === null || _config$tables18 === void 0 ? void 0 : _config$tables18.pageSize
518
+ current: tables === null || tables === void 0 || (_tables$pagination9 = tables.pagination) === null || _tables$pagination9 === void 0 ? void 0 : _tables$pagination9.current,
519
+ pageSize: tables === null || tables === void 0 || (_tables$pagination10 = tables.pagination) === null || _tables$pagination10 === void 0 ? void 0 : _tables$pagination10.pageSize
557
520
  }, (staticFilter === null || staticFilter === void 0 ? void 0 : staticFilter.visible) && ((_staticFilter$data3 = staticFilter.data) === null || _staticFilter$data3 === void 0 || (_staticFilter$data3 = _staticFilter$data3.find(item => item.selected)) === null || _staticFilter$data3 === void 0 ? void 0 : _staticFilter$data3.value) && {
558
521
  staticFilter: staticFilter.data.find(item => item.selected).value
559
- }), (customDrawer === null || customDrawer === void 0 ? void 0 : customDrawer.appliedFilters) && Object.keys((_customDrawer$applied5 = customDrawer === null || customDrawer === void 0 ? void 0 : customDrawer.appliedFilters) !== null && _customDrawer$applied5 !== void 0 ? _customDrawer$applied5 : {}).length > 0 && _objectSpread({}, customDrawer === null || customDrawer === void 0 ? void 0 : customDrawer.appliedFilters)), (header === null || header === void 0 || (_header$subHeading9 = header.subHeading) === null || _header$subHeading9 === void 0 || (_header$subHeading9 = _header$subHeading9.jsxConfig) === null || _header$subHeading9 === void 0 ? void 0 : _header$subHeading9.type) == "select" ? {
560
- subHeadingSelectVal: header === null || header === void 0 || (_header$subHeading10 = header.subHeading) === null || _header$subHeading10 === void 0 || (_header$subHeading10 = _header$subHeading10.jsxConfig) === null || _header$subHeading10 === void 0 ? void 0 : _header$subHeading10.value
561
- } : {}), (_state$misc4 = state === null || state === void 0 ? void 0 : state.misc) !== null && _state$misc4 !== void 0 ? _state$misc4 : {}));
522
+ }), (customDrawer === null || customDrawer === void 0 ? void 0 : customDrawer.appliedFilters) && Object.keys((_customDrawer$applied5 = customDrawer === null || customDrawer === void 0 ? void 0 : customDrawer.appliedFilters) !== null && _customDrawer$applied5 !== void 0 ? _customDrawer$applied5 : {}).length > 0 && {
523
+ filterOn: customDrawer === null || customDrawer === void 0 ? void 0 : customDrawer.appliedFilters.filterBy,
524
+ fromDate: customDrawer === null || customDrawer === void 0 ? void 0 : customDrawer.appliedFilters.fromDate,
525
+ toDate: customDrawer === null || customDrawer === void 0 ? void 0 : customDrawer.appliedFilters.toDate
526
+ }), (_state$misc4 = state === null || state === void 0 ? void 0 : state.misc) !== null && _state$misc4 !== void 0 ? _state$misc4 : {}));
562
527
  if (error) {
563
528
  showErrorNotification(error);
564
529
  dispatch({
565
530
  type: _layoutReducer.actionTypes.SET_TABLE_EMPTY
566
531
  });
567
532
  } else {
568
- var _config$tables19, _config$tables20;
569
533
  if (staticFilter !== null && staticFilter !== void 0 && staticFilter.visible) {
570
534
  setStaticFilterData(data);
571
535
  }
@@ -573,13 +537,6 @@ function GenricLayOut(_ref) {
573
537
  type: _layoutReducer.actionTypes.SET_TABLE_DATA,
574
538
  payload: data
575
539
  });
576
- dispatch({
577
- type: _layoutReducer.actionTypes.SET_PAGINATION,
578
- payload: {
579
- current: config === null || config === void 0 || (_config$tables19 = config.tables) === null || _config$tables19 === void 0 || (_config$tables19 = _config$tables19.pagination) === null || _config$tables19 === void 0 ? void 0 : _config$tables19.current,
580
- pageSize: config === null || config === void 0 || (_config$tables20 = config.tables) === null || _config$tables20 === void 0 || (_config$tables20 = _config$tables20.pagination) === null || _config$tables20 === void 0 ? void 0 : _config$tables20.pageSize
581
- }
582
- });
583
540
  if (config !== null && config !== void 0 && config.tabs) {
584
541
  dispatch({
585
542
  type: _layoutReducer.actionTypes.TAB_CLICK,
@@ -658,30 +615,31 @@ function GenricLayOut(_ref) {
658
615
  payload: null
659
616
  });
660
617
  if (handleDropdownSearchClear) {
661
- var _state$tabs6, _config$tables21, _config$tables22, _tables$sorting9, _tables$sorting10, _tables$filter3, _staticFilter$data4, _customDrawer$applied6, _header$subHeading11, _header$subHeading12, _state$misc5;
618
+ var _state$tabs6, _tables$pagination11, _tables$pagination12, _tables$sorting9, _tables$sorting10, _tables$filter3, _staticFilter$data4, _customDrawer$applied6, _state$misc5;
662
619
  const {
663
620
  error,
664
621
  data
665
- } = await handleDropdownSearchClear(_objectSpread(_objectSpread(_objectSpread(_objectSpread(_objectSpread({
622
+ } = await handleDropdownSearchClear(_objectSpread(_objectSpread(_objectSpread(_objectSpread({
666
623
  selectedTab: state === null || state === void 0 || (_state$tabs6 = state.tabs) === null || _state$tabs6 === void 0 ? void 0 : _state$tabs6.active,
667
- current: config === null || config === void 0 || (_config$tables21 = config.tables) === null || _config$tables21 === void 0 || (_config$tables21 = _config$tables21.pagination) === null || _config$tables21 === void 0 ? void 0 : _config$tables21.current,
668
- pageSize: config === null || config === void 0 || (_config$tables22 = config.tables) === null || _config$tables22 === void 0 || (_config$tables22 = _config$tables22.pagination) === null || _config$tables22 === void 0 ? void 0 : _config$tables22.pageSize,
624
+ current: tables === null || tables === void 0 || (_tables$pagination11 = tables.pagination) === null || _tables$pagination11 === void 0 ? void 0 : _tables$pagination11.current,
625
+ pageSize: tables === null || tables === void 0 || (_tables$pagination12 = tables.pagination) === null || _tables$pagination12 === void 0 ? void 0 : _tables$pagination12.pageSize,
669
626
  field: tables === null || tables === void 0 || (_tables$sorting9 = tables.sorting) === null || _tables$sorting9 === void 0 ? void 0 : _tables$sorting9.sortBy,
670
627
  order: tables === null || tables === void 0 || (_tables$sorting10 = tables.sorting) === null || _tables$sorting10 === void 0 ? void 0 : _tables$sorting10.sortDirection
671
628
  }, (tables === null || tables === void 0 || (_tables$filter3 = tables.filter) === null || _tables$filter3 === void 0 ? void 0 : _tables$filter3.key) && {
672
629
  columnFilterStatus: tables === null || tables === void 0 ? void 0 : tables.filter
673
630
  }), (staticFilter === null || staticFilter === void 0 ? void 0 : staticFilter.visible) && ((_staticFilter$data4 = staticFilter.data) === null || _staticFilter$data4 === void 0 || (_staticFilter$data4 = _staticFilter$data4.find(item => item.selected)) === null || _staticFilter$data4 === void 0 ? void 0 : _staticFilter$data4.value) && {
674
631
  staticFilter: staticFilter.data.find(item => item.selected).value
675
- }), (customDrawer === null || customDrawer === void 0 ? void 0 : customDrawer.appliedFilters) && Object.keys((_customDrawer$applied6 = customDrawer === null || customDrawer === void 0 ? void 0 : customDrawer.appliedFilters) !== null && _customDrawer$applied6 !== void 0 ? _customDrawer$applied6 : {}).length > 0 && _objectSpread({}, customDrawer === null || customDrawer === void 0 ? void 0 : customDrawer.appliedFilters)), (header === null || header === void 0 || (_header$subHeading11 = header.subHeading) === null || _header$subHeading11 === void 0 || (_header$subHeading11 = _header$subHeading11.jsxConfig) === null || _header$subHeading11 === void 0 ? void 0 : _header$subHeading11.type) == "select" ? {
676
- subHeadingSelectVal: header === null || header === void 0 || (_header$subHeading12 = header.subHeading) === null || _header$subHeading12 === void 0 || (_header$subHeading12 = _header$subHeading12.jsxConfig) === null || _header$subHeading12 === void 0 ? void 0 : _header$subHeading12.value
677
- } : {}), (_state$misc5 = state === null || state === void 0 ? void 0 : state.misc) !== null && _state$misc5 !== void 0 ? _state$misc5 : {}));
632
+ }), (customDrawer === null || customDrawer === void 0 ? void 0 : customDrawer.appliedFilters) && Object.keys((_customDrawer$applied6 = customDrawer === null || customDrawer === void 0 ? void 0 : customDrawer.appliedFilters) !== null && _customDrawer$applied6 !== void 0 ? _customDrawer$applied6 : {}).length > 0 && {
633
+ filterOn: customDrawer === null || customDrawer === void 0 ? void 0 : customDrawer.appliedFilters.filterBy,
634
+ fromDate: customDrawer === null || customDrawer === void 0 ? void 0 : customDrawer.appliedFilters.fromDate,
635
+ toDate: customDrawer === null || customDrawer === void 0 ? void 0 : customDrawer.appliedFilters.toDate
636
+ }), (_state$misc5 = state === null || state === void 0 ? void 0 : state.misc) !== null && _state$misc5 !== void 0 ? _state$misc5 : {}));
678
637
  if (error) {
679
638
  showErrorNotification(error);
680
639
  dispatch({
681
640
  type: _layoutReducer.actionTypes.SET_TABLE_EMPTY
682
641
  });
683
642
  } else {
684
- var _config$tables23, _config$tables24;
685
643
  if (staticFilter !== null && staticFilter !== void 0 && staticFilter.visible) {
686
644
  setStaticFilterData(data);
687
645
  }
@@ -689,13 +647,6 @@ function GenricLayOut(_ref) {
689
647
  type: _layoutReducer.actionTypes.SET_TABLE_DATA,
690
648
  payload: data
691
649
  });
692
- dispatch({
693
- type: _layoutReducer.actionTypes.SET_PAGINATION,
694
- payload: {
695
- current: config === null || config === void 0 || (_config$tables23 = config.tables) === null || _config$tables23 === void 0 || (_config$tables23 = _config$tables23.pagination) === null || _config$tables23 === void 0 ? void 0 : _config$tables23.current,
696
- pageSize: config === null || config === void 0 || (_config$tables24 = config.tables) === null || _config$tables24 === void 0 || (_config$tables24 = _config$tables24.pagination) === null || _config$tables24 === void 0 ? void 0 : _config$tables24.pageSize
697
- }
698
- });
699
650
  }
700
651
  }
701
652
  };
@@ -720,27 +671,30 @@ function GenricLayOut(_ref) {
720
671
  payload: null
721
672
  });
722
673
  if (handleInputSearchClear) {
723
- var _state$tabs7, _config$tables25, _config$tables26, _tables$sorting11, _tables$sorting12, _customDrawer$applied7, _header$subHeading13, _header$subHeading14, _state$misc6;
674
+ var _state$tabs7, _tables$pagination13, _tables$pagination14, _tables$sorting11, _tables$sorting12, _customDrawer$applied7, _header$subHeading5, _header$subHeading6;
724
675
  const {
725
676
  error,
726
677
  data
727
- } = await handleInputSearchClear(_objectSpread(_objectSpread(_objectSpread(_objectSpread({}, state !== null && state !== void 0 && (_state$tabs7 = state.tabs) !== null && _state$tabs7 !== void 0 && _state$tabs7.active ? {
678
+ } = await handleInputSearchClear(_objectSpread(_objectSpread(_objectSpread({}, state !== null && state !== void 0 && (_state$tabs7 = state.tabs) !== null && _state$tabs7 !== void 0 && _state$tabs7.active ? {
728
679
  selectedTab: state.tabs.active
729
680
  } : {}), {}, {
730
- current: config === null || config === void 0 || (_config$tables25 = config.tables) === null || _config$tables25 === void 0 || (_config$tables25 = _config$tables25.pagination) === null || _config$tables25 === void 0 ? void 0 : _config$tables25.current,
731
- pageSize: config === null || config === void 0 || (_config$tables26 = config.tables) === null || _config$tables26 === void 0 || (_config$tables26 = _config$tables26.pagination) === null || _config$tables26 === void 0 ? void 0 : _config$tables26.pageSize,
681
+ current: tables === null || tables === void 0 || (_tables$pagination13 = tables.pagination) === null || _tables$pagination13 === void 0 ? void 0 : _tables$pagination13.current,
682
+ pageSize: tables === null || tables === void 0 || (_tables$pagination14 = tables.pagination) === null || _tables$pagination14 === void 0 ? void 0 : _tables$pagination14.pageSize,
732
683
  field: tables === null || tables === void 0 || (_tables$sorting11 = tables.sorting) === null || _tables$sorting11 === void 0 ? void 0 : _tables$sorting11.sortBy,
733
684
  order: tables === null || tables === void 0 || (_tables$sorting12 = tables.sorting) === null || _tables$sorting12 === void 0 ? void 0 : _tables$sorting12.sortDirection
734
- }, (customDrawer === null || customDrawer === void 0 ? void 0 : customDrawer.appliedFilters) && Object.keys((_customDrawer$applied7 = customDrawer === null || customDrawer === void 0 ? void 0 : customDrawer.appliedFilters) !== null && _customDrawer$applied7 !== void 0 ? _customDrawer$applied7 : {}).length > 0 && _objectSpread({}, customDrawer === null || customDrawer === void 0 ? void 0 : customDrawer.appliedFilters)), (header === null || header === void 0 || (_header$subHeading13 = header.subHeading) === null || _header$subHeading13 === void 0 || (_header$subHeading13 = _header$subHeading13.jsxConfig) === null || _header$subHeading13 === void 0 ? void 0 : _header$subHeading13.type) == "select" ? {
735
- subHeadingSelectVal: header === null || header === void 0 || (_header$subHeading14 = header.subHeading) === null || _header$subHeading14 === void 0 || (_header$subHeading14 = _header$subHeading14.jsxConfig) === null || _header$subHeading14 === void 0 ? void 0 : _header$subHeading14.value
736
- } : {}), (_state$misc6 = state === null || state === void 0 ? void 0 : state.misc) !== null && _state$misc6 !== void 0 ? _state$misc6 : {}));
685
+ }, (customDrawer === null || customDrawer === void 0 ? void 0 : customDrawer.appliedFilters) && Object.keys((_customDrawer$applied7 = customDrawer === null || customDrawer === void 0 ? void 0 : customDrawer.appliedFilters) !== null && _customDrawer$applied7 !== void 0 ? _customDrawer$applied7 : {}).length > 0 && {
686
+ filterOn: customDrawer === null || customDrawer === void 0 ? void 0 : customDrawer.appliedFilters.filterBy,
687
+ fromDate: customDrawer === null || customDrawer === void 0 ? void 0 : customDrawer.appliedFilters.fromDate,
688
+ toDate: customDrawer === null || customDrawer === void 0 ? void 0 : customDrawer.appliedFilters.toDate
689
+ }), (header === null || header === void 0 || (_header$subHeading5 = header.subHeading) === null || _header$subHeading5 === void 0 || (_header$subHeading5 = _header$subHeading5.jsxConfig) === null || _header$subHeading5 === void 0 ? void 0 : _header$subHeading5.type) == "select" ? {
690
+ subHeadingSelectVal: header === null || header === void 0 || (_header$subHeading6 = header.subHeading) === null || _header$subHeading6 === void 0 || (_header$subHeading6 = _header$subHeading6.jsxConfig) === null || _header$subHeading6 === void 0 ? void 0 : _header$subHeading6.value
691
+ } : {}));
737
692
  if (error) {
738
693
  showErrorNotification(error);
739
694
  dispatch({
740
695
  type: _layoutReducer.actionTypes.SET_TABLE_EMPTY
741
696
  });
742
697
  } else {
743
- var _config$tables27, _config$tables28;
744
698
  if (staticFilter !== null && staticFilter !== void 0 && staticFilter.visible) {
745
699
  setStaticFilterData(data);
746
700
  }
@@ -748,13 +702,6 @@ function GenricLayOut(_ref) {
748
702
  type: _layoutReducer.actionTypes.SET_TABLE_DATA,
749
703
  payload: data
750
704
  });
751
- dispatch({
752
- type: _layoutReducer.actionTypes.SET_PAGINATION,
753
- payload: {
754
- current: config === null || config === void 0 || (_config$tables27 = config.tables) === null || _config$tables27 === void 0 || (_config$tables27 = _config$tables27.pagination) === null || _config$tables27 === void 0 ? void 0 : _config$tables27.current,
755
- pageSize: config === null || config === void 0 || (_config$tables28 = config.tables) === null || _config$tables28 === void 0 || (_config$tables28 = _config$tables28.pagination) === null || _config$tables28 === void 0 ? void 0 : _config$tables28.pageSize
756
- }
757
- });
758
705
  }
759
706
  }
760
707
  };
@@ -787,14 +734,14 @@ function GenricLayOut(_ref) {
787
734
  if ((configArgs === null || configArgs === void 0 ? void 0 : configArgs.action) === "OPEN_DRAWER_AND_FETCH") {
788
735
  const selectkey = optKey || (configArgs === null || configArgs === void 0 ? void 0 : configArgs.key);
789
736
  if (handleTableColumnClick) {
790
- var _state$misc7;
737
+ var _state$misc6;
791
738
  const {
792
739
  error,
793
740
  data
794
741
  } = await (handleTableColumnClick === null || handleTableColumnClick === void 0 ? void 0 : handleTableColumnClick(_objectSpread({
795
742
  record: record,
796
743
  type: configArgs === null || configArgs === void 0 ? void 0 : configArgs.call
797
- }, (_state$misc7 = state === null || state === void 0 ? void 0 : state.misc) !== null && _state$misc7 !== void 0 ? _state$misc7 : {})));
744
+ }, (_state$misc6 = state === null || state === void 0 ? void 0 : state.misc) !== null && _state$misc6 !== void 0 ? _state$misc6 : {})));
798
745
  if (error) {
799
746
  showErrorNotification(error);
800
747
  } else {
@@ -927,9 +874,9 @@ function GenricLayOut(_ref) {
927
874
  * If an error occurs during any action, an error notification is shown.
928
875
  */
929
876
  const customTableSelectFooterClick = async configData => {
877
+ var _state$modal;
878
+ const modalContent = state === null || state === void 0 || (_state$modal = state.modal) === null || _state$modal === void 0 ? void 0 : _state$modal.modalContent;
930
879
  if ((configData === null || configData === void 0 ? void 0 : configData.action) === "OPEN_MODAL") {
931
- var _state$modal;
932
- const modalContent = state === null || state === void 0 || (_state$modal = state.modal) === null || _state$modal === void 0 ? void 0 : _state$modal.modalContent;
933
880
  if (handleModalDataSet) {
934
881
  const {
935
882
  error,
@@ -951,44 +898,6 @@ function GenricLayOut(_ref) {
951
898
  });
952
899
  }
953
900
  }
954
- } else if ((configData === null || configData === void 0 ? void 0 : configData.action) === "CALL_API") {
955
- if (handleTableFooterApi) {
956
- const {
957
- error,
958
- data
959
- } = await (handleTableFooterApi === null || handleTableFooterApi === void 0 ? void 0 : handleTableFooterApi(state));
960
- if (error) {
961
- showErrorNotification(error);
962
- } else {
963
- const updatedModalContent = (0, _staticConfigResolver.default)(config === null || config === void 0 ? void 0 : config.modal, data);
964
- dispatch({
965
- type: _layoutReducer.actionTypes.SET_MODAL,
966
- payload: {
967
- modalData: updatedModalContent
968
- }
969
- });
970
- dispatch({
971
- type: _layoutReducer.actionTypes.TOGGLE_MODAL,
972
- payload: true
973
- });
974
- }
975
- }
976
- } else if ((configData === null || configData === void 0 ? void 0 : configData.action) === "ACTION_ON_CTA") {
977
- console.log("here");
978
- console.log(state, "statedata");
979
- if (handleTableFooterApi) {
980
- var _state$tables2;
981
- const {
982
- error,
983
- data
984
- } = await (handleTableFooterApi === null || handleTableFooterApi === void 0 ? void 0 : handleTableFooterApi(state === null || state === void 0 || (_state$tables2 = state.tables) === null || _state$tables2 === void 0 ? void 0 : _state$tables2.selectedRowKeys, state));
985
- if (error) {
986
- showErrorNotification(error);
987
- } else {
988
- showSuccessNotification(data);
989
- }
990
- init();
991
- }
992
901
  }
993
902
  };
994
903
 
@@ -1079,7 +988,7 @@ function GenricLayOut(_ref) {
1079
988
  }
1080
989
  });
1081
990
  if (handleTableChange) {
1082
- var _state$dropdownSearch3, _state$inputSearch4, _state$tabs9, _header$subHeading15, _header$subHeading16, _staticFilter$data5, _customDrawer$applied8, _state$misc8;
991
+ var _state$dropdownSearch3, _state$inputSearch4, _state$tabs9, _header$subHeading7, _header$subHeading8, _staticFilter$data5, _customDrawer$applied8, _state$misc7;
1083
992
  dispatch({
1084
993
  type: _layoutReducer.actionTypes.SET_LOADING,
1085
994
  payload: true
@@ -1098,13 +1007,17 @@ function GenricLayOut(_ref) {
1098
1007
  pageSize: pageSize,
1099
1008
  columnFilterStatus: _f,
1100
1009
  field: sorter === null || sorter === void 0 ? void 0 : sorter.columnKey
1101
- }, (header === null || header === void 0 || (_header$subHeading15 = header.subHeading) === null || _header$subHeading15 === void 0 || (_header$subHeading15 = _header$subHeading15.jsxConfig) === null || _header$subHeading15 === void 0 ? void 0 : _header$subHeading15.type) == "select" ? {
1102
- subHeadingSelectVal: header === null || header === void 0 || (_header$subHeading16 = header.subHeading) === null || _header$subHeading16 === void 0 || (_header$subHeading16 = _header$subHeading16.jsxConfig) === null || _header$subHeading16 === void 0 ? void 0 : _header$subHeading16.value
1010
+ }, (header === null || header === void 0 || (_header$subHeading7 = header.subHeading) === null || _header$subHeading7 === void 0 || (_header$subHeading7 = _header$subHeading7.jsxConfig) === null || _header$subHeading7 === void 0 ? void 0 : _header$subHeading7.type) == "select" ? {
1011
+ subHeadingSelectVal: header === null || header === void 0 || (_header$subHeading8 = header.subHeading) === null || _header$subHeading8 === void 0 || (_header$subHeading8 = _header$subHeading8.jsxConfig) === null || _header$subHeading8 === void 0 ? void 0 : _header$subHeading8.value
1103
1012
  } : {}), (staticFilter === null || staticFilter === void 0 ? void 0 : staticFilter.visible) && ((_staticFilter$data5 = staticFilter.data) === null || _staticFilter$data5 === void 0 || (_staticFilter$data5 = _staticFilter$data5.find(item => item.selected)) === null || _staticFilter$data5 === void 0 ? void 0 : _staticFilter$data5.value) && {
1104
1013
  staticFilter: staticFilter.data.find(item => item.selected).value
1105
- }), (customDrawer === null || customDrawer === void 0 ? void 0 : customDrawer.appliedFilters) && Object.keys((_customDrawer$applied8 = customDrawer === null || customDrawer === void 0 ? void 0 : customDrawer.appliedFilters) !== null && _customDrawer$applied8 !== void 0 ? _customDrawer$applied8 : {}).length > 0 && _objectSpread({}, customDrawer === null || customDrawer === void 0 ? void 0 : customDrawer.appliedFilters)), {}, {
1014
+ }), (customDrawer === null || customDrawer === void 0 ? void 0 : customDrawer.appliedFilters) && Object.keys((_customDrawer$applied8 = customDrawer === null || customDrawer === void 0 ? void 0 : customDrawer.appliedFilters) !== null && _customDrawer$applied8 !== void 0 ? _customDrawer$applied8 : {}).length > 0 && {
1015
+ filterOn: customDrawer === null || customDrawer === void 0 ? void 0 : customDrawer.appliedFilters.filterBy,
1016
+ fromDate: customDrawer === null || customDrawer === void 0 ? void 0 : customDrawer.appliedFilters.fromDate,
1017
+ toDate: customDrawer === null || customDrawer === void 0 ? void 0 : customDrawer.appliedFilters.toDate
1018
+ }), {}, {
1106
1019
  order: (sorter === null || sorter === void 0 ? void 0 : sorter.order) === "ascend" && "ASC" || (sorter === null || sorter === void 0 ? void 0 : sorter.order) === "descend" && "DESC" || ""
1107
- }, (_state$misc8 = state === null || state === void 0 ? void 0 : state.misc) !== null && _state$misc8 !== void 0 ? _state$misc8 : {}));
1020
+ }, (_state$misc7 = state === null || state === void 0 ? void 0 : state.misc) !== null && _state$misc7 !== void 0 ? _state$misc7 : {}));
1108
1021
  if (error) {
1109
1022
  showErrorNotification(error);
1110
1023
  dispatch({
@@ -1185,7 +1098,7 @@ function GenricLayOut(_ref) {
1185
1098
  });
1186
1099
  const selectedStaticFilterValue = tables !== null && tables !== void 0 && tables.staticFilterKey && (tables === null || tables === void 0 ? void 0 : tables.staticFilterKey) == key && Array.isArray(staticFilter.data) ? (_staticFilter$data$fi2 = staticFilter.data.find(item => item.selected)) === null || _staticFilter$data$fi2 === void 0 ? void 0 : _staticFilter$data$fi2.value : undefined;
1187
1100
  if (handleTabClick) {
1188
- var _state$misc9, _tables$pagination, _tables$pagination2, _tables$sorting13, _tables$sorting14, _state$dropdownSearch4, _header$subHeading17, _header$subHeading18, _customDrawer$applied9, _state$misc10;
1101
+ var _state$misc8, _tables$pagination15, _tables$pagination16, _tables$sorting13, _tables$sorting14, _state$dropdownSearch4, _customDrawer$applied9;
1189
1102
  dispatch({
1190
1103
  type: _layoutReducer.actionTypes.SET_LOADING,
1191
1104
  payload: true
@@ -1193,10 +1106,10 @@ function GenricLayOut(_ref) {
1193
1106
  const {
1194
1107
  error,
1195
1108
  data
1196
- } = await handleTabClick(_objectSpread(_objectSpread(_objectSpread(_objectSpread(_objectSpread(_objectSpread({}, (_state$misc9 = state === null || state === void 0 ? void 0 : state.misc) !== null && _state$misc9 !== void 0 ? _state$misc9 : {}), {}, {
1109
+ } = await handleTabClick(_objectSpread(_objectSpread(_objectSpread(_objectSpread({}, (_state$misc8 = state === null || state === void 0 ? void 0 : state.misc) !== null && _state$misc8 !== void 0 ? _state$misc8 : {}), {}, {
1197
1110
  selectedTab: key,
1198
- current: tables === null || tables === void 0 || (_tables$pagination = tables.pagination) === null || _tables$pagination === void 0 ? void 0 : _tables$pagination.current,
1199
- pageSize: tables === null || tables === void 0 || (_tables$pagination2 = tables.pagination) === null || _tables$pagination2 === void 0 ? void 0 : _tables$pagination2.pageSize,
1111
+ current: tables === null || tables === void 0 || (_tables$pagination15 = tables.pagination) === null || _tables$pagination15 === void 0 ? void 0 : _tables$pagination15.current,
1112
+ pageSize: tables === null || tables === void 0 || (_tables$pagination16 = tables.pagination) === null || _tables$pagination16 === void 0 ? void 0 : _tables$pagination16.pageSize,
1200
1113
  field: tables === null || tables === void 0 || (_tables$sorting13 = tables.sorting) === null || _tables$sorting13 === void 0 ? void 0 : _tables$sorting13.sortBy
1201
1114
  }, selectedStaticFilterValue && {
1202
1115
  staticFilter: selectedStaticFilterValue
@@ -1205,9 +1118,11 @@ function GenricLayOut(_ref) {
1205
1118
  }, (state === null || state === void 0 || (_state$dropdownSearch4 = state.dropdownSearch) === null || _state$dropdownSearch4 === void 0 || (_state$dropdownSearch4 = _state$dropdownSearch4.value) === null || _state$dropdownSearch4 === void 0 ? void 0 : _state$dropdownSearch4.trim()) && {
1206
1119
  searchedValue: state.dropdownSearch.value,
1207
1120
  selectedOption: state.dropdownSearch.selectedOption
1208
- }), (header === null || header === void 0 || (_header$subHeading17 = header.subHeading) === null || _header$subHeading17 === void 0 || (_header$subHeading17 = _header$subHeading17.jsxConfig) === null || _header$subHeading17 === void 0 ? void 0 : _header$subHeading17.type) == "select" ? {
1209
- subHeadingSelectVal: header === null || header === void 0 || (_header$subHeading18 = header.subHeading) === null || _header$subHeading18 === void 0 || (_header$subHeading18 = _header$subHeading18.jsxConfig) === null || _header$subHeading18 === void 0 ? void 0 : _header$subHeading18.value
1210
- } : {}), (customDrawer === null || customDrawer === void 0 ? void 0 : customDrawer.appliedFilters) && Object.keys((_customDrawer$applied9 = customDrawer === null || customDrawer === void 0 ? void 0 : customDrawer.appliedFilters) !== null && _customDrawer$applied9 !== void 0 ? _customDrawer$applied9 : {}).length > 0 && _objectSpread({}, customDrawer === null || customDrawer === void 0 ? void 0 : customDrawer.appliedFilters)), (_state$misc10 = state === null || state === void 0 ? void 0 : state.misc) !== null && _state$misc10 !== void 0 ? _state$misc10 : {}));
1121
+ }), (customDrawer === null || customDrawer === void 0 ? void 0 : customDrawer.appliedFilters) && Object.keys((_customDrawer$applied9 = customDrawer === null || customDrawer === void 0 ? void 0 : customDrawer.appliedFilters) !== null && _customDrawer$applied9 !== void 0 ? _customDrawer$applied9 : {}).length > 0 && {
1122
+ filterOn: customDrawer === null || customDrawer === void 0 ? void 0 : customDrawer.appliedFilters.filterBy,
1123
+ fromDate: customDrawer === null || customDrawer === void 0 ? void 0 : customDrawer.appliedFilters.fromDate,
1124
+ toDate: customDrawer === null || customDrawer === void 0 ? void 0 : customDrawer.appliedFilters.toDate
1125
+ }));
1211
1126
  if (error) {
1212
1127
  showErrorNotification(error);
1213
1128
  dispatch({
@@ -1301,11 +1216,11 @@ function GenricLayOut(_ref) {
1301
1216
  return;
1302
1217
  }
1303
1218
  if (handleDrawerFormOnFinish) {
1304
- var _state$misc11;
1219
+ var _state$misc9;
1305
1220
  const {
1306
1221
  error,
1307
1222
  data
1308
- } = await (handleDrawerFormOnFinish === null || handleDrawerFormOnFinish === void 0 ? void 0 : handleDrawerFormOnFinish(_objectSpread(_objectSpread(_objectSpread({}, record), formData), (_state$misc11 = state === null || state === void 0 ? void 0 : state.misc) !== null && _state$misc11 !== void 0 ? _state$misc11 : {})));
1223
+ } = await (handleDrawerFormOnFinish === null || handleDrawerFormOnFinish === void 0 ? void 0 : handleDrawerFormOnFinish(_objectSpread(_objectSpread(_objectSpread({}, record), formData), (_state$misc9 = state === null || state === void 0 ? void 0 : state.misc) !== null && _state$misc9 !== void 0 ? _state$misc9 : {})));
1309
1224
  if (error) {
1310
1225
  showErrorNotification(error);
1311
1226
  } else {
@@ -1329,7 +1244,7 @@ function GenricLayOut(_ref) {
1329
1244
 
1330
1245
  // If there are remaining filters, reapply them
1331
1246
  if (Object.keys(currentFilters).length > 0) {
1332
- var _state$dropdownSearch5, _state$inputSearch5, _state$tabs12, _tables$pagination3, _tables$pagination4, _tables$filter6, _tables$sorting15, _header$subHeading19, _header$subHeading20, _staticFilter$data6, _tables$sorting16, _state$misc12;
1247
+ var _state$dropdownSearch5, _state$inputSearch5, _state$tabs12, _tables$pagination17, _tables$pagination18, _tables$filter6, _tables$sorting15, _header$subHeading9, _header$subHeading10, _staticFilter$data6, _tables$sorting16, _state$misc10;
1333
1248
  const {
1334
1249
  error,
1335
1250
  data
@@ -1343,19 +1258,19 @@ function GenricLayOut(_ref) {
1343
1258
  fromDate: currentFilters === null || currentFilters === void 0 ? void 0 : currentFilters.fromDate,
1344
1259
  toDate: currentFilters === null || currentFilters === void 0 ? void 0 : currentFilters.toDate,
1345
1260
  selectedTab: state === null || state === void 0 || (_state$tabs12 = state.tabs) === null || _state$tabs12 === void 0 ? void 0 : _state$tabs12.active,
1346
- current: tables === null || tables === void 0 || (_tables$pagination3 = tables.pagination) === null || _tables$pagination3 === void 0 ? void 0 : _tables$pagination3.current,
1347
- pageSize: tables === null || tables === void 0 || (_tables$pagination4 = tables.pagination) === null || _tables$pagination4 === void 0 ? void 0 : _tables$pagination4.pageSize
1261
+ current: tables === null || tables === void 0 || (_tables$pagination17 = tables.pagination) === null || _tables$pagination17 === void 0 ? void 0 : _tables$pagination17.current,
1262
+ pageSize: tables === null || tables === void 0 || (_tables$pagination18 = tables.pagination) === null || _tables$pagination18 === void 0 ? void 0 : _tables$pagination18.pageSize
1348
1263
  }, (tables === null || tables === void 0 || (_tables$filter6 = tables.filter) === null || _tables$filter6 === void 0 ? void 0 : _tables$filter6.key) && {
1349
1264
  columnFilterStatus: tables === null || tables === void 0 ? void 0 : tables.filter
1350
1265
  }), {}, {
1351
1266
  field: tables === null || tables === void 0 || (_tables$sorting15 = tables.sorting) === null || _tables$sorting15 === void 0 ? void 0 : _tables$sorting15.sortBy
1352
- }, (header === null || header === void 0 || (_header$subHeading19 = header.subHeading) === null || _header$subHeading19 === void 0 || (_header$subHeading19 = _header$subHeading19.jsxConfig) === null || _header$subHeading19 === void 0 ? void 0 : _header$subHeading19.type) == "select" ? {
1353
- subHeadingSelectVal: header === null || header === void 0 || (_header$subHeading20 = header.subHeading) === null || _header$subHeading20 === void 0 || (_header$subHeading20 = _header$subHeading20.jsxConfig) === null || _header$subHeading20 === void 0 ? void 0 : _header$subHeading20.value
1267
+ }, (header === null || header === void 0 || (_header$subHeading9 = header.subHeading) === null || _header$subHeading9 === void 0 || (_header$subHeading9 = _header$subHeading9.jsxConfig) === null || _header$subHeading9 === void 0 ? void 0 : _header$subHeading9.type) == "select" ? {
1268
+ subHeadingSelectVal: header === null || header === void 0 || (_header$subHeading10 = header.subHeading) === null || _header$subHeading10 === void 0 || (_header$subHeading10 = _header$subHeading10.jsxConfig) === null || _header$subHeading10 === void 0 ? void 0 : _header$subHeading10.value
1354
1269
  } : {}), (staticFilter === null || staticFilter === void 0 ? void 0 : staticFilter.visible) && ((_staticFilter$data6 = staticFilter.data) === null || _staticFilter$data6 === void 0 || (_staticFilter$data6 = _staticFilter$data6.find(item => item.selected)) === null || _staticFilter$data6 === void 0 ? void 0 : _staticFilter$data6.value) && {
1355
1270
  staticFilter: staticFilter.data.find(item => item.selected).value
1356
1271
  }), {}, {
1357
1272
  order: tables === null || tables === void 0 || (_tables$sorting16 = tables.sorting) === null || _tables$sorting16 === void 0 ? void 0 : _tables$sorting16.sortDirection
1358
- }, (_state$misc12 = state === null || state === void 0 ? void 0 : state.misc) !== null && _state$misc12 !== void 0 ? _state$misc12 : {}));
1273
+ }, (_state$misc10 = state === null || state === void 0 ? void 0 : state.misc) !== null && _state$misc10 !== void 0 ? _state$misc10 : {}));
1359
1274
  if (error) {
1360
1275
  showErrorNotification(error);
1361
1276
  dispatch({
@@ -1387,13 +1302,7 @@ function GenricLayOut(_ref) {
1387
1302
  const filterFormOnFinish = async formData => {
1388
1303
  // Check if this is a cancel/clear action - check both buttonClickType and the actual button data
1389
1304
  if (formData.type === "FILTER-CANCEL") {
1390
- var _state$dropdownSearch6, _state$inputSearch6, _state$tabs13, _tables$pagination5, _tables$pagination6, _tables$filter7, _tables$sorting17, _header$subHeading21, _header$subHeading22, _staticFilter$data7, _tables$sorting18, _state$misc13;
1391
- if (isFiltersEmpty(customDrawer === null || customDrawer === void 0 ? void 0 : customDrawer.appliedFilters)) {
1392
- dispatch({
1393
- type: _layoutReducer.actionTypes.CUSTOM_DRAWER_CLOSED
1394
- });
1395
- return;
1396
- }
1305
+ var _state$dropdownSearch6, _state$inputSearch6, _state$tabs13, _tables$pagination19, _tables$pagination20, _tables$filter7, _tables$sorting17, _header$subHeading11, _header$subHeading12, _staticFilter$data7, _tables$sorting18, _state$misc11;
1397
1306
  const {
1398
1307
  error,
1399
1308
  data
@@ -1404,19 +1313,19 @@ function GenricLayOut(_ref) {
1404
1313
  searchedValue: state.inputSearch.value
1405
1314
  }), {}, {
1406
1315
  selectedTab: state === null || state === void 0 || (_state$tabs13 = state.tabs) === null || _state$tabs13 === void 0 ? void 0 : _state$tabs13.active,
1407
- current: tables === null || tables === void 0 || (_tables$pagination5 = tables.pagination) === null || _tables$pagination5 === void 0 ? void 0 : _tables$pagination5.current,
1408
- pageSize: tables === null || tables === void 0 || (_tables$pagination6 = tables.pagination) === null || _tables$pagination6 === void 0 ? void 0 : _tables$pagination6.pageSize
1316
+ current: tables === null || tables === void 0 || (_tables$pagination19 = tables.pagination) === null || _tables$pagination19 === void 0 ? void 0 : _tables$pagination19.current,
1317
+ pageSize: tables === null || tables === void 0 || (_tables$pagination20 = tables.pagination) === null || _tables$pagination20 === void 0 ? void 0 : _tables$pagination20.pageSize
1409
1318
  }, (tables === null || tables === void 0 || (_tables$filter7 = tables.filter) === null || _tables$filter7 === void 0 ? void 0 : _tables$filter7.key) && {
1410
1319
  columnFilterStatus: tables === null || tables === void 0 ? void 0 : tables.filter
1411
1320
  }), {}, {
1412
1321
  field: tables === null || tables === void 0 || (_tables$sorting17 = tables.sorting) === null || _tables$sorting17 === void 0 ? void 0 : _tables$sorting17.sortBy
1413
- }, (header === null || header === void 0 || (_header$subHeading21 = header.subHeading) === null || _header$subHeading21 === void 0 || (_header$subHeading21 = _header$subHeading21.jsxConfig) === null || _header$subHeading21 === void 0 ? void 0 : _header$subHeading21.type) == "select" ? {
1414
- subHeadingSelectVal: header === null || header === void 0 || (_header$subHeading22 = header.subHeading) === null || _header$subHeading22 === void 0 || (_header$subHeading22 = _header$subHeading22.jsxConfig) === null || _header$subHeading22 === void 0 ? void 0 : _header$subHeading22.value
1322
+ }, (header === null || header === void 0 || (_header$subHeading11 = header.subHeading) === null || _header$subHeading11 === void 0 || (_header$subHeading11 = _header$subHeading11.jsxConfig) === null || _header$subHeading11 === void 0 ? void 0 : _header$subHeading11.type) == "select" ? {
1323
+ subHeadingSelectVal: header === null || header === void 0 || (_header$subHeading12 = header.subHeading) === null || _header$subHeading12 === void 0 || (_header$subHeading12 = _header$subHeading12.jsxConfig) === null || _header$subHeading12 === void 0 ? void 0 : _header$subHeading12.value
1415
1324
  } : {}), (staticFilter === null || staticFilter === void 0 ? void 0 : staticFilter.visible) && ((_staticFilter$data7 = staticFilter.data) === null || _staticFilter$data7 === void 0 || (_staticFilter$data7 = _staticFilter$data7.find(item => item.selected)) === null || _staticFilter$data7 === void 0 ? void 0 : _staticFilter$data7.value) && {
1416
1325
  staticFilter: staticFilter.data.find(item => item.selected).value
1417
1326
  }), {}, {
1418
1327
  order: tables === null || tables === void 0 || (_tables$sorting18 = tables.sorting) === null || _tables$sorting18 === void 0 ? void 0 : _tables$sorting18.sortDirection
1419
- }, (_state$misc13 = state === null || state === void 0 ? void 0 : state.misc) !== null && _state$misc13 !== void 0 ? _state$misc13 : {}));
1328
+ }, (_state$misc11 = state === null || state === void 0 ? void 0 : state.misc) !== null && _state$misc11 !== void 0 ? _state$misc11 : {}));
1420
1329
  if (error) {
1421
1330
  showErrorNotification(error);
1422
1331
  dispatch({
@@ -1463,8 +1372,8 @@ function GenricLayOut(_ref) {
1463
1372
  }
1464
1373
 
1465
1374
  // Only process filter data if this is actually a filter drawer
1466
- if (formData.type === "FILTER-SUBMIT") {
1467
- var _state$dropdownSearch7, _state$inputSearch7, _ref4, _appliedFilters$filte, _state$tabs14, _config$tables29, _config$tables30, _tables$filter8, _tables$sorting19, _header$subHeading23, _header$subHeading24, _staticFilter$data8, _tables$sorting20, _state$misc14;
1375
+ if (formData.drawerKey === "filterData") {
1376
+ var _state$dropdownSearch7, _state$inputSearch7, _ref4, _appliedFilters$filte, _state$tabs14, _tables$pagination21, _tables$pagination22, _tables$filter8, _tables$sorting19, _header$subHeading13, _header$subHeading14, _staticFilter$data8, _tables$sorting20, _state$misc12;
1468
1377
  const appliedFilters = {};
1469
1378
  Object.keys(formData).forEach(key => {
1470
1379
  const value = formData[key];
@@ -1472,45 +1381,38 @@ function GenricLayOut(_ref) {
1472
1381
  appliedFilters[key] = value;
1473
1382
  }
1474
1383
  });
1475
- if (isFiltersEmpty(appliedFilters)) {
1476
- dispatch({
1477
- type: _layoutReducer.actionTypes.CUSTOM_DRAWER_CLOSED
1478
- });
1479
- return;
1480
- }
1481
1384
  const {
1482
1385
  error,
1483
1386
  data
1484
- } = await handleTableChange(_objectSpread(_objectSpread(_objectSpread(_objectSpread(_objectSpread(_objectSpread(_objectSpread({}, (state === null || state === void 0 || (_state$dropdownSearch7 = state.dropdownSearch) === null || _state$dropdownSearch7 === void 0 || (_state$dropdownSearch7 = _state$dropdownSearch7.value) === null || _state$dropdownSearch7 === void 0 ? void 0 : _state$dropdownSearch7.trim()) && {
1387
+ } = await handleTableChange(_objectSpread(_objectSpread(_objectSpread(_objectSpread(_objectSpread(_objectSpread({}, (state === null || state === void 0 || (_state$dropdownSearch7 = state.dropdownSearch) === null || _state$dropdownSearch7 === void 0 || (_state$dropdownSearch7 = _state$dropdownSearch7.value) === null || _state$dropdownSearch7 === void 0 ? void 0 : _state$dropdownSearch7.trim()) && {
1485
1388
  searchedValue: state.dropdownSearch.value,
1486
1389
  selectedOption: state.dropdownSearch.selectedOption
1487
1390
  }), (state === null || state === void 0 || (_state$inputSearch7 = state.inputSearch) === null || _state$inputSearch7 === void 0 || (_state$inputSearch7 = _state$inputSearch7.value) === null || _state$inputSearch7 === void 0 ? void 0 : _state$inputSearch7.trim()) && {
1488
1391
  searchedValue: state.inputSearch.value
1489
- }), appliedFilters), {}, {
1392
+ }), {}, {
1490
1393
  filterOn: (_ref4 = (_appliedFilters$filte = appliedFilters === null || appliedFilters === void 0 ? void 0 : appliedFilters.filterBy) !== null && _appliedFilters$filte !== void 0 ? _appliedFilters$filte : customDrawer === null || customDrawer === void 0 ? void 0 : customDrawer.defaultAppliedFilter) !== null && _ref4 !== void 0 ? _ref4 : "",
1491
1394
  fromDate: appliedFilters === null || appliedFilters === void 0 ? void 0 : appliedFilters.fromDate,
1492
1395
  toDate: appliedFilters === null || appliedFilters === void 0 ? void 0 : appliedFilters.toDate,
1493
1396
  selectedTab: state === null || state === void 0 || (_state$tabs14 = state.tabs) === null || _state$tabs14 === void 0 ? void 0 : _state$tabs14.active,
1494
- current: config === null || config === void 0 || (_config$tables29 = config.tables) === null || _config$tables29 === void 0 || (_config$tables29 = _config$tables29.pagination) === null || _config$tables29 === void 0 ? void 0 : _config$tables29.current,
1495
- pageSize: config === null || config === void 0 || (_config$tables30 = config.tables) === null || _config$tables30 === void 0 || (_config$tables30 = _config$tables30.pagination) === null || _config$tables30 === void 0 ? void 0 : _config$tables30.pageSize
1397
+ current: tables === null || tables === void 0 || (_tables$pagination21 = tables.pagination) === null || _tables$pagination21 === void 0 ? void 0 : _tables$pagination21.current,
1398
+ pageSize: tables === null || tables === void 0 || (_tables$pagination22 = tables.pagination) === null || _tables$pagination22 === void 0 ? void 0 : _tables$pagination22.pageSize
1496
1399
  }, (tables === null || tables === void 0 || (_tables$filter8 = tables.filter) === null || _tables$filter8 === void 0 ? void 0 : _tables$filter8.key) && {
1497
1400
  columnFilterStatus: tables === null || tables === void 0 ? void 0 : tables.filter
1498
1401
  }), {}, {
1499
1402
  field: tables === null || tables === void 0 || (_tables$sorting19 = tables.sorting) === null || _tables$sorting19 === void 0 ? void 0 : _tables$sorting19.sortBy
1500
- }, (header === null || header === void 0 || (_header$subHeading23 = header.subHeading) === null || _header$subHeading23 === void 0 || (_header$subHeading23 = _header$subHeading23.jsxConfig) === null || _header$subHeading23 === void 0 ? void 0 : _header$subHeading23.type) == "select" ? {
1501
- subHeadingSelectVal: header === null || header === void 0 || (_header$subHeading24 = header.subHeading) === null || _header$subHeading24 === void 0 || (_header$subHeading24 = _header$subHeading24.jsxConfig) === null || _header$subHeading24 === void 0 ? void 0 : _header$subHeading24.value
1403
+ }, (header === null || header === void 0 || (_header$subHeading13 = header.subHeading) === null || _header$subHeading13 === void 0 || (_header$subHeading13 = _header$subHeading13.jsxConfig) === null || _header$subHeading13 === void 0 ? void 0 : _header$subHeading13.type) == "select" ? {
1404
+ subHeadingSelectVal: header === null || header === void 0 || (_header$subHeading14 = header.subHeading) === null || _header$subHeading14 === void 0 || (_header$subHeading14 = _header$subHeading14.jsxConfig) === null || _header$subHeading14 === void 0 ? void 0 : _header$subHeading14.value
1502
1405
  } : {}), (staticFilter === null || staticFilter === void 0 ? void 0 : staticFilter.visible) && ((_staticFilter$data8 = staticFilter.data) === null || _staticFilter$data8 === void 0 || (_staticFilter$data8 = _staticFilter$data8.find(item => item.selected)) === null || _staticFilter$data8 === void 0 ? void 0 : _staticFilter$data8.value) && {
1503
1406
  staticFilter: staticFilter.data.find(item => item.selected).value
1504
1407
  }), {}, {
1505
1408
  order: tables === null || tables === void 0 || (_tables$sorting20 = tables.sorting) === null || _tables$sorting20 === void 0 ? void 0 : _tables$sorting20.sortDirection
1506
- }, (_state$misc14 = state === null || state === void 0 ? void 0 : state.misc) !== null && _state$misc14 !== void 0 ? _state$misc14 : {}));
1409
+ }, (_state$misc12 = state === null || state === void 0 ? void 0 : state.misc) !== null && _state$misc12 !== void 0 ? _state$misc12 : {}));
1507
1410
  if (error) {
1508
1411
  showErrorNotification(error);
1509
1412
  dispatch({
1510
1413
  type: _layoutReducer.actionTypes.SET_TABLE_EMPTY
1511
1414
  });
1512
1415
  } else {
1513
- var _config$tables31, _config$tables32;
1514
1416
  if (staticFilter !== null && staticFilter !== void 0 && staticFilter.visible) {
1515
1417
  var _staticFilter$data$fi3, _config$staticFilter2;
1516
1418
  const selectedKey = staticFilter === null || staticFilter === void 0 || (_staticFilter$data$fi3 = staticFilter.data.find(item => item.selected)) === null || _staticFilter$data$fi3 === void 0 ? void 0 : _staticFilter$data$fi3.value;
@@ -1536,52 +1438,39 @@ function GenricLayOut(_ref) {
1536
1438
  type: _layoutReducer.actionTypes.UPDATE_FILTER_DEFAULT_VALUES,
1537
1439
  payload: formData
1538
1440
  });
1539
- dispatch({
1540
- type: _layoutReducer.actionTypes.SET_PAGINATION,
1541
- payload: {
1542
- current: config === null || config === void 0 || (_config$tables31 = config.tables) === null || _config$tables31 === void 0 || (_config$tables31 = _config$tables31.pagination) === null || _config$tables31 === void 0 ? void 0 : _config$tables31.current,
1543
- pageSize: config === null || config === void 0 || (_config$tables32 = config.tables) === null || _config$tables32 === void 0 || (_config$tables32 = _config$tables32.pagination) === null || _config$tables32 === void 0 ? void 0 : _config$tables32.pageSize
1544
- }
1545
- });
1546
1441
  dispatch({
1547
1442
  type: _layoutReducer.actionTypes.CUSTOM_DRAWER_CLOSED
1548
1443
  });
1549
1444
  }
1550
1445
  } else if (formData.drawerKey === "exportDrawer") {
1551
- const appliedFilters = {};
1552
- Object.keys(formData).forEach(key => {
1553
- const value = formData[key];
1554
- if (value !== undefined && value !== "" && value !== null) {
1555
- appliedFilters[key] = value;
1556
- }
1557
- });
1446
+ console.log(formData, "formData");
1558
1447
  if (handleSecondaryTableCTAClick) {
1559
- var _state$dropdownSearch8, _state$inputSearch8, _state$tabs15, _tables$pagination7, _tables$pagination8, _tables$filter9, _tables$sorting21, _tables$sorting22, _header$subHeading25, _header$subHeading26, _staticFilter$data9, _state$misc15;
1448
+ var _state$dropdownSearch8, _state$inputSearch8, _state$tabs15, _tables$pagination23, _tables$pagination24, _tables$filter9, _tables$sorting21, _tables$sorting22, _header$subHeading15, _header$subHeading16, _staticFilter$data9, _state$misc13;
1560
1449
  const {
1561
1450
  error,
1562
1451
  data
1563
- } = await (handleSecondaryTableCTAClick === null || handleSecondaryTableCTAClick === void 0 ? void 0 : handleSecondaryTableCTAClick(_objectSpread(_objectSpread(_objectSpread(_objectSpread(_objectSpread(_objectSpread(_objectSpread({}, (state === null || state === void 0 || (_state$dropdownSearch8 = state.dropdownSearch) === null || _state$dropdownSearch8 === void 0 || (_state$dropdownSearch8 = _state$dropdownSearch8.value) === null || _state$dropdownSearch8 === void 0 ? void 0 : _state$dropdownSearch8.trim()) && {
1452
+ } = await (handleSecondaryTableCTAClick === null || handleSecondaryTableCTAClick === void 0 ? void 0 : handleSecondaryTableCTAClick(_objectSpread(_objectSpread(_objectSpread(_objectSpread(_objectSpread(_objectSpread({}, (state === null || state === void 0 || (_state$dropdownSearch8 = state.dropdownSearch) === null || _state$dropdownSearch8 === void 0 || (_state$dropdownSearch8 = _state$dropdownSearch8.value) === null || _state$dropdownSearch8 === void 0 ? void 0 : _state$dropdownSearch8.trim()) && {
1564
1453
  searchedValue: state.dropdownSearch.value,
1565
1454
  selectedOption: state.dropdownSearch.selectedOption
1566
1455
  }), (state === null || state === void 0 || (_state$inputSearch8 = state.inputSearch) === null || _state$inputSearch8 === void 0 || (_state$inputSearch8 = _state$inputSearch8.value) === null || _state$inputSearch8 === void 0 ? void 0 : _state$inputSearch8.trim()) && {
1567
1456
  searchedValue: state.inputSearch.value
1568
1457
  }), {}, {
1569
1458
  selectedTab: state === null || state === void 0 || (_state$tabs15 = state.tabs) === null || _state$tabs15 === void 0 ? void 0 : _state$tabs15.active,
1570
- current: tables === null || tables === void 0 || (_tables$pagination7 = tables.pagination) === null || _tables$pagination7 === void 0 ? void 0 : _tables$pagination7.current,
1571
- pageSize: tables === null || tables === void 0 || (_tables$pagination8 = tables.pagination) === null || _tables$pagination8 === void 0 ? void 0 : _tables$pagination8.pageSize,
1459
+ current: tables === null || tables === void 0 || (_tables$pagination23 = tables.pagination) === null || _tables$pagination23 === void 0 ? void 0 : _tables$pagination23.current,
1460
+ pageSize: tables === null || tables === void 0 || (_tables$pagination24 = tables.pagination) === null || _tables$pagination24 === void 0 ? void 0 : _tables$pagination24.pageSize,
1572
1461
  columnFilterStatus: tables === null || tables === void 0 || (_tables$filter9 = tables.filter) === null || _tables$filter9 === void 0 ? void 0 : _tables$filter9.value,
1573
1462
  field: tables === null || tables === void 0 || (_tables$sorting21 = tables.sorting) === null || _tables$sorting21 === void 0 ? void 0 : _tables$sorting21.sortBy,
1574
1463
  order: tables === null || tables === void 0 || (_tables$sorting22 = tables.sorting) === null || _tables$sorting22 === void 0 ? void 0 : _tables$sorting22.sortDirection
1575
- }, (header === null || header === void 0 || (_header$subHeading25 = header.subHeading) === null || _header$subHeading25 === void 0 || (_header$subHeading25 = _header$subHeading25.jsxConfig) === null || _header$subHeading25 === void 0 ? void 0 : _header$subHeading25.type) == "select" ? {
1576
- subHeadingSelectVal: header === null || header === void 0 || (_header$subHeading26 = header.subHeading) === null || _header$subHeading26 === void 0 || (_header$subHeading26 = _header$subHeading26.jsxConfig) === null || _header$subHeading26 === void 0 ? void 0 : _header$subHeading26.value
1464
+ }, (header === null || header === void 0 || (_header$subHeading15 = header.subHeading) === null || _header$subHeading15 === void 0 || (_header$subHeading15 = _header$subHeading15.jsxConfig) === null || _header$subHeading15 === void 0 ? void 0 : _header$subHeading15.type) == "select" ? {
1465
+ subHeadingSelectVal: header === null || header === void 0 || (_header$subHeading16 = header.subHeading) === null || _header$subHeading16 === void 0 || (_header$subHeading16 = _header$subHeading16.jsxConfig) === null || _header$subHeading16 === void 0 ? void 0 : _header$subHeading16.value
1577
1466
  } : {}), (staticFilter === null || staticFilter === void 0 ? void 0 : staticFilter.visible) && ((_staticFilter$data9 = staticFilter.data) === null || _staticFilter$data9 === void 0 || (_staticFilter$data9 = _staticFilter$data9.find(item => item.selected)) === null || _staticFilter$data9 === void 0 ? void 0 : _staticFilter$data9.value) && {
1578
1467
  staticFilter: staticFilter.data.find(item => item.selected).value
1579
1468
  }), {}, {
1580
1469
  fromDate: formData === null || formData === void 0 ? void 0 : formData.fromDate,
1581
1470
  toDate: formData === null || formData === void 0 ? void 0 : formData.toDate
1582
- }, appliedFilters), (formData === null || formData === void 0 ? void 0 : formData.exportType) && {
1471
+ }, (formData === null || formData === void 0 ? void 0 : formData.exportType) && {
1583
1472
  exportType: formData === null || formData === void 0 ? void 0 : formData.exportType
1584
- }), (_state$misc15 = state === null || state === void 0 ? void 0 : state.misc) !== null && _state$misc15 !== void 0 ? _state$misc15 : {})));
1473
+ }), (_state$misc13 = state === null || state === void 0 ? void 0 : state.misc) !== null && _state$misc13 !== void 0 ? _state$misc13 : {})));
1585
1474
  if (error) {
1586
1475
  showErrorNotification(error);
1587
1476
  } else {
@@ -1595,7 +1484,7 @@ function GenricLayOut(_ref) {
1595
1484
  }
1596
1485
  };
1597
1486
  const onClearAllAppliedFilters = async () => {
1598
- var _state$dropdownSearch9, _state$inputSearch9, _state$tabs16, _tables$pagination9, _tables$pagination10, _tables$filter10, _tables$sorting23, _header$subHeading27, _header$subHeading28, _staticFilter$data10, _tables$sorting24, _state$misc16;
1487
+ var _state$dropdownSearch9, _state$inputSearch9, _state$tabs16, _tables$pagination25, _tables$pagination26, _tables$filter10, _tables$sorting23, _header$subHeading17, _header$subHeading18, _staticFilter$data10, _tables$sorting24, _state$misc14;
1599
1488
  const {
1600
1489
  error,
1601
1490
  data
@@ -1606,19 +1495,19 @@ function GenricLayOut(_ref) {
1606
1495
  searchedValue: state.inputSearch.value
1607
1496
  }), {}, {
1608
1497
  selectedTab: state === null || state === void 0 || (_state$tabs16 = state.tabs) === null || _state$tabs16 === void 0 ? void 0 : _state$tabs16.active,
1609
- current: tables === null || tables === void 0 || (_tables$pagination9 = tables.pagination) === null || _tables$pagination9 === void 0 ? void 0 : _tables$pagination9.current,
1610
- pageSize: tables === null || tables === void 0 || (_tables$pagination10 = tables.pagination) === null || _tables$pagination10 === void 0 ? void 0 : _tables$pagination10.pageSize
1498
+ current: tables === null || tables === void 0 || (_tables$pagination25 = tables.pagination) === null || _tables$pagination25 === void 0 ? void 0 : _tables$pagination25.current,
1499
+ pageSize: tables === null || tables === void 0 || (_tables$pagination26 = tables.pagination) === null || _tables$pagination26 === void 0 ? void 0 : _tables$pagination26.pageSize
1611
1500
  }, (tables === null || tables === void 0 || (_tables$filter10 = tables.filter) === null || _tables$filter10 === void 0 ? void 0 : _tables$filter10.key) && {
1612
1501
  columnFilterStatus: tables === null || tables === void 0 ? void 0 : tables.filter
1613
1502
  }), {}, {
1614
1503
  field: tables === null || tables === void 0 || (_tables$sorting23 = tables.sorting) === null || _tables$sorting23 === void 0 ? void 0 : _tables$sorting23.sortBy
1615
- }, (header === null || header === void 0 || (_header$subHeading27 = header.subHeading) === null || _header$subHeading27 === void 0 || (_header$subHeading27 = _header$subHeading27.jsxConfig) === null || _header$subHeading27 === void 0 ? void 0 : _header$subHeading27.type) == "select" ? {
1616
- subHeadingSelectVal: header === null || header === void 0 || (_header$subHeading28 = header.subHeading) === null || _header$subHeading28 === void 0 || (_header$subHeading28 = _header$subHeading28.jsxConfig) === null || _header$subHeading28 === void 0 ? void 0 : _header$subHeading28.value
1504
+ }, (header === null || header === void 0 || (_header$subHeading17 = header.subHeading) === null || _header$subHeading17 === void 0 || (_header$subHeading17 = _header$subHeading17.jsxConfig) === null || _header$subHeading17 === void 0 ? void 0 : _header$subHeading17.type) == "select" ? {
1505
+ subHeadingSelectVal: header === null || header === void 0 || (_header$subHeading18 = header.subHeading) === null || _header$subHeading18 === void 0 || (_header$subHeading18 = _header$subHeading18.jsxConfig) === null || _header$subHeading18 === void 0 ? void 0 : _header$subHeading18.value
1617
1506
  } : {}), (staticFilter === null || staticFilter === void 0 ? void 0 : staticFilter.visible) && ((_staticFilter$data10 = staticFilter.data) === null || _staticFilter$data10 === void 0 || (_staticFilter$data10 = _staticFilter$data10.find(item => item.selected)) === null || _staticFilter$data10 === void 0 ? void 0 : _staticFilter$data10.value) && {
1618
1507
  staticFilter: staticFilter.data.find(item => item.selected).value
1619
1508
  }), {}, {
1620
1509
  order: tables === null || tables === void 0 || (_tables$sorting24 = tables.sorting) === null || _tables$sorting24 === void 0 ? void 0 : _tables$sorting24.sortDirection
1621
- }, (_state$misc16 = state === null || state === void 0 ? void 0 : state.misc) !== null && _state$misc16 !== void 0 ? _state$misc16 : {}));
1510
+ }, (_state$misc14 = state === null || state === void 0 ? void 0 : state.misc) !== null && _state$misc14 !== void 0 ? _state$misc14 : {}));
1622
1511
  if (error) {
1623
1512
  showErrorNotification(error);
1624
1513
  dispatch({
@@ -1656,7 +1545,7 @@ function GenricLayOut(_ref) {
1656
1545
  * @returns {Promise<void>} - Resolves after the action is handled.
1657
1546
  *
1658
1547
  * Handles the modal footer button clicks with the following actions:
1659
- * - "CLOSE_MODAL": Closes the modal.
1548
+ * - "CLOSE_MODAL_ONLEY": Closes the modal.
1660
1549
  * - "CLOSE_MODAL_AND_FETCH": Calls the `handleModalCloseSuccess` function
1661
1550
  * if provided, and closes the modal if successful. Also re-initializes the
1662
1551
  * state.
@@ -1667,7 +1556,7 @@ function GenricLayOut(_ref) {
1667
1556
  */
1668
1557
 
1669
1558
  const onClickModalFooter = async (action, buttonConfig) => {
1670
- if (action === "CLOSE_MODAL") {
1559
+ if (action === "CLOSE_MODAL_ONLEY") {
1671
1560
  dispatch({
1672
1561
  type: _layoutReducer.actionTypes.TOGGLE_MODAL,
1673
1562
  payload: false
@@ -1675,14 +1564,14 @@ function GenricLayOut(_ref) {
1675
1564
  return;
1676
1565
  } else if (action === "CLOSE_MODAL_AND_FETCH") {
1677
1566
  if (handleModalCloseSuccess) {
1678
- var _stateRef$current, _state$misc17;
1567
+ var _stateRef$current, _state$misc15;
1679
1568
  const {
1680
1569
  error,
1681
1570
  data
1682
1571
  } = await (handleModalCloseSuccess === null || handleModalCloseSuccess === void 0 ? void 0 : handleModalCloseSuccess(_objectSpread({
1683
1572
  modalValue: stateRef === null || stateRef === void 0 || (_stateRef$current = stateRef.current) === null || _stateRef$current === void 0 || (_stateRef$current = _stateRef$current.modal) === null || _stateRef$current === void 0 ? void 0 : _stateRef$current.value,
1684
1573
  call: buttonConfig === null || buttonConfig === void 0 ? void 0 : buttonConfig.call
1685
- }, (_state$misc17 = state === null || state === void 0 ? void 0 : state.misc) !== null && _state$misc17 !== void 0 ? _state$misc17 : {})));
1574
+ }, (_state$misc15 = state === null || state === void 0 ? void 0 : state.misc) !== null && _state$misc15 !== void 0 ? _state$misc15 : {})));
1686
1575
  if (error) {
1687
1576
  showErrorNotification(error);
1688
1577
  } else {
@@ -1696,10 +1585,10 @@ function GenricLayOut(_ref) {
1696
1585
  }
1697
1586
  } else {
1698
1587
  if (handleDrawerFormOnFinish) {
1699
- var _state$tables$selecte, _state$tables3;
1588
+ var _state$tables$selecte, _state$tables2;
1700
1589
  let req = {};
1701
1590
  req.type = "APPROVE";
1702
- req.orderUUID = (_state$tables$selecte = state === null || state === void 0 || (_state$tables3 = state.tables) === null || _state$tables3 === void 0 || (_state$tables3 = _state$tables3.selectedRowKeys) === null || _state$tables3 === void 0 ? void 0 : _state$tables3.map(item => item.orderUUID)) !== null && _state$tables$selecte !== void 0 ? _state$tables$selecte : [];
1591
+ req.orderUUID = (_state$tables$selecte = state === null || state === void 0 || (_state$tables2 = state.tables) === null || _state$tables2 === void 0 || (_state$tables2 = _state$tables2.selectedRowKeys) === null || _state$tables2 === void 0 ? void 0 : _state$tables2.map(item => item.orderUUID)) !== null && _state$tables$selecte !== void 0 ? _state$tables$selecte : [];
1703
1592
  const {
1704
1593
  error,
1705
1594
  data
@@ -1749,6 +1638,7 @@ function GenricLayOut(_ref) {
1749
1638
  * - "OPEN_MODAL": Opens a modal with updated content.
1750
1639
  */
1751
1640
  const leftHeaderFirstButtonClick = async () => {
1641
+ console.log(leftHeaderFirstButton, "leftHeaderFirstButton");
1752
1642
  if ((leftHeaderFirstButton === null || leftHeaderFirstButton === void 0 ? void 0 : leftHeaderFirstButton.action) === "OPEN_CUSTOM_DRAWER") {
1753
1643
  var _config$customDrawer3;
1754
1644
  const drawerData = config === null || config === void 0 || (_config$customDrawer3 = config.customDrawer) === null || _config$customDrawer3 === void 0 || (_config$customDrawer3 = _config$customDrawer3.data) === null || _config$customDrawer3 === void 0 ? void 0 : _config$customDrawer3[leftHeaderFirstButton === null || leftHeaderFirstButton === void 0 ? void 0 : leftHeaderFirstButton.drawerKey];
@@ -1799,7 +1689,7 @@ function GenricLayOut(_ref) {
1799
1689
  };
1800
1690
  const rightHeaderSecondButtonClick = async () => {
1801
1691
  if ((rightHeaderSecondButton === null || rightHeaderSecondButton === void 0 ? void 0 : rightHeaderSecondButton.action) === "RESET_CUSTOM_DRAWER") {
1802
- var _state$dropdownSearch10, _state$inputSearch10, _state$tabs17, _tables$pagination11, _tables$pagination12, _tables$filter11, _tables$sorting25, _header$subHeading29, _header$subHeading30, _staticFilter$data11, _tables$sorting26, _state$misc18;
1692
+ var _state$dropdownSearch10, _state$inputSearch10, _state$tabs17, _tables$pagination27, _tables$pagination28, _tables$filter11, _tables$sorting25, _header$subHeading19, _header$subHeading20, _staticFilter$data11, _tables$sorting26, _state$misc16;
1803
1693
  const {
1804
1694
  error,
1805
1695
  data
@@ -1810,19 +1700,19 @@ function GenricLayOut(_ref) {
1810
1700
  searchedValue: state.inputSearch.value
1811
1701
  }), {}, {
1812
1702
  selectedTab: state === null || state === void 0 || (_state$tabs17 = state.tabs) === null || _state$tabs17 === void 0 ? void 0 : _state$tabs17.active,
1813
- current: tables === null || tables === void 0 || (_tables$pagination11 = tables.pagination) === null || _tables$pagination11 === void 0 ? void 0 : _tables$pagination11.current,
1814
- pageSize: tables === null || tables === void 0 || (_tables$pagination12 = tables.pagination) === null || _tables$pagination12 === void 0 ? void 0 : _tables$pagination12.pageSize
1703
+ current: tables === null || tables === void 0 || (_tables$pagination27 = tables.pagination) === null || _tables$pagination27 === void 0 ? void 0 : _tables$pagination27.current,
1704
+ pageSize: tables === null || tables === void 0 || (_tables$pagination28 = tables.pagination) === null || _tables$pagination28 === void 0 ? void 0 : _tables$pagination28.pageSize
1815
1705
  }, (tables === null || tables === void 0 || (_tables$filter11 = tables.filter) === null || _tables$filter11 === void 0 ? void 0 : _tables$filter11.key) && {
1816
1706
  columnFilterStatus: tables === null || tables === void 0 ? void 0 : tables.filter
1817
1707
  }), {}, {
1818
1708
  field: tables === null || tables === void 0 || (_tables$sorting25 = tables.sorting) === null || _tables$sorting25 === void 0 ? void 0 : _tables$sorting25.sortBy
1819
- }, (header === null || header === void 0 || (_header$subHeading29 = header.subHeading) === null || _header$subHeading29 === void 0 || (_header$subHeading29 = _header$subHeading29.jsxConfig) === null || _header$subHeading29 === void 0 ? void 0 : _header$subHeading29.type) == "select" ? {
1820
- subHeadingSelectVal: header === null || header === void 0 || (_header$subHeading30 = header.subHeading) === null || _header$subHeading30 === void 0 || (_header$subHeading30 = _header$subHeading30.jsxConfig) === null || _header$subHeading30 === void 0 ? void 0 : _header$subHeading30.value
1709
+ }, (header === null || header === void 0 || (_header$subHeading19 = header.subHeading) === null || _header$subHeading19 === void 0 || (_header$subHeading19 = _header$subHeading19.jsxConfig) === null || _header$subHeading19 === void 0 ? void 0 : _header$subHeading19.type) == "select" ? {
1710
+ subHeadingSelectVal: header === null || header === void 0 || (_header$subHeading20 = header.subHeading) === null || _header$subHeading20 === void 0 || (_header$subHeading20 = _header$subHeading20.jsxConfig) === null || _header$subHeading20 === void 0 ? void 0 : _header$subHeading20.value
1821
1711
  } : {}), (staticFilter === null || staticFilter === void 0 ? void 0 : staticFilter.visible) && ((_staticFilter$data11 = staticFilter.data) === null || _staticFilter$data11 === void 0 || (_staticFilter$data11 = _staticFilter$data11.find(item => item.selected)) === null || _staticFilter$data11 === void 0 ? void 0 : _staticFilter$data11.value) && {
1822
1712
  staticFilter: staticFilter.data.find(item => item.selected).value
1823
1713
  }), {}, {
1824
1714
  order: tables === null || tables === void 0 || (_tables$sorting26 = tables.sorting) === null || _tables$sorting26 === void 0 ? void 0 : _tables$sorting26.sortDirection
1825
- }, (_state$misc18 = state === null || state === void 0 ? void 0 : state.misc) !== null && _state$misc18 !== void 0 ? _state$misc18 : {}));
1715
+ }, (_state$misc16 = state === null || state === void 0 ? void 0 : state.misc) !== null && _state$misc16 !== void 0 ? _state$misc16 : {}));
1826
1716
  if (error) {
1827
1717
  showErrorNotification(error);
1828
1718
  dispatch({
@@ -1873,7 +1763,7 @@ function GenricLayOut(_ref) {
1873
1763
  };
1874
1764
  const handleSubHeadingSelect = async val => {
1875
1765
  if (val) {
1876
- var _state$tabs18, _tables$pagination13, _tables$pagination14, _state$misc19;
1766
+ var _tables$pagination29, _tables$pagination30, _state$misc17;
1877
1767
  dispatch({
1878
1768
  type: _layoutReducer.actionTypes.SET_SUBHEADING_SELECTED_CONFIG,
1879
1769
  payload: val
@@ -1882,12 +1772,11 @@ function GenricLayOut(_ref) {
1882
1772
  error,
1883
1773
  data
1884
1774
  } = await handleSubHeadingSelectClick(_objectSpread({
1885
- selectedTab: state === null || state === void 0 || (_state$tabs18 = state.tabs) === null || _state$tabs18 === void 0 ? void 0 : _state$tabs18.active,
1886
1775
  searchedValue: inputSearch === null || inputSearch === void 0 ? void 0 : inputSearch.value,
1887
- current: tables === null || tables === void 0 || (_tables$pagination13 = tables.pagination) === null || _tables$pagination13 === void 0 ? void 0 : _tables$pagination13.current,
1888
- pageSize: tables === null || tables === void 0 || (_tables$pagination14 = tables.pagination) === null || _tables$pagination14 === void 0 ? void 0 : _tables$pagination14.pageSize,
1776
+ current: tables === null || tables === void 0 || (_tables$pagination29 = tables.pagination) === null || _tables$pagination29 === void 0 ? void 0 : _tables$pagination29.current,
1777
+ pageSize: tables === null || tables === void 0 || (_tables$pagination30 = tables.pagination) === null || _tables$pagination30 === void 0 ? void 0 : _tables$pagination30.pageSize,
1889
1778
  subHeadingSelectVal: val
1890
- }, (_state$misc19 = state === null || state === void 0 ? void 0 : state.misc) !== null && _state$misc19 !== void 0 ? _state$misc19 : {}));
1779
+ }, (_state$misc17 = state === null || state === void 0 ? void 0 : state.misc) !== null && _state$misc17 !== void 0 ? _state$misc17 : {}));
1891
1780
  if (error) {
1892
1781
  showErrorNotification(error);
1893
1782
  dispatch({
@@ -1914,7 +1803,7 @@ function GenricLayOut(_ref) {
1914
1803
 
1915
1804
  // Call the handler if provided
1916
1805
  if (handleTableChange) {
1917
- var _state$dropdownSearch11, _state$inputSearch11, _state$tabs19, _tables$pagination15, _tables$sorting27, _tables$sorting28, _header$subHeading31, _header$subHeading32, _customDrawer$applied10, _state$misc20;
1806
+ var _state$dropdownSearch11, _state$inputSearch11, _state$tabs18, _tables$pagination31, _tables$sorting27, _tables$sorting28, _header$subHeading21, _header$subHeading22, _customDrawer$applied10, _state$misc18;
1918
1807
  dispatch({
1919
1808
  type: _layoutReducer.actionTypes.SET_LOADING,
1920
1809
  payload: true
@@ -1928,16 +1817,20 @@ function GenricLayOut(_ref) {
1928
1817
  }), (state === null || state === void 0 || (_state$inputSearch11 = state.inputSearch) === null || _state$inputSearch11 === void 0 || (_state$inputSearch11 = _state$inputSearch11.value) === null || _state$inputSearch11 === void 0 ? void 0 : _state$inputSearch11.trim()) && {
1929
1818
  searchedValue: state.inputSearch.value
1930
1819
  }), {}, {
1931
- selectedTab: state === null || state === void 0 || (_state$tabs19 = state.tabs) === null || _state$tabs19 === void 0 ? void 0 : _state$tabs19.active,
1820
+ selectedTab: state === null || state === void 0 || (_state$tabs18 = state.tabs) === null || _state$tabs18 === void 0 ? void 0 : _state$tabs18.active,
1932
1821
  current: 1,
1933
1822
  // Reset to first page when filtering
1934
- pageSize: tables === null || tables === void 0 || (_tables$pagination15 = tables.pagination) === null || _tables$pagination15 === void 0 ? void 0 : _tables$pagination15.pageSize,
1823
+ pageSize: tables === null || tables === void 0 || (_tables$pagination31 = tables.pagination) === null || _tables$pagination31 === void 0 ? void 0 : _tables$pagination31.pageSize,
1935
1824
  filterStatus: filterValue,
1936
1825
  field: tables === null || tables === void 0 || (_tables$sorting27 = tables.sorting) === null || _tables$sorting27 === void 0 ? void 0 : _tables$sorting27.sortBy,
1937
1826
  order: tables === null || tables === void 0 || (_tables$sorting28 = tables.sorting) === null || _tables$sorting28 === void 0 ? void 0 : _tables$sorting28.sortDirection
1938
- }, (header === null || header === void 0 || (_header$subHeading31 = header.subHeading) === null || _header$subHeading31 === void 0 || (_header$subHeading31 = _header$subHeading31.jsxConfig) === null || _header$subHeading31 === void 0 ? void 0 : _header$subHeading31.type) == "select" ? {
1939
- subHeadingSelectVal: header === null || header === void 0 || (_header$subHeading32 = header.subHeading) === null || _header$subHeading32 === void 0 || (_header$subHeading32 = _header$subHeading32.jsxConfig) === null || _header$subHeading32 === void 0 ? void 0 : _header$subHeading32.value
1940
- } : {}), (customDrawer === null || customDrawer === void 0 ? void 0 : customDrawer.appliedFilters) && Object.keys((_customDrawer$applied10 = customDrawer === null || customDrawer === void 0 ? void 0 : customDrawer.appliedFilters) !== null && _customDrawer$applied10 !== void 0 ? _customDrawer$applied10 : {}).length > 0 && _objectSpread({}, customDrawer === null || customDrawer === void 0 ? void 0 : customDrawer.appliedFilters)), (_state$misc20 = state === null || state === void 0 ? void 0 : state.misc) !== null && _state$misc20 !== void 0 ? _state$misc20 : {}), {}, {
1827
+ }, (header === null || header === void 0 || (_header$subHeading21 = header.subHeading) === null || _header$subHeading21 === void 0 || (_header$subHeading21 = _header$subHeading21.jsxConfig) === null || _header$subHeading21 === void 0 ? void 0 : _header$subHeading21.type) == "select" ? {
1828
+ subHeadingSelectVal: header === null || header === void 0 || (_header$subHeading22 = header.subHeading) === null || _header$subHeading22 === void 0 || (_header$subHeading22 = _header$subHeading22.jsxConfig) === null || _header$subHeading22 === void 0 ? void 0 : _header$subHeading22.value
1829
+ } : {}), (customDrawer === null || customDrawer === void 0 ? void 0 : customDrawer.appliedFilters) && Object.keys((_customDrawer$applied10 = customDrawer === null || customDrawer === void 0 ? void 0 : customDrawer.appliedFilters) !== null && _customDrawer$applied10 !== void 0 ? _customDrawer$applied10 : {}).length > 0 && {
1830
+ filterOn: customDrawer === null || customDrawer === void 0 ? void 0 : customDrawer.appliedFilters.filterBy,
1831
+ fromDate: customDrawer === null || customDrawer === void 0 ? void 0 : customDrawer.appliedFilters.fromDate,
1832
+ toDate: customDrawer === null || customDrawer === void 0 ? void 0 : customDrawer.appliedFilters.toDate
1833
+ }), (_state$misc18 = state === null || state === void 0 ? void 0 : state.misc) !== null && _state$misc18 !== void 0 ? _state$misc18 : {}), {}, {
1941
1834
  staticFilter: filterValue // Pass static filter value
1942
1835
  }));
1943
1836
  if (error) {
@@ -1946,7 +1839,7 @@ function GenricLayOut(_ref) {
1946
1839
  type: _layoutReducer.actionTypes.SET_TABLE_EMPTY
1947
1840
  });
1948
1841
  } else {
1949
- var _tables$pagination16;
1842
+ var _tables$pagination32;
1950
1843
  dispatch({
1951
1844
  type: _layoutReducer.actionTypes.SET_TABLE_DATA,
1952
1845
  payload: data
@@ -1956,7 +1849,7 @@ function GenricLayOut(_ref) {
1956
1849
  type: _layoutReducer.actionTypes.SET_PAGINATION,
1957
1850
  payload: {
1958
1851
  current: 1,
1959
- pageSize: tables === null || tables === void 0 || (_tables$pagination16 = tables.pagination) === null || _tables$pagination16 === void 0 ? void 0 : _tables$pagination16.pageSize
1852
+ pageSize: tables === null || tables === void 0 || (_tables$pagination32 = tables.pagination) === null || _tables$pagination32 === void 0 ? void 0 : _tables$pagination32.pageSize
1960
1853
  }
1961
1854
  });
1962
1855
  }
@@ -1979,7 +1872,7 @@ function GenricLayOut(_ref) {
1979
1872
  }
1980
1873
  });
1981
1874
  if (handleTableChange) {
1982
- var _state$dropdownSearch12, _state$inputSearch12, _state$tabs20, _tables$filter12, _tables$sorting29, _tables$sorting30, _header$subHeading33, _header$subHeading34, _staticFilter$data12, _customDrawer$applied11, _state$misc21;
1875
+ var _state$dropdownSearch12, _state$inputSearch12, _state$tabs19, _tables$filter12, _tables$sorting29, _tables$sorting30, _header$subHeading23, _header$subHeading24, _staticFilter$data12, _customDrawer$applied11, _state$misc19;
1983
1876
  const {
1984
1877
  error,
1985
1878
  data
@@ -1989,17 +1882,21 @@ function GenricLayOut(_ref) {
1989
1882
  }), (state === null || state === void 0 || (_state$inputSearch12 = state.inputSearch) === null || _state$inputSearch12 === void 0 || (_state$inputSearch12 = _state$inputSearch12.value) === null || _state$inputSearch12 === void 0 ? void 0 : _state$inputSearch12.trim()) && {
1990
1883
  searchedValue: state.inputSearch.value
1991
1884
  }), {}, {
1992
- selectedTab: state === null || state === void 0 || (_state$tabs20 = state.tabs) === null || _state$tabs20 === void 0 ? void 0 : _state$tabs20.active,
1885
+ selectedTab: state === null || state === void 0 || (_state$tabs19 = state.tabs) === null || _state$tabs19 === void 0 ? void 0 : _state$tabs19.active,
1993
1886
  current,
1994
1887
  pageSize,
1995
1888
  columnFilterStatus: tables === null || tables === void 0 || (_tables$filter12 = tables.filter) === null || _tables$filter12 === void 0 ? void 0 : _tables$filter12.value,
1996
1889
  field: tables === null || tables === void 0 || (_tables$sorting29 = tables.sorting) === null || _tables$sorting29 === void 0 ? void 0 : _tables$sorting29.sortBy,
1997
1890
  order: tables === null || tables === void 0 || (_tables$sorting30 = tables.sorting) === null || _tables$sorting30 === void 0 ? void 0 : _tables$sorting30.sortDirection
1998
- }, (header === null || header === void 0 || (_header$subHeading33 = header.subHeading) === null || _header$subHeading33 === void 0 || (_header$subHeading33 = _header$subHeading33.jsxConfig) === null || _header$subHeading33 === void 0 ? void 0 : _header$subHeading33.type) == "select" ? {
1999
- subHeadingSelectVal: header === null || header === void 0 || (_header$subHeading34 = header.subHeading) === null || _header$subHeading34 === void 0 || (_header$subHeading34 = _header$subHeading34.jsxConfig) === null || _header$subHeading34 === void 0 ? void 0 : _header$subHeading34.value
1891
+ }, (header === null || header === void 0 || (_header$subHeading23 = header.subHeading) === null || _header$subHeading23 === void 0 || (_header$subHeading23 = _header$subHeading23.jsxConfig) === null || _header$subHeading23 === void 0 ? void 0 : _header$subHeading23.type) == "select" ? {
1892
+ subHeadingSelectVal: header === null || header === void 0 || (_header$subHeading24 = header.subHeading) === null || _header$subHeading24 === void 0 || (_header$subHeading24 = _header$subHeading24.jsxConfig) === null || _header$subHeading24 === void 0 ? void 0 : _header$subHeading24.value
2000
1893
  } : {}), (staticFilter === null || staticFilter === void 0 ? void 0 : staticFilter.visible) && ((_staticFilter$data12 = staticFilter.data) === null || _staticFilter$data12 === void 0 || (_staticFilter$data12 = _staticFilter$data12.find(item => item.selected)) === null || _staticFilter$data12 === void 0 ? void 0 : _staticFilter$data12.value) && {
2001
1894
  staticFilter: staticFilter.data.find(item => item.selected).value
2002
- }), (customDrawer === null || customDrawer === void 0 ? void 0 : customDrawer.appliedFilters) && Object.keys((_customDrawer$applied11 = customDrawer === null || customDrawer === void 0 ? void 0 : customDrawer.appliedFilters) !== null && _customDrawer$applied11 !== void 0 ? _customDrawer$applied11 : {}).length > 0 && _objectSpread({}, customDrawer === null || customDrawer === void 0 ? void 0 : customDrawer.appliedFilters)), (_state$misc21 = state === null || state === void 0 ? void 0 : state.misc) !== null && _state$misc21 !== void 0 ? _state$misc21 : {}));
1895
+ }), (customDrawer === null || customDrawer === void 0 ? void 0 : customDrawer.appliedFilters) && Object.keys((_customDrawer$applied11 = customDrawer === null || customDrawer === void 0 ? void 0 : customDrawer.appliedFilters) !== null && _customDrawer$applied11 !== void 0 ? _customDrawer$applied11 : {}).length > 0 && {
1896
+ filterOn: customDrawer === null || customDrawer === void 0 ? void 0 : customDrawer.appliedFilters.filterBy,
1897
+ fromDate: customDrawer === null || customDrawer === void 0 ? void 0 : customDrawer.appliedFilters.fromDate,
1898
+ toDate: customDrawer === null || customDrawer === void 0 ? void 0 : customDrawer.appliedFilters.toDate
1899
+ }), (_state$misc19 = state === null || state === void 0 ? void 0 : state.misc) !== null && _state$misc19 !== void 0 ? _state$misc19 : {}));
2003
1900
  if (error) {
2004
1901
  showErrorNotification(error);
2005
1902
  dispatch({
@@ -2016,18 +1913,9 @@ function GenricLayOut(_ref) {
2016
1913
  }
2017
1914
  }
2018
1915
  };
2019
- function isFiltersEmpty() {
2020
- let filters = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
2021
- const filtersKeyLength = Object.keys(filters).length;
2022
- if (filtersKeyLength === 0) return true;
2023
- if (filtersKeyLength === 2) {
2024
- return (filters === null || filters === void 0 ? void 0 : filters.drawerKey) && (filters === null || filters === void 0 ? void 0 : filters.type);
2025
- }
2026
- return false;
2027
- }
2028
1916
  console.log(state, "GenricLayOutstate");
2029
1917
  return /*#__PURE__*/_react.default.createElement(_styles.OapageWithDataStyle, {
2030
- className: (state === null || state === void 0 || (_state$misc22 = state.misc) === null || _state$misc22 === void 0 ? void 0 : _state$misc22.flow) === "hubAutomation" ? "hubAutomationContainer" : ""
1918
+ className: (state === null || state === void 0 || (_state$misc20 = state.misc) === null || _state$misc20 === void 0 ? void 0 : _state$misc20.flow) === "hubAutomation" ? "hubAutomationContainer" : ""
2031
1919
  }, /*#__PURE__*/_react.default.createElement(_styles.DrawerWithOutFooter, null), /*#__PURE__*/_react.default.createElement("div", {
2032
1920
  className: "fullPageLayout"
2033
1921
  }, /*#__PURE__*/_react.default.createElement(_GlobalCss.default, null, (sidebar === null || sidebar === void 0 ? void 0 : sidebar.visible) && /*#__PURE__*/_react.default.createElement(_antd.Skeleton, {
@@ -2120,7 +2008,7 @@ function GenricLayOut(_ref) {
2120
2008
  }),
2121
2009
  position: "left"
2122
2010
  })
2123
- }), !isFiltersEmpty(customDrawer === null || customDrawer === void 0 ? void 0 : customDrawer.appliedFilters) && /*#__PURE__*/_react.default.createElement("span", {
2011
+ }), Object.keys((_customDrawer$applied12 = customDrawer === null || customDrawer === void 0 ? void 0 : customDrawer.appliedFilters) !== null && _customDrawer$applied12 !== void 0 ? _customDrawer$applied12 : {}).length > 0 && /*#__PURE__*/_react.default.createElement("span", {
2124
2012
  className: "notifyDot"
2125
2013
  })))))), (inputSearch === null || inputSearch === void 0 ? void 0 : inputSearch.visible) && /*#__PURE__*/_react.default.createElement(_antd.Skeleton, {
2126
2014
  loading: state === null || state === void 0 ? void 0 : state.isLoading,
@@ -2185,7 +2073,7 @@ function GenricLayOut(_ref) {
2185
2073
  onChange: onTableChange,
2186
2074
  customTableChange: customTableChange,
2187
2075
  pagination: tables === null || tables === void 0 ? void 0 : tables.pagination,
2188
- selectedRows: (state === null || state === void 0 || (_state$tables4 = state.tables) === null || _state$tables4 === void 0 ? void 0 : _state$tables4.selectedRowKeys) || [],
2076
+ selectedRows: (state === null || state === void 0 || (_state$tables3 = state.tables) === null || _state$tables3 === void 0 ? void 0 : _state$tables3.selectedRowKeys) || [],
2189
2077
  rowSelection: (tables === null || tables === void 0 || (_tables$selectionType = tables.selectionType) === null || _tables$selectionType === void 0 ? void 0 : _tables$selectionType[(_tabs$active4 = tabs === null || tabs === void 0 ? void 0 : tabs.active) !== null && _tabs$active4 !== void 0 ? _tabs$active4 : "default"]) && Object.assign({
2190
2078
  type: tables === null || tables === void 0 || (_tables$selectionType2 = tables.selectionType) === null || _tables$selectionType2 === void 0 ? void 0 : _tables$selectionType2[tabs === null || tabs === void 0 ? void 0 : tabs.active]
2191
2079
  }, rowSelection),
@@ -2193,7 +2081,7 @@ function GenricLayOut(_ref) {
2193
2081
  emptyText: emptyTableState
2194
2082
  },
2195
2083
  emptyStateCard: emptyTableState,
2196
- onMobilePageChange: tables !== null && tables !== void 0 && (_tables$pagination17 = tables.pagination) !== null && _tables$pagination17 !== void 0 && _tables$pagination17.mwebPagination ? onMobilePageChange : undefined
2084
+ onMobilePageChange: tables !== null && tables !== void 0 && (_tables$pagination33 = tables.pagination) !== null && _tables$pagination33 !== void 0 && _tables$pagination33.mwebPagination ? onMobilePageChange : undefined
2197
2085
  })))), (drawer === null || drawer === void 0 ? void 0 : drawer.visible) && /*#__PURE__*/_react.default.createElement(_CustomDrawer.default, {
2198
2086
  className: "oaDrawer",
2199
2087
  title: drawer === null || drawer === void 0 || (_drawer$data = drawer.data) === null || _drawer$data === void 0 || (_drawer$data = _drawer$data[(_tabs$active5 = tabs === null || tabs === void 0 ? void 0 : tabs.active) !== null && _tabs$active5 !== void 0 ? _tabs$active5 : "default"]) === null || _drawer$data === void 0 || (_drawer$data = _drawer$data[drawer === null || drawer === void 0 ? void 0 : drawer.active]) === null || _drawer$data === void 0 ? void 0 : _drawer$data.title,
@@ -2251,7 +2139,7 @@ function GenricLayOut(_ref) {
2251
2139
  className: "bottomSelectedSecion"
2252
2140
  }, /*#__PURE__*/_react.default.createElement(_Typography.default, {
2253
2141
  color: "secondary-content",
2254
- typography: "type-button-500"
2142
+ typography: "ype-button-500"
2255
2143
  }, /*#__PURE__*/_react.default.createElement("span", null, "".concat(tables === null || tables === void 0 || (_tables$selectedRowKe = tables.selectedRowKeys) === null || _tables$selectedRowKe === void 0 ? void 0 : _tables$selectedRowKe.length, " ").concat(tables === null || tables === void 0 || (_tables$tableFooter2 = tables.tableFooter) === null || _tables$tableFooter2 === void 0 ? void 0 : _tables$tableFooter2.text))), /*#__PURE__*/_react.default.createElement(_CustomButton.default, {
2256
2144
  type: tables === null || tables === void 0 || (_tables$tableFooter3 = tables.tableFooter) === null || _tables$tableFooter3 === void 0 || (_tables$tableFooter3 = _tables$tableFooter3.jsxConfig) === null || _tables$tableFooter3 === void 0 ? void 0 : _tables$tableFooter3.buttonType,
2257
2145
  onClick: () => {