ninegrid2 6.201.0 → 6.203.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.
@@ -18302,11 +18302,11 @@ class ngFilterPanel extends HTMLElement
18302
18302
 
18303
18303
  #onOk = (e) => {
18304
18304
 
18305
- var grd = this.shadowRoot.querySelector("nine-grid");
18305
+ const grd = this.shadowRoot.querySelector("nine-grid");
18306
18306
 
18307
18307
  //ninegrid.j.querySelectorAll(grd).addClass("loading");
18308
- ninegrid.j.querySelectorAll(this.#target.owner).addClass("loading");
18309
-
18308
+ //ninegrid.j.querySelectorAll(this.#target.owner).addClass("loading");
18309
+ this.classList.add("loading");
18310
18310
 
18311
18311
  setTimeout(() => {
18312
18312
 
@@ -18357,47 +18357,26 @@ class ngFilterPanel extends HTMLElement
18357
18357
 
18358
18358
  console.log(this.#target, this.#target.button);
18359
18359
 
18360
- this.#target.button.filterData = [...new Set(checked.map(m => { return m.v[DATA_IDX] }))];
18360
+ this.#target.button.filterOptions = filterData;
18361
+
18362
+ //this.#target.button.filterData = [...new Set(checked.map(m => { return m.v[DATA_IDX] }))];
18361
18363
 
18362
18364
  console.log(this.#target.button.filterData);
18363
18365
 
18364
- var oParam = {};
18365
-
18366
18366
  $("ng-filter-button", this.#target.owner.body).each((index,el) => {
18367
18367
 
18368
- //console.log(el, el.filterData);
18369
-
18370
18368
  if (!el.filterData) return true;
18371
-
18372
- //console.log(el, el.filterData);
18373
18369
 
18374
18370
  el.colnms.forEach(colnm => {
18375
- oParam[colnm] = el.filterData;
18371
+ el.filterData;
18376
18372
  });
18377
-
18378
- /**
18379
- el.filterData.forEach(o => {
18380
-
18381
- oParam[o.colnm] = o.data;
18382
-
18383
- //const idx = this.#target.owner.fields.indexOf(o.colnm);
18384
- //this.#target.owner.data.getValidData().filter(m => { return o.data.nineBinarySearch(m.v[idx] || '') < 0; }).map(m => { m.__ng.filtered = true; });
18385
- }); */
18386
18373
  });
18387
18374
 
18388
- console.log(oParam);
18389
-
18390
- //this.#target.owner.data.setFilter(oParam);
18391
- this.#target.owner.filtering.on(oParam);
18392
-
18393
-
18394
- //this.#target.owner.data.getValidDataNF().filter(rowData => { return this.#target.button.filterData.findIndex(item => (item.DATA || '') == (rowData[item.COLNM] || '') ) < 0; }).map(item => { item.__ng.filtered = true; });
18395
- //this.#target.owner.scrollTo_V1(0);
18396
-
18397
- //this.#target.owner.paging.reset();
18398
-
18399
- ninegrid.j.querySelectorAll(this.#target.owner).removeClass("loading");
18375
+ //console.log(oParam);
18400
18376
 
18377
+ //this.#target.owner.filtering.on(oParam);
18378
+
18379
+ this.classList.remove("loading");
18401
18380
  });
18402
18381
 
18403
18382
  $(this).hide();
@@ -18459,6 +18438,7 @@ class ngFilterPanel extends HTMLElement
18459
18438
 
18460
18439
  open = (filterButton) => {
18461
18440
 
18441
+ /**
18462
18442
  const owner = this.shadow.closest("nine-grid");
18463
18443
 
18464
18444
  var cell = filterButton.closest("th,td");
@@ -18471,6 +18451,28 @@ class ngFilterPanel extends HTMLElement
18471
18451
 
18472
18452
  //$(this).offset({left: l, top: t});
18473
18453
  $(this).css({left: l, top: t});
18454
+ */
18455
+
18456
+ const owner = this.shadow.closest("nine-grid");
18457
+
18458
+
18459
+ /** 위치 */
18460
+ const cell = filterButton.closest("th,td");
18461
+
18462
+ const filterButtonRect = filterButton.getBoundingClientRect();
18463
+ const ownerRect = owner.getBoundingClientRect();
18464
+ const cellRect = cell.getBoundingClientRect();
18465
+ const targetRect = this.getBoundingClientRect();
18466
+
18467
+ let l = filterButtonRect.left - ownerRect.left;
18468
+ if (l < 0) l = 0;
18469
+ if (l + targetRect.width > ownerRect.width) l = ownerRect.width - targetRect.width - 5;
18470
+
18471
+ const t = cellRect.top + cellRect.height - ownerRect.top;
18472
+
18473
+ this.style.left = `${l}px`; // ✅ 위치 설정
18474
+ this.style.top = `${t}px`;
18475
+
18474
18476
 
18475
18477
 
18476
18478
  //console.log(this, owner, filterButton.filterOptions, colnms);
@@ -18603,11 +18605,14 @@ class ngFilterPanel extends HTMLElement
18603
18605
 
18604
18606
  grd.data.set(ds);
18605
18607
 
18606
- $(this.shadowRoot).find("input[type=checkbox]").prop("checked", grd.data.getValidData().filter(item => { return item.LVL == 2 && item.CHK != "Y"; }).length == 0 ? true : false);
18607
-
18608
+ // 데이터 필터링 체크 상태 결정
18609
+ const checkbox = this.shadowRoot.querySelector("input[type=checkbox]");
18610
+ checkbox.checked = grd.data.getValidData().filter(item => item.LVL == 2 && item.CHK != "Y").length === 0; // ✅ 체크 상태 설정
18611
+
18608
18612
  this.shadowRoot.querySelector("input").focus();
18609
18613
 
18610
- ninegrid.j.querySelectorAll(this).removeClass("loading");
18614
+ this.classList.remove("loading");
18615
+ //ninegrid.j.querySelectorAll(this).removeClass("loading");
18611
18616
  });
18612
18617
  };
18613
18618
  }
