gd-bs 6.0.9 → 6.1.1

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
@@ -55,8 +55,12 @@
55
55
  window.addEventListener("load", function() {
56
56
  // Dev
57
57
  let items = [];
58
- for(var i=0; i<10; i++) {
59
- items.push({ label: "Item " + i, data: i, isSelected: true });
58
+ for (var i = 0; i < 10; i++) {
59
+ items.push({
60
+ label: "Item " + i,
61
+ data: i,
62
+ isSelected: true
63
+ });
60
64
  }
61
65
  window["form"] = GD.Components.Form({
62
66
  el: document.getElementById("dev"),
@@ -64,9 +68,20 @@
64
68
  name: "cb",
65
69
  label: "My CB",
66
70
  items,
67
- //renderRow: false,
68
- //colSize: 3,
71
+ renderRow: true,
72
+ colSize: 3,
69
73
  type: 8
74
+ }, {
75
+ name: "switch",
76
+ label: "Select an Option",
77
+ type: GD.Components.FormControlTypes.Switch,
78
+ items: [{
79
+ label: "Switch 1"
80
+ }, {
81
+ label: "Switch 2"
82
+ }, {
83
+ label: "Switch 3"
84
+ }]
70
85
  }]
71
86
  });
72
87
 
@@ -123,7 +138,9 @@
123
138
  text: "Test Tooltip",
124
139
  type: GD.Components.ButtonTypes.OutlineDanger
125
140
  },
126
- options: { trigger: "click" }
141
+ options: {
142
+ trigger: "click"
143
+ }
127
144
  });
128
145
 
129
146
  window["card"] = GD.Components.Card({
@@ -134,7 +151,9 @@
134
151
  actions: [{
135
152
  text: "Card Action",
136
153
  buttonType: GD.Components.ButtonTypes.OutlinePrimary,
137
- onClick: function(action, card) { alert(card.title + " was clicked."); }
154
+ onClick: function(action, card) {
155
+ alert(card.title + " was clicked.");
156
+ }
138
157
  }]
139
158
  }]
140
159
  });
@@ -862,6 +881,21 @@
862
881
  type: GD.Components.FormControlTypes.Password,
863
882
  }
864
883
  }]
884
+ }, {
885
+ columns: [{
886
+ control: {
887
+ label: "Select an Option",
888
+ name: "option",
889
+ type: GD.Components.FormControlTypes.Switch,
890
+ items: [{
891
+ label: "Switch 1"
892
+ }, {
893
+ label: "Switch 2"
894
+ }, {
895
+ label: "Switch 3"
896
+ }]
897
+ }
898
+ }]
865
899
  }, {
866
900
  columns: [{
867
901
  control: {
@@ -1103,7 +1137,9 @@
1103
1137
  tabContent: "This is the content for tab 4."
1104
1138
  }, {
1105
1139
  title: "NavTab 5",
1106
- onRenderTab: function(el) { el.innerHTML = "This is the content for tab 5." }
1140
+ onRenderTab: function(el) {
1141
+ el.innerHTML = "This is the content for tab 5."
1142
+ }
1107
1143
  }]
1108
1144
  });
