cilog-lib 1.4.3 → 1.4.4

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.
@@ -490,26 +490,7 @@ class CilogTableComponent {
490
490
  end = endDate.getTime();
491
491
  return cell.value == null ? false : cell.value.getTime() >= start && cell.value.getTime() <= end;
492
492
  });
493
- // Text
494
- this.filterService.register('textFilter', (cell, filter) => {
495
- if (filter == null || filter.trim() == '') {
496
- return true;
497
- }
498
- if (cell.value == null) {
499
- return false;
500
- }
501
- let value;
502
- if (typeof cell.value == 'string') {
503
- value = cell.value;
504
- }
505
- else if (Array.isArray(cell.value)) {
506
- value = this.getMultiSelectConcat(cell.value, this.selectedColumnFilter.options['optionLabel']);
507
- }
508
- else {
509
- value = cell.value[this.selectedColumnFilter.options['optionLabel']];
510
- }
511
- return value.toLowerCase().includes(filter.toLowerCase());
512
- });
493
+ this.registerFilterText();
513
494
  // Number
514
495
  this.filterService.register('numberFilter', (cell, filter) => {
515
496
  if (filter == null) {
@@ -580,6 +561,29 @@ class CilogTableComponent {
580
561
  this.initFilter = false;
581
562
  }
582
563
  }
564
+ registerFilterText() {
565
+ // Text
566
+ this.filterService.register('textFilter', (cell, filter) => {
567
+ console.log(cell, filter);
568
+ if (filter == null || filter.trim() == '') {
569
+ return true;
570
+ }
571
+ if (cell.value == null) {
572
+ return false;
573
+ }
574
+ let value;
575
+ if (typeof cell.value == 'string') {
576
+ value = cell.value;
577
+ }
578
+ else if (Array.isArray(cell.value)) {
579
+ value = this.getMultiSelectConcat(cell.value, this.selectedColumnFilter.options['optionLabel']);
580
+ }
581
+ else {
582
+ value = cell.value[this.selectedColumnFilter.options['optionLabel']];
583
+ }
584
+ return value.toLowerCase().includes(filter.toLowerCase());
585
+ });
586
+ }
583
587
  ngAfterViewInit() {
584
588
  this.columns.forEach(col => {
585
589
  if (!col.invisible) {
@@ -793,6 +797,8 @@ class CilogTableComponent {
793
797
  value = event.target.value;
794
798
  }
795
799
  this.selectedColumnFilter = col;
800
+ this.registerFilterText();
801
+ console.log(this.filterService.filters);
796
802
  this.filter(col, value, this.getFilterByCol(col));
797
803
  this.onFilter.emit({ column: col, value: value, filteredValue: this.table.filteredValue });
798
804
  }