ninegrid2 6.178.0 → 6.180.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.
@@ -18225,8 +18225,6 @@ class ngFilterButton extends HTMLElement
18225
18225
  //console.log(panel.isHidden, panel.col, this.closest('th,td').dataset.col);
18226
18226
 
18227
18227
  if (panel.col === this.closest('th,td').dataset.col) {
18228
- //panel.col = null;
18229
- //panel.style.display = 'none';
18230
18228
  panel.close();
18231
18229
  }
18232
18230
  else {
@@ -18465,7 +18463,10 @@ class ngFilterPanel extends HTMLElement
18465
18463
  open = (filterButton) => {
18466
18464
 
18467
18465
  const owner = this.shadow.closest("nine-grid");
18466
+ const colnms = [...new Set(filterButton.filterOptions.map(item => item.colnm))];
18468
18467
 
18468
+ console.log(filterButton.filterOptions, colnms);
18469
+
18469
18470
  var col = filterButton.closest('th,td').dataset.col;
18470
18471
  this.col = col;
18471
18472
 
@@ -18482,36 +18483,40 @@ class ngFilterPanel extends HTMLElement
18482
18483
 
18483
18484
  this.shadowRoot.querySelector("input[type=text]").value = "";
18484
18485
 
18486
+
18485
18487
  //$(this.shadowRoot).find("input[type=text]").val("");
18486
18488
 
18487
18489
  setTimeout(() => {
18488
-
18490
+
18489
18491
 
18490
- var ds = [];
18491
- var colnms = [];
18492
- $(owner.template).find(`[data-col=${col}]`).each((index,el) => {
18493
- if (el.dataset.bind) colnms.push(el.dataset.bind);
18494
- });
18492
+ const data = owner.data.getValidDataNF();
18493
+
18494
+ console.log(data);
18495
18495
 
18496
- owner.activeTmpl.querySelectorAll(`[data-col="${col}"]`).forEach(el => {
18497
- if (el.dataset.bind) colnms.push(el.dataset.bind);
18496
+ owner.body.querySelectorAll(`th[data-col]:not([data-col="${col}"]),td[data-col]:not([data-col="${col}"])`).forEach(td => {
18497
+ const el = td.querySelector("ng-filter-button");
18498
+ console.log(el);
18499
+
18500
+ if (el && el.filterOptions) {
18501
+ el.filterOptions.forEach(filterOption => {
18502
+ var idx = owner.fields.indexOf(filterOption.colnm);
18503
+
18504
+ console.log(idx);
18505
+
18506
+ if (idx >= 0) {
18507
+ data = data.filter(m => { return filterOption.data.nineBinarySearch(m.v[idx] || '') >= 0; });
18508
+ }
18509
+ });
18510
+ }
18498
18511
  });
18499
18512
 
18500
- console.log(colnms);
18501
-
18502
- var data = owner.data.getValidDataNF();
18513
+ console.log(data);
18514
+
18515
+ /**
18503
18516
  $("ng-filter-button", owner.body).each((index,el) => {
18504
18517
 
18505
18518
  if (el.closest('th,td').dataset.col == col || !el.filterData) return true;
18506
- /**
18507
- el.filterData.forEach(o => {
18508
- var idx = owner.fields.indexOf(o.colnm);
18509
-
18510
- if (idx >= 0) {
18511
- data = data.filter(m => { return o.data.nineBinarySearch(m.v[idx] || '') >= 0; });
18512
- }
18513
- });
18514
- */
18519
+
18515
18520
 
18516
18521
  console.log(el.filterData, el.colnms, el.dataset.bind);
18517
18522
 
@@ -18526,10 +18531,11 @@ class ngFilterPanel extends HTMLElement
18526
18531
  });
18527
18532
 
18528
18533
  //data = data.filter(rowData => { return el.filterData.findIndex(item => (item.DATA || '') == (rowData[item.COLNM] || '') ) >= 0; });
18529
- });
18534
+ }); */
18530
18535
 
18531
18536
 
18532
- colnms = [...new Set(colnms)];
18537
+ var ds = [];
18538
+ //colnms = [...new Set(colnms)];
18533
18539
  colnms.forEach((colnm,i) => {
18534
18540
 
18535
18541
  ds.push({
@@ -18580,7 +18586,7 @@ class ngFilterPanel extends HTMLElement
18580
18586
  });
18581
18587
  });
18582
18588
 
18583
- var grd = this.shadowRoot.querySelector("nine-grid");
18589
+ const grd = this.shadowRoot.querySelector("nine-grid");
18584
18590
  //grd.dataSource = ds;
