gd-bs 6.1.1 → 6.1.2

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "gd-bs",
3
- "version": "6.1.1",
3
+ "version": "6.1.2",
4
4
  "description": "Bootstrap JavaScript, TypeScript and Web Components library.",
5
5
  "main": "build/index.js",
6
6
  "typings": "src/index.d.ts",
@@ -37,6 +37,7 @@ export class CheckboxItem {
37
37
  if (this._elCheckbox) {
38
38
  this._elCheckbox.disabled = this._parent.isDisabled ? true : false;
39
39
  this._elCheckbox.readOnly = this._parent.isReadonly ? true : false;
40
+ this._elCheckbox.required = this._parent.required ? true : false;
40
41
 
41
42
  // Default the title property for the checkbox
42
43
  this._elCheckbox.title = this.props.label || this._parent.title || "";
@@ -95,6 +95,7 @@ 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
+ required?: boolean;
98
99
  title?: string;
99
100
  type?: number;
100
101
  value?: any;
@@ -289,6 +289,7 @@ class _Dropdown extends Base<IDropdownProps> implements IDropdown {
289
289
  dropdown.classList.add("form-select");
290
290
  dropdown.disabled = this.props.isReadonly ? true : false;
291
291
  dropdown.multiple = this.props.multi ? true : false;
292
+ dropdown.required = this.props.required ? true : false;
292
293
  this.props.title ? dropdown.title = this.props.title : null;
293
294
  }
294
295
  }
@@ -143,6 +143,7 @@ export interface IDropdownProps extends IBaseProps<IDropdown> {
143
143
  navFl?: boolean;
144
144
  onChange?: (item?: IDropdownItem | Array<IDropdownItem>, ev?: Event) => void;
145
145
  onMenuRendering?: (props: IPopoverProps) => IPopoverProps;
146
+ required?: boolean;
146
147
  setLabelToValue?: boolean;
147
148
  title?: string;
148
149
  type?: number;
@@ -121,6 +121,7 @@ export class FormControl implements IFormControl {
121
121
  isReadonly: this._props.isReadonly,
122
122
  items: cbProps.items,
123
123
  onChange: cbProps.onChange,
124
+ required: this._props.required,
124
125
  title: this._props.title,
125
126
  type: CheckboxGroupTypes.Checkbox,
126
127
  value
@@ -136,6 +137,7 @@ export class FormControl implements IFormControl {
136
137
  isReadonly: this._props.isReadonly,
137
138
  onChange: (this._props as IFormControlPropsTextField).onChange,
138
139
  placeholder: (this._props as IFormControlPropsTextField).placeholder,
140
+ required: this._props.required,
139
141
  title: this._props.title,
140
142
  type: InputGroupTypes.ColorPicker,
141
143
  value
@@ -152,6 +154,7 @@ export class FormControl implements IFormControl {
152
154
  isReadonly: this._props.isReadonly,
153
155
  items: (this._props as IFormControlPropsDropdown).items,
154
156
  onChange: (this._props as IFormControlPropsDropdown).onChange,
157
+ required: this._props.required,
155
158
  title: this._props.title,
156
159
  value
157
160
  });
@@ -167,6 +170,7 @@ export class FormControl implements IFormControl {
167
170
  items: (this._props as IFormControlPropsDropdown).items,
168
171
  onChange: (this._props as IFormControlPropsDropdown).onChange,
169
172
  onMenuRendering: (this._props as IFormControlPropsDropdown).onMenuRendering,
173
+ required: this._props.required,
170
174
  title: this._props.title,
171
175
  value
172
176
  });
@@ -181,6 +185,7 @@ export class FormControl implements IFormControl {
181
185
  isReadonly: this._props.isReadonly,
182
186
  onChange: (this._props as IFormControlPropsTextField).onChange,
183
187
  placeholder: (this._props as IFormControlPropsTextField).placeholder,
188
+ required: this._props.required,
184
189
  title: this._props.title,
185
190
  type: InputGroupTypes.Email,
186
191
  value
@@ -196,6 +201,7 @@ export class FormControl implements IFormControl {
196
201
  isReadonly: this._props.isReadonly,
197
202
  onChange: (this._props as IFormControlPropsTextField).onChange,
198
203
  placeholder: (this._props as IFormControlPropsTextField).placeholder,
204
+ required: this._props.required,
199
205
  title: this._props.title,
200
206
  type: InputGroupTypes.File,
201
207
  value
@@ -210,6 +216,7 @@ export class FormControl implements IFormControl {
210
216
  items: (this._props as IFormControlPropsListBox).items,
211
217
  onChange: (this._props as IFormControlPropsListBox).onChange,
212
218
  placeholder: (this._props as IFormControlPropsListBox).placeholder,
219
+ required: this._props.required,
213
220
  value
214
221
  });
215
222
  break;
@@ -228,6 +235,7 @@ export class FormControl implements IFormControl {
228
235
  items: cbMultiProps.items,
229
236
  multi: true,
230
237
  onChange: cbMultiProps.onChange,
238
+ required: this._props.required,
231
239
  title: this._props.title,
232
240
  type: CheckboxGroupTypes.Checkbox,
233
241
  value
@@ -245,6 +253,7 @@ export class FormControl implements IFormControl {
245
253
  multi: true,
246
254
  onChange: (this._props as IFormControlPropsDropdown).onChange,
247
255
  onMenuRendering: (this._props as IFormControlPropsDropdown).onMenuRendering,
256
+ required: this._props.required,
248
257
  title: this._props.title,
249
258
  value
250
259
  });
@@ -259,6 +268,7 @@ export class FormControl implements IFormControl {
259
268
  multi: true,
260
269
  onChange: (this._props as IFormControlPropsMultiListBox).onChange,
261
270
  placeholder: (this._props as IFormControlPropsMultiListBox).placeholder,
271
+ required: this._props.required,
262
272
  value
263
273
  });
264
274
  break;
@@ -274,6 +284,7 @@ export class FormControl implements IFormControl {
274
284
  items: (this._props as IFormControlPropsMultiCheckbox).items,
275
285
  multi: true,
276
286
  onChange: (this._props as IFormControlPropsMultiCheckbox).onChange,
287
+ required: this._props.required,
277
288
  title: this._props.title,
278
289
  type: CheckboxGroupTypes.Radio,
279
290
  value
@@ -291,6 +302,7 @@ export class FormControl implements IFormControl {
291
302
  items: (this._props as IFormControlPropsMultiCheckbox).items,
292
303
  multi: true,
293
304
  onChange: (this._props as IFormControlPropsMultiCheckbox).onChange,
305
+ required: this._props.required,
294
306
  title: this._props.title,
295
307
  type: CheckboxGroupTypes.Switch,
296
308
  value
@@ -306,6 +318,7 @@ export class FormControl implements IFormControl {
306
318
  isReadonly: this._props.isReadonly,
307
319
  onChange: (this._props as IFormControlPropsTextField).onChange,
308
320
  placeholder: (this._props as IFormControlPropsTextField).placeholder,
321
+ required: this._props.required,
309
322
  title: this._props.title,
310
323
  type: InputGroupTypes.Password,
311
324
  value
@@ -322,6 +335,7 @@ export class FormControl implements IFormControl {
322
335
  isReadonly: this._props.isReadonly,
323
336
  items: (this._props as IFormControlPropsCheckbox).items,
324
337
  onChange: (this._props as IFormControlPropsCheckbox).onChange,
338
+ required: this._props.required,
325
339
  title: this._props.title,
326
340
  type: CheckboxGroupTypes.Radio,
327
341
  value
@@ -339,6 +353,7 @@ export class FormControl implements IFormControl {
339
353
  max: (this._props as IFormControlPropsRange).max || 100,
340
354
  onChange: (this._props as IFormControlPropsRange).onChange,
341
355
  placeholder: (this._props as IFormControlPropsRange).placeholder,
356
+ required: this._props.required,
342
357
  step: (this._props as IFormControlPropsRange).step,
343
358
  title: this._props.title,
344
359
  type: InputGroupTypes.Range,
@@ -354,6 +369,7 @@ export class FormControl implements IFormControl {
354
369
  isReadonly: true,
355
370
  onChange: (this._props as IFormControlPropsTextField).onChange,
356
371
  placeholder: (this._props as IFormControlPropsTextField).placeholder,
372
+ required: this._props.required,
357
373
  title: this._props.title,
358
374
  type: InputGroupTypes.TextField,
359
375
  value
@@ -370,6 +386,7 @@ export class FormControl implements IFormControl {
370
386
  isReadonly: this._props.isReadonly,
371
387
  items: (this._props as IFormControlPropsCheckbox).items,
372
388
  onChange: (this._props as IFormControlPropsCheckbox).onChange,
389
+ required: this._props.required,
373
390
  title: this._props.title,
374
391
  type: CheckboxGroupTypes.Switch,
375
392
  value
@@ -385,6 +402,7 @@ export class FormControl implements IFormControl {
385
402
  isReadonly: this._props.isReadonly,
386
403
  onChange: (this._props as IFormControlPropsTextField).onChange,
387
404
  placeholder: (this._props as IFormControlPropsTextField).placeholder,
405
+ required: this._props.required,
388
406
  rows: (this._props as IFormControlPropsTextField).rows,
389
407
  title: this._props.title,
390
408
  type: InputGroupTypes.TextArea,
@@ -401,6 +419,7 @@ export class FormControl implements IFormControl {
401
419
  isReadonly: this._props.isReadonly,
402
420
  onChange: (this._props as IFormControlPropsTextField).onChange,
403
421
  placeholder: (this._props as IFormControlPropsTextField).placeholder,
422
+ required: this._props.required,
404
423
  title: this._props.title,
405
424
  type: InputGroupTypes.TextField,
406
425
  value
@@ -219,6 +219,7 @@ class _InputGroup extends Base<IInputGroupProps> implements IInputGroup {
219
219
  this.props.placeholder ? textarea.placeholder = this.props.placeholder : null;
220
220
  textarea.disabled = this.props.isDisabled ? true : false;
221
221
  textarea.readOnly = this.props.isReadonly ? true : false;
222
+ textarea.required = this.props.required ? true : false;
222
223
  textarea.rows = this.props.rows;
223
224
  this.props.title ? textarea.title = this.props.title : null;
224
225
  }
@@ -233,6 +234,7 @@ class _InputGroup extends Base<IInputGroupProps> implements IInputGroup {
233
234
  this.props.placeholder ? input.placeholder = this.props.placeholder : null;
234
235
  input.disabled = this.props.isDisabled ? true : false;
235
236
  input.readOnly = this.props.isReadonly ? true : false;
237
+ input.required = this.props.required ? true : false;
236
238
  this.props.title ? input.title = this.props.title : null;
237
239
  typeof (this.props.min) === "number" ? input.min = this.props.min + "" : null;
238
240
  typeof (this.props.max) === "number" ? input.max = this.props.max + "" : null;
@@ -91,6 +91,7 @@ export interface IInputGroupProps extends IBaseProps<IInputGroup> {
91
91
  placeholder?: string;
92
92
  prependedButtons?: Array<IButtonProps>;
93
93
  prependedLabel?: string;
94
+ required?: boolean;
94
95
  rows?: number;
95
96
  step?: number;
96
97
  title?: string;
@@ -72,6 +72,9 @@ class _ListBox extends Base<IListBoxProps> implements IListBox {
72
72
  this._elSearchBox ? this._elSearchBox.disabled = true : null;
73
73
  }
74
74
 
75
+ // Set the required property
76
+ this._elSearchBox.required = this.props.required ? true : false;
77
+
75
78
  // Set the options
76
79
  this.setOptions(this.props.items);
77
80
 
@@ -99,8 +99,9 @@ export interface IListBoxProps extends IBaseProps<IListBox> {
99
99
  isReadonly?: boolean;
100
100
  items: Array<IDropdownItem>;
101
101
  multi?: boolean;
102
- placeholder?: string;
103
102
  onLoadData?: () => Array<IDropdownItem> | PromiseLike<Array<IDropdownItem>>;
104
103
  onChange?: (items: IDropdownItem | Array<IDropdownItem>, ev?: Event) => void;
104
+ placeholder?: string;
105
+ required?: boolean;
105
106
  value?: string | Array<string>;
106
107
  }