ninegrid2 6.1250.0 → 6.1251.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.
@@ -121948,22 +121948,33 @@ class nxDiv extends HTMLElement {
121948
121948
  }
121949
121949
 
121950
121950
  #init = () => {
121951
- // CSS Style 적용
121951
+ // 1. CSS Style 적용
121952
121952
  for (const attr of this.attributes) {
121953
121953
  if (attr.name.startsWith("css-")) {
121954
121954
  this.style.setProperty(attr.name.substring(4), attr.value);
121955
121955
  }
121956
121956
  }
121957
121957
 
121958
- // 2. HTML 내용 처리
121958
+ // 2. 이미 초기화가 완료되었거나 내용이 옮겨졌는지 확인
121959
+ if (this.shadowRoot && this.shadowRoot.innerHTML.trim() !== "") {
121960
+ return; // 이미 내용이 있으면 중복 실행 방지
121961
+ }
121962
+
121963
+ // 3. HTML 내용 처리
121959
121964
  this.originContents = this.innerHTML.trim();
121960
121965
 
121961
- // Shadow DOM을 사용할 경우 내용을 안으로 옮김
121962
121966
  if (this.shadowRoot) {
121963
- this.shadowRoot.innerHTML = this.originContents;
121964
- this.innerHTML = ""; // 외부(Light DOM) 내용은 비움
121967
+ // Shadow DOM 모드일 때
121968
+ // 만약 자식 클래스에서 별도 템플릿을 그린다면 여기서는 비워두거나
121969
+ // 기본 뼈대만 잡아야 합니다.
121970
+ if (this.shadowRoot.innerHTML === "") {
121971
+ this.shadowRoot.innerHTML = this.originContents;
121972
+ }
121973
+
121974
+ // 중요: React가 다시 자식을 채우지 않도록 비우되,
121975
+ // 하위 클래스에서 처리할 수 있도록 보존만 합니다.
121976
+ this.innerHTML = "";
121965
121977
  }
121966
- // Shadow DOM을 안 쓰면 그대로 유지 (this.#root가 this이므로 별도 처리 불필요)
121967
121978
  };
121968
121979
  }
121969
121980
 
@@ -122266,7 +122277,7 @@ class nxButtons extends nxDiv {
122266
122277
  ${ninegrid.getCustomPath(this, "nxButtons.css")}
122267
122278
  </style>
122268
122279
  `;
122269
- console.log("11111");
122280
+
122270
122281
  const htmlTmpl = document.createElement("template");
122271
122282
 
122272
122283
  // Shadow DOM일 때는 originContents를 옮겨야 하고,
@@ -121944,22 +121944,33 @@ class nxDiv extends HTMLElement {
121944
121944
  }
121945
121945
 
121946
121946
  #init = () => {
121947
- // CSS Style 적용
121947
+ // 1. CSS Style 적용
121948
121948
  for (const attr of this.attributes) {
121949
121949
  if (attr.name.startsWith("css-")) {
121950
121950
  this.style.setProperty(attr.name.substring(4), attr.value);
121951
121951
  }
121952
121952
  }
121953
121953
 
121954
- // 2. HTML 내용 처리
121954
+ // 2. 이미 초기화가 완료되었거나 내용이 옮겨졌는지 확인
121955
+ if (this.shadowRoot && this.shadowRoot.innerHTML.trim() !== "") {
121956
+ return; // 이미 내용이 있으면 중복 실행 방지
121957
+ }
121958
+
121959
+ // 3. HTML 내용 처리
121955
121960
  this.originContents = this.innerHTML.trim();
121956
121961
 
121957
- // Shadow DOM을 사용할 경우 내용을 안으로 옮김
121958
121962
  if (this.shadowRoot) {
121959
- this.shadowRoot.innerHTML = this.originContents;
121960
- this.innerHTML = ""; // 외부(Light DOM) 내용은 비움
121963
+ // Shadow DOM 모드일 때
121964
+ // 만약 자식 클래스에서 별도 템플릿을 그린다면 여기서는 비워두거나
121965
+ // 기본 뼈대만 잡아야 합니다.
121966
+ if (this.shadowRoot.innerHTML === "") {
121967
+ this.shadowRoot.innerHTML = this.originContents;
121968
+ }
121969
+
121970
+ // 중요: React가 다시 자식을 채우지 않도록 비우되,
121971
+ // 하위 클래스에서 처리할 수 있도록 보존만 합니다.
121972
+ this.innerHTML = "";
121961
121973
  }
121962
- // Shadow DOM을 안 쓰면 그대로 유지 (this.#root가 this이므로 별도 처리 불필요)
121963
121974
  };
121964
121975
  }
121965
121976
 
@@ -122262,7 +122273,7 @@ class nxButtons extends nxDiv {
122262
122273
  ${ninegrid.getCustomPath(this, "nxButtons.css")}
122263
122274
  </style>
122264
122275
  `;
122265
- console.log("11111");
122276
+
122266
122277
  const htmlTmpl = document.createElement("template");
122267
122278
 
122268
122279
  // Shadow DOM일 때는 originContents를 옮겨야 하고,
package/dist/nx/_nxDiv.js CHANGED
@@ -110,21 +110,32 @@ export class nxDiv extends HTMLElement {
110
110
  }
111
111
 
112
112
  #init = () => {
113
- // CSS Style 적용
113
+ // 1. CSS Style 적용
114
114
  for (const attr of this.attributes) {
115
115
  if (attr.name.startsWith("css-")) {
116
116
  this.style.setProperty(attr.name.substring(4), attr.value);
117
117
  }
118
118
  }
119
119
 
120
- // 2. HTML 내용 처리
120
+ // 2. 이미 초기화가 완료되었거나 내용이 옮겨졌는지 확인
121
+ if (this.shadowRoot && this.shadowRoot.innerHTML.trim() !== "") {
122
+ return; // 이미 내용이 있으면 중복 실행 방지
123
+ }
124
+
125
+ // 3. HTML 내용 처리
121
126
  this.originContents = this.innerHTML.trim();
122
127
 
123
- // Shadow DOM을 사용할 경우 내용을 안으로 옮김
124
128
  if (this.shadowRoot) {
125
- this.shadowRoot.innerHTML = this.originContents;
126
- this.innerHTML = ""; // 외부(Light DOM) 내용은 비움
129
+ // Shadow DOM 모드일 때
130
+ // 만약 자식 클래스에서 별도 템플릿을 그린다면 여기서는 비워두거나
131
+ // 기본 뼈대만 잡아야 합니다.
132
+ if (this.shadowRoot.innerHTML === "") {
133
+ this.shadowRoot.innerHTML = this.originContents;
134
+ }
135
+
136
+ // 중요: React가 다시 자식을 채우지 않도록 비우되,
137
+ // 하위 클래스에서 처리할 수 있도록 보존만 합니다.
138
+ this.innerHTML = "";
127
139
  }
128
- // Shadow DOM을 안 쓰면 그대로 유지 (this.#root가 this이므로 별도 처리 불필요)
129
140
  };