18585
18591
  grd.fields.add(["DATA","DATA2","COLNM"]);
18586
18592
 
@@ -18223,8 +18223,6 @@ class ngFilterButton extends HTMLElement
18223
18223
  //console.log(panel.isHidden, panel.col, this.closest('th,td').dataset.col);
18224
18224
 
18225
18225
  if (panel.col === this.closest('th,td').dataset.col) {
18226
- //panel.col = null;
18227
- //panel.style.display = 'none';
18228
18226
  panel.close();
18229
18227
  }
18230
18228
  else {
@@ -18463,7 +18461,10 @@ class ngFilterPanel extends HTMLElement
18463
18461
  open = (filterButton) => {
18464
18462
 
18465
18463
  const owner = this.shadow.closest("nine-grid");
18464
+ const colnms = [...new Set(filterButton.filterOptions.map(item => item.colnm))];
18466
18465
 
18466
+ console.log(filterButton.filterOptions, colnms);
18467
+
18467
18468
  var col = filterButton.closest('th,td').dataset.col;
18468
18469
  this.col = col;
18469
18470
 
@@ -18480,36 +18481,40 @@ class ngFilterPanel extends HTMLElement
18480
18481
 
18481
18482
  this.shadowRoot.querySelector("input[type=text]").value = "";
18482
18483
 
18484
+
18483
18485
  //$(this.shadowRoot).find("input[type=text]").val("");
18484
18486
 
18485
18487
  setTimeout(() => {
18486
-
18488
+
18487
18489
 
18488
- var ds = [];
18489
- var colnms = [];
18490
- $(owner.template).find(`[data-col=${col}]`).each((index,el) => {
18491
- if (el.dataset.bind) colnms.push(el.dataset.bind);
18492
- });
18490
+ const data = owner.data.getValidDataNF();
18491
+
18492
+ console.log(data);
18493
18493
 
18494
- owner.activeTmpl.querySelectorAll(`[data-col="${col}"]`).forEach(el => {
18495
- if (el.dataset.bind) colnms.push(el.dataset.bind);
18494
+ owner.body.querySelectorAll(`th[data-col]:not([data-col="${col}"]),td[data-col]:not([data-col="${col}"])`).forEach(td => {
18495
+ const el = td.querySelector("ng-filter-button");
18496
+ console.log(el);
18497
+
18498
+ if (el && el.filterOptions) {
18499
+ el.filterOptions.forEach(filterOption => {
18500
+ var idx = owner.fields.indexOf(filterOption.colnm);
18501
+
18502
+ console.log(idx);
18503
+
18504
+ if (idx >= 0) {
18505
+ data = data.filter(m => { return filterOption.data.nineBinarySearch(m.v[idx] || '') >= 0; });
18506
+ }
18507
+ });
18508
+ }
18496
18509
  });
18497
18510
 
18498
- console.log(colnms);
18499
-
18500
- var data = owner.data.getValidDataNF();
18511
+ console.log(data);
18512
+
18513
+ /**
18501
18514
  $("ng-filter-button", owner.body).each((index,el) => {
18502
18515
 
18503
18516
  if (el.closest('th,td').dataset.col == col || !el.filterData) return true;
18504
- /**
18505
- el.filterData.forEach(o => {
18506
- var idx = owner.fields.indexOf(o.colnm);
18507
-
18508
- if (idx >= 0) {
18509
- data = data.filter(m => { return o.data.nineBinarySearch(m.v[idx] || '') >= 0; });
18510
- }
18511
- });
18512
- */
18517
+
18513
18518
 
18514
18519
  console.log(el.filterData, el.colnms, el.dataset.bind);
18515
18520
 
@@ -18524,10 +18529,11 @@ class ngFilterPanel extends HTMLElement
18524
18529
  });
18525
18530
 
18526
18531
  //data = data.filter(rowData => { return el.filterData.findIndex(item => (item.DATA || '') == (rowData[item.COLNM] || '') ) >= 0; });
18527
- });
18532
+ }); */
18528
18533
 
18529
18534
 
18530
- colnms = [...new Set(colnms)];
18535
+ var ds = [];
18536
+ //colnms = [...new Set(colnms)];
18531
18537
  colnms.forEach((colnm,i) => {
18532
18538
 
18533
18539
  ds.push({
@@ -18578,7 +18584,7 @@ class ngFilterPanel extends HTMLElement
18578
18584
  });
18579
18585
  });
18580
18586
 
