ninegrid2 6.149.0 → 6.151.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.
@@ -18017,9 +18017,28 @@ class ngFiltering
18017
18017
  return index;
18018
18018
  };
18019
18019
 
18020
-
18021
18020
  #on = () => {
18022
18021
  this.#isFiltering = true;
18022
+ const lastRowIndex = this.#getLastRowIndex();
18023
+
18024
+ this.#owner.body.querySelectorAll(".ng-table thead th, .ng-table thead td").forEach((td) => {
18025
+ const rowIndex = td.closest("tr")?.sectionRowIndex;
18026
+ if (rowIndex !== undefined && rowIndex + td.rowSpan - 1 === lastRowIndex) {
18027
+ const options = Array.from(this.#owner.activeTmpl.querySelectorAll(`[data-col="${td.dataset.col}"]`))
18028
+ .map(el => el.dataset.bind ? { colnm: el.dataset.bind, data: [] } : null)
18029
+ .filter(Boolean); // ✅ `null` 제거
18030
+ console.log(options);
18031
+ if (options.length > 0) {
18032
+ const filterButton = document.createElement("ng-filter-button");
18033
+ td.appendChild(filterButton);
18034
+ filterButton.filterOptions = options;
18035
+ }
18036
+ }
18037
+ });
18038
+ };
18039
+
18040
+ #on1 = () => {
18041
+ this.#isFiltering = true;
18023
18042
 
18024
18043
  const lastRowIndex = this.#getLastRowIndex();
18025
18044
 
@@ -18027,10 +18046,10 @@ class ngFiltering
18027
18046
  if (td.closest("tr").sectionRowIndex + td.rowSpan - 1 === lastRowIndex) {
18028
18047
  //let colnms = [];
18029
18048
  const options = [];
18030
- this.#owner.activeTmpl.querySelectorAll(`[data-col="${td.dataset.col}"]`).forEach((elem) => {
18031
- if (elem.dataset.bind) {
18049
+ this.#owner.activeTmpl.querySelectorAll(`[data-col="${td.dataset.col}"]`).forEach((el) => {
18050
+ if (el.dataset.bind) {
18032
18051
  options.push({
18033
- colnm: elem.dataset.bind,
18052
+ colnm: el.dataset.bind,
18034
18053
  data: [],
18035
18054
  });
18036
18055
  }
@@ -18038,10 +18057,8 @@ class ngFiltering
18038
18057
 
18039
18058
  if (options.length > 0) {
18040
18059
  const filterButton = document.createElement("ng-filter-button"); // ✅ `ng-filter-button` 생성
18041
- elem.appendChild(filterButton);
18060
+ td.appendChild(filterButton);
18042
18061
  filterButton.filterOptions = options; // ✅ 속성 설정
18043
-
18044
- console.log(filterButton, filterButton.filterOptions);
18045
18062
  }
18046
18063
  }
18047
18064
  });
@@ -18015,9 +18015,28 @@ class ngFiltering
18015
18015
  return index;
18016
18016
  };
18017
18017
 
18018
-
18019
18018
  #on = () => {
18020
18019
  this.#isFiltering = true;
18020
+ const lastRowIndex = this.#getLastRowIndex();
18021
+
18022
+ this.#owner.body.querySelectorAll(".ng-table thead th, .ng-table thead td").forEach((td) => {
18023
+ const rowIndex = td.closest("tr")?.sectionRowIndex;
18024
+ if (rowIndex !== undefined && rowIndex + td.rowSpan - 1 === lastRowIndex) {
18025
+ const options = Array.from(this.#owner.activeTmpl.querySelectorAll(`[data-col="${td.dataset.col}"]`))
18026
+ .map(el => el.dataset.bind ? { colnm: el.dataset.bind, data: [] } : null)
18027
+ .filter(Boolean); // ✅ `null` 제거
18028
+ console.log(options);
18029
+ if (options.length > 0) {
18030
+ const filterButton = document.createElement("ng-filter-button");
18031
+ td.appendChild(filterButton);
18032
+ filterButton.filterOptions = options;
18033
+ }
18034
+ }
18035
+ });
18036
+ };
18037
+
18038
+ #on1 = () => {
18039
+ this.#isFiltering = true;
18021
18040
 
18022
18041
  const lastRowIndex = this.#getLastRowIndex();
18023
18042
 
@@ -18025,10 +18044,10 @@ class ngFiltering
18025
18044
  if (td.closest("tr").sectionRowIndex + td.rowSpan - 1 === lastRowIndex) {
18026
18045
  //let colnms = [];
18027
18046
  const options = [];
18028
- this.#owner.activeTmpl.querySelectorAll(`[data-col="${td.dataset.col}"]`).forEach((elem) => {
18029
- if (elem.dataset.bind) {
18047
+ this.#owner.activeTmpl.querySelectorAll(`[data-col="${td.dataset.col}"]`).forEach((el) => {
18048
+ if (el.dataset.bind) {
18030
18049
  options.push({
18031
- colnm: elem.dataset.bind,
18050
+ colnm: el.dataset.bind,
18032
18051
  data: [],
18033
18052
  });
18034
18053
  }
@@ -18036,10 +18055,8 @@ class ngFiltering
18036
18055
 
18037
18056
  if (options.length > 0) {
18038
18057
  const filterButton = document.createElement("ng-filter-button"); // ✅ `ng-filter-button` 생성
18039
- elem.appendChild(filterButton);
18058
+ td.appendChild(filterButton);
18040
18059
  filterButton.filterOptions = options; // ✅ 속성 설정
18041
-
18042
- console.log(filterButton, filterButton.filterOptions);
18043
18060
  }
18044
18061
  }
18045
18062
  });
