ninegrid2 6.240.0 → 6.242.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.
@@ -17947,15 +17947,10 @@ class ngFiltering
17947
17947
  this.#owner.paging.reset();
17948
17948
  };
17949
17949
 
17950
- #getLastRowIndex = (v = "thead") => {
17950
+ #getLastRowIndex = (v = "thead") =>
17951
+ [...this.#owner.body.querySelectorAll(`.ng-table ${v}`)]
17952
+ .reduce((maxIndex, el) => Math.max(el.rows.length - 1, maxIndex), 0);
17951
17953
 
17952
- let index = 0;
17953
- this.#owner.body.querySelectorAll(`.ng-table ${v}`).forEach((el) => {
17954
- index = Math.max(el.rows.length - 1, index);
17955
- });
17956
-
17957
- return index;
17958
- };
17959
17954
  }
17960
17955
 
17961
17956
  class ngFilterButton extends HTMLElement
@@ -17983,18 +17978,19 @@ class ngFilterButton extends HTMLElement
17983
17978
  }
17984
17979
 
17985
17980
  #onClick = (e) => {
17986
-
17987
- e.preventDefault();
17988
- e.stopPropagation();
17989
-
17990
- const panel = this.#owner.shadowRoot.querySelector('ng-filter-panel');
17991
-
17992
- (panel.col === this.closest('th,td').dataset.col) ? panel.close() : panel.open(this);
17993
- };
17981
+ e.preventDefault();
17982
+ e.stopPropagation();
17983
+
17984
+ const panel = this.#owner.shadowRoot.querySelector("ng-filter-panel");
17985
+ const col = this.closest("th,td")?.dataset.col; // ✅ `?.` 활용하여 안전한 접근
17986
+
17987
+ panel.col === col ? panel.close() : panel.open(this);
17988
+ };
17994
17989
  }
17995
17990
 
17996
17991
  class ngFilterPanel extends HTMLElement
17997
17992
  {
17993
+ #owner;
17998
17994
  #target;
17999
17995
  #timer;
18000
17996
 
@@ -18004,6 +18000,10 @@ class ngFilterPanel extends HTMLElement
18004
18000
  }
18005
18001
 
