gd-bs 6.6.35 → 6.6.37

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.
@@ -340,6 +340,20 @@ var _Dropdown = /** @class */ (function (_super) {
340
340
  selectedItem.toggle();
341
341
  }
342
342
  }
343
+ // See if we are updating the label
344
+ if (_this.props.updateLabel) {
345
+ var selectedItems = _this.getValue();
346
+ var selectedValues = [];
347
+ for (var i = 0; i < selectedItems.length; i++) {
348
+ // Append the value
349
+ selectedValues.push(selectedItems[i].text);
350
+ }
351
+ // Set the label
352
+ var toggle = _this.el.querySelector(".dropdown-toggle");
353
+ if (toggle) {
354
+ toggle.innerHTML = selectedValues.length > 0 ? selectedValues.join(', ') : _this.props.label;
355
+ }
356
+ }
343
357
  });
344
358
  }
345
359
  // Add a click event
@@ -353,6 +367,15 @@ var _Dropdown = /** @class */ (function (_super) {
353
367
  }
354
368
  // Execute the event
355
369
  _this.props.onChange ? _this.props.onChange(_this.getValue(), ev) : null;
370
+ // See if we are updating the label
371
+ if (_this.props.updateLabel) {
372
+ var selectedItem = _this.getValue();
373
+ // Set the label
374
+ var toggle = _this.el.querySelector(".dropdown-toggle");
375
+ if (toggle) {
376
+ toggle.innerHTML = selectedItem ? selectedItem.text : _this.props.label;
377
+ }
378
+ }
356
379
  });
357
380
  };
358
381
  // Configures the dropdown for a nav bar