ninegrid2 6.1373.0 → 6.1375.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,7 +28481,11 @@ 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")) {
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") {
28485
28489
  value = el.checked;
28486
28490
  } else {
28487
28491
  value = el.value;
@@ -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;
@@ -28613,9 +28622,7 @@ class nxTitle2 extends nxDiv {
28613
28622
  <span>${caption}</span>
28614
28623
  </div>
28615
28624
 
28616
- <div part="nx-title2-panel">
28617
- <slot></slot>
28618
- </div>
28625
+ <slot></slot>
28619
28626
  `;
28620
28627
 
28621
28628
  this.shadowRoot.appendChild(htmlTmpl.content.cloneNode(true));
@@ -28902,17 +28909,9 @@ class nxButtons extends nxDiv {
28902
28909
  <style>
28903
28910
  @import "https://cdn.jsdelivr.net/npm/ninegrid@${ninegrid.version}/dist/css/nxButtons.css";
28904
28911
  ${ninegrid.getCustomPath(this,"nxButtons.css")}
28905
-
28906
- ::slotted(button[slot="sss"]) {
28907
- background: red;
28908
- padding: 4px 12px;
28909
- border: 1px solid green;
28910
- }
28911
28912
  </style>
28912
28913
 
28913
- <div part="nx-buttons-part">
28914
- <slot name="sss"></slot>
28915
- </div>
28914
+ <slot></slot>
28916
28915
  `;
28917
28916
 
28918
28917
  target.appendChild(htmlTmpl.content.cloneNode(true));
@@ -28477,7 +28477,11 @@ 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")) {
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") {
28481
28485
  value = el.checked;
28482
28486
  } else {
28483
28487
  value = el.value;
@@ -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;
@@ -28609,9 +28618,7 @@ class nxTitle2 extends nxDiv {
28609
28618
  <span>${caption}</span>
28610
28619
  </div>
28611
28620
 
28612
- <div part="nx-title2-panel">
28613
- <slot></slot>
28614
- </div>
28621
+ <slot></slot>
28615
28622
  `;
28616
28623
 
28617
28624
  this.shadowRoot.appendChild(htmlTmpl.content.cloneNode(true));
@@ -28898,17 +28905,9 @@ class nxButtons extends nxDiv {
28898
28905
  <style>
28899
28906
  @import "https://cdn.jsdelivr.net/npm/ninegrid@${ninegrid.version}/dist/css/nxButtons.css";
28900
28907
  ${ninegrid.getCustomPath(this,"nxButtons.css")}
28901
-
28902
- ::slotted(button[slot="sss"]) {
28903
- background: red;
28904
- padding: 4px 12px;
28905
- border: 1px solid green;
28906
- }
28907
28908
  </style>
28908
28909
 
28909
- <div part="nx-buttons-part">
28910
- <slot name="sss"></slot>
28911
- </div>
28910
+ <slot></slot>
28912
28911
  `;
28913
28912
 
28914
28913
  target.appendChild(htmlTmpl.content.cloneNode(true));
package/dist/nx/_nxDiv.js CHANGED
@@ -48,7 +48,11 @@ 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")) {
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") {
52
56
  value = el.checked;
53
57
  } else {
54
58
  value = el.value;
@@ -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;
@@ -20,17 +20,9 @@ class nxButtons extends nxDiv {
20
20
  <style>
21
21
  @import "https://cdn.jsdelivr.net/npm/ninegrid@${ninegrid.version}/dist/css/nxButtons.css";
22
22
  ${ninegrid.getCustomPath(this,"nxButtons.css")}
23
-
24
- ::slotted(button[slot="sss"]) {
25
- background: red;
26
- padding: 4px 12px;
27
- border: 1px solid green;
28
- }
29
23
  </style>
30
24
 
31
- <div part="nx-buttons-part">
32
- <slot name="sss"></slot>
33
- </div>
25
+ <slot></slot>
34
26
  `;
35
27
 
36
28
  target.appendChild(htmlTmpl.content.cloneNode(true));
@@ -35,9 +35,7 @@ class nxTitle2 extends nxDiv {
35
35
  <span>${caption}</span>
36
36
  </div>
37
37
 
38
- <div part="nx-title2-panel">
39
- <slot></slot>
40
- </div>
38
+ <slot></slot>
41
39
  `;
42
40
 
43
41
  this.shadowRoot.appendChild(htmlTmpl.content.cloneNode(true));
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "ninegrid2",
3
3
  "type": "module",
4
- "version": "6.1373.0",
4
+ "version": "6.1375.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;
@@ -20,17 +20,9 @@ class nxButtons extends nxDiv {
20
20
  <style>
21
21
  @import "https://cdn.jsdelivr.net/npm/ninegrid@${ninegrid.version}/dist/css/nxButtons.css";
22
22
  ${ninegrid.getCustomPath(this,"nxButtons.css")}
23
-
24
- ::slotted(button[slot="sss"]) {
25
- background: red;
26
- padding: 4px 12px;
27
- border: 1px solid green;
28
- }
29
23
  </style>
30
24
 
31
- <div part="nx-buttons-part">
32
- <slot name="sss"></slot>
33
- </div>
25
+ <slot></slot>
34
26
  `;
35
27
 
36
28
  target.appendChild(htmlTmpl.content.cloneNode(true));
@@ -35,9 +35,7 @@ class nxTitle2 extends nxDiv {
35
35
  <span>${caption}</span>
36
36
  </div>
37
37
 
38
- <div part="nx-title2-panel">
39
- <slot></slot>
40
- </div>
38
+ <slot></slot>
41
39
  `;
42
40
 
43
41
  this.shadowRoot.appendChild(htmlTmpl.content.cloneNode(true));