gd-bs 6.6.68 → 6.6.70
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/form/control.js +5 -0
- package/dist/gd-bs-icons.js +1 -1
- package/dist/gd-bs-icons.min.js +1 -1
- package/dist/gd-bs.d.ts +7 -2
- package/dist/gd-bs.js +1 -1
- package/dist/gd-bs.min.js +1 -1
- package/package.json +1 -1
- package/src/components/checkboxGroup/types.d.ts +7 -2
- package/src/components/form/control.ts +7 -2
package/package.json
CHANGED
|
@@ -56,7 +56,7 @@ export interface ICheckboxGroup {
|
|
|
56
56
|
el: HTMLElement;
|
|
57
57
|
|
|
58
58
|
/** Gets the values. */
|
|
59
|
-
getValue: () =>
|
|
59
|
+
getValue: () => ICheckboxGroupValue;
|
|
60
60
|
|
|
61
61
|
/** Hides the checkbox group. */
|
|
62
62
|
hide: () => void;
|
|
@@ -98,13 +98,18 @@ export interface ICheckboxGroupProps extends IBaseProps<ICheckboxGroup> {
|
|
|
98
98
|
items?: Array<ICheckboxGroupItem>;
|
|
99
99
|
multi?: boolean;
|
|
100
100
|
onRender?: (el?: HTMLElement, item?: ICheckboxGroupItem) => void;
|
|
101
|
-
onChange?: (selectedItems: ICheckboxGroupItem |
|
|
101
|
+
onChange?: (selectedItems: ICheckboxGroupItem | ICheckboxGroupItem[], allItems?: ICheckboxGroupItem[], ev?: Event) => void;
|
|
102
102
|
required?: boolean;
|
|
103
103
|
title?: string;
|
|
104
104
|
type?: number;
|
|
105
105
|
value?: any;
|
|
106
106
|
}
|
|
107
107
|
|
|
108
|
+
export interface ICheckboxGroupValue {
|
|
109
|
+
selectedItems: ICheckboxGroupItem | Array<ICheckboxGroupItem>;
|
|
110
|
+
allItems: Array<ICheckboxGroupItem>;
|
|
111
|
+
}
|
|
112
|
+
|
|
108
113
|
/**
|
|
109
114
|
* Checkbox Group Types
|
|
110
115
|
*/
|
|
@@ -3,10 +3,10 @@ import {
|
|
|
3
3
|
IFormControlPropsDropdown, IFormControlPropsDropdownButton, IFormControlPropsDropdownCheckbox,
|
|
4
4
|
IFormControlPropsListBox, IFormControlPropsMultiCheckbox,
|
|
5
5
|
IFormControlPropsMultiDropdown, IFormControlPropsMultiDropdownButton, IFormControlPropsMultiDropdownCheckbox,
|
|
6
|
-
IFormControlPropsMultiListBox,
|
|
6
|
+
IFormControlPropsMultiListBox,
|
|
7
7
|
IFormControlPropsRange, IFormControlPropsTextField, IFormControlValidationResult
|
|
8
8
|
} from "./controlTypes";
|
|
9
|
-
import { ICheckboxGroup } from "../checkboxGroup/types";
|
|
9
|
+
import { ICheckboxGroup, ICheckboxGroupValue } from "../checkboxGroup/types";
|
|
10
10
|
import { IDropdown } from "../dropdown/types";
|
|
11
11
|
import { IInputGroup } from "../inputGroup/types";
|
|
12
12
|
import { IListBox } from "../listBox/types";
|
|
@@ -693,6 +693,11 @@ export class FormControl implements IFormControl {
|
|
|
693
693
|
// Set the flag
|
|
694
694
|
validation.isValid = value.length > 0;
|
|
695
695
|
}
|
|
696
|
+
// Else, see if this is a checkbox
|
|
697
|
+
else if (this._cb) {
|
|
698
|
+
// Set the flag
|
|
699
|
+
validation.isValid = (value as ICheckboxGroupValue).selectedItems ? true : false;
|
|
700
|
+
}
|
|
696
701
|
}
|
|
697
702
|
|
|
698
703
|
// See if an event exists
|