gd-bs 6.6.40 → 6.6.42

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/index.html CHANGED
@@ -1351,6 +1351,7 @@
1351
1351
  });
1352
1352
  window["navbar"] = GD.Components.Navbar({
1353
1353
  el: document.querySelector("#navbar"),
1354
+ brand: "Test",
1354
1355
  onClick: function(item) {
1355
1356
  // Log
1356
1357
  console.log("Nav Item Clicked: " + item.text);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "gd-bs",
3
- "version": "6.6.40",
3
+ "version": "6.6.42",
4
4
  "description": "Bootstrap JavaScript, TypeScript and Web Components library.",
5
5
  "main": "build/index.js",
6
6
  "typings": "src/index.d.ts",
@@ -631,8 +631,14 @@ export class FormControl implements IFormControl {
631
631
  if (this._el) {
632
632
  // See if this is a row
633
633
  if (this._el.parentElement && this._el.parentElement.parentElement && this._el.parentElement.parentElement.classList.contains("row")) {
634
- // Hide the row element
635
- this._el.parentElement.parentElement.classList.add("d-none");
634
+ // See if there are other controls in this row
635
+ if (this._el.parentElement.parentElement.querySelectorAll(".col").length > 1) {
636
+ // Hide the column element
637
+ this._el.parentElement.classList.add("d-none");
638
+ } else {
639
+ // Hide the row element
640
+ this._el.parentElement.parentElement.classList.add("d-none");
641
+ }
636
642
  }
637
643
  // Else, ensure the parent element exists
638
644
  else if (this._el.parentElement) {
@@ -734,8 +740,14 @@ export class FormControl implements IFormControl {
734
740
  if (this._el) {
735
741
  // See if this is a row
736
742
  if (this._el.parentElement && this._el.parentElement.parentElement && this._el.parentElement.parentElement.classList.contains("row")) {
737
- // Show the row element
738
- this._el.parentElement.parentElement.classList.remove("d-none");
743
+ // See if there are other controls in this row
744
+ if (this._el.parentElement.parentElement.querySelectorAll(".col").length > 1) {
745
+ // Show the column element
746
+ this._el.parentElement.classList.remove("d-none");
747
+ } else {
748
+ // Show the row element
749
+ this._el.parentElement.parentElement.classList.remove("d-none");
750
+ }
739
751
  }
740
752
  // Else, ensure the parent element exists
741
753
  else if (this._el.parentElement) {
@@ -40,19 +40,36 @@ class _Navbar extends Base<INavbarProps> implements INavbar {
40
40
 
41
41
  // Configure the card group
42
42
  private configure(itemTemplate: string) {
43
- // See if there is a brand
44
- let brand = this.el.querySelector(".navbar-brand") as HTMLAnchorElement;
45
- if (brand) {
46
- if (this.props.brand) {
43
+ // See if we are applying a brand
44
+ if (this.props.brand) {
45
+ let elBrand = this.el.querySelector("span.navbar-brand") as HTMLSpanElement;
46
+ let elBrandLink = this.el.querySelector("a.navbar-brand") as HTMLAnchorElement;
47
+
48
+ // See if we are using a link
49
+ if (this.props.brandUrl || this.props.onClickBrand) {
50
+ // Remove the element
51
+ elBrand ? elBrand.parentElement.removeChild(elBrand) : null;
52
+
47
53
  // Update the brand
48
- this.props.brandUrl ? brand.href = this.props.brandUrl : null;
54
+ elBrandLink ? elBrandLink.href = this.props.brandUrl : null;
49
55
 
50
56
  // Append the content
51
- appendContent(brand, this.props.brand);
57
+ appendContent(elBrandLink, this.props.brand);
52
58
  } else {
53
- // Remove the brand
54
- brand.parentNode.removeChild(brand);
59
+ // Remove the link element
60
+ elBrandLink ? elBrandLink.parentElement.removeChild(elBrandLink) : null;
61
+
62
+ // Append the content
63
+ appendContent(elBrand, this.props.brand);
55
64
  }
65
+ } else {
66
+ // Remove the brand link
67
+ let elBrandLink = this.el.querySelector("a.navbar-brand");
68
+ if (elBrandLink) { elBrandLink.parentNode.removeChild(elBrandLink); }
69
+
70
+ // Remove the brand element
71
+ let elBrand = this.el.querySelector("span.navbar-brand");
72
+ if (elBrand) { elBrand.parentNode.removeChild(elBrand); }
56
73
  }
57
74
 
58
75
  // Update the nav bar
@@ -3,6 +3,7 @@ export const HTML = `
3
3
  <nav class="navbar navbar-expand-lg">
4
4
  <div class="container-fluid">
5
5
  <a class="navbar-brand" href="#"></a>
6
+ <span class="navbar-brand mb-0 h1"></span>
6
7
  <button class="navbar-toggler" type="button" data-bs-toggle="collapse" aria-expanded="false"
7
8
  aria-label="Toggle Navigation">
8
9
  <span class="navbar-toggler-icon"></span>