@formio/js 5.0.0-dev.5940.cf4089b → 5.0.0-dev.5944.74e70b0
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/dist/formio.form.js +2 -2
- package/dist/formio.form.min.js +1 -1
- package/dist/formio.full.js +2 -2
- package/dist/formio.full.min.js +1 -1
- package/lib/cjs/components/editgrid/EditGrid.d.ts +1 -1
- package/lib/cjs/components/editgrid/EditGrid.js +7 -2
- package/lib/cjs/formio.form.js +0 -1
- package/lib/mjs/components/editgrid/EditGrid.d.ts +1 -1
- package/lib/mjs/components/editgrid/EditGrid.js +7 -2
- package/lib/mjs/formio.form.js +0 -1
- package/package.json +1 -1
|
@@ -43,7 +43,7 @@ export default class EditGridComponent extends NestedArrayComponent {
|
|
|
43
43
|
get defaultValue(): any[];
|
|
44
44
|
hasRemoveButtons(): boolean;
|
|
45
45
|
editRows: any;
|
|
46
|
-
checkRowVariableTypeComponents(editRow: any, rowIndex: any):
|
|
46
|
+
checkRowVariableTypeComponents(editRow: any, rowIndex: any): boolean;
|
|
47
47
|
setVariableTypeComponents(): void;
|
|
48
48
|
variableTypeComponentsIndexes: any[] | undefined;
|
|
49
49
|
isOpen(editRow: any): boolean;
|
|
@@ -294,12 +294,15 @@ class EditGridComponent extends NestedArrayComponent_1.default {
|
|
|
294
294
|
}
|
|
295
295
|
checkRowVariableTypeComponents(editRow, rowIndex) {
|
|
296
296
|
const rowComponents = editRow.components;
|
|
297
|
+
let typeChanged = false;
|
|
297
298
|
if (lodash_1.default.some(this.variableTypeComponentsIndexes, (compIndex) => {
|
|
298
299
|
const variableTypeComp = rowComponents[compIndex];
|
|
299
300
|
return variableTypeComp.type !== variableTypeComp.component.type;
|
|
300
301
|
})) {
|
|
301
302
|
editRow.components = this.createRowComponents(editRow.data, rowIndex, true);
|
|
303
|
+
typeChanged = true;
|
|
302
304
|
}
|
|
305
|
+
return typeChanged;
|
|
303
306
|
}
|
|
304
307
|
setVariableTypeComponents() {
|
|
305
308
|
//set components which type is changing within a row (e.g.,by mergeComponentSchema action)
|
|
@@ -951,8 +954,10 @@ class EditGridComponent extends NestedArrayComponent_1.default {
|
|
|
951
954
|
this.validateRow(editRow, false);
|
|
952
955
|
}
|
|
953
956
|
if (this.variableTypeComponentsIndexes.length) {
|
|
954
|
-
this.checkRowVariableTypeComponents(editRow, rowIndex);
|
|
955
|
-
|
|
957
|
+
const typeChanged = this.checkRowVariableTypeComponents(editRow, rowIndex);
|
|
958
|
+
if (typeChanged) {
|
|
959
|
+
this.redraw();
|
|
960
|
+
}
|
|
956
961
|
}
|
|
957
962
|
};
|
|
958
963
|
const comp = this.createComponent(lodash_1.default.assign({}, column, { row: options.row }), options, row, null, recreatePartially && currentRowComponents ? currentRowComponents[colIndex] : null);
|
package/lib/cjs/formio.form.js
CHANGED
|
@@ -73,7 +73,6 @@ function registerModule(mod, defaultFn = null, options = {}) {
|
|
|
73
73
|
case 'templates':
|
|
74
74
|
for (const framework of Object.keys(mod.templates)) {
|
|
75
75
|
Formio_1.Formio.Templates.extendTemplate(framework, mod.templates[framework]);
|
|
76
|
-
Formio_1.Formio.Templates.defaultTemplates = lodash_1.default.defaults(mod.templates[framework], Formio_1.Formio.Templates.defaultTemplates);
|
|
77
76
|
}
|
|
78
77
|
if (mod.templates[current]) {
|
|
79
78
|
Formio_1.Formio.Templates.current = mod.templates[current];
|
|
@@ -43,7 +43,7 @@ export default class EditGridComponent extends NestedArrayComponent {
|
|
|
43
43
|
get defaultValue(): any[];
|
|
44
44
|
hasRemoveButtons(): boolean;
|
|
45
45
|
editRows: any;
|
|
46
|
-
checkRowVariableTypeComponents(editRow: any, rowIndex: any):
|
|
46
|
+
checkRowVariableTypeComponents(editRow: any, rowIndex: any): boolean;
|
|
47
47
|
setVariableTypeComponents(): void;
|
|
48
48
|
variableTypeComponentsIndexes: any[] | undefined;
|
|
49
49
|
isOpen(editRow: any): boolean;
|
|
@@ -289,12 +289,15 @@ export default class EditGridComponent extends NestedArrayComponent {
|
|
|
289
289
|
}
|
|
290
290
|
checkRowVariableTypeComponents(editRow, rowIndex) {
|
|
291
291
|
const rowComponents = editRow.components;
|
|
292
|
+
let typeChanged = false;
|
|
292
293
|
if (_.some(this.variableTypeComponentsIndexes, (compIndex) => {
|
|
293
294
|
const variableTypeComp = rowComponents[compIndex];
|
|
294
295
|
return variableTypeComp.type !== variableTypeComp.component.type;
|
|
295
296
|
})) {
|
|
296
297
|
editRow.components = this.createRowComponents(editRow.data, rowIndex, true);
|
|
298
|
+
typeChanged = true;
|
|
297
299
|
}
|
|
300
|
+
return typeChanged;
|
|
298
301
|
}
|
|
299
302
|
setVariableTypeComponents() {
|
|
300
303
|
//set components which type is changing within a row (e.g.,by mergeComponentSchema action)
|
|
@@ -942,8 +945,10 @@ export default class EditGridComponent extends NestedArrayComponent {
|
|
|
942
945
|
this.validateRow(editRow, false);
|
|
943
946
|
}
|
|
944
947
|
if (this.variableTypeComponentsIndexes.length) {
|
|
945
|
-
this.checkRowVariableTypeComponents(editRow, rowIndex);
|
|
946
|
-
|
|
948
|
+
const typeChanged = this.checkRowVariableTypeComponents(editRow, rowIndex);
|
|
949
|
+
if (typeChanged) {
|
|
950
|
+
this.redraw();
|
|
951
|
+
}
|
|
947
952
|
}
|
|
948
953
|
};
|
|
949
954
|
const comp = this.createComponent(_.assign({}, column, { row: options.row }), options, row, null, recreatePartially && currentRowComponents ? currentRowComponents[colIndex] : null);
|
package/lib/mjs/formio.form.js
CHANGED
|
@@ -56,7 +56,6 @@ export function registerModule(mod, defaultFn = null, options = {}) {
|
|
|
56
56
|
case 'templates':
|
|
57
57
|
for (const framework of Object.keys(mod.templates)) {
|
|
58
58
|
Formio.Templates.extendTemplate(framework, mod.templates[framework]);
|
|
59
|
-
Formio.Templates.defaultTemplates = _.defaults(mod.templates[framework], Formio.Templates.defaultTemplates);
|
|
60
59
|
}
|
|
61
60
|
if (mod.templates[current]) {
|
|
62
61
|
Formio.Templates.current = mod.templates[current];
|