18006
18002
  connectedCallback() {
18003
+
18004
+ this.#owner = this.getRootNode().host;
18005
+ console.log("========================", this.#owner);
18006
+
18007
18007
  const cssPath = this.getRootNode().host.closest("nine-grid").getAttribute("css-path") || "";
18008
18008
 
18009
18009
  this.shadowRoot.innerHTML = `
@@ -18066,7 +18066,7 @@ class ngFilterPanel extends HTMLElement
18066
18066
  const DATA_IDX = grd.fields.indexOf("DATA");
18067
18067
 
18068
18068
  const checked = grd.data.getValidDataNF().filter(m => { return m.v[LVL_IDX] == 2 && m.v[CHK_IDX] == "Y"; });
18069
- grd.data.getValidDataNF().filter(m => { return m.v[LVL_IDX] == 2 && m.v[CHK_IDX] != "Y"; });
18069
+ //const unchecked = grd.data.getValidDataNF().filter(m => { return m.v[LVL_IDX] == 2 && m.v[CHK_IDX] != "Y"; });
18070
18070
 
18071
18071
  var filterOptions = [];
18072
18072
  if (checked.length > 0) {
@@ -18079,31 +18079,8 @@ class ngFilterPanel extends HTMLElement
18079
18079
  });
18080
18080
  }
18081
18081
 
18082
- console.log(filterOptions);
18083
-
18084
- //console.log(this.#target);
18085
-
18086
- //console.log(this.#target, this.#target.button);
18087
-
18088
- //this.#target.button.filterData = filterData;//grd.data.getValidData().filter(item => { return item.CHK == "Y"; });//.map(item => { return item.DATA; });
18089
-
18090
-
18091
- /**
18092
- this.#target.owner.data.clearFilter();
18093
-
18094
- $("ng-filter-button", this.#target.owner.body).each((index,el) => {
18095
- if (!el.filterData) return true;
18096
- el.filterData.forEach(o => {
18097
- const idx = this.#target.owner.fields.indexOf(o.colnm);
18098
- this.#target.owner.data.getValidData().filter(m => { return o.data.nineBinarySearch(m.v[idx] || '') < 0; }).map(m => { m.__ng.filtered = true; });
18099
- //this.#target.owner.data.resetIndex();
18100
- });
18101
- });
18102
-
18103
- this.#target.owner.data.refreshFilter();
18104
- */
18105
-
18106
- console.log(this.#target, this.#target.button, filterOptions);
18082
+ //console.log(filterOptions);
18083
+ //console.log(this.#target, this.#target.button, filterOptions)
18107
18084
 
18108
18085
  this.#target.button.filterOptions = filterOptions;
18109
18086
 
@@ -17945,15 +17945,10 @@ class ngFiltering
17945
17945
  this.#owner.paging.reset();
17946
17946
  };
17947
17947
 
17948
- #getLastRowIndex = (v = "thead") => {
17948
+ #getLastRowIndex = (v = "thead") =>
17949
+ [...this.#owner.body.querySelectorAll(`.ng-table ${v}`)]
17950
+ .reduce((maxIndex, el) => Math.max(el.rows.length - 1, maxIndex), 0);
17949
17951
 
17950
- let index = 0;
17951
- this.#owner.body.querySelectorAll(`.ng-table ${v}`).forEach((el) => {
17952
- index = Math.max(el.rows.length - 1, index);
17953
- });
17954
-
17955
- return index;
17956
- };
17957
17952
  }
17958
17953
 
17959
17954
  class ngFilterButton extends HTMLElement
@@ -17981,18 +17976,19 @@ class ngFilterButton extends HTMLElement
17981
17976
  }
17982
17977
 
17983
17978
  #onClick = (e) => {
17984
-
17985
- e.preventDefault();
17986
- e.stopPropagation();
17987
-
17988
- const panel = this.#owner.shadowRoot.querySelector('ng-filter-panel');
17989
-
17990
- (panel.col === this.closest('th,td').dataset.col) ? panel.close() : panel.open(this);
17991
- };
17979
+ e.preventDefault();
17980
+ e.stopPropagation();
17981
+
17982
+ const panel = this.#owner.shadowRoot.querySelector("ng-filter-panel");
17983
+ const col = this.closest("th,td")?.dataset.col; // ✅ `?.` 활용하여 안전한 접근
17984
+
17985
+ panel.col === col ? panel.close() : panel.open(this);
17986
+ };
17992
17987
  }
17993
17988
 
17994
17989
  class ngFilterPanel extends HTMLElement
17995
17990
  {
17991
+ #owner;
17996
17992
  #target;
17997
17993
  #timer;
17998
17994
 
@@ -18002,6 +17998,10 @@ class ngFilterPanel extends HTMLElement
18002
17998
  }
18003
17999
 
18004
18000
  connectedCallback() {
18001
+
18002
+ this.#owner = this.getRootNode().host;
18003
+ console.log("========================", this.#owner);
18004
+
18005
18005
  const cssPath = this.getRootNode().host.closest("nine-grid").getAttribute("css-path") || "";
18006
18006
 
18007
18007
  this.shadowRoot.innerHTML = `
@@ -18064,7 +18064,7 @@ class ngFilterPanel extends HTMLElement
18064
18064
  const DATA_IDX = grd.fields.indexOf("DATA");
18065
18065
 
18066
18066
  const checked = grd.data.getValidDataNF().filter(m => { return m.v[LVL_IDX] == 2 && m.v[CHK_IDX] == "Y"; });
18067
- grd.data.getValidDataNF().filter(m => { return m.v[LVL_IDX] == 2 && m.v[CHK_IDX] != "Y"; });
18067
+ //const unchecked = grd.data.getValidDataNF().filter(m => { return m.v[LVL_IDX] == 2 && m.v[CHK_IDX] != "Y"; });
18068
18068
 
18069
18069
  var filterOptions = [];
18070
18070
  if (checked.length > 0) {
@@ -18077,31 +18077,8 @@ class ngFilterPanel extends HTMLElement
18077
18077
  });
18078
18078
  }
18079
18079
 
18080
- console.log(filterOptions);
18081
-
18082
- //console.log(this.#target);
18083
-
18084
- //console.log(this.#target, this.#target.button);
18085
-
18086
- //this.#target.button.filterData = filterData;//grd.data.getValidData().filter(item => { return item.CHK == "Y"; });//.map(item => { return item.DATA; });
18087
-
18088
-
18089
- /**
18090
- this.#target.owner.data.clearFilter();
18091
-
18092
- $("ng-filter-button", this.#target.owner.body).each((index,el) => {
18093
- if (!el.filterData) return true;
18094
- el.filterData.forEach(o => {
18095
- const idx = this.#target.owner.fields.indexOf(o.colnm);
18096
- this.#target.owner.data.getValidData().filter(m => { return o.data.nineBinarySearch(m.v[idx] || '') < 0; }).map(m => { m.__ng.filtered = true; });
18097
- //this.#target.owner.data.resetIndex();
18098
- });
18099
- });
18100
-
18101
- this.#target.owner.data.refreshFilter();
18102
- */
18103
-
18104
- console.log(this.#target, this.#target.button, filterOptions);
18080
+ //console.log(filterOptions);
18081
+ //console.log(this.#target, this.#target.button, filterOptions)
18105
18082
 
18106
18083
  this.#target.button.filterOptions = filterOptions;
18107
18084
 
@@ -124,15 +124,10 @@ export class ngFiltering
124
124
  this.#owner.paging.reset();
125
125
  };