1109
1145
  window["carousel"] = GD.Components.Carousel({
@@ -1183,7 +1219,9 @@
1183
1219
  GD.Components.Pagination({
1184
1220
  el: document.querySelector("#paging"),
1185
1221
  numberOfPages: 5,
1186
- onClick: function(pageNumber) { alert(pageNumber + " was clicked."); }
1222
+ onClick: function(pageNumber) {
1223
+ alert(pageNumber + " was clicked.");
1224
+ }
1187
1225
  });
1188
1226
  GD.Components.Progress({
1189
1227
  el: document.querySelector("#progress"),
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "gd-bs",
3
- "version": "6.0.9",
3
+ "version": "6.1.1",
4
4
  "description": "Bootstrap JavaScript, TypeScript and Web Components library.",
5
5
  "main": "build/index.js",
6
6
  "typings": "src/index.d.ts",
@@ -35,7 +35,7 @@ class _CheckboxGroup extends Base<ICheckboxGroupProps> implements ICheckboxGroup
35
35
 
36
36
  // Configure the card group
37
37
  private configure(cbTemplate: string) {
38
- let renderRow = typeof (this.props.renderRow) === "boolean" ? this.props.renderRow : true;
38
+ let renderRow = typeof (this.props.colSize) === "number" ? this.props.colSize > 0 : false;
39
39
 
40
40
  // See if a label is defined
41
41
  let label = this.el.querySelector("legend");
@@ -42,9 +42,14 @@ 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);
45
+ // See if we are rendering a row
46
+ let renderRow = typeof (this._parent.colSize) === "number" ? this._parent.colSize > 0 : false;
47
+ if (renderRow) {
48
+ // Set the column size
49
+ let colSize = this._parent.colSize > 0 && this._parent.colSize < 13 ? this._parent.colSize : 12;
50
+ this._el.classList.add("col-" + colSize);
51
+
52
+ }
48
53
 
49
54
  // See if the title property is defined
50
55
  if (this._parent.title) {
@@ -95,7 +95,6 @@ export interface ICheckboxGroupProps extends IBaseProps<ICheckboxGroup> {
95
95
  multi?: boolean;
96
96
  onRender?: (el?: HTMLElement, item?: ICheckboxGroupItem) => void;
97
97
  onChange?: (items: ICheckboxGroupItem | Array<ICheckboxGroupItem>, ev?: Event) => void;
98
- renderRow?: boolean;
99
98
  title?: string;
100
99
  type?: number;
101
100
  value?: any;
@@ -121,7 +121,6 @@ export class FormControl implements IFormControl {
121
121
  isReadonly: this._props.isReadonly,
122
122
  items: cbProps.items,
123
123
  onChange: cbProps.onChange,
124
- renderRow: cbProps.renderRow,
125
124
  title: this._props.title,
126
125
  type: CheckboxGroupTypes.Checkbox,
127
126
  value
@@ -229,7 +228,6 @@ export class FormControl implements IFormControl {
229
228
  items: cbMultiProps.items,
230
229
  multi: true,
231
230
  onChange: cbMultiProps.onChange,
232
- renderRow: cbMultiProps.renderRow,
233
231
  title: this._props.title,
234
232
  type: CheckboxGroupTypes.Checkbox,
235
233
  value
@@ -276,7 +274,6 @@ export class FormControl implements IFormControl {
276
274
  items: (this._props as IFormControlPropsMultiCheckbox).items,
277
275
  multi: true,
278
276
  onChange: (this._props as IFormControlPropsMultiCheckbox).onChange,
279
- renderRow: (this._props as IFormControlPropsMultiCheckbox).renderRow,
280
277
  title: this._props.title,
281
278
  type: CheckboxGroupTypes.Radio,
282
279
  value
@@ -294,7 +291,6 @@ export class FormControl implements IFormControl {
294
291
  items: (this._props as IFormControlPropsMultiCheckbox).items,
295
292
  multi: true,
296
293
  onChange: (this._props as IFormControlPropsMultiCheckbox).onChange,
297
- renderRow: (this._props as IFormControlPropsMultiCheckbox).renderRow,
298
294
  title: this._props.title,
299
295
  type: CheckboxGroupTypes.Switch,
300
296
  value
@@ -326,7 +322,6 @@ export class FormControl implements IFormControl {
326
322
  isReadonly: this._props.isReadonly,
327
323
  items: (this._props as IFormControlPropsCheckbox).items,
328
324
  onChange: (this._props as IFormControlPropsCheckbox).onChange,
329
- renderRow: (this._props as IFormControlPropsCheckbox).renderRow,
330
325
  title: this._props.title,
331
326
  type: CheckboxGroupTypes.Radio,
332
327
  value
@@ -375,7 +370,6 @@ export class FormControl implements IFormControl {
375
370
  isReadonly: this._props.isReadonly,
376
371
  items: (this._props as IFormControlPropsCheckbox).items,
377
372
  onChange: (this._props as IFormControlPropsCheckbox).onChange,
378
- renderRow: (this._props as IFormControlPropsCheckbox).renderRow,
379
373
  title: this._props.title,
380
374
  type: CheckboxGroupTypes.Switch,
381
375
  value
@@ -105,7 +105,6 @@ export interface IFormControlPropsCheckbox extends IFormControlProps {
105
105
  onControlRendering?: (control: IFormControlPropsCheckbox) => void | PromiseLike<IFormControlPropsCheckbox>;
106
106
  onGetValue?: (control: IFormControlPropsCheckbox) => any;
107
107
  onValidate?: (control: IFormControlPropsCheckbox, value: IFormControlValidationResult) => boolean | IFormControlValidationResult;
108
- renderRow?: boolean;
109
108
  }
110
109
 
111
110
  /**
@@ -101,6 +101,9 @@ export interface INavbar {
101
101
  /** The element. */
102
102
  el: HTMLBaseElement;
103
103
 
104
+ /** Method to get the search box value. */
105
+ getSearchValue?: () => string;
106
+
104
107
  /** Hides the nav bar. */
105
108
  hide: () => void;
106
109
 
@@ -168,7 +171,6 @@ export type INavbarTypes = {
168
171
  export interface INavbarSearchBox {
169
172
  btnType?: number;
170
173
  btnText?: string;
171
- getSearchValue?: () => string;
172
174
  hideButton?: boolean;
173
175
  onChange?: (value?: string, ev?: Event) => void;
174
176
  onSearch?: (value?: string, ev?: Event) => void;