gd-bs 6.6.7 → 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/build/components/checkboxGroup/index.js +11 -8
- package/build/components/dropdown/index.js +1 -0
- package/dist/gd-bs-icons.js +1 -1
- package/dist/gd-bs-icons.min.js +1 -1
- package/dist/gd-bs.js +1 -1
- package/dist/gd-bs.min.js +1 -1
- package/package.json +1 -1
- package/src/components/checkboxGroup/index.ts +13 -9
- package/src/components/dropdown/index.ts +1 -0
package/package.json
CHANGED
|
@@ -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
|
|
|
@@ -419,6 +419,7 @@ class _Dropdown extends Base<IDropdownProps> implements IDropdown {
|
|
|
419
419
|
el: menu,
|
|
420
420
|
items: cbItems,
|
|
421
421
|
multi: this.props.multi,
|
|
422
|
+
value: this.props.value,
|
|
422
423
|
onChange: this.props.onChange ? (values, ev) => {
|
|
423
424
|
// Pass the current values
|
|
424
425
|
this.props.onChange(this.getValue(), ev);
|