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.
- package/build/components/button/index.js +9 -1
- package/build/components/navbar/index.js +11 -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 +2 -2
- package/pnpm-lock.yaml +4 -4
- package/src/components/button/index.ts +11 -1
- package/src/components/navbar/index.ts +13 -0
- package/src/components/navbar/types.d.ts +1 -0
|
@@ -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
|