ninegrid2 6.217.0 → 6.218.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.
@@ -18058,15 +18058,18 @@ class ngFiltering
18058
18058
 
18059
18059
 
18060
18060
  this.#owner.data.refreshFilter();
18061
-
18062
- var colnms = [];
18063
- for (let key in jsonFilter) {
18064
- colnms.push(key);
18065
- }
18066
18061
  //var colnms = filterData.map(item => item.colnm);
18067
18062
 
18068
- ninegrid.querySelectorAll("ng-filter-button").forEach(v => {
18069
- v.filterOptions = null;
18063
+ //ninegrid.querySelectorAll("ng-filter-button").forEach(v => {
18064
+ this.#owner.shadow.querySelectorAll("ng-filter-button").forEach(el => {
18065
+ //v.filterOptions = null;
18066
+ let options = el.filterOptions;
18067
+
18068
+ options.forEach(opt => {
18069
+ opt.data = [];
18070
+ });
18071
+
18072
+ el.filterOptions = options;
18070
18073
  });
18071
18074
 
18072
18075
  for (let key in jsonFilter) {
@@ -18074,19 +18077,31 @@ class ngFiltering
18074
18077
  this.#owner.fields.indexOf(key);
18075
18078
 
18076
18079
  //console.log(filterData);
18077
- ninegrid.querySelectorAll("ng-filter-button").forEach(v => {
18080
+ //ninegrid.querySelectorAll("ng-filter-button").forEach(v => {
18081
+ this.#owner.shadow.querySelectorAll("ng-filter-button").forEach(el => {
18078
18082
  //v.filterData = null;
18079
18083
  //console.log(v);
18080
18084
  //var b = v.colnms;
18081
- v.colnms.forEach(colnm => {
18082
-
18083
- console.log(colnms, colnm);
18085
+ let options = el.filterOptions;
18086
+
18087
+ options.forEach(opt => {
18088
+
18089
+ if (opt.hasOwnProperty(key)) {
18090
+ opt.data = arr;
18091
+ }
18092
+ /**
18093
+ //console.log(colnms, colnm);
18084
18094
  if (colnms.includes(colnm)) {
18085
18095
  console.log("==================");
18086
18096
 
18087
18097
  v.filterOptions = arr;
18088
- }
18098
+ } */
18089
18099
  });
18100
+
18101
+
18102
+ console.log(options);
18103
+
18104
+ el.filterOptions = options;
18090
18105
  });
18091
18106
  }
18092
18107
 
@@ -18205,7 +18220,7 @@ class ngFilterButton extends HTMLElement
18205
18220
  };
18206
18221
  set filterOptions(v) {
18207
18222
  this.#filterOptions = v;
18208
- this.classList.toggle('filtered', v && this.#filterOptions.some(item => item.data.length > 0));
18223
+ this.classList.toggle('filtered', this.#filterOptions.some(item => item.data.length > 0));
18209
18224
  }
18210
18225
 
18211
18226
  #onClick = (e) => {
@@ -18056,15 +18056,18 @@ class ngFiltering
18056
18056
 
18057
18057
 
18058
18058
  this.#owner.data.refreshFilter();
18059
-
18060
- var colnms = [];
18061
- for (let key in jsonFilter) {
18062
- colnms.push(key);
18063
- }
18064
18059
  //var colnms = filterData.map(item => item.colnm);
18065
18060
 
18066
- ninegrid.querySelectorAll("ng-filter-button").forEach(v => {
18067
- v.filterOptions = null;
18061
+ //ninegrid.querySelectorAll("ng-filter-button").forEach(v => {
18062
+ this.#owner.shadow.querySelectorAll("ng-filter-button").forEach(el => {
18063
+ //v.filterOptions = null;
18064
+ let options = el.filterOptions;
18065
+
18066
+ options.forEach(opt => {
18067
+ opt.data = [];
18068
+ });
18069
+
18070
+ el.filterOptions = options;
18068
18071
  });
18069
18072
 
18070
18073
  for (let key in jsonFilter) {
@@ -18072,19 +18075,31 @@ class ngFiltering
18072
18075
  this.#owner.fields.indexOf(key);
18073
18076
 
18074
18077
  //console.log(filterData);
18075
- ninegrid.querySelectorAll("ng-filter-button").forEach(v => {
18078
+ //ninegrid.querySelectorAll("ng-filter-button").forEach(v => {
18079
+ this.#owner.shadow.querySelectorAll("ng-filter-button").forEach(el => {
18076
18080
  //v.filterData = null;
18077
18081
  //console.log(v);
18078
18082
  //var b = v.colnms;
18079
- v.colnms.forEach(colnm => {
18080
-
18081
- console.log(colnms, colnm);
18083
+ let options = el.filterOptions;
18084
+
18085
+ options.forEach(opt => {
18086
+
18087
+ if (opt.hasOwnProperty(key)) {
18088
+ opt.data = arr;
18089
+ }
18090
+ /**
18091
+ //console.log(colnms, colnm);
18082
18092
  if (colnms.includes(colnm)) {
18083
18093
  console.log("==================");
18084
18094
 
18085
18095
  v.filterOptions = arr;
18086
- }
18096
+ } */
18087
18097
  });
18098
+
18099
+
18100
+ console.log(options);
18101
+
18102
+ el.filterOptions = options;
18088
18103
  });
18089
18104
  }
18090
18105
 
@@ -18203,7 +18218,7 @@ class ngFilterButton extends HTMLElement
18203
18218
  };
18204
18219
  set filterOptions(v) {
18205
18220
  this.#filterOptions = v;
18206
- this.classList.toggle('filtered', v && this.#filterOptions.some(item => item.data.length > 0));
18221
+ this.classList.toggle('filtered', this.#filterOptions.some(item => item.data.length > 0));
18207
18222
  }
18208
18223
 
18209
18224
  #onClick = (e) => {
@@ -133,8 +133,16 @@ export class ngFiltering
133
133
  }
134
134
  //var colnms = filterData.map(item => item.colnm);
135
135
 
136
- ninegrid.querySelectorAll("ng-filter-button").forEach(v => {
137
- v.filterOptions = null;
136
+ //ninegrid.querySelectorAll("ng-filter-button").forEach(v => {
137
+ this.#owner.shadow.querySelectorAll("ng-filter-button").forEach(el => {
138
+ //v.filterOptions = null;
139
+ let options = el.filterOptions;
140
+
141
+ options.forEach(opt => {
142
+ opt.data = [];
143
+ });
144
+
145
+ el.filterOptions = options;
138
146
  });
139
147
 
140
148
  for (let key in jsonFilter) {
@@ -142,19 +150,31 @@ export class ngFiltering
142
150
  const idx = this.#owner.fields.indexOf(key);
143
151
 
144
152
  //console.log(filterData);
145
- ninegrid.querySelectorAll("ng-filter-button").forEach(v => {
153
+ //ninegrid.querySelectorAll("ng-filter-button").forEach(v => {
154
+ this.#owner.shadow.querySelectorAll("ng-filter-button").forEach(el => {
146
155
  //v.filterData = null;
147
156
  //console.log(v);
148
157
  //var b = v.colnms;
149
- v.colnms.forEach(colnm => {
150
-
151
- console.log(colnms, colnm);
158
+ let options = el.filterOptions;
159
+
160
+ options.forEach(opt => {
161
+
162
+ if (opt.hasOwnProperty(key)) {
163
+ opt.data = arr;
164
+ }
165
+ /**
166
+ //console.log(colnms, colnm);
152
167
  if (colnms.includes(colnm)) {
153
168
  console.log("==================");
154
169
 
155
170
  v.filterOptions = arr;
156
- }
171
+ } */
157
172
  });
173
+
174
+
175
+ console.log(options);
176
+
177
+ el.filterOptions = options;
158
178
  });
159
179
  }
160
180
 
@@ -273,7 +293,7 @@ class ngFilterButton extends HTMLElement
273
293
  };
274
294
  set filterOptions(v) {
275
295
  this.#filterOptions = v;
276
- this.classList.toggle('filtered', v && this.#filterOptions.some(item => item.data.length > 0));
296
+ this.classList.toggle('filtered', this.#filterOptions.some(item => item.data.length > 0));
277
297
  }
278
298
 
279
299
  #onClick = (e) => {
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "ninegrid2",
3
3
  "type": "module",
4
- "version": "6.217.0",
4
+ "version": "6.218.0",
5
5
  "main": "dist/index.js",
6
6
  "exports": {
7
7
  "import": "./dist/index.js",
@@ -133,8 +133,16 @@ export class ngFiltering
133
133
  }
134
134
  //var colnms = filterData.map(item => item.colnm);
135
135
 
136
- ninegrid.querySelectorAll("ng-filter-button").forEach(v => {
137
- v.filterOptions = null;
136
+ //ninegrid.querySelectorAll("ng-filter-button").forEach(v => {
137
+ this.#owner.shadow.querySelectorAll("ng-filter-button").forEach(el => {
138
+ //v.filterOptions = null;
139
+ let options = el.filterOptions;
140
+
141
+ options.forEach(opt => {
142
+ opt.data = [];
143
+ });
144
+
145
+ el.filterOptions = options;
138
146
  });
139
147
 
140
148
  for (let key in jsonFilter) {
@@ -142,19 +150,31 @@ export class ngFiltering
142
150
  const idx = this.#owner.fields.indexOf(key);
143
151
 
144
152
  //console.log(filterData);
145
- ninegrid.querySelectorAll("ng-filter-button").forEach(v => {
153
+ //ninegrid.querySelectorAll("ng-filter-button").forEach(v => {
154
+ this.#owner.shadow.querySelectorAll("ng-filter-button").forEach(el => {
146
155
  //v.filterData = null;
147
156
  //console.log(v);
148
157
  //var b = v.colnms;
149
- v.colnms.forEach(colnm => {
150
-
151
- console.log(colnms, colnm);
158
+ let options = el.filterOptions;
159
+
160
+ options.forEach(opt => {
161
+
162
+ if (opt.hasOwnProperty(key)) {
163
+ opt.data = arr;
164
+ }
165
+ /**
166
+ //console.log(colnms, colnm);
152
167
  if (colnms.includes(colnm)) {
153
168
  console.log("==================");
154
169
 
155
170
  v.filterOptions = arr;
156
- }
171
+ } */
157
172
  });
173
+
174
+
175
+ console.log(options);
176
+
177
+ el.filterOptions = options;
158
178
  });
159
179
  }
160
180
 
@@ -273,7 +293,7 @@ class ngFilterButton extends HTMLElement
273
293
  };
274
294
  set filterOptions(v) {
275
295
  this.#filterOptions = v;
276
- this.classList.toggle('filtered', v && this.#filterOptions.some(item => item.data.length > 0));
296
+ this.classList.toggle('filtered', this.#filterOptions.some(item => item.data.length > 0));
277
297
  }
278
298
 
279
299
  #onClick = (e) => {