@formio/js 5.0.0-dev.5610.da13e39 → 5.0.0-dev.5613.3476921
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.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.js +1199 -651
- package/dist/formio.form.min.js +1 -1
- package/dist/formio.form.min.js.LICENSE.txt +11 -3
- package/dist/formio.full.js +919 -691
- package/dist/formio.full.min.js +1 -1
- package/dist/formio.full.min.js.LICENSE.txt +11 -3
- package/dist/formio.js +16 -16
- package/dist/formio.min.js +1 -1
- package/dist/formio.min.js.LICENSE.txt +1 -1
- package/dist/formio.utils.js +493 -1861
- package/dist/formio.utils.min.js +1 -1
- package/dist/formio.utils.min.js.LICENSE.txt +2 -12
- package/lib/cjs/Element.d.ts +96 -86
- package/lib/cjs/Element.js +78 -68
- package/lib/cjs/Form.d.ts +36 -365
- package/lib/cjs/Form.js +64 -50
- package/lib/cjs/FormBuilder.d.ts +2 -187
- package/lib/cjs/FormBuilder.js +8 -30
- package/lib/cjs/PDF.d.ts +13 -11
- package/lib/cjs/PDF.js +8 -6
- package/lib/cjs/Webform.d.ts +139 -180
- package/lib/cjs/Webform.js +298 -313
- package/lib/cjs/WebformBuilder.d.ts +14 -16
- package/lib/cjs/WebformBuilder.js +11 -17
- package/lib/cjs/Wizard.d.ts +21 -31
- package/lib/cjs/Wizard.js +19 -42
- package/lib/cjs/WizardBuilder.d.ts +1 -1
- package/lib/cjs/addons/PasswordStrength/PasswordStrengthAddon.d.ts +5 -8
- package/lib/cjs/addons/PasswordStrength/PasswordStrengthAddon.js +3 -6
- package/lib/cjs/components/Components.d.ts +4 -4
- package/lib/cjs/components/Components.js +3 -3
- package/lib/cjs/components/_classes/component/Component.d.ts +269 -502
- package/lib/cjs/components/_classes/component/Component.form.d.ts +3 -6
- package/lib/cjs/components/_classes/component/Component.form.js +0 -5
- package/lib/cjs/components/_classes/component/Component.js +189 -433
- package/lib/cjs/components/_classes/component/editForm/Component.edit.display.js +8 -0
- package/lib/cjs/components/_classes/component/editForm/Component.edit.validation.js +2 -2
- package/lib/cjs/components/_classes/component/editForm/utils.js +2 -2
- package/lib/cjs/components/_classes/field/Field.d.ts +2 -11
- package/lib/cjs/components/_classes/field/Field.js +1 -13
- package/lib/cjs/components/_classes/input/Input.d.ts +3 -4
- package/lib/cjs/components/_classes/input/Input.js +2 -2
- package/lib/cjs/components/_classes/list/ListComponent.d.ts +2 -2
- package/lib/cjs/components/_classes/list/ListComponent.form.d.ts +3 -6
- package/lib/cjs/components/_classes/list/ListComponent.form.js +0 -5
- package/lib/cjs/components/_classes/multivalue/Multivalue.d.ts +12 -43
- package/lib/cjs/components/_classes/multivalue/Multivalue.js +3 -37
- package/lib/cjs/components/_classes/nested/NestedComponent.d.ts +67 -163
- package/lib/cjs/components/_classes/nested/NestedComponent.form.d.ts +3 -6
- package/lib/cjs/components/_classes/nested/NestedComponent.form.js +0 -5
- package/lib/cjs/components/_classes/nested/NestedComponent.js +54 -175
- package/lib/cjs/components/_classes/nestedarray/NestedArrayComponent.d.ts +2 -2
- package/lib/cjs/components/_classes/nestedarray/NestedArrayComponent.js +1 -1
- package/lib/cjs/components/_classes/nesteddata/NestedDataComponent.d.ts +1 -7
- package/lib/cjs/components/_classes/nesteddata/NestedDataComponent.js +3 -2
- package/lib/cjs/components/address/Address.d.ts +2 -4
- package/lib/cjs/components/address/Address.form.d.ts +3 -6
- package/lib/cjs/components/address/Address.form.js +0 -5
- package/lib/cjs/components/button/Button.d.ts +12 -3
- package/lib/cjs/components/button/Button.form.d.ts +3 -6
- package/lib/cjs/components/button/Button.form.js +0 -5
- package/lib/cjs/components/button/Button.js +0 -5
- package/lib/cjs/components/checkbox/Checkbox.d.ts +27 -4
- package/lib/cjs/components/checkbox/Checkbox.form.d.ts +3 -6
- package/lib/cjs/components/checkbox/Checkbox.form.js +0 -5
- package/lib/cjs/components/columns/Columns.d.ts +2 -3
- package/lib/cjs/components/columns/Columns.form.d.ts +3 -6
- package/lib/cjs/components/columns/Columns.form.js +0 -5
- package/lib/cjs/components/columns/Columns.js +1 -1
- package/lib/cjs/components/container/Container.form.d.ts +3 -6
- package/lib/cjs/components/container/Container.form.js +0 -5
- package/lib/cjs/components/content/Content.d.ts +1 -2
- package/lib/cjs/components/content/Content.form.d.ts +3 -6
- package/lib/cjs/components/content/Content.form.js +0 -5
- package/lib/cjs/components/currency/Currency.form.d.ts +3 -6
- package/lib/cjs/components/currency/Currency.form.js +0 -5
- package/lib/cjs/components/currency/Currency.js +2 -1
- package/lib/cjs/components/datagrid/DataGrid.d.ts +7 -8
- package/lib/cjs/components/datagrid/DataGrid.form.d.ts +3 -6
- package/lib/cjs/components/datagrid/DataGrid.form.js +0 -5
- package/lib/cjs/components/datagrid/DataGrid.js +5 -5
- package/lib/cjs/components/datamap/DataMap.d.ts +0 -1
- package/lib/cjs/components/datamap/DataMap.form.d.ts +3 -6
- package/lib/cjs/components/datamap/DataMap.form.js +0 -5
- package/lib/cjs/components/datetime/DateTime.d.ts +14 -0
- package/lib/cjs/components/datetime/DateTime.form.d.ts +3 -6
- package/lib/cjs/components/datetime/DateTime.form.js +0 -5
- package/lib/cjs/components/datetime/editForm/DateTime.edit.date.js +2 -2
- package/lib/cjs/components/day/Day.d.ts +48 -22
- package/lib/cjs/components/day/Day.form.d.ts +3 -6
- package/lib/cjs/components/day/Day.form.js +0 -5
- package/lib/cjs/components/day/Day.js +20 -15
- package/lib/cjs/components/editgrid/EditGrid.d.ts +3 -7
- package/lib/cjs/components/editgrid/EditGrid.form.d.ts +3 -6
- package/lib/cjs/components/editgrid/EditGrid.form.js +0 -5
- package/lib/cjs/components/editgrid/EditGrid.js +3 -3
- package/lib/cjs/components/editgrid/editForm/EditGrid.edit.display.js +5 -2
- package/lib/cjs/components/editgrid/editForm/EditGrid.edit.templates.js +9 -6
- package/lib/cjs/components/email/Email.form.d.ts +3 -6
- package/lib/cjs/components/email/Email.form.js +0 -5
- package/lib/cjs/components/fieldset/Fieldset.form.d.ts +3 -6
- package/lib/cjs/components/fieldset/Fieldset.form.js +0 -5
- package/lib/cjs/components/file/File.d.ts +22 -9
- package/lib/cjs/components/file/File.form.d.ts +3 -6
- package/lib/cjs/components/file/File.form.js +0 -5
- package/lib/cjs/components/form/Form.d.ts +20 -31
- package/lib/cjs/components/form/Form.form.d.ts +3 -6
- package/lib/cjs/components/form/Form.form.js +0 -5
- package/lib/cjs/components/form/Form.js +10 -13
- package/lib/cjs/components/hidden/Hidden.d.ts +11 -1
- package/lib/cjs/components/hidden/Hidden.form.d.ts +3 -6
- package/lib/cjs/components/hidden/Hidden.form.js +0 -5
- package/lib/cjs/components/hidden/Hidden.js +2 -1
- package/lib/cjs/components/html/HTML.d.ts +1 -2
- package/lib/cjs/components/html/HTML.form.d.ts +3 -6
- package/lib/cjs/components/html/HTML.form.js +0 -5
- package/lib/cjs/components/number/Number.d.ts +17 -3
- package/lib/cjs/components/number/Number.form.d.ts +3 -6
- package/lib/cjs/components/number/Number.form.js +0 -5
- package/lib/cjs/components/number/Number.js +2 -1
- package/lib/cjs/components/panel/Panel.form.d.ts +3 -6
- package/lib/cjs/components/panel/Panel.form.js +0 -5
- package/lib/cjs/components/panel/Panel.js +1 -0
- package/lib/cjs/components/password/Password.form.d.ts +3 -6
- package/lib/cjs/components/password/Password.form.js +0 -5
- package/lib/cjs/components/phonenumber/PhoneNumber.form.d.ts +3 -6
- package/lib/cjs/components/phonenumber/PhoneNumber.form.js +0 -5
- package/lib/cjs/components/radio/Radio.d.ts +26 -3
- package/lib/cjs/components/radio/Radio.form.d.ts +3 -6
- package/lib/cjs/components/radio/Radio.form.js +0 -5
- package/lib/cjs/components/radio/Radio.js +4 -3
- package/lib/cjs/components/recaptcha/ReCaptcha.d.ts +1 -1
- package/lib/cjs/components/recaptcha/ReCaptcha.form.d.ts +3 -5
- package/lib/cjs/components/recaptcha/ReCaptcha.form.js +0 -4
- package/lib/cjs/components/select/Select.d.ts +39 -16
- package/lib/cjs/components/select/Select.form.d.ts +3 -6
- package/lib/cjs/components/select/Select.form.js +0 -5
- package/lib/cjs/components/select/Select.js +16 -13
- package/lib/cjs/components/selectboxes/SelectBoxes.d.ts +17 -2
- package/lib/cjs/components/selectboxes/SelectBoxes.form.d.ts +3 -6
- package/lib/cjs/components/selectboxes/SelectBoxes.form.js +0 -5
- package/lib/cjs/components/selectboxes/SelectBoxes.js +9 -7
- package/lib/cjs/components/signature/Signature.d.ts +14 -1
- package/lib/cjs/components/signature/Signature.form.d.ts +3 -6
- package/lib/cjs/components/signature/Signature.form.js +0 -5
- package/lib/cjs/components/survey/Survey.d.ts +15 -3
- package/lib/cjs/components/survey/Survey.form.d.ts +3 -6
- package/lib/cjs/components/survey/Survey.form.js +0 -5
- package/lib/cjs/components/table/Table.d.ts +1 -2
- package/lib/cjs/components/table/Table.form.d.ts +3 -6
- package/lib/cjs/components/table/Table.form.js +0 -5
- package/lib/cjs/components/tabs/Tabs.d.ts +4 -4
- package/lib/cjs/components/tabs/Tabs.form.d.ts +3 -6
- package/lib/cjs/components/tabs/Tabs.form.js +0 -5
- package/lib/cjs/components/tabs/Tabs.js +2 -1
- package/lib/cjs/components/tags/Tags.d.ts +14 -0
- package/lib/cjs/components/tags/Tags.form.d.ts +3 -6
- package/lib/cjs/components/tags/Tags.form.js +0 -5
- package/lib/cjs/components/textarea/TextArea.d.ts +9 -4
- package/lib/cjs/components/textarea/TextArea.form.d.ts +3 -6
- package/lib/cjs/components/textarea/TextArea.form.js +0 -5
- package/lib/cjs/components/textarea/TextArea.js +2 -2
- package/lib/cjs/components/textfield/TextField.d.ts +30 -14
- package/lib/cjs/components/textfield/TextField.form.d.ts +3 -6
- package/lib/cjs/components/textfield/TextField.form.js +0 -5
- package/lib/cjs/components/textfield/TextField.js +16 -13
- package/lib/cjs/components/time/Time.form.d.ts +3 -6
- package/lib/cjs/components/time/Time.form.js +0 -5
- package/lib/cjs/components/unknown/Unknown.form.d.ts +34 -5
- package/lib/cjs/components/unknown/Unknown.form.js +0 -4
- package/lib/cjs/components/url/Url.form.d.ts +3 -6
- package/lib/cjs/components/url/Url.form.js +0 -5
- package/lib/cjs/components/well/Well.form.d.ts +3 -6
- package/lib/cjs/components/well/Well.form.js +0 -5
- package/lib/cjs/formio.embed.d.ts +2 -1
- package/lib/cjs/formio.embed.js +100 -2
- package/lib/cjs/formio.form.d.ts +4 -11
- package/lib/cjs/formio.form.js +5 -13
- package/lib/cjs/providers/Providers.d.ts +5 -36
- package/lib/cjs/providers/Providers.js +0 -29
- package/lib/cjs/providers/address/AddressProvider.d.ts +12 -131
- package/lib/cjs/providers/address/AddressProvider.js +2 -88
- package/lib/cjs/providers/address/AzureAddressProvider.d.ts +1 -48
- package/lib/cjs/providers/address/AzureAddressProvider.js +0 -37
- package/lib/cjs/providers/address/CustomAddressProvider.d.ts +4 -27
- package/lib/cjs/providers/address/CustomAddressProvider.js +0 -34
- package/lib/cjs/providers/address/GoogleAddressProvider.d.ts +6 -130
- package/lib/cjs/providers/address/GoogleAddressProvider.js +0 -72
- package/lib/cjs/providers/address/NominatimAddressProvider.d.ts +7 -32
- package/lib/cjs/providers/address/NominatimAddressProvider.js +0 -33
- package/lib/cjs/providers/address/index.d.ts +1 -3
- package/lib/cjs/providers/processor/fileProcessor.d.ts +1 -7
- package/lib/cjs/providers/processor/fileProcessor.js +0 -6
- package/lib/cjs/providers/storage/azure.d.ts +13 -6
- package/lib/cjs/providers/storage/azure.js +0 -5
- package/lib/cjs/providers/storage/base64.d.ts +6 -5
- package/lib/cjs/providers/storage/base64.js +0 -4
- package/lib/cjs/providers/storage/dropbox.d.ts +4 -6
- package/lib/cjs/providers/storage/dropbox.js +0 -5
- package/lib/cjs/providers/storage/googleDrive.d.ts +5 -7
- package/lib/cjs/providers/storage/googleDrive.js +0 -6
- package/lib/cjs/providers/storage/indexeddb.d.ts +7 -5
- package/lib/cjs/providers/storage/indexeddb.js +0 -4
- package/lib/cjs/providers/storage/s3.d.ts +20 -6
- package/lib/cjs/providers/storage/s3.js +0 -5
- package/lib/cjs/providers/storage/url.d.ts +7 -6
- package/lib/cjs/providers/storage/url.js +0 -10
- package/lib/cjs/providers/storage/util.d.ts +1 -24
- package/lib/cjs/providers/storage/util.js +0 -18
- package/lib/cjs/templates/Templates.d.ts +0 -1
- package/lib/cjs/translations/en.d.ts +1 -0
- package/lib/cjs/translations/en.js +1 -0
- package/lib/cjs/utils/Evaluator.d.ts +3 -6
- package/lib/cjs/utils/Evaluator.js +20 -11
- package/lib/cjs/utils/builder.d.ts +7 -9
- package/lib/cjs/utils/builder.js +5 -10
- package/lib/cjs/utils/calendarUtils.d.ts +13 -7
- package/lib/cjs/utils/calendarUtils.js +17 -10
- package/lib/cjs/utils/formUtils.d.ts +171 -43
- package/lib/cjs/utils/formUtils.js +569 -38
- package/lib/cjs/utils/utils.d.ts +216 -362
- package/lib/cjs/utils/utils.js +224 -331
- package/lib/cjs/widgets/CalendarWidget.d.ts +10 -9
- package/lib/cjs/widgets/CalendarWidget.js +11 -9
- package/lib/mjs/Element.d.ts +96 -86
- package/lib/mjs/Element.js +78 -68
- package/lib/mjs/Form.d.ts +36 -365
- package/lib/mjs/Form.js +57 -140
- package/lib/mjs/FormBuilder.d.ts +2 -187
- package/lib/mjs/FormBuilder.js +8 -32
- package/lib/mjs/PDF.d.ts +13 -11
- package/lib/mjs/PDF.js +8 -6
- package/lib/mjs/Webform.d.ts +139 -180
- package/lib/mjs/Webform.js +310 -325
- package/lib/mjs/WebformBuilder.d.ts +14 -16
- package/lib/mjs/WebformBuilder.js +11 -16
- package/lib/mjs/Wizard.d.ts +21 -31
- package/lib/mjs/Wizard.js +18 -41
- package/lib/mjs/WizardBuilder.d.ts +1 -1
- package/lib/mjs/addons/PasswordStrength/PasswordStrengthAddon.d.ts +5 -8
- package/lib/mjs/addons/PasswordStrength/PasswordStrengthAddon.js +3 -6
- package/lib/mjs/components/Components.d.ts +4 -4
- package/lib/mjs/components/Components.js +3 -3
- package/lib/mjs/components/_classes/component/Component.d.ts +269 -502
- package/lib/mjs/components/_classes/component/Component.form.d.ts +3 -6
- package/lib/mjs/components/_classes/component/Component.form.js +0 -5
- package/lib/mjs/components/_classes/component/Component.js +189 -433
- package/lib/mjs/components/_classes/component/editForm/Component.edit.display.js +8 -0
- package/lib/mjs/components/_classes/component/editForm/Component.edit.validation.js +1 -1
- package/lib/mjs/components/_classes/component/editForm/utils.js +1 -1
- package/lib/mjs/components/_classes/field/Field.d.ts +2 -11
- package/lib/mjs/components/_classes/field/Field.js +1 -13
- package/lib/mjs/components/_classes/input/Input.d.ts +3 -4
- package/lib/mjs/components/_classes/input/Input.js +2 -2
- package/lib/mjs/components/_classes/list/ListComponent.d.ts +2 -2
- package/lib/mjs/components/_classes/list/ListComponent.form.d.ts +3 -6
- package/lib/mjs/components/_classes/list/ListComponent.form.js +0 -5
- package/lib/mjs/components/_classes/multivalue/Multivalue.d.ts +12 -43
- package/lib/mjs/components/_classes/multivalue/Multivalue.js +3 -37
- package/lib/mjs/components/_classes/nested/NestedComponent.d.ts +67 -163
- package/lib/mjs/components/_classes/nested/NestedComponent.form.d.ts +3 -6
- package/lib/mjs/components/_classes/nested/NestedComponent.form.js +0 -5
- package/lib/mjs/components/_classes/nested/NestedComponent.js +54 -175
- package/lib/mjs/components/_classes/nestedarray/NestedArrayComponent.d.ts +2 -2
- package/lib/mjs/components/_classes/nestedarray/NestedArrayComponent.js +1 -1
- package/lib/mjs/components/_classes/nesteddata/NestedDataComponent.d.ts +1 -7
- package/lib/mjs/components/_classes/nesteddata/NestedDataComponent.js +3 -2
- package/lib/mjs/components/address/Address.d.ts +2 -4
- package/lib/mjs/components/address/Address.form.d.ts +3 -6
- package/lib/mjs/components/address/Address.form.js +0 -5
- package/lib/mjs/components/button/Button.d.ts +12 -3
- package/lib/mjs/components/button/Button.form.d.ts +3 -6
- package/lib/mjs/components/button/Button.form.js +0 -5
- package/lib/mjs/components/button/Button.js +0 -5
- package/lib/mjs/components/checkbox/Checkbox.d.ts +27 -4
- package/lib/mjs/components/checkbox/Checkbox.form.d.ts +3 -6
- package/lib/mjs/components/checkbox/Checkbox.form.js +0 -5
- package/lib/mjs/components/columns/Columns.d.ts +2 -3
- package/lib/mjs/components/columns/Columns.form.d.ts +3 -6
- package/lib/mjs/components/columns/Columns.form.js +0 -5
- package/lib/mjs/components/columns/Columns.js +1 -1
- package/lib/mjs/components/container/Container.form.d.ts +3 -6
- package/lib/mjs/components/container/Container.form.js +0 -5
- package/lib/mjs/components/content/Content.d.ts +1 -2
- package/lib/mjs/components/content/Content.form.d.ts +3 -6
- package/lib/mjs/components/content/Content.form.js +0 -5
- package/lib/mjs/components/currency/Currency.form.d.ts +3 -6
- package/lib/mjs/components/currency/Currency.form.js +0 -5
- package/lib/mjs/components/currency/Currency.js +2 -1
- package/lib/mjs/components/datagrid/DataGrid.d.ts +7 -8
- package/lib/mjs/components/datagrid/DataGrid.form.d.ts +3 -6
- package/lib/mjs/components/datagrid/DataGrid.form.js +0 -5
- package/lib/mjs/components/datagrid/DataGrid.js +5 -5
- package/lib/mjs/components/datamap/DataMap.d.ts +0 -1
- package/lib/mjs/components/datamap/DataMap.form.d.ts +3 -6
- package/lib/mjs/components/datamap/DataMap.form.js +0 -5
- package/lib/mjs/components/datetime/DateTime.d.ts +14 -0
- package/lib/mjs/components/datetime/DateTime.form.d.ts +3 -6
- package/lib/mjs/components/datetime/DateTime.form.js +0 -5
- package/lib/mjs/components/datetime/editForm/DateTime.edit.date.js +1 -1
- package/lib/mjs/components/day/Day.d.ts +48 -22
- package/lib/mjs/components/day/Day.form.d.ts +3 -6
- package/lib/mjs/components/day/Day.form.js +0 -5
- package/lib/mjs/components/day/Day.js +20 -15
- package/lib/mjs/components/editgrid/EditGrid.d.ts +3 -7
- package/lib/mjs/components/editgrid/EditGrid.form.d.ts +3 -6
- package/lib/mjs/components/editgrid/EditGrid.form.js +0 -5
- package/lib/mjs/components/editgrid/EditGrid.js +3 -3
- package/lib/mjs/components/editgrid/editForm/EditGrid.edit.display.js +1 -1
- package/lib/mjs/components/editgrid/editForm/EditGrid.edit.templates.js +1 -1
- package/lib/mjs/components/email/Email.form.d.ts +3 -6
- package/lib/mjs/components/email/Email.form.js +0 -5
- package/lib/mjs/components/fieldset/Fieldset.form.d.ts +3 -6
- package/lib/mjs/components/fieldset/Fieldset.form.js +0 -5
- package/lib/mjs/components/file/File.d.ts +22 -9
- package/lib/mjs/components/file/File.form.d.ts +3 -6
- package/lib/mjs/components/file/File.form.js +0 -5
- package/lib/mjs/components/form/Form.d.ts +20 -31
- package/lib/mjs/components/form/Form.form.d.ts +3 -6
- package/lib/mjs/components/form/Form.form.js +0 -5
- package/lib/mjs/components/form/Form.js +10 -13
- package/lib/mjs/components/hidden/Hidden.d.ts +11 -1
- package/lib/mjs/components/hidden/Hidden.form.d.ts +3 -6
- package/lib/mjs/components/hidden/Hidden.form.js +0 -5
- package/lib/mjs/components/hidden/Hidden.js +2 -1
- package/lib/mjs/components/html/HTML.d.ts +1 -2
- package/lib/mjs/components/html/HTML.form.d.ts +3 -6
- package/lib/mjs/components/html/HTML.form.js +0 -5
- package/lib/mjs/components/number/Number.d.ts +17 -3
- package/lib/mjs/components/number/Number.form.d.ts +3 -6
- package/lib/mjs/components/number/Number.form.js +0 -5
- package/lib/mjs/components/number/Number.js +2 -1
- package/lib/mjs/components/panel/Panel.form.d.ts +3 -6
- package/lib/mjs/components/panel/Panel.form.js +0 -5
- package/lib/mjs/components/panel/Panel.js +1 -0
- package/lib/mjs/components/password/Password.form.d.ts +3 -6
- package/lib/mjs/components/password/Password.form.js +0 -5
- package/lib/mjs/components/phonenumber/PhoneNumber.form.d.ts +3 -6
- package/lib/mjs/components/phonenumber/PhoneNumber.form.js +0 -5
- package/lib/mjs/components/radio/Radio.d.ts +26 -3
- package/lib/mjs/components/radio/Radio.form.d.ts +3 -6
- package/lib/mjs/components/radio/Radio.form.js +0 -5
- package/lib/mjs/components/radio/Radio.js +4 -3
- package/lib/mjs/components/recaptcha/ReCaptcha.d.ts +1 -1
- package/lib/mjs/components/recaptcha/ReCaptcha.form.d.ts +3 -5
- package/lib/mjs/components/recaptcha/ReCaptcha.form.js +0 -4
- package/lib/mjs/components/select/Select.d.ts +39 -16
- package/lib/mjs/components/select/Select.form.d.ts +3 -6
- package/lib/mjs/components/select/Select.form.js +0 -5
- package/lib/mjs/components/select/Select.js +16 -13
- package/lib/mjs/components/selectboxes/SelectBoxes.d.ts +17 -2
- package/lib/mjs/components/selectboxes/SelectBoxes.form.d.ts +3 -6
- package/lib/mjs/components/selectboxes/SelectBoxes.form.js +0 -5
- package/lib/mjs/components/selectboxes/SelectBoxes.js +9 -7
- package/lib/mjs/components/signature/Signature.d.ts +14 -1
- package/lib/mjs/components/signature/Signature.form.d.ts +3 -6
- package/lib/mjs/components/signature/Signature.form.js +0 -5
- package/lib/mjs/components/survey/Survey.d.ts +15 -3
- package/lib/mjs/components/survey/Survey.form.d.ts +3 -6
- package/lib/mjs/components/survey/Survey.form.js +0 -5
- package/lib/mjs/components/table/Table.d.ts +1 -2
- package/lib/mjs/components/table/Table.form.d.ts +3 -6
- package/lib/mjs/components/table/Table.form.js +0 -5
- package/lib/mjs/components/tabs/Tabs.d.ts +4 -4
- package/lib/mjs/components/tabs/Tabs.form.d.ts +3 -6
- package/lib/mjs/components/tabs/Tabs.form.js +0 -5
- package/lib/mjs/components/tabs/Tabs.js +2 -1
- package/lib/mjs/components/tags/Tags.d.ts +14 -0
- package/lib/mjs/components/tags/Tags.form.d.ts +3 -6
- package/lib/mjs/components/tags/Tags.form.js +0 -5
- package/lib/mjs/components/textarea/TextArea.d.ts +9 -4
- package/lib/mjs/components/textarea/TextArea.form.d.ts +3 -6
- package/lib/mjs/components/textarea/TextArea.form.js +0 -5
- package/lib/mjs/components/textarea/TextArea.js +2 -2
- package/lib/mjs/components/textfield/TextField.d.ts +30 -14
- package/lib/mjs/components/textfield/TextField.form.d.ts +3 -6
- package/lib/mjs/components/textfield/TextField.form.js +0 -5
- package/lib/mjs/components/textfield/TextField.js +16 -13
- package/lib/mjs/components/time/Time.form.d.ts +3 -6
- package/lib/mjs/components/time/Time.form.js +0 -5
- package/lib/mjs/components/unknown/Unknown.form.d.ts +34 -5
- package/lib/mjs/components/unknown/Unknown.form.js +0 -4
- package/lib/mjs/components/url/Url.form.d.ts +3 -6
- package/lib/mjs/components/url/Url.form.js +0 -5
- package/lib/mjs/components/well/Well.form.d.ts +3 -6
- package/lib/mjs/components/well/Well.form.js +0 -5
- package/lib/mjs/formio.embed.d.ts +2 -1
- package/lib/mjs/formio.embed.js +99 -2
- package/lib/mjs/formio.form.d.ts +4 -11
- package/lib/mjs/formio.form.js +3 -10
- package/lib/mjs/providers/Providers.d.ts +5 -36
- package/lib/mjs/providers/Providers.js +0 -29
- package/lib/mjs/providers/address/AddressProvider.d.ts +12 -131
- package/lib/mjs/providers/address/AddressProvider.js +2 -88
- package/lib/mjs/providers/address/AzureAddressProvider.d.ts +1 -48
- package/lib/mjs/providers/address/AzureAddressProvider.js +0 -37
- package/lib/mjs/providers/address/CustomAddressProvider.d.ts +4 -27
- package/lib/mjs/providers/address/CustomAddressProvider.js +0 -34
- package/lib/mjs/providers/address/GoogleAddressProvider.d.ts +6 -130
- package/lib/mjs/providers/address/GoogleAddressProvider.js +0 -72
- package/lib/mjs/providers/address/NominatimAddressProvider.d.ts +7 -32
- package/lib/mjs/providers/address/NominatimAddressProvider.js +0 -33
- package/lib/mjs/providers/address/index.d.ts +1 -3
- package/lib/mjs/providers/processor/fileProcessor.d.ts +1 -7
- package/lib/mjs/providers/processor/fileProcessor.js +0 -6
- package/lib/mjs/providers/storage/azure.d.ts +13 -6
- package/lib/mjs/providers/storage/azure.js +0 -5
- package/lib/mjs/providers/storage/base64.d.ts +6 -5
- package/lib/mjs/providers/storage/base64.js +0 -4
- package/lib/mjs/providers/storage/dropbox.d.ts +4 -6
- package/lib/mjs/providers/storage/dropbox.js +0 -5
- package/lib/mjs/providers/storage/googleDrive.d.ts +5 -7
- package/lib/mjs/providers/storage/googleDrive.js +0 -6
- package/lib/mjs/providers/storage/indexeddb.d.ts +7 -5
- package/lib/mjs/providers/storage/indexeddb.js +0 -4
- package/lib/mjs/providers/storage/s3.d.ts +20 -6
- package/lib/mjs/providers/storage/s3.js +0 -5
- package/lib/mjs/providers/storage/url.d.ts +7 -6
- package/lib/mjs/providers/storage/url.js +0 -10
- package/lib/mjs/providers/storage/util.d.ts +1 -24
- package/lib/mjs/providers/storage/util.js +0 -18
- package/lib/mjs/templates/Templates.d.ts +0 -1
- package/lib/mjs/translations/en.d.ts +1 -0
- package/lib/mjs/translations/en.js +1 -0
- package/lib/mjs/utils/Evaluator.d.ts +3 -6
- package/lib/mjs/utils/Evaluator.js +20 -9
- package/lib/mjs/utils/builder.d.ts +7 -9
- package/lib/mjs/utils/builder.js +5 -10
- package/lib/mjs/utils/calendarUtils.d.ts +13 -7
- package/lib/mjs/utils/calendarUtils.js +17 -10
- package/lib/mjs/utils/formUtils.d.ts +171 -43
- package/lib/mjs/utils/formUtils.js +554 -6
- package/lib/mjs/utils/utils.d.ts +216 -362
- package/lib/mjs/utils/utils.js +218 -325
- package/lib/mjs/widgets/CalendarWidget.d.ts +10 -9
- package/lib/mjs/widgets/CalendarWidget.js +11 -9
- package/package.json +22 -22
- package/embed.d.ts +0 -1
- package/form.d.ts +0 -1
- package/lib/cjs/InlineEmbed.d.ts +0 -7
- package/lib/cjs/InlineEmbed.js +0 -109
- package/lib/mjs/InlineEmbed.d.ts +0 -7
- package/lib/mjs/InlineEmbed.js +0 -105
- package/sdk.d.ts +0 -1
- package/utils.d.ts +0 -1
package/lib/cjs/Form.d.ts
CHANGED
|
@@ -1,377 +1,50 @@
|
|
|
1
1
|
export default class Form extends Element {
|
|
2
2
|
static embed(embed: any): Promise<any>;
|
|
3
|
-
constructor(elementOrForm: any, formOrOptions: any, options?: {});
|
|
4
|
-
/**
|
|
5
|
-
* Represents a JSON value.
|
|
6
|
-
* @typedef {(string | number | boolean | null | JSONArray | JSONObject)} JSON
|
|
7
|
-
*/
|
|
8
|
-
/**
|
|
9
|
-
* Represents a JSON array.
|
|
10
|
-
* @typedef {Array<JSON>} JSONArray
|
|
11
|
-
*/
|
|
12
|
-
/**
|
|
13
|
-
* Represents a JSON object.
|
|
14
|
-
* @typedef {{[key: string]: JSON}} JSONObject
|
|
15
|
-
*/
|
|
16
|
-
/**
|
|
17
|
-
* @typedef {object} FormioHooks
|
|
18
|
-
* @property {Function} [beforeSubmit] - Called before a submission is made.
|
|
19
|
-
* @property {Function} [beforeCancel] - Called before a cancel is made.
|
|
20
|
-
* @property {Function} [beforeNext] - Called before the next page is navigated to.
|
|
21
|
-
* @property {Function} [beforePrev] - Called before the previous page is navigated to.
|
|
22
|
-
* @property {Function} [attachComponent] - Called when a component is attached.
|
|
23
|
-
* @property {Function} [setDataValue] - Called when a data value is set.
|
|
24
|
-
* @property {Function} [addComponents] - Called when components are added.
|
|
25
|
-
* @property {Function} [addComponent] - Called when a component is added.
|
|
26
|
-
* @property {Function} [customValidation] - Called when a custom validation is made.
|
|
27
|
-
* @property {Function} [attachWebform] - Called when a webform is attached.
|
|
28
|
-
*/
|
|
29
|
-
/**
|
|
30
|
-
* @typedef {object} SanitizeConfig
|
|
31
|
-
* @property {string[]} [addAttr] - The html attributes to allow with sanitization.
|
|
32
|
-
* @property {string[]} [addTags] - The html tags to allow with sanitization.
|
|
33
|
-
* @property {string[]} [allowedAttrs] - The html attributes to allow with sanitization.
|
|
34
|
-
* @property {string[]} [allowedTags] - The html tags to allow with sanitization.
|
|
35
|
-
* @property {string[]} [allowedUriRegex] - The regex for allowed URIs.
|
|
36
|
-
* @property {string[]} [addUriSafeAttr] - The URI attributes to allow with sanitization.
|
|
37
|
-
*/
|
|
38
|
-
/**
|
|
39
|
-
* @typedef {object} ButtonSettings
|
|
40
|
-
* @property {boolean} [showPrevious] - Show the previous button in wizard forms.
|
|
41
|
-
* @property {boolean} [showNext] - Show the next button in wizard forms.
|
|
42
|
-
* @property {boolean} [showCancel] - Show the cancel button in wizard forms.
|
|
43
|
-
* @property {boolean} [showSubmit] - Show the submit button in wizard forms.
|
|
44
|
-
*/
|
|
45
|
-
/**
|
|
46
|
-
* @typedef {object} FormOptions
|
|
47
|
-
* @property {boolean} [saveDraft] - Enable the save draft feature.
|
|
48
|
-
* @property {number} [saveDraftThrottle] - The throttle for the save draft feature.
|
|
49
|
-
* @property {boolean} [readOnly] - Set this form to readOnly.
|
|
50
|
-
* @property {boolean} [noAlerts] - Disable the alerts dialog.
|
|
51
|
-
* @property {{[key: string]: string}} [i18n] - The translation file for this rendering.
|
|
52
|
-
* @property {string} [template] - Custom logic for creation of elements.
|
|
53
|
-
* @property {boolean} [noDefaults] - Exclude default values from the settings.
|
|
54
|
-
* @property {any} [fileService] - The file service for this form.
|
|
55
|
-
* @property {EventEmitter} [events] - The EventEmitter for this form.
|
|
56
|
-
* @property {string} [language] - The language to render this form in.
|
|
57
|
-
* @property {{[key: string]: string}} [i18next] - The i18next configuration for this form.
|
|
58
|
-
* @property {boolean} [viewAsHtml] - View the form as raw HTML.
|
|
59
|
-
* @property {'form' | 'html' | 'flat' | 'builder' | 'pdf'} [renderMode] - The render mode for this form.
|
|
60
|
-
* @property {boolean} [highlightErrors] - Highlight any errors on the form.
|
|
61
|
-
* @property {string} [componentErrorClass] - The error class for components.
|
|
62
|
-
* @property {any} [templates] - The templates for this form.
|
|
63
|
-
* @property {string} [iconset] - The iconset for this form.
|
|
64
|
-
* @property {import('@formio/core').Component[]} [components] - The components for this form.
|
|
65
|
-
* @property {{[key: string]: boolean}} [disabled] - Disabled components for this form.
|
|
66
|
-
* @property {boolean} [showHiddenFields] - Show hidden fields.
|
|
67
|
-
* @property {{[key: string]: boolean}} [hide] - Hidden components for this form.
|
|
68
|
-
* @property {{[key: string]: boolean}} [show] - Components to show for this form.
|
|
69
|
-
* @property {Formio} [formio] - The Formio instance for this form.
|
|
70
|
-
* @property {string} [decimalSeparator] - The decimal separator for this form.
|
|
71
|
-
* @property {string} [thousandsSeparator] - The thousands separator for this form.
|
|
72
|
-
* @property {FormioHooks} [hooks] - The hooks for this form.
|
|
73
|
-
* @property {boolean} [alwaysDirty] - Always be dirty.
|
|
74
|
-
* @property {boolean} [skipDraftRestore] - Skip restoring a draft.
|
|
75
|
-
* @property {'form' | 'wizard' | 'pdf'} [display] - The display for this form.
|
|
76
|
-
* @property {string} [cdnUrl] - The CDN url for this form.
|
|
77
|
-
* @property {boolean} [flatten] - Flatten the form.
|
|
78
|
-
* @property {boolean} [sanitize] - Sanitize the form.
|
|
79
|
-
* @property {SanitizeConfig} [sanitizeConfig] - The sanitize configuration for this form.
|
|
80
|
-
* @property {ButtonSettings} [buttonSettings] - The button settings for this form.
|
|
81
|
-
* @property {object} [breadcrumbSettings] - The breadcrumb settings for this form.
|
|
82
|
-
* @property {boolean} [allowPrevious] - Allow the previous button (for Wizard forms).
|
|
83
|
-
* @property {string[]} [wizardButtonOrder] - The order of the buttons (for Wizard forms).
|
|
84
|
-
* @property {boolean} [showCheckboxBackground] - Show the checkbox background.
|
|
85
|
-
* @property {number} [zoom] - The zoom for PDF forms.
|
|
86
|
-
*/
|
|
87
3
|
/**
|
|
88
4
|
* Creates an easy to use interface for embedding webforms, pdfs, and wizards into your application.
|
|
89
|
-
*
|
|
90
|
-
* @param {
|
|
91
|
-
* @param {
|
|
5
|
+
*
|
|
6
|
+
* @param {Object} element - The DOM element you wish to render this form within.
|
|
7
|
+
* @param {Object | string} form - Either a Form JSON schema or the URL of a hosted form via. form.io.
|
|
8
|
+
* @param {Object} options - The options to create a new form instance.
|
|
9
|
+
* @param {boolean} options.readOnly - Set this form to readOnly
|
|
10
|
+
* @param {boolean} options.noAlerts - Set to true to disable the alerts dialog.
|
|
11
|
+
* @param {boolean} options.i18n - The translation file for this rendering. @see https://github.com/formio/formio.js/blob/master/i18n.js
|
|
12
|
+
* @param {boolean} options.template - Provides a way to inject custom logic into the creation of every element rendered within the form.
|
|
13
|
+
*
|
|
92
14
|
* @example
|
|
93
15
|
* import Form from '@formio/js/Form';
|
|
94
16
|
* const form = new Form(document.getElementById('formio'), 'https://examples.form.io/example');
|
|
95
17
|
* form.build();
|
|
96
18
|
*/
|
|
97
|
-
|
|
98
|
-
* @type {FormOptions} - the options for this Form.
|
|
99
|
-
*/
|
|
100
|
-
options: {
|
|
101
|
-
/**
|
|
102
|
-
* - Enable the save draft feature.
|
|
103
|
-
*/
|
|
104
|
-
saveDraft?: boolean | undefined;
|
|
105
|
-
/**
|
|
106
|
-
* - The throttle for the save draft feature.
|
|
107
|
-
*/
|
|
108
|
-
saveDraftThrottle?: number | undefined;
|
|
109
|
-
/**
|
|
110
|
-
* - Set this form to readOnly.
|
|
111
|
-
*/
|
|
112
|
-
readOnly?: boolean | undefined;
|
|
113
|
-
/**
|
|
114
|
-
* - Disable the alerts dialog.
|
|
115
|
-
*/
|
|
116
|
-
noAlerts?: boolean | undefined;
|
|
117
|
-
/**
|
|
118
|
-
* - The translation file for this rendering.
|
|
119
|
-
*/
|
|
120
|
-
i18n?: {
|
|
121
|
-
[key: string]: string;
|
|
122
|
-
} | undefined;
|
|
123
|
-
/**
|
|
124
|
-
* - Custom logic for creation of elements.
|
|
125
|
-
*/
|
|
126
|
-
template?: string | undefined;
|
|
127
|
-
/**
|
|
128
|
-
* - Exclude default values from the settings.
|
|
129
|
-
*/
|
|
130
|
-
noDefaults?: boolean | undefined;
|
|
131
|
-
/**
|
|
132
|
-
* - The file service for this form.
|
|
133
|
-
*/
|
|
134
|
-
fileService?: any;
|
|
135
|
-
/**
|
|
136
|
-
* - The EventEmitter for this form.
|
|
137
|
-
*/
|
|
138
|
-
events?: any;
|
|
139
|
-
/**
|
|
140
|
-
* - The language to render this form in.
|
|
141
|
-
*/
|
|
142
|
-
language?: string | undefined;
|
|
143
|
-
/**
|
|
144
|
-
* - The i18next configuration for this form.
|
|
145
|
-
*/
|
|
146
|
-
i18next?: {
|
|
147
|
-
[key: string]: string;
|
|
148
|
-
} | undefined;
|
|
149
|
-
/**
|
|
150
|
-
* - View the form as raw HTML.
|
|
151
|
-
*/
|
|
152
|
-
viewAsHtml?: boolean | undefined;
|
|
153
|
-
/**
|
|
154
|
-
* - The render mode for this form.
|
|
155
|
-
*/
|
|
156
|
-
renderMode?: "builder" | "form" | "html" | "flat" | "pdf" | undefined;
|
|
157
|
-
/**
|
|
158
|
-
* - Highlight any errors on the form.
|
|
159
|
-
*/
|
|
160
|
-
highlightErrors?: boolean | undefined;
|
|
161
|
-
/**
|
|
162
|
-
* - The error class for components.
|
|
163
|
-
*/
|
|
164
|
-
componentErrorClass?: string | undefined;
|
|
165
|
-
/**
|
|
166
|
-
* - The templates for this form.
|
|
167
|
-
*/
|
|
168
|
-
templates?: any;
|
|
169
|
-
/**
|
|
170
|
-
* - The iconset for this form.
|
|
171
|
-
*/
|
|
172
|
-
iconset?: string | undefined;
|
|
173
|
-
/**
|
|
174
|
-
* - The components for this form.
|
|
175
|
-
*/
|
|
176
|
-
components?: import("@formio/core").Component[] | undefined;
|
|
177
|
-
/**
|
|
178
|
-
* - Disabled components for this form.
|
|
179
|
-
*/
|
|
180
|
-
disabled?: {
|
|
181
|
-
[key: string]: boolean;
|
|
182
|
-
} | undefined;
|
|
183
|
-
/**
|
|
184
|
-
* - Show hidden fields.
|
|
185
|
-
*/
|
|
186
|
-
showHiddenFields?: boolean | undefined;
|
|
187
|
-
/**
|
|
188
|
-
* - Hidden components for this form.
|
|
189
|
-
*/
|
|
190
|
-
hide?: {
|
|
191
|
-
[key: string]: boolean;
|
|
192
|
-
} | undefined;
|
|
193
|
-
/**
|
|
194
|
-
* - Components to show for this form.
|
|
195
|
-
*/
|
|
196
|
-
show?: {
|
|
197
|
-
[key: string]: boolean;
|
|
198
|
-
} | undefined;
|
|
199
|
-
/**
|
|
200
|
-
* - The Formio instance for this form.
|
|
201
|
-
*/
|
|
202
|
-
formio?: any;
|
|
203
|
-
/**
|
|
204
|
-
* - The decimal separator for this form.
|
|
205
|
-
*/
|
|
206
|
-
decimalSeparator?: string | undefined;
|
|
207
|
-
/**
|
|
208
|
-
* - The thousands separator for this form.
|
|
209
|
-
*/
|
|
210
|
-
thousandsSeparator?: string | undefined;
|
|
211
|
-
/**
|
|
212
|
-
* - The hooks for this form.
|
|
213
|
-
*/
|
|
214
|
-
hooks?: {
|
|
215
|
-
/**
|
|
216
|
-
* - Called before a submission is made.
|
|
217
|
-
*/
|
|
218
|
-
beforeSubmit?: Function | undefined;
|
|
219
|
-
/**
|
|
220
|
-
* - Called before a cancel is made.
|
|
221
|
-
*/
|
|
222
|
-
beforeCancel?: Function | undefined;
|
|
223
|
-
/**
|
|
224
|
-
* - Called before the next page is navigated to.
|
|
225
|
-
*/
|
|
226
|
-
beforeNext?: Function | undefined;
|
|
227
|
-
/**
|
|
228
|
-
* - Called before the previous page is navigated to.
|
|
229
|
-
*/
|
|
230
|
-
beforePrev?: Function | undefined;
|
|
231
|
-
/**
|
|
232
|
-
* - Called when a component is attached.
|
|
233
|
-
*/
|
|
234
|
-
attachComponent?: Function | undefined;
|
|
235
|
-
/**
|
|
236
|
-
* - Called when a data value is set.
|
|
237
|
-
*/
|
|
238
|
-
setDataValue?: Function | undefined;
|
|
239
|
-
/**
|
|
240
|
-
* - Called when components are added.
|
|
241
|
-
*/
|
|
242
|
-
addComponents?: Function | undefined;
|
|
243
|
-
/**
|
|
244
|
-
* - Called when a component is added.
|
|
245
|
-
*/
|
|
246
|
-
addComponent?: Function | undefined;
|
|
247
|
-
/**
|
|
248
|
-
* - Called when a custom validation is made.
|
|
249
|
-
*/
|
|
250
|
-
customValidation?: Function | undefined;
|
|
251
|
-
/**
|
|
252
|
-
* - Called when a webform is attached.
|
|
253
|
-
*/
|
|
254
|
-
attachWebform?: Function | undefined;
|
|
255
|
-
} | undefined;
|
|
256
|
-
/**
|
|
257
|
-
* - Always be dirty.
|
|
258
|
-
*/
|
|
259
|
-
alwaysDirty?: boolean | undefined;
|
|
260
|
-
/**
|
|
261
|
-
* - Skip restoring a draft.
|
|
262
|
-
*/
|
|
263
|
-
skipDraftRestore?: boolean | undefined;
|
|
264
|
-
/**
|
|
265
|
-
* - The display for this form.
|
|
266
|
-
*/
|
|
267
|
-
display?: "form" | "pdf" | "wizard" | undefined;
|
|
268
|
-
/**
|
|
269
|
-
* - The CDN url for this form.
|
|
270
|
-
*/
|
|
271
|
-
cdnUrl?: string | undefined;
|
|
272
|
-
/**
|
|
273
|
-
* - Flatten the form.
|
|
274
|
-
*/
|
|
275
|
-
flatten?: boolean | undefined;
|
|
276
|
-
/**
|
|
277
|
-
* - Sanitize the form.
|
|
278
|
-
*/
|
|
279
|
-
sanitize?: boolean | undefined;
|
|
280
|
-
/**
|
|
281
|
-
* - The sanitize configuration for this form.
|
|
282
|
-
*/
|
|
283
|
-
sanitizeConfig?: {
|
|
284
|
-
/**
|
|
285
|
-
* - The html attributes to allow with sanitization.
|
|
286
|
-
*/
|
|
287
|
-
addAttr?: string[] | undefined;
|
|
288
|
-
/**
|
|
289
|
-
* - The html tags to allow with sanitization.
|
|
290
|
-
*/
|
|
291
|
-
addTags?: string[] | undefined;
|
|
292
|
-
/**
|
|
293
|
-
* - The html attributes to allow with sanitization.
|
|
294
|
-
*/
|
|
295
|
-
allowedAttrs?: string[] | undefined;
|
|
296
|
-
/**
|
|
297
|
-
* - The html tags to allow with sanitization.
|
|
298
|
-
*/
|
|
299
|
-
allowedTags?: string[] | undefined;
|
|
300
|
-
/**
|
|
301
|
-
* - The regex for allowed URIs.
|
|
302
|
-
*/
|
|
303
|
-
allowedUriRegex?: string[] | undefined;
|
|
304
|
-
/**
|
|
305
|
-
* - The URI attributes to allow with sanitization.
|
|
306
|
-
*/
|
|
307
|
-
addUriSafeAttr?: string[] | undefined;
|
|
308
|
-
} | undefined;
|
|
309
|
-
/**
|
|
310
|
-
* - The button settings for this form.
|
|
311
|
-
*/
|
|
312
|
-
buttonSettings?: {
|
|
313
|
-
/**
|
|
314
|
-
* - Show the previous button in wizard forms.
|
|
315
|
-
*/
|
|
316
|
-
showPrevious?: boolean | undefined;
|
|
317
|
-
/**
|
|
318
|
-
* - Show the next button in wizard forms.
|
|
319
|
-
*/
|
|
320
|
-
showNext?: boolean | undefined;
|
|
321
|
-
/**
|
|
322
|
-
* - Show the cancel button in wizard forms.
|
|
323
|
-
*/
|
|
324
|
-
showCancel?: boolean | undefined;
|
|
325
|
-
/**
|
|
326
|
-
* - Show the submit button in wizard forms.
|
|
327
|
-
*/
|
|
328
|
-
showSubmit?: boolean | undefined;
|
|
329
|
-
} | undefined;
|
|
330
|
-
/**
|
|
331
|
-
* - The breadcrumb settings for this form.
|
|
332
|
-
*/
|
|
333
|
-
breadcrumbSettings?: object | undefined;
|
|
334
|
-
/**
|
|
335
|
-
* - Allow the previous button (for Wizard forms).
|
|
336
|
-
*/
|
|
337
|
-
allowPrevious?: boolean | undefined;
|
|
338
|
-
/**
|
|
339
|
-
* - The order of the buttons (for Wizard forms).
|
|
340
|
-
*/
|
|
341
|
-
wizardButtonOrder?: string[] | undefined;
|
|
342
|
-
/**
|
|
343
|
-
* - Show the checkbox background.
|
|
344
|
-
*/
|
|
345
|
-
showCheckboxBackground?: boolean | undefined;
|
|
346
|
-
/**
|
|
347
|
-
* - The zoom for PDF forms.
|
|
348
|
-
*/
|
|
349
|
-
zoom?: number | undefined;
|
|
350
|
-
};
|
|
19
|
+
constructor(...args: any[]);
|
|
351
20
|
ready: Promise<any>;
|
|
352
21
|
readyResolve: (value: any) => void;
|
|
353
22
|
readyReject: (reason?: any) => void;
|
|
354
23
|
instance: any;
|
|
355
24
|
element: any;
|
|
25
|
+
options: any;
|
|
356
26
|
display: string;
|
|
357
27
|
createElement(tag: any, attrs: any, children: any): any;
|
|
358
28
|
set loading(load: any);
|
|
359
29
|
loader: any;
|
|
360
30
|
/**
|
|
361
31
|
* Create a new form instance provided the display of the form.
|
|
32
|
+
*
|
|
362
33
|
* @param {string} display - The display of the form, either "wizard", "form", or "pdf"
|
|
363
|
-
* @
|
|
34
|
+
* @return {*}
|
|
364
35
|
*/
|
|
365
|
-
create(display: string):
|
|
36
|
+
create(display: string): any;
|
|
366
37
|
/**
|
|
367
38
|
* Sets the form. Either as JSON or a URL to a form JSON schema.
|
|
39
|
+
*
|
|
368
40
|
* @param {string|object} formParam - Either the form JSON or the URL of the form json.
|
|
369
|
-
* @
|
|
41
|
+
* @return {*}
|
|
370
42
|
*/
|
|
371
43
|
set form(formParam: object);
|
|
372
44
|
/**
|
|
373
45
|
* Returns the loaded forms JSON.
|
|
374
|
-
*
|
|
46
|
+
*
|
|
47
|
+
* @return {object} - The loaded form's JSON
|
|
375
48
|
*/
|
|
376
49
|
get form(): object;
|
|
377
50
|
errorForm(err: any): {
|
|
@@ -390,40 +63,38 @@ export default class Form extends Element {
|
|
|
390
63
|
}[];
|
|
391
64
|
};
|
|
392
65
|
/**
|
|
393
|
-
|
|
394
|
-
|
|
395
|
-
|
|
396
|
-
|
|
397
|
-
|
|
398
|
-
|
|
399
|
-
|
|
400
|
-
|
|
401
|
-
* @param {import('@formio/core').Form} formParam - The form JSON to set this form to.
|
|
402
|
-
* @returns {Promise<Webform|Wizard|PDF>} - The webform instance that was created.
|
|
403
|
-
*/
|
|
404
|
-
setForm(formParam: import('@formio/core').Form): Promise<Webform | Wizard | PDF>;
|
|
66
|
+
* Check Subdirectories path and provide correct options
|
|
67
|
+
*
|
|
68
|
+
* @param {string} url - The the URL of the form json.
|
|
69
|
+
* @param {form} object - The form json.
|
|
70
|
+
* @return {object} The initial options with base and project.
|
|
71
|
+
*/
|
|
72
|
+
getFormInitOptions(url: string, form: any): object;
|
|
73
|
+
setForm(formParam: any): any;
|
|
405
74
|
_form: any;
|
|
406
75
|
getSubmission(formio: any, opts: any): any;
|
|
407
76
|
/**
|
|
408
77
|
* Changes the display of the form.
|
|
78
|
+
*
|
|
409
79
|
* @param {string} display - The display to set this form. Either "wizard", "form", or "pdf"
|
|
410
|
-
* @
|
|
80
|
+
* @return {Promise<T>}
|
|
411
81
|
*/
|
|
412
|
-
setDisplay(display: string): Promise<
|
|
82
|
+
setDisplay(display: string): Promise<T>;
|
|
413
83
|
empty(): void;
|
|
414
84
|
/**
|
|
415
85
|
* Sanitize an html string.
|
|
416
|
-
*
|
|
417
|
-
* @param
|
|
418
|
-
* @returns {
|
|
86
|
+
*
|
|
87
|
+
* @param string
|
|
88
|
+
* @returns {*}
|
|
419
89
|
*/
|
|
420
|
-
sanitize(dirty:
|
|
90
|
+
sanitize(dirty: any, forceSanitize: any): any;
|
|
421
91
|
setContent(element: any, content: any, forceSanitize: any): boolean;
|
|
422
92
|
/**
|
|
423
93
|
* Build a new form.
|
|
424
|
-
*
|
|
94
|
+
*
|
|
95
|
+
* @return {Promise<T>}
|
|
425
96
|
*/
|
|
426
|
-
build(): Promise<
|
|
97
|
+
build(): Promise<T>;
|
|
427
98
|
render(): Promise<any>;
|
|
428
99
|
attach(element: any): any;
|
|
429
100
|
}
|
package/lib/cjs/Form.js
CHANGED
|
@@ -32,22 +32,28 @@ const displays_1 = __importDefault(require("./displays"));
|
|
|
32
32
|
const templates_1 = __importDefault(require("./templates"));
|
|
33
33
|
const FormioUtils = __importStar(require("./utils/utils"));
|
|
34
34
|
class Form extends Element_1.default {
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
35
|
+
/**
|
|
36
|
+
* Creates an easy to use interface for embedding webforms, pdfs, and wizards into your application.
|
|
37
|
+
*
|
|
38
|
+
* @param {Object} element - The DOM element you wish to render this form within.
|
|
39
|
+
* @param {Object | string} form - Either a Form JSON schema or the URL of a hosted form via. form.io.
|
|
40
|
+
* @param {Object} options - The options to create a new form instance.
|
|
41
|
+
* @param {boolean} options.readOnly - Set this form to readOnly
|
|
42
|
+
* @param {boolean} options.noAlerts - Set to true to disable the alerts dialog.
|
|
43
|
+
* @param {boolean} options.i18n - The translation file for this rendering. @see https://github.com/formio/formio.js/blob/master/i18n.js
|
|
44
|
+
* @param {boolean} options.template - Provides a way to inject custom logic into the creation of every element rendered within the form.
|
|
45
|
+
*
|
|
46
|
+
* @example
|
|
47
|
+
* import Form from '@formio/js/Form';
|
|
48
|
+
* const form = new Form(document.getElementById('formio'), 'https://examples.form.io/example');
|
|
49
|
+
* form.build();
|
|
50
|
+
*/
|
|
51
|
+
constructor(...args) {
|
|
52
|
+
let options = args[0] instanceof HTMLElement ? args[2] : args[1];
|
|
47
53
|
if (Formio_1.Formio.options && Formio_1.Formio.options.form) {
|
|
48
|
-
|
|
54
|
+
options = Object.assign(options, Formio_1.Formio.options.form);
|
|
49
55
|
}
|
|
50
|
-
super(
|
|
56
|
+
super(options);
|
|
51
57
|
if (this.options.useSessionToken) {
|
|
52
58
|
Formio_1.Formio.useSessionToken(this.options);
|
|
53
59
|
}
|
|
@@ -56,22 +62,30 @@ class Form extends Element_1.default {
|
|
|
56
62
|
this.readyReject = reject;
|
|
57
63
|
});
|
|
58
64
|
this.instance = null;
|
|
59
|
-
if (
|
|
65
|
+
if (args[0] instanceof HTMLElement) {
|
|
60
66
|
if (this.element) {
|
|
61
67
|
delete this.element.component;
|
|
62
68
|
}
|
|
63
|
-
this.element =
|
|
69
|
+
this.element = args[0];
|
|
70
|
+
this.options = args[2] || {};
|
|
71
|
+
this.options.events = this.events;
|
|
72
|
+
this.setForm(args[1])
|
|
73
|
+
.then(() => this.readyResolve(this.instance))
|
|
74
|
+
.catch(this.readyReject);
|
|
64
75
|
}
|
|
65
|
-
else {
|
|
76
|
+
else if (args[0]) {
|
|
66
77
|
this.element = null;
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
this.setForm(
|
|
78
|
+
this.options = args[1] || {};
|
|
79
|
+
this.options.events = this.events;
|
|
80
|
+
this.setForm(args[0])
|
|
70
81
|
.then(() => this.readyResolve(this.instance))
|
|
71
82
|
.catch(this.readyReject);
|
|
72
83
|
}
|
|
73
|
-
|
|
74
|
-
|
|
84
|
+
else {
|
|
85
|
+
this.element = null;
|
|
86
|
+
this.options = {};
|
|
87
|
+
this.options.events = this.events;
|
|
88
|
+
}
|
|
75
89
|
this.display = '';
|
|
76
90
|
}
|
|
77
91
|
createElement(tag, attrs, children) {
|
|
@@ -119,8 +133,9 @@ class Form extends Element_1.default {
|
|
|
119
133
|
}
|
|
120
134
|
/**
|
|
121
135
|
* Create a new form instance provided the display of the form.
|
|
136
|
+
*
|
|
122
137
|
* @param {string} display - The display of the form, either "wizard", "form", or "pdf"
|
|
123
|
-
* @
|
|
138
|
+
* @return {*}
|
|
124
139
|
*/
|
|
125
140
|
create(display) {
|
|
126
141
|
if (this.options && (this.options.flatten || this.options.renderMode === 'flat')) {
|
|
@@ -137,8 +152,9 @@ class Form extends Element_1.default {
|
|
|
137
152
|
}
|
|
138
153
|
/**
|
|
139
154
|
* Sets the form. Either as JSON or a URL to a form JSON schema.
|
|
155
|
+
*
|
|
140
156
|
* @param {string|object} formParam - Either the form JSON or the URL of the form json.
|
|
141
|
-
* @
|
|
157
|
+
* @return {*}
|
|
142
158
|
*/
|
|
143
159
|
set form(formParam) {
|
|
144
160
|
this.setForm(formParam);
|
|
@@ -165,11 +181,12 @@ class Form extends Element_1.default {
|
|
|
165
181
|
};
|
|
166
182
|
}
|
|
167
183
|
/**
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
184
|
+
* Check Subdirectories path and provide correct options
|
|
185
|
+
*
|
|
186
|
+
* @param {string} url - The the URL of the form json.
|
|
187
|
+
* @param {form} object - The form json.
|
|
188
|
+
* @return {object} The initial options with base and project.
|
|
189
|
+
*/
|
|
173
190
|
getFormInitOptions(url, form) {
|
|
174
191
|
const options = {};
|
|
175
192
|
const index = url.indexOf(form === null || form === void 0 ? void 0 : form.path);
|
|
@@ -193,11 +210,6 @@ class Form extends Element_1.default {
|
|
|
193
210
|
}
|
|
194
211
|
return {};
|
|
195
212
|
}
|
|
196
|
-
/**
|
|
197
|
-
* Sets the form to the JSON schema of a form.
|
|
198
|
-
* @param {import('@formio/core').Form} formParam - The form JSON to set this form to.
|
|
199
|
-
* @returns {Promise<Webform|Wizard|PDF>} - The webform instance that was created.
|
|
200
|
-
*/
|
|
201
213
|
setForm(formParam) {
|
|
202
214
|
let result;
|
|
203
215
|
formParam = formParam || this.form;
|
|
@@ -258,15 +270,17 @@ class Form extends Element_1.default {
|
|
|
258
270
|
}
|
|
259
271
|
/**
|
|
260
272
|
* Returns the loaded forms JSON.
|
|
261
|
-
*
|
|
273
|
+
*
|
|
274
|
+
* @return {object} - The loaded form's JSON
|
|
262
275
|
*/
|
|
263
276
|
get form() {
|
|
264
277
|
return this._form;
|
|
265
278
|
}
|
|
266
279
|
/**
|
|
267
280
|
* Changes the display of the form.
|
|
281
|
+
*
|
|
268
282
|
* @param {string} display - The display to set this form. Either "wizard", "form", or "pdf"
|
|
269
|
-
* @
|
|
283
|
+
* @return {Promise<T>}
|
|
270
284
|
*/
|
|
271
285
|
setDisplay(display) {
|
|
272
286
|
if ((this.display === display) && this.instance) {
|
|
@@ -307,9 +321,9 @@ class Form extends Element_1.default {
|
|
|
307
321
|
}
|
|
308
322
|
/**
|
|
309
323
|
* Sanitize an html string.
|
|
310
|
-
*
|
|
311
|
-
* @param
|
|
312
|
-
* @returns {
|
|
324
|
+
*
|
|
325
|
+
* @param string
|
|
326
|
+
* @returns {*}
|
|
313
327
|
*/
|
|
314
328
|
sanitize(dirty, forceSanitize) {
|
|
315
329
|
// If Sanitize is turned off
|
|
@@ -327,7 +341,8 @@ class Form extends Element_1.default {
|
|
|
327
341
|
}
|
|
328
342
|
/**
|
|
329
343
|
* Build a new form.
|
|
330
|
-
*
|
|
344
|
+
*
|
|
345
|
+
* @return {Promise<T>}
|
|
331
346
|
*/
|
|
332
347
|
build() {
|
|
333
348
|
if (!this.instance) {
|
|
@@ -383,16 +398,15 @@ exports.default = Form;
|
|
|
383
398
|
// Allow simple embedding.
|
|
384
399
|
Formio_1.Formio.embedForm = (embed) => Form.embed(embed);
|
|
385
400
|
/**
|
|
386
|
-
*
|
|
387
|
-
*
|
|
388
|
-
* @param {
|
|
389
|
-
* @param {
|
|
390
|
-
* @
|
|
391
|
-
*
|
|
392
|
-
*
|
|
393
|
-
* Formio.createForm(document.getElementById('formio'), 'https://examples.form.io/example');
|
|
401
|
+
* Factory that creates a new form based on the form parameters.
|
|
402
|
+
*
|
|
403
|
+
* @param element {HMTLElement} - The HTML Element to add this form to.
|
|
404
|
+
* @param form {string|Object} - The src of the form, or a form object.
|
|
405
|
+
* @param options {Object} - The options to create this form.
|
|
406
|
+
*
|
|
407
|
+
* @return {Promise} - When the form is instance is ready.
|
|
394
408
|
*/
|
|
395
|
-
Formio_1.Formio.createForm = (
|
|
396
|
-
return (new Form(
|
|
409
|
+
Formio_1.Formio.createForm = (...args) => {
|
|
410
|
+
return (new Form(...args)).ready;
|
|
397
411
|
};
|
|
398
412
|
Formio_1.Formio.Form = Form;
|