@@ -18300,11 +18300,11 @@ class ngFilterPanel extends HTMLElement
18300
18300
 
18301
18301
  #onOk = (e) => {
18302
18302
 
18303
- var grd = this.shadowRoot.querySelector("nine-grid");
18303
+ const grd = this.shadowRoot.querySelector("nine-grid");
18304
18304
 
18305
18305
  //ninegrid.j.querySelectorAll(grd).addClass("loading");
18306
- ninegrid.j.querySelectorAll(this.#target.owner).addClass("loading");
18307
-
18306
+ //ninegrid.j.querySelectorAll(this.#target.owner).addClass("loading");
18307
+ this.classList.add("loading");
18308
18308
 
18309
18309
  setTimeout(() => {
18310
18310
 
@@ -18355,47 +18355,26 @@ class ngFilterPanel extends HTMLElement
18355
18355
 
18356
18356
  console.log(this.#target, this.#target.button);
18357
18357
 
18358
- this.#target.button.filterData = [...new Set(checked.map(m => { return m.v[DATA_IDX] }))];
18358
+ this.#target.button.filterOptions = filterData;
18359
+
18360
+ //this.#target.button.filterData = [...new Set(checked.map(m => { return m.v[DATA_IDX] }))];
18359
18361
 
18360
18362
  console.log(this.#target.button.filterData);
18361
18363
 
18362
- var oParam = {};
18363
-
18364
18364
  $("ng-filter-button", this.#target.owner.body).each((index,el) => {
18365
18365
 
18366
- //console.log(el, el.filterData);
18367
-
18368
18366
  if (!el.filterData) return true;
18369
-
18370
- //console.log(el, el.filterData);
18371
18367
 
18372
18368
  el.colnms.forEach(colnm => {
18373
- oParam[colnm] = el.filterData;
18369
+ el.filterData;
18374
18370
  });
18375
-
18376
- /**
18377
- el.filterData.forEach(o => {
18378
-
18379
- oParam[o.colnm] = o.data;
18380
-
18381
- //const idx = this.#target.owner.fields.indexOf(o.colnm);
18382
- //this.#target.owner.data.getValidData().filter(m => { return o.data.nineBinarySearch(m.v[idx] || '') < 0; }).map(m => { m.__ng.filtered = true; });
18383
- }); */
18384
18371
  });
18385
18372
 
18386
- console.log(oParam);
18387
-
18388
- //this.#target.owner.data.setFilter(oParam);
18389
- this.#target.owner.filtering.on(oParam);
18390
-
18391
-
18392
- //this.#target.owner.data.getValidDataNF().filter(rowData => { return this.#target.button.filterData.findIndex(item => (item.DATA || '') == (rowData[item.COLNM] || '') ) < 0; }).map(item => { item.__ng.filtered = true; });
18393
- //this.#target.owner.scrollTo_V1(0);
18394
-
18395
- //this.#target.owner.paging.reset();
18396
-
18397
- ninegrid.j.querySelectorAll(this.#target.owner).removeClass("loading");
18373
+ //console.log(oParam);
18398
18374
 
18375
+ //this.#target.owner.filtering.on(oParam);
18376
+
18377
+ this.classList.remove("loading");
18399
18378
  });
18400
18379
 
18401
18380
  $(this).hide();
@@ -18457,6 +18436,7 @@ class ngFilterPanel extends HTMLElement
18457
18436
 
18458
18437
  open = (filterButton) => {
18459
18438
 
18439
+ /**
18460
18440
  const owner = this.shadow.closest("nine-grid");
18461
18441
 
18462
18442
  var cell = filterButton.closest("th,td");
@@ -18469,6 +18449,28 @@ class ngFilterPanel extends HTMLElement
18469
18449
 
18470
18450
  //$(this).offset({left: l, top: t});
18471
18451
  $(this).css({left: l, top: t});
18452
+ */
18453
+
18454
+ const owner = this.shadow.closest("nine-grid");
18455
+
18456
+
18457
+ /** 위치 */
18458
+ const cell = filterButton.closest("th,td");
18459
+
18460
+ const filterButtonRect = filterButton.getBoundingClientRect();
18461
+ const ownerRect = owner.getBoundingClientRect();
18462
+ const cellRect = cell.getBoundingClientRect();
18463
+ const targetRect = this.getBoundingClientRect();
18464
+
18465
+ let l = filterButtonRect.left - ownerRect.left;
18466
+ if (l < 0) l = 0;
18467
+ if (l + targetRect.width > ownerRect.width) l = ownerRect.width - targetRect.width - 5;
18468
+
18469
+ const t = cellRect.top + cellRect.height - ownerRect.top;
18470
+
18471
+ this.style.left = `${l}px`; // ✅ 위치 설정
18472
+ this.style.top = `${t}px`;
18473
+
18472
18474
 
18473
18475
 
18474
18476
  //console.log(this, owner, filterButton.filterOptions, colnms);
@@ -18601,11 +18603,14 @@ class ngFilterPanel extends HTMLElement
18601
18603
 
18602
18604
  grd.data.set(ds);
18603
18605
 
18604
- $(this.shadowRoot).find("input[type=checkbox]").prop("checked", grd.data.getValidData().filter(item => { return item.LVL == 2 && item.CHK != "Y"; }).length == 0 ? true : false);
18605
-
18606
+ // 데이터 필터링 체크 상태 결정
18607
+ const checkbox = this.shadowRoot.querySelector("input[type=checkbox]");
18608
+ checkbox.checked = grd.data.getValidData().filter(item => item.LVL == 2 && item.CHK != "Y").length === 0; // ✅ 체크 상태 설정
18609
+
18606
18610
  this.shadowRoot.querySelector("input").focus();
18607
18611
 
18608
- ninegrid.j.querySelectorAll(this).removeClass("loading");
18612
+ this.classList.remove("loading");
18613
+ //ninegrid.j.querySelectorAll(this).removeClass("loading");
18609
18614
  });
18610
18615
  };
18611
18616
  }