18581
- var grd = this.shadowRoot.querySelector("nine-grid");
18587
+ const grd = this.shadowRoot.querySelector("nine-grid");
18582
18588
  //grd.dataSource = ds;
18583
18589
  grd.fields.add(["DATA","DATA2","COLNM"]);
18584
18590
 
@@ -289,8 +289,6 @@ class ngFilterButton extends HTMLElement
289
289
  //console.log(panel.isHidden, panel.col, this.closest('th,td').dataset.col);
290
290
 
291
291
  if (panel.col === this.closest('th,td').dataset.col) {
292
- //panel.col = null;
293
- //panel.style.display = 'none';
294
292
  panel.close();
295
293
  }
296
294
  else {
@@ -531,7 +529,10 @@ class ngFilterPanel extends HTMLElement
531
529
  open = (filterButton) => {
532
530
 
533
531
  const owner = this.shadow.closest("nine-grid");
532
+ const colnms = [...new Set(filterButton.filterOptions.map(item => item.colnm))];
534
533
 
534
+ console.log(filterButton.filterOptions, colnms);
535
+
535
536
  var col = filterButton.closest('th,td').dataset.col;
536
537
  this.col = col;
537
538
 
@@ -548,36 +549,40 @@ class ngFilterPanel extends HTMLElement
548
549
 
549
550
  this.shadowRoot.querySelector("input[type=text]").value = "";
550
551
 
552
+
551
553
  //$(this.shadowRoot).find("input[type=text]").val("");
552
554
 
553
555
  setTimeout(() => {
554
-
556
+
555
557
 
556
- var ds = [];
557
- var colnms = [];
558
- $(owner.template).find(`[data-col=${col}]`).each((index,el) => {
559
- if (el.dataset.bind) colnms.push(el.dataset.bind);
560
- });
558
+ const data = owner.data.getValidDataNF();
559
+
560
+ console.log(data);
561
561
 
562
- owner.activeTmpl.querySelectorAll(`[data-col="${col}"]`).forEach(el => {
563
- if (el.dataset.bind) colnms.push(el.dataset.bind);
562
+ owner.body.querySelectorAll(`th[data-col]:not([data-col="${col}"]),td[data-col]:not([data-col="${col}"])`).forEach(td => {
563
+ const el = td.querySelector("ng-filter-button");
564
+ console.log(el);
565
+
566
+ if (el && el.filterOptions) {
567
+ el.filterOptions.forEach(filterOption => {
568
+ var idx = owner.fields.indexOf(filterOption.colnm);
569
+
570
+ console.log(idx);
571
+
572
+ if (idx >= 0) {
573
+ data = data.filter(m => { return filterOption.data.nineBinarySearch(m.v[idx] || '') >= 0; });
574
+ }
575
+ });
576
+ }
564
577
  });
565
578
 
566
- console.log(colnms);
567
-
568
- var data = owner.data.getValidDataNF();
579
+ console.log(data);
580
+
581
+ /**
569
582
  $("ng-filter-button", owner.body).each((index,el) => {
570
583
 
571
584
  if (el.closest('th,td').dataset.col == col || !el.filterData) return true;
572
- /**
573
- el.filterData.forEach(o => {
574
- var idx = owner.fields.indexOf(o.colnm);
575
-
576
- if (idx >= 0) {
577
- data = data.filter(m => { return o.data.nineBinarySearch(m.v[idx] || '') >= 0; });
578
- }
579
- });
580
- */
585
+
581
586
 
582
587
  console.log(el.filterData, el.colnms, el.dataset.bind);
583
588
 
@@ -592,10 +597,11 @@ class ngFilterPanel extends HTMLElement
592
597
  });
593
598
 
594
599
  //data = data.filter(rowData => { return el.filterData.findIndex(item => (item.DATA || '') == (rowData[item.COLNM] || '') ) >= 0; });
595
- });
600
+ }); */
596
601
 
597
602
 
598
- colnms = [...new Set(colnms)];
603
+ var ds = [];
604
+ //colnms = [...new Set(colnms)];
599
605
  colnms.forEach((colnm,i) => {
600
606
 
601
607
  ds.push({
@@ -646,7 +652,7 @@ class ngFilterPanel extends HTMLElement
646
652
  });
647
653
  });
648
654
 
649
- var grd = this.shadowRoot.querySelector("nine-grid");
655
+ const grd = this.shadowRoot.querySelector("nine-grid");
650
656
  //grd.dataSource = ds;
651
657
  grd.fields.add(["DATA","DATA2","COLNM"]);
