ninegrid2 6.1176.0 → 6.1178.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.
@@ -121858,6 +121858,7 @@ class nxDiv extends HTMLElement
121858
121858
  return;
121859
121859
  }
121860
121860
 
121861
+ let bChanged = false;
121861
121862
  ninegrid.querySelectorAll("input[name], textarea[name], select[name]", this.shadowRoot).forEach(el => {
121862
121863
  const key = el.name;
121863
121864
  if (!key || !jsonData.hasOwnProperty(key)) return;
@@ -121867,17 +121868,37 @@ class nxDiv extends HTMLElement
121867
121868
  // 폼 요소에만 데이터를 설정합니다.
121868
121869
  if (el.tagName === "INPUT" || el.tagName === "TEXTAREA" || el.tagName === "SELECT") {
121869
121870
  if (el.type === "checkbox" || el.type === "radio") {
121871
+ if (el.checked !== (el.value === String(value))) bChanged = true;
121870
121872
  el.checked = (el.value === String(value));
121871
121873
  } else {
121874
+ if (el.value !== value) bChanged = true;
121872
121875
  el.value = value;
121873
121876
  }
121874
121877
  } else {
121875
121878
  // 폼 요소가 아닌 경우, textContent를 사용합니다.
121879
+ if (el.textContent !== value) bChanged = true;
121876
121880
  el.textContent = value;
121877
121881
  }
121878
121882
  });
121883
+
121884
+ if (bChanged) this.#changed(bChanged);
121885
+ };
121886
+
121887
+ initData = (jsonData) => {
121888
+ this.setData(jsonData);
121889
+
121890
+ this.#changed(false);
121879
121891
  };
121880
121892
 
121893
+ #changed = (v) => {
121894
+ const parent = this.closest(".detail-wrapper");
121895
+ if (parent) {
121896
+ const el = parent.querySelector("nx-title2");
121897
+ if (el) el.changed = v;
121898
+ }
121899
+ }
121900
+
121901
+
121881
121902
  #init = () => {
121882
121903
 
