@nethserver/ns8-ui-lib 0.0.97 → 0.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -380,6 +380,7 @@ export default {
380
380
  backwardText: { type: String, default: undefined },
381
381
  forwardText: { type: String, default: undefined },
382
382
  pageNumberLabel: { type: String, default: undefined },
383
+ filterRowsCallback: { type: Function }
383
384
  },
384
385
  data() {
385
386
  return {
@@ -455,9 +456,17 @@ export default {
455
456
  }
456
457
  },
457
458
  filterRows() {
459
+ if (this.filterRowsCallback) {
460
+ // call custom filterRows function
461
+ this.filteredRows = this.filterRowsCallback(this.searchFilter);
462
+ } else {
463
+ this.filteredRows = this.defaultFilterRows();
464
+ }
465
+ },
466
+ defaultFilterRows() {
458
467
  if (!this.searchFilter) {
459
- this.filteredRows = this.allRows;
460
- } else if (this.searchFilter) {
468
+ return this.allRows;
469
+ } else {
461
470
  // clean query
462
471
  const cleanRegex = /[^a-zA-Z0-9]/g;
463
472
  const queryText = this.searchFilter.replace(cleanRegex, "");
@@ -486,7 +495,7 @@ export default {
486
495
  }
487
496
  });
488
497
  }, this);
489
- this.filteredRows = searchResults;
498
+ return searchResults;
490
499
  }
491
500
  },
492
501
  paginateTable(ev) {