@formio/js 5.0.0-dev.5613.3476921 → 5.0.0-dev.5614.ea3660d
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 +18 -18
- package/dist/formio.form.min.js +1 -1
- package/dist/formio.full.js +20 -20
- package/dist/formio.full.min.js +1 -1
- package/dist/formio.utils.js +1 -1
- package/dist/formio.utils.min.js +1 -1
- package/lib/cjs/Element.d.ts +1 -2
- package/lib/cjs/Element.js +8 -17
- package/lib/cjs/Form.js +1 -15
- package/lib/cjs/PDF.js +1 -8
- package/lib/cjs/PDFBuilder.js +3 -3
- package/lib/cjs/Webform.d.ts +1 -0
- package/lib/cjs/Webform.js +12 -17
- package/lib/cjs/WebformBuilder.d.ts +1 -0
- package/lib/cjs/WebformBuilder.js +10 -5
- package/lib/cjs/Wizard.js +1 -1
- package/lib/cjs/addons/FormioAddon.d.ts +0 -1
- package/lib/cjs/components/_classes/component/Component.d.ts +4 -7
- package/lib/cjs/components/_classes/component/Component.js +8 -45
- package/lib/cjs/components/_classes/input/Input.js +1 -16
- package/lib/cjs/components/_classes/nested/NestedComponent.d.ts +2 -2
- package/lib/cjs/components/_classes/nested/NestedComponent.js +7 -8
- package/lib/cjs/components/columns/Columns.js +2 -2
- package/lib/cjs/components/editgrid/EditGrid.d.ts +1 -1
- package/lib/cjs/components/editgrid/EditGrid.js +7 -21
- package/lib/cjs/components/file/File.d.ts +0 -1
- package/lib/cjs/components/file/File.js +2 -2
- package/lib/cjs/components/form/Form.js +3 -3
- package/lib/cjs/components/select/Select.js +2 -4
- package/lib/cjs/components/table/Table.d.ts +1 -0
- package/lib/cjs/components/table/Table.js +1 -1
- package/lib/cjs/components/tags/Tags.js +2 -4
- package/lib/cjs/translations/en.d.ts +0 -1
- package/lib/cjs/translations/en.js +0 -1
- package/lib/cjs/utils/utils.d.ts +1 -1
- package/lib/cjs/utils/utils.js +2 -14
- package/lib/cjs/widgets/CalendarWidget.js +2 -2
- package/lib/mjs/Element.d.ts +1 -2
- package/lib/mjs/Element.js +8 -17
- package/lib/mjs/Form.js +1 -15
- package/lib/mjs/PDF.js +1 -8
- package/lib/mjs/PDFBuilder.js +3 -3
- package/lib/mjs/Webform.d.ts +1 -0
- package/lib/mjs/Webform.js +12 -17
- package/lib/mjs/WebformBuilder.d.ts +1 -0
- package/lib/mjs/WebformBuilder.js +9 -5
- package/lib/mjs/Wizard.js +1 -1
- package/lib/mjs/addons/FormioAddon.d.ts +0 -1
- package/lib/mjs/components/_classes/component/Component.d.ts +4 -7
- package/lib/mjs/components/_classes/component/Component.js +8 -45
- package/lib/mjs/components/_classes/input/Input.js +1 -16
- package/lib/mjs/components/_classes/nested/NestedComponent.d.ts +2 -2
- package/lib/mjs/components/_classes/nested/NestedComponent.js +7 -8
- package/lib/mjs/components/columns/Columns.js +2 -2
- package/lib/mjs/components/editgrid/EditGrid.d.ts +1 -1
- package/lib/mjs/components/editgrid/EditGrid.js +7 -20
- package/lib/mjs/components/file/File.d.ts +0 -1
- package/lib/mjs/components/file/File.js +2 -2
- package/lib/mjs/components/form/Form.js +3 -3
- package/lib/mjs/components/select/Select.js +2 -4
- package/lib/mjs/components/table/Table.d.ts +1 -0
- package/lib/mjs/components/table/Table.js +1 -1
- package/lib/mjs/components/tags/Tags.js +2 -4
- package/lib/mjs/translations/en.d.ts +0 -1
- package/lib/mjs/translations/en.js +0 -1
- package/lib/mjs/utils/utils.d.ts +1 -1
- package/lib/mjs/utils/utils.js +1 -2
- package/lib/mjs/widgets/CalendarWidget.js +2 -2
- package/package.json +1 -1
|
@@ -567,19 +567,15 @@ export default class EditGridComponent extends NestedArrayComponent {
|
|
|
567
567
|
return this.builderMode
|
|
568
568
|
? super.getComponents()
|
|
569
569
|
: _.isNumber(rowIndex)
|
|
570
|
-
? (this.editRows[rowIndex]
|
|
570
|
+
? (this.editRows[rowIndex].components || [])
|
|
571
571
|
: this.editRows.reduce((result, row) => result.concat(row.components || []), []);
|
|
572
572
|
}
|
|
573
|
-
|
|
574
|
-
this.calculatedValue = undefined;
|
|
575
|
-
super.destroy(all);
|
|
576
|
-
}
|
|
577
|
-
destroyComponents(all = false, rowIndex = 0) {
|
|
573
|
+
destroyComponents(rowIndex) {
|
|
578
574
|
if (this.builderMode) {
|
|
579
|
-
return super.destroyComponents(
|
|
575
|
+
return super.destroyComponents();
|
|
580
576
|
}
|
|
581
577
|
const components = this.getComponents(rowIndex).slice();
|
|
582
|
-
components.forEach((comp) => this.removeComponent(comp, this.components
|
|
578
|
+
components.forEach((comp) => this.removeComponent(comp, this.components));
|
|
583
579
|
}
|
|
584
580
|
createRow(dataObj, rowIndex) {
|
|
585
581
|
const editRow = {
|
|
@@ -752,7 +748,7 @@ export default class EditGridComponent extends NestedArrayComponent {
|
|
|
752
748
|
case EditRowState.New: {
|
|
753
749
|
editRow.state = EditRowState.Removed;
|
|
754
750
|
this.clearErrors(rowIndex);
|
|
755
|
-
this.destroyComponents(
|
|
751
|
+
this.destroyComponents(rowIndex);
|
|
756
752
|
if (this.inlineEditMode) {
|
|
757
753
|
this.splice(rowIndex);
|
|
758
754
|
}
|
|
@@ -870,7 +866,7 @@ export default class EditGridComponent extends NestedArrayComponent {
|
|
|
870
866
|
baseRemoveRow(rowIndex) {
|
|
871
867
|
const editRow = this.editRows[rowIndex];
|
|
872
868
|
editRow.state = EditRowState.Removed;
|
|
873
|
-
this.destroyComponents(
|
|
869
|
+
this.destroyComponents(rowIndex);
|
|
874
870
|
return editRow;
|
|
875
871
|
}
|
|
876
872
|
removeRow(rowIndex, modified) {
|
|
@@ -893,15 +889,6 @@ export default class EditGridComponent extends NestedArrayComponent {
|
|
|
893
889
|
this.redraw();
|
|
894
890
|
}
|
|
895
891
|
createRowComponents(row, rowIndex, recreatePartially) {
|
|
896
|
-
// Iterate through existing components and destroy the ones with the same rowIndex.
|
|
897
|
-
if (this.components) {
|
|
898
|
-
for (let i = 0; i < this.components.length; i++) {
|
|
899
|
-
if (this.components[i].rowIndex === rowIndex) {
|
|
900
|
-
this.components[i].destroy();
|
|
901
|
-
this.components.splice(i, 1);
|
|
902
|
-
}
|
|
903
|
-
}
|
|
904
|
-
}
|
|
905
892
|
const currentRowComponents = _.get(this.editRows, `[${rowIndex}].components`, null);
|
|
906
893
|
return this.component.components.map((col, colIndex) => {
|
|
907
894
|
if (recreatePartially && currentRowComponents && this.variableTypeComponentsIndexes.length) {
|
|
@@ -1181,7 +1168,7 @@ export default class EditGridComponent extends NestedArrayComponent {
|
|
|
1181
1168
|
});
|
|
1182
1169
|
}
|
|
1183
1170
|
emptyRows() {
|
|
1184
|
-
this.editRows.forEach((editRow, index) => this.destroyComponents(
|
|
1171
|
+
this.editRows.forEach((editRow, index) => this.destroyComponents(index));
|
|
1185
1172
|
this.editRows = [];
|
|
1186
1173
|
}
|
|
1187
1174
|
resetValue() {
|
|
@@ -329,13 +329,13 @@ export default class FormComponent extends Component {
|
|
|
329
329
|
&& _.isNumber(this.formObj._vid)
|
|
330
330
|
&& this.formObj._vid !== this.subFormRevision;
|
|
331
331
|
}
|
|
332
|
-
destroy(
|
|
332
|
+
destroy() {
|
|
333
333
|
if (this.subForm) {
|
|
334
|
-
this.subForm.destroy(
|
|
334
|
+
this.subForm.destroy();
|
|
335
335
|
this.subForm = null;
|
|
336
336
|
this.subFormReady = null;
|
|
337
337
|
}
|
|
338
|
-
super.destroy(
|
|
338
|
+
super.destroy();
|
|
339
339
|
}
|
|
340
340
|
redraw() {
|
|
341
341
|
if (this.subForm) {
|
|
@@ -840,9 +840,7 @@ export default class SelectComponent extends ListComponent {
|
|
|
840
840
|
}
|
|
841
841
|
const tabIndex = input.tabIndex;
|
|
842
842
|
this.addPlaceholder();
|
|
843
|
-
|
|
844
|
-
input.setAttribute('dir', this.i18next.dir());
|
|
845
|
-
}
|
|
843
|
+
input.setAttribute('dir', this.i18next.dir());
|
|
846
844
|
if (this.choices?.containerOuter?.element?.parentNode) {
|
|
847
845
|
this.choices.destroy();
|
|
848
846
|
}
|
|
@@ -1570,6 +1568,7 @@ export default class SelectComponent extends ListComponent {
|
|
|
1570
1568
|
: '-';
|
|
1571
1569
|
}
|
|
1572
1570
|
detach() {
|
|
1571
|
+
super.detach();
|
|
1573
1572
|
this.off('blur');
|
|
1574
1573
|
if (this.choices) {
|
|
1575
1574
|
if (this.choices.containerOuter?.element?.parentNode) {
|
|
@@ -1577,7 +1576,6 @@ export default class SelectComponent extends ListComponent {
|
|
|
1577
1576
|
}
|
|
1578
1577
|
this.choices = null;
|
|
1579
1578
|
}
|
|
1580
|
-
super.detach();
|
|
1581
1579
|
}
|
|
1582
1580
|
focus() {
|
|
1583
1581
|
if (this.focusableElement) {
|
|
@@ -59,9 +59,7 @@ export default class TagsComponent extends Input {
|
|
|
59
59
|
if (!element) {
|
|
60
60
|
return;
|
|
61
61
|
}
|
|
62
|
-
|
|
63
|
-
element.setAttribute('dir', this.i18next.dir());
|
|
64
|
-
}
|
|
62
|
+
element.setAttribute('dir', this.i18next.dir());
|
|
65
63
|
if (this.choices) {
|
|
66
64
|
this.choices.destroy();
|
|
67
65
|
}
|
|
@@ -108,11 +106,11 @@ export default class TagsComponent extends Input {
|
|
|
108
106
|
});
|
|
109
107
|
}
|
|
110
108
|
detach() {
|
|
109
|
+
super.detach();
|
|
111
110
|
if (this.choices) {
|
|
112
111
|
this.choices.destroy();
|
|
113
112
|
this.choices = null;
|
|
114
113
|
}
|
|
115
|
-
super.detach();
|
|
116
114
|
}
|
|
117
115
|
normalizeValue(value) {
|
|
118
116
|
if (this.component.storeas === 'string' && Array.isArray(value)) {
|
|
@@ -71,5 +71,4 @@ export default {
|
|
|
71
71
|
submitButtonAriaLabel: 'Submit Form button. Click to submit the form',
|
|
72
72
|
reCaptchaTokenValidationError: 'ReCAPTCHA: Token validation error',
|
|
73
73
|
reCaptchaTokenNotSpecifiedError: 'ReCAPTCHA: Token is not specified in submission',
|
|
74
|
-
apiKey: 'API Key is not unique: {{key}}'
|
|
75
74
|
};
|
package/lib/mjs/utils/utils.d.ts
CHANGED
|
@@ -374,4 +374,4 @@ import jsonLogic from 'json-logic-js';
|
|
|
374
374
|
import ConditionOperators from './conditionOperators';
|
|
375
375
|
import Evaluator from './Evaluator';
|
|
376
376
|
export const interpolate: (rawTemplate: any, data: any, _options: any) => any;
|
|
377
|
-
export { jsonLogic, ConditionOperators, Evaluator, _ };
|
|
377
|
+
export { jsonLogic, moment, ConditionOperators, Evaluator, _ };
|
package/lib/mjs/utils/utils.js
CHANGED
|
@@ -28,8 +28,7 @@ jsonLogic.add_operation('relativeMinDate', (relativeMinDate) => {
|
|
|
28
28
|
jsonLogic.add_operation('relativeMaxDate', (relativeMaxDate) => {
|
|
29
29
|
return moment().add(relativeMaxDate, 'days').toISOString();
|
|
30
30
|
});
|
|
31
|
-
export { jsonLogic, ConditionOperators };
|
|
32
|
-
export * as moment from 'moment-timezone/moment-timezone';
|
|
31
|
+
export { jsonLogic, moment, ConditionOperators };
|
|
33
32
|
function setPathToComponentAndPerentSchema(component) {
|
|
34
33
|
component.path = getComponentPath(component);
|
|
35
34
|
const dataParent = getDataParentComponent(component);
|
|
@@ -457,10 +457,10 @@ export default class CalendarWidget extends InputWidget {
|
|
|
457
457
|
return Flatpickr.formatDate(date, format);
|
|
458
458
|
};
|
|
459
459
|
}
|
|
460
|
-
destroy(
|
|
460
|
+
destroy() {
|
|
461
|
+
super.destroy();
|
|
461
462
|
if (this.calendar) {
|
|
462
463
|
this.calendar.destroy();
|
|
463
464
|
}
|
|
464
|
-
super.destroy(all);
|
|
465
465
|
}
|
|
466
466
|
}
|