@@ -370,11 +370,11 @@ class ngFilterPanel extends HTMLElement
370
370
 
371
371
  #onOk = (e) => {
372
372
 
373
- var grd = this.shadowRoot.querySelector("nine-grid");
373
+ const grd = this.shadowRoot.querySelector("nine-grid");
374
374
 
375
375
  //ninegrid.j.querySelectorAll(grd).addClass("loading");
376
- ninegrid.j.querySelectorAll(this.#target.owner).addClass("loading");
377
-
376
+ //ninegrid.j.querySelectorAll(this.#target.owner).addClass("loading");
377
+ this.classList.add("loading");
378
378
 
379
379
  setTimeout(() => {
380
380
 
@@ -427,7 +427,9 @@ class ngFilterPanel extends HTMLElement
427
427
 
428
428
  console.log(this.#target, this.#target.button)
429
429
 
430
- this.#target.button.filterData = [...new Set(checked.map(m => { return m.v[DATA_IDX] }))];
430
+ this.#target.button.filterOptions = filterData;
431
+
432
+ //this.#target.button.filterData = [...new Set(checked.map(m => { return m.v[DATA_IDX] }))];
431
433
 
432
434
  console.log(this.#target.button.filterData)
433
435
 
@@ -435,39 +437,18 @@ class ngFilterPanel extends HTMLElement
435
437
 
436
438
  $("ng-filter-button", this.#target.owner.body).each((index,el) => {
437
439
 
438
- //console.log(el, el.filterData);
439
-
440
440
  if (!el.filterData) return true;
441
-
442
- //console.log(el, el.filterData);
443
441
 
444
442
  el.colnms.forEach(colnm => {
445
443
  oParam[colnm] = el.filterData;
446
444
  });
447
-
448
- /**
449
- el.filterData.forEach(o => {
450
-
451
- oParam[o.colnm] = o.data;
452
-
453
- //const idx = this.#target.owner.fields.indexOf(o.colnm);
454
- //this.#target.owner.data.getValidData().filter(m => { return o.data.nineBinarySearch(m.v[idx] || '') < 0; }).map(m => { m.__ng.filtered = true; });
455
- }); */
456
445
  });
457
446
 
458
- console.log(oParam);
459
-
460
- //this.#target.owner.data.setFilter(oParam);
461
- this.#target.owner.filtering.on(oParam);
462
-
463
-
464
- //this.#target.owner.data.getValidDataNF().filter(rowData => { return this.#target.button.filterData.findIndex(item => (item.DATA || '') == (rowData[item.COLNM] || '') ) < 0; }).map(item => { item.__ng.filtered = true; });
465
- //this.#target.owner.scrollTo_V1(0);
466
-
467
- //this.#target.owner.paging.reset();
468
-
469
- ninegrid.j.querySelectorAll(this.#target.owner).removeClass("loading");
447
+ //console.log(oParam);
470
448
 
449
+ //this.#target.owner.filtering.on(oParam);
450
+
451
+ this.classList.remove("loading");
471
452
  });
472
453
 
473
454
  $(this).hide();
@@ -529,6 +510,7 @@ class ngFilterPanel extends HTMLElement
529
510
 
530
511
  open = (filterButton) => {
531
512
 
513
+ /**
532
514
  const owner = this.shadow.closest("nine-grid");
533
515
 
534
516
  var cell = filterButton.closest("th,td");
@@ -541,6 +523,28 @@ class ngFilterPanel extends HTMLElement
541
523
 
542
524
  //$(this).offset({left: l, top: t});
543
525
  $(this).css({left: l, top: t});
526
+ */
527
+
528
+ const owner = this.shadow.closest("nine-grid");
529
+
530
+
531
+ /** 위치 */
532
+ const cell = filterButton.closest("th,td");
533
+
534
+ const filterButtonRect = filterButton.getBoundingClientRect();
535
+ const ownerRect = owner.getBoundingClientRect();
536
+ const cellRect = cell.getBoundingClientRect();
537
+ const targetRect = this.getBoundingClientRect();
538
+
539
+ let l = filterButtonRect.left - ownerRect.left;
540
+ if (l < 0) l = 0;
541
+ if (l + targetRect.width > ownerRect.width) l = ownerRect.width - targetRect.width - 5;
542
+
543
+ const t = cellRect.top + cellRect.height - ownerRect.top;
544
+
545
+ this.style.left = `${l}px`; // ✅ 위치 설정
546
+ this.style.top = `${t}px`;
547
+
544
548
 
545
549
 
546
550
  //console.log(this, owner, filterButton.filterOptions, colnms);
@@ -673,11 +677,14 @@ class ngFilterPanel extends HTMLElement
673
677
 
674
678
  grd.data.set(ds);
675
679
 
676
- $(this.shadowRoot).find("input[type=checkbox]").prop("checked", grd.data.getValidData().filter(item => { return item.LVL == 2 && item.CHK != "Y"; }).length == 0 ? true : false);
677
-
680
+ // 데이터 필터링 체크 상태 결정
681
+ const checkbox = this.shadowRoot.querySelector("input[type=checkbox]");
682
+ checkbox.checked = grd.data.getValidData().filter(item => item.LVL == 2 && item.CHK != "Y").length === 0; // ✅ 체크 상태 설정
683
+
678
684
  this.shadowRoot.querySelector("input").focus();
679
685
 
680
- ninegrid.j.querySelectorAll(this).removeClass("loading");
686
+ this.classList.remove("loading");
687
+ //ninegrid.j.querySelectorAll(this).removeClass("loading");
681
688
  });
682
689
  };
683
690
  }
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "ninegrid2",
3
3
  "type": "module",