126
126
 
127
- #getLastRowIndex = (v = "thead") => {
127
+ #getLastRowIndex = (v = "thead") =>
128
+ [...this.#owner.body.querySelectorAll(`.ng-table ${v}`)]
129
+ .reduce((maxIndex, el) => Math.max(el.rows.length - 1, maxIndex), 0);
128
130
 
129
- let index = 0;
130
- this.#owner.body.querySelectorAll(`.ng-table ${v}`).forEach((el) => {
131
- index = Math.max(el.rows.length - 1, index);
132
- });
133
-
134
- return index;
135
- };
136
131
  }
137
132
 
138
133
  class ngFilterButton extends HTMLElement
@@ -160,18 +155,19 @@ class ngFilterButton extends HTMLElement
160
155
  }
161
156
 
162
157
  #onClick = (e) => {
163
-
164
- e.preventDefault();
165
- e.stopPropagation();
166
-
167
- const panel = this.#owner.shadowRoot.querySelector('ng-filter-panel');
168
-
169
- (panel.col === this.closest('th,td').dataset.col) ? panel.close() : panel.open(this);
170
- };
158
+ e.preventDefault();
159
+ e.stopPropagation();
160
+
161
+ const panel = this.#owner.shadowRoot.querySelector("ng-filter-panel");
162
+ const col = this.closest("th,td")?.dataset.col; // ✅ `?.` 활용하여 안전한 접근
163
+
164
+ panel.col === col ? panel.close() : panel.open(this);
165
+ };
171
166
  }
172
167
 
173
168
  class ngFilterPanel extends HTMLElement
174
169
  {
170
+ #owner;
175
171
  #target;
176
172
  #timer;
177
173
 
@@ -181,6 +177,10 @@ class ngFilterPanel extends HTMLElement
181
177
  }
182
178
 
