gd-bs 6.6.30 → 6.6.31
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/navbar/index.js +9 -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/index.html +10 -8
- package/package.json +1 -1
- package/src/components/navbar/index.ts +10 -0
- package/src/components/navbar/types.d.ts +1 -0
package/index.html
CHANGED
|
@@ -60,17 +60,19 @@
|
|
|
60
60
|
for (var i = 0; i < 10; i++) {
|
|
61
61
|
items.push({
|
|
62
62
|
data: i,
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
63
|
+
content: "Item " + i,
|
|
64
|
+
badge: {
|
|
65
|
+
data: i,
|
|
66
|
+
content: i,
|
|
67
|
+
onClick: (el, item) => {
|
|
68
|
+
alert("Item " + item.data + " clicked...");
|
|
69
|
+
}
|
|
70
|
+
}
|
|
66
71
|
});
|
|
67
72
|
}
|
|
68
|
-
window["
|
|
73
|
+
window["dev"] = GD.Components.ListGroup({
|
|
69
74
|
el: document.getElementById("dev"),
|
|
70
|
-
items: items
|
|
71
|
-
isCheckbox: false,
|
|
72
|
-
multi: true,
|
|
73
|
-
label: "CB Dropdown"
|
|
75
|
+
items: items
|
|
74
76
|
});
|
|
75
77
|
|
|
76
78
|
// Components
|
package/package.json
CHANGED
|
@@ -89,6 +89,16 @@ class _Navbar extends Base<INavbarProps> implements INavbar {
|
|
|
89
89
|
private configureEvents() {
|
|
90
90
|
let props = this.props.searchBox || {};
|
|
91
91
|
|
|
92
|
+
// See if the brand element and click event exist
|
|
93
|
+
let brand = this.el.querySelector(".navbar-brand") as HTMLAnchorElement;
|
|
94
|
+
if (brand && this.props.onClickBrand) {
|
|
95
|
+
// Set the click event
|
|
96
|
+
brand.addEventListener("click", ev => {
|
|
97
|
+
// Call the event
|
|
98
|
+
this.props.onClickBrand(brand, ev);
|
|
99
|
+
});
|
|
100
|
+
}
|
|
101
|
+
|
|
92
102
|
// See if search events exist
|
|
93
103
|
let searchbox = this.el.querySelector("form input") as HTMLInputElement;
|
|
94
104
|
if (searchbox) {
|
|
@@ -150,6 +150,7 @@ export interface INavbarProps<T = HTMLElement> extends IBaseProps<INavbar> {
|
|
|
150
150
|
items?: Array<INavbarItem>;
|
|
151
151
|
itemsEnd?: Array<INavbarItem>;
|
|
152
152
|
onClick?: (item?: INavbarItem, ev?: Event) => void;
|
|
153
|
+
onClickBrand?: (el?: HTMLElement, ev?: Event) => void;
|
|
153
154
|
onItemRendered?: (el?: HTMLElement, item?: INavbarItem) => void;
|
|
154
155
|
onRendered?: (el?: HTMLElement) => void;
|
|
155
156
|
searchBox?: INavbarSearchBox;
|