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
package/package.json
CHANGED
|
@@ -167,6 +167,8 @@ class _Dropdown extends Base<IDropdownProps> implements IDropdown {
|
|
|
167
167
|
if (menu) {
|
|
168
168
|
// Add a change event
|
|
169
169
|
menu.addEventListener("change", ev => {
|
|
170
|
+
let values = "";
|
|
171
|
+
|
|
170
172
|
// See if multiple options are allowed
|
|
171
173
|
if (this.props.multi == true) {
|
|
172
174
|
// See if we are selecting the values
|
|
@@ -177,6 +179,9 @@ class _Dropdown extends Base<IDropdownProps> implements IDropdown {
|
|
|
177
179
|
|
|
178
180
|
// Update the flag
|
|
179
181
|
item.isSelected = (item.el as HTMLOptionElement).selected;
|
|
182
|
+
|
|
183
|
+
// Append the value
|
|
184
|
+
values = (values ? ", " : "") + (item.props.text || item.props.value);
|
|
180
185
|
}
|
|
181
186
|
}
|
|
182
187
|
|
|
@@ -186,6 +191,9 @@ class _Dropdown extends Base<IDropdownProps> implements IDropdown {
|
|
|
186
191
|
// Get the selected value
|
|
187
192
|
let selectedValue = ((ev.target as HTMLSelectElement).value || "").trim();
|
|
188
193
|
|
|
194
|
+
// Set the selected value
|
|
195
|
+
values = selectedValue;
|
|
196
|
+
|
|
189
197
|
// Parse the items
|
|
190
198
|
for (let i = 0; i < this._items.length; i++) {
|
|
191
199
|
let item = this._items[i];
|
|
@@ -206,6 +214,15 @@ class _Dropdown extends Base<IDropdownProps> implements IDropdown {
|
|
|
206
214
|
}
|
|
207
215
|
}
|
|
208
216
|
}
|
|
217
|
+
|
|
218
|
+
// See if we are updating the label
|
|
219
|
+
if (this.props.updateLabel) {
|
|
220
|
+
// Set the label
|
|
221
|
+
let toggle = this.el.querySelector(".dropdown-toggle");
|
|
222
|
+
if (toggle) {
|
|
223
|
+
toggle.innerHTML = values || this.props.label;
|
|
224
|
+
}
|
|
225
|
+
}
|
|
209
226
|
});
|
|
210
227
|
}
|
|
211
228
|
|