gd-bs 5.7.6 → 5.7.7

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/index.html CHANGED
@@ -64,6 +64,8 @@
64
64
  name: "cb",
65
65
  label: "My CB",
66
66
  items,
67
+ //renderRow: false,
68
+ //colSize: 3,
67
69
  type: 8
68
70
  }]
69
71
  });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "gd-bs",
3
- "version": "5.7.6",
3
+ "version": "5.7.7",
4
4
  "description": "Bootstrap JavaScript, TypeScript and Web Components library.",
5
5
  "main": "build/index.js",
6
6
  "typings": "src/index.d.ts",
@@ -35,21 +35,13 @@ class _CheckboxGroup extends Base<ICheckboxGroupProps> implements ICheckboxGroup
35
35
 
36
36
  // Configure the card group
37
37
  private configure(cbTemplate: string) {
38
- let colSize = this.props.colSize > 0 && this.props.colSize < 13 ? this.props.colSize : (this.props.label ? 10 : 12);
39
38
  let renderRow = typeof (this.props.renderRow) === "boolean" ? this.props.renderRow : true;
40
39
 
41
- // See if we are not rendering a row
42
- if (!renderRow) {
43
- // Remove the row class
44
- this.el.classList.remove("row");
45
- }
46
-
47
40
  // See if a label is defined
48
41
  let label = this.el.querySelector("legend");
49
42
  if (label) {
50
43
  if (this.props.label && this.props.hideLabel != true) {
51
44
  // Add the label
52
- renderRow ? label.classList.add("col-" + (12 - colSize)) : null;
53
45
  label.innerHTML = this.props.label;
54
46
  } else {
55
47
  // Remove the label
@@ -60,10 +52,7 @@ class _CheckboxGroup extends Base<ICheckboxGroupProps> implements ICheckboxGroup
60
52
  // Get the group and configure the size
61
53
  let group = this.el.querySelector("div");
62
54
  if (group) {
63
- if (renderRow) {
64
- // Set the class
65
- group.classList.add("col-" + colSize);
66
- } else {
55
+ if (!renderRow) {
67
56
  // Remove the group element
68
57
  this.el.removeChild(group);
69
58
  }
@@ -42,6 +42,10 @@ export class CheckboxItem {
42
42
  this._elCheckbox.title = this.props.label || this._parent.title || "";
43
43
  }
44
44
 
45
+ // Set the column size
46
+ let colSize = this._parent.colSize > 0 && this._parent.colSize < 13 ? this._parent.colSize : 12;
47
+ this._el.classList.add("col-" + colSize);
48
+
45
49
  // See if the title property is defined
46
50
  if (this._parent.title) {
47
51
  // Set the title
@@ -1,8 +1,8 @@
1
1
  // Checkbox
2
2
  export const HTML = `
3
- <div class="row">
3
+ <div>
4
4
  <legend class="col-form-label"></legend>
5
- <div></div>
5
+ <div class="row"></div>
6
6
  </div>`.trim();
7
7
 
8
8
  // Checkbox
@@ -117,6 +117,7 @@ export class FormControl implements IFormControl {
117
117
  isReadonly: this._props.isReadonly,
118
118
  items: cbProps.items,
119
119
  onChange: cbProps.onChange,
120
+ renderRow: cbProps.renderRow,
120
121
  title: this._props.title,
121
122
  type: CheckboxGroupTypes.Checkbox,
122
123
  value: this._props.value
@@ -224,6 +225,7 @@ export class FormControl implements IFormControl {
224
225
  items: cbMultiProps.items,
225
226
  multi: true,
226
227
  onChange: cbMultiProps.onChange,
228
+ renderRow: cbMultiProps.renderRow,
227
229
  title: this._props.title,
228
230
  type: CheckboxGroupTypes.Checkbox,
229
231
  value: this._props.value
@@ -270,6 +272,7 @@ export class FormControl implements IFormControl {
270
272
  items: (this._props as IFormControlPropsMultiCheckbox).items,
271
273
  multi: true,
272
274
  onChange: (this._props as IFormControlPropsMultiCheckbox).onChange,
275
+ renderRow: (this._props as IFormControlPropsMultiCheckbox).renderRow,
273
276
  title: this._props.title,
274
277
  type: CheckboxGroupTypes.Radio,
275
278
  value: this._props.value
@@ -287,6 +290,7 @@ export class FormControl implements IFormControl {
287
290
  items: (this._props as IFormControlPropsMultiCheckbox).items,
288
291
  multi: true,
289
292
  onChange: (this._props as IFormControlPropsMultiCheckbox).onChange,
293
+ renderRow: (this._props as IFormControlPropsMultiCheckbox).renderRow,
290
294
  title: this._props.title,
291
295
  type: CheckboxGroupTypes.Switch,
292
296
  value: this._props.value
@@ -318,6 +322,7 @@ export class FormControl implements IFormControl {
318
322
  isReadonly: this._props.isReadonly,
319
323
  items: (this._props as IFormControlPropsCheckbox).items,
320
324
  onChange: (this._props as IFormControlPropsCheckbox).onChange,
325
+ renderRow: (this._props as IFormControlPropsCheckbox).renderRow,
321
326
  title: this._props.title,
322
327
  type: CheckboxGroupTypes.Radio,
323
328
  value: this._props.value
@@ -366,6 +371,7 @@ export class FormControl implements IFormControl {
366
371
  isReadonly: this._props.isReadonly,
367
372
  items: (this._props as IFormControlPropsCheckbox).items,
368
373
  onChange: (this._props as IFormControlPropsCheckbox).onChange,
374
+ renderRow: (this._props as IFormControlPropsCheckbox).renderRow,
369
375
  title: this._props.title,
370
376
  type: CheckboxGroupTypes.Switch,
371
377
  value: this._props.value
@@ -103,6 +103,7 @@ export interface IFormControlPropsCheckbox extends IFormControlProps {
103
103
  onControlRendering?: (control: IFormControlPropsCheckbox) => void | PromiseLike<IFormControlPropsCheckbox>;
104
104
  onGetValue?: (control: IFormControlPropsCheckbox) => any;
105
105
  onValidate?: (control: IFormControlPropsCheckbox, value: IFormControlValidationResult) => boolean | IFormControlValidationResult;
106
+ renderRow?: boolean;
106
107
  }
107
108
 
108
109
  /**
@@ -142,6 +143,7 @@ export interface IFormControlPropsMultiCheckbox extends IFormControlProps {
142
143
  onControlRendering?: (control: IFormControlPropsCheckbox) => void | PromiseLike<IFormControlPropsCheckbox>;
143
144
  onGetValue?: (control: IFormControlPropsCheckbox) => any;
144
145
  onValidate?: (control: IFormControlPropsCheckbox, value: IFormControlValidationResult) => boolean | IFormControlValidationResult;
146
+ renderRow?: boolean;
145
147
  }
146
148
 
147
149
  /**