gd-bs 6.6.10 → 6.6.12

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.10",
3
+ "version": "6.6.12",
4
4
  "description": "Bootstrap JavaScript, TypeScript and Web Components library.",
5
5
  "main": "build/index.js",
6
6
  "typings": "src/index.d.ts",
@@ -396,7 +396,7 @@ class _Dropdown extends Base<IDropdownProps> implements IDropdown {
396
396
  }
397
397
 
398
398
  // Generates the checkbox value
399
- private generateCheckboxValue(currentValues: string | string[]): string[] {
399
+ private generateCheckboxValue(currentValues: string | string[] | IDropdownItem[]): string[] {
400
400
  let values: string[] = [];
401
401
 
402
402
  // Ensure a value exists
@@ -410,15 +410,26 @@ class _Dropdown extends Base<IDropdownProps> implements IDropdown {
410
410
 
411
411
  // Parse the current values
412
412
  for (let i = 0; i < currentValues.length; i++) {
413
- let value = currentValues[i];
413
+ let currentValue = currentValues[i];
414
+ let currentItem: IDropdownItem = {};
415
+
416
+ // See if this is a string
417
+ if (typeof (currentValue) == "string") {
418
+ // Set the text and value properties
419
+ currentItem.text = currentValue;
420
+ currentItem.value = currentValue;
421
+ } else {
422
+ // Set the item
423
+ currentItem = currentValue;
424
+ }
414
425
 
415
426
  // Find the item
416
427
  let item = this.props.items?.find((item) => {
417
428
  // Match by the text property if the value doesn't exist
418
- if (typeof (item.value) === undefined) { return item.text == value; }
429
+ if (typeof (item.value) === undefined) { return item.text == currentItem.text; }
419
430
 
420
431
  // See if the value property matches
421
- return item.value == value;
432
+ return item.value == currentItem.value;
422
433
  });
423
434
 
424
435
  // See if an item was found