gd-bs 5.4.5 → 5.4.6
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/index.js +10 -0
- package/dist/gd-bs-icons.js +1 -1
- package/dist/gd-bs-icons.min.js +1 -1
- package/dist/gd-bs.d.ts +2 -2
- package/dist/gd-bs.js +1 -1
- package/dist/gd-bs.min.js +1 -1
- package/package.json +1 -1
- package/src/components/form/formTypes.d.ts +2 -2
- package/src/components/form/index.ts +17 -1
package/package.json
CHANGED
|
@@ -114,10 +114,10 @@ export const FormValidationTypes: IFormValidationTypes;
|
|
|
114
114
|
*/
|
|
115
115
|
export interface IForm {
|
|
116
116
|
/** Appends controls to the form */
|
|
117
|
-
appendControls: (controls: Array<IFormControlProps>) =>
|
|
117
|
+
appendControls: (controls: Array<IFormControlProps>) => Array<IFormControl>;
|
|
118
118
|
|
|
119
119
|
/** Appends rows to the form */
|
|
120
|
-
appendRows: (rows: Array<IFormRow>) =>
|
|
120
|
+
appendRows: (rows: Array<IFormRow>) => Array<IFormControl>;
|
|
121
121
|
|
|
122
122
|
/** The form controls */
|
|
123
123
|
controls: Array<IFormControl>;
|
|
@@ -89,25 +89,41 @@ class _Form extends Base<IFormProps> implements IForm {
|
|
|
89
89
|
*/
|
|
90
90
|
|
|
91
91
|
// Append controls to the form
|
|
92
|
-
appendControls(controls: Array<IFormControlProps> = []) {
|
|
92
|
+
appendControls(controls: Array<IFormControlProps> = []): Array<IFormControl> {
|
|
93
|
+
let addedControls: Array<IFormControl> = [];
|
|
94
|
+
|
|
93
95
|
// Parse the controls
|
|
94
96
|
for (let i = 0; i < controls.length; i++) {
|
|
95
97
|
// Create the group
|
|
96
98
|
let group = new FormGroup(controls[i], this.props);
|
|
97
99
|
this._groups.push(group);
|
|
98
100
|
this.el.appendChild(group.el);
|
|
101
|
+
|
|
102
|
+
// Append the control
|
|
103
|
+
addedControls.push(group.control);
|
|
99
104
|
}
|
|
105
|
+
|
|
106
|
+
// Return the controls
|
|
107
|
+
return addedControls;
|
|
100
108
|
}
|
|
101
109
|
|
|
102
110
|
// Append rows to the form
|
|
103
111
|
appendRows(rows: Array<IFormRow> = []) {
|
|
112
|
+
let addedControls: Array<IFormControl> = [];
|
|
113
|
+
|
|
104
114
|
// Parse the rows
|
|
105
115
|
for (let i = 0; i < rows.length; i++) {
|
|
106
116
|
// Create the row
|
|
107
117
|
let row = new FormRow(rows[i], this.props);
|
|
108
118
|
this._rows.push(row);
|
|
109
119
|
this.el.appendChild(row.el);
|
|
120
|
+
|
|
121
|
+
// Append the control
|
|
122
|
+
addedControls = addedControls.concat(row.controls);
|
|
110
123
|
}
|
|
124
|
+
|
|
125
|
+
// Return the controls
|
|
126
|
+
return addedControls;
|
|
111
127
|
}
|
|
112
128
|
|
|
113
129
|
// The forms controls
|