ninegrid2 6.205.0 → 6.207.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.
@@ -18066,7 +18066,7 @@ class ngFiltering
18066
18066
  //var colnms = filterData.map(item => item.colnm);
18067
18067
 
18068
18068
  ninegrid.querySelectorAll("ng-filter-button").forEach(v => {
18069
- v.filterData = null;
18069
+ v.filterOptions = null;
18070
18070
  });
18071
18071
 
18072
18072
  for (let key in jsonFilter) {
@@ -18084,7 +18084,7 @@ class ngFiltering
18084
18084
  if (colnms.includes(colnm)) {
18085
18085
  console.log("==================");
18086
18086
 
18087
- v.filterData = arr;
18087
+ v.filterOptions = arr;
18088
18088
  }
18089
18089
  });
18090
18090
  });
@@ -18179,7 +18179,7 @@ class ngFiltering
18179
18179
  class ngFilterButton extends HTMLElement
18180
18180
  {
18181
18181
  #owner;
18182
- #filterData;
18182
+ #filterOptions;
18183
18183
  #colnms;
18184
18184
 
18185
18185
  constructor () {
@@ -18200,12 +18200,13 @@ class ngFilterButton extends HTMLElement
18200
18200
  this.#colnms = v;
18201
18201
  };
18202
18202
 
18203
- get filterData() {
18204
- return this.#filterData;
18203
+ get filterOptions() {
18204
+ return this.#filterOptions;
18205
18205
  };
18206
- set filterData(v) {
18207
- this.#filterData = v;
18208
- v && v.length > 0 ? ninegrid.j.querySelectorAll(this).addClass('filtered') : ninegrid.j.querySelectorAll(this).removeClass('filtered');
18206
+ set filterOptions(v) {
18207
+ console.log(v);
18208
+ this.#filterOptions = v;
18209
+ v && v.length > 0 ? this.classList.add('filtered') : this.classList.remove('filtered');
18209
18210
  };
18210
18211
 
18211
18212
  #onClick = (e) => {
@@ -18316,22 +18317,20 @@ class ngFilterPanel extends HTMLElement
18316
18317
  const DATA_IDX = grd.fields.indexOf("DATA");
18317
18318
 
18318
18319
  const checked = grd.data.getValidDataNF().filter(m => { return m.v[LVL_IDX] == 2 && m.v[CHK_IDX] == "Y"; });
18319
- const unchecked = grd.data.getValidDataNF().filter(m => { return m.v[LVL_IDX] == 2 && m.v[CHK_IDX] != "Y"; });
18320
-
18321
- if (unchecked.length == 0) ;
18320
+ grd.data.getValidDataNF().filter(m => { return m.v[LVL_IDX] == 2 && m.v[CHK_IDX] != "Y"; });
18322
18321
 
18323
- var filterData = [];
18322
+ var filterOptions = [];
18324
18323
  if (checked.length > 0) {
18325
18324
 
18326
18325
  [...new Set(checked.map(m => { return m.v[COLNM_IDX] }))].forEach(v => {
18327
- filterData.push({
18326
+ filterOptions.push({
18328
18327
  colnm : v,
18329
18328
  data : [...new Set(grd.data.getValidData().filter(m => { return m.v[CHK_IDX] == "Y" && m.v[COLNM_IDX] == v; }).map(m => { return m.v[DATA_IDX] || ''; }))].sort((a,b) => { return a > b ? 1 : -1; }),
18330
18329
  });
18331
18330
  });
18332
18331
  }
18333
18332
 
18334
- console.log(filterData);
18333
+ console.log(filterOptions);
18335
18334
 
18336
18335
  //console.log(this.#target);
18337
18336
 
@@ -18355,27 +18354,25 @@ class ngFilterPanel extends HTMLElement
18355
18354
  this.#target.owner.data.refreshFilter();
18356
18355
  */
18357
18356
 
18358
- console.log(this.#target, this.#target.button, filterData);
18357
+ console.log(this.#target, this.#target.button, filterOptions);
18359
18358
 
18360
- this.#target.button.filterOptions = filterData;
18361
- this.#target.button.filterData = filterData;
18362
-
18363
- //this.#target.button.filterData = [...new Set(checked.map(m => { return m.v[DATA_IDX] }))];
18359
+ this.#target.button.filterOptions = filterOptions;
18364
18360
 
18365
- console.log(this.#target.button.filterOptions);
18361
+ var oParam = {};
18366
18362
 
18367
- $("ng-filter-button", this.#target.owner.body).each((index,el) => {
18363
+ this.#target.owner.body.querySelectorAll("ng-filter-button").each(el => {
18368
18364
 
18369
- if (!el.filterData) return true;
18365
+ //if (!el.filterOptions) return true;
18370
18366
 
18371
- el.colnms.forEach(colnm => {
18372
- el.filterData;
18367
+ el.filterOptions.forEach(filterOptions => {
18368
+ oParam[filterOptions.colnm] = filterOptions.data;
18373
18369
  });
18374
18370
  });
18375
18371
 
18376
- //console.log(oParam);
18377
-
18378
- //this.#target.owner.filtering.on(oParam);
18372
+ console.log(oParam);
18373
+
18374
+
18375
+ this.#target.owner.filtering.set(oParam);
18379
18376
 
18380
18377
  this.classList.remove("loading");
18381
18378
  });
@@ -18064,7 +18064,7 @@ class ngFiltering
18064
18064
  //var colnms = filterData.map(item => item.colnm);
18065
18065
 
18066
18066
  ninegrid.querySelectorAll("ng-filter-button").forEach(v => {
18067
- v.filterData = null;
18067
+ v.filterOptions = null;
18068
18068
  });
18069
18069
 
18070
18070
  for (let key in jsonFilter) {
@@ -18082,7 +18082,7 @@ class ngFiltering
18082
18082
  if (colnms.includes(colnm)) {
18083
18083
  console.log("==================");
18084
18084
 
18085
- v.filterData = arr;
18085
+ v.filterOptions = arr;
18086
18086
  }
18087
18087
  });
18088
18088
  });
@@ -18177,7 +18177,7 @@ class ngFiltering
18177
18177
  class ngFilterButton extends HTMLElement
18178
18178
  {
18179
18179
  #owner;
18180
- #filterData;
18180
+ #filterOptions;
18181
18181
  #colnms;
18182
18182
 
18183
18183
  constructor () {
@@ -18198,12 +18198,13 @@ class ngFilterButton extends HTMLElement
18198
18198
  this.#colnms = v;
18199
18199
  };
18200
18200
 
18201
- get filterData() {
18202
- return this.#filterData;
18201
+ get filterOptions() {
18202
+ return this.#filterOptions;
18203
18203
  };
18204
- set filterData(v) {
18205
- this.#filterData = v;
18206
- v && v.length > 0 ? ninegrid.j.querySelectorAll(this).addClass('filtered') : ninegrid.j.querySelectorAll(this).removeClass('filtered');
18204
+ set filterOptions(v) {
18205
+ console.log(v);
18206
+ this.#filterOptions = v;
18207
+ v && v.length > 0 ? this.classList.add('filtered') : this.classList.remove('filtered');
18207
18208
  };
18208
18209
 
18209
18210
  #onClick = (e) => {
@@ -18314,22 +18315,20 @@ class ngFilterPanel extends HTMLElement
18314
18315
  const DATA_IDX = grd.fields.indexOf("DATA");
18315
18316
 
18316
18317
  const checked = grd.data.getValidDataNF().filter(m => { return m.v[LVL_IDX] == 2 && m.v[CHK_IDX] == "Y"; });
18317
- const unchecked = grd.data.getValidDataNF().filter(m => { return m.v[LVL_IDX] == 2 && m.v[CHK_IDX] != "Y"; });
18318
-
18319
- if (unchecked.length == 0) ;
18318
+ grd.data.getValidDataNF().filter(m => { return m.v[LVL_IDX] == 2 && m.v[CHK_IDX] != "Y"; });
18320
18319
 
18321
- var filterData = [];
18320
+ var filterOptions = [];
18322
18321
  if (checked.length > 0) {
18323
18322
 
18324
18323
  [...new Set(checked.map(m => { return m.v[COLNM_IDX] }))].forEach(v => {
18325
- filterData.push({
18324
+ filterOptions.push({
18326
18325
  colnm : v,
18327
18326
  data : [...new Set(grd.data.getValidData().filter(m => { return m.v[CHK_IDX] == "Y" && m.v[COLNM_IDX] == v; }).map(m => { return m.v[DATA_IDX] || ''; }))].sort((a,b) => { return a > b ? 1 : -1; }),
18328
18327
  });
18329
18328
  });
18330
18329
  }
18331
18330
 
18332
- console.log(filterData);
18331
+ console.log(filterOptions);
18333
18332
 
18334
18333
  //console.log(this.#target);
18335
18334
 
@@ -18353,27 +18352,25 @@ class ngFilterPanel extends HTMLElement
18353
18352
  this.#target.owner.data.refreshFilter();
18354
18353
  */
18355
18354
 
18356
- console.log(this.#target, this.#target.button, filterData);
18355
+ console.log(this.#target, this.#target.button, filterOptions);
18357
18356
 
18358
- this.#target.button.filterOptions = filterData;
18359
- this.#target.button.filterData = filterData;
18360
-
18361
- //this.#target.button.filterData = [...new Set(checked.map(m => { return m.v[DATA_IDX] }))];
18357
+ this.#target.button.filterOptions = filterOptions;
18362
18358
 
18363
- console.log(this.#target.button.filterOptions);
18359
+ var oParam = {};
18364
18360
 
18365
- $("ng-filter-button", this.#target.owner.body).each((index,el) => {
18361
+ this.#target.owner.body.querySelectorAll("ng-filter-button").each(el => {
18366
18362
 
18367
- if (!el.filterData) return true;
18363
+ //if (!el.filterOptions) return true;
18368
18364
 
18369
- el.colnms.forEach(colnm => {
18370
- el.filterData;
18365
+ el.filterOptions.forEach(filterOptions => {
18366
+ oParam[filterOptions.colnm] = filterOptions.data;
18371
18367
  });
18372
18368
  });
18373
18369
 
18374
- //console.log(oParam);
18375
-
18376
- //this.#target.owner.filtering.on(oParam);
18370
+ console.log(oParam);
18371
+
18372
+
18373
+ this.#target.owner.filtering.set(oParam);
18377
18374
 
18378
18375
  this.classList.remove("loading");
18379
18376
  });
@@ -134,7 +134,7 @@ export class ngFiltering
134
134
  //var colnms = filterData.map(item => item.colnm);
135
135
 
136
136
  ninegrid.querySelectorAll("ng-filter-button").forEach(v => {
137
- v.filterData = null;
137
+ v.filterOptions = null;
138
138
  });
139
139
 
140
140
  for (let key in jsonFilter) {
@@ -152,7 +152,7 @@ export class ngFiltering
152
152
  if (colnms.includes(colnm)) {
153
153
  console.log("==================");
154
154
 
155
- v.filterData = arr;
155
+ v.filterOptions = arr;
156
156
  }
157
157
  });
158
158
  });
@@ -247,7 +247,7 @@ export class ngFiltering
247
247
  class ngFilterButton extends HTMLElement
248
248
  {
249
249
  #owner;
250
- #filterData;
250
+ #filterOptions;
251
251
  #colnms;
252
252
 
253
253
  constructor () {
@@ -268,12 +268,13 @@ class ngFilterButton extends HTMLElement
268
268
  this.#colnms = v;
269
269
  };
270
270
 
271
- get filterData() {
272
- return this.#filterData;
271
+ get filterOptions() {
272
+ return this.#filterOptions;
273
273
  };
274
- set filterData(v) {
275
- this.#filterData = v;
276
- v && v.length > 0 ? ninegrid.j.querySelectorAll(this).addClass('filtered') : ninegrid.j.querySelectorAll(this).removeClass('filtered');
274
+ set filterOptions(v) {
275
+ console.log(v);
276
+ this.#filterOptions = v;
277
+ v && v.length > 0 ? this.classList.add('filtered') : this.classList.remove('filtered');
277
278
  };
278
279
 
279
280
  #onClick = (e) => {
@@ -386,22 +387,18 @@ class ngFilterPanel extends HTMLElement
386
387
  const checked = grd.data.getValidDataNF().filter(m => { return m.v[LVL_IDX] == 2 && m.v[CHK_IDX] == "Y"; });
387
388
  const unchecked = grd.data.getValidDataNF().filter(m => { return m.v[LVL_IDX] == 2 && m.v[CHK_IDX] != "Y"; });
388
389
 
389
- if (unchecked.length == 0) {
390
- //this.#target.button.filterData = null;
391
- }
392
-
393
- var filterData = [];
390
+ var filterOptions = [];
394
391
  if (checked.length > 0) {
395
392
 
396
393
  [...new Set(checked.map(m => { return m.v[COLNM_IDX] }))].forEach(v => {
397
- filterData.push({
394
+ filterOptions.push({
398
395
  colnm : v,
399
396
  data : [...new Set(grd.data.getValidData().filter(m => { return m.v[CHK_IDX] == "Y" && m.v[COLNM_IDX] == v; }).map(m => { return m.v[DATA_IDX] || ''; }))].sort((a,b) => { return a > b ? 1 : -1; }),
400
397
  });
401
398
  });
402
399
  }
403
400
 
404
- console.log(filterData);
401
+ console.log(filterOptions);
405
402
 
406
403
  //console.log(this.#target);
407
404
 
@@ -425,29 +422,25 @@ class ngFilterPanel extends HTMLElement
425
422
  this.#target.owner.data.refreshFilter();
426
423
  */
427
424
 
428
- console.log(this.#target, this.#target.button, filterData)
429
-
430
- this.#target.button.filterOptions = filterData;
431
- this.#target.button.filterData = filterData;
432
-
433
- //this.#target.button.filterData = [...new Set(checked.map(m => { return m.v[DATA_IDX] }))];
425
+ console.log(this.#target, this.#target.button, filterOptions)
434
426
 
435
- console.log(this.#target.button.filterOptions)
427
+ this.#target.button.filterOptions = filterOptions;
436
428
 
437
429
  var oParam = {};
438
430
 
439
- $("ng-filter-button", this.#target.owner.body).each((index,el) => {
431
+ this.#target.owner.body.querySelectorAll("ng-filter-button").each(el => {
440
432
 
441
- if (!el.filterData) return true;
433
+ //if (!el.filterOptions) return true;
442
434
 
443
- el.colnms.forEach(colnm => {
444
- oParam[colnm] = el.filterData;
435
+ el.filterOptions.forEach(filterOptions => {
436
+ oParam[filterOptions.colnm] = filterOptions.data;
445
437
  });
446
438
  });
447
439
 
448
- //console.log(oParam);
449
-
450
- //this.#target.owner.filtering.on(oParam);
440
+ console.log(oParam);
441
+
442
+
443
+ this.#target.owner.filtering.set(oParam);
451
444
 
452
445
  this.classList.remove("loading");
453
446
  });
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "ninegrid2",
3
3
  "type": "module",
4
- "version": "6.205.0",
4
+ "version": "6.207.0",
5
5
  "main": "dist/index.js",
6
6
  "exports": {
7
7
  "import": "./dist/index.js",
@@ -134,7 +134,7 @@ export class ngFiltering
134
134
  //var colnms = filterData.map(item => item.colnm);
135
135
 
136
136
  ninegrid.querySelectorAll("ng-filter-button").forEach(v => {
137
- v.filterData = null;
137
+ v.filterOptions = null;
138
138
  });
139
139
 
140
140
  for (let key in jsonFilter) {
@@ -152,7 +152,7 @@ export class ngFiltering
152
152
  if (colnms.includes(colnm)) {
153
153
  console.log("==================");
154
154
 
155
- v.filterData = arr;
155
+ v.filterOptions = arr;
156
156
  }
157
157
  });
158
158
  });
@@ -247,7 +247,7 @@ export class ngFiltering
247
247
  class ngFilterButton extends HTMLElement
248
248
  {
249
249
  #owner;
250
- #filterData;
250
+ #filterOptions;
251
251
  #colnms;
252
252
 
253
253
  constructor () {
@@ -268,12 +268,13 @@ class ngFilterButton extends HTMLElement
268
268
  this.#colnms = v;
269
269
  };
270
270
 
271
- get filterData() {
272
- return this.#filterData;
271
+ get filterOptions() {
272
+ return this.#filterOptions;
273
273
  };
274
- set filterData(v) {
275
- this.#filterData = v;
276
- v && v.length > 0 ? ninegrid.j.querySelectorAll(this).addClass('filtered') : ninegrid.j.querySelectorAll(this).removeClass('filtered');
274
+ set filterOptions(v) {
275
+ console.log(v);
276
+ this.#filterOptions = v;
277
+ v && v.length > 0 ? this.classList.add('filtered') : this.classList.remove('filtered');
277
278
  };
278
279
 
279
280
  #onClick = (e) => {
@@ -386,22 +387,18 @@ class ngFilterPanel extends HTMLElement
386
387
  const checked = grd.data.getValidDataNF().filter(m => { return m.v[LVL_IDX] == 2 && m.v[CHK_IDX] == "Y"; });
387
388
  const unchecked = grd.data.getValidDataNF().filter(m => { return m.v[LVL_IDX] == 2 && m.v[CHK_IDX] != "Y"; });
388
389
 
389
- if (unchecked.length == 0) {
390
- //this.#target.button.filterData = null;
391
- }
392
-
393
- var filterData = [];
390
+ var filterOptions = [];
394
391
  if (checked.length > 0) {
395
392
 
396
393
  [...new Set(checked.map(m => { return m.v[COLNM_IDX] }))].forEach(v => {
397
- filterData.push({
394
+ filterOptions.push({
398
395
  colnm : v,
399
396
  data : [...new Set(grd.data.getValidData().filter(m => { return m.v[CHK_IDX] == "Y" && m.v[COLNM_IDX] == v; }).map(m => { return m.v[DATA_IDX] || ''; }))].sort((a,b) => { return a > b ? 1 : -1; }),
400
397
  });
401
398
  });
402
399
  }
403
400
 
404
- console.log(filterData);
401
+ console.log(filterOptions);
405
402
 
406
403
  //console.log(this.#target);
407
404
 
@@ -425,29 +422,25 @@ class ngFilterPanel extends HTMLElement
425
422
  this.#target.owner.data.refreshFilter();
426
423
  */
427
424
 
428
- console.log(this.#target, this.#target.button, filterData)
429
-
430
- this.#target.button.filterOptions = filterData;
431
- this.#target.button.filterData = filterData;
432
-
433
- //this.#target.button.filterData = [...new Set(checked.map(m => { return m.v[DATA_IDX] }))];
425
+ console.log(this.#target, this.#target.button, filterOptions)
434
426
 
435
- console.log(this.#target.button.filterOptions)
427
+ this.#target.button.filterOptions = filterOptions;
436
428
 
437
429
  var oParam = {};
438
430
 
439
- $("ng-filter-button", this.#target.owner.body).each((index,el) => {
431
+ this.#target.owner.body.querySelectorAll("ng-filter-button").each(el => {
440
432
 
441
- if (!el.filterData) return true;
433
+ //if (!el.filterOptions) return true;
442
434
 
443
- el.colnms.forEach(colnm => {
444
- oParam[colnm] = el.filterData;
435
+ el.filterOptions.forEach(filterOptions => {
436
+ oParam[filterOptions.colnm] = filterOptions.data;
445
437
  });
446
438
  });
447
439
 
448
- //console.log(oParam);
449
-
450
- //this.#target.owner.filtering.on(oParam);
440
+ console.log(oParam);
441
+
442
+
443
+ this.#target.owner.filtering.set(oParam);
451
444
 
452
445
  this.classList.remove("loading");
453
446
  });