@formio/js 5.0.0-dev.5633.8d2b30d → 5.0.0-dev.5633.fde3bc9
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/Changelog.md +47 -2
- package/dist/formio.builder.css +8 -8
- 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 +8 -8
- package/dist/formio.form.js +615 -1196
- package/dist/formio.form.min.css +1 -1
- package/dist/formio.form.min.js +1 -1
- package/dist/formio.form.min.js.LICENSE.txt +3 -5
- package/dist/formio.full.css +8 -8
- package/dist/formio.full.js +659 -920
- package/dist/formio.full.min.css +1 -1
- package/dist/formio.full.min.js +1 -1
- package/dist/formio.full.min.js.LICENSE.txt +3 -5
- package/dist/formio.js +18 -18
- package/dist/formio.min.js +1 -1
- package/dist/formio.min.js.LICENSE.txt +1 -1
- package/dist/formio.utils.js +1829 -492
- package/dist/formio.utils.min.js +1 -1
- package/dist/formio.utils.min.js.LICENSE.txt +10 -4
- package/embed.d.ts +1 -0
- package/form.d.ts +1 -0
- package/lib/cjs/CDN.d.ts +1 -0
- package/lib/cjs/CDN.js +6 -3
- package/lib/cjs/Element.d.ts +86 -96
- package/lib/cjs/Element.js +68 -78
- package/lib/cjs/Embed.d.ts +1 -1
- package/lib/cjs/Embed.js +52 -12
- package/lib/cjs/Form.d.ts +365 -36
- package/lib/cjs/Form.js +50 -64
- package/lib/cjs/FormBuilder.d.ts +187 -2
- package/lib/cjs/FormBuilder.js +30 -8
- package/lib/cjs/InlineEmbed.d.ts +7 -0
- package/lib/cjs/InlineEmbed.js +116 -0
- package/lib/cjs/PDF.d.ts +11 -13
- package/lib/cjs/PDF.js +6 -8
- package/lib/cjs/Webform.d.ts +183 -143
- package/lib/cjs/Webform.js +310 -298
- package/lib/cjs/WebformBuilder.d.ts +16 -14
- package/lib/cjs/WebformBuilder.js +11 -10
- package/lib/cjs/Wizard.d.ts +31 -21
- package/lib/cjs/Wizard.js +43 -20
- package/lib/cjs/WizardBuilder.d.ts +1 -1
- package/lib/cjs/addons/PasswordStrength/PasswordStrengthAddon.d.ts +8 -5
- package/lib/cjs/addons/PasswordStrength/PasswordStrengthAddon.js +6 -3
- 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 +507 -276
- package/lib/cjs/components/_classes/component/Component.form.d.ts +6 -3
- package/lib/cjs/components/_classes/component/Component.form.js +5 -0
- package/lib/cjs/components/_classes/component/Component.js +438 -196
- package/lib/cjs/components/_classes/component/editForm/Component.edit.display.js +0 -8
- 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/component/fixtures/comp6.d.ts +77 -0
- package/lib/cjs/components/_classes/component/fixtures/comp6.js +59 -0
- package/lib/cjs/components/_classes/component/fixtures/index.d.ts +2 -1
- package/lib/cjs/components/_classes/component/fixtures/index.js +3 -1
- package/lib/cjs/components/_classes/field/Field.d.ts +11 -2
- package/lib/cjs/components/_classes/field/Field.js +13 -1
- package/lib/cjs/components/_classes/input/Input.d.ts +4 -3
- package/lib/cjs/components/_classes/input/Input.js +8 -6
- package/lib/cjs/components/_classes/list/ListComponent.d.ts +2 -2
- package/lib/cjs/components/_classes/list/ListComponent.form.d.ts +6 -3
- package/lib/cjs/components/_classes/list/ListComponent.form.js +5 -0
- package/lib/cjs/components/_classes/multivalue/Multivalue.d.ts +43 -12
- package/lib/cjs/components/_classes/multivalue/Multivalue.js +37 -3
- package/lib/cjs/components/_classes/nested/NestedComponent.d.ts +163 -67
- package/lib/cjs/components/_classes/nested/NestedComponent.form.d.ts +6 -3
- package/lib/cjs/components/_classes/nested/NestedComponent.form.js +5 -0
- package/lib/cjs/components/_classes/nested/NestedComponent.js +175 -54
- 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 +7 -1
- package/lib/cjs/components/_classes/nesteddata/NestedDataComponent.js +2 -3
- package/lib/cjs/components/address/Address.d.ts +4 -2
- package/lib/cjs/components/address/Address.form.d.ts +6 -3
- package/lib/cjs/components/address/Address.form.js +5 -0
- package/lib/cjs/components/button/Button.d.ts +3 -12
- package/lib/cjs/components/button/Button.form.d.ts +6 -3
- package/lib/cjs/components/button/Button.form.js +5 -0
- package/lib/cjs/components/button/Button.js +5 -0
- package/lib/cjs/components/checkbox/Checkbox.d.ts +4 -27
- package/lib/cjs/components/checkbox/Checkbox.form.d.ts +6 -3
- package/lib/cjs/components/checkbox/Checkbox.form.js +5 -0
- package/lib/cjs/components/columns/Columns.d.ts +3 -2
- package/lib/cjs/components/columns/Columns.form.d.ts +6 -3
- package/lib/cjs/components/columns/Columns.form.js +5 -0
- package/lib/cjs/components/columns/Columns.js +1 -1
- package/lib/cjs/components/container/Container.form.d.ts +6 -3
- package/lib/cjs/components/container/Container.form.js +5 -0
- package/lib/cjs/components/content/Content.d.ts +2 -1
- package/lib/cjs/components/content/Content.form.d.ts +6 -3
- package/lib/cjs/components/content/Content.form.js +5 -0
- package/lib/cjs/components/currency/Currency.form.d.ts +6 -3
- package/lib/cjs/components/currency/Currency.form.js +5 -0
- package/lib/cjs/components/currency/Currency.js +1 -2
- package/lib/cjs/components/datagrid/DataGrid.d.ts +8 -7
- package/lib/cjs/components/datagrid/DataGrid.form.d.ts +6 -3
- package/lib/cjs/components/datagrid/DataGrid.form.js +5 -0
- package/lib/cjs/components/datagrid/DataGrid.js +5 -5
- package/lib/cjs/components/datagrid/fixtures/comp-with-checkboxes.d.ts +29 -0
- package/lib/cjs/components/datagrid/fixtures/comp-with-checkboxes.js +36 -0
- package/lib/cjs/components/datagrid/fixtures/index.d.ts +2 -1
- package/lib/cjs/components/datagrid/fixtures/index.js +3 -1
- package/lib/cjs/components/datamap/DataMap.d.ts +1 -0
- package/lib/cjs/components/datamap/DataMap.form.d.ts +6 -3
- package/lib/cjs/components/datamap/DataMap.form.js +5 -0
- package/lib/cjs/components/datetime/DateTime.d.ts +0 -14
- package/lib/cjs/components/datetime/DateTime.form.d.ts +6 -3
- package/lib/cjs/components/datetime/DateTime.form.js +5 -0
- package/lib/cjs/components/datetime/editForm/DateTime.edit.date.js +2 -2
- package/lib/cjs/components/day/Day.d.ts +23 -49
- package/lib/cjs/components/day/Day.form.d.ts +6 -3
- package/lib/cjs/components/day/Day.form.js +5 -0
- package/lib/cjs/components/day/Day.js +16 -21
- package/lib/cjs/components/day/fixtures/comp7.d.ts +109 -0
- package/lib/cjs/components/day/fixtures/comp7.js +109 -0
- package/lib/cjs/components/day/fixtures/index.d.ts +2 -1
- package/lib/cjs/components/day/fixtures/index.js +3 -1
- package/lib/cjs/components/editgrid/EditGrid.d.ts +7 -3
- package/lib/cjs/components/editgrid/EditGrid.form.d.ts +6 -3
- package/lib/cjs/components/editgrid/EditGrid.form.js +5 -0
- package/lib/cjs/components/editgrid/EditGrid.js +3 -3
- package/lib/cjs/components/editgrid/editForm/EditGrid.edit.display.js +2 -5
- package/lib/cjs/components/editgrid/editForm/EditGrid.edit.templates.js +6 -9
- package/lib/cjs/components/email/Email.form.d.ts +6 -3
- package/lib/cjs/components/email/Email.form.js +5 -0
- package/lib/cjs/components/fieldset/Fieldset.form.d.ts +6 -3
- package/lib/cjs/components/fieldset/Fieldset.form.js +5 -0
- package/lib/cjs/components/file/File.d.ts +9 -22
- package/lib/cjs/components/file/File.form.d.ts +6 -3
- package/lib/cjs/components/file/File.form.js +5 -0
- package/lib/cjs/components/file/File.js +1 -2
- package/lib/cjs/components/form/Form.d.ts +34 -24
- package/lib/cjs/components/form/Form.form.d.ts +6 -3
- package/lib/cjs/components/form/Form.form.js +5 -0
- package/lib/cjs/components/form/Form.js +15 -13
- package/lib/cjs/components/hidden/Hidden.d.ts +1 -11
- package/lib/cjs/components/hidden/Hidden.form.d.ts +6 -3
- package/lib/cjs/components/hidden/Hidden.form.js +5 -0
- package/lib/cjs/components/hidden/Hidden.js +1 -2
- package/lib/cjs/components/html/HTML.d.ts +2 -1
- package/lib/cjs/components/html/HTML.form.d.ts +6 -3
- package/lib/cjs/components/html/HTML.form.js +5 -0
- package/lib/cjs/components/number/Number.d.ts +3 -17
- package/lib/cjs/components/number/Number.form.d.ts +6 -3
- package/lib/cjs/components/number/Number.form.js +5 -0
- package/lib/cjs/components/number/Number.js +1 -2
- package/lib/cjs/components/panel/Panel.form.d.ts +6 -3
- package/lib/cjs/components/panel/Panel.form.js +5 -0
- package/lib/cjs/components/panel/Panel.js +0 -1
- package/lib/cjs/components/password/Password.form.d.ts +6 -3
- package/lib/cjs/components/password/Password.form.js +5 -0
- package/lib/cjs/components/phonenumber/PhoneNumber.form.d.ts +6 -3
- package/lib/cjs/components/phonenumber/PhoneNumber.form.js +5 -0
- package/lib/cjs/components/radio/Radio.d.ts +3 -26
- package/lib/cjs/components/radio/Radio.form.d.ts +6 -3
- package/lib/cjs/components/radio/Radio.form.js +5 -0
- package/lib/cjs/components/radio/Radio.js +6 -6
- package/lib/cjs/components/recaptcha/ReCaptcha.d.ts +1 -1
- package/lib/cjs/components/recaptcha/ReCaptcha.form.d.ts +6 -3
- package/lib/cjs/components/recaptcha/ReCaptcha.form.js +5 -0
- package/lib/cjs/components/select/Select.d.ts +16 -39
- package/lib/cjs/components/select/Select.form.d.ts +6 -3
- package/lib/cjs/components/select/Select.form.js +5 -0
- package/lib/cjs/components/select/Select.js +13 -16
- package/lib/cjs/components/selectboxes/SelectBoxes.d.ts +2 -17
- package/lib/cjs/components/selectboxes/SelectBoxes.form.d.ts +6 -3
- package/lib/cjs/components/selectboxes/SelectBoxes.form.js +5 -0
- package/lib/cjs/components/selectboxes/SelectBoxes.js +7 -9
- package/lib/cjs/components/signature/Signature.d.ts +0 -14
- package/lib/cjs/components/signature/Signature.form.d.ts +6 -3
- package/lib/cjs/components/signature/Signature.form.js +5 -0
- package/lib/cjs/components/survey/Survey.d.ts +3 -15
- package/lib/cjs/components/survey/Survey.form.d.ts +6 -3
- package/lib/cjs/components/survey/Survey.form.js +5 -0
- package/lib/cjs/components/table/Table.d.ts +2 -1
- package/lib/cjs/components/table/Table.form.d.ts +6 -3
- package/lib/cjs/components/table/Table.form.js +5 -0
- package/lib/cjs/components/tabs/Tabs.d.ts +4 -4
- package/lib/cjs/components/tabs/Tabs.form.d.ts +6 -3
- package/lib/cjs/components/tabs/Tabs.form.js +5 -0
- package/lib/cjs/components/tabs/Tabs.js +1 -2
- package/lib/cjs/components/tags/Tags.d.ts +0 -14
- package/lib/cjs/components/tags/Tags.form.d.ts +6 -3
- package/lib/cjs/components/tags/Tags.form.js +5 -0
- package/lib/cjs/components/textarea/TextArea.d.ts +4 -9
- package/lib/cjs/components/textarea/TextArea.form.d.ts +6 -3
- package/lib/cjs/components/textarea/TextArea.form.js +5 -0
- package/lib/cjs/components/textarea/TextArea.js +2 -2
- package/lib/cjs/components/textfield/TextField.d.ts +14 -30
- package/lib/cjs/components/textfield/TextField.form.d.ts +6 -3
- package/lib/cjs/components/textfield/TextField.form.js +5 -0
- package/lib/cjs/components/textfield/TextField.js +16 -17
- package/lib/cjs/components/time/Time.form.d.ts +6 -3
- package/lib/cjs/components/time/Time.form.js +5 -0
- package/lib/cjs/components/unknown/Unknown.form.d.ts +5 -34
- package/lib/cjs/components/unknown/Unknown.form.js +4 -0
- package/lib/cjs/components/url/Url.form.d.ts +6 -3
- package/lib/cjs/components/url/Url.form.js +5 -0
- package/lib/cjs/components/well/Well.form.d.ts +6 -3
- package/lib/cjs/components/well/Well.form.js +5 -0
- package/lib/cjs/formio.embed.d.ts +1 -2
- package/lib/cjs/formio.embed.js +2 -100
- package/lib/cjs/formio.form.d.ts +11 -4
- package/lib/cjs/formio.form.js +13 -5
- package/lib/cjs/providers/Providers.d.ts +36 -5
- package/lib/cjs/providers/Providers.js +29 -0
- package/lib/cjs/providers/address/AddressProvider.d.ts +131 -12
- package/lib/cjs/providers/address/AddressProvider.js +88 -2
- package/lib/cjs/providers/address/AzureAddressProvider.d.ts +48 -1
- package/lib/cjs/providers/address/AzureAddressProvider.js +37 -0
- package/lib/cjs/providers/address/CustomAddressProvider.d.ts +27 -4
- package/lib/cjs/providers/address/CustomAddressProvider.js +34 -0
- package/lib/cjs/providers/address/GoogleAddressProvider.d.ts +130 -6
- package/lib/cjs/providers/address/GoogleAddressProvider.js +73 -1
- package/lib/cjs/providers/address/NominatimAddressProvider.d.ts +32 -7
- package/lib/cjs/providers/address/NominatimAddressProvider.js +33 -0
- package/lib/cjs/providers/address/index.d.ts +3 -1
- package/lib/cjs/providers/processor/fileProcessor.d.ts +7 -1
- package/lib/cjs/providers/processor/fileProcessor.js +6 -0
- package/lib/cjs/providers/storage/azure.d.ts +6 -13
- package/lib/cjs/providers/storage/azure.js +5 -0
- package/lib/cjs/providers/storage/base64.d.ts +5 -6
- package/lib/cjs/providers/storage/base64.js +4 -0
- package/lib/cjs/providers/storage/dropbox.d.ts +6 -4
- package/lib/cjs/providers/storage/dropbox.js +5 -0
- package/lib/cjs/providers/storage/googleDrive.d.ts +7 -5
- package/lib/cjs/providers/storage/googleDrive.js +6 -0
- package/lib/cjs/providers/storage/indexeddb.d.ts +5 -7
- package/lib/cjs/providers/storage/indexeddb.js +4 -0
- package/lib/cjs/providers/storage/s3.d.ts +6 -20
- package/lib/cjs/providers/storage/s3.js +5 -0
- package/lib/cjs/providers/storage/url.d.ts +6 -7
- package/lib/cjs/providers/storage/url.js +10 -0
- package/lib/cjs/providers/storage/util.d.ts +24 -1
- package/lib/cjs/providers/storage/util.js +18 -0
- package/lib/cjs/templates/Templates.d.ts +1 -0
- package/lib/cjs/translations/en.d.ts +2 -0
- package/lib/cjs/translations/en.js +3 -1
- package/lib/cjs/utils/ChoicesWrapper.d.ts +1 -1
- package/lib/cjs/utils/ChoicesWrapper.js +13 -2
- package/lib/cjs/utils/Evaluator.d.ts +6 -3
- package/lib/cjs/utils/Evaluator.js +11 -20
- package/lib/cjs/utils/builder.d.ts +9 -7
- package/lib/cjs/utils/builder.js +10 -5
- package/lib/cjs/utils/calendarUtils.d.ts +7 -13
- package/lib/cjs/utils/calendarUtils.js +10 -17
- package/lib/cjs/utils/formUtils.d.ts +43 -171
- package/lib/cjs/utils/formUtils.js +38 -569
- package/lib/cjs/utils/utils.d.ts +367 -221
- package/lib/cjs/utils/utils.js +335 -228
- package/lib/cjs/widgets/CalendarWidget.d.ts +9 -10
- package/lib/cjs/widgets/CalendarWidget.js +9 -11
- package/lib/mjs/CDN.d.ts +1 -0
- package/lib/mjs/CDN.js +6 -3
- package/lib/mjs/Element.d.ts +86 -96
- package/lib/mjs/Element.js +68 -78
- package/lib/mjs/Embed.d.ts +1 -1
- package/lib/mjs/Embed.js +52 -12
- package/lib/mjs/Form.d.ts +365 -36
- package/lib/mjs/Form.js +140 -57
- package/lib/mjs/FormBuilder.d.ts +187 -2
- package/lib/mjs/FormBuilder.js +32 -8
- package/lib/mjs/InlineEmbed.d.ts +7 -0
- package/lib/mjs/InlineEmbed.js +112 -0
- package/lib/mjs/PDF.d.ts +11 -13
- package/lib/mjs/PDF.js +6 -8
- package/lib/mjs/Webform.d.ts +183 -143
- package/lib/mjs/Webform.js +322 -310
- package/lib/mjs/WebformBuilder.d.ts +16 -14
- package/lib/mjs/WebformBuilder.js +11 -10
- package/lib/mjs/Wizard.d.ts +31 -21
- package/lib/mjs/Wizard.js +42 -19
- package/lib/mjs/WizardBuilder.d.ts +1 -1
- package/lib/mjs/addons/PasswordStrength/PasswordStrengthAddon.d.ts +8 -5
- package/lib/mjs/addons/PasswordStrength/PasswordStrengthAddon.js +6 -3
- 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 +507 -276
- package/lib/mjs/components/_classes/component/Component.form.d.ts +6 -3
- package/lib/mjs/components/_classes/component/Component.form.js +5 -0
- package/lib/mjs/components/_classes/component/Component.js +438 -196
- package/lib/mjs/components/_classes/component/editForm/Component.edit.display.js +0 -8
- 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/component/fixtures/comp6.d.ts +77 -0
- package/lib/mjs/components/_classes/component/fixtures/comp6.js +57 -0
- package/lib/mjs/components/_classes/component/fixtures/index.d.ts +2 -1
- package/lib/mjs/components/_classes/component/fixtures/index.js +2 -1
- package/lib/mjs/components/_classes/field/Field.d.ts +11 -2
- package/lib/mjs/components/_classes/field/Field.js +13 -1
- package/lib/mjs/components/_classes/input/Input.d.ts +4 -3
- package/lib/mjs/components/_classes/input/Input.js +8 -6
- package/lib/mjs/components/_classes/list/ListComponent.d.ts +2 -2
- package/lib/mjs/components/_classes/list/ListComponent.form.d.ts +6 -3
- package/lib/mjs/components/_classes/list/ListComponent.form.js +5 -0
- package/lib/mjs/components/_classes/multivalue/Multivalue.d.ts +43 -12
- package/lib/mjs/components/_classes/multivalue/Multivalue.js +37 -3
- package/lib/mjs/components/_classes/nested/NestedComponent.d.ts +163 -67
- package/lib/mjs/components/_classes/nested/NestedComponent.form.d.ts +6 -3
- package/lib/mjs/components/_classes/nested/NestedComponent.form.js +5 -0
- package/lib/mjs/components/_classes/nested/NestedComponent.js +175 -54
- 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 +7 -1
- package/lib/mjs/components/_classes/nesteddata/NestedDataComponent.js +2 -3
- package/lib/mjs/components/address/Address.d.ts +4 -2
- package/lib/mjs/components/address/Address.form.d.ts +6 -3
- package/lib/mjs/components/address/Address.form.js +5 -0
- package/lib/mjs/components/button/Button.d.ts +3 -12
- package/lib/mjs/components/button/Button.form.d.ts +6 -3
- package/lib/mjs/components/button/Button.form.js +5 -0
- package/lib/mjs/components/button/Button.js +5 -0
- package/lib/mjs/components/checkbox/Checkbox.d.ts +4 -27
- package/lib/mjs/components/checkbox/Checkbox.form.d.ts +6 -3
- package/lib/mjs/components/checkbox/Checkbox.form.js +5 -0
- package/lib/mjs/components/columns/Columns.d.ts +3 -2
- package/lib/mjs/components/columns/Columns.form.d.ts +6 -3
- package/lib/mjs/components/columns/Columns.form.js +5 -0
- package/lib/mjs/components/columns/Columns.js +1 -1
- package/lib/mjs/components/container/Container.form.d.ts +6 -3
- package/lib/mjs/components/container/Container.form.js +5 -0
- package/lib/mjs/components/content/Content.d.ts +2 -1
- package/lib/mjs/components/content/Content.form.d.ts +6 -3
- package/lib/mjs/components/content/Content.form.js +5 -0
- package/lib/mjs/components/currency/Currency.form.d.ts +6 -3
- package/lib/mjs/components/currency/Currency.form.js +5 -0
- package/lib/mjs/components/currency/Currency.js +1 -2
- package/lib/mjs/components/datagrid/DataGrid.d.ts +8 -7
- package/lib/mjs/components/datagrid/DataGrid.form.d.ts +6 -3
- package/lib/mjs/components/datagrid/DataGrid.form.js +5 -0
- package/lib/mjs/components/datagrid/DataGrid.js +5 -5
- package/lib/mjs/components/datagrid/fixtures/comp-with-checkboxes.d.ts +29 -0
- package/lib/mjs/components/datagrid/fixtures/comp-with-checkboxes.js +34 -0
- package/lib/mjs/components/datagrid/fixtures/index.d.ts +2 -1
- package/lib/mjs/components/datagrid/fixtures/index.js +2 -1
- package/lib/mjs/components/datamap/DataMap.d.ts +1 -0
- package/lib/mjs/components/datamap/DataMap.form.d.ts +6 -3
- package/lib/mjs/components/datamap/DataMap.form.js +5 -0
- package/lib/mjs/components/datetime/DateTime.d.ts +0 -14
- package/lib/mjs/components/datetime/DateTime.form.d.ts +6 -3
- package/lib/mjs/components/datetime/DateTime.form.js +5 -0
- package/lib/mjs/components/datetime/editForm/DateTime.edit.date.js +1 -1
- package/lib/mjs/components/day/Day.d.ts +23 -49
- package/lib/mjs/components/day/Day.form.d.ts +6 -3
- package/lib/mjs/components/day/Day.form.js +5 -0
- package/lib/mjs/components/day/Day.js +16 -21
- package/lib/mjs/components/day/fixtures/comp7.d.ts +109 -0
- package/lib/mjs/components/day/fixtures/comp7.js +107 -0
- package/lib/mjs/components/day/fixtures/index.d.ts +2 -1
- package/lib/mjs/components/day/fixtures/index.js +2 -1
- package/lib/mjs/components/editgrid/EditGrid.d.ts +7 -3
- package/lib/mjs/components/editgrid/EditGrid.form.d.ts +6 -3
- package/lib/mjs/components/editgrid/EditGrid.form.js +5 -0
- 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 +6 -3
- package/lib/mjs/components/email/Email.form.js +5 -0
- package/lib/mjs/components/fieldset/Fieldset.form.d.ts +6 -3
- package/lib/mjs/components/fieldset/Fieldset.form.js +5 -0
- package/lib/mjs/components/file/File.d.ts +9 -22
- package/lib/mjs/components/file/File.form.d.ts +6 -3
- package/lib/mjs/components/file/File.form.js +5 -0
- package/lib/mjs/components/file/File.js +1 -2
- package/lib/mjs/components/form/Form.d.ts +34 -24
- package/lib/mjs/components/form/Form.form.d.ts +6 -3
- package/lib/mjs/components/form/Form.form.js +5 -0
- package/lib/mjs/components/form/Form.js +15 -13
- package/lib/mjs/components/hidden/Hidden.d.ts +1 -11
- package/lib/mjs/components/hidden/Hidden.form.d.ts +6 -3
- package/lib/mjs/components/hidden/Hidden.form.js +5 -0
- package/lib/mjs/components/hidden/Hidden.js +1 -2
- package/lib/mjs/components/html/HTML.d.ts +2 -1
- package/lib/mjs/components/html/HTML.form.d.ts +6 -3
- package/lib/mjs/components/html/HTML.form.js +5 -0
- package/lib/mjs/components/number/Number.d.ts +3 -17
- package/lib/mjs/components/number/Number.form.d.ts +6 -3
- package/lib/mjs/components/number/Number.form.js +5 -0
- package/lib/mjs/components/number/Number.js +1 -2
- package/lib/mjs/components/panel/Panel.form.d.ts +6 -3
- package/lib/mjs/components/panel/Panel.form.js +5 -0
- package/lib/mjs/components/panel/Panel.js +0 -1
- package/lib/mjs/components/password/Password.form.d.ts +6 -3
- package/lib/mjs/components/password/Password.form.js +5 -0
- package/lib/mjs/components/phonenumber/PhoneNumber.form.d.ts +6 -3
- package/lib/mjs/components/phonenumber/PhoneNumber.form.js +5 -0
- package/lib/mjs/components/radio/Radio.d.ts +3 -26
- package/lib/mjs/components/radio/Radio.form.d.ts +6 -3
- package/lib/mjs/components/radio/Radio.form.js +5 -0
- package/lib/mjs/components/radio/Radio.js +6 -6
- package/lib/mjs/components/recaptcha/ReCaptcha.d.ts +1 -1
- package/lib/mjs/components/recaptcha/ReCaptcha.form.d.ts +6 -3
- package/lib/mjs/components/recaptcha/ReCaptcha.form.js +5 -0
- package/lib/mjs/components/select/Select.d.ts +16 -39
- package/lib/mjs/components/select/Select.form.d.ts +6 -3
- package/lib/mjs/components/select/Select.form.js +5 -0
- package/lib/mjs/components/select/Select.js +14 -17
- package/lib/mjs/components/selectboxes/SelectBoxes.d.ts +2 -17
- package/lib/mjs/components/selectboxes/SelectBoxes.form.d.ts +6 -3
- package/lib/mjs/components/selectboxes/SelectBoxes.form.js +5 -0
- package/lib/mjs/components/selectboxes/SelectBoxes.js +7 -9
- package/lib/mjs/components/signature/Signature.d.ts +0 -14
- package/lib/mjs/components/signature/Signature.form.d.ts +6 -3
- package/lib/mjs/components/signature/Signature.form.js +5 -0
- package/lib/mjs/components/survey/Survey.d.ts +3 -15
- package/lib/mjs/components/survey/Survey.form.d.ts +6 -3
- package/lib/mjs/components/survey/Survey.form.js +5 -0
- package/lib/mjs/components/table/Table.d.ts +2 -1
- package/lib/mjs/components/table/Table.form.d.ts +6 -3
- package/lib/mjs/components/table/Table.form.js +5 -0
- package/lib/mjs/components/tabs/Tabs.d.ts +4 -4
- package/lib/mjs/components/tabs/Tabs.form.d.ts +6 -3
- package/lib/mjs/components/tabs/Tabs.form.js +5 -0
- package/lib/mjs/components/tabs/Tabs.js +1 -2
- package/lib/mjs/components/tags/Tags.d.ts +0 -14
- package/lib/mjs/components/tags/Tags.form.d.ts +6 -3
- package/lib/mjs/components/tags/Tags.form.js +5 -0
- package/lib/mjs/components/textarea/TextArea.d.ts +4 -9
- package/lib/mjs/components/textarea/TextArea.form.d.ts +6 -3
- package/lib/mjs/components/textarea/TextArea.form.js +5 -0
- package/lib/mjs/components/textarea/TextArea.js +2 -2
- package/lib/mjs/components/textfield/TextField.d.ts +14 -30
- package/lib/mjs/components/textfield/TextField.form.d.ts +6 -3
- package/lib/mjs/components/textfield/TextField.form.js +5 -0
- package/lib/mjs/components/textfield/TextField.js +16 -17
- package/lib/mjs/components/time/Time.form.d.ts +6 -3
- package/lib/mjs/components/time/Time.form.js +5 -0
- package/lib/mjs/components/unknown/Unknown.form.d.ts +5 -34
- package/lib/mjs/components/unknown/Unknown.form.js +4 -0
- package/lib/mjs/components/url/Url.form.d.ts +6 -3
- package/lib/mjs/components/url/Url.form.js +5 -0
- package/lib/mjs/components/well/Well.form.d.ts +6 -3
- package/lib/mjs/components/well/Well.form.js +5 -0
- package/lib/mjs/formio.embed.d.ts +1 -2
- package/lib/mjs/formio.embed.js +2 -99
- package/lib/mjs/formio.form.d.ts +11 -4
- package/lib/mjs/formio.form.js +10 -3
- package/lib/mjs/providers/Providers.d.ts +36 -5
- package/lib/mjs/providers/Providers.js +29 -0
- package/lib/mjs/providers/address/AddressProvider.d.ts +131 -12
- package/lib/mjs/providers/address/AddressProvider.js +88 -2
- package/lib/mjs/providers/address/AzureAddressProvider.d.ts +48 -1
- package/lib/mjs/providers/address/AzureAddressProvider.js +37 -0
- package/lib/mjs/providers/address/CustomAddressProvider.d.ts +27 -4
- package/lib/mjs/providers/address/CustomAddressProvider.js +34 -0
- package/lib/mjs/providers/address/GoogleAddressProvider.d.ts +130 -6
- package/lib/mjs/providers/address/GoogleAddressProvider.js +73 -1
- package/lib/mjs/providers/address/NominatimAddressProvider.d.ts +32 -7
- package/lib/mjs/providers/address/NominatimAddressProvider.js +33 -0
- package/lib/mjs/providers/address/index.d.ts +3 -1
- package/lib/mjs/providers/processor/fileProcessor.d.ts +7 -1
- package/lib/mjs/providers/processor/fileProcessor.js +6 -0
- package/lib/mjs/providers/storage/azure.d.ts +6 -13
- package/lib/mjs/providers/storage/azure.js +5 -0
- package/lib/mjs/providers/storage/base64.d.ts +5 -6
- package/lib/mjs/providers/storage/base64.js +4 -0
- package/lib/mjs/providers/storage/dropbox.d.ts +6 -4
- package/lib/mjs/providers/storage/dropbox.js +5 -0
- package/lib/mjs/providers/storage/googleDrive.d.ts +7 -5
- package/lib/mjs/providers/storage/googleDrive.js +6 -0
- package/lib/mjs/providers/storage/indexeddb.d.ts +5 -7
- package/lib/mjs/providers/storage/indexeddb.js +4 -0
- package/lib/mjs/providers/storage/s3.d.ts +6 -20
- package/lib/mjs/providers/storage/s3.js +5 -0
- package/lib/mjs/providers/storage/url.d.ts +6 -7
- package/lib/mjs/providers/storage/url.js +10 -0
- package/lib/mjs/providers/storage/util.d.ts +24 -1
- package/lib/mjs/providers/storage/util.js +18 -0
- package/lib/mjs/templates/Templates.d.ts +1 -0
- package/lib/mjs/translations/en.d.ts +2 -0
- package/lib/mjs/translations/en.js +3 -1
- package/lib/mjs/utils/ChoicesWrapper.d.ts +1 -1
- package/lib/mjs/utils/ChoicesWrapper.js +13 -2
- package/lib/mjs/utils/Evaluator.d.ts +6 -3
- package/lib/mjs/utils/Evaluator.js +9 -20
- package/lib/mjs/utils/builder.d.ts +9 -7
- package/lib/mjs/utils/builder.js +10 -5
- package/lib/mjs/utils/calendarUtils.d.ts +7 -13
- package/lib/mjs/utils/calendarUtils.js +10 -17
- package/lib/mjs/utils/formUtils.d.ts +43 -171
- package/lib/mjs/utils/formUtils.js +6 -554
- package/lib/mjs/utils/utils.d.ts +367 -221
- package/lib/mjs/utils/utils.js +329 -222
- package/lib/mjs/widgets/CalendarWidget.d.ts +9 -10
- package/lib/mjs/widgets/CalendarWidget.js +9 -11
- package/package.json +22 -22
- package/sdk.d.ts +1 -0
- package/utils.d.ts +1 -0
package/lib/cjs/Form.d.ts
CHANGED
|
@@ -1,50 +1,377 @@
|
|
|
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
|
+
*/
|
|
3
87
|
/**
|
|
4
88
|
* Creates an easy to use interface for embedding webforms, pdfs, and wizards into your application.
|
|
5
|
-
*
|
|
6
|
-
* @param {
|
|
7
|
-
* @param {
|
|
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
|
-
*
|
|
89
|
+
* @param {object} elementOrForm - The DOM element you wish to render this form within, or the form definition.
|
|
90
|
+
* @param {object | string | FormOptions} formOrOptions - A Form JSON schema, the URL of a hosted form, or the form options.
|
|
91
|
+
* @param {FormOptions} [options] - The options to create a new form instance.
|
|
14
92
|
* @example
|
|
15
93
|
* import Form from '@formio/js/Form';
|
|
16
94
|
* const form = new Form(document.getElementById('formio'), 'https://examples.form.io/example');
|
|
17
95
|
* form.build();
|
|
18
96
|
*/
|
|
19
|
-
|
|
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
|
+
};
|
|
20
351
|
ready: Promise<any>;
|
|
21
352
|
readyResolve: (value: any) => void;
|
|
22
353
|
readyReject: (reason?: any) => void;
|
|
23
354
|
instance: any;
|
|
24
355
|
element: any;
|
|
25
|
-
options: any;
|
|
26
356
|
display: string;
|
|
27
357
|
createElement(tag: any, attrs: any, children: any): any;
|
|
28
358
|
set loading(load: any);
|
|
29
359
|
loader: any;
|
|
30
360
|
/**
|
|
31
361
|
* Create a new form instance provided the display of the form.
|
|
32
|
-
*
|
|
33
362
|
* @param {string} display - The display of the form, either "wizard", "form", or "pdf"
|
|
34
|
-
* @
|
|
363
|
+
* @returns {Webform|Wizard|PDF} - The new form instance for the display.
|
|
35
364
|
*/
|
|
36
|
-
create(display: string):
|
|
365
|
+
create(display: string): Webform | Wizard | PDF;
|
|
37
366
|
/**
|
|
38
367
|
* Sets the form. Either as JSON or a URL to a form JSON schema.
|
|
39
|
-
*
|
|
40
368
|
* @param {string|object} formParam - Either the form JSON or the URL of the form json.
|
|
41
|
-
* @
|
|
369
|
+
* @returns {void}
|
|
42
370
|
*/
|
|
43
371
|
set form(formParam: object);
|
|
44
372
|
/**
|
|
45
373
|
* Returns the loaded forms JSON.
|
|
46
|
-
*
|
|
47
|
-
* @return {object} - The loaded form's JSON
|
|
374
|
+
* @returns {object} - The loaded form's JSON
|
|
48
375
|
*/
|
|
49
376
|
get form(): object;
|
|
50
377
|
errorForm(err: any): {
|
|
@@ -63,38 +390,40 @@ export default class Form extends Element {
|
|
|
63
390
|
}[];
|
|
64
391
|
};
|
|
65
392
|
/**
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
393
|
+
* Check Subdirectories path and provide correct options
|
|
394
|
+
* @param {string} url - The the URL of the form json.
|
|
395
|
+
* @param {import('@formio/core').Form} form - The form json.
|
|
396
|
+
* @returns {object} The initial options with base and project.
|
|
397
|
+
*/
|
|
398
|
+
getFormInitOptions(url: string, form: import('@formio/core').Form): object;
|
|
399
|
+
/**
|
|
400
|
+
* Sets the form to the JSON schema of a form.
|
|
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>;
|
|
74
405
|
_form: any;
|
|
75
406
|
getSubmission(formio: any, opts: any): any;
|
|
76
407
|
/**
|
|
77
408
|
* Changes the display of the form.
|
|
78
|
-
*
|
|
79
409
|
* @param {string} display - The display to set this form. Either "wizard", "form", or "pdf"
|
|
80
|
-
* @
|
|
410
|
+
* @returns {Promise<Webform|Wizard|PDF>} - The form instance that was created after changing the display.
|
|
81
411
|
*/
|
|
82
|
-
setDisplay(display: string): Promise<
|
|
412
|
+
setDisplay(display: string): Promise<Webform | Wizard | PDF>;
|
|
83
413
|
empty(): void;
|
|
84
414
|
/**
|
|
85
415
|
* Sanitize an html string.
|
|
86
|
-
*
|
|
87
|
-
* @param string
|
|
88
|
-
* @returns {
|
|
416
|
+
* @param {string} dirty - The dirty html string to sanitize.
|
|
417
|
+
* @param {boolean} forceSanitize - If the string should be force sanitized.
|
|
418
|
+
* @returns {string} - The sanitized html string.
|
|
89
419
|
*/
|
|
90
|
-
sanitize(dirty:
|
|
420
|
+
sanitize(dirty: string, forceSanitize: boolean): string;
|
|
91
421
|
setContent(element: any, content: any, forceSanitize: any): boolean;
|
|
92
422
|
/**
|
|
93
423
|
* Build a new form.
|
|
94
|
-
*
|
|
95
|
-
* @return {Promise<T>}
|
|
424
|
+
* @returns {Promise<Webform|Wizard|PDF>} - The form instance that was created.
|
|
96
425
|
*/
|
|
97
|
-
build(): Promise<
|
|
426
|
+
build(): Promise<Webform | Wizard | PDF>;
|
|
98
427
|
render(): Promise<any>;
|
|
99
428
|
attach(element: any): any;
|
|
100
429
|
}
|
package/lib/cjs/Form.js
CHANGED
|
@@ -32,28 +32,22 @@ 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
|
-
|
|
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];
|
|
35
|
+
constructor(elementOrForm, formOrOptions, options = {}) {
|
|
36
|
+
let element, form, formOptions;
|
|
37
|
+
if (elementOrForm instanceof HTMLElement) {
|
|
38
|
+
element = elementOrForm;
|
|
39
|
+
form = formOrOptions;
|
|
40
|
+
formOptions = options;
|
|
41
|
+
}
|
|
42
|
+
else {
|
|
43
|
+
element = null;
|
|
44
|
+
form = elementOrForm;
|
|
45
|
+
formOptions = formOrOptions || {};
|
|
46
|
+
}
|
|
53
47
|
if (Formio_1.Formio.options && Formio_1.Formio.options.form) {
|
|
54
|
-
|
|
48
|
+
formOptions = Object.assign(formOptions, Formio_1.Formio.options.form);
|
|
55
49
|
}
|
|
56
|
-
super(
|
|
50
|
+
super(formOptions);
|
|
57
51
|
if (this.options.useSessionToken) {
|
|
58
52
|
Formio_1.Formio.useSessionToken(this.options);
|
|
59
53
|
}
|
|
@@ -62,30 +56,22 @@ class Form extends Element_1.default {
|
|
|
62
56
|
this.readyReject = reject;
|
|
63
57
|
});
|
|
64
58
|
this.instance = null;
|
|
65
|
-
if (
|
|
59
|
+
if (element) {
|
|
66
60
|
if (this.element) {
|
|
67
61
|
delete this.element.component;
|
|
68
62
|
}
|
|
69
|
-
this.element =
|
|
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);
|
|
63
|
+
this.element = element;
|
|
75
64
|
}
|
|
76
|
-
else
|
|
65
|
+
else {
|
|
77
66
|
this.element = null;
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
this.setForm(
|
|
67
|
+
}
|
|
68
|
+
if (form) {
|
|
69
|
+
this.setForm(form)
|
|
81
70
|
.then(() => this.readyResolve(this.instance))
|
|
82
71
|
.catch(this.readyReject);
|
|
83
72
|
}
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
this.options = {};
|
|
87
|
-
this.options.events = this.events;
|
|
88
|
-
}
|
|
73
|
+
this.options = formOptions;
|
|
74
|
+
this.options.events = this.events;
|
|
89
75
|
this.display = '';
|
|
90
76
|
}
|
|
91
77
|
createElement(tag, attrs, children) {
|
|
@@ -133,9 +119,8 @@ class Form extends Element_1.default {
|
|
|
133
119
|
}
|
|
134
120
|
/**
|
|
135
121
|
* Create a new form instance provided the display of the form.
|
|
136
|
-
*
|
|
137
122
|
* @param {string} display - The display of the form, either "wizard", "form", or "pdf"
|
|
138
|
-
* @
|
|
123
|
+
* @returns {Webform|Wizard|PDF} - The new form instance for the display.
|
|
139
124
|
*/
|
|
140
125
|
create(display) {
|
|
141
126
|
if (this.options && (this.options.flatten || this.options.renderMode === 'flat')) {
|
|
@@ -152,9 +137,8 @@ class Form extends Element_1.default {
|
|
|
152
137
|
}
|
|
153
138
|
/**
|
|
154
139
|
* Sets the form. Either as JSON or a URL to a form JSON schema.
|
|
155
|
-
*
|
|
156
140
|
* @param {string|object} formParam - Either the form JSON or the URL of the form json.
|
|
157
|
-
* @
|
|
141
|
+
* @returns {void}
|
|
158
142
|
*/
|
|
159
143
|
set form(formParam) {
|
|
160
144
|
this.setForm(formParam);
|
|
@@ -181,12 +165,11 @@ class Form extends Element_1.default {
|
|
|
181
165
|
};
|
|
182
166
|
}
|
|
183
167
|
/**
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
*/
|
|
168
|
+
* Check Subdirectories path and provide correct options
|
|
169
|
+
* @param {string} url - The the URL of the form json.
|
|
170
|
+
* @param {import('@formio/core').Form} form - The form json.
|
|
171
|
+
* @returns {object} The initial options with base and project.
|
|
172
|
+
*/
|
|
190
173
|
getFormInitOptions(url, form) {
|
|
191
174
|
const options = {};
|
|
192
175
|
const index = url.indexOf(form === null || form === void 0 ? void 0 : form.path);
|
|
@@ -210,6 +193,11 @@ class Form extends Element_1.default {
|
|
|
210
193
|
}
|
|
211
194
|
return {};
|
|
212
195
|
}
|
|
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
|
+
*/
|
|
213
201
|
setForm(formParam) {
|
|
214
202
|
let result;
|
|
215
203
|
formParam = formParam || this.form;
|
|
@@ -270,17 +258,15 @@ class Form extends Element_1.default {
|
|
|
270
258
|
}
|
|
271
259
|
/**
|
|
272
260
|
* Returns the loaded forms JSON.
|
|
273
|
-
*
|
|
274
|
-
* @return {object} - The loaded form's JSON
|
|
261
|
+
* @returns {object} - The loaded form's JSON
|
|
275
262
|
*/
|
|
276
263
|
get form() {
|
|
277
264
|
return this._form;
|
|
278
265
|
}
|
|
279
266
|
/**
|
|
280
267
|
* Changes the display of the form.
|
|
281
|
-
*
|
|
282
268
|
* @param {string} display - The display to set this form. Either "wizard", "form", or "pdf"
|
|
283
|
-
* @
|
|
269
|
+
* @returns {Promise<Webform|Wizard|PDF>} - The form instance that was created after changing the display.
|
|
284
270
|
*/
|
|
285
271
|
setDisplay(display) {
|
|
286
272
|
if ((this.display === display) && this.instance) {
|
|
@@ -321,9 +307,9 @@ class Form extends Element_1.default {
|
|
|
321
307
|
}
|
|
322
308
|
/**
|
|
323
309
|
* Sanitize an html string.
|
|
324
|
-
*
|
|
325
|
-
* @param string
|
|
326
|
-
* @returns {
|
|
310
|
+
* @param {string} dirty - The dirty html string to sanitize.
|
|
311
|
+
* @param {boolean} forceSanitize - If the string should be force sanitized.
|
|
312
|
+
* @returns {string} - The sanitized html string.
|
|
327
313
|
*/
|
|
328
314
|
sanitize(dirty, forceSanitize) {
|
|
329
315
|
// If Sanitize is turned off
|
|
@@ -341,8 +327,7 @@ class Form extends Element_1.default {
|
|
|
341
327
|
}
|
|
342
328
|
/**
|
|
343
329
|
* Build a new form.
|
|
344
|
-
*
|
|
345
|
-
* @return {Promise<T>}
|
|
330
|
+
* @returns {Promise<Webform|Wizard|PDF>} - The form instance that was created.
|
|
346
331
|
*/
|
|
347
332
|
build() {
|
|
348
333
|
if (!this.instance) {
|
|
@@ -398,15 +383,16 @@ exports.default = Form;
|
|
|
398
383
|
// Allow simple embedding.
|
|
399
384
|
Formio_1.Formio.embedForm = (embed) => Form.embed(embed);
|
|
400
385
|
/**
|
|
401
|
-
*
|
|
402
|
-
*
|
|
403
|
-
* @param
|
|
404
|
-
* @param
|
|
405
|
-
* @
|
|
406
|
-
*
|
|
407
|
-
*
|
|
386
|
+
* Creates an easy to use interface for embedding webforms, pdfs, and wizards into your application.
|
|
387
|
+
* @param {object} elementOrForm - The DOM element you wish to render this form within, or the form definition.
|
|
388
|
+
* @param {object | string | FormOptions} formOrOptions - A Form JSON schema, the URL of a hosted form, or the form options.
|
|
389
|
+
* @param {FormOptions} [options] - The options to create a new form instance.
|
|
390
|
+
* @returns {Promise<Webform|Wizard|PDF>} - The form instance that was created.
|
|
391
|
+
* @example
|
|
392
|
+
* import { Formio } from '@formio/js';
|
|
393
|
+
* Formio.createForm(document.getElementById('formio'), 'https://examples.form.io/example');
|
|
408
394
|
*/
|
|
409
|
-
Formio_1.Formio.createForm = (
|
|
410
|
-
return (new Form(
|
|
395
|
+
Formio_1.Formio.createForm = (elementOrForm, formOrOptions, options) => {
|
|
396
|
+
return (new Form(elementOrForm, formOrOptions, options)).ready;
|
|
411
397
|
};
|
|
412
398
|
Formio_1.Formio.Form = Form;
|