ninegrid2 6.1387.0 → 6.1388.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 +41 -28
- package/dist/bundle.esm.js +41 -28
- package/dist/nx/_nxDiv.js +41 -28
- package/package.json +1 -1
- package/src/nx/_nxDiv.js +41 -28
package/dist/bundle.cjs.js
CHANGED
|
@@ -28474,6 +28474,41 @@ class nxDiv extends HTMLElement {
|
|
|
28474
28474
|
return ninegrid.querySelectorAll("input[name], textarea[name], select[name], nx-editor[name]", this.#root);
|
|
28475
28475
|
}
|
|
28476
28476
|
|
|
28477
|
+
// [공통 로직 1] 특정 요소에 값을 쓰거나 초기화하는 핵심 함수
|
|
28478
|
+
#updateElement(el, value) {
|
|
28479
|
+
const tagName = el.tagName.toUpperCase();
|
|
28480
|
+
const type = el.type;
|
|
28481
|
+
let isChanged = false;
|
|
28482
|
+
|
|
28483
|
+
if (["INPUT", "TEXTAREA", "SELECT", "NX-EDITOR"].includes(tagName)) {
|
|
28484
|
+
if (type === "checkbox") {
|
|
28485
|
+
const t = el.getAttribute("true-value") || "Y";
|
|
28486
|
+
const isChecked = (String(t) === String(value));
|
|
28487
|
+
if (el.checked !== isChecked) isChanged = true;
|
|
28488
|
+
el.checked = isChecked;
|
|
28489
|
+
} else if (type === "radio") {
|
|
28490
|
+
const isChecked = (String(el.value) === String(value));
|
|
28491
|
+
if (el.checked !== isChecked) isChanged = true;
|
|
28492
|
+
el.checked = isChecked;
|
|
28493
|
+
} else {
|
|
28494
|
+
if (el.value !== value) isChanged = true;
|
|
28495
|
+
el.value = value;
|
|
28496
|
+
}
|
|
28497
|
+
} else {
|
|
28498
|
+
if (el.textContent !== value) isChanged = true;
|
|
28499
|
+
el.textContent = value;
|
|
28500
|
+
}
|
|
28501
|
+
return isChanged;
|
|
28502
|
+
}
|
|
28503
|
+
|
|
28504
|
+
// [공통 로직 2] 이벤트 리스너 일괄 등록
|
|
28505
|
+
#refreshListeners() {
|
|
28506
|
+
this.#getElements().forEach(el => {
|
|
28507
|
+
el.removeEventListener("input", this.#changeHandler);
|
|
28508
|
+
el.addEventListener("input", this.#changeHandler);
|
|
28509
|
+
});
|
|
28510
|
+
}
|
|
28511
|
+
|
|
28477
28512
|
getData = () => {
|
|
28478
28513
|
const jsonData = {};
|
|
28479
28514
|
this.#getElements().forEach(el => {
|
|
@@ -28501,36 +28536,14 @@ class nxDiv extends HTMLElement {
|
|
|
28501
28536
|
return jsonData;
|
|
28502
28537
|
};
|
|
28503
28538
|
|
|
28504
|
-
|
|
28505
|
-
|
|
28506
|
-
|
|
28507
|
-
el.addEventListener("input", this.#changeHandler);
|
|
28508
|
-
});
|
|
28509
|
-
|
|
28510
|
-
//if (!jsonData || typeof jsonData !== 'object') return;
|
|
28511
|
-
|
|
28512
|
-
//let bChanged = false;
|
|
28539
|
+
// 파라미터가 있으면 해당 값으로, 없으면 전체 공백 초기화
|
|
28540
|
+
clearData = (jsonData = {}) => {
|
|
28541
|
+
this.#refreshListeners();
|
|
28513
28542
|
this.#getElements().forEach(el => {
|
|
28514
28543
|
const key = el.name;
|
|
28515
|
-
|
|
28516
|
-
|
|
28517
|
-
|
|
28518
|
-
const inputTags = ["INPUT", "TEXTAREA", "SELECT", "NX-EDITOR"];
|
|
28519
|
-
|
|
28520
|
-
if (inputTags.includes(el.tagName)) {
|
|
28521
|
-
if (el.type === "checkbox") {
|
|
28522
|
-
let t = el.getAttribute("true-value") || "Y";
|
|
28523
|
-
const isChecked = (t === String(value));
|
|
28524
|
-
|
|
28525
|
-
el.checked = isChecked;
|
|
28526
|
-
} else if (el.type === "radio") {
|
|
28527
|
-
el.value = value;
|
|
28528
|
-
} else {
|
|
28529
|
-
el.value = value;
|
|
28530
|
-
}
|
|
28531
|
-
} else {
|
|
28532
|
-
el.textContent = value;
|
|
28533
|
-
}
|
|
28544
|
+
if (!key) return;
|
|
28545
|
+
const val = (jsonData && jsonData[key] !== undefined) ? jsonData[key] : "";
|
|
28546
|
+
this.#updateElement(el, val);
|
|
28534
28547
|
});
|
|
28535
28548
|
this.#changed(false);
|
|
28536
28549
|
};
|
package/dist/bundle.esm.js
CHANGED
|
@@ -28470,6 +28470,41 @@ class nxDiv extends HTMLElement {
|
|
|
28470
28470
|
return ninegrid.querySelectorAll("input[name], textarea[name], select[name], nx-editor[name]", this.#root);
|
|
28471
28471
|
}
|
|
28472
28472
|
|
|
28473
|
+
// [공통 로직 1] 특정 요소에 값을 쓰거나 초기화하는 핵심 함수
|
|
28474
|
+
#updateElement(el, value) {
|
|
28475
|
+
const tagName = el.tagName.toUpperCase();
|
|
28476
|
+
const type = el.type;
|
|
28477
|
+
let isChanged = false;
|
|
28478
|
+
|
|
28479
|
+
if (["INPUT", "TEXTAREA", "SELECT", "NX-EDITOR"].includes(tagName)) {
|
|
28480
|
+
if (type === "checkbox") {
|
|
28481
|
+
const t = el.getAttribute("true-value") || "Y";
|
|
28482
|
+
const isChecked = (String(t) === String(value));
|
|
28483
|
+
if (el.checked !== isChecked) isChanged = true;
|
|
28484
|
+
el.checked = isChecked;
|
|
28485
|
+
} else if (type === "radio") {
|
|
28486
|
+
const isChecked = (String(el.value) === String(value));
|
|
28487
|
+
if (el.checked !== isChecked) isChanged = true;
|
|
28488
|
+
el.checked = isChecked;
|
|
28489
|
+
} else {
|
|
28490
|
+
if (el.value !== value) isChanged = true;
|
|
28491
|
+
el.value = value;
|
|
28492
|
+
}
|
|
28493
|
+
} else {
|
|
28494
|
+
if (el.textContent !== value) isChanged = true;
|
|
28495
|
+
el.textContent = value;
|
|
28496
|
+
}
|
|
28497
|
+
return isChanged;
|
|
28498
|
+
}
|
|
28499
|
+
|
|
28500
|
+
// [공통 로직 2] 이벤트 리스너 일괄 등록
|
|
28501
|
+
#refreshListeners() {
|
|
28502
|
+
this.#getElements().forEach(el => {
|
|
28503
|
+
el.removeEventListener("input", this.#changeHandler);
|
|
28504
|
+
el.addEventListener("input", this.#changeHandler);
|
|
28505
|
+
});
|
|
28506
|
+
}
|
|
28507
|
+
|
|
28473
28508
|
getData = () => {
|
|
28474
28509
|
const jsonData = {};
|
|
28475
28510
|
this.#getElements().forEach(el => {
|
|
@@ -28497,36 +28532,14 @@ class nxDiv extends HTMLElement {
|
|
|
28497
28532
|
return jsonData;
|
|
28498
28533
|
};
|
|
28499
28534
|
|
|
28500
|
-
|
|
28501
|
-
|
|
28502
|
-
|
|
28503
|
-
el.addEventListener("input", this.#changeHandler);
|
|
28504
|
-
});
|
|
28505
|
-
|
|
28506
|
-
//if (!jsonData || typeof jsonData !== 'object') return;
|
|
28507
|
-
|
|
28508
|
-
//let bChanged = false;
|
|
28535
|
+
// 파라미터가 있으면 해당 값으로, 없으면 전체 공백 초기화
|
|
28536
|
+
clearData = (jsonData = {}) => {
|
|
28537
|
+
this.#refreshListeners();
|
|
28509
28538
|
this.#getElements().forEach(el => {
|
|
28510
28539
|
const key = el.name;
|
|
28511
|
-
|
|
28512
|
-
|
|
28513
|
-
|
|
28514
|
-
const inputTags = ["INPUT", "TEXTAREA", "SELECT", "NX-EDITOR"];
|
|
28515
|
-
|
|
28516
|
-
if (inputTags.includes(el.tagName)) {
|
|
28517
|
-
if (el.type === "checkbox") {
|
|
28518
|
-
let t = el.getAttribute("true-value") || "Y";
|
|
28519
|
-
const isChecked = (t === String(value));
|
|
28520
|
-
|
|
28521
|
-
el.checked = isChecked;
|
|
28522
|
-
} else if (el.type === "radio") {
|
|
28523
|
-
el.value = value;
|
|
28524
|
-
} else {
|
|
28525
|
-
el.value = value;
|
|
28526
|
-
}
|
|
28527
|
-
} else {
|
|
28528
|
-
el.textContent = value;
|
|
28529
|
-
}
|
|
28540
|
+
if (!key) return;
|
|
28541
|
+
const val = (jsonData && jsonData[key] !== undefined) ? jsonData[key] : "";
|
|
28542
|
+
this.#updateElement(el, val);
|
|
28530
28543
|
});
|
|
28531
28544
|
this.#changed(false);
|
|
28532
28545
|
};
|
package/dist/nx/_nxDiv.js
CHANGED
|
@@ -41,6 +41,41 @@ export class nxDiv extends HTMLElement {
|
|
|
41
41
|
return ninegrid.querySelectorAll("input[name], textarea[name], select[name], nx-editor[name]", this.#root);
|
|
42
42
|
}
|
|
43
43
|
|
|
44
|
+
// [공통 로직 1] 특정 요소에 값을 쓰거나 초기화하는 핵심 함수
|
|
45
|
+
#updateElement(el, value) {
|
|
46
|
+
const tagName = el.tagName.toUpperCase();
|
|
47
|
+
const type = el.type;
|
|
48
|
+
let isChanged = false;
|
|
49
|
+
|
|
50
|
+
if (["INPUT", "TEXTAREA", "SELECT", "NX-EDITOR"].includes(tagName)) {
|
|
51
|
+
if (type === "checkbox") {
|
|
52
|
+
const t = el.getAttribute("true-value") || "Y";
|
|
53
|
+
const isChecked = (String(t) === String(value));
|
|
54
|
+
if (el.checked !== isChecked) isChanged = true;
|
|
55
|
+
el.checked = isChecked;
|
|
56
|
+
} else if (type === "radio") {
|
|
57
|
+
const isChecked = (String(el.value) === String(value));
|
|
58
|
+
if (el.checked !== isChecked) isChanged = true;
|
|
59
|
+
el.checked = isChecked;
|
|
60
|
+
} else {
|
|
61
|
+
if (el.value !== value) isChanged = true;
|
|
62
|
+
el.value = value;
|
|
63
|
+
}
|
|
64
|
+
} else {
|
|
65
|
+
if (el.textContent !== value) isChanged = true;
|
|
66
|
+
el.textContent = value;
|
|
67
|
+
}
|
|
68
|
+
return isChanged;
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
// [공통 로직 2] 이벤트 리스너 일괄 등록
|
|
72
|
+
#refreshListeners() {
|
|
73
|
+
this.#getElements().forEach(el => {
|
|
74
|
+
el.removeEventListener("input", this.#changeHandler);
|
|
75
|
+
el.addEventListener("input", this.#changeHandler);
|
|
76
|
+
});
|
|
77
|
+
}
|
|
78
|
+
|
|
44
79
|
getData = () => {
|
|
45
80
|
const jsonData = {};
|
|
46
81
|
this.#getElements().forEach(el => {
|
|
@@ -68,36 +103,14 @@ export class nxDiv extends HTMLElement {
|
|
|
68
103
|
return jsonData;
|
|
69
104
|
};
|
|
70
105
|
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
el.addEventListener("input", this.#changeHandler);
|
|
75
|
-
});
|
|
76
|
-
|
|
77
|
-
//if (!jsonData || typeof jsonData !== 'object') return;
|
|
78
|
-
|
|
79
|
-
//let bChanged = false;
|
|
106
|
+
// 파라미터가 있으면 해당 값으로, 없으면 전체 공백 초기화
|
|
107
|
+
clearData = (jsonData = {}) => {
|
|
108
|
+
this.#refreshListeners();
|
|
80
109
|
this.#getElements().forEach(el => {
|
|
81
110
|
const key = el.name;
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
const inputTags = ["INPUT", "TEXTAREA", "SELECT", "NX-EDITOR"];
|
|
86
|
-
|
|
87
|
-
if (inputTags.includes(el.tagName)) {
|
|
88
|
-
if (el.type === "checkbox") {
|
|
89
|
-
let t = el.getAttribute("true-value") || "Y";
|
|
90
|
-
const isChecked = (t === String(value));
|
|
91
|
-
|
|
92
|
-
el.checked = isChecked;
|
|
93
|
-
} else if (el.type === "radio") {
|
|
94
|
-
el.value = value;
|
|
95
|
-
} else {
|
|
96
|
-
el.value = value;
|
|
97
|
-
}
|
|
98
|
-
} else {
|
|
99
|
-
el.textContent = value;
|
|
100
|
-
}
|
|
111
|
+
if (!key) return;
|
|
112
|
+
const val = (jsonData && jsonData[key] !== undefined) ? jsonData[key] : "";
|
|
113
|
+
this.#updateElement(el, val);
|
|
101
114
|
});
|
|
102
115
|
this.#changed(false);
|
|
103
116
|
};
|
package/package.json
CHANGED
package/src/nx/_nxDiv.js
CHANGED
|
@@ -41,6 +41,41 @@ export class nxDiv extends HTMLElement {
|
|
|
41
41
|
return ninegrid.querySelectorAll("input[name], textarea[name], select[name], nx-editor[name]", this.#root);
|
|
42
42
|
}
|
|
43
43
|
|
|
44
|
+
// [공통 로직 1] 특정 요소에 값을 쓰거나 초기화하는 핵심 함수
|
|
45
|
+
#updateElement(el, value) {
|
|
46
|
+
const tagName = el.tagName.toUpperCase();
|
|
47
|
+
const type = el.type;
|
|
48
|
+
let isChanged = false;
|
|
49
|
+
|
|
50
|
+
if (["INPUT", "TEXTAREA", "SELECT", "NX-EDITOR"].includes(tagName)) {
|
|
51
|
+
if (type === "checkbox") {
|
|
52
|
+
const t = el.getAttribute("true-value") || "Y";
|
|
53
|
+
const isChecked = (String(t) === String(value));
|
|
54
|
+
if (el.checked !== isChecked) isChanged = true;
|
|
55
|
+
el.checked = isChecked;
|
|
56
|
+
} else if (type === "radio") {
|
|
57
|
+
const isChecked = (String(el.value) === String(value));
|
|
58
|
+
if (el.checked !== isChecked) isChanged = true;
|
|
59
|
+
el.checked = isChecked;
|
|
60
|
+
} else {
|
|
61
|
+
if (el.value !== value) isChanged = true;
|
|
62
|
+
el.value = value;
|
|
63
|
+
}
|
|
64
|
+
} else {
|
|
65
|
+
if (el.textContent !== value) isChanged = true;
|
|
66
|
+
el.textContent = value;
|
|
67
|
+
}
|
|
68
|
+
return isChanged;
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
// [공통 로직 2] 이벤트 리스너 일괄 등록
|
|
72
|
+
#refreshListeners() {
|
|
73
|
+
this.#getElements().forEach(el => {
|
|
74
|
+
el.removeEventListener("input", this.#changeHandler);
|
|
75
|
+
el.addEventListener("input", this.#changeHandler);
|
|
76
|
+
});
|
|
77
|
+
}
|
|
78
|
+
|
|
44
79
|
getData = () => {
|
|
45
80
|
const jsonData = {};
|
|
46
81
|
this.#getElements().forEach(el => {
|
|
@@ -68,36 +103,14 @@ export class nxDiv extends HTMLElement {
|
|
|
68
103
|
return jsonData;
|
|
69
104
|
};
|
|
70
105
|
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
el.addEventListener("input", this.#changeHandler);
|
|
75
|
-
});
|
|
76
|
-
|
|
77
|
-
//if (!jsonData || typeof jsonData !== 'object') return;
|
|
78
|
-
|
|
79
|
-
//let bChanged = false;
|
|
106
|
+
// 파라미터가 있으면 해당 값으로, 없으면 전체 공백 초기화
|
|
107
|
+
clearData = (jsonData = {}) => {
|
|
108
|
+
this.#refreshListeners();
|
|
80
109
|
this.#getElements().forEach(el => {
|
|
81
110
|
const key = el.name;
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
const inputTags = ["INPUT", "TEXTAREA", "SELECT", "NX-EDITOR"];
|
|
86
|
-
|
|
87
|
-
if (inputTags.includes(el.tagName)) {
|
|
88
|
-
if (el.type === "checkbox") {
|
|
89
|
-
let t = el.getAttribute("true-value") || "Y";
|
|
90
|
-
const isChecked = (t === String(value));
|
|
91
|
-
|
|
92
|
-
el.checked = isChecked;
|
|
93
|
-
} else if (el.type === "radio") {
|
|
94
|
-
el.value = value;
|
|
95
|
-
} else {
|
|
96
|
-
el.value = value;
|
|
97
|
-
}
|
|
98
|
-
} else {
|
|
99
|
-
el.textContent = value;
|
|
100
|
-
}
|
|
111
|
+
if (!key) return;
|
|
112
|
+
const val = (jsonData && jsonData[key] !== undefined) ? jsonData[key] : "";
|
|
113
|
+
this.#updateElement(el, val);
|
|
101
114
|
});
|
|
102
115
|
this.#changed(false);
|
|
103
116
|
};
|