@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/FormBuilder.d.ts
CHANGED
|
@@ -1,6 +1,191 @@
|
|
|
1
1
|
export default class FormBuilder extends Form {
|
|
2
|
-
|
|
3
|
-
|
|
2
|
+
/**
|
|
3
|
+
* @typedef FormBuilderOptions
|
|
4
|
+
* @property {string[]} [disabled] - An array of "keys" of components that should be disabled within the form builder. Example: ['firstName', 'lastName']
|
|
5
|
+
* @property {boolean} [noNewEdit] - When set to TRUE no modal is shown when a component is dragged onto the form.
|
|
6
|
+
* @property {boolean} [noDefaultSubmitButton] - Set to TRUE to not include the default submit button in Webforms.
|
|
7
|
+
* @property {boolean} [alwaysConfirmComponentRemoval] - Set to TRUE to always require confirmation before removing a component.
|
|
8
|
+
* @property {object} [formConfig] - Form configurations to apply to forms being created. These configurations are added to the "config" property of the form object.
|
|
9
|
+
* @property {string} [resourceTag] - The tag to use to query for the "Existing Resource Fields" section of the builder.
|
|
10
|
+
* @property {import('./Form').FormOptions} [editForm] - The options to apply to the Edit Form (the form that shows inside the modal when you edit a component).
|
|
11
|
+
* @property {string} [language] - The language to load into the form builder.
|
|
12
|
+
* @property {object} [builder] - The builder options to pass to the builder.
|
|
13
|
+
* @property {'form'|'wizard'|'pdf'} [display] - The display mode of the builder.
|
|
14
|
+
* @property {string} [resourceFilter] - Filter applied to the resources that appear in the builder's Existing Resource Fields.
|
|
15
|
+
* @property {boolean} [noSource] - When set to TRUE, the resource ID in the builder's Existing Resource Fields will not be linked.
|
|
16
|
+
* @property {boolean} [showFullJsonSchema] - When set to TRUE, the full JSON schema will be displayed in the JSON edit menu.
|
|
17
|
+
*/
|
|
18
|
+
/** @type {FormBuilderOptions} */
|
|
19
|
+
static options: {
|
|
20
|
+
/**
|
|
21
|
+
* - An array of "keys" of components that should be disabled within the form builder. Example: ['firstName', 'lastName']
|
|
22
|
+
*/
|
|
23
|
+
disabled?: string[] | undefined;
|
|
24
|
+
/**
|
|
25
|
+
* - When set to TRUE no modal is shown when a component is dragged onto the form.
|
|
26
|
+
*/
|
|
27
|
+
noNewEdit?: boolean | undefined;
|
|
28
|
+
/**
|
|
29
|
+
* - Set to TRUE to not include the default submit button in Webforms.
|
|
30
|
+
*/
|
|
31
|
+
noDefaultSubmitButton?: boolean | undefined;
|
|
32
|
+
/**
|
|
33
|
+
* - Set to TRUE to always require confirmation before removing a component.
|
|
34
|
+
*/
|
|
35
|
+
alwaysConfirmComponentRemoval?: boolean | undefined;
|
|
36
|
+
/**
|
|
37
|
+
* - Form configurations to apply to forms being created. These configurations are added to the "config" property of the form object.
|
|
38
|
+
*/
|
|
39
|
+
formConfig?: object | undefined;
|
|
40
|
+
/**
|
|
41
|
+
* - The tag to use to query for the "Existing Resource Fields" section of the builder.
|
|
42
|
+
*/
|
|
43
|
+
resourceTag?: string | undefined;
|
|
44
|
+
/**
|
|
45
|
+
* - The options to apply to the Edit Form (the form that shows inside the modal when you edit a component).
|
|
46
|
+
*/
|
|
47
|
+
editForm?: any;
|
|
48
|
+
/**
|
|
49
|
+
* - The language to load into the form builder.
|
|
50
|
+
*/
|
|
51
|
+
language?: string | undefined;
|
|
52
|
+
/**
|
|
53
|
+
* - The builder options to pass to the builder.
|
|
54
|
+
*/
|
|
55
|
+
builder?: object | undefined;
|
|
56
|
+
/**
|
|
57
|
+
* - The display mode of the builder.
|
|
58
|
+
*/
|
|
59
|
+
display?: "form" | "pdf" | "wizard" | undefined;
|
|
60
|
+
/**
|
|
61
|
+
* - Filter applied to the resources that appear in the builder's Existing Resource Fields.
|
|
62
|
+
*/
|
|
63
|
+
resourceFilter?: string | undefined;
|
|
64
|
+
/**
|
|
65
|
+
* - When set to TRUE, the resource ID in the builder's Existing Resource Fields will not be linked.
|
|
66
|
+
*/
|
|
67
|
+
noSource?: boolean | undefined;
|
|
68
|
+
/**
|
|
69
|
+
* - When set to TRUE, the full JSON schema will be displayed in the JSON edit menu.
|
|
70
|
+
*/
|
|
71
|
+
showFullJsonSchema?: boolean | undefined;
|
|
72
|
+
};
|
|
73
|
+
/**
|
|
74
|
+
* Creates a new form builder.
|
|
75
|
+
* @param {HTMLElement} element - The HTML element to place the form builder.
|
|
76
|
+
* @param {string | object} form - The form to pass to the builder
|
|
77
|
+
* @param {FormBuilderOptions} options - The options to create this builder.
|
|
78
|
+
* @returns {FormBuilder} - The form builder instance.
|
|
79
|
+
*/
|
|
80
|
+
constructor(element: HTMLElement, form: string | object, options: {
|
|
81
|
+
/**
|
|
82
|
+
* - An array of "keys" of components that should be disabled within the form builder. Example: ['firstName', 'lastName']
|
|
83
|
+
*/
|
|
84
|
+
disabled?: string[] | undefined;
|
|
85
|
+
/**
|
|
86
|
+
* - When set to TRUE no modal is shown when a component is dragged onto the form.
|
|
87
|
+
*/
|
|
88
|
+
noNewEdit?: boolean | undefined;
|
|
89
|
+
/**
|
|
90
|
+
* - Set to TRUE to not include the default submit button in Webforms.
|
|
91
|
+
*/
|
|
92
|
+
noDefaultSubmitButton?: boolean | undefined;
|
|
93
|
+
/**
|
|
94
|
+
* - Set to TRUE to always require confirmation before removing a component.
|
|
95
|
+
*/
|
|
96
|
+
alwaysConfirmComponentRemoval?: boolean | undefined;
|
|
97
|
+
/**
|
|
98
|
+
* - Form configurations to apply to forms being created. These configurations are added to the "config" property of the form object.
|
|
99
|
+
*/
|
|
100
|
+
formConfig?: object | undefined;
|
|
101
|
+
/**
|
|
102
|
+
* - The tag to use to query for the "Existing Resource Fields" section of the builder.
|
|
103
|
+
*/
|
|
104
|
+
resourceTag?: string | undefined;
|
|
105
|
+
/**
|
|
106
|
+
* - The options to apply to the Edit Form (the form that shows inside the modal when you edit a component).
|
|
107
|
+
*/
|
|
108
|
+
editForm?: any;
|
|
109
|
+
/**
|
|
110
|
+
* - The language to load into the form builder.
|
|
111
|
+
*/
|
|
112
|
+
language?: string | undefined;
|
|
113
|
+
/**
|
|
114
|
+
* - The builder options to pass to the builder.
|
|
115
|
+
*/
|
|
116
|
+
builder?: object | undefined;
|
|
117
|
+
/**
|
|
118
|
+
* - The display mode of the builder.
|
|
119
|
+
*/
|
|
120
|
+
display?: "form" | "pdf" | "wizard" | undefined;
|
|
121
|
+
/**
|
|
122
|
+
* - Filter applied to the resources that appear in the builder's Existing Resource Fields.
|
|
123
|
+
*/
|
|
124
|
+
resourceFilter?: string | undefined;
|
|
125
|
+
/**
|
|
126
|
+
* - When set to TRUE, the resource ID in the builder's Existing Resource Fields will not be linked.
|
|
127
|
+
*/
|
|
128
|
+
noSource?: boolean | undefined;
|
|
129
|
+
/**
|
|
130
|
+
* - When set to TRUE, the full JSON schema will be displayed in the JSON edit menu.
|
|
131
|
+
*/
|
|
132
|
+
showFullJsonSchema?: boolean | undefined;
|
|
133
|
+
});
|
|
134
|
+
/** @type {FormBuilderOptions} */
|
|
135
|
+
options: {
|
|
136
|
+
/**
|
|
137
|
+
* - An array of "keys" of components that should be disabled within the form builder. Example: ['firstName', 'lastName']
|
|
138
|
+
*/
|
|
139
|
+
disabled?: string[] | undefined;
|
|
140
|
+
/**
|
|
141
|
+
* - When set to TRUE no modal is shown when a component is dragged onto the form.
|
|
142
|
+
*/
|
|
143
|
+
noNewEdit?: boolean | undefined;
|
|
144
|
+
/**
|
|
145
|
+
* - Set to TRUE to not include the default submit button in Webforms.
|
|
146
|
+
*/
|
|
147
|
+
noDefaultSubmitButton?: boolean | undefined;
|
|
148
|
+
/**
|
|
149
|
+
* - Set to TRUE to always require confirmation before removing a component.
|
|
150
|
+
*/
|
|
151
|
+
alwaysConfirmComponentRemoval?: boolean | undefined;
|
|
152
|
+
/**
|
|
153
|
+
* - Form configurations to apply to forms being created. These configurations are added to the "config" property of the form object.
|
|
154
|
+
*/
|
|
155
|
+
formConfig?: object | undefined;
|
|
156
|
+
/**
|
|
157
|
+
* - The tag to use to query for the "Existing Resource Fields" section of the builder.
|
|
158
|
+
*/
|
|
159
|
+
resourceTag?: string | undefined;
|
|
160
|
+
/**
|
|
161
|
+
* - The options to apply to the Edit Form (the form that shows inside the modal when you edit a component).
|
|
162
|
+
*/
|
|
163
|
+
editForm?: any;
|
|
164
|
+
/**
|
|
165
|
+
* - The language to load into the form builder.
|
|
166
|
+
*/
|
|
167
|
+
language?: string | undefined;
|
|
168
|
+
/**
|
|
169
|
+
* - The builder options to pass to the builder.
|
|
170
|
+
*/
|
|
171
|
+
builder?: object | undefined;
|
|
172
|
+
/**
|
|
173
|
+
* - The display mode of the builder.
|
|
174
|
+
*/
|
|
175
|
+
display?: "form" | "pdf" | "wizard" | undefined;
|
|
176
|
+
/**
|
|
177
|
+
* - Filter applied to the resources that appear in the builder's Existing Resource Fields.
|
|
178
|
+
*/
|
|
179
|
+
resourceFilter?: string | undefined;
|
|
180
|
+
/**
|
|
181
|
+
* - When set to TRUE, the resource ID in the builder's Existing Resource Fields will not be linked.
|
|
182
|
+
*/
|
|
183
|
+
noSource?: boolean | undefined;
|
|
184
|
+
/**
|
|
185
|
+
* - When set to TRUE, the full JSON schema will be displayed in the JSON edit menu.
|
|
186
|
+
*/
|
|
187
|
+
showFullJsonSchema?: boolean | undefined;
|
|
188
|
+
};
|
|
4
189
|
create(display: any): any;
|
|
5
190
|
}
|
|
6
191
|
import Form from './Form';
|
package/lib/cjs/FormBuilder.js
CHANGED
|
@@ -7,6 +7,13 @@ const Formio_1 = require("./Formio");
|
|
|
7
7
|
const builders_1 = __importDefault(require("./builders"));
|
|
8
8
|
const Form_1 = __importDefault(require("./Form"));
|
|
9
9
|
class FormBuilder extends Form_1.default {
|
|
10
|
+
/**
|
|
11
|
+
* Creates a new form builder.
|
|
12
|
+
* @param {HTMLElement} element - The HTML element to place the form builder.
|
|
13
|
+
* @param {string | object} form - The form to pass to the builder
|
|
14
|
+
* @param {FormBuilderOptions} options - The options to create this builder.
|
|
15
|
+
* @returns {FormBuilder} - The form builder instance.
|
|
16
|
+
*/
|
|
10
17
|
constructor(element, form, options) {
|
|
11
18
|
form = form || {};
|
|
12
19
|
options = options || {};
|
|
@@ -22,18 +29,33 @@ class FormBuilder extends Form_1.default {
|
|
|
22
29
|
}
|
|
23
30
|
}
|
|
24
31
|
}
|
|
32
|
+
/**
|
|
33
|
+
* @typedef FormBuilderOptions
|
|
34
|
+
* @property {string[]} [disabled] - An array of "keys" of components that should be disabled within the form builder. Example: ['firstName', 'lastName']
|
|
35
|
+
* @property {boolean} [noNewEdit] - When set to TRUE no modal is shown when a component is dragged onto the form.
|
|
36
|
+
* @property {boolean} [noDefaultSubmitButton] - Set to TRUE to not include the default submit button in Webforms.
|
|
37
|
+
* @property {boolean} [alwaysConfirmComponentRemoval] - Set to TRUE to always require confirmation before removing a component.
|
|
38
|
+
* @property {object} [formConfig] - Form configurations to apply to forms being created. These configurations are added to the "config" property of the form object.
|
|
39
|
+
* @property {string} [resourceTag] - The tag to use to query for the "Existing Resource Fields" section of the builder.
|
|
40
|
+
* @property {import('./Form').FormOptions} [editForm] - The options to apply to the Edit Form (the form that shows inside the modal when you edit a component).
|
|
41
|
+
* @property {string} [language] - The language to load into the form builder.
|
|
42
|
+
* @property {object} [builder] - The builder options to pass to the builder.
|
|
43
|
+
* @property {'form'|'wizard'|'pdf'} [display] - The display mode of the builder.
|
|
44
|
+
* @property {string} [resourceFilter] - Filter applied to the resources that appear in the builder's Existing Resource Fields.
|
|
45
|
+
* @property {boolean} [noSource] - When set to TRUE, the resource ID in the builder's Existing Resource Fields will not be linked.
|
|
46
|
+
* @property {boolean} [showFullJsonSchema] - When set to TRUE, the full JSON schema will be displayed in the JSON edit menu.
|
|
47
|
+
*/
|
|
48
|
+
/** @type {FormBuilderOptions} */
|
|
25
49
|
FormBuilder.options = {};
|
|
26
50
|
exports.default = FormBuilder;
|
|
27
51
|
/**
|
|
28
52
|
* Factory that creates a new form builder based on the form parameter.
|
|
29
|
-
*
|
|
30
|
-
* @param
|
|
31
|
-
* @param
|
|
32
|
-
* @
|
|
33
|
-
*
|
|
34
|
-
* @return {Promise} - When the form is instance is ready.
|
|
53
|
+
* @param {HTMLElement} element - The HTML Element to add this form to.
|
|
54
|
+
* @param {string|object} form - The src of the form, or a form object.
|
|
55
|
+
* @param {object} options - The options to create this form.
|
|
56
|
+
* @returns {Promise} - When the form is instance is ready.
|
|
35
57
|
*/
|
|
36
|
-
Formio_1.Formio.builder = (
|
|
37
|
-
return (new FormBuilder(
|
|
58
|
+
Formio_1.Formio.builder = (element, form, options) => {
|
|
59
|
+
return (new FormBuilder(element, form, options)).ready;
|
|
38
60
|
};
|
|
39
61
|
Formio_1.Formio.FormBuilder = FormBuilder;
|
|
@@ -0,0 +1,116 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.Formio = exports.embed = void 0;
|
|
4
|
+
const Embed_1 = require("./Embed");
|
|
5
|
+
Object.defineProperty(exports, "Formio", { enumerable: true, get: function () { return Embed_1.Formio; } });
|
|
6
|
+
/**
|
|
7
|
+
* Inline embed a form within a webpage.
|
|
8
|
+
* @param {*} config - Configuration to configure how the inline embed is rendered.
|
|
9
|
+
*/
|
|
10
|
+
function embed(config = {}) {
|
|
11
|
+
const scripts = document.getElementsByTagName('script');
|
|
12
|
+
config = Object.assign({}, window.FormioConfig || {}, config);
|
|
13
|
+
let thisScript = null;
|
|
14
|
+
let i = scripts.length;
|
|
15
|
+
const scriptName = config.scriptName || 'formio.embed.';
|
|
16
|
+
while (i--) {
|
|
17
|
+
if (scripts[i].src && (scripts[i].src.indexOf(scriptName) !== -1)) {
|
|
18
|
+
thisScript = scripts[i];
|
|
19
|
+
break;
|
|
20
|
+
}
|
|
21
|
+
}
|
|
22
|
+
if (thisScript) {
|
|
23
|
+
const query = {};
|
|
24
|
+
const queryString = thisScript.src.replace(/^[^?]+\??/, '');
|
|
25
|
+
queryString.replace(/\?/g, '&').split('&').forEach((item) => {
|
|
26
|
+
query[item.split('=')[0]] = item.split('=')[1] && decodeURIComponent(item.split('=')[1]);
|
|
27
|
+
});
|
|
28
|
+
let scriptSrc = thisScript.src.replace(/^([^?]+).*/, '$1').split('/');
|
|
29
|
+
scriptSrc.pop();
|
|
30
|
+
let cdnSrc = '';
|
|
31
|
+
if (['js', 'offline'].includes(scriptSrc[scriptSrc.length - 1])) {
|
|
32
|
+
scriptSrc.pop();
|
|
33
|
+
scriptSrc = cdnSrc = scriptSrc.join('/');
|
|
34
|
+
scriptSrc += '/js';
|
|
35
|
+
}
|
|
36
|
+
else {
|
|
37
|
+
scriptSrc = scriptSrc.join('/');
|
|
38
|
+
}
|
|
39
|
+
const debug = (query.debug === 'true' || query.debug === '1');
|
|
40
|
+
const renderer = debug ? 'formio.form' : 'formio.form.min';
|
|
41
|
+
Embed_1.Formio.config = Object.assign({
|
|
42
|
+
script: query.script || (`${scriptSrc}/${renderer}.js`),
|
|
43
|
+
style: query.styles || (`${scriptSrc}/${renderer}.css`),
|
|
44
|
+
cdn: query.cdn || cdnSrc,
|
|
45
|
+
class: (query.class || 'formio-form-wrapper'),
|
|
46
|
+
src: query.src,
|
|
47
|
+
form: null,
|
|
48
|
+
submission: null,
|
|
49
|
+
project: query.project,
|
|
50
|
+
base: query.base || 'https://api.form.io',
|
|
51
|
+
submit: query.submit,
|
|
52
|
+
includeLibs: (query.libs === 'true' || query.libs === '1'),
|
|
53
|
+
noshadow: (query.shadow === 'false' || query.shadow === '0'),
|
|
54
|
+
template: query.template || 'bootstrap',
|
|
55
|
+
debug: debug,
|
|
56
|
+
config: {},
|
|
57
|
+
redirect: (query.return || query.redirect),
|
|
58
|
+
embedCSS: (`${scriptSrc}/formio.embed.css`),
|
|
59
|
+
success: query.success || 'Thank you for your submission!',
|
|
60
|
+
before: null,
|
|
61
|
+
after: null
|
|
62
|
+
}, config);
|
|
63
|
+
if (Embed_1.Formio.config.alter) {
|
|
64
|
+
Embed_1.Formio.config.alter(Embed_1.Formio.config);
|
|
65
|
+
}
|
|
66
|
+
const form = (Embed_1.Formio.config.form || Embed_1.Formio.config.src);
|
|
67
|
+
if (form) {
|
|
68
|
+
Embed_1.Formio.debug('Embedding Configuration', config);
|
|
69
|
+
// The id for this embedded form.
|
|
70
|
+
Embed_1.Formio.config.id = `formio-${Math.random().toString(36).substring(7)}`;
|
|
71
|
+
Embed_1.Formio.debug('Creating form element');
|
|
72
|
+
const element = Embed_1.Formio.createElement('div', {
|
|
73
|
+
'id': Embed_1.Formio.config.id,
|
|
74
|
+
class: Embed_1.Formio.config.class
|
|
75
|
+
});
|
|
76
|
+
// insertAfter doesn't exist, but effect is identical.
|
|
77
|
+
thisScript.parentNode.insertBefore(element, thisScript.parentNode.firstElementChild.nextSibling);
|
|
78
|
+
Embed_1.Formio.createForm(element, form, Embed_1.Formio.config.config).then((instance) => {
|
|
79
|
+
if (Embed_1.Formio.config.submit) {
|
|
80
|
+
instance.nosubmit = true;
|
|
81
|
+
}
|
|
82
|
+
// Trigger the submit done event.
|
|
83
|
+
instance.on('submitDone', (submission) => Embed_1.Formio.submitDone(instance, submission));
|
|
84
|
+
// Configure a redirect.
|
|
85
|
+
instance.on('submit', (submission) => {
|
|
86
|
+
Embed_1.Formio.debug("on('submit')", submission);
|
|
87
|
+
if (Embed_1.Formio.config.submit) {
|
|
88
|
+
Embed_1.Formio.debug(`Sending submission to ${Embed_1.Formio.config.submit}`);
|
|
89
|
+
const headers = {
|
|
90
|
+
'content-type': 'application/json'
|
|
91
|
+
};
|
|
92
|
+
const token = Embed_1.Formio.FormioClass.getToken();
|
|
93
|
+
if (token) {
|
|
94
|
+
headers['x-jwt-token'] = token;
|
|
95
|
+
}
|
|
96
|
+
Embed_1.Formio.FormioClass.fetch(Embed_1.Formio.config.submit, {
|
|
97
|
+
body: JSON.stringify(submission),
|
|
98
|
+
headers: headers,
|
|
99
|
+
method: 'POST',
|
|
100
|
+
mode: 'cors',
|
|
101
|
+
})
|
|
102
|
+
.then(resp => resp.json())
|
|
103
|
+
.then((submission) => {
|
|
104
|
+
Embed_1.Formio.submitDone(instance, submission);
|
|
105
|
+
});
|
|
106
|
+
}
|
|
107
|
+
});
|
|
108
|
+
});
|
|
109
|
+
}
|
|
110
|
+
}
|
|
111
|
+
else {
|
|
112
|
+
// Show an error if the script cannot be found.
|
|
113
|
+
document.write('<span>Could not locate the Embedded form.</span>');
|
|
114
|
+
}
|
|
115
|
+
}
|
|
116
|
+
exports.embed = embed;
|
package/lib/cjs/PDF.d.ts
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
export default class PDF extends Webform {
|
|
2
|
-
constructor(element: any, options: any);
|
|
3
2
|
components: any[];
|
|
4
3
|
init(): void;
|
|
5
|
-
|
|
4
|
+
render(): any;
|
|
5
|
+
submitButton: any;
|
|
6
6
|
attachComponents(element: any, components: any, container: any): Promise<void>;
|
|
7
7
|
attach(element: any): Promise<void>;
|
|
8
8
|
iframeReady: Promise<any> | undefined;
|
|
@@ -11,26 +11,24 @@ export default class PDF extends Webform {
|
|
|
11
11
|
iframeElement: any;
|
|
12
12
|
/**
|
|
13
13
|
* Get the submission from the iframe.
|
|
14
|
-
*
|
|
15
|
-
* @return {Promise<any>}
|
|
14
|
+
* @returns {Promise<any>} - The submission from the iframe.
|
|
16
15
|
*/
|
|
17
16
|
getSubmission(): Promise<any>;
|
|
18
17
|
/**
|
|
19
18
|
* Ensure we have the submission from the iframe before we submit the form.
|
|
20
|
-
*
|
|
21
|
-
* @
|
|
22
|
-
* @return {*}
|
|
19
|
+
* @param {any} options - The options for submission.
|
|
20
|
+
* @returns {Promise<any>} - Resolves when the form is submitted.
|
|
23
21
|
*/
|
|
24
|
-
submitForm(options?:
|
|
22
|
+
submitForm(options?: any): Promise<any>;
|
|
25
23
|
getSrc(): string;
|
|
26
|
-
setForm(form: any, flags?: {}):
|
|
24
|
+
setForm(form: any, flags?: {}): Promise<void>;
|
|
27
25
|
/**
|
|
28
26
|
* Set's the value of this form component.
|
|
29
|
-
*
|
|
30
|
-
* @param submission
|
|
31
|
-
* @
|
|
27
|
+
* @param {import('@formio/core').Submission} submission - The submission JSON to set the value of this form.
|
|
28
|
+
* @param {any} flags - The flags to use when setting the submission.
|
|
29
|
+
* @returns {boolean} - If the value changed or not.
|
|
32
30
|
*/
|
|
33
|
-
setValue(submission:
|
|
31
|
+
setValue(submission: import('@formio/core').Submission, flags?: any): boolean;
|
|
34
32
|
postMessage(message: any): void;
|
|
35
33
|
iframeFormSetUp: boolean | undefined;
|
|
36
34
|
focusOnComponent(key: any): void;
|
package/lib/cjs/PDF.js
CHANGED
|
@@ -143,8 +143,7 @@ class PDF extends Webform_1.default {
|
|
|
143
143
|
}
|
|
144
144
|
/**
|
|
145
145
|
* Get the submission from the iframe.
|
|
146
|
-
*
|
|
147
|
-
* @return {Promise<any>}
|
|
146
|
+
* @returns {Promise<any>} - The submission from the iframe.
|
|
148
147
|
*/
|
|
149
148
|
getSubmission() {
|
|
150
149
|
return new Promise((resolve) => {
|
|
@@ -154,9 +153,8 @@ class PDF extends Webform_1.default {
|
|
|
154
153
|
}
|
|
155
154
|
/**
|
|
156
155
|
* Ensure we have the submission from the iframe before we submit the form.
|
|
157
|
-
*
|
|
158
|
-
* @
|
|
159
|
-
* @return {*}
|
|
156
|
+
* @param {any} options - The options for submission.
|
|
157
|
+
* @returns {Promise<any>} - Resolves when the form is submitted.
|
|
160
158
|
*/
|
|
161
159
|
submitForm(options = {}) {
|
|
162
160
|
this.postMessage({ name: 'getErrors' });
|
|
@@ -198,9 +196,9 @@ class PDF extends Webform_1.default {
|
|
|
198
196
|
}
|
|
199
197
|
/**
|
|
200
198
|
* Set's the value of this form component.
|
|
201
|
-
*
|
|
202
|
-
* @param submission
|
|
203
|
-
* @
|
|
199
|
+
* @param {import('@formio/core').Submission} submission - The submission JSON to set the value of this form.
|
|
200
|
+
* @param {any} flags - The flags to use when setting the submission.
|
|
201
|
+
* @returns {boolean} - If the value changed or not.
|
|
204
202
|
*/
|
|
205
203
|
setValue(submission, flags = {}) {
|
|
206
204
|
const changed = super.setValue(submission, flags);
|