@formio/js 5.0.0-dev.5673.3d062b9 → 5.0.0-dev.5673.ae99c16
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/Changelog.md +63 -1
- package/dist/formio.builder.css +0 -1
- package/dist/formio.builder.min.css +1 -1
- package/dist/formio.embed.js +1 -1
- package/dist/formio.embed.min.js +1 -1
- package/dist/formio.form.css +0 -1
- package/dist/formio.form.js +646 -594
- package/dist/formio.form.min.css +1 -1
- package/dist/formio.form.min.js +1 -1
- package/dist/formio.form.min.js.LICENSE.txt +1 -9
- package/dist/formio.full.css +0 -1
- package/dist/formio.full.js +633 -601
- package/dist/formio.full.min.css +1 -1
- package/dist/formio.full.min.js +1 -1
- package/dist/formio.full.min.js.LICENSE.txt +1 -9
- package/dist/formio.js +4 -4
- package/dist/formio.min.js +1 -1
- package/dist/formio.utils.js +100 -38
- package/dist/formio.utils.min.js +1 -1
- package/dist/formio.utils.min.js.LICENSE.txt +5 -3
- package/lib/cjs/CDN.d.ts +1 -0
- package/lib/cjs/CDN.js +2 -2
- package/lib/cjs/Form.d.ts +2 -2
- package/lib/cjs/Form.js +11 -5
- package/lib/cjs/Formio.js +1 -0
- package/lib/cjs/PDF.js +1 -1
- package/lib/cjs/PDFBuilder.js +2 -1
- package/lib/cjs/Webform.d.ts +1 -1
- package/lib/cjs/Webform.js +11 -6
- package/lib/cjs/WebformBuilder.js +13 -3
- package/lib/cjs/Wizard.js +1 -1
- package/lib/cjs/components/_classes/component/Component.d.ts +4 -3
- package/lib/cjs/components/_classes/component/Component.js +31 -8
- package/lib/cjs/components/_classes/component/editForm/Component.edit.display.js +8 -0
- package/lib/cjs/components/_classes/component/fixtures/comp7.d.ts +84 -0
- package/lib/cjs/components/_classes/component/fixtures/comp7.js +86 -0
- package/lib/cjs/components/_classes/component/fixtures/index.d.ts +2 -1
- package/lib/cjs/components/_classes/component/fixtures/index.js +3 -1
- package/lib/cjs/components/_classes/input/Input.js +23 -1
- package/lib/cjs/components/_classes/multivalue/Multivalue.d.ts +9 -2
- package/lib/cjs/components/_classes/multivalue/Multivalue.js +53 -26
- package/lib/cjs/components/_classes/nested/NestedComponent.d.ts +2 -1
- package/lib/cjs/components/_classes/nested/NestedComponent.js +5 -1
- package/lib/cjs/components/_classes/nestedarray/NestedArrayComponent.d.ts +3 -0
- package/lib/cjs/components/_classes/nestedarray/NestedArrayComponent.js +56 -29
- package/lib/cjs/components/address/Address.d.ts +6 -0
- package/lib/cjs/components/address/Address.js +11 -1
- package/lib/cjs/components/address/editForm/Address.edit.provider.js +1 -1
- package/lib/cjs/components/checkbox/Checkbox.d.ts +1 -1
- package/lib/cjs/components/checkbox/Checkbox.js +1 -1
- package/lib/cjs/components/checkbox/fixtures/comp6.d.ts +32 -0
- package/lib/cjs/components/checkbox/fixtures/comp6.js +30 -0
- package/lib/cjs/components/checkbox/fixtures/index.d.ts +2 -1
- package/lib/cjs/components/checkbox/fixtures/index.js +3 -1
- package/lib/cjs/components/currency/Currency.d.ts +2 -0
- package/lib/cjs/components/datagrid/DataGrid.d.ts +11 -1
- package/lib/cjs/components/datagrid/DataGrid.js +59 -36
- package/lib/cjs/components/datagrid/fixtures/comp-with-reorder.d.ts +100 -0
- package/lib/cjs/components/datagrid/fixtures/comp-with-reorder.js +139 -0
- package/lib/cjs/components/datagrid/fixtures/comp10.d.ts +81 -0
- package/lib/cjs/components/datagrid/fixtures/comp10.js +87 -0
- package/lib/cjs/components/datagrid/fixtures/comp11.d.ts +50 -0
- package/lib/cjs/components/datagrid/fixtures/comp11.js +55 -0
- package/lib/cjs/components/datagrid/fixtures/comp9.d.ts +41 -0
- package/lib/cjs/components/datagrid/fixtures/comp9.js +44 -0
- package/lib/cjs/components/datagrid/fixtures/index.d.ts +5 -1
- package/lib/cjs/components/datagrid/fixtures/index.js +9 -1
- package/lib/cjs/components/datamap/DataMap.js +2 -2
- package/lib/cjs/components/datetime/fixtures/comp14.d.ts +35 -0
- package/lib/cjs/components/datetime/fixtures/comp14.js +38 -0
- package/lib/cjs/components/datetime/fixtures/index.d.ts +6 -5
- package/lib/cjs/components/datetime/fixtures/index.js +3 -1
- package/lib/cjs/components/day/Day.d.ts +3 -4
- package/lib/cjs/components/day/Day.js +31 -10
- package/lib/cjs/components/day/fixtures/comp8.d.ts +41 -0
- package/lib/cjs/components/day/fixtures/comp8.js +40 -0
- package/lib/cjs/components/day/fixtures/index.d.ts +2 -1
- package/lib/cjs/components/day/fixtures/index.js +3 -1
- package/lib/cjs/components/editgrid/EditGrid.js +16 -8
- package/lib/cjs/components/editgrid/fixtures/comp-test-events.d.ts +54 -0
- package/lib/cjs/components/editgrid/fixtures/comp-test-events.js +54 -0
- package/lib/cjs/components/editgrid/fixtures/comp16.d.ts +52 -0
- package/lib/cjs/components/editgrid/fixtures/comp16.js +71 -0
- package/lib/cjs/components/editgrid/fixtures/comp17.d.ts +80 -0
- package/lib/cjs/components/editgrid/fixtures/comp17.js +99 -0
- package/lib/cjs/components/editgrid/fixtures/index.d.ts +10 -7
- package/lib/cjs/components/editgrid/fixtures/index.js +7 -1
- package/lib/cjs/components/file/File.d.ts +2 -2
- package/lib/cjs/components/file/File.js +13 -2
- package/lib/cjs/components/file/editForm/File.edit.display.js +1 -1
- package/lib/cjs/components/form/Form.d.ts +1 -1
- package/lib/cjs/components/form/Form.js +1 -1
- package/lib/cjs/components/form/editForm/Form.edit.form.js +1 -1
- package/lib/cjs/components/form/fixtures/index.d.ts +2 -1
- package/lib/cjs/components/form/fixtures/index.js +3 -1
- package/lib/cjs/components/form/fixtures/nestedWizardForm.d.ts +771 -0
- package/lib/cjs/components/form/fixtures/nestedWizardForm.js +765 -0
- package/lib/cjs/components/html/HTML.js +1 -1
- package/lib/cjs/components/number/Number.d.ts +17 -2
- package/lib/cjs/components/number/Number.js +27 -7
- package/lib/cjs/components/number/fixtures/comp10.d.ts +18 -0
- package/lib/cjs/components/number/fixtures/comp10.js +21 -0
- package/lib/cjs/components/number/fixtures/comp8.d.ts +32 -0
- package/lib/cjs/components/number/fixtures/comp8.js +28 -0
- package/lib/cjs/components/number/fixtures/comp9.d.ts +18 -0
- package/lib/cjs/components/number/fixtures/comp9.js +21 -0
- package/lib/cjs/components/number/fixtures/index.d.ts +4 -1
- package/lib/cjs/components/number/fixtures/index.js +7 -1
- package/lib/cjs/components/panel/Panel.d.ts +1 -0
- package/lib/cjs/components/panel/Panel.js +1 -0
- package/lib/cjs/components/phonenumber/fixtures/comp2.d.ts +16 -0
- package/lib/cjs/components/phonenumber/fixtures/comp2.js +25 -0
- package/lib/cjs/components/phonenumber/fixtures/index.d.ts +2 -1
- package/lib/cjs/components/phonenumber/fixtures/index.js +3 -1
- package/lib/cjs/components/radio/Radio.d.ts +2 -18
- package/lib/cjs/components/radio/Radio.js +29 -27
- package/lib/cjs/components/radio/fixtures/comp12.d.ts +29 -0
- package/lib/cjs/components/radio/fixtures/comp12.js +36 -0
- package/lib/cjs/components/radio/fixtures/index.d.ts +2 -1
- package/lib/cjs/components/radio/fixtures/index.js +3 -1
- package/lib/cjs/components/recaptcha/ReCaptcha.d.ts +6 -0
- package/lib/cjs/components/recaptcha/ReCaptcha.js +6 -0
- package/lib/cjs/components/select/Select.d.ts +38 -0
- package/lib/cjs/components/select/Select.js +14 -5
- package/lib/cjs/components/select/fixtures/comp25.d.ts +59 -0
- package/lib/cjs/components/select/fixtures/comp25.js +66 -0
- package/lib/cjs/components/select/fixtures/comp26.d.ts +44 -0
- package/lib/cjs/components/select/fixtures/comp26.js +59 -0
- package/lib/cjs/components/select/fixtures/index.d.ts +3 -1
- package/lib/cjs/components/select/fixtures/index.js +5 -1
- package/lib/cjs/components/selectboxes/SelectBoxes.d.ts +0 -22
- package/lib/cjs/components/selectboxes/SelectBoxes.js +12 -9
- package/lib/cjs/components/signature/editForm/Signature.edit.display.d.ts +0 -6
- package/lib/cjs/components/signature/editForm/Signature.edit.display.js +0 -1
- package/lib/cjs/components/tags/Tags.js +3 -3
- package/lib/cjs/components/time/Time.d.ts +2 -2
- package/lib/cjs/components/time/Time.form.js +2 -2
- package/lib/cjs/components/time/Time.js +3 -7
- package/lib/cjs/components/time/fixtures/comp4.d.ts +166 -0
- package/lib/cjs/components/time/fixtures/comp4.js +171 -0
- package/lib/cjs/components/time/fixtures/index.d.ts +2 -1
- package/lib/cjs/components/time/fixtures/index.js +3 -1
- package/lib/cjs/providers/address/GoogleAddressProvider.d.ts +5 -0
- package/lib/cjs/providers/address/GoogleAddressProvider.js +23 -1
- package/lib/cjs/templates/Templates.js +1 -1
- package/lib/cjs/translations/en.d.ts +4 -0
- package/lib/cjs/translations/en.js +5 -1
- package/lib/cjs/utils/conditionOperators/IsEmptyValue.js +2 -2
- package/lib/cjs/utils/utils.d.ts +2 -11
- package/lib/cjs/utils/utils.js +60 -24
- package/lib/cjs/widgets/CalendarWidget.js +24 -10
- package/lib/mjs/CDN.d.ts +1 -0
- package/lib/mjs/CDN.js +2 -2
- package/lib/mjs/Form.d.ts +2 -2
- package/lib/mjs/Form.js +11 -5
- package/lib/mjs/Formio.js +1 -0
- package/lib/mjs/PDF.js +1 -1
- package/lib/mjs/PDFBuilder.js +1 -1
- package/lib/mjs/Webform.d.ts +1 -1
- package/lib/mjs/Webform.js +15 -6
- package/lib/mjs/WebformBuilder.js +12 -3
- package/lib/mjs/Wizard.js +1 -1
- package/lib/mjs/components/_classes/component/Component.d.ts +4 -3
- package/lib/mjs/components/_classes/component/Component.js +17 -5
- package/lib/mjs/components/_classes/component/editForm/Component.edit.display.js +8 -0
- package/lib/mjs/components/_classes/component/fixtures/comp7.d.ts +84 -0
- package/lib/mjs/components/_classes/component/fixtures/comp7.js +84 -0
- package/lib/mjs/components/_classes/component/fixtures/index.d.ts +2 -1
- package/lib/mjs/components/_classes/component/fixtures/index.js +2 -1
- package/lib/mjs/components/_classes/input/Input.js +22 -1
- package/lib/mjs/components/_classes/multivalue/Multivalue.d.ts +9 -2
- package/lib/mjs/components/_classes/multivalue/Multivalue.js +53 -26
- package/lib/mjs/components/_classes/nested/NestedComponent.d.ts +2 -1
- package/lib/mjs/components/_classes/nested/NestedComponent.js +5 -1
- package/lib/mjs/components/_classes/nestedarray/NestedArrayComponent.d.ts +3 -0
- package/lib/mjs/components/_classes/nestedarray/NestedArrayComponent.js +57 -29
- package/lib/mjs/components/address/Address.d.ts +6 -0
- package/lib/mjs/components/address/Address.js +14 -1
- package/lib/mjs/components/address/editForm/Address.edit.provider.js +1 -1
- package/lib/mjs/components/checkbox/Checkbox.d.ts +1 -1
- package/lib/mjs/components/checkbox/Checkbox.js +1 -1
- package/lib/mjs/components/checkbox/fixtures/comp6.d.ts +32 -0
- package/lib/mjs/components/checkbox/fixtures/comp6.js +28 -0
- package/lib/mjs/components/checkbox/fixtures/index.d.ts +2 -1
- package/lib/mjs/components/checkbox/fixtures/index.js +2 -1
- package/lib/mjs/components/currency/Currency.d.ts +2 -0
- package/lib/mjs/components/datagrid/DataGrid.d.ts +11 -1
- package/lib/mjs/components/datagrid/DataGrid.js +58 -35
- package/lib/mjs/components/datagrid/fixtures/comp-with-reorder.d.ts +100 -0
- package/lib/mjs/components/datagrid/fixtures/comp-with-reorder.js +137 -0
- package/lib/mjs/components/datagrid/fixtures/comp10.d.ts +81 -0
- package/lib/mjs/components/datagrid/fixtures/comp10.js +85 -0
- package/lib/mjs/components/datagrid/fixtures/comp11.d.ts +50 -0
- package/lib/mjs/components/datagrid/fixtures/comp11.js +53 -0
- package/lib/mjs/components/datagrid/fixtures/comp9.d.ts +41 -0
- package/lib/mjs/components/datagrid/fixtures/comp9.js +42 -0
- package/lib/mjs/components/datagrid/fixtures/index.d.ts +5 -1
- package/lib/mjs/components/datagrid/fixtures/index.js +5 -1
- package/lib/mjs/components/datamap/DataMap.js +2 -2
- package/lib/mjs/components/datetime/fixtures/comp14.d.ts +35 -0
- package/lib/mjs/components/datetime/fixtures/comp14.js +36 -0
- package/lib/mjs/components/datetime/fixtures/index.d.ts +6 -5
- package/lib/mjs/components/datetime/fixtures/index.js +2 -1
- package/lib/mjs/components/day/Day.d.ts +3 -4
- package/lib/mjs/components/day/Day.js +30 -10
- package/lib/mjs/components/day/fixtures/comp8.d.ts +41 -0
- package/lib/mjs/components/day/fixtures/comp8.js +38 -0
- package/lib/mjs/components/day/fixtures/index.d.ts +2 -1
- package/lib/mjs/components/day/fixtures/index.js +2 -1
- package/lib/mjs/components/editgrid/EditGrid.js +16 -8
- package/lib/mjs/components/editgrid/fixtures/comp-test-events.d.ts +54 -0
- package/lib/mjs/components/editgrid/fixtures/comp-test-events.js +52 -0
- package/lib/mjs/components/editgrid/fixtures/comp16.d.ts +52 -0
- package/lib/mjs/components/editgrid/fixtures/comp16.js +69 -0
- package/lib/mjs/components/editgrid/fixtures/comp17.d.ts +80 -0
- package/lib/mjs/components/editgrid/fixtures/comp17.js +97 -0
- package/lib/mjs/components/editgrid/fixtures/index.d.ts +10 -7
- package/lib/mjs/components/editgrid/fixtures/index.js +4 -1
- package/lib/mjs/components/file/File.d.ts +2 -2
- package/lib/mjs/components/file/File.js +13 -2
- package/lib/mjs/components/file/editForm/File.edit.display.js +1 -1
- package/lib/mjs/components/form/Form.d.ts +1 -1
- package/lib/mjs/components/form/Form.js +1 -1
- package/lib/mjs/components/form/editForm/Form.edit.form.js +1 -1
- package/lib/mjs/components/form/fixtures/index.d.ts +2 -1
- package/lib/mjs/components/form/fixtures/index.js +2 -1
- package/lib/mjs/components/form/fixtures/nestedWizardForm.d.ts +771 -0
- package/lib/mjs/components/form/fixtures/nestedWizardForm.js +763 -0
- package/lib/mjs/components/html/HTML.js +1 -1
- package/lib/mjs/components/number/Number.d.ts +17 -2
- package/lib/mjs/components/number/Number.js +26 -6
- package/lib/mjs/components/number/fixtures/comp10.d.ts +18 -0
- package/lib/mjs/components/number/fixtures/comp10.js +19 -0
- package/lib/mjs/components/number/fixtures/comp8.d.ts +32 -0
- package/lib/mjs/components/number/fixtures/comp8.js +26 -0
- package/lib/mjs/components/number/fixtures/comp9.d.ts +18 -0
- package/lib/mjs/components/number/fixtures/comp9.js +19 -0
- package/lib/mjs/components/number/fixtures/index.d.ts +4 -1
- package/lib/mjs/components/number/fixtures/index.js +4 -1
- package/lib/mjs/components/panel/Panel.d.ts +1 -0
- package/lib/mjs/components/panel/Panel.js +1 -0
- package/lib/mjs/components/phonenumber/fixtures/comp2.d.ts +16 -0
- package/lib/mjs/components/phonenumber/fixtures/comp2.js +23 -0
- package/lib/mjs/components/phonenumber/fixtures/index.d.ts +2 -1
- package/lib/mjs/components/phonenumber/fixtures/index.js +2 -1
- package/lib/mjs/components/radio/Radio.d.ts +2 -18
- package/lib/mjs/components/radio/Radio.js +32 -30
- package/lib/mjs/components/radio/fixtures/comp12.d.ts +29 -0
- package/lib/mjs/components/radio/fixtures/comp12.js +34 -0
- package/lib/mjs/components/radio/fixtures/index.d.ts +2 -1
- package/lib/mjs/components/radio/fixtures/index.js +2 -1
- package/lib/mjs/components/recaptcha/ReCaptcha.d.ts +6 -0
- package/lib/mjs/components/recaptcha/ReCaptcha.js +9 -0
- package/lib/mjs/components/select/Select.d.ts +38 -0
- package/lib/mjs/components/select/Select.js +17 -6
- package/lib/mjs/components/select/fixtures/comp25.d.ts +59 -0
- package/lib/mjs/components/select/fixtures/comp25.js +64 -0
- package/lib/mjs/components/select/fixtures/comp26.d.ts +44 -0
- package/lib/mjs/components/select/fixtures/comp26.js +57 -0
- package/lib/mjs/components/select/fixtures/index.d.ts +3 -1
- package/lib/mjs/components/select/fixtures/index.js +3 -1
- package/lib/mjs/components/selectboxes/SelectBoxes.d.ts +0 -22
- package/lib/mjs/components/selectboxes/SelectBoxes.js +16 -9
- package/lib/mjs/components/signature/editForm/Signature.edit.display.d.ts +0 -6
- package/lib/mjs/components/signature/editForm/Signature.edit.display.js +0 -1
- package/lib/mjs/components/tags/Tags.js +3 -3
- package/lib/mjs/components/time/Time.d.ts +2 -2
- package/lib/mjs/components/time/Time.form.js +2 -2
- package/lib/mjs/components/time/Time.js +3 -13
- package/lib/mjs/components/time/fixtures/comp4.d.ts +166 -0
- package/lib/mjs/components/time/fixtures/comp4.js +169 -0
- package/lib/mjs/components/time/fixtures/index.d.ts +2 -1
- package/lib/mjs/components/time/fixtures/index.js +2 -1
- package/lib/mjs/providers/address/GoogleAddressProvider.d.ts +5 -0
- package/lib/mjs/providers/address/GoogleAddressProvider.js +22 -1
- package/lib/mjs/templates/Templates.js +1 -1
- package/lib/mjs/translations/en.d.ts +4 -0
- package/lib/mjs/translations/en.js +5 -1
- package/lib/mjs/utils/conditionOperators/IsEmptyValue.js +2 -2
- package/lib/mjs/utils/utils.d.ts +2 -11
- package/lib/mjs/utils/utils.js +59 -13
- package/lib/mjs/widgets/CalendarWidget.js +24 -10
- package/package.json +5 -6
package/lib/mjs/Webform.d.ts
CHANGED
|
@@ -334,7 +334,7 @@ declare class Webform extends NestedDataComponent {
|
|
|
334
334
|
* Sets the submission value
|
|
335
335
|
* @param {object|null|undefined} submission - The submission to set.
|
|
336
336
|
* @param {object|null|undefined} flags - Any flags to apply when setting the submission.
|
|
337
|
-
* @
|
|
337
|
+
* @returns {void}
|
|
338
338
|
*/
|
|
339
339
|
onSetSubmission(submission: object | null | undefined, flags?: object | null | undefined): void;
|
|
340
340
|
/**
|
package/lib/mjs/Webform.js
CHANGED
|
@@ -8,6 +8,10 @@ import Components from "./components/Components";
|
|
|
8
8
|
import NestedDataComponent from "./components/_classes/nesteddata/NestedDataComponent";
|
|
9
9
|
import { fastCloneDeep, currentTimezone, unescapeHTML, getStringFromComponentPath, convertStringToHTMLElement, getArrayFromComponentPath, } from "./utils/utils";
|
|
10
10
|
import { eachComponent } from "./utils/formUtils";
|
|
11
|
+
// We need this here because dragula pulls in CustomEvent class that requires global to exist.
|
|
12
|
+
if (typeof window !== 'undefined' && typeof window.global === 'undefined') {
|
|
13
|
+
window.global = window;
|
|
14
|
+
}
|
|
11
15
|
// Initialize the available forms.
|
|
12
16
|
Formio.forms = {};
|
|
13
17
|
// Allow people to register components.
|
|
@@ -700,7 +704,7 @@ export default class Webform extends NestedDataComponent {
|
|
|
700
704
|
* Sets the submission value
|
|
701
705
|
* @param {object|null|undefined} submission - The submission to set.
|
|
702
706
|
* @param {object|null|undefined} flags - Any flags to apply when setting the submission.
|
|
703
|
-
* @
|
|
707
|
+
* @returns {void}
|
|
704
708
|
*/
|
|
705
709
|
onSetSubmission(submission, flags = {}) {
|
|
706
710
|
this.submissionSet = true;
|
|
@@ -826,7 +830,6 @@ export default class Webform extends NestedDataComponent {
|
|
|
826
830
|
if (!submission || !submission.data) {
|
|
827
831
|
submission = {
|
|
828
832
|
data: {},
|
|
829
|
-
metadata: submission.metadata,
|
|
830
833
|
};
|
|
831
834
|
}
|
|
832
835
|
// Metadata needs to be available before setValue
|
|
@@ -886,7 +889,9 @@ export default class Webform extends NestedDataComponent {
|
|
|
886
889
|
this.addComponents();
|
|
887
890
|
this.on("submitButton", (options) => {
|
|
888
891
|
this.submit(false, options).catch((e) => {
|
|
889
|
-
options
|
|
892
|
+
if (options?.instance) {
|
|
893
|
+
options.instance.loading = false;
|
|
894
|
+
}
|
|
890
895
|
return e !== false && e !== undefined && console.log(e);
|
|
891
896
|
});
|
|
892
897
|
}, true);
|
|
@@ -1128,7 +1133,7 @@ export default class Webform extends NestedDataComponent {
|
|
|
1128
1133
|
});
|
|
1129
1134
|
const displayedErrors = [];
|
|
1130
1135
|
if (errors.length) {
|
|
1131
|
-
errors = _.uniqBy(errors, (error) => error.message);
|
|
1136
|
+
errors = _.uniqBy(errors, (error) => [error.message, error.component?.id, error.context?.path].join());
|
|
1132
1137
|
const createListItem = (message, index) => {
|
|
1133
1138
|
const err = errors[index];
|
|
1134
1139
|
const messageFromIndex = !_.isUndefined(index) && errors && errors[index];
|
|
@@ -1242,10 +1247,14 @@ export default class Webform extends NestedDataComponent {
|
|
|
1242
1247
|
}
|
|
1243
1248
|
this.checkData(value.data, flags);
|
|
1244
1249
|
const shouldValidate = !flags.noValidate ||
|
|
1245
|
-
flags.
|
|
1250
|
+
flags.fromIframe ||
|
|
1246
1251
|
(flags.fromSubmission && this.rootPristine && this.pristine && flags.changed);
|
|
1247
1252
|
const errors = shouldValidate
|
|
1248
|
-
? this.validate(value.data, {
|
|
1253
|
+
? this.validate(value.data, {
|
|
1254
|
+
...flags,
|
|
1255
|
+
noValidate: false,
|
|
1256
|
+
process: 'change'
|
|
1257
|
+
})
|
|
1249
1258
|
: [];
|
|
1250
1259
|
value.isValid = errors.length === 0;
|
|
1251
1260
|
this.loading = false;
|
|
@@ -187,7 +187,8 @@ export default class WebformBuilder extends Component {
|
|
|
187
187
|
params: {
|
|
188
188
|
type: 'resource',
|
|
189
189
|
limit: 1000000,
|
|
190
|
-
select: '_id,title,name,components'
|
|
190
|
+
select: '_id,title,name,components',
|
|
191
|
+
'tags__ne': 'noBuilderResource'
|
|
191
192
|
}
|
|
192
193
|
};
|
|
193
194
|
if (this.options && this.options.resourceTag) {
|
|
@@ -892,7 +893,11 @@ export default class WebformBuilder extends Component {
|
|
|
892
893
|
if (form && form.properties) {
|
|
893
894
|
this.options.properties = form.properties;
|
|
894
895
|
}
|
|
895
|
-
|
|
896
|
+
let keyboardActionsEnabled = _.get(this.options, 'keyboardBuilder', false) || this.options.properties?.keyboardBuilder;
|
|
897
|
+
if (typeof keyboardActionsEnabled === 'string') {
|
|
898
|
+
keyboardActionsEnabled = keyboardActionsEnabled === 'true';
|
|
899
|
+
}
|
|
900
|
+
this.keyboardActionsEnabled = keyboardActionsEnabled;
|
|
896
901
|
const isShowSubmitButton = !this.options.noDefaultSubmitButton
|
|
897
902
|
&& (!form.components.length || !form.components.find(comp => comp.key === 'submit'));
|
|
898
903
|
// Ensure there is at least a submit button.
|
|
@@ -1044,7 +1049,10 @@ export default class WebformBuilder extends Component {
|
|
|
1044
1049
|
'calculateValue',
|
|
1045
1050
|
'conditional',
|
|
1046
1051
|
'customConditional',
|
|
1047
|
-
'id'
|
|
1052
|
+
'id',
|
|
1053
|
+
'fields.day.required',
|
|
1054
|
+
'fields.month.required',
|
|
1055
|
+
'fields.year.required',
|
|
1048
1056
|
]));
|
|
1049
1057
|
const parentComponent = defaultValueComponent.parent;
|
|
1050
1058
|
let tabIndex = -1;
|
|
@@ -1231,6 +1239,7 @@ export default class WebformBuilder extends Component {
|
|
|
1231
1239
|
helplinks: this.helplinks,
|
|
1232
1240
|
}));
|
|
1233
1241
|
this.editForm.attach(this.componentEdit.querySelector(`[${this._referenceAttributeName}="editForm"]`));
|
|
1242
|
+
this.updateComponent(this.editForm.submission.data ?? component);
|
|
1234
1243
|
this.attachEditComponentControls(component, parent, isNew, original, ComponentClass);
|
|
1235
1244
|
});
|
|
1236
1245
|
});
|
package/lib/mjs/Wizard.js
CHANGED
|
@@ -13,7 +13,7 @@ export default class Wizard extends Webform {
|
|
|
13
13
|
*/
|
|
14
14
|
constructor(elementOrOptions = undefined, _options = undefined) {
|
|
15
15
|
let element, options;
|
|
16
|
-
if (elementOrOptions instanceof HTMLElement ||
|
|
16
|
+
if (elementOrOptions instanceof HTMLElement || _options) {
|
|
17
17
|
element = elementOrOptions;
|
|
18
18
|
options = _options || {};
|
|
19
19
|
}
|
|
@@ -346,7 +346,7 @@ declare class Component extends Element {
|
|
|
346
346
|
/**
|
|
347
347
|
* Renders a modal preview template and returns the markup as a string
|
|
348
348
|
* @param {object|null|undefined} ctx - The rendering context
|
|
349
|
-
* @
|
|
349
|
+
* @returns {string} - The modal preview markup
|
|
350
350
|
*/
|
|
351
351
|
renderModalPreview(ctx: object | null | undefined): string;
|
|
352
352
|
/**
|
|
@@ -372,7 +372,7 @@ declare class Component extends Element {
|
|
|
372
372
|
* Creates the tooltip instance using tippy.js and returns it
|
|
373
373
|
* @param {HTMLElement} tooltipEl - HTML element to attach the tooltip
|
|
374
374
|
* @param {object|null|undefined} settings - tippy.js options
|
|
375
|
-
* @
|
|
375
|
+
* @returns {import('tippy.js').Tippy} - tippy.js instance
|
|
376
376
|
*/
|
|
377
377
|
createTooltip(tooltipEl: HTMLElement, settings?: object | null | undefined): import('tippy.js').Tippy;
|
|
378
378
|
/**
|
|
@@ -830,6 +830,7 @@ declare class Component extends Element {
|
|
|
830
830
|
quill: any;
|
|
831
831
|
get shouldSanitizeValue(): boolean;
|
|
832
832
|
addAce(element: any, settings: any, onChange: any): any;
|
|
833
|
+
getDragula(): Promise<any>;
|
|
833
834
|
get tree(): any;
|
|
834
835
|
/**
|
|
835
836
|
* The empty value for this component.
|
|
@@ -1075,7 +1076,7 @@ declare class Component extends Element {
|
|
|
1075
1076
|
elementInfo(): any;
|
|
1076
1077
|
autofocus(): void;
|
|
1077
1078
|
scrollIntoView(element?: any): void;
|
|
1078
|
-
focus(index
|
|
1079
|
+
focus(index: any): void;
|
|
1079
1080
|
/**
|
|
1080
1081
|
* Get `Formio` instance for working with files
|
|
1081
1082
|
* @returns {import('@formio/core').Formio} - The Formio instance file service.
|
|
@@ -1016,7 +1016,7 @@ export default class Component extends Element {
|
|
|
1016
1016
|
/**
|
|
1017
1017
|
* Renders a modal preview template and returns the markup as a string
|
|
1018
1018
|
* @param {object|null|undefined} ctx - The rendering context
|
|
1019
|
-
* @
|
|
1019
|
+
* @returns {string} - The modal preview markup
|
|
1020
1020
|
*/
|
|
1021
1021
|
renderModalPreview(ctx) {
|
|
1022
1022
|
return this.renderTemplate('modalPreview', ctx || {});
|
|
@@ -1084,7 +1084,7 @@ export default class Component extends Element {
|
|
|
1084
1084
|
* Creates the tooltip instance using tippy.js and returns it
|
|
1085
1085
|
* @param {HTMLElement} tooltipEl - HTML element to attach the tooltip
|
|
1086
1086
|
* @param {object|null|undefined} settings - tippy.js options
|
|
1087
|
-
* @
|
|
1087
|
+
* @returns {import('tippy.js').Tippy} - tippy.js instance
|
|
1088
1088
|
*/
|
|
1089
1089
|
createTooltip(tooltipEl, settings = {}) {
|
|
1090
1090
|
const tooltipAttribute = tooltipEl.getAttribute('data-tooltip');
|
|
@@ -2351,6 +2351,13 @@ export default class Component extends Element {
|
|
|
2351
2351
|
return editor;
|
|
2352
2352
|
});
|
|
2353
2353
|
}
|
|
2354
|
+
async getDragula() {
|
|
2355
|
+
return new Promise((resolve) => {
|
|
2356
|
+
return Formio.requireLibrary('dragula', 'dragula', `${Formio.cdn.dragula}/dragula.js`, true, (ready) => {
|
|
2357
|
+
return ready.then(resolve);
|
|
2358
|
+
});
|
|
2359
|
+
});
|
|
2360
|
+
}
|
|
2354
2361
|
get tree() {
|
|
2355
2362
|
return this.component.tree || false;
|
|
2356
2363
|
}
|
|
@@ -2981,7 +2988,7 @@ export default class Component extends Element {
|
|
|
2981
2988
|
this.parent.childErrors.push(...errors);
|
|
2982
2989
|
}
|
|
2983
2990
|
else {
|
|
2984
|
-
_.remove(this.parent.childErrors, (err) => err
|
|
2991
|
+
_.remove(this.parent.childErrors, (err) => (err?.component?.key || err?.context?.key) === this.component.key);
|
|
2985
2992
|
}
|
|
2986
2993
|
}
|
|
2987
2994
|
this.showValidationErrors(errors, data, row, flags);
|
|
@@ -2997,7 +3004,7 @@ export default class Component extends Element {
|
|
|
2997
3004
|
this.parent.childErrors.push(...errors);
|
|
2998
3005
|
}
|
|
2999
3006
|
else {
|
|
3000
|
-
_.remove(this.parent.childErrors, (err) => err
|
|
3007
|
+
_.remove(this.parent.childErrors, (err) => (err?.component?.key || err?.context?.key) === this.component.key);
|
|
3001
3008
|
}
|
|
3002
3009
|
}
|
|
3003
3010
|
return errors.length === 0;
|
|
@@ -3361,6 +3368,10 @@ export default class Component extends Element {
|
|
|
3361
3368
|
const disabled = this.shouldDisabled;
|
|
3362
3369
|
// Change states which won't be recalculated during redrawing
|
|
3363
3370
|
if (this.visible !== visible) {
|
|
3371
|
+
// If the logic is triggered by an event and the action sets the hidden state then the original
|
|
3372
|
+
// component definition must be changed so that the components hidden state does not get flipped back by
|
|
3373
|
+
// the fieldLogic function
|
|
3374
|
+
this.originalComponent.hidden = !visible;
|
|
3364
3375
|
this.visible = visible;
|
|
3365
3376
|
}
|
|
3366
3377
|
if (this.disabled !== disabled) {
|
|
@@ -3414,10 +3425,11 @@ export default class Component extends Element {
|
|
|
3414
3425
|
const { left, top } = element.getBoundingClientRect();
|
|
3415
3426
|
window.scrollTo(left + window.scrollX, top + window.scrollY);
|
|
3416
3427
|
}
|
|
3417
|
-
focus(index
|
|
3428
|
+
focus(index) {
|
|
3418
3429
|
if ('beforeFocus' in this.parent) {
|
|
3419
3430
|
this.parent.beforeFocus(this);
|
|
3420
3431
|
}
|
|
3432
|
+
index = index || this.refs.input?.length - 1;
|
|
3421
3433
|
if (this.refs.input?.length) {
|
|
3422
3434
|
const focusingInput = this.refs.input[index];
|
|
3423
3435
|
if (this.component.widget?.type === 'calendar') {
|
|
@@ -187,5 +187,13 @@ export default [
|
|
|
187
187
|
key: 'tableView',
|
|
188
188
|
input: true
|
|
189
189
|
},
|
|
190
|
+
{
|
|
191
|
+
weight: 1600,
|
|
192
|
+
type: 'checkbox',
|
|
193
|
+
label: 'Modal Edit',
|
|
194
|
+
tooltip: 'Opens up a modal to edit the value of this component.',
|
|
195
|
+
key: 'modalEdit',
|
|
196
|
+
input: true
|
|
197
|
+
}
|
|
190
198
|
];
|
|
191
199
|
/* eslint-enable max-len */
|
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
declare namespace _default {
|
|
2
|
+
let components: ({
|
|
3
|
+
label: string;
|
|
4
|
+
action: string;
|
|
5
|
+
showValidations: boolean;
|
|
6
|
+
tableView: boolean;
|
|
7
|
+
key: string;
|
|
8
|
+
type: string;
|
|
9
|
+
event: string;
|
|
10
|
+
input: boolean;
|
|
11
|
+
theme?: undefined;
|
|
12
|
+
collapsible?: undefined;
|
|
13
|
+
hidden?: undefined;
|
|
14
|
+
logic?: undefined;
|
|
15
|
+
collapsed?: undefined;
|
|
16
|
+
components?: undefined;
|
|
17
|
+
applyMaskOn?: undefined;
|
|
18
|
+
} | {
|
|
19
|
+
label: string;
|
|
20
|
+
action: string;
|
|
21
|
+
showValidations: boolean;
|
|
22
|
+
theme: string;
|
|
23
|
+
tableView: boolean;
|
|
24
|
+
key: string;
|
|
25
|
+
type: string;
|
|
26
|
+
event: string;
|
|
27
|
+
input: boolean;
|
|
28
|
+
collapsible?: undefined;
|
|
29
|
+
hidden?: undefined;
|
|
30
|
+
logic?: undefined;
|
|
31
|
+
collapsed?: undefined;
|
|
32
|
+
components?: undefined;
|
|
33
|
+
applyMaskOn?: undefined;
|
|
34
|
+
} | {
|
|
35
|
+
collapsible: boolean;
|
|
36
|
+
hidden: boolean;
|
|
37
|
+
key: string;
|
|
38
|
+
logic: {
|
|
39
|
+
name: string;
|
|
40
|
+
trigger: {
|
|
41
|
+
type: string;
|
|
42
|
+
event: string;
|
|
43
|
+
};
|
|
44
|
+
actions: {
|
|
45
|
+
name: string;
|
|
46
|
+
type: string;
|
|
47
|
+
property: {
|
|
48
|
+
label: string;
|
|
49
|
+
value: string;
|
|
50
|
+
type: string;
|
|
51
|
+
};
|
|
52
|
+
state: boolean;
|
|
53
|
+
}[];
|
|
54
|
+
}[];
|
|
55
|
+
type: string;
|
|
56
|
+
label: string;
|
|
57
|
+
collapsed: boolean;
|
|
58
|
+
input: boolean;
|
|
59
|
+
tableView: boolean;
|
|
60
|
+
components: never[];
|
|
61
|
+
action?: undefined;
|
|
62
|
+
showValidations?: undefined;
|
|
63
|
+
event?: undefined;
|
|
64
|
+
theme?: undefined;
|
|
65
|
+
applyMaskOn?: undefined;
|
|
66
|
+
} | {
|
|
67
|
+
label: string;
|
|
68
|
+
applyMaskOn: string;
|
|
69
|
+
tableView: boolean;
|
|
70
|
+
key: string;
|
|
71
|
+
type: string;
|
|
72
|
+
input: boolean;
|
|
73
|
+
action?: undefined;
|
|
74
|
+
showValidations?: undefined;
|
|
75
|
+
event?: undefined;
|
|
76
|
+
theme?: undefined;
|
|
77
|
+
collapsible?: undefined;
|
|
78
|
+
hidden?: undefined;
|
|
79
|
+
logic?: undefined;
|
|
80
|
+
collapsed?: undefined;
|
|
81
|
+
components?: undefined;
|
|
82
|
+
})[];
|
|
83
|
+
}
|
|
84
|
+
export default _default;
|
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
export default {
|
|
2
|
+
components: [
|
|
3
|
+
{
|
|
4
|
+
"label": "Show",
|
|
5
|
+
"action": "event",
|
|
6
|
+
"showValidations": false,
|
|
7
|
+
"tableView": false,
|
|
8
|
+
"key": "show",
|
|
9
|
+
"type": "button",
|
|
10
|
+
"event": "show",
|
|
11
|
+
"input": true
|
|
12
|
+
},
|
|
13
|
+
{
|
|
14
|
+
"label": "Hide",
|
|
15
|
+
"action": "event",
|
|
16
|
+
"showValidations": false,
|
|
17
|
+
"theme": "danger",
|
|
18
|
+
"tableView": false,
|
|
19
|
+
"key": "hide",
|
|
20
|
+
"type": "button",
|
|
21
|
+
"event": "hide",
|
|
22
|
+
"input": true
|
|
23
|
+
},
|
|
24
|
+
{
|
|
25
|
+
"collapsible": true,
|
|
26
|
+
"hidden": true,
|
|
27
|
+
"key": "panel",
|
|
28
|
+
"logic": [
|
|
29
|
+
{
|
|
30
|
+
"name": "ShowPanel",
|
|
31
|
+
"trigger": {
|
|
32
|
+
"type": "event",
|
|
33
|
+
"event": "show"
|
|
34
|
+
},
|
|
35
|
+
"actions": [
|
|
36
|
+
{
|
|
37
|
+
"name": "Show",
|
|
38
|
+
"type": "property",
|
|
39
|
+
"property": {
|
|
40
|
+
"label": "Hidden",
|
|
41
|
+
"value": "hidden",
|
|
42
|
+
"type": "boolean"
|
|
43
|
+
},
|
|
44
|
+
"state": false
|
|
45
|
+
}
|
|
46
|
+
]
|
|
47
|
+
},
|
|
48
|
+
{
|
|
49
|
+
"name": "HidePanel",
|
|
50
|
+
"trigger": {
|
|
51
|
+
"type": "event",
|
|
52
|
+
"event": "hide"
|
|
53
|
+
},
|
|
54
|
+
"actions": [
|
|
55
|
+
{
|
|
56
|
+
"name": "Hide",
|
|
57
|
+
"type": "property",
|
|
58
|
+
"property": {
|
|
59
|
+
"label": "Hidden",
|
|
60
|
+
"value": "hidden",
|
|
61
|
+
"type": "boolean"
|
|
62
|
+
},
|
|
63
|
+
"state": true
|
|
64
|
+
}
|
|
65
|
+
]
|
|
66
|
+
}
|
|
67
|
+
],
|
|
68
|
+
"type": "panel",
|
|
69
|
+
"label": "Panel",
|
|
70
|
+
"collapsed": false,
|
|
71
|
+
"input": false,
|
|
72
|
+
"tableView": false,
|
|
73
|
+
"components": []
|
|
74
|
+
},
|
|
75
|
+
{
|
|
76
|
+
"label": "Text Field",
|
|
77
|
+
"applyMaskOn": "change",
|
|
78
|
+
"tableView": true,
|
|
79
|
+
"key": "textField1",
|
|
80
|
+
"type": "textfield",
|
|
81
|
+
"input": true
|
|
82
|
+
}
|
|
83
|
+
]
|
|
84
|
+
};
|
|
@@ -233,7 +233,28 @@ export default class Input extends Multivalue {
|
|
|
233
233
|
if (key === 13) {
|
|
234
234
|
event.preventDefault();
|
|
235
235
|
event.stopPropagation();
|
|
236
|
-
|
|
236
|
+
let submitButton = null;
|
|
237
|
+
if (this.root?.everyComponent) {
|
|
238
|
+
this.root.everyComponent((component) => {
|
|
239
|
+
if (component?.component.type === 'button' &&
|
|
240
|
+
component?.component.action === 'submit') {
|
|
241
|
+
submitButton = component;
|
|
242
|
+
return false;
|
|
243
|
+
}
|
|
244
|
+
});
|
|
245
|
+
}
|
|
246
|
+
const options = {};
|
|
247
|
+
if (submitButton) {
|
|
248
|
+
options.instance = submitButton;
|
|
249
|
+
options.component = submitButton.component;
|
|
250
|
+
options.noValidate = this.component.state === 'draft';
|
|
251
|
+
options.state = this.component.state || 'submitted';
|
|
252
|
+
submitButton.loading = true;
|
|
253
|
+
this.emit('submitButton', options);
|
|
254
|
+
}
|
|
255
|
+
else {
|
|
256
|
+
this.emit('submitButton', options);
|
|
257
|
+
}
|
|
237
258
|
}
|
|
238
259
|
});
|
|
239
260
|
}
|
|
@@ -1,6 +1,13 @@
|
|
|
1
1
|
export default class Multivalue extends Field {
|
|
2
|
+
/**
|
|
3
|
+
* Normalize values coming into updateValue.
|
|
4
|
+
* @param {*} value - The value to normalize before setting.
|
|
5
|
+
* @param {Object} flags - Flags to use when normalizing the value.
|
|
6
|
+
* @param {*} emptyValue - The empty value for the field.
|
|
7
|
+
* @returns {*} - The normalized value.
|
|
8
|
+
*/
|
|
9
|
+
normalizeValue(value: any, flags?: Object, emptyValue?: any): any;
|
|
2
10
|
get addAnother(): string;
|
|
3
|
-
useWrapper(): any;
|
|
4
11
|
/**
|
|
5
12
|
* @returns {Field} - The created field.
|
|
6
13
|
*/
|
|
@@ -44,7 +51,7 @@ export default class Multivalue extends Field {
|
|
|
44
51
|
attachMultiMask(index: number): boolean;
|
|
45
52
|
/**
|
|
46
53
|
* @param {any} input - The input element on which the mask is to be applied.
|
|
47
|
-
* @param {string} mask - The mask pattern to apply to the input element. Exit early if no mask.
|
|
54
|
+
* @param {string} mask - The mask pattern to apply to the input element. Exit early and remove previous mask if no mask.
|
|
48
55
|
*/
|
|
49
56
|
updateMask(input: any, mask: string): void;
|
|
50
57
|
/**
|
|
@@ -1,12 +1,42 @@
|
|
|
1
1
|
import Field from '../field/Field';
|
|
2
2
|
import _ from 'lodash';
|
|
3
3
|
export default class Multivalue extends Field {
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
4
|
+
/**
|
|
5
|
+
* Normalize values coming into updateValue.
|
|
6
|
+
* @param {*} value - The value to normalize before setting.
|
|
7
|
+
* @param {Object} flags - Flags to use when normalizing the value.
|
|
8
|
+
* @param {*} emptyValue - The empty value for the field.
|
|
9
|
+
* @returns {*} - The normalized value.
|
|
10
|
+
*/
|
|
11
|
+
normalizeValue(value, flags = {}, emptyValue = this.emptyValue) {
|
|
12
|
+
if (this.component.multiple) {
|
|
13
|
+
if (Array.isArray(value)) {
|
|
14
|
+
if (value.length === 0) {
|
|
15
|
+
return [emptyValue];
|
|
16
|
+
}
|
|
17
|
+
if (this.component.storeas === 'array') {
|
|
18
|
+
return super.normalizeValue([value], flags);
|
|
19
|
+
}
|
|
20
|
+
return super.normalizeValue(value, flags);
|
|
21
|
+
}
|
|
22
|
+
else {
|
|
23
|
+
return super.normalizeValue(value == null ? [emptyValue] : [value], flags);
|
|
24
|
+
}
|
|
8
25
|
}
|
|
9
|
-
|
|
26
|
+
else {
|
|
27
|
+
if (Array.isArray(value) && !Array.isArray(emptyValue)) {
|
|
28
|
+
if (this.component.storeas === 'string') {
|
|
29
|
+
return super.normalizeValue(value.join(this.delimiter || ''), flags);
|
|
30
|
+
}
|
|
31
|
+
return super.normalizeValue(value[0] || emptyValue, flags);
|
|
32
|
+
}
|
|
33
|
+
else {
|
|
34
|
+
return super.normalizeValue(value, flags);
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
get dataValue() {
|
|
39
|
+
return this.normalizeValue(super.dataValue);
|
|
10
40
|
}
|
|
11
41
|
set dataValue(value) {
|
|
12
42
|
super.dataValue = value;
|
|
@@ -26,30 +56,20 @@ export default class Multivalue extends Field {
|
|
|
26
56
|
get addAnother() {
|
|
27
57
|
return this.t(this.component.addAnother || 'Add Another');
|
|
28
58
|
}
|
|
29
|
-
useWrapper() {
|
|
30
|
-
return this.component.hasOwnProperty('multiple') && this.component.multiple;
|
|
31
|
-
}
|
|
32
59
|
/**
|
|
33
60
|
* @returns {Field} - The created field.
|
|
34
61
|
*/
|
|
35
62
|
render() {
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
}
|
|
47
|
-
// If multiple value field.
|
|
48
|
-
return super.render(this.renderTemplate('multiValueTable', {
|
|
49
|
-
rows: dataValue.map(this.renderRow.bind(this)).join(''),
|
|
50
|
-
disabled: this.disabled,
|
|
51
|
-
addAnother: this.addAnother,
|
|
52
|
-
}));
|
|
63
|
+
let dataValue = this.normalizeValue(this.dataValue);
|
|
64
|
+
return this.component.hasOwnProperty('multiple') && this.component.multiple
|
|
65
|
+
? super.render(this.renderTemplate('multiValueTable', {
|
|
66
|
+
rows: dataValue.map(this.renderRow.bind(this)).join(''),
|
|
67
|
+
disabled: this.disabled,
|
|
68
|
+
addAnother: this.addAnother,
|
|
69
|
+
}))
|
|
70
|
+
: super.render(`<div ${this._referenceAttributeName}="element">
|
|
71
|
+
${this.renderElement(this.component.type !== 'hidden' ? dataValue : '')}
|
|
72
|
+
</div>`);
|
|
53
73
|
}
|
|
54
74
|
renderElement() {
|
|
55
75
|
return '';
|
|
@@ -232,10 +252,17 @@ export default class Multivalue extends Field {
|
|
|
232
252
|
}
|
|
233
253
|
/**
|
|
234
254
|
* @param {any} input - The input element on which the mask is to be applied.
|
|
235
|
-
* @param {string} mask - The mask pattern to apply to the input element. Exit early if no mask.
|
|
255
|
+
* @param {string} mask - The mask pattern to apply to the input element. Exit early and remove previous mask if no mask.
|
|
236
256
|
*/
|
|
237
257
|
updateMask(input, mask) {
|
|
238
258
|
if (!mask) {
|
|
259
|
+
if (input.mask) {
|
|
260
|
+
input.mask.destroy();
|
|
261
|
+
}
|
|
262
|
+
if (!this.component.placeholder) {
|
|
263
|
+
input.removeAttribute('placeholder');
|
|
264
|
+
}
|
|
265
|
+
input.value = '';
|
|
239
266
|
return;
|
|
240
267
|
}
|
|
241
268
|
this.setInputMask(input, mask, !this.component.placeholder);
|
|
@@ -211,11 +211,12 @@ export default class NestedComponent extends Field {
|
|
|
211
211
|
calculateValue(data: any, flags: any, row: any): any;
|
|
212
212
|
isLastPage(): boolean;
|
|
213
213
|
isValid(data: any, dirty: any): any;
|
|
214
|
-
validationProcessor({ scope, data, row, instance }: {
|
|
214
|
+
validationProcessor({ scope, data, row, instance, component }: {
|
|
215
215
|
scope: any;
|
|
216
216
|
data: any;
|
|
217
217
|
row: any;
|
|
218
218
|
instance: any;
|
|
219
|
+
component: any;
|
|
219
220
|
}, flags: any): void;
|
|
220
221
|
/**
|
|
221
222
|
* Perform a validation on all child components of this nested component.
|
|
@@ -493,6 +493,7 @@ export default class NestedComponent extends Field {
|
|
|
493
493
|
header: 'single',
|
|
494
494
|
collapsed: this.collapsed,
|
|
495
495
|
[this.nestedKey]: 'single',
|
|
496
|
+
messageContainer: 'single-scope',
|
|
496
497
|
});
|
|
497
498
|
let childPromise = Promise.resolve();
|
|
498
499
|
if (this.refs[this.nestedKey]) {
|
|
@@ -677,8 +678,11 @@ export default class NestedComponent extends Field {
|
|
|
677
678
|
isValid(data, dirty) {
|
|
678
679
|
return this.getComponents().reduce((valid, comp) => comp.isValid(data, dirty) && valid, super.isValid(data, dirty));
|
|
679
680
|
}
|
|
680
|
-
validationProcessor({ scope, data, row, instance }, flags) {
|
|
681
|
+
validationProcessor({ scope, data, row, instance, component }, flags) {
|
|
681
682
|
const { dirty } = flags;
|
|
683
|
+
if (this.root.hasExtraPages && this.page !== this.root.page) {
|
|
684
|
+
instance = this.getComponent(component.path);
|
|
685
|
+
}
|
|
682
686
|
if (!instance) {
|
|
683
687
|
return;
|
|
684
688
|
}
|
|
@@ -12,6 +12,9 @@ export default class NestedArrayComponent extends NestedDataComponent {
|
|
|
12
12
|
hasAddButton(): any;
|
|
13
13
|
getComponent(path: any, fn: any, originalPath: any): any;
|
|
14
14
|
everyComponent(fn: any, rowIndex: any, options?: {}): void;
|
|
15
|
+
_getEmailTableHeader(options: any): string;
|
|
16
|
+
_getEmailTableBody(options: any): string;
|
|
15
17
|
getComponents(rowIndex: any): any;
|
|
18
|
+
removeSubmissionMetadataRow(index: any): void;
|
|
16
19
|
}
|
|
17
20
|
import NestedDataComponent from '../nesteddata/NestedDataComponent';
|