gd-bs 6.0.7 → 6.0.9

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.
@@ -196,16 +196,24 @@ var _Button = /** @class */ (function (_super) {
196
196
  // Sets the button text
197
197
  _Button.prototype.setText = function (btnText) {
198
198
  var elButton = this.el;
199
+ var existsFl = false;
199
200
  // Parse the child nodes
200
201
  for (var i = 0; i < elButton.childNodes.length; i++) {
201
202
  // See if this is the text element
202
203
  if (elButton.childNodes[i].nodeName == "#text") {
204
+ // Set the flag
205
+ existsFl = true;
203
206
  // Set the value
204
- elButton.childNodes[i].nodeValue = btnText;
207
+ elButton.childNodes[i].nodeValue = btnText || "";
205
208
  // Break from the loop
206
209
  break;
207
210
  }
208
211
  }
212
+ // See if it doesn't exist
213
+ if (!existsFl) {
214
+ // Add the text node
215
+ elButton.appendChild(document.createTextNode(btnText == null ? "" : btnText));
216
+ }
209
217
  };
210
218
  // Sets the button type
211
219
  _Button.prototype.setType = function (buttonType) {
@@ -264,6 +264,17 @@ var _Navbar = /** @class */ (function (_super) {
264
264
  /**
265
265
  * Public Methods
266
266
  */
267
+ // Returns the current search value
268
+ _Navbar.prototype.getSearchValue = function () {
269
+ // Get the searchbox element
270
+ var searchbox = this.el.querySelector("form input");
271
+ if (searchbox) {
272
+ // Return the value
273
+ return searchbox.value;
274
+ }
275
+ // Return nothing by default
276
+ return "";
277
+ };
267
278
  // Updates the navbar template type
268
279
  _Navbar.prototype.setType = function (navbarType) {
269
280
  // Remove the classes