gd-bs 6.6.34 → 6.6.36

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.
@@ -184,6 +184,7 @@ var _Dropdown = /** @class */ (function (_super) {
184
184
  if (menu) {
185
185
  // Add a change event
186
186
  menu.addEventListener("change", function (ev) {
187
+ var values = "";
187
188
  // See if multiple options are allowed
188
189
  if (_this.props.multi == true) {
189
190
  // See if we are selecting the values
@@ -193,6 +194,8 @@ var _Dropdown = /** @class */ (function (_super) {
193
194
  var item = _this._items[i];
194
195
  // Update the flag
195
196
  item.isSelected = item.el.selected;
197
+ // Append the value
198
+ values = (values ? ", " : "") + (item.props.text || item.props.value);
196
199
  }
197
200
  }
198
201
  // Call the change event
@@ -201,6 +204,8 @@ var _Dropdown = /** @class */ (function (_super) {
201
204
  else {
202
205
  // Get the selected value
203
206
  var selectedValue = (ev.target.value || "").trim();
207
+ // Set the selected value
208
+ values = selectedValue;
204
209
  // Parse the items
205
210
  for (var i = 0; i < _this._items.length; i++) {
206
211
  var item = _this._items[i];
@@ -223,6 +228,14 @@ var _Dropdown = /** @class */ (function (_super) {
223
228
  }
224
229
  }
225
230
  }
231
+ // See if we are updating the label
232
+ if (_this.props.updateLabel) {
233
+ // Set the label
234
+ var toggle_1 = _this.el.querySelector(".dropdown-toggle");
235
+ if (toggle_1) {
236
+ toggle_1.innerHTML = values || _this.props.label;
237
+ }
238
+ }
226
239
  });
227
240
  }
228
241
  // Get the toggle
@@ -515,8 +515,10 @@ var FormControl = /** @class */ (function () {
515
515
  // See if there is a custom type
516
516
  var custom = custom_1.CustomControls.getByType(this._props.type);
517
517
  if (custom && typeof (custom) === "function") {
518
+ // Set the default value
519
+ this._props.value = this._props.value || value;
518
520
  // Execute the event
519
- this._custom = custom(__assign(__assign({}, this._props), { value: value }), this._formProps);
521
+ this._custom = custom(this._props, this._formProps);
520
522
  }
521
523
  break;
522
524
  }