ninegrid2 6.970.0 → 6.972.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.
@@ -118111,6 +118111,7 @@ customElements.define("ng-filter-panel", ngFilterPanel);
118111
118111
 
118112
118112
  class NineGridContainer extends HTMLElement
118113
118113
  {
118114
+ #created = false;
118114
118115
  #colResizer;
118115
118116
  #colMover;
118116
118117
  #rowMover;
@@ -118591,7 +118592,9 @@ class NineGridContainer extends HTMLElement
118591
118592
  };
118592
118593
 
118593
118594
  #initialize = () => {
118594
-
118595
+
118596
+ if (this.#created) return;
118597
+
118595
118598
  this.originFormat = this.outerHTML;
118596
118599
 
118597
118600
  this.uuid = ninegrid.randomUUID(); //crypto.randomUUID();
@@ -118910,6 +118913,7 @@ class NineGridContainer extends HTMLElement
118910
118913
  this.addEventListener(handler.type, handler.listener);
118911
118914
  } */
118912
118915
 
118916
+ this.#created = true;
118913
118917
  };
118914
118918
 
118915
118919
  #initOption = () => {
@@ -121898,7 +121902,9 @@ class NxLayout extends HTMLElement {
121898
121902
 
121899
121903
  attributeChangedCallback(name, oldValue, newValue) {
121900
121904
  // 속성이 변경되면 레이아웃을 다시 렌더링합니다.
121901
- //this.#render();
121905
+ if (oldValue !== newValue) {
121906
+ this.#render();
121907
+ }
121902
121908
  }
121903
121909
 
121904
121910
  static get observedAttributes() {
@@ -121906,19 +121912,20 @@ class NxLayout extends HTMLElement {
121906
121912
  }
121907
121913
 
121908
121914
  #render() {
121909
- // 이전 콘텐츠를 모두 제거합니다.
121910
- console.log("====================");
121911
-
121912
- const numColumns = Number(this.getAttribute('columns') || "1");
121913
- const numRows = Number(this.getAttribute('rows') || "1");
121915
+ // 기존 자식 요소들을 미리 저장합니다.
121914
121916
  const children = Array.from(this.children);
121915
121917
 
121916
- if (children.length <= 0) return;
121918
+ if (children.length === 0) {
121919
+ return;
121920
+ }
121917
121921
 
121918
- console.log(children);
121919
- console.log(numRows, numColumns, this.getAttribute('columns'));
121922
+ const numColumns = Number(this.getAttribute('columns') || "1");
121923
+ const numRows = Number(this.getAttribute('rows') || "1");
121920
121924
 
121921
- this.innerHTML = '';
121925
+ // 기존 자식 노드를 안전하게 제거합니다.
121926
+ while (this.firstChild) {
121927
+ this.removeChild(this.firstChild);
121928
+ }
121922
121929
 
121923
121930
  // CSS Grid 컨테이너 스타일 설정
121924
121931
  let gridColumns = '';
@@ -121944,8 +121951,6 @@ class NxLayout extends HTMLElement {
121944
121951
  this.style.gridTemplateColumns = gridColumns.trim();
121945
121952
  this.style.gridTemplateRows = gridRows.trim();
121946
121953
 
121947
-
121948
-
121949
121954
  // 자식 요소를 다시 추가하고 스플리터 삽입
121950
121955
  const renderedLayout = [];
121951
121956
  let childIndex = 0;
@@ -121953,12 +121958,7 @@ class NxLayout extends HTMLElement {
121953
121958
  for (let row = 0; row < numRows; row++) {
121954
121959
  for (let col = 0; col < numColumns; col++) {
121955
121960
 
121956
- console.log(row, col, childIndex);
121957
-
121958
121961
  if (children[childIndex]) {
121959
-
121960
- console.log(children[childIndex]);
121961
-
121962
121962
  const childWrapper = document.createElement('div');
121963
121963
  childWrapper.style.width = '100%';
121964
121964
  childWrapper.style.height = '100%';
@@ -118107,6 +118107,7 @@ customElements.define("ng-filter-panel", ngFilterPanel);
118107
118107
 
118108
118108
  class NineGridContainer extends HTMLElement
118109
118109
  {
118110
+ #created = false;
118110
118111
  #colResizer;
118111
118112
  #colMover;
118112
118113
  #rowMover;
@@ -118587,7 +118588,9 @@ class NineGridContainer extends HTMLElement
118587
118588
  };
118588
118589
 
118589
118590
  #initialize = () => {
118590
-
118591
+
118592
+ if (this.#created) return;
118593
+
118591
118594
  this.originFormat = this.outerHTML;
118592
118595
 
118593
118596
  this.uuid = ninegrid.randomUUID(); //crypto.randomUUID();
@@ -118906,6 +118909,7 @@ class NineGridContainer extends HTMLElement
118906
118909
  this.addEventListener(handler.type, handler.listener);
118907
118910
  } */
118908
118911
 
118912
+ this.#created = true;
118909
118913
  };
118910
118914
 
118911
118915
  #initOption = () => {
@@ -121894,7 +121898,9 @@ class NxLayout extends HTMLElement {
121894
121898
 
121895
121899
  attributeChangedCallback(name, oldValue, newValue) {
121896
121900
  // 속성이 변경되면 레이아웃을 다시 렌더링합니다.
121897
- //this.#render();
121901
+ if (oldValue !== newValue) {
121902
+ this.#render();
121903
+ }
121898
121904
  }
121899
121905
 
121900
121906
  static get observedAttributes() {
@@ -121902,19 +121908,20 @@ class NxLayout extends HTMLElement {
121902
121908
  }
121903
121909
 
121904
121910
  #render() {
121905
- // 이전 콘텐츠를 모두 제거합니다.
121906
- console.log("====================");
121907
-
121908
- const numColumns = Number(this.getAttribute('columns') || "1");
121909
- const numRows = Number(this.getAttribute('rows') || "1");
121911
+ // 기존 자식 요소들을 미리 저장합니다.
121910
121912
  const children = Array.from(this.children);
121911
121913
 
121912
- if (children.length <= 0) return;
121914
+ if (children.length === 0) {
121915
+ return;
121916
+ }
121913
121917
 
121914
- console.log(children);
121915
- console.log(numRows, numColumns, this.getAttribute('columns'));
121918
+ const numColumns = Number(this.getAttribute('columns') || "1");
121919
+ const numRows = Number(this.getAttribute('rows') || "1");
121916
121920
 
121917
- this.innerHTML = '';
121921
+ // 기존 자식 노드를 안전하게 제거합니다.
121922
+ while (this.firstChild) {
121923
+ this.removeChild(this.firstChild);
121924
+ }
121918
121925
 
121919
121926
  // CSS Grid 컨테이너 스타일 설정
121920
121927
  let gridColumns = '';
@@ -121940,8 +121947,6 @@ class NxLayout extends HTMLElement {
121940
121947
  this.style.gridTemplateColumns = gridColumns.trim();
121941
121948
  this.style.gridTemplateRows = gridRows.trim();
121942
121949
 
121943
-
121944
-
121945
121950
  // 자식 요소를 다시 추가하고 스플리터 삽입
121946
121951
  const renderedLayout = [];
121947
121952
  let childIndex = 0;
@@ -121949,12 +121954,7 @@ class NxLayout extends HTMLElement {
121949
121954
  for (let row = 0; row < numRows; row++) {
121950
121955
  for (let col = 0; col < numColumns; col++) {
121951
121956
 
121952
- console.log(row, col, childIndex);
121953
-
121954
121957
  if (children[childIndex]) {
121955
-
121956
- console.log(children[childIndex]);
121957
-
121958
121958
  const childWrapper = document.createElement('div');
121959
121959
  childWrapper.style.width = '100%';
121960
121960
  childWrapper.style.height = '100%';
@@ -22,6 +22,7 @@ import { ngFiltering } from "../utils/ngFiltering.js";
22
22
 
23
23
  export class NineGridContainer extends HTMLElement
24
24
  {
25
+ #created = false;
25
26
  #colResizer;
26
27
  #colMover;
27
28
  #rowMover;
@@ -505,7 +506,9 @@ export class NineGridContainer extends HTMLElement
505
506
  };
506
507
 
507
508
  #initialize = () => {
508
-
509
+
510
+ if (this.#created) return;
511
+
509
512
  this.originFormat = this.outerHTML;
510
513
 
511
514
  this.uuid = ninegrid.randomUUID(); //crypto.randomUUID();
@@ -827,6 +830,7 @@ export class NineGridContainer extends HTMLElement
827
830
  this.addEventListener(handler.type, handler.listener);
828
831
  } */
829
832
 
833
+ this.#created = true;
830
834
  };
831
835
 
832
836
  #initOption = () => {
@@ -7,7 +7,9 @@ class NxLayout extends HTMLElement {
7
7
 
8
8
  attributeChangedCallback(name, oldValue, newValue) {
9
9
  // 속성이 변경되면 레이아웃을 다시 렌더링합니다.
10
- //this.#render();
10
+ if (oldValue !== newValue) {
11
+ this.#render();
12
+ }
11
13
  }
12
14
 
13
15
  static get observedAttributes() {
@@ -15,19 +17,20 @@ class NxLayout extends HTMLElement {
15
17
  }
16
18
 
17
19
  #render() {
18
- // 이전 콘텐츠를 모두 제거합니다.
19
- console.log("====================");
20
-
21
- const numColumns = Number(this.getAttribute('columns') || "1");
22
- const numRows = Number(this.getAttribute('rows') || "1");
20
+ // 기존 자식 요소들을 미리 저장합니다.
23
21
  const children = Array.from(this.children);
24
22
 
25
- if (children.length <= 0) return;
23
+ if (children.length === 0) {
24
+ return;
25
+ }
26
26
 
27
- console.log(children);
28
- console.log(numRows, numColumns, this.getAttribute('columns'));
27
+ const numColumns = Number(this.getAttribute('columns') || "1");
28
+ const numRows = Number(this.getAttribute('rows') || "1");
29
29
 
30
- this.innerHTML = '';
30
+ // 기존 자식 노드를 안전하게 제거합니다.
31
+ while (this.firstChild) {
32
+ this.removeChild(this.firstChild);
33
+ }
31
34
 
32
35
  // CSS Grid 컨테이너 스타일 설정
33
36
  let gridColumns = '';
@@ -53,8 +56,6 @@ class NxLayout extends HTMLElement {
53
56
  this.style.gridTemplateColumns = gridColumns.trim();
54
57
  this.style.gridTemplateRows = gridRows.trim();
55
58
 
56
-
57
-
58
59
  // 자식 요소를 다시 추가하고 스플리터 삽입
59
60
  const renderedLayout = [];
60
61
  let childIndex = 0;
@@ -62,12 +63,7 @@ class NxLayout extends HTMLElement {
62
63
  for (let row = 0; row < numRows; row++) {
63
64
  for (let col = 0; col < numColumns; col++) {
64
65
 
65
- console.log(row, col, childIndex);
66
-
67
66
  if (children[childIndex]) {
68
-
69
- console.log(children[childIndex]);
70
-
71
67
  const childWrapper = document.createElement('div');
72
68
  childWrapper.style.width = '100%';
73
69
  childWrapper.style.height = '100%';
@@ -95,4 +91,4 @@ class NxLayout extends HTMLElement {
95
91
  }
96
92
 
97
93
  // 커스텀 엘리먼트를 등록
98
- customElements.define('nx-layout', NxLayout);
94
+ customElements.define('nx-layout', NxLayout);
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "ninegrid2",
3
3
  "type": "module",
4
- "version": "6.970.0",
4
+ "version": "6.972.0",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
7
7
  "exports": {
@@ -22,6 +22,7 @@ import { ngFiltering } from "../utils/ngFiltering.js";
22
22
 
23
23
  export class NineGridContainer extends HTMLElement
24
24
  {
25
+ #created = false;
25
26
  #colResizer;
26
27
  #colMover;
27
28
  #rowMover;
@@ -505,7 +506,9 @@ export class NineGridContainer extends HTMLElement
505
506
  };
506
507
 
507
508
  #initialize = () => {
508
-
509
+
510
+ if (this.#created) return;
511
+
509
512
  this.originFormat = this.outerHTML;
510
513
 
511
514
  this.uuid = ninegrid.randomUUID(); //crypto.randomUUID();
@@ -827,6 +830,7 @@ export class NineGridContainer extends HTMLElement
827
830
  this.addEventListener(handler.type, handler.listener);
828
831
  } */
829
832
 
833
+ this.#created = true;
830
834
  };
831
835
 
832
836
  #initOption = () => {
@@ -7,7 +7,9 @@ class NxLayout extends HTMLElement {
7
7
 
8
8
  attributeChangedCallback(name, oldValue, newValue) {
9
9
  // 속성이 변경되면 레이아웃을 다시 렌더링합니다.
10
- //this.#render();
10
+ if (oldValue !== newValue) {
11
+ this.#render();
12
+ }
11
13
  }
12
14
 
13
15
  static get observedAttributes() {
@@ -15,19 +17,20 @@ class NxLayout extends HTMLElement {
15
17
  }
16
18
 
17
19
  #render() {
18
- // 이전 콘텐츠를 모두 제거합니다.
19
- console.log("====================");
20
-
21
- const numColumns = Number(this.getAttribute('columns') || "1");
22
- const numRows = Number(this.getAttribute('rows') || "1");
20
+ // 기존 자식 요소들을 미리 저장합니다.
23
21
  const children = Array.from(this.children);
24
22
 
25
- if (children.length <= 0) return;
23
+ if (children.length === 0) {
24
+ return;
25
+ }
26
26
 
27
- console.log(children);
28
- console.log(numRows, numColumns, this.getAttribute('columns'));
27
+ const numColumns = Number(this.getAttribute('columns') || "1");
28
+ const numRows = Number(this.getAttribute('rows') || "1");
29
29
 
30
- this.innerHTML = '';
30
+ // 기존 자식 노드를 안전하게 제거합니다.
31
+ while (this.firstChild) {
32
+ this.removeChild(this.firstChild);
33
+ }
31
34
 
32
35
  // CSS Grid 컨테이너 스타일 설정
33
36
  let gridColumns = '';
@@ -53,8 +56,6 @@ class NxLayout extends HTMLElement {
53
56
  this.style.gridTemplateColumns = gridColumns.trim();
54
57
  this.style.gridTemplateRows = gridRows.trim();
55
58
 
56
-
57
-
58
59
  // 자식 요소를 다시 추가하고 스플리터 삽입
59
60
  const renderedLayout = [];
60
61
  let childIndex = 0;
@@ -62,12 +63,7 @@ class NxLayout extends HTMLElement {
62
63
  for (let row = 0; row < numRows; row++) {
63
64
  for (let col = 0; col < numColumns; col++) {
64
65
 
65
- console.log(row, col, childIndex);
66
-
67
66
  if (children[childIndex]) {
68
-
69
- console.log(children[childIndex]);
70
-
71
67
  const childWrapper = document.createElement('div');
72
68
  childWrapper.style.width = '100%';
73
69
  childWrapper.style.height = '100%';
@@ -95,4 +91,4 @@ class NxLayout extends HTMLElement {
95
91
  }
96
92
 
97
93
  // 커스텀 엘리먼트를 등록
98
- customElements.define('nx-layout', NxLayout);
94
+ customElements.define('nx-layout', NxLayout);