652
658
 
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "ninegrid2",
3
3
  "type": "module",
4
- "version": "6.178.0",
4
+ "version": "6.180.0",
5
5
  "main": "dist/index.js",
6
6
  "exports": {
7
7
  "import": "./dist/index.js",
@@ -289,8 +289,6 @@ class ngFilterButton extends HTMLElement
289
289
  //console.log(panel.isHidden, panel.col, this.closest('th,td').dataset.col);
290
290
 
291
291
  if (panel.col === this.closest('th,td').dataset.col) {
292
- //panel.col = null;
293
- //panel.style.display = 'none';
294
292
  panel.close();
295
293
  }
296
294
  else {
@@ -531,7 +529,10 @@ class ngFilterPanel extends HTMLElement
531
529
  open = (filterButton) => {
532
530
 
533
531
  const owner = this.shadow.closest("nine-grid");
532
+ const colnms = [...new Set(filterButton.filterOptions.map(item => item.colnm))];
534
533
 
534
+ console.log(filterButton.filterOptions, colnms);
535
+
535
536
  var col = filterButton.closest('th,td').dataset.col;
536
537
  this.col = col;
537
538
 
@@ -548,36 +549,40 @@ class ngFilterPanel extends HTMLElement
548
549
 
549
550
  this.shadowRoot.querySelector("input[type=text]").value = "";
550
551
 
552
+
551
553
  //$(this.shadowRoot).find("input[type=text]").val("");
552
554
 
553
555
  setTimeout(() => {
554
-
556
+
555
557
 
556
- var ds = [];
557
- var colnms = [];
558
- $(owner.template).find(`[data-col=${col}]`).each((index,el) => {
559
- if (el.dataset.bind) colnms.push(el.dataset.bind);
560
- });
558
+ const data = owner.data.getValidDataNF();
559
+
560
+ console.log(data);
561
561
 
562
- owner.activeTmpl.querySelectorAll(`[data-col="${col}"]`).forEach(el => {
563
- if (el.dataset.bind) colnms.push(el.dataset.bind);
562
+ owner.body.querySelectorAll(`th[data-col]:not([data-col="${col}"]),td[data-col]:not([data-col="${col}"])`).forEach(td => {
563
+ const el = td.querySelector("ng-filter-button");
564
+ console.log(el);
565
+
566
+ if (el && el.filterOptions) {
567
+ el.filterOptions.forEach(filterOption => {
568
+ var idx = owner.fields.indexOf(filterOption.colnm);
569
+
570
+ console.log(idx);
571
+
572
+ if (idx >= 0) {
573
+ data = data.filter(m => { return filterOption.data.nineBinarySearch(m.v[idx] || '') >= 0; });
574
+ }
575
+ });
576
+ }
564
577
  });
565
578
 
566
- console.log(colnms);
567
-
568
- var data = owner.data.getValidDataNF();
579
+ console.log(data);
580
+
581
+ /**
569
582
  $("ng-filter-button", owner.body).each((index,el) => {
570
583
 
571
584
  if (el.closest('th,td').dataset.col == col || !el.filterData) return true;
572
- /**
573
- el.filterData.forEach(o => {
574
- var idx = owner.fields.indexOf(o.colnm);
575
-
576
- if (idx >= 0) {
577
- data = data.filter(m => { return o.data.nineBinarySearch(m.v[idx] || '') >= 0; });
578
- }
579
- });
580
- */
585
+
581
586
 
582
587
  console.log(el.filterData, el.colnms, el.dataset.bind);
583
588
 
@@ -592,10 +597,11 @@ class ngFilterPanel extends HTMLElement
592
597
  });
593
598
 
594
599
  //data = data.filter(rowData => { return el.filterData.findIndex(item => (item.DATA || '') == (rowData[item.COLNM] || '') ) >= 0; });
595
- });
600
+ }); */
596
601
 
597
602
 
598
- colnms = [...new Set(colnms)];
603
+ var ds = [];
604
+ //colnms = [...new Set(colnms)];
599
605
  colnms.forEach((colnm,i) => {
600
606
 
601
607
  ds.push({
@@ -646,7 +652,7 @@ class ngFilterPanel extends HTMLElement
646
652
  });
647
653
  });
648
654
 
649
- var grd = this.shadowRoot.querySelector("nine-grid");
655
+ const grd = this.shadowRoot.querySelector("nine-grid");
650
656
  //grd.dataSource = ds;
651
657
  grd.fields.add(["DATA","DATA2","COLNM"]);
652
658