ninegrid2 6.1374.0 → 6.1376.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.
@@ -28481,8 +28481,12 @@ class nxDiv extends HTMLElement {
28481
28481
  if (!key) return;
28482
28482
 
28483
28483
  let value;
28484
- if (el.tagName === "INPUT" && (el.type === "checkbox" || el.type === "radio")) {
28485
- value = el.checked;
28484
+ if (el.tagName === "INPUT" && el.type === "checkbox") {
28485
+ let t = el.getAttribute("true-value") || "Y";
28486
+ let f = el.getAttribute("false-value") || "N";
28487
+ value = el.checked ? t : f;
28488
+ } else if (el.tagName === "INPUT" && el.type === "radio") {
28489
+ value = el.value;
28486
28490
  } else {
28487
28491
  value = el.value;
28488
28492
  }
@@ -28513,11 +28517,16 @@ class nxDiv extends HTMLElement {
28513
28517
  if (!key || !jsonData.hasOwnProperty(key)) return;
28514
28518
 
28515
28519
  const value = jsonData[key];
28516
-
28517
28520
  const inputTags = ["INPUT", "TEXTAREA", "SELECT", "NX-EDITOR"];
28518
28521
 
28519
28522
  if (inputTags.includes(el.tagName)) {
28520
- if (el.type === "checkbox" || el.type === "radio") {
28523
+ if (el.type === "checkbox") {
28524
+ let t = el.getAttribute("true-value") || "Y";
28525
+ el.getAttribute("false-value") || "N";
28526
+ const isChecked = (t === String(value));
28527
+ if (el.checked !== isChecked) bChanged = true;
28528
+ el.checked = isChecked;
28529
+ } else if (el.type === "radio") {
28521
28530
  const isChecked = (String(el.value) === String(value));
28522
28531
  if (el.checked !== isChecked) bChanged = true;
28523
28532
  el.checked = isChecked;
@@ -28477,8 +28477,12 @@ class nxDiv extends HTMLElement {
28477
28477
  if (!key) return;
28478
28478
 
28479
28479
  let value;
28480
- if (el.tagName === "INPUT" && (el.type === "checkbox" || el.type === "radio")) {
28481
- value = el.checked;
28480
+ if (el.tagName === "INPUT" && el.type === "checkbox") {
28481
+ let t = el.getAttribute("true-value") || "Y";
28482
+ let f = el.getAttribute("false-value") || "N";
28483
+ value = el.checked ? t : f;
28484
+ } else if (el.tagName === "INPUT" && el.type === "radio") {
28485
+ value = el.value;
28482
28486
  } else {
28483
28487
  value = el.value;
28484
28488
  }
@@ -28509,11 +28513,16 @@ class nxDiv extends HTMLElement {
28509
28513
  if (!key || !jsonData.hasOwnProperty(key)) return;
28510
28514
 
28511
28515
  const value = jsonData[key];
28512
-
28513
28516
  const inputTags = ["INPUT", "TEXTAREA", "SELECT", "NX-EDITOR"];
28514
28517
 
28515
28518
  if (inputTags.includes(el.tagName)) {
28516
- if (el.type === "checkbox" || el.type === "radio") {
28519
+ if (el.type === "checkbox") {
28520
+ let t = el.getAttribute("true-value") || "Y";
28521
+ el.getAttribute("false-value") || "N";
28522
+ const isChecked = (t === String(value));
28523
+ if (el.checked !== isChecked) bChanged = true;
28524
+ el.checked = isChecked;
28525
+ } else if (el.type === "radio") {
28517
28526
  const isChecked = (String(el.value) === String(value));
28518
28527
  if (el.checked !== isChecked) bChanged = true;
28519
28528
  el.checked = isChecked;
package/dist/nx/_nxDiv.js CHANGED
@@ -48,8 +48,12 @@ export class nxDiv extends HTMLElement {
48
48
  if (!key) return;
49
49
 
50
50
  let value;
51
- if (el.tagName === "INPUT" && (el.type === "checkbox" || el.type === "radio")) {
52
- value = el.checked;
51
+ if (el.tagName === "INPUT" && el.type === "checkbox") {
52
+ let t = el.getAttribute("true-value") || "Y";
53
+ let f = el.getAttribute("false-value") || "N";
54
+ value = el.checked ? t : f;
55
+ } else if (el.tagName === "INPUT" && el.type === "radio") {
56
+ value = el.value;
53
57
  } else {
54
58
  value = el.value;
55
59
  }
@@ -80,11 +84,16 @@ export class nxDiv extends HTMLElement {
80
84
  if (!key || !jsonData.hasOwnProperty(key)) return;
81
85
 
82
86
  const value = jsonData[key];
83
-
84
87
  const inputTags = ["INPUT", "TEXTAREA", "SELECT", "NX-EDITOR"];
85
88
 
86
89
  if (inputTags.includes(el.tagName)) {
87
- if (el.type === "checkbox" || el.type === "radio") {
90
+ if (el.type === "checkbox") {
91
+ let t = el.getAttribute("true-value") || "Y";
92
+ let f = el.getAttribute("false-value") || "N";
93
+ const isChecked = (t === String(value));
94
+ if (el.checked !== isChecked) bChanged = true;
95
+ el.checked = isChecked;
96
+ } else if (el.type === "radio") {
88
97
  const isChecked = (String(el.value) === String(value));
89
98
  if (el.checked !== isChecked) bChanged = true;
90
99
  el.checked = isChecked;
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "ninegrid2",
3
3
  "type": "module",
4
- "version": "6.1374.0",
4
+ "version": "6.1376.0",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
7
7
  "exports": {
package/src/nx/_nxDiv.js CHANGED
@@ -48,8 +48,12 @@ export class nxDiv extends HTMLElement {
48
48
  if (!key) return;
49
49
 
50
50
  let value;
51
- if (el.tagName === "INPUT" && (el.type === "checkbox" || el.type === "radio")) {
52
- value = el.checked;
51
+ if (el.tagName === "INPUT" && el.type === "checkbox") {
52
+ let t = el.getAttribute("true-value") || "Y";
53
+ let f = el.getAttribute("false-value") || "N";
54
+ value = el.checked ? t : f;
55
+ } else if (el.tagName === "INPUT" && el.type === "radio") {
56
+ value = el.value;
53
57
  } else {
54
58
  value = el.value;
55
59
  }
@@ -80,11 +84,16 @@ export class nxDiv extends HTMLElement {
80
84
  if (!key || !jsonData.hasOwnProperty(key)) return;
81
85
 
82
86
  const value = jsonData[key];
83
-
84
87
  const inputTags = ["INPUT", "TEXTAREA", "SELECT", "NX-EDITOR"];
85
88
 
86
89
  if (inputTags.includes(el.tagName)) {
87
- if (el.type === "checkbox" || el.type === "radio") {
90
+ if (el.type === "checkbox") {
91
+ let t = el.getAttribute("true-value") || "Y";
92
+ let f = el.getAttribute("false-value") || "N";
93
+ const isChecked = (t === String(value));
94
+ if (el.checked !== isChecked) bChanged = true;
95
+ el.checked = isChecked;
96
+ } else if (el.type === "radio") {
88
97
  const isChecked = (String(el.value) === String(value));
89
98
  if (el.checked !== isChecked) bChanged = true;
90
99
  el.checked = isChecked;