121883
121904
  /**
@@ -121892,11 +121913,18 @@ class nxDiv extends HTMLElement
121892
121913
 
121893
121914
  this.originContents = this.innerHTML.trim();
121894
121915
  this.innerHTML = ""; // 기존 내부 HTML 제거
121916
+
121917
+ ninegrid.querySelectorAll("input[name], textarea[name], select[name]", this.originContents).forEach(el => {
121918
+ el.name;
121919
+ console.log(el);
121920
+ });
121895
121921
  };
121896
121922
  }
121897
121923
 
121898
121924
  class nxTitle2 extends nxDiv {
121899
121925
 
121926
+ #changed = false;
121927
+
121900
121928
  constructor() {
121901
121929
  super();
121902
121930
  }
@@ -121905,9 +121933,18 @@ class nxTitle2 extends nxDiv {
121905
121933
  if (super.connectedCallback()) this.#init();
121906
121934
  };
121907
121935
 
121936
+ get changed() {
121937
+ return this.#changed;
121938
+ };
121939
+ set changed(v) {
121940
+ this.#changed = v;
121941
+ v ? this.classList.add("changed") : this.classList.remove("changed");
121942
+ };
121943
+
121908
121944
  #init = () => {
121909
121945
  const caption = this.getAttribute("caption") || "";
121910
121946
  const htmlTmpl = document.createElement("template");
121947
+
121911
121948
  htmlTmpl.innerHTML = `
121912
121949
  <style>
121913
121950
  @import "https://cdn.jsdelivr.net/npm/ninegrid@${ninegrid.version}/dist/css/nxTitle2.css";
@@ -121854,6 +121854,7 @@ class nxDiv extends HTMLElement
121854
121854
  return;
121855
121855
  }
121856
121856
 
121857
+ let bChanged = false;
121857
121858
  ninegrid.querySelectorAll("input[name], textarea[name], select[name]", this.shadowRoot).forEach(el => {
121858
121859
  const key = el.name;
121859
121860
  if (!key || !jsonData.hasOwnProperty(key)) return;
@@ -121863,17 +121864,37 @@ class nxDiv extends HTMLElement
121863
121864
  // 폼 요소에만 데이터를 설정합니다.
121864
121865
  if (el.tagName === "INPUT" || el.tagName === "TEXTAREA" || el.tagName === "SELECT") {
121865
121866
  if (el.type === "checkbox" || el.type === "radio") {
121867
+ if (el.checked !== (el.value === String(value))) bChanged = true;
121866
121868
  el.checked = (el.value === String(value));
121867
121869
  } else {
121870
+ if (el.value !== value) bChanged = true;
121868
121871
  el.value = value;
121869
121872
  }
121870
121873
  } else {
121871
121874
  // 폼 요소가 아닌 경우, textContent를 사용합니다.
121875
+ if (el.textContent !== value) bChanged = true;
121872
121876
  el.textContent = value;
121873
121877
  }
121874
121878
  });
121879
+
121880
+ if (bChanged) this.#changed(bChanged);
121881
+ };
121882
+
121883
+ initData = (jsonData) => {
121884
+ this.setData(jsonData);
121885
+
121886
+ this.#changed(false);
121875
121887
  };
121876
121888
 
121889
+ #changed = (v) => {
121890
+ const parent = this.closest(".detail-wrapper");
121891
+ if (parent) {
121892
+ const el = parent.querySelector("nx-title2");
121893
+ if (el) el.changed = v;
121894
+ }
121895
+ }
121896
+
121897
+
121877
121898
  #init = () => {
121878
121899
 
121879
121900
  /**
@@ -121888,11 +121909,18 @@ class nxDiv extends HTMLElement
121888
121909
 
121889
121910
  this.originContents = this.innerHTML.trim();
121890
121911
  this.innerHTML = ""; // 기존 내부 HTML 제거
121912
+
121913
+ ninegrid.querySelectorAll("input[name], textarea[name], select[name]", this.originContents).forEach(el => {
121914
+ el.name;
121915
+ console.log(el);
121916
+ });
121891
121917
  };
121892
121918
  }
121893
121919
 
121894
121920
  class nxTitle2 extends nxDiv {
121895
121921
 
121922
+ #changed = false;
121923
+
121896
121924
  constructor() {
121897
121925
  super();
121898
121926
  }
@@ -121901,9 +121929,18 @@ class nxTitle2 extends nxDiv {
121901
121929
  if (super.connectedCallback()) this.#init();
121902
121930
  };
121903
121931
 
121932
+ get changed() {
121933
+ return this.#changed;
121934
+ };
121935
+ set changed(v) {
121936
+ this.#changed = v;
121937
+ v ? this.classList.add("changed") : this.classList.remove("changed");
121938
+ };
121939
+
121904
121940
  #init = () => {
121905
121941
  const caption = this.getAttribute("caption") || "";
121906
121942
  const htmlTmpl = document.createElement("template");
121943
+
121907
121944
  htmlTmpl.innerHTML = `
121908
121945
  <style>
121909
121946
  @import "https://cdn.jsdelivr.net/npm/ninegrid@${ninegrid.version}/dist/css/nxTitle2.css";
package/dist/nx/_nxDiv.js CHANGED
@@ -55,6 +55,7 @@ export class nxDiv extends HTMLElement
55
55
  return;
56
56
  }
57
57
 
58
+ let bChanged = false;
58
59
  ninegrid.querySelectorAll("input[name], textarea[name], select[name]", this.shadowRoot).forEach(el => {
59
60
  const key = el.name;
60
61
  if (!key || !jsonData.hasOwnProperty(key)) return;
@@ -64,17 +65,37 @@ export class nxDiv extends HTMLElement
64
65
  // 폼 요소에만 데이터를 설정합니다.
65
66
  if (el.tagName === "INPUT" || el.tagName === "TEXTAREA" || el.tagName === "SELECT") {
66
67
  if (el.type === "checkbox" || el.type === "radio") {
68
+ if (el.checked !== (el.value === String(value))) bChanged = true;
67
69
  el.checked = (el.value === String(value));
68
70
  } else {
71
+ if (el.value !== value) bChanged = true;
69
72
  el.value = value;
70
73
  }
71
74
  } else {
72
75
  // 폼 요소가 아닌 경우, textContent를 사용합니다.
76
+ if (el.textContent !== value) bChanged = true;
73
77
  el.textContent = value;
74
78
  }
75
79
  });
80
+
81
+ if (bChanged) this.#changed(bChanged);
82
+ };
83
+
84
+ initData = (jsonData) => {
85
+ this.setData(jsonData);
86
+
87
+ this.#changed(false);
76
88
  };
77
89
 
90
+ #changed = (v) => {
91
+ const parent = this.closest(".detail-wrapper");
92
+ if (parent) {
93
+ const el = parent.querySelector("nx-title2");
94
+ if (el) el.changed = v;
95
+ }
96
+ }
97
+
98
+
78
99
  #init = () => {
79
100
 
80
101
  /**
@@ -89,5 +110,10 @@ export class nxDiv extends HTMLElement
89
110
 
90
111
  this.originContents = this.innerHTML.trim();
91
112
  this.innerHTML = ""; // 기존 내부 HTML 제거
113
+
114
+ ninegrid.querySelectorAll("input[name], textarea[name], select[name]", this.originContents).forEach(el => {
115
+ const key = el.name;
116
+ console.log(el);
117
+ });
92
118
  };
93
119
  }
@@ -3,6 +3,8 @@ import {nxDiv} from "./_nxDiv.js";
3
3
 
4
4
  class nxTitle2 extends nxDiv {
5
5
 
6
+ #changed = false;
7
+
6
8
  constructor() {
7
9
  super();
8
10
  }
@@ -11,9 +13,18 @@ class nxTitle2 extends nxDiv {
11
13
  if (super.connectedCallback()) this.#init();
12
14
  };
13
15
 
16
+ get changed() {
17
+ return this.#changed;
18
+ };
19
+ set changed(v) {
20
+ this.#changed = v;
21
+ v ? this.classList.add("changed") : this.classList.remove("changed");
22
+ };
23
+
14
24
  #init = () => {
15
25
  const caption = this.getAttribute("caption") || "";
16
26
  const htmlTmpl = document.createElement("template");
27
+
17
28
  htmlTmpl.innerHTML = `
18
29
  <style>
19
30
  @import "https://cdn.jsdelivr.net/npm/ninegrid@${ninegrid.version}/dist/css/nxTitle2.css";
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "ninegrid2",
3
3
  "type": "module",
4
- "version": "6.1176.0",
4
+ "version": "6.1178.0",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
7
7
  "exports": {
package/src/nx/_nxDiv.js CHANGED
@@ -55,6 +55,7 @@ export class nxDiv extends HTMLElement
55
55
  return;
56
56
  }
57
57
 
58
+ let bChanged = false;
58
59
  ninegrid.querySelectorAll("input[name], textarea[name], select[name]", this.shadowRoot).forEach(el => {
59
60
  const key = el.name;
60
61
  if (!key || !jsonData.hasOwnProperty(key)) return;
@@ -64,17 +65,37 @@ export class nxDiv extends HTMLElement
64
65
  // 폼 요소에만 데이터를 설정합니다.
65
66
  if (el.tagName === "INPUT" || el.tagName === "TEXTAREA" || el.tagName === "SELECT") {
66
67
  if (el.type === "checkbox" || el.type === "radio") {
68
+ if (el.checked !== (el.value === String(value))) bChanged = true;
67
69
  el.checked = (el.value === String(value));
68
70
  } else {
71
+ if (el.value !== value) bChanged = true;
69
72
  el.value = value;
70
73
  }
71
74
  } else {
72
75
  // 폼 요소가 아닌 경우, textContent를 사용합니다.
76
+ if (el.textContent !== value) bChanged = true;
73
77
  el.textContent = value;
74
78
  }
75
79
  });
80
+
81
+ if (bChanged) this.#changed(bChanged);
82
+ };
83
+
84
+ initData = (jsonData) => {
85
+ this.setData(jsonData);
86
+
87
+ this.#changed(false);
76
88
  };
77
89
 
90
+ #changed = (v) => {
91
+ const parent = this.closest(".detail-wrapper");
92
+ if (parent) {
93
+ const el = parent.querySelector("nx-title2");
94
+ if (el) el.changed = v;
95
+ }
96
+ }
97
+
98
+
78
99
  #init = () => {
79
100
 
80
101
  /**
@@ -89,5 +110,10 @@ export class nxDiv extends HTMLElement
89
110
 
90
111
  this.originContents = this.innerHTML.trim();
91
112
  this.innerHTML = ""; // 기존 내부 HTML 제거
113
+
114
+ ninegrid.querySelectorAll("input[name], textarea[name], select[name]", this.originContents).forEach(el => {
115
+ const key = el.name;
116
+ console.log(el);
117
+ });
92
118
  };
93
119
  }
@@ -3,6 +3,8 @@ import {nxDiv} from "./_nxDiv.js";
3
3
 
4
4
  class nxTitle2 extends nxDiv {
5
5
 
6
+ #changed = false;
7
+
6
8
  constructor() {
7
9
  super();
8
10
  }
@@ -11,9 +13,18 @@ class nxTitle2 extends nxDiv {
11
13
  if (super.connectedCallback()) this.#init();
12
14
  };
13
15
 
16
+ get changed() {
17
+ return this.#changed;
18
+ };
19
+ set changed(v) {
20
+ this.#changed = v;
21
+ v ? this.classList.add("changed") : this.classList.remove("changed");
22
+ };
23
+
14
24
  #init = () => {
15
25
  const caption = this.getAttribute("caption") || "";
16
26
  const htmlTmpl = document.createElement("template");
27
+
17
28
  htmlTmpl.innerHTML = `
18
29
  <style>
19
30
  @import "https://cdn.jsdelivr.net/npm/ninegrid@${ninegrid.version}/dist/css/nxTitle2.css";