@formio/js 5.0.0-rc.19 → 5.0.0-rc.21
Sign up to get free protection for your applications and to get access to all the features.
- package/README.md +1 -1
- package/dist/formio.builder.css +14 -22
- package/dist/formio.builder.min.css +1 -1
- package/dist/formio.embed.css +1 -40
- package/dist/formio.embed.js +2 -90
- package/dist/formio.embed.min.css +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 +10 -2
- package/dist/formio.form.js +1267 -1103
- 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 -8
- package/dist/formio.full.css +14 -22
- package/dist/formio.full.js +1302 -1127
- 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 -8
- package/dist/formio.js +713 -626
- package/dist/formio.min.js +1 -1
- package/dist/formio.min.js.LICENSE.txt +2 -7
- package/dist/formio.utils.js +220 -13
- package/dist/formio.utils.min.js +1 -1
- package/dist/formio.utils.min.js.LICENSE.txt +2 -7
- package/lib/cjs/CDN.d.ts +1 -0
- package/lib/cjs/CDN.js +2 -1
- package/lib/cjs/Element.js +7 -2
- package/lib/cjs/Embed.d.ts +21 -1
- package/lib/cjs/Embed.js +211 -308
- package/lib/cjs/Form.d.ts +9 -6
- package/lib/cjs/Form.js +53 -11
- package/lib/cjs/PDF.d.ts +11 -3
- package/lib/cjs/PDF.js +4 -5
- package/lib/cjs/PDFBuilder.js +2 -3
- package/lib/cjs/Webform.d.ts +10 -13
- package/lib/cjs/Webform.js +46 -125
- package/lib/cjs/WebformBuilder.d.ts +6 -1
- package/lib/cjs/WebformBuilder.js +105 -65
- package/lib/cjs/Wizard.d.ts +8 -5
- package/lib/cjs/Wizard.js +12 -12
- package/lib/cjs/WizardBuilder.d.ts +6 -4
- package/lib/cjs/WizardBuilder.js +20 -3
- package/lib/cjs/addons/FormioAddon.d.ts +1 -1
- package/lib/cjs/addons/FormioAddon.js +1 -2
- package/lib/cjs/components/_classes/component/Component.d.ts +24 -8
- package/lib/cjs/components/_classes/component/Component.js +44 -14
- package/lib/cjs/components/_classes/input/Input.d.ts +1 -1
- package/lib/cjs/components/_classes/input/Input.js +1 -2
- package/lib/cjs/components/_classes/list/ListComponent.d.ts +4 -0
- package/lib/cjs/components/_classes/list/ListComponent.js +43 -6
- package/lib/cjs/components/_classes/multivalue/Multivalue.d.ts +1 -0
- package/lib/cjs/components/_classes/multivalue/Multivalue.js +10 -4
- package/lib/cjs/components/_classes/nested/NestedComponent.d.ts +5 -2
- package/lib/cjs/components/_classes/nested/NestedComponent.js +9 -10
- package/lib/cjs/components/_classes/nestedarray/NestedArrayComponent.d.ts +1 -0
- package/lib/cjs/components/_classes/nestedarray/NestedArrayComponent.js +4 -0
- package/lib/cjs/components/_classes/nesteddata/NestedDataComponent.d.ts +1 -0
- package/lib/cjs/components/_classes/nesteddata/NestedDataComponent.js +4 -0
- package/lib/cjs/components/address/Address.d.ts +8 -0
- package/lib/cjs/components/address/Address.js +5 -0
- package/lib/cjs/components/button/Button.d.ts +1 -0
- package/lib/cjs/components/button/Button.js +5 -3
- package/lib/cjs/components/checkbox/Checkbox.d.ts +41 -0
- package/lib/cjs/components/checkbox/Checkbox.js +32 -5
- package/lib/cjs/components/columns/Columns.d.ts +2 -0
- package/lib/cjs/components/columns/Columns.js +4 -0
- package/lib/cjs/components/container/Container.d.ts +1 -0
- package/lib/cjs/components/container/Container.js +4 -0
- package/lib/cjs/components/content/Content.d.ts +2 -0
- package/lib/cjs/components/content/Content.js +4 -2
- package/lib/cjs/components/currency/editForm/Currency.edit.data.d.ts +14 -2
- package/lib/cjs/components/currency/editForm/Currency.edit.data.js +4 -0
- package/lib/cjs/components/currency/editForm/Currency.edit.display.js +4 -0
- package/lib/cjs/components/datagrid/DataGrid.d.ts +1 -0
- package/lib/cjs/components/datagrid/DataGrid.js +8 -1
- package/lib/cjs/components/datamap/DataMap.d.ts +1 -0
- package/lib/cjs/components/datamap/DataMap.js +4 -0
- package/lib/cjs/components/datetime/DateTime.d.ts +23 -0
- package/lib/cjs/components/datetime/DateTime.js +20 -1
- package/lib/cjs/components/day/Day.d.ts +22 -1
- package/lib/cjs/components/day/Day.js +20 -6
- package/lib/cjs/components/day/fixtures/comp3.js +2 -2
- package/lib/cjs/components/editgrid/EditGrid.d.ts +4 -3
- package/lib/cjs/components/editgrid/EditGrid.js +11 -6
- package/lib/cjs/components/editgrid/fixtures/comp-with-custom-default-value.d.ts +190 -0
- package/lib/cjs/components/editgrid/fixtures/comp-with-custom-default-value.js +227 -0
- package/lib/cjs/components/editgrid/fixtures/comp15.d.ts +54 -0
- package/lib/cjs/components/editgrid/fixtures/comp15.js +51 -0
- package/lib/cjs/components/editgrid/fixtures/index.d.ts +3 -1
- package/lib/cjs/components/editgrid/fixtures/index.js +5 -1
- package/lib/cjs/components/fieldset/Fieldset.d.ts +2 -0
- package/lib/cjs/components/fieldset/Fieldset.js +4 -0
- package/lib/cjs/components/file/File.d.ts +28 -6
- package/lib/cjs/components/file/File.js +40 -15
- package/lib/cjs/components/file/editForm/File.edit.file.d.ts +62 -0
- package/lib/cjs/components/file/editForm/File.edit.file.js +29 -2
- package/lib/cjs/components/form/Form.d.ts +4 -0
- package/lib/cjs/components/form/Form.js +12 -10
- package/lib/cjs/components/hidden/Hidden.d.ts +1 -0
- package/lib/cjs/components/hidden/Hidden.js +1 -0
- package/lib/cjs/components/html/HTML.d.ts +2 -0
- package/lib/cjs/components/html/HTML.js +4 -0
- package/lib/cjs/components/number/Number.d.ts +24 -1
- package/lib/cjs/components/number/Number.js +18 -6
- package/lib/cjs/components/panel/Panel.d.ts +1 -0
- package/lib/cjs/components/panel/Panel.js +3 -0
- package/lib/cjs/components/phonenumber/PhoneNumber.form.js +9 -0
- package/lib/cjs/components/radio/Radio.d.ts +24 -3
- package/lib/cjs/components/radio/Radio.js +89 -18
- package/lib/cjs/components/recaptcha/ReCaptcha.d.ts +2 -1
- package/lib/cjs/components/recaptcha/ReCaptcha.js +7 -5
- package/lib/cjs/components/resource/Resource.d.ts +7 -0
- package/lib/cjs/components/resource/Resource.js +0 -1
- package/lib/cjs/components/resource/editForm/Resource.edit.display.js +1 -1
- package/lib/cjs/components/select/Select.d.ts +25 -5
- package/lib/cjs/components/select/Select.js +51 -51
- package/lib/cjs/components/selectboxes/SelectBoxes.d.ts +37 -0
- package/lib/cjs/components/selectboxes/SelectBoxes.js +60 -25
- package/lib/cjs/components/selectboxes/fixtures/comp4.d.ts +30 -27
- package/lib/cjs/components/selectboxes/fixtures/comp4.js +47 -32
- package/lib/cjs/components/selectboxes/fixtures/comp6.d.ts +14 -0
- package/lib/cjs/components/selectboxes/fixtures/comp6.js +15 -0
- package/lib/cjs/components/selectboxes/fixtures/index.d.ts +2 -1
- package/lib/cjs/components/selectboxes/fixtures/index.js +3 -1
- package/lib/cjs/components/signature/Signature.d.ts +22 -1
- package/lib/cjs/components/signature/Signature.js +16 -3
- package/lib/cjs/components/survey/Survey.d.ts +21 -0
- package/lib/cjs/components/survey/Survey.js +9 -0
- package/lib/cjs/components/table/Table.d.ts +2 -0
- package/lib/cjs/components/table/Table.js +4 -0
- package/lib/cjs/components/tabs/Tabs.d.ts +2 -0
- package/lib/cjs/components/tabs/Tabs.js +4 -0
- package/lib/cjs/components/tags/Tags.d.ts +21 -0
- package/lib/cjs/components/tags/Tags.js +11 -0
- package/lib/cjs/components/textarea/TextArea.d.ts +3 -2
- package/lib/cjs/components/textarea/TextArea.js +4 -5
- package/lib/cjs/components/textarea/fixtures/comp4.d.ts +30 -0
- package/lib/cjs/components/textarea/fixtures/comp4.js +27 -0
- package/lib/cjs/components/textarea/fixtures/index.d.ts +2 -1
- package/lib/cjs/components/textarea/fixtures/index.js +3 -1
- package/lib/cjs/components/textfield/TextField.d.ts +22 -0
- package/lib/cjs/components/textfield/TextField.js +11 -3
- package/lib/cjs/components/time/Time.d.ts +11 -0
- package/lib/cjs/components/time/Time.js +6 -1
- package/lib/cjs/components/tree/Tree.d.ts +5 -4
- package/lib/cjs/components/tree/Tree.form.js +5 -0
- package/lib/cjs/components/tree/Tree.js +8 -9
- package/lib/cjs/components/tree/editForm/Tree.edit.display.d.ts +9 -0
- package/lib/cjs/components/tree/editForm/Tree.edit.display.js +12 -0
- package/lib/cjs/components/well/Well.d.ts +2 -0
- package/lib/cjs/components/well/Well.js +4 -0
- package/lib/cjs/formio.embed.d.ts +2 -1
- package/lib/cjs/formio.embed.js +96 -1
- package/lib/cjs/formio.form.d.ts +4 -3
- package/lib/cjs/formio.form.js +17 -8
- package/lib/cjs/licenses/Licenses.d.ts +7 -0
- package/lib/cjs/licenses/Licenses.js +22 -0
- package/lib/cjs/licenses/index.d.ts +2 -0
- package/lib/cjs/licenses/index.js +7 -0
- package/lib/cjs/providers/Providers.d.ts +31 -11
- package/lib/cjs/providers/address/GoogleAddressProvider.d.ts +2 -2
- package/lib/cjs/providers/address/GoogleAddressProvider.js +2 -3
- package/lib/cjs/providers/processor/fileProcessor.d.ts +1 -1
- package/lib/cjs/providers/processor/fileProcessor.js +1 -5
- package/lib/cjs/providers/storage/azure.d.ts +10 -1
- package/lib/cjs/providers/storage/azure.js +7 -2
- package/lib/cjs/providers/storage/base64.d.ts +2 -2
- package/lib/cjs/providers/storage/base64.js +2 -6
- package/lib/cjs/providers/storage/dropbox.d.ts +2 -2
- package/lib/cjs/providers/storage/dropbox.js +2 -6
- package/lib/cjs/providers/storage/googleDrive.d.ts +3 -2
- package/lib/cjs/providers/storage/googleDrive.js +6 -6
- package/lib/cjs/providers/storage/indexeddb.d.ts +3 -3
- package/lib/cjs/providers/storage/indexeddb.js +9 -13
- package/lib/cjs/providers/storage/s3.d.ts +11 -1
- package/lib/cjs/providers/storage/s3.js +5 -2
- package/lib/cjs/providers/storage/uploadAdapter.js +1 -5
- package/lib/cjs/providers/storage/url.d.ts +2 -2
- package/lib/cjs/providers/storage/url.js +12 -8
- package/lib/cjs/providers/storage/xhr.d.ts +1 -1
- package/lib/cjs/providers/storage/xhr.js +1 -2
- package/lib/cjs/templates/index.d.ts +226 -1
- package/lib/cjs/utils/Evaluator.js +4 -33
- package/lib/cjs/utils/i18n.d.ts +16 -0
- package/lib/cjs/utils/i18n.js +88 -0
- package/lib/cjs/utils/utils.d.ts +11 -1
- package/lib/cjs/utils/utils.js +29 -10
- package/lib/cjs/validator/Validator.d.ts +30 -2
- package/lib/cjs/validator/Validator.js +32 -9
- package/lib/cjs/validator/rules/Select.js +1 -2
- package/lib/cjs/validator/rules/Unique.d.ts +1 -1
- package/lib/cjs/validator/rules/Unique.js +1 -2
- package/lib/cjs/widgets/CalendarWidget.d.ts +1 -0
- package/lib/cjs/widgets/InputWidget.d.ts +1 -1
- package/lib/cjs/widgets/InputWidget.js +1 -2
- package/lib/mjs/CDN.d.ts +1 -0
- package/lib/mjs/CDN.js +2 -1
- package/lib/mjs/Element.js +6 -2
- package/lib/mjs/Embed.d.ts +21 -1
- package/lib/mjs/Embed.js +208 -319
- package/lib/mjs/Form.d.ts +9 -6
- package/lib/mjs/Form.js +53 -11
- package/lib/mjs/PDF.d.ts +11 -3
- package/lib/mjs/PDF.js +4 -5
- package/lib/mjs/PDFBuilder.js +2 -3
- package/lib/mjs/Webform.d.ts +10 -13
- package/lib/mjs/Webform.js +46 -128
- package/lib/mjs/WebformBuilder.d.ts +6 -1
- package/lib/mjs/WebformBuilder.js +103 -65
- package/lib/mjs/Wizard.d.ts +8 -5
- package/lib/mjs/Wizard.js +12 -12
- package/lib/mjs/WizardBuilder.d.ts +6 -4
- package/lib/mjs/WizardBuilder.js +20 -3
- package/lib/mjs/addons/FormioAddon.d.ts +1 -1
- package/lib/mjs/addons/FormioAddon.js +1 -2
- package/lib/mjs/components/_classes/component/Component.d.ts +24 -8
- package/lib/mjs/components/_classes/component/Component.js +44 -14
- package/lib/mjs/components/_classes/input/Input.d.ts +1 -1
- package/lib/mjs/components/_classes/input/Input.js +1 -2
- package/lib/mjs/components/_classes/list/ListComponent.d.ts +4 -0
- package/lib/mjs/components/_classes/list/ListComponent.js +43 -5
- package/lib/mjs/components/_classes/multivalue/Multivalue.d.ts +1 -0
- package/lib/mjs/components/_classes/multivalue/Multivalue.js +10 -4
- package/lib/mjs/components/_classes/nested/NestedComponent.d.ts +5 -2
- package/lib/mjs/components/_classes/nested/NestedComponent.js +9 -10
- package/lib/mjs/components/_classes/nestedarray/NestedArrayComponent.d.ts +1 -0
- package/lib/mjs/components/_classes/nestedarray/NestedArrayComponent.js +4 -0
- package/lib/mjs/components/_classes/nesteddata/NestedDataComponent.d.ts +1 -0
- package/lib/mjs/components/_classes/nesteddata/NestedDataComponent.js +4 -0
- package/lib/mjs/components/address/Address.d.ts +8 -0
- package/lib/mjs/components/address/Address.js +5 -0
- package/lib/mjs/components/button/Button.d.ts +1 -0
- package/lib/mjs/components/button/Button.js +6 -4
- package/lib/mjs/components/checkbox/Checkbox.d.ts +41 -0
- package/lib/mjs/components/checkbox/Checkbox.js +36 -5
- package/lib/mjs/components/columns/Columns.d.ts +2 -0
- package/lib/mjs/components/columns/Columns.js +4 -0
- package/lib/mjs/components/container/Container.d.ts +1 -0
- package/lib/mjs/components/container/Container.js +5 -1
- package/lib/mjs/components/content/Content.d.ts +2 -0
- package/lib/mjs/components/content/Content.js +4 -2
- package/lib/mjs/components/currency/editForm/Currency.edit.data.d.ts +14 -2
- package/lib/mjs/components/currency/editForm/Currency.edit.data.js +4 -0
- package/lib/mjs/components/currency/editForm/Currency.edit.display.js +4 -0
- package/lib/mjs/components/datagrid/DataGrid.d.ts +1 -0
- package/lib/mjs/components/datagrid/DataGrid.js +8 -1
- package/lib/mjs/components/datamap/DataMap.d.ts +1 -0
- package/lib/mjs/components/datamap/DataMap.js +5 -1
- package/lib/mjs/components/datetime/DateTime.d.ts +23 -0
- package/lib/mjs/components/datetime/DateTime.js +27 -1
- package/lib/mjs/components/day/Day.d.ts +22 -1
- package/lib/mjs/components/day/Day.js +24 -7
- package/lib/mjs/components/day/fixtures/comp3.js +2 -2
- package/lib/mjs/components/editgrid/EditGrid.d.ts +4 -3
- package/lib/mjs/components/editgrid/EditGrid.js +11 -6
- package/lib/mjs/components/editgrid/fixtures/comp-with-custom-default-value.d.ts +190 -0
- package/lib/mjs/components/editgrid/fixtures/comp-with-custom-default-value.js +225 -0
- package/lib/mjs/components/editgrid/fixtures/comp15.d.ts +54 -0
- package/lib/mjs/components/editgrid/fixtures/comp15.js +49 -0
- package/lib/mjs/components/editgrid/fixtures/index.d.ts +3 -1
- package/lib/mjs/components/editgrid/fixtures/index.js +3 -1
- package/lib/mjs/components/fieldset/Fieldset.d.ts +2 -0
- package/lib/mjs/components/fieldset/Fieldset.js +4 -0
- package/lib/mjs/components/file/File.d.ts +28 -6
- package/lib/mjs/components/file/File.js +44 -16
- package/lib/mjs/components/file/editForm/File.edit.file.d.ts +62 -0
- package/lib/mjs/components/file/editForm/File.edit.file.js +29 -2
- package/lib/mjs/components/form/Form.d.ts +4 -0
- package/lib/mjs/components/form/Form.js +13 -11
- package/lib/mjs/components/hidden/Hidden.d.ts +1 -0
- package/lib/mjs/components/hidden/Hidden.js +1 -0
- package/lib/mjs/components/html/HTML.d.ts +2 -0
- package/lib/mjs/components/html/HTML.js +4 -0
- package/lib/mjs/components/number/Number.d.ts +24 -1
- package/lib/mjs/components/number/Number.js +23 -7
- package/lib/mjs/components/panel/Panel.d.ts +1 -0
- package/lib/mjs/components/panel/Panel.js +3 -0
- package/lib/mjs/components/phonenumber/PhoneNumber.form.js +9 -0
- package/lib/mjs/components/radio/Radio.d.ts +24 -3
- package/lib/mjs/components/radio/Radio.js +93 -19
- package/lib/mjs/components/recaptcha/ReCaptcha.d.ts +2 -1
- package/lib/mjs/components/recaptcha/ReCaptcha.js +7 -5
- package/lib/mjs/components/resource/Resource.d.ts +7 -0
- package/lib/mjs/components/resource/Resource.js +0 -1
- package/lib/mjs/components/resource/editForm/Resource.edit.display.js +1 -1
- package/lib/mjs/components/select/Select.d.ts +25 -5
- package/lib/mjs/components/select/Select.js +55 -52
- package/lib/mjs/components/selectboxes/SelectBoxes.d.ts +37 -0
- package/lib/mjs/components/selectboxes/SelectBoxes.js +63 -25
- package/lib/mjs/components/selectboxes/fixtures/comp4.d.ts +30 -27
- package/lib/mjs/components/selectboxes/fixtures/comp4.js +47 -32
- package/lib/mjs/components/selectboxes/fixtures/comp6.d.ts +14 -0
- package/lib/mjs/components/selectboxes/fixtures/comp6.js +13 -0
- package/lib/mjs/components/selectboxes/fixtures/index.d.ts +2 -1
- package/lib/mjs/components/selectboxes/fixtures/index.js +2 -1
- package/lib/mjs/components/signature/Signature.d.ts +22 -1
- package/lib/mjs/components/signature/Signature.js +19 -3
- package/lib/mjs/components/survey/Survey.d.ts +21 -0
- package/lib/mjs/components/survey/Survey.js +13 -1
- package/lib/mjs/components/table/Table.d.ts +2 -0
- package/lib/mjs/components/table/Table.js +4 -0
- package/lib/mjs/components/tabs/Tabs.d.ts +2 -0
- package/lib/mjs/components/tabs/Tabs.js +4 -0
- package/lib/mjs/components/tags/Tags.d.ts +21 -0
- package/lib/mjs/components/tags/Tags.js +14 -0
- package/lib/mjs/components/textarea/TextArea.d.ts +3 -2
- package/lib/mjs/components/textarea/TextArea.js +4 -5
- package/lib/mjs/components/textarea/fixtures/comp4.d.ts +30 -0
- package/lib/mjs/components/textarea/fixtures/comp4.js +25 -0
- package/lib/mjs/components/textarea/fixtures/index.d.ts +2 -1
- package/lib/mjs/components/textarea/fixtures/index.js +2 -1
- package/lib/mjs/components/textfield/TextField.d.ts +22 -0
- package/lib/mjs/components/textfield/TextField.js +14 -3
- package/lib/mjs/components/time/Time.d.ts +11 -0
- package/lib/mjs/components/time/Time.js +12 -1
- package/lib/mjs/components/tree/Tree.d.ts +5 -4
- package/lib/mjs/components/tree/Tree.form.js +5 -0
- package/lib/mjs/components/tree/Tree.js +8 -9
- package/lib/mjs/components/tree/editForm/Tree.edit.display.d.ts +9 -0
- package/lib/mjs/components/tree/editForm/Tree.edit.display.js +10 -0
- package/lib/mjs/components/well/Well.d.ts +2 -0
- package/lib/mjs/components/well/Well.js +4 -0
- package/lib/mjs/formio.embed.d.ts +2 -1
- package/lib/mjs/formio.embed.js +96 -2
- package/lib/mjs/formio.form.d.ts +4 -3
- package/lib/mjs/formio.form.js +16 -8
- package/lib/mjs/licenses/Licenses.d.ts +7 -0
- package/lib/mjs/licenses/Licenses.js +17 -0
- package/lib/mjs/licenses/index.d.ts +2 -0
- package/lib/mjs/licenses/index.js +2 -0
- package/lib/mjs/providers/Providers.d.ts +31 -11
- package/lib/mjs/providers/address/GoogleAddressProvider.d.ts +2 -2
- package/lib/mjs/providers/address/GoogleAddressProvider.js +2 -3
- package/lib/mjs/providers/processor/fileProcessor.d.ts +1 -1
- package/lib/mjs/providers/processor/fileProcessor.js +1 -2
- package/lib/mjs/providers/storage/azure.d.ts +10 -1
- package/lib/mjs/providers/storage/azure.js +7 -2
- package/lib/mjs/providers/storage/base64.d.ts +2 -2
- package/lib/mjs/providers/storage/base64.js +2 -3
- package/lib/mjs/providers/storage/dropbox.d.ts +2 -2
- package/lib/mjs/providers/storage/dropbox.js +2 -3
- package/lib/mjs/providers/storage/googleDrive.d.ts +3 -2
- package/lib/mjs/providers/storage/googleDrive.js +6 -3
- package/lib/mjs/providers/storage/indexeddb.d.ts +3 -3
- package/lib/mjs/providers/storage/indexeddb.js +9 -10
- package/lib/mjs/providers/storage/s3.d.ts +11 -1
- package/lib/mjs/providers/storage/s3.js +5 -2
- package/lib/mjs/providers/storage/uploadAdapter.js +1 -2
- package/lib/mjs/providers/storage/url.d.ts +2 -2
- package/lib/mjs/providers/storage/url.js +12 -5
- package/lib/mjs/providers/storage/xhr.d.ts +1 -1
- package/lib/mjs/providers/storage/xhr.js +1 -2
- package/lib/mjs/templates/index.d.ts +226 -1
- package/lib/mjs/utils/Evaluator.js +4 -33
- package/lib/mjs/utils/i18n.d.ts +16 -0
- package/lib/mjs/utils/i18n.js +81 -0
- package/lib/mjs/utils/utils.d.ts +11 -1
- package/lib/mjs/utils/utils.js +27 -9
- package/lib/mjs/validator/Validator.d.ts +30 -2
- package/lib/mjs/validator/Validator.js +31 -9
- package/lib/mjs/validator/rules/Select.js +1 -2
- package/lib/mjs/validator/rules/Unique.d.ts +1 -1
- package/lib/mjs/validator/rules/Unique.js +1 -2
- package/lib/mjs/widgets/CalendarWidget.d.ts +1 -0
- package/lib/mjs/widgets/InputWidget.d.ts +1 -1
- package/lib/mjs/widgets/InputWidget.js +1 -2
- package/package.json +18 -15
- package/types/index.d.ts +1 -0
- package/types/licenses.d.ts +7 -0
- package/types/utils.d.ts +2 -0
package/lib/mjs/Embed.js
CHANGED
@@ -1,181 +1,179 @@
|
|
1
|
-
import CDN from './CDN';
|
2
|
-
|
3
|
-
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
1
|
+
import CDN from './CDN.js';
|
2
|
+
class Formio {
|
3
|
+
static baseUrl;
|
4
|
+
static projectUrl;
|
5
|
+
static language;
|
6
|
+
static wrapper;
|
7
|
+
static element;
|
8
|
+
static config = {};
|
9
|
+
static loader = null;
|
10
|
+
static cdn = null;
|
11
|
+
static proxy = true;
|
12
|
+
static async setBaseUrl(url) {
|
13
|
+
Formio.baseUrl = url;
|
14
|
+
}
|
15
|
+
static async setProjectUrl(url) {
|
16
|
+
Formio.projectUrl = url;
|
17
|
+
}
|
18
|
+
static debug(...args) {
|
19
|
+
if (Formio.config.debug) {
|
20
|
+
console.log(...args);
|
21
|
+
}
|
22
|
+
}
|
23
|
+
static global(prop) {
|
24
|
+
const globalValue = window[prop];
|
25
|
+
if (globalValue && globalValue.proxy) {
|
26
|
+
return null;
|
13
27
|
}
|
28
|
+
Formio.debug(`Getting global ${prop}`, globalValue);
|
29
|
+
return globalValue;
|
14
30
|
}
|
15
|
-
|
16
|
-
const
|
17
|
-
|
18
|
-
|
19
|
-
query[item.split('=')[0]] = item.split('=')[1] && decodeURIComponent(item.split('=')[1]);
|
31
|
+
static createElement(type, attrs, children) {
|
32
|
+
const element = document.createElement(type);
|
33
|
+
Object.keys(attrs).forEach(key => {
|
34
|
+
element.setAttribute(key, attrs[key]);
|
20
35
|
});
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
36
|
+
(children || []).forEach(child => {
|
37
|
+
element.appendChild(Formio.createElement(child.tag, child.attrs, child.children));
|
38
|
+
});
|
39
|
+
return element;
|
40
|
+
}
|
41
|
+
static async addScript(src, name) {
|
42
|
+
if (!src) {
|
43
|
+
return Promise.resolve();
|
25
44
|
}
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
libs.uswds.js = `${url}/uswds/${cdn.getVersion('uswds')}/uswds.min.js`;
|
48
|
-
libs.uswds.css = `${url}/uswds/${cdn.getVersion('uswds')}/uswds.min.css`;
|
49
|
-
libs.fontawesome.css = `${url}/font-awesome/${cdn.getVersion('font-awesome')}/css/font-awesome.min.css`;
|
50
|
-
libs.bootstrap.css = `${url}/bootstrap/${cdn.getVersion('bootstrap')}/css/bootstrap.min.css`;
|
51
|
-
}
|
52
|
-
return libs;
|
53
|
-
};
|
54
|
-
config = Object.assign({
|
55
|
-
script: query.script,
|
56
|
-
style: query.styles,
|
57
|
-
class: (query.class || 'formio-form-wrapper'),
|
58
|
-
src: query.src,
|
59
|
-
form: null,
|
60
|
-
submission: null,
|
61
|
-
project: query.project,
|
62
|
-
base: query.base,
|
63
|
-
submit: query.submit,
|
64
|
-
includeLibs: (query.libs === 'true' || query.libs === '1'),
|
65
|
-
template: query.template,
|
66
|
-
debug: (query.debug === 'true' || query.debug === '1'),
|
67
|
-
config: {},
|
68
|
-
redirect: (query.return || query.redirect),
|
69
|
-
before: () => { },
|
70
|
-
after: () => { }
|
71
|
-
}, config);
|
72
|
-
/**
|
73
|
-
* Print debug statements.
|
74
|
-
*
|
75
|
-
* @param {...any} args Arguments to pass to the console.log method.
|
76
|
-
*/
|
77
|
-
const debug = (...args) => {
|
78
|
-
if (config.debug) {
|
79
|
-
console.log(...args);
|
80
|
-
}
|
81
|
-
};
|
82
|
-
/**
|
83
|
-
* Creates a new DOM element.
|
84
|
-
*
|
85
|
-
* @param {string} tag The HTMLElement to add to the wrapper or shadow dom.
|
86
|
-
* @param {Object} attrs The attributes to add to this element.
|
87
|
-
* @param {Array<Object>} children The children attached to this element.
|
88
|
-
*/
|
89
|
-
const createElement = (tag, attrs, children) => {
|
90
|
-
const element = document.createElement(tag);
|
91
|
-
for (const attr in attrs) {
|
92
|
-
if (attrs.hasOwnProperty(attr)) {
|
93
|
-
element.setAttribute(attr, attrs[attr]);
|
45
|
+
if (typeof src !== 'string' && src.length) {
|
46
|
+
return Promise.all(src.map(ref => Formio.addScript(ref)));
|
47
|
+
}
|
48
|
+
if (name && Formio.global(name)) {
|
49
|
+
Formio.debug(`${name} already loaded.`);
|
50
|
+
return Promise.resolve(Formio.global(name));
|
51
|
+
}
|
52
|
+
Formio.debug('Adding Script', src);
|
53
|
+
Formio.wrapper.appendChild(Formio.createElement('script', {
|
54
|
+
src
|
55
|
+
}));
|
56
|
+
if (!name) {
|
57
|
+
return Promise.resolve();
|
58
|
+
}
|
59
|
+
return new Promise((resolve) => {
|
60
|
+
Formio.debug(`Waiting to load ${name}`);
|
61
|
+
const wait = setInterval(() => {
|
62
|
+
if (Formio.global(name)) {
|
63
|
+
clearInterval(wait);
|
64
|
+
Formio.debug(`${name} loaded.`);
|
65
|
+
resolve(Formio.global(name));
|
94
66
|
}
|
95
|
-
}
|
96
|
-
|
97
|
-
|
98
|
-
|
99
|
-
|
100
|
-
|
101
|
-
|
102
|
-
if (
|
103
|
-
|
67
|
+
}, 100);
|
68
|
+
});
|
69
|
+
}
|
70
|
+
static async addStyles(href, addGlobally = false) {
|
71
|
+
if (!href) {
|
72
|
+
return;
|
73
|
+
}
|
74
|
+
if (typeof href !== 'string' && href.length) {
|
75
|
+
href.forEach(ref => Formio.addStyles(ref));
|
76
|
+
return;
|
104
77
|
}
|
105
|
-
|
106
|
-
const
|
107
|
-
|
108
|
-
|
109
|
-
let wrapper = createElement('div', {
|
110
|
-
'id': `"${id}-wrapper"`
|
78
|
+
Formio.debug('Adding Styles', href);
|
79
|
+
const link = Formio.createElement('link', {
|
80
|
+
rel: 'stylesheet',
|
81
|
+
href
|
111
82
|
});
|
112
|
-
|
113
|
-
|
114
|
-
|
115
|
-
if (config.includeLibs && (typeof wrapper.attachShadow === 'function') && !config.premium) {
|
116
|
-
wrapper = wrapper.attachShadow({
|
117
|
-
mode: 'open'
|
118
|
-
});
|
119
|
-
config.config.shadowRoot = wrapper;
|
83
|
+
if (addGlobally) {
|
84
|
+
// Add globally as well.
|
85
|
+
document.head.appendChild(link);
|
120
86
|
}
|
121
|
-
|
122
|
-
|
123
|
-
|
124
|
-
|
125
|
-
|
126
|
-
|
127
|
-
|
128
|
-
|
129
|
-
|
130
|
-
|
131
|
-
|
132
|
-
|
133
|
-
|
134
|
-
|
135
|
-
|
136
|
-
|
137
|
-
|
138
|
-
|
139
|
-
|
140
|
-
|
141
|
-
|
142
|
-
|
143
|
-
|
144
|
-
|
145
|
-
|
146
|
-
}
|
147
|
-
|
148
|
-
|
149
|
-
if (
|
150
|
-
|
151
|
-
}
|
152
|
-
if (typeof src !== 'string' && src.length) {
|
153
|
-
src.forEach(ref => addScript(ref));
|
154
|
-
return;
|
155
|
-
}
|
156
|
-
if (globalProp && global(globalProp)) {
|
157
|
-
debug(`${globalProp} already loaded.`);
|
158
|
-
return global(globalProp);
|
87
|
+
Formio.wrapper.appendChild(Formio.createElement('link', {
|
88
|
+
rel: 'stylesheet',
|
89
|
+
href
|
90
|
+
}));
|
91
|
+
}
|
92
|
+
static async submitDone(instance, submission) {
|
93
|
+
Formio.debug('Submision Complete', submission);
|
94
|
+
let returnUrl = Formio.config.redirect;
|
95
|
+
// Allow form based configuration for return url.
|
96
|
+
if (!returnUrl &&
|
97
|
+
(instance._form &&
|
98
|
+
instance._form.settings &&
|
99
|
+
(instance._form.settings.returnUrl ||
|
100
|
+
instance._form.settings.redirect))) {
|
101
|
+
Formio.debug('Return url found in form configuration');
|
102
|
+
returnUrl = instance._form.settings.returnUrl || instance._form.settings.redirect;
|
103
|
+
}
|
104
|
+
if (returnUrl) {
|
105
|
+
const formSrc = instance.formio ? instance.formio.formUrl : '';
|
106
|
+
const hasQuery = !!returnUrl.match(/\?/);
|
107
|
+
const isOrigin = returnUrl.indexOf(location.origin) === 0;
|
108
|
+
returnUrl += hasQuery ? '&' : '?';
|
109
|
+
returnUrl += `sub=${submission._id}`;
|
110
|
+
if (!isOrigin && formSrc) {
|
111
|
+
returnUrl += `&form=${encodeURIComponent(formSrc)}`;
|
112
|
+
}
|
113
|
+
Formio.debug('Return URL', returnUrl);
|
114
|
+
window.location.href = returnUrl;
|
115
|
+
if (isOrigin) {
|
116
|
+
window.location.reload();
|
159
117
|
}
|
160
|
-
|
161
|
-
|
162
|
-
|
163
|
-
|
164
|
-
|
165
|
-
|
166
|
-
|
167
|
-
|
168
|
-
|
169
|
-
|
170
|
-
|
171
|
-
|
172
|
-
|
118
|
+
}
|
119
|
+
}
|
120
|
+
static async renderForm(form, options) {
|
121
|
+
if (Formio.config.before) {
|
122
|
+
await Formio.config.before(Formio.FormioClass, Formio.element, Formio.config);
|
123
|
+
}
|
124
|
+
Formio.FormioClass.license = true;
|
125
|
+
return Formio.FormioClass.createForm(Formio.element, form, {
|
126
|
+
...options,
|
127
|
+
...{ noLoader: true }
|
128
|
+
}).then((instance) => {
|
129
|
+
Formio.debug('Form created', instance);
|
130
|
+
// Remove the loader.
|
131
|
+
Formio.debug('Removing loader');
|
132
|
+
Formio.wrapper.removeChild(Formio.loader);
|
133
|
+
// Set the default submission data.
|
134
|
+
if (Formio.config.submission) {
|
135
|
+
Formio.debug('Setting submission', Formio.config.submission);
|
136
|
+
instance.submission = Formio.config.submission;
|
137
|
+
}
|
138
|
+
// Allow them to provide additional configs.
|
139
|
+
Formio.debug('Triggering embed event');
|
140
|
+
Formio.FormioClass.events.emit('formEmbedded', instance);
|
141
|
+
// Trigger the after handler.
|
142
|
+
if (Formio.config.after) {
|
143
|
+
Formio.debug('Calling ready callback');
|
144
|
+
Formio.config.after(instance, Formio.config);
|
145
|
+
}
|
146
|
+
return instance;
|
147
|
+
});
|
148
|
+
}
|
149
|
+
// eslint-disable-next-line max-statements
|
150
|
+
static async createForm(element, form, options) {
|
151
|
+
Formio.element = element;
|
152
|
+
Formio.cdn = new CDN(Formio.config.cdn);
|
153
|
+
Formio.config.libs = Formio.config.libs || {
|
154
|
+
uswds: {
|
155
|
+
fa: true,
|
156
|
+
js: `${Formio.cdn.uswds}/uswds.min.js`,
|
157
|
+
css: `${Formio.cdn.uswds}/uswds.min.css`,
|
158
|
+
},
|
159
|
+
fontawesome: {
|
160
|
+
css: `${Formio.cdn['font-awesome']}/css/font-awesome.min.css`
|
161
|
+
},
|
162
|
+
bootstrap: {
|
163
|
+
css: `${Formio.cdn.bootstrap}/css/bootstrap.min.css`
|
173
164
|
}
|
174
165
|
};
|
175
|
-
|
176
|
-
|
177
|
-
|
178
|
-
|
166
|
+
Formio.config.id = Formio.config.id || `formio-${Math.random().toString(36).substring(7)}`;
|
167
|
+
// Create a new wrapper and add the element inside of a new wrapper.
|
168
|
+
Formio.wrapper = Formio.createElement('div', {
|
169
|
+
'id': `"${Formio.config.id}-wrapper"`
|
170
|
+
});
|
171
|
+
element.parentNode.insertBefore(Formio.wrapper, element);
|
172
|
+
element.parentNode.removeChild(element);
|
173
|
+
Formio.wrapper.appendChild(element);
|
174
|
+
// Load the renderer styles.
|
175
|
+
await Formio.addStyles(Formio.config.embedCSS || `${Formio.cdn.js}/formio.embed.css`);
|
176
|
+
Formio.loader = Formio.createElement('div', {
|
179
177
|
'class': 'formio-loader'
|
180
178
|
}, [{
|
181
179
|
tag: 'div',
|
@@ -189,160 +187,51 @@ export function embed(config = {}) {
|
|
189
187
|
}
|
190
188
|
}]
|
191
189
|
}]);
|
192
|
-
wrapper.appendChild(loader);
|
193
|
-
|
194
|
-
|
195
|
-
|
196
|
-
|
197
|
-
|
198
|
-
|
199
|
-
|
200
|
-
|
201
|
-
|
202
|
-
|
203
|
-
|
204
|
-
|
205
|
-
|
206
|
-
|
207
|
-
|
208
|
-
|
209
|
-
|
210
|
-
|
211
|
-
|
212
|
-
// Allow form based configuration for return url.
|
213
|
-
if (!returnUrl &&
|
214
|
-
(instance._form &&
|
215
|
-
instance._form.settings &&
|
216
|
-
(instance._form.settings.returnUrl ||
|
217
|
-
instance._form.settings.redirect))) {
|
218
|
-
debug('Return url found in form configuration');
|
219
|
-
returnUrl = instance._form.settings.returnUrl || instance._form.settings.redirect;
|
220
|
-
}
|
221
|
-
if (returnUrl) {
|
222
|
-
const formSrc = instance.formio ? instance.formio.formUrl : '';
|
223
|
-
const hasQuery = !!returnUrl.match(/\?/);
|
224
|
-
const isOrigin = returnUrl.indexOf(location.origin) === 0;
|
225
|
-
returnUrl += hasQuery ? '&' : '?';
|
226
|
-
returnUrl += `sub=${submission._id}`;
|
227
|
-
if (!isOrigin && formSrc) {
|
228
|
-
returnUrl += `&form=${encodeURIComponent(formSrc)}`;
|
229
|
-
}
|
230
|
-
debug('Return URL', returnUrl);
|
231
|
-
window.location.href = returnUrl;
|
232
|
-
if (isOrigin) {
|
233
|
-
window.location.reload();
|
234
|
-
}
|
235
|
-
}
|
236
|
-
};
|
237
|
-
if (config.submit) {
|
238
|
-
instance.nosubmit = true;
|
239
|
-
}
|
240
|
-
debug('Form created', instance);
|
241
|
-
// Remove the loader.
|
242
|
-
debug('Removing loader');
|
243
|
-
wrapper.removeChild(loader);
|
244
|
-
// Set the default submission data.
|
245
|
-
if (config.submission) {
|
246
|
-
debug('Setting submission', config.submission);
|
247
|
-
instance.submission = config.submission;
|
248
|
-
}
|
249
|
-
// Allow them to provide additional configs.
|
250
|
-
debug('Triggering embed event');
|
251
|
-
Formio.events.emit('formEmbedded', instance);
|
252
|
-
debug('Calling ready callback');
|
253
|
-
config.after(instance, config);
|
254
|
-
// Configure a redirect.
|
255
|
-
instance.on('submit', (submission) => {
|
256
|
-
debug("on('submit')", submission);
|
257
|
-
if (config.submit) {
|
258
|
-
debug(`Sending submission to ${config.submit}`);
|
259
|
-
const headers = {
|
260
|
-
'content-type': 'application/json'
|
261
|
-
};
|
262
|
-
const token = Formio.getToken();
|
263
|
-
if (token) {
|
264
|
-
headers['x-jwt-token'] = token;
|
265
|
-
}
|
266
|
-
Formio.fetch(config.submit, {
|
267
|
-
body: JSON.stringify(submission),
|
268
|
-
headers: headers,
|
269
|
-
method: 'POST',
|
270
|
-
mode: 'cors',
|
271
|
-
})
|
272
|
-
.then(resp => resp.json())
|
273
|
-
.then(submission => submitDone(submission));
|
274
|
-
}
|
275
|
-
else {
|
276
|
-
submitDone(submission);
|
277
|
-
}
|
278
|
-
});
|
279
|
-
});
|
280
|
-
});
|
281
|
-
};
|
282
|
-
if (config.base) {
|
283
|
-
Formio.setBaseUrl(config.base);
|
284
|
-
}
|
285
|
-
if (config.project) {
|
286
|
-
Formio.setProjectUrl(config.project);
|
287
|
-
}
|
288
|
-
// Add premium modules
|
289
|
-
if (global('premium')) {
|
290
|
-
debug('Using premium module.');
|
291
|
-
Formio.use(global('premium'));
|
292
|
-
}
|
293
|
-
if (global('vpat')) {
|
294
|
-
debug('Using vpat module.');
|
295
|
-
Formio.use(global('vpat'));
|
296
|
-
}
|
297
|
-
if (config.template) {
|
298
|
-
if (config.includeLibs) {
|
299
|
-
addStyles(config.libs[config.template].css);
|
300
|
-
addScript(config.libs[config.template].js);
|
301
|
-
if (config.libs[config.template].fa) {
|
302
|
-
addStyles(config.libs.fontawesome.css, true);
|
303
|
-
}
|
304
|
-
}
|
305
|
-
let templateSrc;
|
306
|
-
if (cdn instanceof CDN) {
|
307
|
-
templateSrc = `${cdn[config.template]}/${config.template}.min`;
|
308
|
-
}
|
309
|
-
else {
|
310
|
-
templateSrc = `${cdn}/@formio/${config.template}@latest/dist/${config.template}.min`;
|
190
|
+
Formio.wrapper.appendChild(Formio.loader);
|
191
|
+
Formio.FormioClass = await Formio.addScript(Formio.config.script || `${Formio.cdn.js}/formio.form.min.js`, 'Formio');
|
192
|
+
Formio.FormioClass.setBaseUrl(Formio.baseUrl || Formio.config.base);
|
193
|
+
Formio.FormioClass.setProjectUrl(Formio.projectUrl || Formio.config.project);
|
194
|
+
Formio.FormioClass.language = Formio.language;
|
195
|
+
// Add premium modules
|
196
|
+
if (Formio.global('premium')) {
|
197
|
+
Formio.debug('Using premium module.');
|
198
|
+
Formio.FormioClass.use(Formio.global('premium'));
|
199
|
+
}
|
200
|
+
if (Formio.global('vpat')) {
|
201
|
+
Formio.debug('Using vpat module.');
|
202
|
+
Formio.FormioClass.use(Formio.global('vpat'));
|
203
|
+
}
|
204
|
+
if (Formio.config.template) {
|
205
|
+
if (Formio.config.includeLibs) {
|
206
|
+
await Formio.addStyles(Formio.config.libs[Formio.config.template].css);
|
207
|
+
await Formio.addScript(Formio.config.libs[Formio.config.template].js);
|
208
|
+
if (Formio.config.libs[Formio.config.template].fa) {
|
209
|
+
await Formio.addStyles(Formio.config.libs.fontawesome.css, true);
|
311
210
|
}
|
312
|
-
addStyles(`${templateSrc}.css`);
|
313
|
-
addScript(`${templateSrc}.js`, config.template, (template) => {
|
314
|
-
debug(`Using ${config.template}`);
|
315
|
-
Formio.use(template);
|
316
|
-
renderForm();
|
317
|
-
});
|
318
|
-
}
|
319
|
-
else if (global('uswds')) {
|
320
|
-
debug('Using uswds module.');
|
321
|
-
Formio.use(global('uswds'));
|
322
|
-
}
|
323
|
-
// Default bootstrap + fontawesome.
|
324
|
-
else if (config.includeLibs) {
|
325
|
-
Formio.cdn = new CDN();
|
326
|
-
config.libs = resolveLibs(query.cdn || Formio.cdn);
|
327
|
-
addStyles(config.libs.fontawesome.css, true);
|
328
|
-
addStyles(config.libs.bootstrap.css);
|
329
211
|
}
|
330
|
-
if (config.
|
331
|
-
|
332
|
-
|
333
|
-
|
334
|
-
|
335
|
-
renderForm();
|
336
|
-
});
|
212
|
+
if (Formio.cdn[Formio.config.template]) {
|
213
|
+
const templateSrc = `${Formio.cdn[Formio.config.template]}/${Formio.config.template}.min`;
|
214
|
+
await Formio.addStyles(`${templateSrc}.css`);
|
215
|
+
Formio.debug(`Using ${Formio.config.template}`);
|
216
|
+
Formio.FormioClass.use(await Formio.addScript(`${templateSrc}.js`, Formio.config.template));
|
337
217
|
}
|
338
|
-
|
339
|
-
|
340
|
-
|
341
|
-
|
342
|
-
}
|
343
|
-
|
344
|
-
|
345
|
-
|
346
|
-
|
218
|
+
}
|
219
|
+
else if (Formio.global('uswds')) {
|
220
|
+
Formio.debug('Using uswds module.');
|
221
|
+
Formio.FormioClass.use(Formio.global('uswds'));
|
222
|
+
}
|
223
|
+
// Default bootstrap + fontawesome.
|
224
|
+
else if (Formio.config.includeLibs) {
|
225
|
+
await Formio.addStyles(Formio.config.libs.fontawesome.css, true);
|
226
|
+
await Formio.addStyles(Formio.config.libs.bootstrap.css);
|
227
|
+
}
|
228
|
+
if (Formio.config.premium) {
|
229
|
+
await Formio.addStyles(Formio.config.premium.css);
|
230
|
+
Formio.debug('Using premium');
|
231
|
+
Formio.FormioClass.use(await Formio.addScript(Formio.config.premium.js, 'premium'));
|
232
|
+
}
|
233
|
+
await Formio.addStyles(Formio.config.style || `${Formio.cdn.js}/formio.form.min.css`);
|
234
|
+
return await Formio.renderForm(form, options);
|
347
235
|
}
|
348
236
|
}
|
237
|
+
export { Formio };
|
package/lib/mjs/Form.d.ts
CHANGED
@@ -1,5 +1,5 @@
|
|
1
1
|
export default class Form extends Element {
|
2
|
-
static embed(embed: any): any
|
2
|
+
static embed(embed: any): Promise<any>;
|
3
3
|
/**
|
4
4
|
* Creates an easy to use interface for embedding webforms, pdfs, and wizards into your application.
|
5
5
|
*
|
@@ -12,18 +12,21 @@ export default class Form extends Element {
|
|
12
12
|
* @param {boolean} options.template - Provides a way to inject custom logic into the creation of every element rendered within the form.
|
13
13
|
*
|
14
14
|
* @example
|
15
|
-
* import Form from '
|
15
|
+
* import Form from '@formio/js/Form';
|
16
16
|
* const form = new Form(document.getElementById('formio'), 'https://examples.form.io/example');
|
17
17
|
* form.build();
|
18
18
|
*/
|
19
19
|
constructor(...args: any[]);
|
20
|
-
ready: any
|
21
|
-
readyResolve: any;
|
22
|
-
readyReject: any;
|
20
|
+
ready: Promise<any>;
|
21
|
+
readyResolve: (value: any) => void;
|
22
|
+
readyReject: (reason?: any) => void;
|
23
23
|
instance: any;
|
24
24
|
element: any;
|
25
25
|
options: any;
|
26
26
|
display: string;
|
27
|
+
createElement(tag: any, attrs: any, children: any): any;
|
28
|
+
set loading(arg: any);
|
29
|
+
loader: any;
|
27
30
|
/**
|
28
31
|
* Create a new form instance provided the display of the form.
|
29
32
|
*
|
@@ -84,7 +87,7 @@ export default class Form extends Element {
|
|
84
87
|
* @return {Promise<T>}
|
85
88
|
*/
|
86
89
|
build(): Promise<T>;
|
87
|
-
render(): any
|
90
|
+
render(): Promise<any>;
|
88
91
|
attach(element: any): any;
|
89
92
|
}
|
90
93
|
import Element from './Element';
|