gd-bs 6.6.64 → 6.6.66
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/checkboxGroup/index.js +10 -5
- package/build/components/checkboxGroup/item.js +2 -0
- package/build/components/form/control.js +3 -0
- package/package.json +1 -1
- package/src/components/checkboxGroup/index.ts +14 -6
- package/src/components/checkboxGroup/item.ts +2 -0
- package/src/components/checkboxGroup/types.d.ts +3 -3
- package/src/components/form/control.ts +3 -0
- package/build/bs.js +0 -1
- package/build/icons/svgs/index.d.ts +0 -4100
- package/dist/gd-bs-icons.js +0 -2
- package/dist/gd-bs-icons.js.LICENSE.txt +0 -9771
- package/dist/gd-bs-icons.min.js +0 -1
- package/dist/gd-bs.d.ts +0 -3263
- package/dist/gd-bs.js +0 -2
- package/dist/gd-bs.js.LICENSE.txt +0 -1403
- package/dist/gd-bs.min.js +0 -1
|
@@ -123,8 +123,9 @@ var _CheckboxGroup = /** @class */ (function (_super) {
|
|
|
123
123
|
if (this.props.onChange) {
|
|
124
124
|
// Add a click event
|
|
125
125
|
item.checkbox.addEventListener("click", function (ev) {
|
|
126
|
+
var value = _this.getValue();
|
|
126
127
|
// Call the event
|
|
127
|
-
_this.props.onChange(
|
|
128
|
+
_this.props.onChange(value.selectedItems, value.allItems, ev);
|
|
128
129
|
});
|
|
129
130
|
}
|
|
130
131
|
};
|
|
@@ -160,18 +161,21 @@ var _CheckboxGroup = /** @class */ (function (_super) {
|
|
|
160
161
|
*/
|
|
161
162
|
// Method to get the value
|
|
162
163
|
_CheckboxGroup.prototype.getValue = function () {
|
|
163
|
-
var
|
|
164
|
+
var allItems = [];
|
|
165
|
+
var selectedItems = [];
|
|
164
166
|
// Parse the checkboxes
|
|
165
167
|
for (var i = 0; i < this._checkboxes.length; i++) {
|
|
166
168
|
var cb = this._checkboxes[i];
|
|
169
|
+
// Add the item
|
|
170
|
+
allItems.push(cb.props);
|
|
167
171
|
// See if it's checked
|
|
168
172
|
if (cb.isChecked) {
|
|
169
173
|
// Add the value
|
|
170
|
-
|
|
174
|
+
selectedItems.push(cb.props);
|
|
171
175
|
}
|
|
172
176
|
}
|
|
173
177
|
// Return the values
|
|
174
|
-
return this.props.multi ?
|
|
178
|
+
return { selectedItems: this.props.multi ? selectedItems : selectedItems[0], allItems: allItems };
|
|
175
179
|
};
|
|
176
180
|
// Sets the checkbox items
|
|
177
181
|
_CheckboxGroup.prototype.setItems = function (newItems) {
|
|
@@ -219,8 +223,9 @@ var _CheckboxGroup = /** @class */ (function (_super) {
|
|
|
219
223
|
}
|
|
220
224
|
// See if a change event exists
|
|
221
225
|
if (this._initFl && this.props.onChange) {
|
|
226
|
+
var value_2 = this.getValue();
|
|
222
227
|
// Execute the change event
|
|
223
|
-
this.props.onChange(
|
|
228
|
+
this.props.onChange(value_2.selectedItems, value_2.allItems);
|
|
224
229
|
}
|
|
225
230
|
};
|
|
226
231
|
return _CheckboxGroup;
|
|
@@ -94,6 +94,7 @@ var CheckboxItem = /** @class */ (function () {
|
|
|
94
94
|
this._elCheckbox.addEventListener("click", function (ev) {
|
|
95
95
|
// Update the value
|
|
96
96
|
_this._isSelected = !_this._isSelected;
|
|
97
|
+
_this._props.isSelected = _this._isSelected;
|
|
97
98
|
_this._elCheckbox.checked = _this._isSelected;
|
|
98
99
|
// See if an event is defined
|
|
99
100
|
if (_this._props.onChange) {
|
|
@@ -153,6 +154,7 @@ var CheckboxItem = /** @class */ (function () {
|
|
|
153
154
|
CheckboxItem.prototype.toggle = function () {
|
|
154
155
|
// Update the value
|
|
155
156
|
this._isSelected = !this._isSelected;
|
|
157
|
+
this._props.isSelected = this._isSelected;
|
|
156
158
|
// Set the checkbox value
|
|
157
159
|
this._el.querySelector("input").checked = this._isSelected;
|
|
158
160
|
};
|
|
@@ -372,6 +372,7 @@ var FormControl = /** @class */ (function () {
|
|
|
372
372
|
colSize: this._props.colSize,
|
|
373
373
|
hideLabel: true,
|
|
374
374
|
isDisabled: this._props.isDisabled,
|
|
375
|
+
isInline: this._props.isInline,
|
|
375
376
|
isReadonly: this._props.isReadonly,
|
|
376
377
|
items: this._props.items,
|
|
377
378
|
multi: true,
|
|
@@ -408,6 +409,7 @@ var FormControl = /** @class */ (function () {
|
|
|
408
409
|
colSize: this._props.colSize,
|
|
409
410
|
hideLabel: true,
|
|
410
411
|
isDisabled: this._props.isDisabled,
|
|
412
|
+
isInline: this._props.isInline,
|
|
411
413
|
isReadonly: this._props.isReadonly,
|
|
412
414
|
items: this._props.items,
|
|
413
415
|
onChange: this._props.onChange,
|
|
@@ -462,6 +464,7 @@ var FormControl = /** @class */ (function () {
|
|
|
462
464
|
colSize: this._props.colSize,
|
|
463
465
|
hideLabel: true,
|
|
464
466
|
isDisabled: this._props.isDisabled,
|
|
467
|
+
isInline: this._props.isInline,
|
|
465
468
|
isReadonly: this._props.isReadonly,
|
|
466
469
|
items: this._props.items,
|
|
467
470
|
onChange: this._props.onChange,
|
package/package.json
CHANGED
|
@@ -114,8 +114,10 @@ class _CheckboxGroup extends Base<ICheckboxGroupProps> implements ICheckboxGroup
|
|
|
114
114
|
if (this.props.onChange) {
|
|
115
115
|
// Add a click event
|
|
116
116
|
item.checkbox.addEventListener("click", ev => {
|
|
117
|
+
let value = this.getValue();
|
|
118
|
+
|
|
117
119
|
// Call the event
|
|
118
|
-
this.props.onChange(
|
|
120
|
+
this.props.onChange(value.selectedItems, value.allItems, ev);
|
|
119
121
|
});
|
|
120
122
|
}
|
|
121
123
|
}
|
|
@@ -159,22 +161,26 @@ class _CheckboxGroup extends Base<ICheckboxGroupProps> implements ICheckboxGroup
|
|
|
159
161
|
*/
|
|
160
162
|
|
|
161
163
|
// Method to get the value
|
|
162
|
-
getValue(): ICheckboxGroupItem | Array<ICheckboxGroupItem> {
|
|
163
|
-
let
|
|
164
|
+
getValue(): { selectedItems: ICheckboxGroupItem | Array<ICheckboxGroupItem>, allItems: Array<ICheckboxGroupItem> } {
|
|
165
|
+
let allItems: Array<ICheckboxGroupItem> = [];
|
|
166
|
+
let selectedItems: Array<ICheckboxGroupItem> = [];
|
|
164
167
|
|
|
165
168
|
// Parse the checkboxes
|
|
166
169
|
for (let i = 0; i < this._checkboxes.length; i++) {
|
|
167
170
|
let cb = this._checkboxes[i];
|
|
168
171
|
|
|
172
|
+
// Add the item
|
|
173
|
+
allItems.push(cb.props);
|
|
174
|
+
|
|
169
175
|
// See if it's checked
|
|
170
176
|
if (cb.isChecked) {
|
|
171
177
|
// Add the value
|
|
172
|
-
|
|
178
|
+
selectedItems.push(cb.props);
|
|
173
179
|
}
|
|
174
180
|
}
|
|
175
181
|
|
|
176
182
|
// Return the values
|
|
177
|
-
return this.props.multi ?
|
|
183
|
+
return { selectedItems: this.props.multi ? selectedItems : selectedItems[0], allItems };
|
|
178
184
|
}
|
|
179
185
|
|
|
180
186
|
// Sets the checkbox items
|
|
@@ -231,8 +237,10 @@ class _CheckboxGroup extends Base<ICheckboxGroupProps> implements ICheckboxGroup
|
|
|
231
237
|
|
|
232
238
|
// See if a change event exists
|
|
233
239
|
if (this._initFl && this.props.onChange) {
|
|
240
|
+
let value = this.getValue();
|
|
241
|
+
|
|
234
242
|
// Execute the change event
|
|
235
|
-
this.props.onChange(
|
|
243
|
+
this.props.onChange(value.selectedItems, value.allItems);
|
|
236
244
|
}
|
|
237
245
|
}
|
|
238
246
|
}
|
|
@@ -105,6 +105,7 @@ export class CheckboxItem {
|
|
|
105
105
|
this._elCheckbox.addEventListener("click", ev => {
|
|
106
106
|
// Update the value
|
|
107
107
|
this._isSelected = !this._isSelected;
|
|
108
|
+
this._props.isSelected = this._isSelected
|
|
108
109
|
this._elCheckbox.checked = this._isSelected;
|
|
109
110
|
|
|
110
111
|
// See if an event is defined
|
|
@@ -157,6 +158,7 @@ export class CheckboxItem {
|
|
|
157
158
|
toggle() {
|
|
158
159
|
// Update the value
|
|
159
160
|
this._isSelected = !this._isSelected;
|
|
161
|
+
this._props.isSelected = this._isSelected;
|
|
160
162
|
|
|
161
163
|
// Set the checkbox value
|
|
162
164
|
this._el.querySelector("input").checked = this._isSelected;
|
|
@@ -56,7 +56,7 @@ export interface ICheckboxGroup {
|
|
|
56
56
|
el: HTMLElement;
|
|
57
57
|
|
|
58
58
|
/** Gets the values. */
|
|
59
|
-
getValue: () => ICheckboxGroupItem | Array<ICheckboxGroupItem
|
|
59
|
+
getValue: () => { selectedItems: ICheckboxGroupItem | Array<ICheckboxGroupItem>, allItems: Array<ICheckboxGroupItem> };
|
|
60
60
|
|
|
61
61
|
/** Hides the checkbox group. */
|
|
62
62
|
hide: () => void;
|
|
@@ -80,7 +80,7 @@ export interface ICheckboxGroupItem {
|
|
|
80
80
|
isSelected?: boolean;
|
|
81
81
|
label?: string;
|
|
82
82
|
name?: string;
|
|
83
|
-
onChange?: (
|
|
83
|
+
onChange?: (selectedItem: ICheckboxGroupItem, ev?: Event) => void;
|
|
84
84
|
title?: string;
|
|
85
85
|
type?: number;
|
|
86
86
|
}
|
|
@@ -98,7 +98,7 @@ 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?: (
|
|
101
|
+
onChange?: (selectedItems: ICheckboxGroupItem | Array<ICheckboxGroupItem>, allItems?: Array<ICheckboxGroupItem>, ev?: Event) => void;
|
|
102
102
|
required?: boolean;
|
|
103
103
|
title?: string;
|
|
104
104
|
type?: number;
|
|
@@ -383,6 +383,7 @@ export class FormControl implements IFormControl {
|
|
|
383
383
|
colSize: (this._props as IFormControlPropsMultiCheckbox).colSize,
|
|
384
384
|
hideLabel: true,
|
|
385
385
|
isDisabled: this._props.isDisabled,
|
|
386
|
+
isInline: (this._props as IFormControlPropsCheckbox).isInline,
|
|
386
387
|
isReadonly: this._props.isReadonly,
|
|
387
388
|
items: (this._props as IFormControlPropsMultiCheckbox).items,
|
|
388
389
|
multi: true,
|
|
@@ -419,6 +420,7 @@ export class FormControl implements IFormControl {
|
|
|
419
420
|
colSize: (this._props as IFormControlPropsCheckbox).colSize,
|
|
420
421
|
hideLabel: true,
|
|
421
422
|
isDisabled: this._props.isDisabled,
|
|
423
|
+
isInline: (this._props as IFormControlPropsCheckbox).isInline,
|
|
422
424
|
isReadonly: this._props.isReadonly,
|
|
423
425
|
items: (this._props as IFormControlPropsCheckbox).items,
|
|
424
426
|
onChange: (this._props as IFormControlPropsCheckbox).onChange,
|
|
@@ -473,6 +475,7 @@ export class FormControl implements IFormControl {
|
|
|
473
475
|
colSize: (this._props as IFormControlPropsCheckbox).colSize,
|
|
474
476
|
hideLabel: true,
|
|
475
477
|
isDisabled: this._props.isDisabled,
|
|
478
|
+
isInline: (this._props as IFormControlPropsCheckbox).isInline,
|
|
476
479
|
isReadonly: this._props.isReadonly,
|
|
477
480
|
items: (this._props as IFormControlPropsCheckbox).items,
|
|
478
481
|
onChange: (this._props as IFormControlPropsCheckbox).onChange,
|