gd-bs 6.6.8 → 6.6.9

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "gd-bs",
3
- "version": "6.6.8",
3
+ "version": "6.6.9",
4
4
  "description": "Bootstrap JavaScript, TypeScript and Web Components library.",
5
5
  "main": "build/index.js",
6
6
  "typings": "src/index.d.ts",
@@ -71,6 +71,9 @@ class _CheckboxGroup extends Base<ICheckboxGroupProps> implements ICheckboxGroup
71
71
 
72
72
  // Render the checkboxes
73
73
  this.renderItems();
74
+
75
+ // Set the value
76
+ this.setValue(this.props.value);
74
77
  }
75
78
 
76
79
  // Configure the events
@@ -122,15 +125,6 @@ class _CheckboxGroup extends Base<ICheckboxGroupProps> implements ICheckboxGroup
122
125
  });
123
126
  }
124
127
 
125
- // See if this is a single checkbox
126
- if (this.props.multi != true && items.length > 0) {
127
- // See if this checkbox should be checked
128
- if (typeof (this.props.value) === "boolean" && this.props.value) {
129
- // Select the item
130
- items[0].isSelected = true;
131
- }
132
- }
133
-
134
128
  // Parse the items
135
129
  for (let i = 0; i < items.length; i++) {
136
130
  let item = items[i];
@@ -189,6 +183,16 @@ class _CheckboxGroup extends Base<ICheckboxGroupProps> implements ICheckboxGroup
189
183
  // Method to set the value
190
184
  // Sets the dropdown value
191
185
  setValue(value) {
186
+ // See if this is a single checkbox
187
+ if (this.props.multi != true && this._checkboxes.length == 1) {
188
+ // See if this checkbox should be checked
189
+ if (typeof (value) === "boolean" && value) {
190
+ // Select the item
191
+ this._checkboxes[0].isChecked ? null : this._checkboxes[0].toggle();
192
+ }
193
+ return;
194
+ }
195
+
192
196
  // Ensure it's an array
193
197
  let values = value ? (typeof (value.length) === "number" && typeof (value) !== "string" ? value : [value]) : [];
194
198