ninegrid2 6.1253.0 → 6.1256.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.
- package/dist/bundle.cjs.js +20 -26
- package/dist/bundle.esm.js +20 -26
- package/dist/nx/_nxDiv.js +20 -26
- package/package.json +1 -1
- package/src/nx/_nxDiv.js +20 -26
package/dist/bundle.cjs.js
CHANGED
|
@@ -121841,12 +121841,13 @@ customElements.define("nx-title", nxTitle);
|
|
|
121841
121841
|
class nxDiv extends HTMLElement {
|
|
121842
121842
|
originContents;
|
|
121843
121843
|
#isInitialized = false;
|
|
121844
|
-
#root; //
|
|
121844
|
+
#root; // 탐색 및 렌더링 대상 (shadowRoot 또는 this)
|
|
121845
121845
|
|
|
121846
121846
|
constructor() {
|
|
121847
121847
|
super();
|
|
121848
|
-
// 1.
|
|
121849
|
-
|
|
121848
|
+
// 1. 옵션 확인 (기본값은 shadow 사용하지 않는 기존 방식처럼 동작 가능하게 설정)
|
|
121849
|
+
// 만약 기존 소스 그대로 shadow를 쓰고 싶다면 true로, 아니면 속성 체크
|
|
121850
|
+
const useShadow = this.getAttribute("use-shadow") === "true";
|
|
121850
121851
|
|
|
121851
121852
|
if (useShadow) {
|
|
121852
121853
|
this.attachShadow({ mode: 'open' });
|
|
@@ -121865,16 +121866,16 @@ class nxDiv extends HTMLElement {
|
|
|
121865
121866
|
return false;
|
|
121866
121867
|
}
|
|
121867
121868
|
|
|
121868
|
-
//
|
|
121869
|
-
#getElements() {
|
|
121870
|
-
return ninegrid.querySelectorAll("input[name], textarea[name], select[name]", this.#root);
|
|
121871
|
-
}
|
|
121872
|
-
|
|
121873
|
-
// 자식 클래스에서 접근할 수 있도록 getter 제공
|
|
121869
|
+
// 자식에서 접근 가능한 root getter
|
|
121874
121870
|
get root() {
|
|
121875
121871
|
return this.#root;
|
|
121876
121872
|
}
|
|
121877
121873
|
|
|
121874
|
+
// root에 따라 엘리먼트 탐색
|
|
121875
|
+
#getElements() {
|
|
121876
|
+
return ninegrid.querySelectorAll("input[name], textarea[name], select[name]", this.#root);
|
|
121877
|
+
}
|
|
121878
|
+
|
|
121878
121879
|
getData = () => {
|
|
121879
121880
|
const jsonData = {};
|
|
121880
121881
|
this.#getElements().forEach(el => {
|
|
@@ -121914,9 +121915,8 @@ class nxDiv extends HTMLElement {
|
|
|
121914
121915
|
const value = jsonData[key];
|
|
121915
121916
|
if (el.tagName === "INPUT" || el.tagName === "TEXTAREA" || el.tagName === "SELECT") {
|
|
121916
121917
|
if (el.type === "checkbox" || el.type === "radio") {
|
|
121917
|
-
|
|
121918
|
-
|
|
121919
|
-
el.checked = isChecked;
|
|
121918
|
+
if (el.checked !== (el.value === String(value))) bChanged = true;
|
|
121919
|
+
el.checked = (el.value === String(value));
|
|
121920
121920
|
} else {
|
|
121921
121921
|
if (el.value !== value) bChanged = true;
|
|
121922
121922
|
el.value = value;
|
|
@@ -121926,7 +121926,6 @@ class nxDiv extends HTMLElement {
|
|
|
121926
121926
|
el.textContent = value;
|
|
121927
121927
|
}
|
|
121928
121928
|
});
|
|
121929
|
-
|
|
121930
121929
|
if (bChanged) this.#changed(bChanged);
|
|
121931
121930
|
};
|
|
121932
121931
|
|
|
@@ -121955,25 +121954,20 @@ class nxDiv extends HTMLElement {
|
|
|
121955
121954
|
}
|
|
121956
121955
|
}
|
|
121957
121956
|
|
|
121958
|
-
// 2. 이미
|
|
121959
|
-
if (this.shadowRoot && this.shadowRoot.innerHTML
|
|
121960
|
-
return; // 이미 내용이 있으면 중복 실행 방지
|
|
121961
|
-
}
|
|
121957
|
+
// 2. 중요: 이미 데이터가 옮겨졌거나 초기화 중복 실행 방지
|
|
121958
|
+
if (this.shadowRoot && this.shadowRoot.innerHTML !== "") return;
|
|
121962
121959
|
|
|
121963
|
-
// 3. HTML
|
|
121960
|
+
// 3. 내부 HTML 보관
|
|
121964
121961
|
this.originContents = this.innerHTML.trim();
|
|
121965
121962
|
|
|
121963
|
+
// 4. Shadow DOM 사용 시에만 비우고 옮기기
|
|
121966
121964
|
if (this.shadowRoot) {
|
|
121967
|
-
//
|
|
121968
|
-
//
|
|
121969
|
-
|
|
121970
|
-
if (this.shadowRoot.innerHTML === "") {
|
|
121965
|
+
// 자식 클래스(nxButtons 등)에서 내용을 직접 구성할 수 있도록
|
|
121966
|
+
// 태그 종류에 따라 선별적으로 내용을 넣어줌
|
|
121967
|
+
if (this.tagName.toLowerCase() === 'nx-div') {
|
|
121971
121968
|
this.shadowRoot.innerHTML = this.originContents;
|
|
121972
121969
|
}
|
|
121973
|
-
|
|
121974
|
-
// 중요: React가 다시 자식을 채우지 않도록 비우되,
|
|
121975
|
-
// 하위 클래스에서 처리할 수 있도록 보존만 합니다.
|
|
121976
|
-
this.innerHTML = "";
|
|
121970
|
+
this.innerHTML = ""; // Light DOM 비움
|
|
121977
121971
|
}
|
|
121978
121972
|
};
|
|
121979
121973
|
}
|
package/dist/bundle.esm.js
CHANGED
|
@@ -121837,12 +121837,13 @@ customElements.define("nx-title", nxTitle);
|
|
|
121837
121837
|
class nxDiv extends HTMLElement {
|
|
121838
121838
|
originContents;
|
|
121839
121839
|
#isInitialized = false;
|
|
121840
|
-
#root; //
|
|
121840
|
+
#root; // 탐색 및 렌더링 대상 (shadowRoot 또는 this)
|
|
121841
121841
|
|
|
121842
121842
|
constructor() {
|
|
121843
121843
|
super();
|
|
121844
|
-
// 1.
|
|
121845
|
-
|
|
121844
|
+
// 1. 옵션 확인 (기본값은 shadow 사용하지 않는 기존 방식처럼 동작 가능하게 설정)
|
|
121845
|
+
// 만약 기존 소스 그대로 shadow를 쓰고 싶다면 true로, 아니면 속성 체크
|
|
121846
|
+
const useShadow = this.getAttribute("use-shadow") === "true";
|
|
121846
121847
|
|
|
121847
121848
|
if (useShadow) {
|
|
121848
121849
|
this.attachShadow({ mode: 'open' });
|
|
@@ -121861,16 +121862,16 @@ class nxDiv extends HTMLElement {
|
|
|
121861
121862
|
return false;
|
|
121862
121863
|
}
|
|
121863
121864
|
|
|
121864
|
-
//
|
|
121865
|
-
#getElements() {
|
|
121866
|
-
return ninegrid.querySelectorAll("input[name], textarea[name], select[name]", this.#root);
|
|
121867
|
-
}
|
|
121868
|
-
|
|
121869
|
-
// 자식 클래스에서 접근할 수 있도록 getter 제공
|
|
121865
|
+
// 자식에서 접근 가능한 root getter
|
|
121870
121866
|
get root() {
|
|
121871
121867
|
return this.#root;
|
|
121872
121868
|
}
|
|
121873
121869
|
|
|
121870
|
+
// root에 따라 엘리먼트 탐색
|
|
121871
|
+
#getElements() {
|
|
121872
|
+
return ninegrid.querySelectorAll("input[name], textarea[name], select[name]", this.#root);
|
|
121873
|
+
}
|
|
121874
|
+
|
|
121874
121875
|
getData = () => {
|
|
121875
121876
|
const jsonData = {};
|
|
121876
121877
|
this.#getElements().forEach(el => {
|
|
@@ -121910,9 +121911,8 @@ class nxDiv extends HTMLElement {
|
|
|
121910
121911
|
const value = jsonData[key];
|
|
121911
121912
|
if (el.tagName === "INPUT" || el.tagName === "TEXTAREA" || el.tagName === "SELECT") {
|
|
121912
121913
|
if (el.type === "checkbox" || el.type === "radio") {
|
|
121913
|
-
|
|
121914
|
-
|
|
121915
|
-
el.checked = isChecked;
|
|
121914
|
+
if (el.checked !== (el.value === String(value))) bChanged = true;
|
|
121915
|
+
el.checked = (el.value === String(value));
|
|
121916
121916
|
} else {
|
|
121917
121917
|
if (el.value !== value) bChanged = true;
|
|
121918
121918
|
el.value = value;
|
|
@@ -121922,7 +121922,6 @@ class nxDiv extends HTMLElement {
|
|
|
121922
121922
|
el.textContent = value;
|
|
121923
121923
|
}
|
|
121924
121924
|
});
|
|
121925
|
-
|
|
121926
121925
|
if (bChanged) this.#changed(bChanged);
|
|
121927
121926
|
};
|
|
121928
121927
|
|
|
@@ -121951,25 +121950,20 @@ class nxDiv extends HTMLElement {
|
|
|
121951
121950
|
}
|
|
121952
121951
|
}
|
|
121953
121952
|
|
|
121954
|
-
// 2. 이미
|
|
121955
|
-
if (this.shadowRoot && this.shadowRoot.innerHTML
|
|
121956
|
-
return; // 이미 내용이 있으면 중복 실행 방지
|
|
121957
|
-
}
|
|
121953
|
+
// 2. 중요: 이미 데이터가 옮겨졌거나 초기화 중복 실행 방지
|
|
121954
|
+
if (this.shadowRoot && this.shadowRoot.innerHTML !== "") return;
|
|
121958
121955
|
|
|
121959
|
-
// 3. HTML
|
|
121956
|
+
// 3. 내부 HTML 보관
|
|
121960
121957
|
this.originContents = this.innerHTML.trim();
|
|
121961
121958
|
|
|
121959
|
+
// 4. Shadow DOM 사용 시에만 비우고 옮기기
|
|
121962
121960
|
if (this.shadowRoot) {
|
|
121963
|
-
//
|
|
121964
|
-
//
|
|
121965
|
-
|
|
121966
|
-
if (this.shadowRoot.innerHTML === "") {
|
|
121961
|
+
// 자식 클래스(nxButtons 등)에서 내용을 직접 구성할 수 있도록
|
|
121962
|
+
// 태그 종류에 따라 선별적으로 내용을 넣어줌
|
|
121963
|
+
if (this.tagName.toLowerCase() === 'nx-div') {
|
|
121967
121964
|
this.shadowRoot.innerHTML = this.originContents;
|
|
121968
121965
|
}
|
|
121969
|
-
|
|
121970
|
-
// 중요: React가 다시 자식을 채우지 않도록 비우되,
|
|
121971
|
-
// 하위 클래스에서 처리할 수 있도록 보존만 합니다.
|
|
121972
|
-
this.innerHTML = "";
|
|
121966
|
+
this.innerHTML = ""; // Light DOM 비움
|
|
121973
121967
|
}
|
|
121974
121968
|
};
|
|
121975
121969
|
}
|
package/dist/nx/_nxDiv.js
CHANGED
|
@@ -3,12 +3,13 @@ import ninegrid from "../index.js";
|
|
|
3
3
|
export class nxDiv extends HTMLElement {
|
|
4
4
|
originContents;
|
|
5
5
|
#isInitialized = false;
|
|
6
|
-
#root; //
|
|
6
|
+
#root; // 탐색 및 렌더링 대상 (shadowRoot 또는 this)
|
|
7
7
|
|
|
8
8
|
constructor() {
|
|
9
9
|
super();
|
|
10
|
-
// 1.
|
|
11
|
-
|
|
10
|
+
// 1. 옵션 확인 (기본값은 shadow 사용하지 않는 기존 방식처럼 동작 가능하게 설정)
|
|
11
|
+
// 만약 기존 소스 그대로 shadow를 쓰고 싶다면 true로, 아니면 속성 체크
|
|
12
|
+
const useShadow = this.getAttribute("use-shadow") === "true";
|
|
12
13
|
|
|
13
14
|
if (useShadow) {
|
|
14
15
|
this.attachShadow({ mode: 'open' });
|
|
@@ -27,16 +28,16 @@ export class nxDiv extends HTMLElement {
|
|
|
27
28
|
return false;
|
|
28
29
|
}
|
|
29
30
|
|
|
30
|
-
//
|
|
31
|
-
#getElements() {
|
|
32
|
-
return ninegrid.querySelectorAll("input[name], textarea[name], select[name]", this.#root);
|
|
33
|
-
}
|
|
34
|
-
|
|
35
|
-
// 자식 클래스에서 접근할 수 있도록 getter 제공
|
|
31
|
+
// 자식에서 접근 가능한 root getter
|
|
36
32
|
get root() {
|
|
37
33
|
return this.#root;
|
|
38
34
|
}
|
|
39
35
|
|
|
36
|
+
// root에 따라 엘리먼트 탐색
|
|
37
|
+
#getElements() {
|
|
38
|
+
return ninegrid.querySelectorAll("input[name], textarea[name], select[name]", this.#root);
|
|
39
|
+
}
|
|
40
|
+
|
|
40
41
|
getData = () => {
|
|
41
42
|
const jsonData = {};
|
|
42
43
|
this.#getElements().forEach(el => {
|
|
@@ -76,9 +77,8 @@ export class nxDiv extends HTMLElement {
|
|
|
76
77
|
const value = jsonData[key];
|
|
77
78
|
if (el.tagName === "INPUT" || el.tagName === "TEXTAREA" || el.tagName === "SELECT") {
|
|
78
79
|
if (el.type === "checkbox" || el.type === "radio") {
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
el.checked = isChecked;
|
|
80
|
+
if (el.checked !== (el.value === String(value))) bChanged = true;
|
|
81
|
+
el.checked = (el.value === String(value));
|
|
82
82
|
} else {
|
|
83
83
|
if (el.value !== value) bChanged = true;
|
|
84
84
|
el.value = value;
|
|
@@ -88,7 +88,6 @@ export class nxDiv extends HTMLElement {
|
|
|
88
88
|
el.textContent = value;
|
|
89
89
|
}
|
|
90
90
|
});
|
|
91
|
-
|
|
92
91
|
if (bChanged) this.#changed(bChanged);
|
|
93
92
|
};
|
|
94
93
|
|
|
@@ -117,25 +116,20 @@ export class nxDiv extends HTMLElement {
|
|
|
117
116
|
}
|
|
118
117
|
}
|
|
119
118
|
|
|
120
|
-
// 2. 이미
|
|
121
|
-
if (this.shadowRoot && this.shadowRoot.innerHTML
|
|
122
|
-
return; // 이미 내용이 있으면 중복 실행 방지
|
|
123
|
-
}
|
|
119
|
+
// 2. 중요: 이미 데이터가 옮겨졌거나 초기화 중복 실행 방지
|
|
120
|
+
if (this.shadowRoot && this.shadowRoot.innerHTML !== "") return;
|
|
124
121
|
|
|
125
|
-
// 3. HTML
|
|
122
|
+
// 3. 내부 HTML 보관
|
|
126
123
|
this.originContents = this.innerHTML.trim();
|
|
127
124
|
|
|
125
|
+
// 4. Shadow DOM 사용 시에만 비우고 옮기기
|
|
128
126
|
if (this.shadowRoot) {
|
|
129
|
-
//
|
|
130
|
-
//
|
|
131
|
-
|
|
132
|
-
if (this.shadowRoot.innerHTML === "") {
|
|
127
|
+
// 자식 클래스(nxButtons 등)에서 내용을 직접 구성할 수 있도록
|
|
128
|
+
// 태그 종류에 따라 선별적으로 내용을 넣어줌
|
|
129
|
+
if (this.tagName.toLowerCase() === 'nx-div') {
|
|
133
130
|
this.shadowRoot.innerHTML = this.originContents;
|
|
134
131
|
}
|
|
135
|
-
|
|
136
|
-
// 중요: React가 다시 자식을 채우지 않도록 비우되,
|
|
137
|
-
// 하위 클래스에서 처리할 수 있도록 보존만 합니다.
|
|
138
|
-
this.innerHTML = "";
|
|
132
|
+
this.innerHTML = ""; // Light DOM 비움
|
|
139
133
|
}
|
|
140
134
|
};
|
|
141
135
|
}
|
package/package.json
CHANGED
package/src/nx/_nxDiv.js
CHANGED
|
@@ -3,12 +3,13 @@ import ninegrid from "../index.js";
|
|
|
3
3
|
export class nxDiv extends HTMLElement {
|
|
4
4
|
originContents;
|
|
5
5
|
#isInitialized = false;
|
|
6
|
-
#root; //
|
|
6
|
+
#root; // 탐색 및 렌더링 대상 (shadowRoot 또는 this)
|
|
7
7
|
|
|
8
8
|
constructor() {
|
|
9
9
|
super();
|
|
10
|
-
// 1.
|
|
11
|
-
|
|
10
|
+
// 1. 옵션 확인 (기본값은 shadow 사용하지 않는 기존 방식처럼 동작 가능하게 설정)
|
|
11
|
+
// 만약 기존 소스 그대로 shadow를 쓰고 싶다면 true로, 아니면 속성 체크
|
|
12
|
+
const useShadow = this.getAttribute("use-shadow") === "true";
|
|
12
13
|
|
|
13
14
|
if (useShadow) {
|
|
14
15
|
this.attachShadow({ mode: 'open' });
|
|
@@ -27,16 +28,16 @@ export class nxDiv extends HTMLElement {
|
|
|
27
28
|
return false;
|
|
28
29
|
}
|
|
29
30
|
|
|
30
|
-
//
|
|
31
|
-
#getElements() {
|
|
32
|
-
return ninegrid.querySelectorAll("input[name], textarea[name], select[name]", this.#root);
|
|
33
|
-
}
|
|
34
|
-
|
|
35
|
-
// 자식 클래스에서 접근할 수 있도록 getter 제공
|
|
31
|
+
// 자식에서 접근 가능한 root getter
|
|
36
32
|
get root() {
|
|
37
33
|
return this.#root;
|
|
38
34
|
}
|
|
39
35
|
|
|
36
|
+
// root에 따라 엘리먼트 탐색
|
|
37
|
+
#getElements() {
|
|
38
|
+
return ninegrid.querySelectorAll("input[name], textarea[name], select[name]", this.#root);
|
|
39
|
+
}
|
|
40
|
+
|
|
40
41
|
getData = () => {
|
|
41
42
|
const jsonData = {};
|
|
42
43
|
this.#getElements().forEach(el => {
|
|
@@ -76,9 +77,8 @@ export class nxDiv extends HTMLElement {
|
|
|
76
77
|
const value = jsonData[key];
|
|
77
78
|
if (el.tagName === "INPUT" || el.tagName === "TEXTAREA" || el.tagName === "SELECT") {
|
|
78
79
|
if (el.type === "checkbox" || el.type === "radio") {
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
el.checked = isChecked;
|
|
80
|
+
if (el.checked !== (el.value === String(value))) bChanged = true;
|
|
81
|
+
el.checked = (el.value === String(value));
|
|
82
82
|
} else {
|
|
83
83
|
if (el.value !== value) bChanged = true;
|
|
84
84
|
el.value = value;
|
|
@@ -88,7 +88,6 @@ export class nxDiv extends HTMLElement {
|
|
|
88
88
|
el.textContent = value;
|
|
89
89
|
}
|
|
90
90
|
});
|
|
91
|
-
|
|
92
91
|
if (bChanged) this.#changed(bChanged);
|
|
93
92
|
};
|
|
94
93
|
|
|
@@ -117,25 +116,20 @@ export class nxDiv extends HTMLElement {
|
|
|
117
116
|
}
|
|
118
117
|
}
|
|
119
118
|
|
|
120
|
-
// 2. 이미
|
|
121
|
-
if (this.shadowRoot && this.shadowRoot.innerHTML
|
|
122
|
-
return; // 이미 내용이 있으면 중복 실행 방지
|
|
123
|
-
}
|
|
119
|
+
// 2. 중요: 이미 데이터가 옮겨졌거나 초기화 중복 실행 방지
|
|
120
|
+
if (this.shadowRoot && this.shadowRoot.innerHTML !== "") return;
|
|
124
121
|
|
|
125
|
-
// 3. HTML
|
|
122
|
+
// 3. 내부 HTML 보관
|
|
126
123
|
this.originContents = this.innerHTML.trim();
|
|
127
124
|
|
|
125
|
+
// 4. Shadow DOM 사용 시에만 비우고 옮기기
|
|
128
126
|
if (this.shadowRoot) {
|
|
129
|
-
//
|
|
130
|
-
//
|
|
131
|
-
|
|
132
|
-
if (this.shadowRoot.innerHTML === "") {
|
|
127
|
+
// 자식 클래스(nxButtons 등)에서 내용을 직접 구성할 수 있도록
|
|
128
|
+
// 태그 종류에 따라 선별적으로 내용을 넣어줌
|
|
129
|
+
if (this.tagName.toLowerCase() === 'nx-div') {
|
|
133
130
|
this.shadowRoot.innerHTML = this.originContents;
|
|
134
131
|
}
|
|
135
|
-
|
|
136
|
-
// 중요: React가 다시 자식을 채우지 않도록 비우되,
|
|
137
|
-
// 하위 클래스에서 처리할 수 있도록 보존만 합니다.
|
|
138
|
-
this.innerHTML = "";
|
|
132
|
+
this.innerHTML = ""; // Light DOM 비움
|
|
139
133
|
}
|
|
140
134
|
};
|
|
141
135
|
}
|