gd-bs 6.6.29 → 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/bs.js +1 -1
- package/build/components/checkboxGroup/index.js +13 -2
- 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 +13 -9
- package/package.json +1 -1
- package/src/components/checkboxGroup/index.ts +14 -2
- package/src/components/navbar/index.ts +10 -0
- package/src/components/navbar/types.d.ts +1 -0
- package/src/styles/_custom.scss +4 -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
|
|
@@ -315,6 +317,7 @@
|
|
|
315
317
|
value: {
|
|
316
318
|
ReasonNotTestedExplanation: "0",
|
|
317
319
|
ReasonNotTestedExplanationRadio: "Primary",
|
|
320
|
+
ReasonNotTestedExplanationCheckbox: "Primary",
|
|
318
321
|
CBExample: true,
|
|
319
322
|
CBInlineExample: true,
|
|
320
323
|
FName: "Datta",
|
|
@@ -401,7 +404,8 @@
|
|
|
401
404
|
name: "CBExample",
|
|
402
405
|
title: "This is a checkbox",
|
|
403
406
|
items: [{
|
|
404
|
-
label: "Checkbox Example w/ no label"
|
|
407
|
+
label: "Checkbox Example w/ no label",
|
|
408
|
+
isSelected: true
|
|
405
409
|
}],
|
|
406
410
|
type: GD.Components.FormControlTypes.Checkbox,
|
|
407
411
|
description: "This is a read-only checkbox",
|
package/package.json
CHANGED
|
@@ -72,8 +72,20 @@ class _CheckboxGroup extends Base<ICheckboxGroupProps> implements ICheckboxGroup
|
|
|
72
72
|
// Render the checkboxes
|
|
73
73
|
this.renderItems();
|
|
74
74
|
|
|
75
|
-
//
|
|
76
|
-
|
|
75
|
+
// Parse the items
|
|
76
|
+
let valueSet: boolean = false;
|
|
77
|
+
let items = this.props.items || [];
|
|
78
|
+
for (let i = 0; i < items.length; i++) {
|
|
79
|
+
// See if the item is using the isSelected property
|
|
80
|
+
if (typeof (items[i].isSelected) === "boolean") {
|
|
81
|
+
// Set the flag
|
|
82
|
+
valueSet = true;
|
|
83
|
+
break;
|
|
84
|
+
}
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
// Set the value if we need to
|
|
88
|
+
valueSet ? null : this.setValue(this.props.value);
|
|
77
89
|
}
|
|
78
90
|
|
|
79
91
|
// Configure the events
|
|
@@ -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;
|
package/src/styles/_custom.scss
CHANGED
|
@@ -297,6 +297,10 @@
|
|
|
297
297
|
background-color: var(--sp-theme-primary, #0078d4);
|
|
298
298
|
border-color: var(--sp-theme-primary, #0078d4);
|
|
299
299
|
}
|
|
300
|
+
/* Fix for readonly */
|
|
301
|
+
.form-check > .form-check-input[readonly] {
|
|
302
|
+
pointer-events: none;
|
|
303
|
+
}
|
|
300
304
|
.form-control:hover, .form-select:hover {
|
|
301
305
|
border-color: var(--sp-theme-tertiary, #71afe5);
|
|
302
306
|
}
|