4
- "version": "6.201.0",
4
+ "version": "6.203.0",
5
5
  "main": "dist/index.js",
6
6
  "exports": {
7
7
  "import": "./dist/index.js",
@@ -370,11 +370,11 @@ class ngFilterPanel extends HTMLElement
370
370
 
371
371
  #onOk = (e) => {
372
372
 
373
- var grd = this.shadowRoot.querySelector("nine-grid");
373
+ const grd = this.shadowRoot.querySelector("nine-grid");
374
374
 
375
375
  //ninegrid.j.querySelectorAll(grd).addClass("loading");
376
- ninegrid.j.querySelectorAll(this.#target.owner).addClass("loading");
377
-
376
+ //ninegrid.j.querySelectorAll(this.#target.owner).addClass("loading");
377
+ this.classList.add("loading");
378
378
 
379
379
  setTimeout(() => {
380
380
 
@@ -427,7 +427,9 @@ class ngFilterPanel extends HTMLElement
427
427
 
428
428
  console.log(this.#target, this.#target.button)
429
429
 
430
- this.#target.button.filterData = [...new Set(checked.map(m => { return m.v[DATA_IDX] }))];
430
+ this.#target.button.filterOptions = filterData;
431
+
432
+ //this.#target.button.filterData = [...new Set(checked.map(m => { return m.v[DATA_IDX] }))];
431
433
 
432
434
  console.log(this.#target.button.filterData)
433
435
 
@@ -435,39 +437,18 @@ class ngFilterPanel extends HTMLElement
435
437
 
436
438
  $("ng-filter-button", this.#target.owner.body).each((index,el) => {
437
439
 
438
- //console.log(el, el.filterData);
439
-
440
440
  if (!el.filterData) return true;
441
-
442
- //console.log(el, el.filterData);
443
441
 
444
442
  el.colnms.forEach(colnm => {
445
443
  oParam[colnm] = el.filterData;
446
444
  });
447
-
448
- /**
449
- el.filterData.forEach(o => {
450
-
451
- oParam[o.colnm] = o.data;
452
-
453
- //const idx = this.#target.owner.fields.indexOf(o.colnm);
454
- //this.#target.owner.data.getValidData().filter(m => { return o.data.nineBinarySearch(m.v[idx] || '') < 0; }).map(m => { m.__ng.filtered = true; });
455
- }); */
456
445
  });
457
446
 
458
- console.log(oParam);
459
-
460
- //this.#target.owner.data.setFilter(oParam);
461
- this.#target.owner.filtering.on(oParam);
462
-
463
-
464
- //this.#target.owner.data.getValidDataNF().filter(rowData => { return this.#target.button.filterData.findIndex(item => (item.DATA || '') == (rowData[item.COLNM] || '') ) < 0; }).map(item => { item.__ng.filtered = true; });
465
- //this.#target.owner.scrollTo_V1(0);
466
-
467
- //this.#target.owner.paging.reset();
468
-
469
- ninegrid.j.querySelectorAll(this.#target.owner).removeClass("loading");
447
+ //console.log(oParam);
470
448
 
449
+ //this.#target.owner.filtering.on(oParam);
450
+
451
+ this.classList.remove("loading");
471
452
  });
472
453
 
473
454
  $(this).hide();
@@ -529,6 +510,7 @@ class ngFilterPanel extends HTMLElement
529
510
 
530
511
  open = (filterButton) => {
531
512
 
513
+ /**
532
514
  const owner = this.shadow.closest("nine-grid");
533
515
 
534
516
  var cell = filterButton.closest("th,td");
@@ -541,6 +523,28 @@ class ngFilterPanel extends HTMLElement
541
523
 
542
524
  //$(this).offset({left: l, top: t});
543
525
  $(this).css({left: l, top: t});
526
+ */
527
+
528
+ const owner = this.shadow.closest("nine-grid");
529
+
530
+
531
+ /** 위치 */
532
+ const cell = filterButton.closest("th,td");
533
+
534
+ const filterButtonRect = filterButton.getBoundingClientRect();
535
+ const ownerRect = owner.getBoundingClientRect();
536
+ const cellRect = cell.getBoundingClientRect();
537
+ const targetRect = this.getBoundingClientRect();
538
+
539
+ let l = filterButtonRect.left - ownerRect.left;
540
+ if (l < 0) l = 0;
541
+ if (l + targetRect.width > ownerRect.width) l = ownerRect.width - targetRect.width - 5;
542
+
543
+ const t = cellRect.top + cellRect.height - ownerRect.top;
544
+
545
+ this.style.left = `${l}px`; // ✅ 위치 설정
546
+ this.style.top = `${t}px`;
547
+
544
548
 
545
549
 
546
550
  //console.log(this, owner, filterButton.filterOptions, colnms);
@@ -673,11 +677,14 @@ class ngFilterPanel extends HTMLElement
673
677
 
674
678
  grd.data.set(ds);
675
679
 
676
- $(this.shadowRoot).find("input[type=checkbox]").prop("checked", grd.data.getValidData().filter(item => { return item.LVL == 2 && item.CHK != "Y"; }).length == 0 ? true : false);
677
-
680
+ // 데이터 필터링 체크 상태 결정
681
+ const checkbox = this.shadowRoot.querySelector("input[type=checkbox]");
682
+ checkbox.checked = grd.data.getValidData().filter(item => item.LVL == 2 && item.CHK != "Y").length === 0; // ✅ 체크 상태 설정
683
+
678
684
  this.shadowRoot.querySelector("input").focus();
679
685
 
680
- ninegrid.j.querySelectorAll(this).removeClass("loading");
686
+ this.classList.remove("loading");
687
+ //ninegrid.j.querySelectorAll(this).removeClass("loading");
681
688
  });
682
689
  };
683
690
  }