ninegrid2 6.1348.0 → 6.1350.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.
@@ -28569,6 +28569,11 @@ class nxDiv extends HTMLElement {
28569
28569
 
28570
28570
  this.originContents = this.innerHTML.trim();
28571
28571
  //this.innerHTML = ""; // 기존 내부 HTML 제거
28572
+ // 1. 문자열로 복사하는 대신, 자식 노드들을 안전하게 '대피'시킵니다.
28573
+ this.fragment = document.createDocumentFragment();
28574
+ while (this.firstChild) {
28575
+ this.fragment.appendChild(this.firstChild); // 원본 노드(이벤트 포함)를 이동
28576
+ }
28572
28577
 
28573
28578
  // 만약 순수 nx-div로만 쓰일 경우(상속 x), 내용을 shadow에 채워줌
28574
28579
  if (this.shadowRoot && this.tagName.toLowerCase() === 'nx-div') {
@@ -28898,12 +28903,16 @@ class nxButtons extends nxDiv {
28898
28903
  @import "https://cdn.jsdelivr.net/npm/ninegrid@${ninegrid.version}/dist/css/nxButtons.css";
28899
28904
  ${ninegrid.getCustomPath(this,"nxButtons.css")}
28900
28905
  </style>
28901
- <slot></slot>
28906
+ <div id="container"></div>
28902
28907
  `;
28903
28908
 
28904
- console.log(htmlTmpl);
28905
-
28906
28909
  target.appendChild(htmlTmpl.content.cloneNode(true));
28910
+
28911
+ // 2. 대피시켰던 원본 노드들을 다시 목적지에 집어넣습니다.
28912
+ const container = target.querySelector('#container');
28913
+ if (this.fragment) {
28914
+ container.appendChild(this.fragment); // 원본 그대로 복구!
28915
+ }
28907
28916
  }
28908
28917
  }
28909
28918
 
@@ -28565,6 +28565,11 @@ class nxDiv extends HTMLElement {
28565
28565
 
28566
28566
  this.originContents = this.innerHTML.trim();
28567
28567
  //this.innerHTML = ""; // 기존 내부 HTML 제거
28568
+ // 1. 문자열로 복사하는 대신, 자식 노드들을 안전하게 '대피'시킵니다.
28569
+ this.fragment = document.createDocumentFragment();
28570
+ while (this.firstChild) {
28571
+ this.fragment.appendChild(this.firstChild); // 원본 노드(이벤트 포함)를 이동
28572
+ }
28568
28573
 
28569
28574
  // 만약 순수 nx-div로만 쓰일 경우(상속 x), 내용을 shadow에 채워줌
28570
28575
  if (this.shadowRoot && this.tagName.toLowerCase() === 'nx-div') {
@@ -28894,12 +28899,16 @@ class nxButtons extends nxDiv {
28894
28899
  @import "https://cdn.jsdelivr.net/npm/ninegrid@${ninegrid.version}/dist/css/nxButtons.css";
28895
28900
  ${ninegrid.getCustomPath(this,"nxButtons.css")}
28896
28901
  </style>
28897
- <slot></slot>
28902
+ <div id="container"></div>
28898
28903
  `;
28899
28904
 
28900
- console.log(htmlTmpl);
28901
-
28902
28905
  target.appendChild(htmlTmpl.content.cloneNode(true));
28906
+
28907
+ // 2. 대피시켰던 원본 노드들을 다시 목적지에 집어넣습니다.
28908
+ const container = target.querySelector('#container');
28909
+ if (this.fragment) {
28910
+ container.appendChild(this.fragment); // 원본 그대로 복구!
28911
+ }
28903
28912
  }
28904
28913
  }
28905
28914
 
package/dist/nx/_nxDiv.js CHANGED
@@ -136,6 +136,11 @@ export class nxDiv extends HTMLElement {
136
136
 
137
137
  this.originContents = this.innerHTML.trim();
138
138
  //this.innerHTML = ""; // 기존 내부 HTML 제거
139
+ // 1. 문자열로 복사하는 대신, 자식 노드들을 안전하게 '대피'시킵니다.
140
+ this.fragment = document.createDocumentFragment();
141
+ while (this.firstChild) {
142
+ this.fragment.appendChild(this.firstChild); // 원본 노드(이벤트 포함)를 이동
143
+ }
139
144
 
140
145
  // 만약 순수 nx-div로만 쓰일 경우(상속 x), 내용을 shadow에 채워줌
141
146
  if (this.shadowRoot && this.tagName.toLowerCase() === 'nx-div') {
@@ -21,12 +21,16 @@ class nxButtons extends nxDiv {
21
21
  @import "https://cdn.jsdelivr.net/npm/ninegrid@${ninegrid.version}/dist/css/nxButtons.css";
22
22
  ${ninegrid.getCustomPath(this,"nxButtons.css")}
23
23
  </style>
24
- <slot></slot>
24
+ <div id="container"></div>
25
25
  `;
26
26
 
27
- console.log(htmlTmpl);
28
-
29
27
  target.appendChild(htmlTmpl.content.cloneNode(true));
28
+
29
+ // 2. 대피시켰던 원본 노드들을 다시 목적지에 집어넣습니다.
30
+ const container = target.querySelector('#container');
31
+ if (this.fragment) {
32
+ container.appendChild(this.fragment); // 원본 그대로 복구!
33
+ }
30
34
  }
31
35
  }
32
36
 
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "ninegrid2",
3
3
  "type": "module",
4
- "version": "6.1348.0",
4
+ "version": "6.1350.0",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
7
7
  "exports": {
package/src/nx/_nxDiv.js CHANGED
@@ -136,6 +136,11 @@ export class nxDiv extends HTMLElement {
136
136
 
137
137
  this.originContents = this.innerHTML.trim();
138
138
  //this.innerHTML = ""; // 기존 내부 HTML 제거
139
+ // 1. 문자열로 복사하는 대신, 자식 노드들을 안전하게 '대피'시킵니다.
140
+ this.fragment = document.createDocumentFragment();
141
+ while (this.firstChild) {
142
+ this.fragment.appendChild(this.firstChild); // 원본 노드(이벤트 포함)를 이동
143
+ }
139
144
 
140
145
  // 만약 순수 nx-div로만 쓰일 경우(상속 x), 내용을 shadow에 채워줌
141
146
  if (this.shadowRoot && this.tagName.toLowerCase() === 'nx-div') {
@@ -21,12 +21,16 @@ class nxButtons extends nxDiv {
21
21
  @import "https://cdn.jsdelivr.net/npm/ninegrid@${ninegrid.version}/dist/css/nxButtons.css";
22
22
  ${ninegrid.getCustomPath(this,"nxButtons.css")}
23
23
  </style>
24
- <slot></slot>
24
+ <div id="container"></div>
25
25
  `;
26
26
 
27
- console.log(htmlTmpl);
28
-
29
27
  target.appendChild(htmlTmpl.content.cloneNode(true));
28
+
29
+ // 2. 대피시켰던 원본 노드들을 다시 목적지에 집어넣습니다.
30
+ const container = target.querySelector('#container');
31
+ if (this.fragment) {
32
+ container.appendChild(this.fragment); // 원본 그대로 복구!
33
+ }
30
34
  }
31
35
  }
32
36