gd-bs 6.6.35 → 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.
- package/build/components/dropdown/index.js +13 -0
- package/dist/gd-bs-icons.js +1 -1
- package/dist/gd-bs-icons.min.js +1 -1
- package/dist/gd-bs.d.ts +1 -0
- package/dist/gd-bs.js +1 -1
- package/dist/gd-bs.min.js +1 -1
- package/package.json +1 -1
- package/src/components/dropdown/index.ts +17 -0
- package/src/components/dropdown/types.d.ts +1 -0
|
@@ -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
|