gd-bs 5.5.8 → 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/index.js +15 -0
- package/dist/gd-bs-icons.js +1 -1
- package/dist/gd-bs-icons.min.js +1 -1
- package/dist/gd-bs.d.ts +3 -0
- package/dist/gd-bs.js +1 -1
- package/dist/gd-bs.min.js +1 -1
- package/index.html +2 -2
- package/package.json +1 -1
- 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
|
@@ -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;
|