@formio/js 5.2.3 → 5.2.4-rc.0
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.builder.css +161 -50
- 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.embed.min.js.LICENSE.txt +1 -1
- package/dist/formio.form.css +158 -49
- package/dist/formio.form.js +152 -108
- 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 -1
- package/dist/formio.full.css +161 -50
- package/dist/formio.full.js +401 -227
- 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 -1
- package/dist/formio.js +51 -18
- package/dist/formio.min.js +1 -1
- package/dist/formio.min.js.LICENSE.txt +1 -1
- package/dist/formio.utils.js +47 -14
- package/dist/formio.utils.min.js +1 -1
- package/dist/formio.utils.min.js.LICENSE.txt +1 -1
- package/lib/cjs/CDN.js +12 -12
- package/lib/cjs/Element.d.ts +3 -2
- package/lib/cjs/Element.js +27 -21
- package/lib/cjs/Embed.js +74 -40
- package/lib/cjs/EventEmitter.js +1 -1
- package/lib/cjs/Form.d.ts +371 -341
- package/lib/cjs/Form.js +153 -39
- package/lib/cjs/FormBuilder.d.ts +3 -3
- package/lib/cjs/FormBuilder.js +2 -3
- package/lib/cjs/Formio.js +26 -23
- package/lib/cjs/InlineEmbed.js +23 -17
- package/lib/cjs/PDF.d.ts +1 -0
- package/lib/cjs/PDF.js +18 -15
- package/lib/cjs/PDFBuilder.js +51 -36
- package/lib/cjs/Webform.d.ts +8 -366
- package/lib/cjs/Webform.js +176 -235
- package/lib/cjs/WebformBuilder.js +217 -144
- package/lib/cjs/Wizard.js +92 -62
- package/lib/cjs/WizardBuilder.js +27 -19
- package/lib/cjs/addons/FormioAddon.js +1 -1
- package/lib/cjs/addons/PasswordStrength/PasswordStrengthAddon.form.js +59 -57
- package/lib/cjs/addons/PasswordStrength/PasswordStrengthAddon.js +24 -16
- package/lib/cjs/addons/index.js +3 -3
- package/lib/cjs/components/Components.js +0 -4
- package/lib/cjs/components/_classes/component/Component.form.js +11 -11
- package/lib/cjs/components/_classes/component/Component.js +298 -179
- package/lib/cjs/components/_classes/component/editForm/Component.edit.addons.js +2 -4
- package/lib/cjs/components/_classes/component/editForm/Component.edit.api.js +5 -5
- package/lib/cjs/components/_classes/component/editForm/Component.edit.conditional.js +9 -11
- package/lib/cjs/components/_classes/component/editForm/Component.edit.data.d.ts +37 -0
- package/lib/cjs/components/_classes/component/editForm/Component.edit.data.js +39 -25
- package/lib/cjs/components/_classes/component/editForm/Component.edit.display.js +47 -29
- package/lib/cjs/components/_classes/component/editForm/Component.edit.layout.js +9 -9
- package/lib/cjs/components/_classes/component/editForm/Component.edit.logic.js +5 -7
- package/lib/cjs/components/_classes/component/editForm/Component.edit.validation.js +37 -34
- package/lib/cjs/components/_classes/component/editForm/utils.js +12 -16
- package/lib/cjs/components/_classes/componentModal/ComponentModal.js +6 -6
- package/lib/cjs/components/_classes/field/Field.js +7 -1
- package/lib/cjs/components/_classes/input/Input.js +30 -26
- package/lib/cjs/components/_classes/list/ListComponent.form.js +1 -1
- package/lib/cjs/components/_classes/list/ListComponent.js +27 -18
- package/lib/cjs/components/_classes/list/editForm/ListComponent.edit.data.js +36 -9
- package/lib/cjs/components/_classes/multivalue/Multivalue.js +32 -13
- package/lib/cjs/components/_classes/nested/NestedComponent.form.js +3 -3
- package/lib/cjs/components/_classes/nested/NestedComponent.js +36 -32
- package/lib/cjs/components/_classes/nestedarray/NestedArrayComponent.js +19 -14
- package/lib/cjs/components/_classes/nesteddata/NestedDataComponent.js +19 -17
- package/lib/cjs/components/address/Address.js +52 -45
- package/lib/cjs/components/address/editForm/Address.edit.data.js +2 -2
- package/lib/cjs/components/address/editForm/Address.edit.display.js +2 -2
- package/lib/cjs/components/address/editForm/Address.edit.provider.js +53 -11
- package/lib/cjs/components/alert/Alert.js +21 -15
- package/lib/cjs/components/button/Button.form.js +1 -1
- package/lib/cjs/components/button/Button.js +50 -27
- package/lib/cjs/components/button/editForm/Button.edit.display.js +49 -9
- package/lib/cjs/components/checkbox/Checkbox.d.ts +1 -1
- package/lib/cjs/components/checkbox/Checkbox.form.js +3 -3
- package/lib/cjs/components/checkbox/Checkbox.js +28 -20
- package/lib/cjs/components/checkbox/editForm/Checkbox.edit.data.js +1 -1
- package/lib/cjs/components/checkbox/editForm/Checkbox.edit.display.js +13 -3
- package/lib/cjs/components/checkbox/editForm/Checkbox.edit.validation.js +2 -2
- package/lib/cjs/components/columns/Columns.form.js +1 -1
- package/lib/cjs/components/columns/Columns.js +24 -12
- package/lib/cjs/components/columns/editForm/Columns.edit.display.js +17 -17
- package/lib/cjs/components/container/Container.form.js +2 -2
- package/lib/cjs/components/container/Container.js +6 -4
- package/lib/cjs/components/container/editForm/Container.edit.data.js +3 -3
- package/lib/cjs/components/container/editForm/Container.edit.display.js +4 -4
- package/lib/cjs/components/content/Content.form.js +4 -2
- package/lib/cjs/components/content/Content.js +10 -8
- package/lib/cjs/components/content/editForm/Content.edit.display.js +10 -10
- package/lib/cjs/components/currency/Currency.form.js +3 -3
- package/lib/cjs/components/currency/Currency.js +19 -10
- package/lib/cjs/components/currency/editForm/Currency.edit.data.js +5 -5
- package/lib/cjs/components/currency/editForm/Currency.edit.display.js +8 -8
- package/lib/cjs/components/datagrid/DataGrid.form.js +3 -3
- package/lib/cjs/components/datagrid/DataGrid.js +89 -38
- package/lib/cjs/components/datagrid/editForm/DataGrid.edit.data.js +1 -1
- package/lib/cjs/components/datagrid/editForm/DataGrid.edit.display.js +14 -14
- package/lib/cjs/components/datagrid/editForm/DataGrid.edit.validation.js +3 -3
- package/lib/cjs/components/datamap/DataMap.form.js +2 -2
- package/lib/cjs/components/datamap/DataMap.js +44 -31
- package/lib/cjs/components/datamap/editForm/DataMap.edit.data.js +1 -1
- package/lib/cjs/components/datamap/editForm/DataMap.edit.display.js +8 -8
- package/lib/cjs/components/datetime/DateTime.form.js +5 -5
- package/lib/cjs/components/datetime/DateTime.js +30 -15
- package/lib/cjs/components/datetime/editForm/DateTime.edit.data.js +4 -3
- package/lib/cjs/components/datetime/editForm/DateTime.edit.date.js +10 -10
- package/lib/cjs/components/datetime/editForm/DateTime.edit.display.js +22 -17
- package/lib/cjs/components/datetime/editForm/DateTime.edit.time.js +5 -5
- package/lib/cjs/components/datetime/editForm/DateTime.edit.validation.js +3 -3
- package/lib/cjs/components/day/Day.form.js +5 -5
- package/lib/cjs/components/day/Day.js +146 -56
- package/lib/cjs/components/day/editForm/Day.edit.day.js +13 -9
- package/lib/cjs/components/day/editForm/Day.edit.display.js +7 -7
- package/lib/cjs/components/day/editForm/Day.edit.month.js +12 -8
- package/lib/cjs/components/day/editForm/Day.edit.validation.js +7 -7
- package/lib/cjs/components/day/editForm/Day.edit.year.js +8 -8
- package/lib/cjs/components/editgrid/EditGrid.form.js +2 -2
- package/lib/cjs/components/editgrid/EditGrid.js +137 -89
- package/lib/cjs/components/editgrid/editForm/EditGrid.edit.data.js +2 -2
- package/lib/cjs/components/editgrid/editForm/EditGrid.edit.display.js +7 -2
- package/lib/cjs/components/editgrid/editForm/EditGrid.edit.templates.js +16 -16
- package/lib/cjs/components/editgrid/editForm/EditGrid.edit.validation.js +3 -3
- package/lib/cjs/components/email/Email.js +4 -4
- package/lib/cjs/components/email/editForm/Email.edit.display.js +3 -3
- package/lib/cjs/components/email/editForm/Email.edit.validation.js +6 -6
- package/lib/cjs/components/fieldset/Fieldset.form.js +1 -1
- package/lib/cjs/components/fieldset/Fieldset.js +2 -2
- package/lib/cjs/components/fieldset/editForm/Fieldset.edit.display.js +8 -8
- package/lib/cjs/components/file/File.form.js +4 -4
- package/lib/cjs/components/file/File.js +126 -80
- package/lib/cjs/components/file/editForm/File.edit.display.js +9 -5
- package/lib/cjs/components/file/editForm/File.edit.file.d.ts +37 -16
- package/lib/cjs/components/file/editForm/File.edit.file.js +169 -72
- package/lib/cjs/components/file/editForm/File.edit.validation.js +2 -2
- package/lib/cjs/components/form/Form.form.js +3 -3
- package/lib/cjs/components/form/Form.js +67 -51
- package/lib/cjs/components/form/editForm/Form.edit.data.js +1 -3
- package/lib/cjs/components/form/editForm/Form.edit.display.js +6 -7
- package/lib/cjs/components/form/editForm/Form.edit.form.js +11 -9
- package/lib/cjs/components/hidden/Hidden.form.js +4 -4
- package/lib/cjs/components/hidden/Hidden.js +2 -2
- package/lib/cjs/components/hidden/editForm/Hidden.edit.data.js +3 -3
- package/lib/cjs/components/hidden/editForm/Hidden.edit.display.js +10 -10
- package/lib/cjs/components/html/HTML.js +23 -17
- package/lib/cjs/components/html/editForm/HTML.edit.display.js +17 -17
- package/lib/cjs/components/html/editForm/HTML.edit.logic.js +2 -2
- package/lib/cjs/components/number/Number.form.js +3 -3
- package/lib/cjs/components/number/Number.js +27 -11
- package/lib/cjs/components/number/editForm/Number.edit.data.js +3 -3
- package/lib/cjs/components/number/editForm/Number.edit.display.js +4 -4
- package/lib/cjs/components/number/editForm/Number.edit.validation.js +9 -9
- package/lib/cjs/components/panel/Panel.form.js +1 -1
- package/lib/cjs/components/panel/Panel.js +2 -2
- package/lib/cjs/components/panel/editForm/Panel.edit.conditional.js +5 -7
- package/lib/cjs/components/panel/editForm/Panel.edit.display.js +55 -29
- package/lib/cjs/components/password/Password.form.js +3 -3
- package/lib/cjs/components/password/Password.js +5 -2
- package/lib/cjs/components/password/editForm/Password.edit.data.js +11 -11
- package/lib/cjs/components/password/editForm/Password.edit.display.js +3 -3
- package/lib/cjs/components/password/editForm/Password.edit.validation.js +3 -3
- package/lib/cjs/components/phonenumber/PhoneNumber.form.js +8 -8
- package/lib/cjs/components/phonenumber/PhoneNumber.js +3 -3
- package/lib/cjs/components/phonenumber/editForm/PhoneNumber.edit.validation.js +6 -6
- package/lib/cjs/components/radio/Radio.form.js +3 -3
- package/lib/cjs/components/radio/Radio.js +55 -26
- package/lib/cjs/components/radio/editForm/Radio.edit.data.js +23 -9
- package/lib/cjs/components/radio/editForm/Radio.edit.display.js +6 -6
- package/lib/cjs/components/radio/editForm/Radio.edit.validation.js +2 -2
- package/lib/cjs/components/recaptcha/ReCaptcha.form.js +5 -5
- package/lib/cjs/components/recaptcha/ReCaptcha.js +7 -5
- package/lib/cjs/components/recaptcha/editForm/ReCaptcha.edit.display.js +24 -24
- package/lib/cjs/components/select/Select.form.js +3 -3
- package/lib/cjs/components/select/Select.js +235 -129
- package/lib/cjs/components/select/editForm/Select.edit.data.d.ts +1 -1
- package/lib/cjs/components/select/editForm/Select.edit.data.js +191 -57
- package/lib/cjs/components/select/editForm/Select.edit.display.js +2 -2
- package/lib/cjs/components/select/editForm/Select.edit.validation.js +4 -4
- package/lib/cjs/components/selectboxes/SelectBoxes.form.js +3 -3
- package/lib/cjs/components/selectboxes/SelectBoxes.js +31 -15
- package/lib/cjs/components/selectboxes/editForm/SelectBoxes.edit.validation.js +5 -5
- package/lib/cjs/components/signature/Signature.form.js +3 -3
- package/lib/cjs/components/signature/Signature.js +25 -15
- package/lib/cjs/components/signature/editForm/Signature.edit.display.js +19 -10
- package/lib/cjs/components/survey/Survey.form.js +3 -3
- package/lib/cjs/components/survey/Survey.js +30 -17
- package/lib/cjs/components/survey/editForm/Survey.edit.data.js +23 -11
- package/lib/cjs/components/survey/editForm/Survey.edit.display.js +1 -1
- package/lib/cjs/components/survey/editForm/Survey.edit.validation.js +1 -1
- package/lib/cjs/components/table/Table.form.js +1 -1
- package/lib/cjs/components/table/Table.js +7 -5
- package/lib/cjs/components/table/editForm/Table.edit.display.js +22 -22
- package/lib/cjs/components/tabs/Tabs.form.js +1 -1
- package/lib/cjs/components/tabs/Tabs.js +26 -8
- package/lib/cjs/components/tabs/editForm/Tabs.edit.display.js +21 -17
- package/lib/cjs/components/tags/Tags.form.js +1 -1
- package/lib/cjs/components/tags/Tags.js +28 -12
- package/lib/cjs/components/tags/editForm/Tags.edit.data.js +7 -7
- package/lib/cjs/components/textarea/TextArea.form.js +2 -2
- package/lib/cjs/components/textarea/TextArea.js +63 -45
- package/lib/cjs/components/textarea/editForm/TextArea.edit.display.js +96 -72
- package/lib/cjs/components/textarea/editForm/TextArea.edit.validation.js +3 -3
- package/lib/cjs/components/textfield/TextField.form.js +3 -3
- package/lib/cjs/components/textfield/TextField.js +32 -21
- package/lib/cjs/components/textfield/editForm/TextField.edit.data.js +15 -13
- package/lib/cjs/components/textfield/editForm/TextField.edit.display.js +31 -21
- package/lib/cjs/components/textfield/editForm/TextField.edit.validation.js +6 -6
- package/lib/cjs/components/time/Time.js +17 -10
- package/lib/cjs/components/time/editForm/Time.edit.display.js +2 -2
- package/lib/cjs/components/unknown/Unknown.form.js +5 -5
- package/lib/cjs/components/unknown/Unknown.js +2 -2
- package/lib/cjs/components/unknown/editForm/Unknown.edit.display.js +3 -3
- package/lib/cjs/components/url/Url.form.js +3 -3
- package/lib/cjs/components/url/Url.js +2 -2
- package/lib/cjs/components/url/editForm/Url.edit.display.js +3 -3
- package/lib/cjs/components/url/editForm/Url.edit.validation.js +1 -1
- package/lib/cjs/components/well/Well.form.js +1 -1
- package/lib/cjs/components/well/Well.js +2 -2
- package/lib/cjs/components/well/editForm/Well.edit.display.js +10 -10
- package/lib/cjs/formio.form.d.ts +2 -1
- package/lib/cjs/formio.form.js +38 -12
- package/lib/cjs/i18n.d.ts +4 -0
- package/lib/cjs/i18n.js +7 -3
- package/lib/cjs/package.json +1 -1
- package/lib/cjs/providers/address/AddressProvider.js +8 -5
- package/lib/cjs/providers/address/GoogleAddressProvider.d.ts +3 -3
- package/lib/cjs/providers/address/GoogleAddressProvider.js +24 -13
- package/lib/cjs/providers/processor/fileProcessor.js +3 -1
- package/lib/cjs/providers/storage/azure.js +5 -2
- package/lib/cjs/providers/storage/dropbox.js +4 -5
- package/lib/cjs/providers/storage/googleDrive.js +3 -4
- package/lib/cjs/providers/storage/index.js +1 -1
- package/lib/cjs/providers/storage/indexeddb.js +16 -6
- package/lib/cjs/providers/storage/s3.js +17 -6
- package/lib/cjs/providers/storage/uploadAdapter.js +17 -11
- package/lib/cjs/providers/storage/url.js +13 -11
- package/lib/cjs/providers/storage/xhr.js +17 -9
- package/lib/cjs/templates/index.js +1 -1
- package/lib/cjs/translations/de.d.ts +80 -0
- package/lib/cjs/translations/de.js +81 -0
- package/lib/cjs/translations/en.d.ts +0 -2
- package/lib/cjs/translations/en.js +7 -9
- package/lib/cjs/utils/ChoicesWrapper.js +2 -2
- package/lib/cjs/utils/builder.js +31 -7
- package/lib/cjs/utils/calendarUtils.js +7 -5
- package/lib/cjs/utils/conditionOperators/ConditionOperator.js +1 -1
- package/lib/cjs/utils/conditionOperators/DateGreaterThan.js +12 -4
- package/lib/cjs/utils/conditionOperators/IsEmptyValue.js +3 -1
- package/lib/cjs/utils/conditionOperators/IsEqualTo.js +10 -6
- package/lib/cjs/utils/conditionOperators/index.js +1 -1
- package/lib/cjs/utils/formUtils.js +1 -1
- package/lib/cjs/utils/i18n.js +7 -1
- package/lib/cjs/utils/index.d.ts +2 -1
- package/lib/cjs/utils/index.js +2 -2
- package/lib/cjs/utils/utils.d.ts +10 -1
- package/lib/cjs/utils/utils.js +175 -92
- package/lib/cjs/widgets/CalendarWidget.js +66 -49
- package/lib/cjs/widgets/InputWidget.js +6 -4
- package/lib/cjs/widgets/index.js +1 -1
- package/lib/mjs/CDN.js +12 -12
- package/lib/mjs/Element.d.ts +3 -2
- package/lib/mjs/Element.js +27 -21
- package/lib/mjs/Embed.js +76 -42
- package/lib/mjs/EventEmitter.js +1 -1
- package/lib/mjs/Form.d.ts +371 -341
- package/lib/mjs/Form.js +142 -126
- package/lib/mjs/FormBuilder.d.ts +3 -3
- package/lib/mjs/FormBuilder.js +2 -3
- package/lib/mjs/Formio.js +26 -23
- package/lib/mjs/InlineEmbed.js +23 -17
- package/lib/mjs/PDF.d.ts +1 -0
- package/lib/mjs/PDF.js +18 -15
- package/lib/mjs/PDFBuilder.js +51 -36
- package/lib/mjs/Webform.d.ts +8 -366
- package/lib/mjs/Webform.js +183 -250
- package/lib/mjs/WebformBuilder.js +220 -147
- package/lib/mjs/Wizard.js +93 -63
- package/lib/mjs/WizardBuilder.js +27 -19
- package/lib/mjs/addons/FormioAddon.js +1 -1
- package/lib/mjs/addons/PasswordStrength/PasswordStrengthAddon.form.js +59 -57
- package/lib/mjs/addons/PasswordStrength/PasswordStrengthAddon.js +24 -16
- package/lib/mjs/addons/index.js +3 -3
- package/lib/mjs/components/Components.js +0 -4
- package/lib/mjs/components/_classes/component/Component.form.js +11 -11
- package/lib/mjs/components/_classes/component/Component.js +303 -184
- package/lib/mjs/components/_classes/component/editForm/Component.edit.addons.js +2 -4
- package/lib/mjs/components/_classes/component/editForm/Component.edit.api.js +5 -5
- package/lib/mjs/components/_classes/component/editForm/Component.edit.conditional.js +9 -11
- package/lib/mjs/components/_classes/component/editForm/Component.edit.data.d.ts +37 -0
- package/lib/mjs/components/_classes/component/editForm/Component.edit.data.js +39 -25
- package/lib/mjs/components/_classes/component/editForm/Component.edit.display.js +47 -29
- package/lib/mjs/components/_classes/component/editForm/Component.edit.layout.js +9 -9
- package/lib/mjs/components/_classes/component/editForm/Component.edit.logic.js +5 -7
- package/lib/mjs/components/_classes/component/editForm/Component.edit.validation.js +37 -34
- package/lib/mjs/components/_classes/component/editForm/utils.js +12 -16
- package/lib/mjs/components/_classes/componentModal/ComponentModal.js +2 -2
- package/lib/mjs/components/_classes/field/Field.js +8 -2
- package/lib/mjs/components/_classes/input/Input.js +27 -23
- package/lib/mjs/components/_classes/list/ListComponent.form.js +1 -1
- package/lib/mjs/components/_classes/list/ListComponent.js +27 -18
- package/lib/mjs/components/_classes/list/editForm/ListComponent.edit.data.js +36 -9
- package/lib/mjs/components/_classes/multivalue/Multivalue.js +32 -13
- package/lib/mjs/components/_classes/nested/NestedComponent.form.js +3 -3
- package/lib/mjs/components/_classes/nested/NestedComponent.js +32 -28
- package/lib/mjs/components/_classes/nestedarray/NestedArrayComponent.js +20 -15
- package/lib/mjs/components/_classes/nesteddata/NestedDataComponent.js +19 -17
- package/lib/mjs/components/address/Address.js +57 -46
- package/lib/mjs/components/address/editForm/Address.edit.data.js +2 -2
- package/lib/mjs/components/address/editForm/Address.edit.display.js +2 -2
- package/lib/mjs/components/address/editForm/Address.edit.provider.js +53 -11
- package/lib/mjs/components/alert/Alert.js +22 -16
- package/lib/mjs/components/button/Button.form.js +1 -1
- package/lib/mjs/components/button/Button.js +51 -28
- package/lib/mjs/components/button/editForm/Button.edit.display.js +49 -9
- package/lib/mjs/components/checkbox/Checkbox.d.ts +1 -1
- package/lib/mjs/components/checkbox/Checkbox.form.js +3 -3
- package/lib/mjs/components/checkbox/Checkbox.js +29 -21
- package/lib/mjs/components/checkbox/editForm/Checkbox.edit.data.js +1 -1
- package/lib/mjs/components/checkbox/editForm/Checkbox.edit.display.js +13 -3
- package/lib/mjs/components/checkbox/editForm/Checkbox.edit.validation.js +2 -2
- package/lib/mjs/components/columns/Columns.form.js +1 -1
- package/lib/mjs/components/columns/Columns.js +24 -12
- package/lib/mjs/components/columns/editForm/Columns.edit.display.js +17 -17
- package/lib/mjs/components/container/Container.form.js +2 -2
- package/lib/mjs/components/container/Container.js +6 -4
- package/lib/mjs/components/container/editForm/Container.edit.data.js +3 -3
- package/lib/mjs/components/container/editForm/Container.edit.display.js +4 -4
- package/lib/mjs/components/content/Content.form.js +4 -2
- package/lib/mjs/components/content/Content.js +10 -8
- package/lib/mjs/components/content/editForm/Content.edit.display.js +10 -10
- package/lib/mjs/components/currency/Currency.form.js +3 -3
- package/lib/mjs/components/currency/Currency.js +19 -10
- package/lib/mjs/components/currency/editForm/Currency.edit.data.js +5 -5
- package/lib/mjs/components/currency/editForm/Currency.edit.display.js +8 -8
- package/lib/mjs/components/datagrid/DataGrid.form.js +3 -3
- package/lib/mjs/components/datagrid/DataGrid.js +90 -39
- package/lib/mjs/components/datagrid/editForm/DataGrid.edit.data.js +1 -1
- package/lib/mjs/components/datagrid/editForm/DataGrid.edit.display.js +14 -14
- package/lib/mjs/components/datagrid/editForm/DataGrid.edit.validation.js +3 -3
- package/lib/mjs/components/datamap/DataMap.form.js +2 -2
- package/lib/mjs/components/datamap/DataMap.js +44 -31
- package/lib/mjs/components/datamap/editForm/DataMap.edit.data.js +1 -1
- package/lib/mjs/components/datamap/editForm/DataMap.edit.display.js +8 -8
- package/lib/mjs/components/datetime/DateTime.form.js +5 -5
- package/lib/mjs/components/datetime/DateTime.js +31 -16
- package/lib/mjs/components/datetime/editForm/DateTime.edit.data.js +4 -3
- package/lib/mjs/components/datetime/editForm/DateTime.edit.date.js +10 -10
- package/lib/mjs/components/datetime/editForm/DateTime.edit.display.js +22 -17
- package/lib/mjs/components/datetime/editForm/DateTime.edit.time.js +5 -5
- package/lib/mjs/components/datetime/editForm/DateTime.edit.validation.js +3 -3
- package/lib/mjs/components/day/Day.form.js +5 -5
- package/lib/mjs/components/day/Day.js +147 -57
- package/lib/mjs/components/day/editForm/Day.edit.day.js +13 -9
- package/lib/mjs/components/day/editForm/Day.edit.display.js +7 -7
- package/lib/mjs/components/day/editForm/Day.edit.month.js +12 -8
- package/lib/mjs/components/day/editForm/Day.edit.validation.js +7 -7
- package/lib/mjs/components/day/editForm/Day.edit.year.js +8 -8
- package/lib/mjs/components/editgrid/EditGrid.form.js +2 -2
- package/lib/mjs/components/editgrid/EditGrid.js +138 -90
- package/lib/mjs/components/editgrid/editForm/EditGrid.edit.data.js +2 -2
- package/lib/mjs/components/editgrid/editForm/EditGrid.edit.display.js +7 -2
- package/lib/mjs/components/editgrid/editForm/EditGrid.edit.templates.js +16 -16
- package/lib/mjs/components/editgrid/editForm/EditGrid.edit.validation.js +3 -3
- package/lib/mjs/components/email/Email.js +4 -4
- package/lib/mjs/components/email/editForm/Email.edit.display.js +3 -3
- package/lib/mjs/components/email/editForm/Email.edit.validation.js +6 -6
- package/lib/mjs/components/fieldset/Fieldset.form.js +1 -1
- package/lib/mjs/components/fieldset/Fieldset.js +2 -2
- package/lib/mjs/components/fieldset/editForm/Fieldset.edit.display.js +8 -8
- package/lib/mjs/components/file/File.form.js +4 -4
- package/lib/mjs/components/file/File.js +131 -84
- package/lib/mjs/components/file/editForm/File.edit.display.js +9 -5
- package/lib/mjs/components/file/editForm/File.edit.file.d.ts +37 -16
- package/lib/mjs/components/file/editForm/File.edit.file.js +169 -72
- package/lib/mjs/components/file/editForm/File.edit.validation.js +2 -2
- package/lib/mjs/components/form/Form.form.js +3 -3
- package/lib/mjs/components/form/Form.js +67 -51
- package/lib/mjs/components/form/editForm/Form.edit.data.js +1 -3
- package/lib/mjs/components/form/editForm/Form.edit.display.js +6 -7
- package/lib/mjs/components/form/editForm/Form.edit.form.js +10 -8
- package/lib/mjs/components/hidden/Hidden.form.js +4 -4
- package/lib/mjs/components/hidden/Hidden.js +2 -2
- package/lib/mjs/components/hidden/editForm/Hidden.edit.data.js +3 -3
- package/lib/mjs/components/hidden/editForm/Hidden.edit.display.js +10 -10
- package/lib/mjs/components/html/HTML.js +23 -17
- package/lib/mjs/components/html/editForm/HTML.edit.display.js +17 -17
- package/lib/mjs/components/html/editForm/HTML.edit.logic.js +2 -2
- package/lib/mjs/components/number/Number.form.js +3 -3
- package/lib/mjs/components/number/Number.js +28 -12
- package/lib/mjs/components/number/editForm/Number.edit.data.js +3 -3
- package/lib/mjs/components/number/editForm/Number.edit.display.js +4 -4
- package/lib/mjs/components/number/editForm/Number.edit.validation.js +9 -9
- package/lib/mjs/components/panel/Panel.form.js +1 -1
- package/lib/mjs/components/panel/Panel.js +2 -2
- package/lib/mjs/components/panel/editForm/Panel.edit.conditional.js +6 -8
- package/lib/mjs/components/panel/editForm/Panel.edit.display.js +55 -29
- package/lib/mjs/components/password/Password.form.js +3 -3
- package/lib/mjs/components/password/Password.js +5 -2
- package/lib/mjs/components/password/editForm/Password.edit.data.js +11 -11
- package/lib/mjs/components/password/editForm/Password.edit.display.js +3 -3
- package/lib/mjs/components/password/editForm/Password.edit.validation.js +3 -3
- package/lib/mjs/components/phonenumber/PhoneNumber.form.js +8 -8
- package/lib/mjs/components/phonenumber/PhoneNumber.js +3 -3
- package/lib/mjs/components/phonenumber/editForm/PhoneNumber.edit.validation.js +6 -6
- package/lib/mjs/components/radio/Radio.form.js +3 -3
- package/lib/mjs/components/radio/Radio.js +56 -27
- package/lib/mjs/components/radio/editForm/Radio.edit.data.js +23 -9
- package/lib/mjs/components/radio/editForm/Radio.edit.display.js +6 -6
- package/lib/mjs/components/radio/editForm/Radio.edit.validation.js +2 -2
- package/lib/mjs/components/recaptcha/ReCaptcha.form.js +5 -5
- package/lib/mjs/components/recaptcha/ReCaptcha.js +7 -5
- package/lib/mjs/components/recaptcha/editForm/ReCaptcha.edit.display.js +24 -24
- package/lib/mjs/components/select/Select.form.js +3 -3
- package/lib/mjs/components/select/Select.js +240 -134
- package/lib/mjs/components/select/editForm/Select.edit.data.d.ts +1 -1
- package/lib/mjs/components/select/editForm/Select.edit.data.js +191 -57
- package/lib/mjs/components/select/editForm/Select.edit.display.js +2 -2
- package/lib/mjs/components/select/editForm/Select.edit.validation.js +4 -4
- package/lib/mjs/components/selectboxes/SelectBoxes.form.js +3 -3
- package/lib/mjs/components/selectboxes/SelectBoxes.js +32 -16
- package/lib/mjs/components/selectboxes/editForm/SelectBoxes.edit.validation.js +5 -5
- package/lib/mjs/components/signature/Signature.form.js +3 -3
- package/lib/mjs/components/signature/Signature.js +25 -15
- package/lib/mjs/components/signature/editForm/Signature.edit.display.js +19 -10
- package/lib/mjs/components/survey/Survey.form.js +3 -3
- package/lib/mjs/components/survey/Survey.js +30 -17
- package/lib/mjs/components/survey/editForm/Survey.edit.data.js +23 -11
- package/lib/mjs/components/survey/editForm/Survey.edit.display.js +1 -1
- package/lib/mjs/components/survey/editForm/Survey.edit.validation.js +1 -1
- package/lib/mjs/components/table/Table.form.js +1 -1
- package/lib/mjs/components/table/Table.js +7 -5
- package/lib/mjs/components/table/editForm/Table.edit.display.js +22 -22
- package/lib/mjs/components/tabs/Tabs.form.js +1 -1
- package/lib/mjs/components/tabs/Tabs.js +26 -8
- package/lib/mjs/components/tabs/editForm/Tabs.edit.display.js +21 -17
- package/lib/mjs/components/tags/Tags.form.js +1 -1
- package/lib/mjs/components/tags/Tags.js +28 -12
- package/lib/mjs/components/tags/editForm/Tags.edit.data.js +7 -7
- package/lib/mjs/components/textarea/TextArea.form.js +2 -2
- package/lib/mjs/components/textarea/TextArea.js +75 -51
- package/lib/mjs/components/textarea/editForm/TextArea.edit.display.js +96 -72
- package/lib/mjs/components/textarea/editForm/TextArea.edit.validation.js +3 -3
- package/lib/mjs/components/textfield/TextField.form.js +3 -3
- package/lib/mjs/components/textfield/TextField.js +34 -23
- package/lib/mjs/components/textfield/editForm/TextField.edit.data.js +15 -13
- package/lib/mjs/components/textfield/editForm/TextField.edit.display.js +31 -21
- package/lib/mjs/components/textfield/editForm/TextField.edit.validation.js +6 -6
- package/lib/mjs/components/time/Time.js +17 -10
- package/lib/mjs/components/time/editForm/Time.edit.display.js +2 -2
- package/lib/mjs/components/unknown/Unknown.form.js +5 -5
- package/lib/mjs/components/unknown/Unknown.js +2 -2
- package/lib/mjs/components/unknown/editForm/Unknown.edit.display.js +3 -3
- package/lib/mjs/components/url/Url.form.js +3 -3
- package/lib/mjs/components/url/Url.js +2 -2
- package/lib/mjs/components/url/editForm/Url.edit.display.js +3 -3
- package/lib/mjs/components/url/editForm/Url.edit.validation.js +1 -1
- package/lib/mjs/components/well/Well.form.js +1 -1
- package/lib/mjs/components/well/Well.js +2 -2
- package/lib/mjs/components/well/editForm/Well.edit.display.js +10 -10
- package/lib/mjs/formio.form.d.ts +2 -1
- package/lib/mjs/formio.form.js +10 -8
- package/lib/mjs/i18n.d.ts +4 -0
- package/lib/mjs/i18n.js +7 -3
- package/lib/mjs/package.json +1 -1
- package/lib/mjs/providers/address/AddressProvider.js +8 -5
- package/lib/mjs/providers/address/GoogleAddressProvider.d.ts +3 -3
- package/lib/mjs/providers/address/GoogleAddressProvider.js +24 -13
- package/lib/mjs/providers/processor/fileProcessor.js +3 -1
- package/lib/mjs/providers/storage/azure.js +5 -2
- package/lib/mjs/providers/storage/dropbox.js +4 -5
- package/lib/mjs/providers/storage/googleDrive.js +3 -4
- package/lib/mjs/providers/storage/index.js +1 -1
- package/lib/mjs/providers/storage/indexeddb.js +16 -6
- package/lib/mjs/providers/storage/s3.js +19 -8
- package/lib/mjs/providers/storage/uploadAdapter.js +17 -11
- package/lib/mjs/providers/storage/url.js +13 -11
- package/lib/mjs/providers/storage/xhr.js +17 -9
- package/lib/mjs/templates/index.js +1 -1
- package/lib/mjs/translations/de.d.ts +80 -0
- package/lib/mjs/translations/de.js +79 -0
- package/lib/mjs/translations/en.d.ts +0 -2
- package/lib/mjs/translations/en.js +7 -9
- package/lib/mjs/utils/ChoicesWrapper.js +2 -2
- package/lib/mjs/utils/builder.js +31 -7
- package/lib/mjs/utils/calendarUtils.js +7 -5
- package/lib/mjs/utils/conditionOperators/ConditionOperator.js +1 -1
- package/lib/mjs/utils/conditionOperators/DateGreaterThan.js +16 -5
- package/lib/mjs/utils/conditionOperators/IsEmptyValue.js +3 -1
- package/lib/mjs/utils/conditionOperators/IsEqualTo.js +10 -6
- package/lib/mjs/utils/conditionOperators/index.js +1 -1
- package/lib/mjs/utils/formUtils.js +2 -2
- package/lib/mjs/utils/i18n.js +7 -1
- package/lib/mjs/utils/index.d.ts +2 -1
- package/lib/mjs/utils/index.js +3 -3
- package/lib/mjs/utils/utils.d.ts +10 -1
- package/lib/mjs/utils/utils.js +178 -91
- package/lib/mjs/widgets/CalendarWidget.js +67 -50
- package/lib/mjs/widgets/InputWidget.js +6 -4
- package/lib/mjs/widgets/index.js +1 -1
- package/package.json +3 -3
- package/lib/cjs/pdf.image.d.ts +0 -2
- package/lib/cjs/pdf.image.js +0 -94
- package/lib/cjs/utils/jsonlogic/operators.d.ts +0 -1
- package/lib/cjs/utils/jsonlogic/operators.js +0 -265
- package/lib/mjs/pdf.image.d.ts +0 -2
- package/lib/mjs/pdf.image.js +0 -94
- package/lib/mjs/utils/jsonlogic/operators.d.ts +0 -1
- package/lib/mjs/utils/jsonlogic/operators.js +0 -262
|
@@ -3,7 +3,6 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
3
3
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
4
|
};
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
/* eslint-disable max-statements */
|
|
7
6
|
const lodash_1 = __importDefault(require("lodash"));
|
|
8
7
|
const Component_1 = __importDefault(require("../_classes/component/Component"));
|
|
9
8
|
const ComponentModal_1 = __importDefault(require("../_classes/componentModal/ComponentModal"));
|
|
@@ -31,18 +30,20 @@ class FormComponent extends Component_1.default {
|
|
|
31
30
|
group: 'premium',
|
|
32
31
|
documentation: '/userguide/form-building/premium-components#nested-form',
|
|
33
32
|
weight: 110,
|
|
34
|
-
schema: FormComponent.schema()
|
|
33
|
+
schema: FormComponent.schema(),
|
|
35
34
|
};
|
|
36
35
|
}
|
|
37
36
|
static savedValueTypes() {
|
|
38
|
-
return [
|
|
37
|
+
return [
|
|
38
|
+
utils_1.componentValueTypes.object,
|
|
39
|
+
];
|
|
39
40
|
}
|
|
40
41
|
init() {
|
|
41
42
|
super.init();
|
|
42
43
|
this.formObj = {
|
|
43
44
|
display: this.component.display,
|
|
44
45
|
settings: this.component.settings,
|
|
45
|
-
components: this.component.components
|
|
46
|
+
components: this.component.components,
|
|
46
47
|
};
|
|
47
48
|
this.valueChanged = false;
|
|
48
49
|
this.subForm = null;
|
|
@@ -94,9 +95,11 @@ class FormComponent extends Component_1.default {
|
|
|
94
95
|
delete this.component.formRevision;
|
|
95
96
|
}
|
|
96
97
|
// Add revision version if set.
|
|
97
|
-
if (this.component.revision ||
|
|
98
|
-
this.component.
|
|
99
|
-
|
|
98
|
+
if (this.component.revision ||
|
|
99
|
+
this.component.revision === 0 ||
|
|
100
|
+
this.component.formRevision ||
|
|
101
|
+
this.component.formRevision === 0 ||
|
|
102
|
+
this.component.revisionId) {
|
|
100
103
|
this.setFormRevision(this.component.revisionId || this.component.revision || this.component.formRevision);
|
|
101
104
|
}
|
|
102
105
|
return this.createSubForm();
|
|
@@ -147,7 +150,6 @@ class FormComponent extends Component_1.default {
|
|
|
147
150
|
}
|
|
148
151
|
return this.subForm.getComponent(path);
|
|
149
152
|
}
|
|
150
|
-
/* eslint-disable max-statements */
|
|
151
153
|
getSubOptions(options = {}) {
|
|
152
154
|
options.events = this.createEmitter();
|
|
153
155
|
// Make sure to not show the submit button in wizards in the nested forms.
|
|
@@ -218,7 +220,6 @@ class FormComponent extends Component_1.default {
|
|
|
218
220
|
options.parent = this;
|
|
219
221
|
return options;
|
|
220
222
|
}
|
|
221
|
-
/* eslint-enable max-statements */
|
|
222
223
|
render() {
|
|
223
224
|
if (this.builderMode) {
|
|
224
225
|
return super.render(this.component.label || 'Nested form');
|
|
@@ -243,24 +244,24 @@ class FormComponent extends Component_1.default {
|
|
|
243
244
|
return 'No data provided';
|
|
244
245
|
}
|
|
245
246
|
if (options === null || options === void 0 ? void 0 : options.email) {
|
|
246
|
-
let result =
|
|
247
|
+
let result = `
|
|
247
248
|
<table border="1" style="width:100%">
|
|
248
249
|
<tbody>
|
|
249
|
-
|
|
250
|
+
`;
|
|
250
251
|
this.everyComponent((component) => {
|
|
251
252
|
if (component.isInputComponent && component.visible && !component.skipInEmail) {
|
|
252
|
-
result +=
|
|
253
|
+
result += `
|
|
253
254
|
<tr>
|
|
254
255
|
<th style="padding: 5px 10px;">${component.label}</th>
|
|
255
256
|
<td style="width:100%;padding:5px 10px;">${component.getView(component.dataValue, options)}</td>
|
|
256
257
|
</tr>
|
|
257
|
-
|
|
258
|
+
`;
|
|
258
259
|
}
|
|
259
260
|
}, Object.assign(Object.assign({}, options), { fromRoot: true }));
|
|
260
|
-
result +=
|
|
261
|
+
result += `
|
|
261
262
|
</tbody>
|
|
262
263
|
</table>
|
|
263
|
-
|
|
264
|
+
`;
|
|
264
265
|
return result;
|
|
265
266
|
}
|
|
266
267
|
if (lodash_1.default.isEmpty(value)) {
|
|
@@ -273,8 +274,7 @@ class FormComponent extends Component_1.default {
|
|
|
273
274
|
if (this.builderMode) {
|
|
274
275
|
return super.attach(element);
|
|
275
276
|
}
|
|
276
|
-
return super.attach(element)
|
|
277
|
-
.then(() => {
|
|
277
|
+
return super.attach(element).then(() => {
|
|
278
278
|
if (this.isSubFormLazyLoad() && !this.hasLoadedForm && !this.subFormLoading) {
|
|
279
279
|
this.createSubForm(true);
|
|
280
280
|
}
|
|
@@ -285,7 +285,7 @@ class FormComponent extends Component_1.default {
|
|
|
285
285
|
this.empty(element);
|
|
286
286
|
if (this.options.builder) {
|
|
287
287
|
this.setContent(element, this.ce('div', {
|
|
288
|
-
class: 'text-muted text-center p-2'
|
|
288
|
+
class: 'text-muted text-center p-2',
|
|
289
289
|
}, this.text(this.formObj.title)));
|
|
290
290
|
return;
|
|
291
291
|
}
|
|
@@ -293,9 +293,12 @@ class FormComponent extends Component_1.default {
|
|
|
293
293
|
const postAttach = () => {
|
|
294
294
|
if (!this.builderMode && this.component.modalEdit) {
|
|
295
295
|
const modalShouldBeOpened = this.componentModal ? this.componentModal.isOpened : false;
|
|
296
|
-
const currentValue = modalShouldBeOpened
|
|
296
|
+
const currentValue = modalShouldBeOpened
|
|
297
|
+
? this.componentModal.currentValue
|
|
298
|
+
: this.dataValue;
|
|
297
299
|
this.componentModal = new ComponentModal_1.default(this, element, modalShouldBeOpened, currentValue, this._referenceAttributeName);
|
|
298
|
-
this.subForm.element =
|
|
300
|
+
this.subForm.element =
|
|
301
|
+
this.componentModal.refs.componentContent || this.subForm.element;
|
|
299
302
|
this.setOpenModalElement();
|
|
300
303
|
}
|
|
301
304
|
this.calculateValue();
|
|
@@ -332,24 +335,24 @@ class FormComponent extends Component_1.default {
|
|
|
332
335
|
return this._currentForm;
|
|
333
336
|
}
|
|
334
337
|
get hasLoadedForm() {
|
|
335
|
-
return this.formObj
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
338
|
+
return (this.formObj &&
|
|
339
|
+
this.formObj.components &&
|
|
340
|
+
Array.isArray(this.formObj.components) &&
|
|
341
|
+
this.formObj.components.length);
|
|
339
342
|
}
|
|
340
343
|
set currentForm(instance) {
|
|
341
344
|
this._currentForm = instance;
|
|
342
345
|
if (!this.subForm) {
|
|
343
346
|
return;
|
|
344
347
|
}
|
|
345
|
-
this.subForm.getComponents().forEach(component => {
|
|
348
|
+
this.subForm.getComponents().forEach((component) => {
|
|
346
349
|
component.currentForm = this;
|
|
347
350
|
});
|
|
348
351
|
}
|
|
349
352
|
get isRevisionChanged() {
|
|
350
|
-
return lodash_1.default.isNumber(this.subFormRevision)
|
|
351
|
-
|
|
352
|
-
|
|
353
|
+
return (lodash_1.default.isNumber(this.subFormRevision) &&
|
|
354
|
+
lodash_1.default.isNumber(this.formObj._vid) &&
|
|
355
|
+
this.formObj._vid !== this.subFormRevision);
|
|
353
356
|
}
|
|
354
357
|
get subFormData() {
|
|
355
358
|
var _a;
|
|
@@ -386,7 +389,7 @@ class FormComponent extends Component_1.default {
|
|
|
386
389
|
updateSubWizards(subForm) {
|
|
387
390
|
var _a, _b;
|
|
388
391
|
if (this.isNestedWizard && ((_a = this.root) === null || _a === void 0 ? void 0 : _a.subWizards) && ((_b = subForm === null || subForm === void 0 ? void 0 : subForm._form) === null || _b === void 0 ? void 0 : _b.display) === 'wizard') {
|
|
389
|
-
const existedForm = this.root.subWizards.findIndex(form => form.component.form === this.component.form);
|
|
392
|
+
const existedForm = this.root.subWizards.findIndex((form) => form.component.form === this.component.form);
|
|
390
393
|
if (existedForm !== -1) {
|
|
391
394
|
this.root.subWizards[existedForm] = this;
|
|
392
395
|
}
|
|
@@ -411,7 +414,8 @@ class FormComponent extends Component_1.default {
|
|
|
411
414
|
* @returns {*} - The subform instance.
|
|
412
415
|
*/
|
|
413
416
|
createSubForm(fromAttach, beforeSubmit) {
|
|
414
|
-
this.subFormReady = this.loadSubForm(fromAttach, beforeSubmit)
|
|
417
|
+
this.subFormReady = this.loadSubForm(fromAttach, beforeSubmit)
|
|
418
|
+
.then((form) => {
|
|
415
419
|
if (!form) {
|
|
416
420
|
return;
|
|
417
421
|
}
|
|
@@ -424,7 +428,8 @@ class FormComponent extends Component_1.default {
|
|
|
424
428
|
this.subForm.destroy();
|
|
425
429
|
}
|
|
426
430
|
// Render the form.
|
|
427
|
-
return
|
|
431
|
+
return new Form_1.default(form, this.getSubOptions()).ready
|
|
432
|
+
.then((instance) => {
|
|
428
433
|
var _a, _b;
|
|
429
434
|
this.subForm = instance;
|
|
430
435
|
this.subForm.currentForm = this;
|
|
@@ -436,7 +441,7 @@ class FormComponent extends Component_1.default {
|
|
|
436
441
|
if (this.subForm && !this.shouldConditionallyClear()) {
|
|
437
442
|
this.dataValue = this.subForm.getValue();
|
|
438
443
|
this.triggerChange({
|
|
439
|
-
noEmit: true
|
|
444
|
+
noEmit: true,
|
|
440
445
|
});
|
|
441
446
|
}
|
|
442
447
|
});
|
|
@@ -448,10 +453,12 @@ class FormComponent extends Component_1.default {
|
|
|
448
453
|
this.valueChanged = this.hasSetValue;
|
|
449
454
|
this.onChange();
|
|
450
455
|
return this.subForm;
|
|
451
|
-
})
|
|
456
|
+
})
|
|
457
|
+
.catch((err) => {
|
|
452
458
|
console.log(err);
|
|
453
459
|
});
|
|
454
|
-
})
|
|
460
|
+
})
|
|
461
|
+
.then((subForm) => {
|
|
455
462
|
this.updateSubWizards(subForm);
|
|
456
463
|
return subForm;
|
|
457
464
|
});
|
|
@@ -474,11 +481,17 @@ class FormComponent extends Component_1.default {
|
|
|
474
481
|
loadSubForm(fromAttach, beforeSubmit) {
|
|
475
482
|
var _a, _b, _c, _d, _e;
|
|
476
483
|
const loadHiddenForm = beforeSubmit && !this.component.clearOnHide;
|
|
477
|
-
if (this.builderMode ||
|
|
484
|
+
if (this.builderMode ||
|
|
485
|
+
(this.conditionallyHidden() && !loadHiddenForm) ||
|
|
486
|
+
(this.isSubFormLazyLoad() && !fromAttach)) {
|
|
478
487
|
return Promise.resolve();
|
|
479
488
|
}
|
|
480
|
-
if (this.hasLoadedForm &&
|
|
481
|
-
!
|
|
489
|
+
if (this.hasLoadedForm &&
|
|
490
|
+
!this.isRevisionChanged &&
|
|
491
|
+
!(this.options.pdf &&
|
|
492
|
+
((_a = this.component) === null || _a === void 0 ? void 0 : _a.useOriginalRevision) &&
|
|
493
|
+
lodash_1.default.isNull(this.subForm) &&
|
|
494
|
+
!this.subFormLoading)) {
|
|
482
495
|
// Pass config down to sub forms.
|
|
483
496
|
if (this.root && this.root.form && this.root.form.config && !this.formObj.config) {
|
|
484
497
|
this.formObj.config = this.root.form.config;
|
|
@@ -493,7 +506,8 @@ class FormComponent extends Component_1.default {
|
|
|
493
506
|
project: this.root.formio.projectUrl,
|
|
494
507
|
}
|
|
495
508
|
: {};
|
|
496
|
-
return
|
|
509
|
+
return new Formio_1.Formio(this.formSrc, options)
|
|
510
|
+
.loadForm({ params: { live: 1 } })
|
|
497
511
|
.then((formObj) => {
|
|
498
512
|
this.formObj = formObj;
|
|
499
513
|
if (this.options.pdf && this.component.useOriginalRevision) {
|
|
@@ -546,7 +560,9 @@ class FormComponent extends Component_1.default {
|
|
|
546
560
|
* @returns {*|boolean} - TRUE if the subform should be submitted, FALSE if it should not.
|
|
547
561
|
*/
|
|
548
562
|
get shouldSubmit() {
|
|
549
|
-
return this.subFormReady &&
|
|
563
|
+
return (this.subFormReady &&
|
|
564
|
+
(!this.component.hasOwnProperty('reference') || this.component.reference) &&
|
|
565
|
+
!this.shouldConditionallyClear());
|
|
550
566
|
}
|
|
551
567
|
/**
|
|
552
568
|
* Returns the data for the subform.
|
|
@@ -573,12 +589,15 @@ class FormComponent extends Component_1.default {
|
|
|
573
589
|
}
|
|
574
590
|
this.subForm.nosubmit = false;
|
|
575
591
|
this.subForm.submitted = true;
|
|
576
|
-
return this.subForm
|
|
592
|
+
return this.subForm
|
|
593
|
+
.submitForm({}, true)
|
|
594
|
+
.then((result) => {
|
|
577
595
|
this.subForm.loading = false;
|
|
578
596
|
this.subForm.showAllErrors = false;
|
|
579
597
|
this.dataValue = result.submission;
|
|
580
598
|
return this.dataValue;
|
|
581
|
-
})
|
|
599
|
+
})
|
|
600
|
+
.catch((err) => {
|
|
582
601
|
this.subForm.showAllErrors = true;
|
|
583
602
|
this.subForm.onSubmissionError(err);
|
|
584
603
|
return Promise.reject(err);
|
|
@@ -647,10 +666,10 @@ class FormComponent extends Component_1.default {
|
|
|
647
666
|
this.valueChanged = true;
|
|
648
667
|
if (this.subForm) {
|
|
649
668
|
const revisionPath = submission._frid ? '_frid' : '_vid';
|
|
650
|
-
const shouldLoadOriginalRevision = this.useOriginalRevision
|
|
651
|
-
|
|
652
|
-
|
|
653
|
-
|
|
669
|
+
const shouldLoadOriginalRevision = this.useOriginalRevision &&
|
|
670
|
+
(lodash_1.default.isNumber(submission[revisionPath]) || lodash_1.default.isNumber(submission._fvid)) &&
|
|
671
|
+
lodash_1.default.isNumber((_a = this.subForm.form) === null || _a === void 0 ? void 0 : _a[revisionPath]) &&
|
|
672
|
+
submission._fvid !== this.subForm.form[revisionPath];
|
|
654
673
|
if (shouldLoadOriginalRevision) {
|
|
655
674
|
this.setFormRevision(submission._frid || submission._fvid);
|
|
656
675
|
this.createSubForm().then(() => {
|
|
@@ -665,10 +684,7 @@ class FormComponent extends Component_1.default {
|
|
|
665
684
|
}
|
|
666
685
|
setSubFormValue(submission, flags) {
|
|
667
686
|
var _a, _b, _c, _d;
|
|
668
|
-
const shouldLoadSubmissionById = submission
|
|
669
|
-
&& submission._id
|
|
670
|
-
&& this.subForm.formio
|
|
671
|
-
&& lodash_1.default.isEmpty(submission.data);
|
|
687
|
+
const shouldLoadSubmissionById = submission && submission._id && this.subForm.formio && lodash_1.default.isEmpty(submission.data);
|
|
672
688
|
const shouldLoadDraftById = this.options.saveDraft && lodash_1.default.isEmpty(submission.data) && lodash_1.default.get(this.subForm, 'submission._id');
|
|
673
689
|
if (shouldLoadSubmissionById || shouldLoadDraftById) {
|
|
674
690
|
const formId = submission.form || this.formObj.form || this.component.form;
|
|
@@ -735,7 +751,7 @@ class FormComponent extends Component_1.default {
|
|
|
735
751
|
*/
|
|
736
752
|
get isNestedWizard() {
|
|
737
753
|
var _a, _b, _c, _d, _e;
|
|
738
|
-
return ((_b = (_a = this.subForm) === null || _a === void 0 ? void 0 : _a._form) === null || _b === void 0 ? void 0 : _b.display) === 'wizard' && ((_e = (_d = (_c = this.parent) === null || _c === void 0 ? void 0 : _c.parent) === null || _d === void 0 ? void 0 : _d._form) === null || _e === void 0 ? void 0 : _e.display) === 'wizard';
|
|
754
|
+
return (((_b = (_a = this.subForm) === null || _a === void 0 ? void 0 : _a._form) === null || _b === void 0 ? void 0 : _b.display) === 'wizard' && ((_e = (_d = (_c = this.parent) === null || _c === void 0 ? void 0 : _c.parent) === null || _d === void 0 ? void 0 : _d._form) === null || _e === void 0 ? void 0 : _e.display) === 'wizard');
|
|
739
755
|
}
|
|
740
756
|
get visible() {
|
|
741
757
|
return super.visible;
|
|
@@ -830,7 +846,7 @@ class FormComponent extends Component_1.default {
|
|
|
830
846
|
deleteValue() {
|
|
831
847
|
super.setValue(null, {
|
|
832
848
|
noUpdateEvent: true,
|
|
833
|
-
noDefault: true
|
|
849
|
+
noDefault: true,
|
|
834
850
|
});
|
|
835
851
|
this.unset();
|
|
836
852
|
}
|
|
@@ -4,7 +4,6 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
4
4
|
};
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
6
|
const utils_1 = __importDefault(require("../../_classes/component/editForm/utils"));
|
|
7
|
-
/* eslint-disable max-len */
|
|
8
7
|
exports.default = [
|
|
9
8
|
utils_1.default.javaScriptValue('Custom Default Value', 'customDefaultValue', 'customDefaultValue', 120, '<p><h4>Example:</h4><pre>value = data.firstName + " " + data.lastName;</pre></p>', '<p><h4>Example:</h4><pre>{"cat": [{"var": "data.firstName"}, " ", {"var": "data.lastName"}]}</pre>'),
|
|
10
9
|
utils_1.default.javaScriptValue('Calculated Value', 'calculateValue', 'calculateValue', 130, '<p><h4>Example:</h4><pre>value = data.a + data.b + data.c;</pre></p>', '<p><h4>Example:</h4><pre>{"+": [{"var": "data.a"}, {"var": "data.b"}, {"var": "data.c"}]}</pre><p><a href="https://help.form.io/userguide/form-building/logic-and-conditions#calculated-values" target="_blank" rel="noopener noreferrer">Click here for an example</a></p>'),
|
|
@@ -15,7 +14,6 @@ exports.default = [
|
|
|
15
14
|
key: 'clearOnHide',
|
|
16
15
|
defaultValue: true,
|
|
17
16
|
tooltip: 'When a field is hidden, clear the value.',
|
|
18
|
-
input: true
|
|
17
|
+
input: true,
|
|
19
18
|
},
|
|
20
19
|
];
|
|
21
|
-
/* eslint-enable max-len */
|
|
@@ -3,27 +3,26 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.default = [
|
|
4
4
|
{
|
|
5
5
|
key: 'labelPosition',
|
|
6
|
-
ignore: true
|
|
6
|
+
ignore: true,
|
|
7
7
|
},
|
|
8
8
|
{
|
|
9
9
|
key: 'placeholder',
|
|
10
|
-
ignore: true
|
|
10
|
+
ignore: true,
|
|
11
11
|
},
|
|
12
12
|
{
|
|
13
13
|
key: 'description',
|
|
14
|
-
ignore: true
|
|
14
|
+
ignore: true,
|
|
15
15
|
},
|
|
16
16
|
{
|
|
17
17
|
key: 'tooltip',
|
|
18
|
-
ignore: true
|
|
18
|
+
ignore: true,
|
|
19
19
|
},
|
|
20
20
|
{
|
|
21
21
|
key: 'tabIndex',
|
|
22
|
-
ignore: true
|
|
22
|
+
ignore: true,
|
|
23
23
|
},
|
|
24
24
|
{
|
|
25
25
|
key: 'autofocus',
|
|
26
|
-
ignore: true
|
|
26
|
+
ignore: true,
|
|
27
27
|
},
|
|
28
28
|
];
|
|
29
|
-
/* eslint-enable max-len */
|
|
@@ -6,7 +6,7 @@ exports.default = [
|
|
|
6
6
|
input: true,
|
|
7
7
|
dataSrc: 'url',
|
|
8
8
|
data: {
|
|
9
|
-
url: '/form?limit=1000000&select=_id,title,display'
|
|
9
|
+
url: '/form?limit=1000000&select=_id,title,display',
|
|
10
10
|
},
|
|
11
11
|
searchField: 'title__regex',
|
|
12
12
|
template: '<span>{{ item.title }}</span>',
|
|
@@ -32,10 +32,12 @@ exports.default = [
|
|
|
32
32
|
tooltip: 'if it is checked, the subform is loaded after navigation to the page with this component within the wizard.',
|
|
33
33
|
input: true,
|
|
34
34
|
customConditional({ instance, data }) {
|
|
35
|
-
var _a, _b, _c
|
|
36
|
-
const
|
|
35
|
+
var _a, _b, _c;
|
|
36
|
+
const formComp = (_a = instance.root) === null || _a === void 0 ? void 0 : _a.getComponent('form');
|
|
37
|
+
const formInfo = formComp === null || formComp === void 0 ? void 0 : formComp.defaultDownloadedResources.find((res) => res._id === data.form);
|
|
37
38
|
const displayMode = 'wizard';
|
|
38
|
-
return ((
|
|
39
|
+
return (((_c = (_b = instance.options) === null || _b === void 0 ? void 0 : _b.editForm) === null || _c === void 0 ? void 0 : _c.display) === displayMode &&
|
|
40
|
+
((data.form && !formInfo) || (formInfo && formInfo.display !== displayMode)));
|
|
39
41
|
},
|
|
40
42
|
},
|
|
41
43
|
{
|
|
@@ -43,7 +45,7 @@ exports.default = [
|
|
|
43
45
|
input: true,
|
|
44
46
|
dataSrc: 'url',
|
|
45
47
|
data: {
|
|
46
|
-
url: '/form/{{ data.form }}/v'
|
|
48
|
+
url: '/form/{{ data.form }}/v',
|
|
47
49
|
},
|
|
48
50
|
searchField: 'title__regex',
|
|
49
51
|
template: '<span>{{ item._vid }}</span>',
|
|
@@ -54,7 +56,7 @@ exports.default = [
|
|
|
54
56
|
weight: 10,
|
|
55
57
|
lazyLoad: true,
|
|
56
58
|
tooltip: 'You can lock the nested form to a specific revision by choosing the revision number here.',
|
|
57
|
-
customConditional: 'show = !!data.form'
|
|
59
|
+
customConditional: 'show = !!data.form',
|
|
58
60
|
},
|
|
59
61
|
{
|
|
60
62
|
type: 'checkbox',
|
|
@@ -62,7 +64,7 @@ exports.default = [
|
|
|
62
64
|
weight: 19,
|
|
63
65
|
key: 'useOriginalRevision',
|
|
64
66
|
label: 'Use Original Revision while Submissions Viewing',
|
|
65
|
-
tooltip: 'Using this option will make form load the original revision (the one which was used to make a submission) when viewing a submission.'
|
|
67
|
+
tooltip: 'Using this option will make form load the original revision (the one which was used to make a submission) when viewing a submission.',
|
|
66
68
|
},
|
|
67
69
|
{
|
|
68
70
|
type: 'checkbox',
|
|
@@ -70,6 +72,6 @@ exports.default = [
|
|
|
70
72
|
weight: 20,
|
|
71
73
|
key: 'reference',
|
|
72
74
|
label: 'Save as reference',
|
|
73
|
-
tooltip: 'Using this option will save this field as a reference and link its value to the value of the origin record.'
|
|
74
|
-
}
|
|
75
|
+
tooltip: 'Using this option will save this field as a reference and link its value to the value of the origin record.',
|
|
76
|
+
},
|
|
75
77
|
];
|
|
@@ -15,19 +15,19 @@ function default_1(...extend) {
|
|
|
15
15
|
return Components_1.default.baseEditForm([
|
|
16
16
|
{
|
|
17
17
|
key: 'display',
|
|
18
|
-
components: Hidden_edit_display_1.default
|
|
18
|
+
components: Hidden_edit_display_1.default,
|
|
19
19
|
},
|
|
20
20
|
{
|
|
21
21
|
key: 'data',
|
|
22
|
-
components: Hidden_edit_data_1.default
|
|
22
|
+
components: Hidden_edit_data_1.default,
|
|
23
23
|
},
|
|
24
24
|
{
|
|
25
25
|
key: 'validation',
|
|
26
|
-
ignore: true
|
|
26
|
+
ignore: true,
|
|
27
27
|
},
|
|
28
28
|
{
|
|
29
29
|
key: 'conditional',
|
|
30
|
-
ignore: true
|
|
30
|
+
ignore: true,
|
|
31
31
|
},
|
|
32
32
|
], ...extend);
|
|
33
33
|
}
|
|
@@ -9,7 +9,7 @@ class HiddenComponent extends Input_1.default {
|
|
|
9
9
|
return Input_1.default.schema({
|
|
10
10
|
type: 'hidden',
|
|
11
11
|
tableView: false,
|
|
12
|
-
inputType: 'hidden'
|
|
12
|
+
inputType: 'hidden',
|
|
13
13
|
}, ...extend);
|
|
14
14
|
}
|
|
15
15
|
static get builderInfo() {
|
|
@@ -20,7 +20,7 @@ class HiddenComponent extends Input_1.default {
|
|
|
20
20
|
weight: 0,
|
|
21
21
|
documentation: '/userguide/form-building/data-components#hidden',
|
|
22
22
|
showPreview: false,
|
|
23
|
-
schema: HiddenComponent.schema()
|
|
23
|
+
schema: HiddenComponent.schema(),
|
|
24
24
|
};
|
|
25
25
|
}
|
|
26
26
|
get defaultSchema() {
|
|
@@ -3,14 +3,14 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.default = [
|
|
4
4
|
{
|
|
5
5
|
key: 'multiple',
|
|
6
|
-
ignore: true
|
|
6
|
+
ignore: true,
|
|
7
7
|
},
|
|
8
8
|
{
|
|
9
9
|
key: 'clearOnHide',
|
|
10
|
-
ignore: true
|
|
10
|
+
ignore: true,
|
|
11
11
|
},
|
|
12
12
|
{
|
|
13
13
|
key: 'allowCalculateOverride',
|
|
14
|
-
ignore: true
|
|
14
|
+
ignore: true,
|
|
15
15
|
},
|
|
16
16
|
];
|
|
@@ -3,42 +3,42 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.default = [
|
|
4
4
|
{
|
|
5
5
|
key: 'labelPosition',
|
|
6
|
-
ignore: true
|
|
6
|
+
ignore: true,
|
|
7
7
|
},
|
|
8
8
|
{
|
|
9
9
|
key: 'placeholder',
|
|
10
|
-
ignore: true
|
|
10
|
+
ignore: true,
|
|
11
11
|
},
|
|
12
12
|
{
|
|
13
13
|
key: 'description',
|
|
14
|
-
ignore: true
|
|
14
|
+
ignore: true,
|
|
15
15
|
},
|
|
16
16
|
{
|
|
17
17
|
key: 'tooltip',
|
|
18
|
-
ignore: true
|
|
18
|
+
ignore: true,
|
|
19
19
|
},
|
|
20
20
|
{
|
|
21
21
|
key: 'hideLabel',
|
|
22
|
-
ignore: true
|
|
22
|
+
ignore: true,
|
|
23
23
|
},
|
|
24
24
|
{
|
|
25
25
|
key: 'autofocus',
|
|
26
|
-
ignore: true
|
|
26
|
+
ignore: true,
|
|
27
27
|
},
|
|
28
28
|
{
|
|
29
29
|
key: 'tabindex',
|
|
30
|
-
ignore: true
|
|
30
|
+
ignore: true,
|
|
31
31
|
},
|
|
32
32
|
{
|
|
33
33
|
key: 'hidden',
|
|
34
|
-
ignore: true
|
|
34
|
+
ignore: true,
|
|
35
35
|
},
|
|
36
36
|
{
|
|
37
37
|
key: 'tableView',
|
|
38
|
-
ignore: true
|
|
38
|
+
ignore: true,
|
|
39
39
|
},
|
|
40
40
|
{
|
|
41
41
|
key: 'disabled',
|
|
42
|
-
ignore: true
|
|
42
|
+
ignore: true,
|
|
43
43
|
},
|
|
44
44
|
];
|
|
@@ -14,7 +14,7 @@ class HTMLComponent extends Component_1.default {
|
|
|
14
14
|
attrs: [],
|
|
15
15
|
content: '',
|
|
16
16
|
input: false,
|
|
17
|
-
persistent: false
|
|
17
|
+
persistent: false,
|
|
18
18
|
}, ...extend);
|
|
19
19
|
}
|
|
20
20
|
static get builderInfo() {
|
|
@@ -25,7 +25,7 @@ class HTMLComponent extends Component_1.default {
|
|
|
25
25
|
weight: 0,
|
|
26
26
|
documentation: '/userguide/form-building/layout-components#html-element',
|
|
27
27
|
showPreview: false,
|
|
28
|
-
schema: HTMLComponent.schema()
|
|
28
|
+
schema: HTMLComponent.schema(),
|
|
29
29
|
};
|
|
30
30
|
}
|
|
31
31
|
static savedValueTypes() {
|
|
@@ -43,28 +43,34 @@ class HTMLComponent extends Component_1.default {
|
|
|
43
43
|
return ` ${this.component.content} `;
|
|
44
44
|
}
|
|
45
45
|
const submission = lodash_1.default.get(this.root, 'submission', {});
|
|
46
|
-
const content = this.component.content
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
46
|
+
const content = this.component.content
|
|
47
|
+
? this.interpolate(this.sanitize(this.component.content, this.shouldSanitizeValue), {
|
|
48
|
+
metadata: submission.metadata || {},
|
|
49
|
+
submission: submission,
|
|
50
|
+
data: this.rootValue,
|
|
51
|
+
row: this.data,
|
|
52
|
+
})
|
|
53
|
+
: '';
|
|
52
54
|
return content;
|
|
53
55
|
}
|
|
54
56
|
get singleTags() {
|
|
55
|
-
return [
|
|
57
|
+
return [
|
|
58
|
+
'br',
|
|
59
|
+
'img',
|
|
60
|
+
'hr',
|
|
61
|
+
];
|
|
56
62
|
}
|
|
57
63
|
checkRefreshOn(changed) {
|
|
58
64
|
super.checkRefreshOn(changed);
|
|
59
65
|
const isVisible = () => {
|
|
60
66
|
return this.hasCondition() ? !this.conditionallyHidden() : !this.component.hidden;
|
|
61
67
|
};
|
|
62
|
-
const shouldSetContent = !this.builderMode
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
+
const shouldSetContent = !this.builderMode &&
|
|
69
|
+
this.component.refreshOnChange &&
|
|
70
|
+
this.element &&
|
|
71
|
+
!lodash_1.default.isUndefined(changed) &&
|
|
72
|
+
((lodash_1.default.isBoolean(changed) && changed) || !lodash_1.default.isEmpty(changed)) &&
|
|
73
|
+
isVisible();
|
|
68
74
|
if (shouldSetContent) {
|
|
69
75
|
this.setContent(this.element, this.renderContent());
|
|
70
76
|
}
|
|
@@ -81,8 +87,8 @@ class HTMLComponent extends Component_1.default {
|
|
|
81
87
|
metadata: submission.metadata || {},
|
|
82
88
|
submission: submission,
|
|
83
89
|
data: this.rootValue,
|
|
84
|
-
row: this.data
|
|
85
|
-
})
|
|
90
|
+
row: this.data,
|
|
91
|
+
}),
|
|
86
92
|
};
|
|
87
93
|
}),
|
|
88
94
|
content: this.content,
|