130
141
  }
@@ -18,7 +18,7 @@ class nxButtons extends nxDiv {
18
18
  ${ninegrid.getCustomPath(this, "nxButtons.css")}
19
19
  </style>
20
20
  `;
21
- console.log("11111")
21
+
22
22
  const htmlTmpl = document.createElement("template");
23
23
 
24
24
  // Shadow DOM일 때는 originContents를 옮겨야 하고,
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "ninegrid2",
3
3
  "type": "module",
4
- "version": "6.1250.0",
4
+ "version": "6.1251.0",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
7
7
  "exports": {
package/src/nx/_nxDiv.js CHANGED
@@ -110,21 +110,32 @@ export class nxDiv extends HTMLElement {
110
110
  }
111
111
 
112
112
  #init = () => {
113
- // CSS Style 적용
113
+ // 1. CSS Style 적용
114
114
  for (const attr of this.attributes) {
115
115
  if (attr.name.startsWith("css-")) {
116
116
  this.style.setProperty(attr.name.substring(4), attr.value);
117
117
  }
118
118
  }
119
119
 
120
- // 2. HTML 내용 처리
120
+ // 2. 이미 초기화가 완료되었거나 내용이 옮겨졌는지 확인
121
+ if (this.shadowRoot && this.shadowRoot.innerHTML.trim() !== "") {
122
+ return; // 이미 내용이 있으면 중복 실행 방지
123
+ }
124
+
125
+ // 3. HTML 내용 처리
121
126
  this.originContents = this.innerHTML.trim();
122
127
 
123
- // Shadow DOM을 사용할 경우 내용을 안으로 옮김
124
128
  if (this.shadowRoot) {
125
- this.shadowRoot.innerHTML = this.originContents;
126
- this.innerHTML = ""; // 외부(Light DOM) 내용은 비움
129
+ // Shadow DOM 모드일 때
130
+ // 만약 자식 클래스에서 별도 템플릿을 그린다면 여기서는 비워두거나
131
+ // 기본 뼈대만 잡아야 합니다.
132
+ if (this.shadowRoot.innerHTML === "") {
133
+ this.shadowRoot.innerHTML = this.originContents;
134
+ }
135
+
136
+ // 중요: React가 다시 자식을 채우지 않도록 비우되,
137
+ // 하위 클래스에서 처리할 수 있도록 보존만 합니다.
138
+ this.innerHTML = "";
127
139
  }
128
- // Shadow DOM을 안 쓰면 그대로 유지 (this.#root가 this이므로 별도 처리 불필요)
129
140
  };
130
141
  }
@@ -18,7 +18,7 @@ class nxButtons extends nxDiv {
18
18
  ${ninegrid.getCustomPath(this, "nxButtons.css")}
19
19
  </style>
20
20
  `;
21
- console.log("11111")
21
+
22
22
  const htmlTmpl = document.createElement("template");
23
23
 
24
24
  // Shadow DOM일 때는 originContents를 옮겨야 하고,