monkey-front-core 0.0.165 → 0.0.168

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.
@@ -2145,6 +2145,7 @@ class MonkeyEcxCommonsService {
2145
2145
  // eslint-disable-next-line no-console
2146
2146
  return console.error('Method callbackPagination needs to be declared');
2147
2147
  };
2148
+ this.__isAbleToDoPagination = {};
2148
2149
  this.handleInit();
2149
2150
  }
2150
2151
  handleInit() {
@@ -2254,11 +2255,14 @@ class MonkeyEcxCommonsService {
2254
2255
  });
2255
2256
  }
2256
2257
  }
2257
- handlePaginationOptions(args) {
2258
- const { service, callback } = args;
2259
- service.setCallback((type) => {
2260
- this.doPaginationv2(type, callback);
2261
- });
2258
+ handlePaginationOptions() {
2259
+ const { __paginationOptions } = this;
2260
+ if (__paginationOptions) {
2261
+ const { service, callback } = __paginationOptions;
2262
+ service?.setCallback((type) => {
2263
+ this.doPaginationv2(type, callback);
2264
+ });
2265
+ }
2262
2266
  }
2263
2267
  setPage(requestPaged) {
2264
2268
  this.__requestPaged = {
@@ -2350,7 +2354,8 @@ class MonkeyEcxCommonsService {
2350
2354
  this.__callbackPagination = otherArgs.callbackPagination;
2351
2355
  }
2352
2356
  if (otherArgs?.paginationOptions) {
2353
- this.handlePaginationOptions(otherArgs?.paginationOptions);
2357
+ this.__paginationOptions = otherArgs?.paginationOptions;
2358
+ this.handlePaginationOptions();
2354
2359
  }
2355
2360
  if (otherArgs?.feature) {
2356
2361
  const { flag, service } = otherArgs.feature;
@@ -2423,16 +2428,18 @@ class MonkeyEcxCommonsService {
2423
2428
  }
2424
2429
  doPaginationv2(type, callback) {
2425
2430
  if (!this.__onLoadingInProgress$.value) {
2426
- const hasMorePages = this.setPage({
2427
- page: {
2428
- ...this.__page
2429
- }
2430
- }).nextPage();
2431
- if (hasMorePages && callback) {
2431
+ if (callback) {
2432
2432
  callback();
2433
2433
  }
2434
2434
  }
2435
2435
  }
2436
+ setLinks(links) {
2437
+ this.__isAbleToDoPagination = {
2438
+ first: !!links?.first,
2439
+ next: !!links?.next
2440
+ };
2441
+ this.__links = links;
2442
+ }
2436
2443
  setSearchByUrl(router, url, search, extras) {
2437
2444
  this.__data = null;
2438
2445
  this.__page = null;