gd-bs 6.6.62 → 6.6.64
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/dropdown/formItem.js +1 -1
- package/build/components/dropdown/index.js +4 -4
- package/build/components/dropdown/item.js +1 -1
- package/build/components/nav/index.js +5 -0
- package/build/components/nav/link.js +6 -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 -1
- package/dist/gd-bs.js +1 -1
- package/dist/gd-bs.min.js +1 -1
- package/package.json +1 -1
- package/src/components/dropdown/formItem.ts +1 -1
- package/src/components/dropdown/index.ts +4 -4
- package/src/components/dropdown/item.ts +1 -1
- package/src/components/dropdown/types.d.ts +1 -1
- package/src/components/nav/index.ts +6 -0
- package/src/components/nav/link.ts +3 -0
package/package.json
CHANGED
|
@@ -54,7 +54,7 @@ export class DropdownFormItem {
|
|
|
54
54
|
// Else, see if a value exists
|
|
55
55
|
else if (this._parent.value != undefined) {
|
|
56
56
|
// Ensure it's an array
|
|
57
|
-
let values = this._parent.value && typeof (this._parent.value)
|
|
57
|
+
let values = this._parent.value && this._parent.value.length && typeof (this._parent.value) !== "string" ? this._parent.value : [this._parent.value];
|
|
58
58
|
|
|
59
59
|
// Parse the values
|
|
60
60
|
for (let i = 0; i < values.length; i++) {
|
|
@@ -434,7 +434,7 @@ class _Dropdown extends Base<IDropdownProps> implements IDropdown {
|
|
|
434
434
|
if (currentValues == null) { return values; }
|
|
435
435
|
|
|
436
436
|
// Ensure it's an array
|
|
437
|
-
if (typeof (currentValues)
|
|
437
|
+
if (typeof (currentValues) === "string") {
|
|
438
438
|
// Make it an array
|
|
439
439
|
currentValues = [currentValues];
|
|
440
440
|
}
|
|
@@ -445,7 +445,7 @@ class _Dropdown extends Base<IDropdownProps> implements IDropdown {
|
|
|
445
445
|
let currentItem: IDropdownItem = {};
|
|
446
446
|
|
|
447
447
|
// See if this is a string
|
|
448
|
-
if (typeof (currentValue)
|
|
448
|
+
if (typeof (currentValue) == "string") {
|
|
449
449
|
// Set the text and value properties
|
|
450
450
|
currentItem.text = currentValue;
|
|
451
451
|
currentItem.value = currentValue;
|
|
@@ -575,7 +575,7 @@ class _Dropdown extends Base<IDropdownProps> implements IDropdown {
|
|
|
575
575
|
if (this._cb) {
|
|
576
576
|
// Get the values
|
|
577
577
|
let items = this._cb.getValue() as ICheckboxGroupItem[];
|
|
578
|
-
items = typeof (items) === "
|
|
578
|
+
items = typeof (items["length"]) === "number" ? items : [items] as any;
|
|
579
579
|
|
|
580
580
|
// Parse the items
|
|
581
581
|
for (let i = 0; i < items.length; i++) {
|
|
@@ -695,7 +695,7 @@ class _Dropdown extends Base<IDropdownProps> implements IDropdown {
|
|
|
695
695
|
// Sets the dropdown value
|
|
696
696
|
setValue(value) {
|
|
697
697
|
// Ensure it's an array
|
|
698
|
-
let values = value == null ? [] : (typeof (value) === "
|
|
698
|
+
let values = value == null ? [] : (typeof (value.length) === "number" && typeof (value) !== "string" ? value : [value]);
|
|
699
699
|
|
|
700
700
|
// See if this is a checkbox
|
|
701
701
|
if (this._cb) {
|
|
@@ -79,7 +79,7 @@ export class DropdownItem {
|
|
|
79
79
|
// Else, see if a value exists
|
|
80
80
|
else if (this._parent.value != undefined) {
|
|
81
81
|
// Ensure it's an array
|
|
82
|
-
let values = this._parent.value && typeof (this._parent.value)
|
|
82
|
+
let values = this._parent.value && this._parent.value.length && typeof (this._parent.value) !== "string" ? this._parent.value : [this._parent.value];
|
|
83
83
|
|
|
84
84
|
// Parse the values
|
|
85
85
|
for (let j = 0; j < values.length; j++) {
|
|
@@ -55,6 +55,12 @@ class _Nav extends Base<INavProps> implements INav {
|
|
|
55
55
|
let prevTab: INavLink = null;
|
|
56
56
|
let newTab: INavLink = link;
|
|
57
57
|
|
|
58
|
+
// See if this link is disabled
|
|
59
|
+
if (link.isDisabled) {
|
|
60
|
+
// Do nothing
|
|
61
|
+
return;
|
|
62
|
+
}
|
|
63
|
+
|
|
58
64
|
// Parse the links
|
|
59
65
|
for (let i = 0; i < this._links.length; i++) {
|
|
60
66
|
let link = this._links[i];
|
|
@@ -102,6 +102,9 @@ export class NavLink extends Base<INavLinkProps> implements INavLink {
|
|
|
102
102
|
// Returns true if the link is active
|
|
103
103
|
get isActive(): boolean { return this._elLink.classList.contains("active"); }
|
|
104
104
|
|
|
105
|
+
// Returns true if the link is disabled
|
|
106
|
+
get isDisabled(): boolean { return this._elLink.classList.contains("disabled"); }
|
|
107
|
+
|
|
105
108
|
// Gets the tab name
|
|
106
109
|
get tabName(): string { return this._elLink.innerHTML.trim(); }
|
|
107
110
|
set tabName(value: string) { this._elLink.innerHTML = (value || "").trim(); }
|