@@ -152,9 +152,28 @@ export class ngFiltering
152
152
  return index;
153
153
  };
154
154
 
155
-
156
155
  #on = () => {
157
156
  this.#isFiltering = true;
157
+ const lastRowIndex = this.#getLastRowIndex();
158
+
159
+ this.#owner.body.querySelectorAll(".ng-table thead th, .ng-table thead td").forEach((td) => {
160
+ const rowIndex = td.closest("tr")?.sectionRowIndex;
161
+ if (rowIndex !== undefined && rowIndex + td.rowSpan - 1 === lastRowIndex) {
162
+ const options = Array.from(this.#owner.activeTmpl.querySelectorAll(`[data-col="${td.dataset.col}"]`))
163
+ .map(el => el.dataset.bind ? { colnm: el.dataset.bind, data: [] } : null)
164
+ .filter(Boolean); // ✅ `null` 제거
165
+ console.log(options);
166
+ if (options.length > 0) {
167
+ const filterButton = document.createElement("ng-filter-button");
168
+ td.appendChild(filterButton);
169
+ filterButton.filterOptions = options;
170
+ }
171
+ }
172
+ });
173
+ };
174
+
175
+ #on1 = () => {
176
+ this.#isFiltering = true;
158
177
 
159
178
  const lastRowIndex = this.#getLastRowIndex();
160
179
 
@@ -162,10 +181,10 @@ export class ngFiltering
162
181
  if (td.closest("tr").sectionRowIndex + td.rowSpan - 1 === lastRowIndex) {
163
182
  //let colnms = [];
164
183
  const options = [];
165
- this.#owner.activeTmpl.querySelectorAll(`[data-col="${td.dataset.col}"]`).forEach((elem) => {
166
- if (elem.dataset.bind) {
184
+ this.#owner.activeTmpl.querySelectorAll(`[data-col="${td.dataset.col}"]`).forEach((el) => {
185
+ if (el.dataset.bind) {
167
186
  options.push({
168
- colnm: elem.dataset.bind,
187
+ colnm: el.dataset.bind,
169
188
  data: [],
170
189
  });
171
190
  }
@@ -173,10 +192,8 @@ export class ngFiltering
173
192
 
174
193
  if (options.length > 0) {
175
194
  const filterButton = document.createElement("ng-filter-button"); // ✅ `ng-filter-button` 생성
176
- elem.appendChild(filterButton);
195
+ td.appendChild(filterButton);
177
196
  filterButton.filterOptions = options; // ✅ 속성 설정
178
-
179
- console.log(filterButton, filterButton.filterOptions);
180
197
  }
181
198
  }
182
199
  });
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "ninegrid2",
3
3
  "type": "module",
4
- "version": "6.149.0",
4
+ "version": "6.151.0",
5
5
  "main": "dist/index.js",
6
6
  "exports": {
7
7
  "import": "./dist/index.js",
@@ -152,9 +152,28 @@ export class ngFiltering
152
152
  return index;
153
153
  };
154
154
 
155
-
156
155
  #on = () => {
157
156
  this.#isFiltering = true;
157
+ const lastRowIndex = this.#getLastRowIndex();
158
+
159
+ this.#owner.body.querySelectorAll(".ng-table thead th, .ng-table thead td").forEach((td) => {
160
+ const rowIndex = td.closest("tr")?.sectionRowIndex;
161
+ if (rowIndex !== undefined && rowIndex + td.rowSpan - 1 === lastRowIndex) {
162
+ const options = Array.from(this.#owner.activeTmpl.querySelectorAll(`[data-col="${td.dataset.col}"]`))
163
+ .map(el => el.dataset.bind ? { colnm: el.dataset.bind, data: [] } : null)
164
+ .filter(Boolean); // ✅ `null` 제거
165
+ console.log(options);
166
+ if (options.length > 0) {
167
+ const filterButton = document.createElement("ng-filter-button");
168
+ td.appendChild(filterButton);
169
+ filterButton.filterOptions = options;
170
+ }
171
+ }
172
+ });
173
+ };
174
+
175
+ #on1 = () => {
176
+ this.#isFiltering = true;
158
177
 
159
178
  const lastRowIndex = this.#getLastRowIndex();
160
179
 
@@ -162,10 +181,10 @@ export class ngFiltering
162
181
  if (td.closest("tr").sectionRowIndex + td.rowSpan - 1 === lastRowIndex) {
163
182
  //let colnms = [];
164
183
  const options = [];
165
- this.#owner.activeTmpl.querySelectorAll(`[data-col="${td.dataset.col}"]`).forEach((elem) => {
166
- if (elem.dataset.bind) {
184
+ this.#owner.activeTmpl.querySelectorAll(`[data-col="${td.dataset.col}"]`).forEach((el) => {
185
+ if (el.dataset.bind) {
167
186
  options.push({
168
- colnm: elem.dataset.bind,
187
+ colnm: el.dataset.bind,
169
188
  data: [],
170
189
  });
171
190
  }
@@ -173,10 +192,8 @@ export class ngFiltering
173
192
 
174
193
  if (options.length > 0) {
175
194
  const filterButton = document.createElement("ng-filter-button"); // ✅ `ng-filter-button` 생성
176
- elem.appendChild(filterButton);
195
+ td.appendChild(filterButton);
177
196
  filterButton.filterOptions = options; // ✅ 속성 설정
178
-
179
- console.log(filterButton, filterButton.filterOptions);
180
197
  }
181
198
  }
182
199
  });