ninegrid2 6.156.0 → 6.157.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.
@@ -10719,7 +10719,7 @@ class ninegrid {
10719
10719
  Object.defineProperty(Element.prototype, "isHidden", {
10720
10720
  get: function () {
10721
10721
  const style = window.getComputedStyle(this);
10722
- console.log(this, style.display, style.visibility, style.opacity);
10722
+ //console.log(this, style.display, style.visibility, style.opacity);
10723
10723
  return style.display === "none" || style.visibility === "hidden" || style.opacity === "0";
10724
10724
  }
10725
10725
  });
@@ -18159,13 +18159,37 @@ class ngFilterButton extends HTMLElement
18159
18159
 
18160
18160
  const panel = this.#owner.shadowRoot.querySelector('ng-filter-panel');
18161
18161
 
18162
- console.log(panel.isHidden);
18162
+ //console.log(panel.isHidden);
18163
18163
 
18164
- panel.style.display = panel.isHidden ? 'flex' : 'none';
18164
+ //panel.style.display = 'flex' : 'none';
18165
+
18166
+
18167
+ if (!panel.isHidden && panel.col === this.closest('th,td').dataset.col) {
18168
+ $(this).hide();
18169
+ return;
18170
+ }
18165
18171
 
18172
+ //return;
18173
+
18174
+ /**
18175
+ if (this.#owner.shadowRoot.querySelectorAll('ng-filter-panel').length > 1) throw "too many ng-filter-panel";
18176
+ if (!panel) throw 'ng-filter-panel is null';
18177
+ */
18178
+
18179
+ var cell = e.target.closest("th,td");
18180
+
18181
+ var l = $(e.target).offset().left - $(this.#owner).offset().left;// - $(panel).width() + $(e.target).width() + 1;
18182
+ if (l < 0) l = 0;
18183
+ if (l + $(panel).width() > $(this.#owner).width()) l = $(this.#owner).width() - $(panel).width() - 5;
18184
+
18166
18185
 
18167
18186
 
18168
- return;
18187
+ var t = $(cell).offset().top + $(cell).height()- $(this.#owner).offset().top;//$(e.target).offset().top + $(e.target).height() + 2;
18188
+
18189
+ //$(panel).offset({left: l, top: t});
18190
+ $(panel).css({left: l, top: t});
18191
+
18192
+ panel.refresh(this.#owner, this);
18169
18193
  };
18170
18194
  }
18171
18195
 
@@ -18381,12 +18405,12 @@ class ngFilterPanel extends HTMLElement
18381
18405
  refresh = (owner, filterButton) => {
18382
18406
 
18383
18407
  var col = filterButton.closest('th,td').dataset.col;
18408
+ this.col = col;
18409
+
18410
+
18384
18411
 
18385
18412
  //if (this.#target && this.#target.uuid == owner.uuid && this.#target.col == col && $(this).is(':visible')) {
18386
- if (this.#target && this.#target.col == col && $(this).is(':visible')) {
18387
- $(this).hide();
18388
- return;
18389
- }
18413
+ if (this.#target && this.#target.col == col && $(this).is(':visible')) ;
18390
18414
 
18391
18415
  this.#target = {
18392
18416
  owner : owner,
@@ -10717,7 +10717,7 @@ class ninegrid {
10717
10717
  Object.defineProperty(Element.prototype, "isHidden", {
10718
10718
  get: function () {
10719
10719
  const style = window.getComputedStyle(this);
10720
- console.log(this, style.display, style.visibility, style.opacity);
10720
+ //console.log(this, style.display, style.visibility, style.opacity);
10721
10721
  return style.display === "none" || style.visibility === "hidden" || style.opacity === "0";
10722
10722
  }
10723
10723
  });
@@ -18157,13 +18157,37 @@ class ngFilterButton extends HTMLElement
18157
18157
 
18158
18158
  const panel = this.#owner.shadowRoot.querySelector('ng-filter-panel');
18159
18159
 
18160
- console.log(panel.isHidden);
18160
+ //console.log(panel.isHidden);
18161
18161
 
18162
- panel.style.display = panel.isHidden ? 'flex' : 'none';
18162
+ //panel.style.display = 'flex' : 'none';
18163
+
18164
+
18165
+ if (!panel.isHidden && panel.col === this.closest('th,td').dataset.col) {
18166
+ $(this).hide();
18167
+ return;
18168
+ }
18163
18169
 
18170
+ //return;
18171
+
18172
+ /**
18173
+ if (this.#owner.shadowRoot.querySelectorAll('ng-filter-panel').length > 1) throw "too many ng-filter-panel";
18174
+ if (!panel) throw 'ng-filter-panel is null';
18175
+ */
18176
+
18177
+ var cell = e.target.closest("th,td");
18178
+
18179
+ var l = $(e.target).offset().left - $(this.#owner).offset().left;// - $(panel).width() + $(e.target).width() + 1;
18180
+ if (l < 0) l = 0;
18181
+ if (l + $(panel).width() > $(this.#owner).width()) l = $(this.#owner).width() - $(panel).width() - 5;
18182
+
18164
18183
 
18165
18184
 
18166
- return;
18185
+ var t = $(cell).offset().top + $(cell).height()- $(this.#owner).offset().top;//$(e.target).offset().top + $(e.target).height() + 2;
18186
+
18187
+ //$(panel).offset({left: l, top: t});
18188
+ $(panel).css({left: l, top: t});
18189
+
18190
+ panel.refresh(this.#owner, this);
18167
18191
  };
18168
18192
  }
18169
18193
 
@@ -18379,12 +18403,12 @@ class ngFilterPanel extends HTMLElement
18379
18403
  refresh = (owner, filterButton) => {
18380
18404
 
18381
18405
  var col = filterButton.closest('th,td').dataset.col;
18406
+ this.col = col;
18407
+
18408
+
18382
18409
 
18383
18410
  //if (this.#target && this.#target.uuid == owner.uuid && this.#target.col == col && $(this).is(':visible')) {
18384
- if (this.#target && this.#target.col == col && $(this).is(':visible')) {
18385
- $(this).hide();
18386
- return;
18387
- }
18411
+ if (this.#target && this.#target.col == col && $(this).is(':visible')) ;
18388
18412
 
18389
18413
  this.#target = {
18390
18414
  owner : owner,
@@ -283,13 +283,17 @@ class ngFilterButton extends HTMLElement
283
283
 
284
284
  const panel = this.#owner.shadowRoot.querySelector('ng-filter-panel');
285
285
 
286
- console.log(panel.isHidden);
287
-
288
- panel.style.display = panel.isHidden ? 'flex' : 'none';
286
+ //console.log(panel.isHidden);
289
287
 
288
+ //panel.style.display = 'flex' : 'none';
290
289
 
291
290
 
292
- return;
291
+ if (!panel.isHidden && panel.col === this.closest('th,td').dataset.col) {
292
+ $(this).hide();
293
+ return;
294
+ }
295
+
296
+ //return;
293
297
 
294
298
  /**
295
299
  if (this.#owner.shadowRoot.querySelectorAll('ng-filter-panel').length > 1) throw "too many ng-filter-panel";
@@ -527,11 +531,14 @@ class ngFilterPanel extends HTMLElement
527
531
  refresh = (owner, filterButton) => {
528
532
 
529
533
  var col = filterButton.closest('th,td').dataset.col;
534
+ this.col = col;
535
+
536
+
530
537
 
531
538
  //if (this.#target && this.#target.uuid == owner.uuid && this.#target.col == col && $(this).is(':visible')) {
532
539
  if (this.#target && this.#target.col == col && $(this).is(':visible')) {
533
- $(this).hide();
534
- return;
540
+ //$(this).hide();
541
+ //return;
535
542
  }
536
543
 
537
544
  this.#target = {
@@ -13,7 +13,7 @@ export class ninegrid {
13
13
  Object.defineProperty(Element.prototype, "isHidden", {
14
14
  get: function () {
15
15
  const style = window.getComputedStyle(this);
16
- console.log(this, style.display, style.visibility, style.opacity);
16
+ //console.log(this, style.display, style.visibility, style.opacity);
17
17
  return style.display === "none" || style.visibility === "hidden" || style.opacity === "0";
18
18
  }
19
19
  });
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "ninegrid2",
3
3
  "type": "module",
4
- "version": "6.156.0",
4
+ "version": "6.157.0",
5
5
  "main": "dist/index.js",
6
6
  "exports": {
7
7
  "import": "./dist/index.js",
@@ -283,13 +283,17 @@ class ngFilterButton extends HTMLElement
283
283
 
284
284
  const panel = this.#owner.shadowRoot.querySelector('ng-filter-panel');
285
285
 
286
- console.log(panel.isHidden);
287
-
288
- panel.style.display = panel.isHidden ? 'flex' : 'none';
286
+ //console.log(panel.isHidden);
289
287
 
288
+ //panel.style.display = 'flex' : 'none';
290
289
 
291
290
 
292
- return;
291
+ if (!panel.isHidden && panel.col === this.closest('th,td').dataset.col) {
292
+ $(this).hide();
293
+ return;
294
+ }
295
+
296
+ //return;
293
297
 
294
298
  /**
295
299
  if (this.#owner.shadowRoot.querySelectorAll('ng-filter-panel').length > 1) throw "too many ng-filter-panel";
@@ -527,11 +531,14 @@ class ngFilterPanel extends HTMLElement
527
531
  refresh = (owner, filterButton) => {
528
532
 
529
533
  var col = filterButton.closest('th,td').dataset.col;
534
+ this.col = col;
535
+
536
+
530
537
 
531
538
  //if (this.#target && this.#target.uuid == owner.uuid && this.#target.col == col && $(this).is(':visible')) {
532
539
  if (this.#target && this.#target.col == col && $(this).is(':visible')) {
533
- $(this).hide();
534
- return;
540
+ //$(this).hide();
541
+ //return;
535
542
  }
536
543
 
537
544
  this.#target = {
@@ -13,7 +13,7 @@ export class ninegrid {
13
13
  Object.defineProperty(Element.prototype, "isHidden", {
14
14
  get: function () {
15
15
  const style = window.getComputedStyle(this);
16
- console.log(this, style.display, style.visibility, style.opacity);
16
+ //console.log(this, style.display, style.visibility, style.opacity);
17
17
  return style.display === "none" || style.visibility === "hidden" || style.opacity === "0";
18
18
  }
19
19
  });