183
179
  connectedCallback() {
180
+
181
+ this.#owner = this.getRootNode().host;
182
+ console.log("========================", this.#owner)
183
+
184
184
  const cssPath = this.getRootNode().host.closest("nine-grid").getAttribute("css-path") || "";
185
185
 
186
186
  this.shadowRoot.innerHTML = `
@@ -243,7 +243,7 @@ class ngFilterPanel extends HTMLElement
243
243
  const DATA_IDX = grd.fields.indexOf("DATA");
244
244
 
245
245
  const checked = grd.data.getValidDataNF().filter(m => { return m.v[LVL_IDX] == 2 && m.v[CHK_IDX] == "Y"; });
246
- const unchecked = grd.data.getValidDataNF().filter(m => { return m.v[LVL_IDX] == 2 && m.v[CHK_IDX] != "Y"; });
246
+ //const unchecked = grd.data.getValidDataNF().filter(m => { return m.v[LVL_IDX] == 2 && m.v[CHK_IDX] != "Y"; });
247
247
 
248
248
  var filterOptions = [];
249
249
  if (checked.length > 0) {
@@ -256,31 +256,8 @@ class ngFilterPanel extends HTMLElement
256
256
  });
257
257
  }
258
258
 
259
- console.log(filterOptions);
260
-
261
- //console.log(this.#target);
262
-
263
- //console.log(this.#target, this.#target.button);
264
-
265
- //this.#target.button.filterData = filterData;//grd.data.getValidData().filter(item => { return item.CHK == "Y"; });//.map(item => { return item.DATA; });
266
-
267
-
268
- /**
269
- this.#target.owner.data.clearFilter();
270
-
271
- $("ng-filter-button", this.#target.owner.body).each((index,el) => {
272
- if (!el.filterData) return true;
273
- el.filterData.forEach(o => {
274
- const idx = this.#target.owner.fields.indexOf(o.colnm);
275
- this.#target.owner.data.getValidData().filter(m => { return o.data.nineBinarySearch(m.v[idx] || '') < 0; }).map(m => { m.__ng.filtered = true; });
276
- //this.#target.owner.data.resetIndex();
277
- });
278
- });
279
-
280
- this.#target.owner.data.refreshFilter();
281
- */
282
-
283
- console.log(this.#target, this.#target.button, filterOptions)
259
+ //console.log(filterOptions);
260
+ //console.log(this.#target, this.#target.button, filterOptions)
284
261
 
285
262
  this.#target.button.filterOptions = filterOptions;
286
263
 
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "ninegrid2",
3
3
  "type": "module",
4
- "version": "6.240.0",
4
+ "version": "6.242.0",
5
5
  "main": "dist/index.js",
6
6
  "exports": {
7
7
  "import": "./dist/index.js",
@@ -124,15 +124,10 @@ export class ngFiltering
124
124
  this.#owner.paging.reset();
125
125
  };
126
126
 
127
- #getLastRowIndex = (v = "thead") => {
127
+ #getLastRowIndex = (v = "thead") =>
128
+ [...this.#owner.body.querySelectorAll(`.ng-table ${v}`)]
129
+ .reduce((maxIndex, el) => Math.max(el.rows.length - 1, maxIndex), 0);
128
130
 
129
- let index = 0;
130
- this.#owner.body.querySelectorAll(`.ng-table ${v}`).forEach((el) => {
131
- index = Math.max(el.rows.length - 1, index);
132
- });
133
-
134
- return index;
135
- };
136
131
  }
137
132
 
138
133
  class ngFilterButton extends HTMLElement
@@ -160,18 +155,19 @@ class ngFilterButton extends HTMLElement
160
155
  }
161
156
 
162
157
  #onClick = (e) => {
163
-
164
- e.preventDefault();
165
- e.stopPropagation();
166
-
167
- const panel = this.#owner.shadowRoot.querySelector('ng-filter-panel');
168
-
169
- (panel.col === this.closest('th,td').dataset.col) ? panel.close() : panel.open(this);
170
- };
158
+ e.preventDefault();
159
+ e.stopPropagation();
160
+
161
+ const panel = this.#owner.shadowRoot.querySelector("ng-filter-panel");
162
+ const col = this.closest("th,td")?.dataset.col; // ✅ `?.` 활용하여 안전한 접근
163
+
164
+ panel.col === col ? panel.close() : panel.open(this);
165
+ };
171
166
  }
172
167
 
173
168
  class ngFilterPanel extends HTMLElement
174
169
  {
170
+ #owner;
175
171
  #target;
176
172
  #timer;
177
173
 
@@ -181,6 +177,10 @@ class ngFilterPanel extends HTMLElement
181
177
  }
182
178
 
183
179
  connectedCallback() {
180
+
181
+ this.#owner = this.getRootNode().host;
182
+ console.log("========================", this.#owner)
183
+
184
184
  const cssPath = this.getRootNode().host.closest("nine-grid").getAttribute("css-path") || "";
185
185
 
186
186
  this.shadowRoot.innerHTML = `
@@ -243,7 +243,7 @@ class ngFilterPanel extends HTMLElement
243
243
  const DATA_IDX = grd.fields.indexOf("DATA");
244
244
 
245
245
  const checked = grd.data.getValidDataNF().filter(m => { return m.v[LVL_IDX] == 2 && m.v[CHK_IDX] == "Y"; });
246
- const unchecked = grd.data.getValidDataNF().filter(m => { return m.v[LVL_IDX] == 2 && m.v[CHK_IDX] != "Y"; });
246
+ //const unchecked = grd.data.getValidDataNF().filter(m => { return m.v[LVL_IDX] == 2 && m.v[CHK_IDX] != "Y"; });
247
247
 
248
248
  var filterOptions = [];
249
249
  if (checked.length > 0) {
@@ -256,31 +256,8 @@ class ngFilterPanel extends HTMLElement
256
256
  });
257
257
  }
258
258
 
259
- console.log(filterOptions);
260
-
261
- //console.log(this.#target);
262
-
263
- //console.log(this.#target, this.#target.button);
264
-
265
- //this.#target.button.filterData = filterData;//grd.data.getValidData().filter(item => { return item.CHK == "Y"; });//.map(item => { return item.DATA; });
266
-
267
-
268
- /**
269
- this.#target.owner.data.clearFilter();
270
-
271
- $("ng-filter-button", this.#target.owner.body).each((index,el) => {
272
- if (!el.filterData) return true;
273
- el.filterData.forEach(o => {
274
- const idx = this.#target.owner.fields.indexOf(o.colnm);
275
- this.#target.owner.data.getValidData().filter(m => { return o.data.nineBinarySearch(m.v[idx] || '') < 0; }).map(m => { m.__ng.filtered = true; });
276
- //this.#target.owner.data.resetIndex();
277
- });
278
- });
279
-
280
- this.#target.owner.data.refreshFilter();
281
- */
282
-
283
- console.log(this.#target, this.#target.button, filterOptions)
259
+ //console.log(filterOptions);
260
+ //console.log(this.#target, this.#target.button, filterOptions)
284
261
 
285
262
  this.#target.button.filterOptions = filterOptions;
286
263