gd-bs 6.6.10 → 6.6.11

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.11",
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,25 @@ 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 property
419
+ currentItem.text = currentValue;
420
+ } else {
421
+ // Set the item
422
+ currentItem = currentValue;
423
+ }
414
424
 
415
425
  // Find the item
416
426
  let item = this.props.items?.find((item) => {
417
427
  // Match by the text property if the value doesn't exist
418
- if (typeof (item.value) === undefined) { return item.text == value; }
428
+ if (typeof (item.value) === undefined) { return item.text == currentItem.text; }
419
429
 
420
430
  // See if the value property matches
421
- return item.value == value;
431
+ return item.value == currentItem.value;
422
432
  });
423
433
 
424
434
  // See if an item was found