gd-bs 5.5.6 → 5.5.9
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 +6 -0
- package/build/components/form/index.js +15 -0
- package/dist/gd-bs-icons.js +2 -2
- package/dist/gd-bs-icons.min.js +1 -1
- package/dist/gd-bs.d.ts +5 -0
- package/dist/gd-bs.js +2 -2
- package/dist/gd-bs.min.js +1 -1
- package/index.html +2 -2
- package/package.json +1 -1
- package/src/components/form/control.ts +6 -0
- package/src/components/form/controlTypes.d.ts +2 -0
- package/src/components/form/formTypes.d.ts +3 -0
- package/src/components/form/index.ts +16 -0
package/index.html
CHANGED
|
@@ -536,7 +536,7 @@
|
|
|
536
536
|
id: "my-panel",
|
|
537
537
|
title: "Panel Example",
|
|
538
538
|
hideCloseButton: true,
|
|
539
|
-
type:
|
|
539
|
+
type: 8,
|
|
540
540
|
options: {
|
|
541
541
|
keyboard: false
|
|
542
542
|
},
|
|
@@ -756,7 +756,7 @@
|
|
|
756
756
|
el: document.querySelector("#modal"),
|
|
757
757
|
id: "my-modal",
|
|
758
758
|
title: "My Modal",
|
|
759
|
-
type:
|
|
759
|
+
type: 9,
|
|
760
760
|
options: {
|
|
761
761
|
keyboard: true,
|
|
762
762
|
autoClose: false
|
package/package.json
CHANGED
|
@@ -110,6 +110,7 @@ export class FormControl implements IFormControl {
|
|
|
110
110
|
// Add the checkbox group
|
|
111
111
|
this._cb = CheckboxGroup({
|
|
112
112
|
className,
|
|
113
|
+
colSize: cbProps.colSize,
|
|
113
114
|
hideLabel: true,
|
|
114
115
|
isInline: cbProps.isInline,
|
|
115
116
|
isReadonly: this._props.isReadonly,
|
|
@@ -211,6 +212,7 @@ export class FormControl implements IFormControl {
|
|
|
211
212
|
// Add the checkbox group
|
|
212
213
|
this._cb = CheckboxGroup({
|
|
213
214
|
className,
|
|
215
|
+
colSize: cbMultiProps.colSize,
|
|
214
216
|
hideLabel: true,
|
|
215
217
|
isInline: cbMultiProps.isInline,
|
|
216
218
|
isReadonly: this._props.isReadonly,
|
|
@@ -256,6 +258,7 @@ export class FormControl implements IFormControl {
|
|
|
256
258
|
// Add the checkbox group
|
|
257
259
|
this._cb = CheckboxGroup({
|
|
258
260
|
className,
|
|
261
|
+
colSize: (this._props as IFormControlPropsMultiCheckbox).colSize,
|
|
259
262
|
hideLabel: true,
|
|
260
263
|
isReadonly: this._props.isReadonly,
|
|
261
264
|
items: (this._props as IFormControlPropsMultiCheckbox).items,
|
|
@@ -271,6 +274,7 @@ export class FormControl implements IFormControl {
|
|
|
271
274
|
// Add the checkbox group
|
|
272
275
|
this._cb = CheckboxGroup({
|
|
273
276
|
className,
|
|
277
|
+
colSize: (this._props as IFormControlPropsMultiCheckbox).colSize,
|
|
274
278
|
hideLabel: true,
|
|
275
279
|
isReadonly: this._props.isReadonly,
|
|
276
280
|
items: (this._props as IFormControlPropsMultiCheckbox).items,
|
|
@@ -300,6 +304,7 @@ export class FormControl implements IFormControl {
|
|
|
300
304
|
// Add the checkbox group
|
|
301
305
|
this._cb = CheckboxGroup({
|
|
302
306
|
className,
|
|
307
|
+
colSize: (this._props as IFormControlPropsCheckbox).colSize,
|
|
303
308
|
hideLabel: true,
|
|
304
309
|
isReadonly: this._props.isReadonly,
|
|
305
310
|
items: (this._props as IFormControlPropsCheckbox).items,
|
|
@@ -345,6 +350,7 @@ export class FormControl implements IFormControl {
|
|
|
345
350
|
// Add the checkbox group
|
|
346
351
|
this._cb = CheckboxGroup({
|
|
347
352
|
className,
|
|
353
|
+
colSize: (this._props as IFormControlPropsCheckbox).colSize,
|
|
348
354
|
hideLabel: true,
|
|
349
355
|
isReadonly: this._props.isReadonly,
|
|
350
356
|
items: (this._props as IFormControlPropsCheckbox).items,
|
|
@@ -93,6 +93,7 @@ export interface IFormControlProps extends IBaseProps<IFormControl> {
|
|
|
93
93
|
* Form Control Properties - Checkbox
|
|
94
94
|
*/
|
|
95
95
|
export interface IFormControlPropsCheckbox extends IFormControlProps {
|
|
96
|
+
colSize?: number;
|
|
96
97
|
el?: HTMLInputElement;
|
|
97
98
|
hideLabel?: boolean;
|
|
98
99
|
isInline?: boolean;
|
|
@@ -131,6 +132,7 @@ export interface IFormControlPropsListBox extends IFormControlProps {
|
|
|
131
132
|
* Form Control Properties - Multiple Checkbox
|
|
132
133
|
*/
|
|
133
134
|
export interface IFormControlPropsMultiCheckbox extends IFormControlProps {
|
|
135
|
+
colSize?: number;
|
|
134
136
|
el?: HTMLInputElement;
|
|
135
137
|
hideLabel?: boolean;
|
|
136
138
|
isInline?: boolean;
|
|
@@ -134,6 +134,9 @@ export interface IForm {
|
|
|
134
134
|
/** Hides the form. */
|
|
135
135
|
hide: () => void;
|
|
136
136
|
|
|
137
|
+
/** Inserts a control into the form */
|
|
138
|
+
insertControl: (idx: number, control: IFormControlProps) => void;
|
|
139
|
+
|
|
137
140
|
/** Validates the form */
|
|
138
141
|
isValid: () => boolean;
|
|
139
142
|
|
|
@@ -166,6 +166,22 @@ class _Form extends Base<IFormProps> implements IForm {
|
|
|
166
166
|
return values;
|
|
167
167
|
}
|
|
168
168
|
|
|
169
|
+
// Inserts a control into the form
|
|
170
|
+
insertControl(idx: number, control: IFormControlProps) {
|
|
171
|
+
// Create the group
|
|
172
|
+
let group = new FormGroup(control, this.props);
|
|
173
|
+
this._groups.push(group);
|
|
174
|
+
|
|
175
|
+
// Validate the index
|
|
176
|
+
if (idx < this.el.childElementCount) {
|
|
177
|
+
// Insert the control
|
|
178
|
+
this.el.insertBefore(group.el, this.el.childNodes[idx]);
|
|
179
|
+
} else {
|
|
180
|
+
// Append the control
|
|
181
|
+
this.el.appendChild(group.el);
|
|
182
|
+
}
|
|
183
|
+
}
|
|
184
|
+
|
|
169
185
|
// Validates the form
|
|
170
186
|
isValid() {
|
|
171
187
|
let isValid = true;
|