@formio/js 5.0.0-dev.5610.da13e39 → 5.0.0-dev.5613.3476921
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/formio.embed.js +1 -1
- package/dist/formio.embed.min.js +1 -1
- package/dist/formio.embed.min.js.LICENSE.txt +1 -1
- package/dist/formio.form.js +1199 -651
- package/dist/formio.form.min.js +1 -1
- package/dist/formio.form.min.js.LICENSE.txt +11 -3
- package/dist/formio.full.js +919 -691
- package/dist/formio.full.min.js +1 -1
- package/dist/formio.full.min.js.LICENSE.txt +11 -3
- package/dist/formio.js +16 -16
- package/dist/formio.min.js +1 -1
- package/dist/formio.min.js.LICENSE.txt +1 -1
- package/dist/formio.utils.js +493 -1861
- package/dist/formio.utils.min.js +1 -1
- package/dist/formio.utils.min.js.LICENSE.txt +2 -12
- package/lib/cjs/Element.d.ts +96 -86
- package/lib/cjs/Element.js +78 -68
- package/lib/cjs/Form.d.ts +36 -365
- package/lib/cjs/Form.js +64 -50
- package/lib/cjs/FormBuilder.d.ts +2 -187
- package/lib/cjs/FormBuilder.js +8 -30
- package/lib/cjs/PDF.d.ts +13 -11
- package/lib/cjs/PDF.js +8 -6
- package/lib/cjs/Webform.d.ts +139 -180
- package/lib/cjs/Webform.js +298 -313
- package/lib/cjs/WebformBuilder.d.ts +14 -16
- package/lib/cjs/WebformBuilder.js +11 -17
- package/lib/cjs/Wizard.d.ts +21 -31
- package/lib/cjs/Wizard.js +19 -42
- package/lib/cjs/WizardBuilder.d.ts +1 -1
- package/lib/cjs/addons/PasswordStrength/PasswordStrengthAddon.d.ts +5 -8
- package/lib/cjs/addons/PasswordStrength/PasswordStrengthAddon.js +3 -6
- package/lib/cjs/components/Components.d.ts +4 -4
- package/lib/cjs/components/Components.js +3 -3
- package/lib/cjs/components/_classes/component/Component.d.ts +269 -502
- package/lib/cjs/components/_classes/component/Component.form.d.ts +3 -6
- package/lib/cjs/components/_classes/component/Component.form.js +0 -5
- package/lib/cjs/components/_classes/component/Component.js +189 -433
- package/lib/cjs/components/_classes/component/editForm/Component.edit.display.js +8 -0
- package/lib/cjs/components/_classes/component/editForm/Component.edit.validation.js +2 -2
- package/lib/cjs/components/_classes/component/editForm/utils.js +2 -2
- package/lib/cjs/components/_classes/field/Field.d.ts +2 -11
- package/lib/cjs/components/_classes/field/Field.js +1 -13
- package/lib/cjs/components/_classes/input/Input.d.ts +3 -4
- package/lib/cjs/components/_classes/input/Input.js +2 -2
- package/lib/cjs/components/_classes/list/ListComponent.d.ts +2 -2
- package/lib/cjs/components/_classes/list/ListComponent.form.d.ts +3 -6
- package/lib/cjs/components/_classes/list/ListComponent.form.js +0 -5
- package/lib/cjs/components/_classes/multivalue/Multivalue.d.ts +12 -43
- package/lib/cjs/components/_classes/multivalue/Multivalue.js +3 -37
- package/lib/cjs/components/_classes/nested/NestedComponent.d.ts +67 -163
- package/lib/cjs/components/_classes/nested/NestedComponent.form.d.ts +3 -6
- package/lib/cjs/components/_classes/nested/NestedComponent.form.js +0 -5
- package/lib/cjs/components/_classes/nested/NestedComponent.js +54 -175
- package/lib/cjs/components/_classes/nestedarray/NestedArrayComponent.d.ts +2 -2
- package/lib/cjs/components/_classes/nestedarray/NestedArrayComponent.js +1 -1
- package/lib/cjs/components/_classes/nesteddata/NestedDataComponent.d.ts +1 -7
- package/lib/cjs/components/_classes/nesteddata/NestedDataComponent.js +3 -2
- package/lib/cjs/components/address/Address.d.ts +2 -4
- package/lib/cjs/components/address/Address.form.d.ts +3 -6
- package/lib/cjs/components/address/Address.form.js +0 -5
- package/lib/cjs/components/button/Button.d.ts +12 -3
- package/lib/cjs/components/button/Button.form.d.ts +3 -6
- package/lib/cjs/components/button/Button.form.js +0 -5
- package/lib/cjs/components/button/Button.js +0 -5
- package/lib/cjs/components/checkbox/Checkbox.d.ts +27 -4
- package/lib/cjs/components/checkbox/Checkbox.form.d.ts +3 -6
- package/lib/cjs/components/checkbox/Checkbox.form.js +0 -5
- package/lib/cjs/components/columns/Columns.d.ts +2 -3
- package/lib/cjs/components/columns/Columns.form.d.ts +3 -6
- package/lib/cjs/components/columns/Columns.form.js +0 -5
- package/lib/cjs/components/columns/Columns.js +1 -1
- package/lib/cjs/components/container/Container.form.d.ts +3 -6
- package/lib/cjs/components/container/Container.form.js +0 -5
- package/lib/cjs/components/content/Content.d.ts +1 -2
- package/lib/cjs/components/content/Content.form.d.ts +3 -6
- package/lib/cjs/components/content/Content.form.js +0 -5
- package/lib/cjs/components/currency/Currency.form.d.ts +3 -6
- package/lib/cjs/components/currency/Currency.form.js +0 -5
- package/lib/cjs/components/currency/Currency.js +2 -1
- package/lib/cjs/components/datagrid/DataGrid.d.ts +7 -8
- package/lib/cjs/components/datagrid/DataGrid.form.d.ts +3 -6
- package/lib/cjs/components/datagrid/DataGrid.form.js +0 -5
- package/lib/cjs/components/datagrid/DataGrid.js +5 -5
- package/lib/cjs/components/datamap/DataMap.d.ts +0 -1
- package/lib/cjs/components/datamap/DataMap.form.d.ts +3 -6
- package/lib/cjs/components/datamap/DataMap.form.js +0 -5
- package/lib/cjs/components/datetime/DateTime.d.ts +14 -0
- package/lib/cjs/components/datetime/DateTime.form.d.ts +3 -6
- package/lib/cjs/components/datetime/DateTime.form.js +0 -5
- package/lib/cjs/components/datetime/editForm/DateTime.edit.date.js +2 -2
- package/lib/cjs/components/day/Day.d.ts +48 -22
- package/lib/cjs/components/day/Day.form.d.ts +3 -6
- package/lib/cjs/components/day/Day.form.js +0 -5
- package/lib/cjs/components/day/Day.js +20 -15
- package/lib/cjs/components/editgrid/EditGrid.d.ts +3 -7
- package/lib/cjs/components/editgrid/EditGrid.form.d.ts +3 -6
- package/lib/cjs/components/editgrid/EditGrid.form.js +0 -5
- package/lib/cjs/components/editgrid/EditGrid.js +3 -3
- package/lib/cjs/components/editgrid/editForm/EditGrid.edit.display.js +5 -2
- package/lib/cjs/components/editgrid/editForm/EditGrid.edit.templates.js +9 -6
- package/lib/cjs/components/email/Email.form.d.ts +3 -6
- package/lib/cjs/components/email/Email.form.js +0 -5
- package/lib/cjs/components/fieldset/Fieldset.form.d.ts +3 -6
- package/lib/cjs/components/fieldset/Fieldset.form.js +0 -5
- package/lib/cjs/components/file/File.d.ts +22 -9
- package/lib/cjs/components/file/File.form.d.ts +3 -6
- package/lib/cjs/components/file/File.form.js +0 -5
- package/lib/cjs/components/form/Form.d.ts +20 -31
- package/lib/cjs/components/form/Form.form.d.ts +3 -6
- package/lib/cjs/components/form/Form.form.js +0 -5
- package/lib/cjs/components/form/Form.js +10 -13
- package/lib/cjs/components/hidden/Hidden.d.ts +11 -1
- package/lib/cjs/components/hidden/Hidden.form.d.ts +3 -6
- package/lib/cjs/components/hidden/Hidden.form.js +0 -5
- package/lib/cjs/components/hidden/Hidden.js +2 -1
- package/lib/cjs/components/html/HTML.d.ts +1 -2
- package/lib/cjs/components/html/HTML.form.d.ts +3 -6
- package/lib/cjs/components/html/HTML.form.js +0 -5
- package/lib/cjs/components/number/Number.d.ts +17 -3
- package/lib/cjs/components/number/Number.form.d.ts +3 -6
- package/lib/cjs/components/number/Number.form.js +0 -5
- package/lib/cjs/components/number/Number.js +2 -1
- package/lib/cjs/components/panel/Panel.form.d.ts +3 -6
- package/lib/cjs/components/panel/Panel.form.js +0 -5
- package/lib/cjs/components/panel/Panel.js +1 -0
- package/lib/cjs/components/password/Password.form.d.ts +3 -6
- package/lib/cjs/components/password/Password.form.js +0 -5
- package/lib/cjs/components/phonenumber/PhoneNumber.form.d.ts +3 -6
- package/lib/cjs/components/phonenumber/PhoneNumber.form.js +0 -5
- package/lib/cjs/components/radio/Radio.d.ts +26 -3
- package/lib/cjs/components/radio/Radio.form.d.ts +3 -6
- package/lib/cjs/components/radio/Radio.form.js +0 -5
- package/lib/cjs/components/radio/Radio.js +4 -3
- package/lib/cjs/components/recaptcha/ReCaptcha.d.ts +1 -1
- package/lib/cjs/components/recaptcha/ReCaptcha.form.d.ts +3 -5
- package/lib/cjs/components/recaptcha/ReCaptcha.form.js +0 -4
- package/lib/cjs/components/select/Select.d.ts +39 -16
- package/lib/cjs/components/select/Select.form.d.ts +3 -6
- package/lib/cjs/components/select/Select.form.js +0 -5
- package/lib/cjs/components/select/Select.js +16 -13
- package/lib/cjs/components/selectboxes/SelectBoxes.d.ts +17 -2
- package/lib/cjs/components/selectboxes/SelectBoxes.form.d.ts +3 -6
- package/lib/cjs/components/selectboxes/SelectBoxes.form.js +0 -5
- package/lib/cjs/components/selectboxes/SelectBoxes.js +9 -7
- package/lib/cjs/components/signature/Signature.d.ts +14 -1
- package/lib/cjs/components/signature/Signature.form.d.ts +3 -6
- package/lib/cjs/components/signature/Signature.form.js +0 -5
- package/lib/cjs/components/survey/Survey.d.ts +15 -3
- package/lib/cjs/components/survey/Survey.form.d.ts +3 -6
- package/lib/cjs/components/survey/Survey.form.js +0 -5
- package/lib/cjs/components/table/Table.d.ts +1 -2
- package/lib/cjs/components/table/Table.form.d.ts +3 -6
- package/lib/cjs/components/table/Table.form.js +0 -5
- package/lib/cjs/components/tabs/Tabs.d.ts +4 -4
- package/lib/cjs/components/tabs/Tabs.form.d.ts +3 -6
- package/lib/cjs/components/tabs/Tabs.form.js +0 -5
- package/lib/cjs/components/tabs/Tabs.js +2 -1
- package/lib/cjs/components/tags/Tags.d.ts +14 -0
- package/lib/cjs/components/tags/Tags.form.d.ts +3 -6
- package/lib/cjs/components/tags/Tags.form.js +0 -5
- package/lib/cjs/components/textarea/TextArea.d.ts +9 -4
- package/lib/cjs/components/textarea/TextArea.form.d.ts +3 -6
- package/lib/cjs/components/textarea/TextArea.form.js +0 -5
- package/lib/cjs/components/textarea/TextArea.js +2 -2
- package/lib/cjs/components/textfield/TextField.d.ts +30 -14
- package/lib/cjs/components/textfield/TextField.form.d.ts +3 -6
- package/lib/cjs/components/textfield/TextField.form.js +0 -5
- package/lib/cjs/components/textfield/TextField.js +16 -13
- package/lib/cjs/components/time/Time.form.d.ts +3 -6
- package/lib/cjs/components/time/Time.form.js +0 -5
- package/lib/cjs/components/unknown/Unknown.form.d.ts +34 -5
- package/lib/cjs/components/unknown/Unknown.form.js +0 -4
- package/lib/cjs/components/url/Url.form.d.ts +3 -6
- package/lib/cjs/components/url/Url.form.js +0 -5
- package/lib/cjs/components/well/Well.form.d.ts +3 -6
- package/lib/cjs/components/well/Well.form.js +0 -5
- package/lib/cjs/formio.embed.d.ts +2 -1
- package/lib/cjs/formio.embed.js +100 -2
- package/lib/cjs/formio.form.d.ts +4 -11
- package/lib/cjs/formio.form.js +5 -13
- package/lib/cjs/providers/Providers.d.ts +5 -36
- package/lib/cjs/providers/Providers.js +0 -29
- package/lib/cjs/providers/address/AddressProvider.d.ts +12 -131
- package/lib/cjs/providers/address/AddressProvider.js +2 -88
- package/lib/cjs/providers/address/AzureAddressProvider.d.ts +1 -48
- package/lib/cjs/providers/address/AzureAddressProvider.js +0 -37
- package/lib/cjs/providers/address/CustomAddressProvider.d.ts +4 -27
- package/lib/cjs/providers/address/CustomAddressProvider.js +0 -34
- package/lib/cjs/providers/address/GoogleAddressProvider.d.ts +6 -130
- package/lib/cjs/providers/address/GoogleAddressProvider.js +0 -72
- package/lib/cjs/providers/address/NominatimAddressProvider.d.ts +7 -32
- package/lib/cjs/providers/address/NominatimAddressProvider.js +0 -33
- package/lib/cjs/providers/address/index.d.ts +1 -3
- package/lib/cjs/providers/processor/fileProcessor.d.ts +1 -7
- package/lib/cjs/providers/processor/fileProcessor.js +0 -6
- package/lib/cjs/providers/storage/azure.d.ts +13 -6
- package/lib/cjs/providers/storage/azure.js +0 -5
- package/lib/cjs/providers/storage/base64.d.ts +6 -5
- package/lib/cjs/providers/storage/base64.js +0 -4
- package/lib/cjs/providers/storage/dropbox.d.ts +4 -6
- package/lib/cjs/providers/storage/dropbox.js +0 -5
- package/lib/cjs/providers/storage/googleDrive.d.ts +5 -7
- package/lib/cjs/providers/storage/googleDrive.js +0 -6
- package/lib/cjs/providers/storage/indexeddb.d.ts +7 -5
- package/lib/cjs/providers/storage/indexeddb.js +0 -4
- package/lib/cjs/providers/storage/s3.d.ts +20 -6
- package/lib/cjs/providers/storage/s3.js +0 -5
- package/lib/cjs/providers/storage/url.d.ts +7 -6
- package/lib/cjs/providers/storage/url.js +0 -10
- package/lib/cjs/providers/storage/util.d.ts +1 -24
- package/lib/cjs/providers/storage/util.js +0 -18
- package/lib/cjs/templates/Templates.d.ts +0 -1
- package/lib/cjs/translations/en.d.ts +1 -0
- package/lib/cjs/translations/en.js +1 -0
- package/lib/cjs/utils/Evaluator.d.ts +3 -6
- package/lib/cjs/utils/Evaluator.js +20 -11
- package/lib/cjs/utils/builder.d.ts +7 -9
- package/lib/cjs/utils/builder.js +5 -10
- package/lib/cjs/utils/calendarUtils.d.ts +13 -7
- package/lib/cjs/utils/calendarUtils.js +17 -10
- package/lib/cjs/utils/formUtils.d.ts +171 -43
- package/lib/cjs/utils/formUtils.js +569 -38
- package/lib/cjs/utils/utils.d.ts +216 -362
- package/lib/cjs/utils/utils.js +224 -331
- package/lib/cjs/widgets/CalendarWidget.d.ts +10 -9
- package/lib/cjs/widgets/CalendarWidget.js +11 -9
- package/lib/mjs/Element.d.ts +96 -86
- package/lib/mjs/Element.js +78 -68
- package/lib/mjs/Form.d.ts +36 -365
- package/lib/mjs/Form.js +57 -140
- package/lib/mjs/FormBuilder.d.ts +2 -187
- package/lib/mjs/FormBuilder.js +8 -32
- package/lib/mjs/PDF.d.ts +13 -11
- package/lib/mjs/PDF.js +8 -6
- package/lib/mjs/Webform.d.ts +139 -180
- package/lib/mjs/Webform.js +310 -325
- package/lib/mjs/WebformBuilder.d.ts +14 -16
- package/lib/mjs/WebformBuilder.js +11 -16
- package/lib/mjs/Wizard.d.ts +21 -31
- package/lib/mjs/Wizard.js +18 -41
- package/lib/mjs/WizardBuilder.d.ts +1 -1
- package/lib/mjs/addons/PasswordStrength/PasswordStrengthAddon.d.ts +5 -8
- package/lib/mjs/addons/PasswordStrength/PasswordStrengthAddon.js +3 -6
- package/lib/mjs/components/Components.d.ts +4 -4
- package/lib/mjs/components/Components.js +3 -3
- package/lib/mjs/components/_classes/component/Component.d.ts +269 -502
- package/lib/mjs/components/_classes/component/Component.form.d.ts +3 -6
- package/lib/mjs/components/_classes/component/Component.form.js +0 -5
- package/lib/mjs/components/_classes/component/Component.js +189 -433
- package/lib/mjs/components/_classes/component/editForm/Component.edit.display.js +8 -0
- package/lib/mjs/components/_classes/component/editForm/Component.edit.validation.js +1 -1
- package/lib/mjs/components/_classes/component/editForm/utils.js +1 -1
- package/lib/mjs/components/_classes/field/Field.d.ts +2 -11
- package/lib/mjs/components/_classes/field/Field.js +1 -13
- package/lib/mjs/components/_classes/input/Input.d.ts +3 -4
- package/lib/mjs/components/_classes/input/Input.js +2 -2
- package/lib/mjs/components/_classes/list/ListComponent.d.ts +2 -2
- package/lib/mjs/components/_classes/list/ListComponent.form.d.ts +3 -6
- package/lib/mjs/components/_classes/list/ListComponent.form.js +0 -5
- package/lib/mjs/components/_classes/multivalue/Multivalue.d.ts +12 -43
- package/lib/mjs/components/_classes/multivalue/Multivalue.js +3 -37
- package/lib/mjs/components/_classes/nested/NestedComponent.d.ts +67 -163
- package/lib/mjs/components/_classes/nested/NestedComponent.form.d.ts +3 -6
- package/lib/mjs/components/_classes/nested/NestedComponent.form.js +0 -5
- package/lib/mjs/components/_classes/nested/NestedComponent.js +54 -175
- package/lib/mjs/components/_classes/nestedarray/NestedArrayComponent.d.ts +2 -2
- package/lib/mjs/components/_classes/nestedarray/NestedArrayComponent.js +1 -1
- package/lib/mjs/components/_classes/nesteddata/NestedDataComponent.d.ts +1 -7
- package/lib/mjs/components/_classes/nesteddata/NestedDataComponent.js +3 -2
- package/lib/mjs/components/address/Address.d.ts +2 -4
- package/lib/mjs/components/address/Address.form.d.ts +3 -6
- package/lib/mjs/components/address/Address.form.js +0 -5
- package/lib/mjs/components/button/Button.d.ts +12 -3
- package/lib/mjs/components/button/Button.form.d.ts +3 -6
- package/lib/mjs/components/button/Button.form.js +0 -5
- package/lib/mjs/components/button/Button.js +0 -5
- package/lib/mjs/components/checkbox/Checkbox.d.ts +27 -4
- package/lib/mjs/components/checkbox/Checkbox.form.d.ts +3 -6
- package/lib/mjs/components/checkbox/Checkbox.form.js +0 -5
- package/lib/mjs/components/columns/Columns.d.ts +2 -3
- package/lib/mjs/components/columns/Columns.form.d.ts +3 -6
- package/lib/mjs/components/columns/Columns.form.js +0 -5
- package/lib/mjs/components/columns/Columns.js +1 -1
- package/lib/mjs/components/container/Container.form.d.ts +3 -6
- package/lib/mjs/components/container/Container.form.js +0 -5
- package/lib/mjs/components/content/Content.d.ts +1 -2
- package/lib/mjs/components/content/Content.form.d.ts +3 -6
- package/lib/mjs/components/content/Content.form.js +0 -5
- package/lib/mjs/components/currency/Currency.form.d.ts +3 -6
- package/lib/mjs/components/currency/Currency.form.js +0 -5
- package/lib/mjs/components/currency/Currency.js +2 -1
- package/lib/mjs/components/datagrid/DataGrid.d.ts +7 -8
- package/lib/mjs/components/datagrid/DataGrid.form.d.ts +3 -6
- package/lib/mjs/components/datagrid/DataGrid.form.js +0 -5
- package/lib/mjs/components/datagrid/DataGrid.js +5 -5
- package/lib/mjs/components/datamap/DataMap.d.ts +0 -1
- package/lib/mjs/components/datamap/DataMap.form.d.ts +3 -6
- package/lib/mjs/components/datamap/DataMap.form.js +0 -5
- package/lib/mjs/components/datetime/DateTime.d.ts +14 -0
- package/lib/mjs/components/datetime/DateTime.form.d.ts +3 -6
- package/lib/mjs/components/datetime/DateTime.form.js +0 -5
- package/lib/mjs/components/datetime/editForm/DateTime.edit.date.js +1 -1
- package/lib/mjs/components/day/Day.d.ts +48 -22
- package/lib/mjs/components/day/Day.form.d.ts +3 -6
- package/lib/mjs/components/day/Day.form.js +0 -5
- package/lib/mjs/components/day/Day.js +20 -15
- package/lib/mjs/components/editgrid/EditGrid.d.ts +3 -7
- package/lib/mjs/components/editgrid/EditGrid.form.d.ts +3 -6
- package/lib/mjs/components/editgrid/EditGrid.form.js +0 -5
- package/lib/mjs/components/editgrid/EditGrid.js +3 -3
- package/lib/mjs/components/editgrid/editForm/EditGrid.edit.display.js +1 -1
- package/lib/mjs/components/editgrid/editForm/EditGrid.edit.templates.js +1 -1
- package/lib/mjs/components/email/Email.form.d.ts +3 -6
- package/lib/mjs/components/email/Email.form.js +0 -5
- package/lib/mjs/components/fieldset/Fieldset.form.d.ts +3 -6
- package/lib/mjs/components/fieldset/Fieldset.form.js +0 -5
- package/lib/mjs/components/file/File.d.ts +22 -9
- package/lib/mjs/components/file/File.form.d.ts +3 -6
- package/lib/mjs/components/file/File.form.js +0 -5
- package/lib/mjs/components/form/Form.d.ts +20 -31
- package/lib/mjs/components/form/Form.form.d.ts +3 -6
- package/lib/mjs/components/form/Form.form.js +0 -5
- package/lib/mjs/components/form/Form.js +10 -13
- package/lib/mjs/components/hidden/Hidden.d.ts +11 -1
- package/lib/mjs/components/hidden/Hidden.form.d.ts +3 -6
- package/lib/mjs/components/hidden/Hidden.form.js +0 -5
- package/lib/mjs/components/hidden/Hidden.js +2 -1
- package/lib/mjs/components/html/HTML.d.ts +1 -2
- package/lib/mjs/components/html/HTML.form.d.ts +3 -6
- package/lib/mjs/components/html/HTML.form.js +0 -5
- package/lib/mjs/components/number/Number.d.ts +17 -3
- package/lib/mjs/components/number/Number.form.d.ts +3 -6
- package/lib/mjs/components/number/Number.form.js +0 -5
- package/lib/mjs/components/number/Number.js +2 -1
- package/lib/mjs/components/panel/Panel.form.d.ts +3 -6
- package/lib/mjs/components/panel/Panel.form.js +0 -5
- package/lib/mjs/components/panel/Panel.js +1 -0
- package/lib/mjs/components/password/Password.form.d.ts +3 -6
- package/lib/mjs/components/password/Password.form.js +0 -5
- package/lib/mjs/components/phonenumber/PhoneNumber.form.d.ts +3 -6
- package/lib/mjs/components/phonenumber/PhoneNumber.form.js +0 -5
- package/lib/mjs/components/radio/Radio.d.ts +26 -3
- package/lib/mjs/components/radio/Radio.form.d.ts +3 -6
- package/lib/mjs/components/radio/Radio.form.js +0 -5
- package/lib/mjs/components/radio/Radio.js +4 -3
- package/lib/mjs/components/recaptcha/ReCaptcha.d.ts +1 -1
- package/lib/mjs/components/recaptcha/ReCaptcha.form.d.ts +3 -5
- package/lib/mjs/components/recaptcha/ReCaptcha.form.js +0 -4
- package/lib/mjs/components/select/Select.d.ts +39 -16
- package/lib/mjs/components/select/Select.form.d.ts +3 -6
- package/lib/mjs/components/select/Select.form.js +0 -5
- package/lib/mjs/components/select/Select.js +16 -13
- package/lib/mjs/components/selectboxes/SelectBoxes.d.ts +17 -2
- package/lib/mjs/components/selectboxes/SelectBoxes.form.d.ts +3 -6
- package/lib/mjs/components/selectboxes/SelectBoxes.form.js +0 -5
- package/lib/mjs/components/selectboxes/SelectBoxes.js +9 -7
- package/lib/mjs/components/signature/Signature.d.ts +14 -1
- package/lib/mjs/components/signature/Signature.form.d.ts +3 -6
- package/lib/mjs/components/signature/Signature.form.js +0 -5
- package/lib/mjs/components/survey/Survey.d.ts +15 -3
- package/lib/mjs/components/survey/Survey.form.d.ts +3 -6
- package/lib/mjs/components/survey/Survey.form.js +0 -5
- package/lib/mjs/components/table/Table.d.ts +1 -2
- package/lib/mjs/components/table/Table.form.d.ts +3 -6
- package/lib/mjs/components/table/Table.form.js +0 -5
- package/lib/mjs/components/tabs/Tabs.d.ts +4 -4
- package/lib/mjs/components/tabs/Tabs.form.d.ts +3 -6
- package/lib/mjs/components/tabs/Tabs.form.js +0 -5
- package/lib/mjs/components/tabs/Tabs.js +2 -1
- package/lib/mjs/components/tags/Tags.d.ts +14 -0
- package/lib/mjs/components/tags/Tags.form.d.ts +3 -6
- package/lib/mjs/components/tags/Tags.form.js +0 -5
- package/lib/mjs/components/textarea/TextArea.d.ts +9 -4
- package/lib/mjs/components/textarea/TextArea.form.d.ts +3 -6
- package/lib/mjs/components/textarea/TextArea.form.js +0 -5
- package/lib/mjs/components/textarea/TextArea.js +2 -2
- package/lib/mjs/components/textfield/TextField.d.ts +30 -14
- package/lib/mjs/components/textfield/TextField.form.d.ts +3 -6
- package/lib/mjs/components/textfield/TextField.form.js +0 -5
- package/lib/mjs/components/textfield/TextField.js +16 -13
- package/lib/mjs/components/time/Time.form.d.ts +3 -6
- package/lib/mjs/components/time/Time.form.js +0 -5
- package/lib/mjs/components/unknown/Unknown.form.d.ts +34 -5
- package/lib/mjs/components/unknown/Unknown.form.js +0 -4
- package/lib/mjs/components/url/Url.form.d.ts +3 -6
- package/lib/mjs/components/url/Url.form.js +0 -5
- package/lib/mjs/components/well/Well.form.d.ts +3 -6
- package/lib/mjs/components/well/Well.form.js +0 -5
- package/lib/mjs/formio.embed.d.ts +2 -1
- package/lib/mjs/formio.embed.js +99 -2
- package/lib/mjs/formio.form.d.ts +4 -11
- package/lib/mjs/formio.form.js +3 -10
- package/lib/mjs/providers/Providers.d.ts +5 -36
- package/lib/mjs/providers/Providers.js +0 -29
- package/lib/mjs/providers/address/AddressProvider.d.ts +12 -131
- package/lib/mjs/providers/address/AddressProvider.js +2 -88
- package/lib/mjs/providers/address/AzureAddressProvider.d.ts +1 -48
- package/lib/mjs/providers/address/AzureAddressProvider.js +0 -37
- package/lib/mjs/providers/address/CustomAddressProvider.d.ts +4 -27
- package/lib/mjs/providers/address/CustomAddressProvider.js +0 -34
- package/lib/mjs/providers/address/GoogleAddressProvider.d.ts +6 -130
- package/lib/mjs/providers/address/GoogleAddressProvider.js +0 -72
- package/lib/mjs/providers/address/NominatimAddressProvider.d.ts +7 -32
- package/lib/mjs/providers/address/NominatimAddressProvider.js +0 -33
- package/lib/mjs/providers/address/index.d.ts +1 -3
- package/lib/mjs/providers/processor/fileProcessor.d.ts +1 -7
- package/lib/mjs/providers/processor/fileProcessor.js +0 -6
- package/lib/mjs/providers/storage/azure.d.ts +13 -6
- package/lib/mjs/providers/storage/azure.js +0 -5
- package/lib/mjs/providers/storage/base64.d.ts +6 -5
- package/lib/mjs/providers/storage/base64.js +0 -4
- package/lib/mjs/providers/storage/dropbox.d.ts +4 -6
- package/lib/mjs/providers/storage/dropbox.js +0 -5
- package/lib/mjs/providers/storage/googleDrive.d.ts +5 -7
- package/lib/mjs/providers/storage/googleDrive.js +0 -6
- package/lib/mjs/providers/storage/indexeddb.d.ts +7 -5
- package/lib/mjs/providers/storage/indexeddb.js +0 -4
- package/lib/mjs/providers/storage/s3.d.ts +20 -6
- package/lib/mjs/providers/storage/s3.js +0 -5
- package/lib/mjs/providers/storage/url.d.ts +7 -6
- package/lib/mjs/providers/storage/url.js +0 -10
- package/lib/mjs/providers/storage/util.d.ts +1 -24
- package/lib/mjs/providers/storage/util.js +0 -18
- package/lib/mjs/templates/Templates.d.ts +0 -1
- package/lib/mjs/translations/en.d.ts +1 -0
- package/lib/mjs/translations/en.js +1 -0
- package/lib/mjs/utils/Evaluator.d.ts +3 -6
- package/lib/mjs/utils/Evaluator.js +20 -9
- package/lib/mjs/utils/builder.d.ts +7 -9
- package/lib/mjs/utils/builder.js +5 -10
- package/lib/mjs/utils/calendarUtils.d.ts +13 -7
- package/lib/mjs/utils/calendarUtils.js +17 -10
- package/lib/mjs/utils/formUtils.d.ts +171 -43
- package/lib/mjs/utils/formUtils.js +554 -6
- package/lib/mjs/utils/utils.d.ts +216 -362
- package/lib/mjs/utils/utils.js +218 -325
- package/lib/mjs/widgets/CalendarWidget.d.ts +10 -9
- package/lib/mjs/widgets/CalendarWidget.js +11 -9
- package/package.json +22 -22
- package/embed.d.ts +0 -1
- package/form.d.ts +0 -1
- package/lib/cjs/InlineEmbed.d.ts +0 -7
- package/lib/cjs/InlineEmbed.js +0 -109
- package/lib/mjs/InlineEmbed.d.ts +0 -7
- package/lib/mjs/InlineEmbed.js +0 -105
- package/sdk.d.ts +0 -1
- package/utils.d.ts +0 -1
package/lib/cjs/formio.embed.js
CHANGED
|
@@ -1,4 +1,102 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
|
|
4
|
-
|
|
3
|
+
exports.Formio = void 0;
|
|
4
|
+
const Embed_1 = require("./Embed");
|
|
5
|
+
Object.defineProperty(exports, "Formio", { enumerable: true, get: function () { return Embed_1.Formio; } });
|
|
6
|
+
const scripts = document.getElementsByTagName('script');
|
|
7
|
+
const config = window.FormioConfig || {};
|
|
8
|
+
let thisScript = null;
|
|
9
|
+
let i = scripts.length;
|
|
10
|
+
const scriptName = config.scriptName || 'formio.embed.';
|
|
11
|
+
while (i--) {
|
|
12
|
+
if (scripts[i].src && (scripts[i].src.indexOf(scriptName) !== -1)) {
|
|
13
|
+
thisScript = scripts[i];
|
|
14
|
+
break;
|
|
15
|
+
}
|
|
16
|
+
}
|
|
17
|
+
if (thisScript) {
|
|
18
|
+
const query = {};
|
|
19
|
+
const queryString = thisScript.src.replace(/^[^?]+\??/, '');
|
|
20
|
+
queryString.replace(/\?/g, '&').split('&').forEach((item) => {
|
|
21
|
+
query[item.split('=')[0]] = item.split('=')[1] && decodeURIComponent(item.split('=')[1]);
|
|
22
|
+
});
|
|
23
|
+
let scriptSrc = thisScript.src.replace(/^([^?]+).*/, '$1').split('/');
|
|
24
|
+
scriptSrc.pop();
|
|
25
|
+
if (config.formioPath) {
|
|
26
|
+
config.formioPath(scriptSrc);
|
|
27
|
+
}
|
|
28
|
+
scriptSrc = scriptSrc.join('/');
|
|
29
|
+
const debug = (query.debug === 'true' || query.debug === '1');
|
|
30
|
+
const renderer = debug ? 'formio.form' : 'formio.form.min';
|
|
31
|
+
Embed_1.Formio.config = Object.assign({
|
|
32
|
+
script: query.script || (`${config.updatePath ? config.updatePath() : scriptSrc}/${renderer}.js`),
|
|
33
|
+
style: query.styles || (`${config.updatePath ? config.updatePath() : scriptSrc}/${renderer}.css`),
|
|
34
|
+
cdn: query.cdn,
|
|
35
|
+
class: (query.class || 'formio-form-wrapper'),
|
|
36
|
+
src: query.src,
|
|
37
|
+
form: null,
|
|
38
|
+
submission: null,
|
|
39
|
+
project: query.project,
|
|
40
|
+
base: query.base || 'https://api.form.io',
|
|
41
|
+
submit: query.submit,
|
|
42
|
+
includeLibs: (query.libs === 'true' || query.libs === '1'),
|
|
43
|
+
template: query.template,
|
|
44
|
+
debug: debug,
|
|
45
|
+
config: {},
|
|
46
|
+
redirect: (query.return || query.redirect),
|
|
47
|
+
embedCSS: (`${config.updatePath ? config.updatePath() : scriptSrc}/formio.embed.css`),
|
|
48
|
+
success: query.success || 'Thank you for your submission!',
|
|
49
|
+
before: null,
|
|
50
|
+
after: null
|
|
51
|
+
}, config);
|
|
52
|
+
const form = (Embed_1.Formio.config.form || Embed_1.Formio.config.src);
|
|
53
|
+
if (form) {
|
|
54
|
+
Embed_1.Formio.debug('Embedding Configuration', config);
|
|
55
|
+
if (Embed_1.Formio.config.addPremiumLib) {
|
|
56
|
+
Embed_1.Formio.config.addPremiumLib(Embed_1.Formio.config, scriptSrc);
|
|
57
|
+
}
|
|
58
|
+
// The id for this embedded form.
|
|
59
|
+
Embed_1.Formio.config.id = `formio-${Math.random().toString(36).substring(7)}`;
|
|
60
|
+
Embed_1.Formio.debug('Creating form element');
|
|
61
|
+
const element = Embed_1.Formio.createElement('div', {
|
|
62
|
+
'id': Embed_1.Formio.config.id,
|
|
63
|
+
class: Embed_1.Formio.config.class
|
|
64
|
+
});
|
|
65
|
+
// insertAfter doesn't exist, but effect is identical.
|
|
66
|
+
thisScript.parentNode.insertBefore(element, thisScript.parentNode.firstElementChild.nextSibling);
|
|
67
|
+
Embed_1.Formio.createForm(element, form, Embed_1.Formio.config.config).then((instance) => {
|
|
68
|
+
if (Embed_1.Formio.config.submit) {
|
|
69
|
+
instance.nosubmit = true;
|
|
70
|
+
}
|
|
71
|
+
// Configure a redirect.
|
|
72
|
+
instance.on('submit', (submission) => {
|
|
73
|
+
Embed_1.Formio.debug("on('submit')", submission);
|
|
74
|
+
if (Embed_1.Formio.config.submit) {
|
|
75
|
+
Embed_1.Formio.debug(`Sending submission to ${Embed_1.Formio.config.submit}`);
|
|
76
|
+
const headers = {
|
|
77
|
+
'content-type': 'application/json'
|
|
78
|
+
};
|
|
79
|
+
const token = Embed_1.Formio.FormioClass.getToken();
|
|
80
|
+
if (token) {
|
|
81
|
+
headers['x-jwt-token'] = token;
|
|
82
|
+
}
|
|
83
|
+
Embed_1.Formio.FormioClass.fetch(Embed_1.Formio.config.submit, {
|
|
84
|
+
body: JSON.stringify(submission),
|
|
85
|
+
headers: headers,
|
|
86
|
+
method: 'POST',
|
|
87
|
+
mode: 'cors',
|
|
88
|
+
})
|
|
89
|
+
.then(resp => resp.json())
|
|
90
|
+
.then(submission => Embed_1.Formio.submitDone(instance, submission));
|
|
91
|
+
}
|
|
92
|
+
else {
|
|
93
|
+
Embed_1.Formio.submitDone(instance, submission);
|
|
94
|
+
}
|
|
95
|
+
});
|
|
96
|
+
});
|
|
97
|
+
}
|
|
98
|
+
}
|
|
99
|
+
else {
|
|
100
|
+
// Show an error if the script cannot be found.
|
|
101
|
+
document.write('<span>Could not locate the Embedded form.</span>');
|
|
102
|
+
}
|
package/lib/cjs/formio.form.d.ts
CHANGED
|
@@ -1,17 +1,10 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Register a module
|
|
3
|
-
* @param {
|
|
4
|
-
* @
|
|
5
|
-
* @param {any} options - Options for the module.
|
|
6
|
-
* @returns {void}
|
|
3
|
+
* @param {*} plugin
|
|
4
|
+
* @returns
|
|
7
5
|
*/
|
|
8
|
-
export function registerModule(mod: any, defaultFn?:
|
|
9
|
-
|
|
10
|
-
* @param {Function|null} defaultFn - The default function to call if the module does not have a known key.
|
|
11
|
-
* @returns {void}
|
|
12
|
-
*/
|
|
13
|
-
export function useModule(defaultFn?: Function | null): void;
|
|
14
|
-
export { Formio as FormioCore } from "./Formio";
|
|
6
|
+
export function registerModule(mod: any, defaultFn?: null, options?: {}): void;
|
|
7
|
+
export function useModule(defaultFn?: null): (plugins: any, options?: {}) => void;
|
|
15
8
|
import Components from './components/Components';
|
|
16
9
|
import Displays from './displays/Displays';
|
|
17
10
|
import Providers from './providers';
|
package/lib/cjs/formio.form.js
CHANGED
|
@@ -3,7 +3,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
3
3
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
4
|
};
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
exports.Webform = exports.EventEmitter = exports.Licenses = exports.Formio = exports.Form = exports.Utils = exports.Templates = exports.Widgets = exports.Providers = exports.Displays = exports.Components = exports.
|
|
6
|
+
exports.Webform = exports.EventEmitter = exports.Licenses = exports.Formio = exports.Form = exports.Utils = exports.Templates = exports.Widgets = exports.Providers = exports.Displays = exports.Components = exports.useModule = exports.registerModule = void 0;
|
|
7
7
|
const lodash_1 = __importDefault(require("lodash"));
|
|
8
8
|
const Formio_1 = require("./Formio");
|
|
9
9
|
Object.defineProperty(exports, "Formio", { enumerable: true, get: function () { return Formio_1.Formio; } });
|
|
@@ -22,7 +22,7 @@ const Form_1 = __importDefault(require("./Form"));
|
|
|
22
22
|
exports.Form = Form_1.default;
|
|
23
23
|
const utils_1 = __importDefault(require("./utils"));
|
|
24
24
|
exports.Utils = utils_1.default;
|
|
25
|
-
const Evaluator_1 = require("./utils/Evaluator");
|
|
25
|
+
const Evaluator_1 = __importDefault(require("./utils/Evaluator"));
|
|
26
26
|
const licenses_1 = __importDefault(require("./licenses"));
|
|
27
27
|
exports.Licenses = licenses_1.default;
|
|
28
28
|
const EventEmitter_1 = __importDefault(require("./EventEmitter"));
|
|
@@ -44,7 +44,7 @@ Formio_1.Formio.Form = Form_1.default;
|
|
|
44
44
|
Formio_1.Formio.Displays = Displays_1.default;
|
|
45
45
|
Formio_1.Formio.Providers = providers_1.default;
|
|
46
46
|
Formio_1.Formio.Widgets = widgets_1.default;
|
|
47
|
-
Formio_1.Formio.Evaluator = Evaluator_1.
|
|
47
|
+
Formio_1.Formio.Evaluator = Evaluator_1.default;
|
|
48
48
|
Formio_1.Formio.AllComponents = components_1.default;
|
|
49
49
|
Formio_1.Formio.Licenses = licenses_1.default;
|
|
50
50
|
// This is strange, but is needed for "premium" components to import correctly.
|
|
@@ -52,10 +52,8 @@ Formio_1.Formio.Formio = Formio_1.Formio;
|
|
|
52
52
|
Formio_1.Formio.Components.setComponents(components_1.default);
|
|
53
53
|
/**
|
|
54
54
|
* Register a module
|
|
55
|
-
* @param {
|
|
56
|
-
* @
|
|
57
|
-
* @param {any} options - Options for the module.
|
|
58
|
-
* @returns {void}
|
|
55
|
+
* @param {*} plugin
|
|
56
|
+
* @returns
|
|
59
57
|
*/
|
|
60
58
|
function registerModule(mod, defaultFn = null, options = {}) {
|
|
61
59
|
if (typeof mod === 'function') {
|
|
@@ -117,10 +115,6 @@ function registerModule(mod, defaultFn = null, options = {}) {
|
|
|
117
115
|
}
|
|
118
116
|
}
|
|
119
117
|
exports.registerModule = registerModule;
|
|
120
|
-
/**
|
|
121
|
-
* @param {Function|null} defaultFn - The default function to call if the module does not have a known key.
|
|
122
|
-
* @returns {void}
|
|
123
|
-
*/
|
|
124
118
|
function useModule(defaultFn = null) {
|
|
125
119
|
return (plugins, options = {}) => {
|
|
126
120
|
plugins = lodash_1.default.isArray(plugins) ? plugins : [plugins];
|
|
@@ -142,5 +136,3 @@ exports.useModule = useModule;
|
|
|
142
136
|
* Formio.plugins([plugin1, plugin2, etc], options);
|
|
143
137
|
*/
|
|
144
138
|
Formio_1.Formio.use = useModule();
|
|
145
|
-
var Formio_2 = require("./Formio");
|
|
146
|
-
Object.defineProperty(exports, "FormioCore", { enumerable: true, get: function () { return Formio_2.Formio; } });
|
|
@@ -1,14 +1,7 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @class Providers
|
|
3
|
-
* @classdesc Represents a collection of providers.
|
|
4
|
-
*/
|
|
5
|
-
/**
|
|
6
|
-
* Represents a collection of providers.
|
|
7
|
-
*/
|
|
8
1
|
export default class Providers {
|
|
9
2
|
static providers: {
|
|
10
3
|
address: {
|
|
11
|
-
[x: string]: typeof import("./address/
|
|
4
|
+
[x: string]: typeof import("./address/CustomAddressProvider").CustomAddressProvider | typeof import("./address/GoogleAddressProvider").GoogleAddressProvider;
|
|
12
5
|
};
|
|
13
6
|
auth: {};
|
|
14
7
|
storage: {
|
|
@@ -20,32 +13,8 @@ export default class Providers {
|
|
|
20
13
|
googledrive: typeof import("./storage/googleDrive").default;
|
|
21
14
|
};
|
|
22
15
|
};
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
* @param {Provider} provider - The provider object.
|
|
28
|
-
*/
|
|
29
|
-
static addProvider(type: string, name: string, provider: Provider): void;
|
|
30
|
-
/**
|
|
31
|
-
* Adds multiple providers to the collection.
|
|
32
|
-
* @param {string} type - The type of the providers.
|
|
33
|
-
* @param {{ [key: string]: Provider }} providers - The collection of providers.
|
|
34
|
-
*/
|
|
35
|
-
static addProviders(type: string, providers: {
|
|
36
|
-
[key: string]: Provider;
|
|
37
|
-
}): void;
|
|
38
|
-
/**
|
|
39
|
-
* Retrives a provider a provider from the collection.
|
|
40
|
-
* @param {string} type - The type of the provider.
|
|
41
|
-
* @param {string} name - The name of the provider.
|
|
42
|
-
* @returns {Provider | void} The provider object.
|
|
43
|
-
*/
|
|
44
|
-
static getProvider(type: string, name: string): Provider | void;
|
|
45
|
-
/**
|
|
46
|
-
* Retrives all providers of a given type.
|
|
47
|
-
* @param {string} type - The type of the providers.
|
|
48
|
-
* @returns {Provider[] | void} The collection of providers.
|
|
49
|
-
*/
|
|
50
|
-
static getProviders(type: string): Provider[] | void;
|
|
16
|
+
static addProvider(type: any, name: any, provider: any): void;
|
|
17
|
+
static addProviders(type: any, providers: any): void;
|
|
18
|
+
static getProvider(type: any, name: any): any;
|
|
19
|
+
static getProviders(type: any): any;
|
|
51
20
|
}
|
|
@@ -7,48 +7,19 @@ const lodash_1 = __importDefault(require("lodash"));
|
|
|
7
7
|
const address_1 = __importDefault(require("./address"));
|
|
8
8
|
const auth_1 = __importDefault(require("./auth"));
|
|
9
9
|
const storage_1 = __importDefault(require("./storage"));
|
|
10
|
-
/**
|
|
11
|
-
* @class Providers
|
|
12
|
-
* @classdesc Represents a collection of providers.
|
|
13
|
-
*/
|
|
14
|
-
/**
|
|
15
|
-
* Represents a collection of providers.
|
|
16
|
-
*/
|
|
17
10
|
class Providers {
|
|
18
|
-
/**
|
|
19
|
-
* Adds a provider to the collection.
|
|
20
|
-
* @param {string} type - The type of the provider.
|
|
21
|
-
* @param {string} name - The name of the provider.
|
|
22
|
-
* @param {Provider} provider - The provider object.
|
|
23
|
-
*/
|
|
24
11
|
static addProvider(type, name, provider) {
|
|
25
12
|
Providers.providers[type] = Providers.providers[type] || {};
|
|
26
13
|
Providers.providers[type][name] = provider;
|
|
27
14
|
}
|
|
28
|
-
/**
|
|
29
|
-
* Adds multiple providers to the collection.
|
|
30
|
-
* @param {string} type - The type of the providers.
|
|
31
|
-
* @param {{ [key: string]: Provider }} providers - The collection of providers.
|
|
32
|
-
*/
|
|
33
15
|
static addProviders(type, providers) {
|
|
34
16
|
Providers.providers[type] = lodash_1.default.merge(Providers.providers[type], providers);
|
|
35
17
|
}
|
|
36
|
-
/**
|
|
37
|
-
* Retrives a provider a provider from the collection.
|
|
38
|
-
* @param {string} type - The type of the provider.
|
|
39
|
-
* @param {string} name - The name of the provider.
|
|
40
|
-
* @returns {Provider | void} The provider object.
|
|
41
|
-
*/
|
|
42
18
|
static getProvider(type, name) {
|
|
43
19
|
if (Providers.providers[type] && Providers.providers[type][name]) {
|
|
44
20
|
return Providers.providers[type][name];
|
|
45
21
|
}
|
|
46
22
|
}
|
|
47
|
-
/**
|
|
48
|
-
* Retrives all providers of a given type.
|
|
49
|
-
* @param {string} type - The type of the providers.
|
|
50
|
-
* @returns {Provider[] | void} The collection of providers.
|
|
51
|
-
*/
|
|
52
23
|
static getProviders(type) {
|
|
53
24
|
if (Providers.providers[type]) {
|
|
54
25
|
return Providers.providers[type];
|
|
@@ -1,136 +1,17 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @typedef {object} RequestOptions
|
|
3
|
-
* @property {object} params - The request parameters.
|
|
4
|
-
* @property {boolean} noToken - Whether to include a token in the request.
|
|
5
|
-
*/
|
|
6
|
-
/**
|
|
7
|
-
* @typedef {object} Address
|
|
8
|
-
* @property {string} street - The street address.
|
|
9
|
-
* @property {string} city - The city.
|
|
10
|
-
* @property {string} state - The state.
|
|
11
|
-
* @property {string} country - The country.
|
|
12
|
-
* @property {string} postalCode - The postal code.
|
|
13
|
-
*/
|
|
14
|
-
/**
|
|
15
|
-
* @class AddressProvider
|
|
16
|
-
* @classdesc Represents an address provider.
|
|
17
|
-
*/
|
|
18
1
|
export class AddressProvider {
|
|
19
|
-
/**
|
|
20
|
-
* @static
|
|
21
|
-
* @type {string}
|
|
22
|
-
* @description The name of the address provider.
|
|
23
|
-
*/
|
|
24
2
|
static get name(): string;
|
|
25
|
-
/**
|
|
26
|
-
* @static
|
|
27
|
-
* @type {string}
|
|
28
|
-
* @description The display name of the address provider.
|
|
29
|
-
*/
|
|
30
3
|
static get displayName(): string;
|
|
31
|
-
|
|
32
|
-
* @class
|
|
33
|
-
* @param {object} options - The options for the address provider.
|
|
34
|
-
*/
|
|
35
|
-
constructor(options?: object);
|
|
4
|
+
constructor(options?: {});
|
|
36
5
|
options: any;
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
/**
|
|
49
|
-
* @private
|
|
50
|
-
* @type {string}
|
|
51
|
-
* @description The query property name.
|
|
52
|
-
*/
|
|
53
|
-
private get queryProperty();
|
|
54
|
-
/**
|
|
55
|
-
* @private
|
|
56
|
-
* @type {string|null}
|
|
57
|
-
* @description The response property name.
|
|
58
|
-
*/
|
|
59
|
-
private get responseProperty();
|
|
60
|
-
/**
|
|
61
|
-
* @private
|
|
62
|
-
* @type {string|null}
|
|
63
|
-
* @description The display value property name.
|
|
64
|
-
*/
|
|
65
|
-
private get displayValueProperty();
|
|
66
|
-
/**
|
|
67
|
-
* @private
|
|
68
|
-
* @param {object} params - The parameters to serialize.
|
|
69
|
-
* @returns {string} The serialized parameters.
|
|
70
|
-
*/
|
|
71
|
-
private serialize;
|
|
72
|
-
/**
|
|
73
|
-
* @private
|
|
74
|
-
* @param {object} options - The request options.
|
|
75
|
-
* @returns {RequestOptions} The merged request options.
|
|
76
|
-
*/
|
|
77
|
-
private getRequestOptions;
|
|
78
|
-
/**
|
|
79
|
-
* @private
|
|
80
|
-
* @param {object} _options - The request options.
|
|
81
|
-
* @throws {Error} Throws an error if the method is not implemented.
|
|
82
|
-
*/
|
|
83
|
-
private getRequestUrl;
|
|
84
|
-
/**
|
|
85
|
-
* @private
|
|
86
|
-
* @param {object} options - The request options.
|
|
87
|
-
* @returns {Promise} A promise that resolves with the request result.
|
|
88
|
-
*/
|
|
89
|
-
private makeRequest;
|
|
90
|
-
/**
|
|
91
|
-
* @public
|
|
92
|
-
* @description The search parameters for the request.
|
|
93
|
-
* @param {string} query - The search query.
|
|
94
|
-
* @param {object} options - The search options.
|
|
95
|
-
* @returns {Promise<Address[]>} A promise that resolves with the search results.
|
|
96
|
-
*/
|
|
97
|
-
public search(query: string, options?: object): Promise<Address[]>;
|
|
98
|
-
/**
|
|
99
|
-
* @public
|
|
100
|
-
* @param {Address} address - The address object.
|
|
101
|
-
* @returns {string} The display value of the address.
|
|
102
|
-
*/
|
|
103
|
-
public getDisplayValue(address: Address): string;
|
|
6
|
+
beforeMergeOptions(): void;
|
|
7
|
+
get defaultOptions(): {};
|
|
8
|
+
get queryProperty(): string;
|
|
9
|
+
get responseProperty(): null;
|
|
10
|
+
get displayValueProperty(): null;
|
|
11
|
+
serialize(params: any): any;
|
|
12
|
+
getRequestOptions(options?: {}): any;
|
|
13
|
+
getRequestUrl(options?: {}): void;
|
|
14
|
+
makeRequest(options?: {}): any;
|
|
15
|
+
search(query: any, options?: {}): any;
|
|
16
|
+
getDisplayValue(address: any): any;
|
|
104
17
|
}
|
|
105
|
-
export type RequestOptions = {
|
|
106
|
-
/**
|
|
107
|
-
* - The request parameters.
|
|
108
|
-
*/
|
|
109
|
-
params: object;
|
|
110
|
-
/**
|
|
111
|
-
* - Whether to include a token in the request.
|
|
112
|
-
*/
|
|
113
|
-
noToken: boolean;
|
|
114
|
-
};
|
|
115
|
-
export type Address = {
|
|
116
|
-
/**
|
|
117
|
-
* - The street address.
|
|
118
|
-
*/
|
|
119
|
-
street: string;
|
|
120
|
-
/**
|
|
121
|
-
* - The city.
|
|
122
|
-
*/
|
|
123
|
-
city: string;
|
|
124
|
-
/**
|
|
125
|
-
* - The state.
|
|
126
|
-
*/
|
|
127
|
-
state: string;
|
|
128
|
-
/**
|
|
129
|
-
* - The country.
|
|
130
|
-
*/
|
|
131
|
-
country: string;
|
|
132
|
-
/**
|
|
133
|
-
* - The postal code.
|
|
134
|
-
*/
|
|
135
|
-
postalCode: string;
|
|
136
|
-
};
|
|
@@ -6,128 +6,47 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
6
6
|
exports.AddressProvider = void 0;
|
|
7
7
|
const lodash_1 = __importDefault(require("lodash"));
|
|
8
8
|
const Formio_1 = require("../../Formio");
|
|
9
|
-
/**
|
|
10
|
-
* @typedef {object} RequestOptions
|
|
11
|
-
* @property {object} params - The request parameters.
|
|
12
|
-
* @property {boolean} noToken - Whether to include a token in the request.
|
|
13
|
-
*/
|
|
14
|
-
/**
|
|
15
|
-
* @typedef {object} Address
|
|
16
|
-
* @property {string} street - The street address.
|
|
17
|
-
* @property {string} city - The city.
|
|
18
|
-
* @property {string} state - The state.
|
|
19
|
-
* @property {string} country - The country.
|
|
20
|
-
* @property {string} postalCode - The postal code.
|
|
21
|
-
*/
|
|
22
|
-
/**
|
|
23
|
-
* @class AddressProvider
|
|
24
|
-
* @classdesc Represents an address provider.
|
|
25
|
-
*/
|
|
26
9
|
class AddressProvider {
|
|
27
|
-
/**
|
|
28
|
-
* @static
|
|
29
|
-
* @type {string}
|
|
30
|
-
* @description The name of the address provider.
|
|
31
|
-
*/
|
|
32
10
|
static get name() {
|
|
33
11
|
return 'address';
|
|
34
12
|
}
|
|
35
|
-
/**
|
|
36
|
-
* @static
|
|
37
|
-
* @type {string}
|
|
38
|
-
* @description The display name of the address provider.
|
|
39
|
-
*/
|
|
40
13
|
static get displayName() {
|
|
41
14
|
return 'Address';
|
|
42
15
|
}
|
|
43
|
-
/**
|
|
44
|
-
* @class
|
|
45
|
-
* @param {object} options - The options for the address provider.
|
|
46
|
-
*/
|
|
47
16
|
constructor(options = {}) {
|
|
48
17
|
this.beforeMergeOptions(options);
|
|
49
18
|
this.options = lodash_1.default.merge({}, this.defaultOptions, options);
|
|
50
19
|
}
|
|
51
|
-
/**
|
|
52
|
-
* @private
|
|
53
|
-
* @description Executes before merging the options.
|
|
54
|
-
*/
|
|
55
20
|
beforeMergeOptions() {
|
|
56
21
|
return;
|
|
57
22
|
}
|
|
58
|
-
/**
|
|
59
|
-
* @private
|
|
60
|
-
* @type {object}
|
|
61
|
-
* @description The default options for the address provider.
|
|
62
|
-
*/
|
|
63
23
|
get defaultOptions() {
|
|
64
24
|
return {};
|
|
65
25
|
}
|
|
66
|
-
/**
|
|
67
|
-
* @private
|
|
68
|
-
* @type {string}
|
|
69
|
-
* @description The query property name.
|
|
70
|
-
*/
|
|
71
26
|
get queryProperty() {
|
|
72
27
|
return 'query';
|
|
73
28
|
}
|
|
74
|
-
/**
|
|
75
|
-
* @private
|
|
76
|
-
* @type {string|null}
|
|
77
|
-
* @description The response property name.
|
|
78
|
-
*/
|
|
79
29
|
get responseProperty() {
|
|
80
30
|
return null;
|
|
81
31
|
}
|
|
82
|
-
/**
|
|
83
|
-
* @private
|
|
84
|
-
* @type {string|null}
|
|
85
|
-
* @description The display value property name.
|
|
86
|
-
*/
|
|
87
32
|
get displayValueProperty() {
|
|
88
33
|
return null;
|
|
89
34
|
}
|
|
90
|
-
/**
|
|
91
|
-
* @private
|
|
92
|
-
* @param {object} params - The parameters to serialize.
|
|
93
|
-
* @returns {string} The serialized parameters.
|
|
94
|
-
*/
|
|
95
35
|
serialize(params) {
|
|
96
36
|
return lodash_1.default.toPairs(params).map(([key, value]) => `${encodeURIComponent(key)}=${encodeURIComponent(value)}`).join('&');
|
|
97
37
|
}
|
|
98
|
-
/**
|
|
99
|
-
* @private
|
|
100
|
-
* @param {object} options - The request options.
|
|
101
|
-
* @returns {RequestOptions} The merged request options.
|
|
102
|
-
*/
|
|
103
38
|
getRequestOptions(options = {}) {
|
|
104
39
|
return lodash_1.default.merge({}, this.options, options);
|
|
105
40
|
}
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
* @param {object} _options - The request options.
|
|
109
|
-
* @throws {Error} Throws an error if the method is not implemented.
|
|
110
|
-
*/
|
|
111
|
-
getRequestUrl(_options = {}) {
|
|
41
|
+
// eslint-disable-next-line no-unused-vars
|
|
42
|
+
getRequestUrl(options = {}) {
|
|
112
43
|
throw new Error('Method AddressProvider#getRequestUrl(options) is abstract.');
|
|
113
44
|
}
|
|
114
|
-
/**
|
|
115
|
-
* @private
|
|
116
|
-
* @param {object} options - The request options.
|
|
117
|
-
* @returns {Promise} A promise that resolves with the request result.
|
|
118
|
-
*/
|
|
119
45
|
makeRequest(options = {}) {
|
|
120
46
|
return Formio_1.Formio.makeStaticRequest(this.getRequestUrl(options), 'GET', null, {
|
|
121
47
|
noToken: true,
|
|
122
48
|
});
|
|
123
49
|
}
|
|
124
|
-
/**
|
|
125
|
-
* @public
|
|
126
|
-
* @description The search parameters for the request.
|
|
127
|
-
* @param {string} query - The search query.
|
|
128
|
-
* @param {object} options - The search options.
|
|
129
|
-
* @returns {Promise<Address[]>} A promise that resolves with the search results.
|
|
130
|
-
*/
|
|
131
50
|
search(query, options = {}) {
|
|
132
51
|
const requestOptions = this.getRequestOptions(options);
|
|
133
52
|
const params = requestOptions.params = requestOptions.params || {};
|
|
@@ -135,11 +54,6 @@ class AddressProvider {
|
|
|
135
54
|
return this.makeRequest(requestOptions)
|
|
136
55
|
.then((result) => this.responseProperty ? lodash_1.default.get(result, this.responseProperty, []) : result);
|
|
137
56
|
}
|
|
138
|
-
/**
|
|
139
|
-
* @public
|
|
140
|
-
* @param {Address} address - The address object.
|
|
141
|
-
* @returns {string} The display value of the address.
|
|
142
|
-
*/
|
|
143
57
|
getDisplayValue(address) {
|
|
144
58
|
return this.displayValueProperty ? lodash_1.default.get(address, this.displayValueProperty, '') : String(address);
|
|
145
59
|
}
|
|
@@ -1,59 +1,12 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @typedef {object} AzureAddressProviderOptionsParams
|
|
3
|
-
* @property {string} 'api-version' - The version of the Azure Maps API.
|
|
4
|
-
* @property {string} typeahead - Whether to enable typeahead in the search.
|
|
5
|
-
* @typedef {object} AzureAddressProviderOptions
|
|
6
|
-
* @property {AzureAddressProviderOptionsParams} params - The parameters for the Azure Maps API request.
|
|
7
|
-
*/
|
|
8
|
-
/**
|
|
9
|
-
* @class
|
|
10
|
-
* @augments AddressProvider
|
|
11
|
-
* @classdesc Represents an Azure Maps address provider.
|
|
12
|
-
*/
|
|
13
1
|
export class AzureAddressProvider extends AddressProvider {
|
|
14
|
-
/**
|
|
15
|
-
* Gets the default options for the address provider.
|
|
16
|
-
* @returns {{ params: { 'api-version': string, typeahead: string } }} The default options.
|
|
17
|
-
*/
|
|
18
2
|
get defaultOptions(): {
|
|
19
3
|
params: {
|
|
20
4
|
'api-version': string;
|
|
21
5
|
typeahead: string;
|
|
22
6
|
};
|
|
23
7
|
};
|
|
24
|
-
/**
|
|
25
|
-
* Gets the response property for the address provider.
|
|
26
|
-
* @type {string}
|
|
27
|
-
*/
|
|
28
8
|
get responseProperty(): string;
|
|
29
|
-
/**
|
|
30
|
-
* Gets the display value property for the address provider.
|
|
31
|
-
* @type {string}
|
|
32
|
-
*/
|
|
33
9
|
get displayValueProperty(): string;
|
|
34
|
-
|
|
35
|
-
* Gets the request URL for the address provider.
|
|
36
|
-
* @param {{params: any}} options - The request options.
|
|
37
|
-
* @returns {string} The request URL.
|
|
38
|
-
*/
|
|
39
|
-
getRequestUrl(options?: {
|
|
40
|
-
params: any;
|
|
41
|
-
}): string;
|
|
10
|
+
getRequestUrl(options?: {}): string;
|
|
42
11
|
}
|
|
43
|
-
export type AzureAddressProviderOptionsParams = {
|
|
44
|
-
/**
|
|
45
|
-
* 'api-version' - The version of the Azure Maps API.
|
|
46
|
-
*/
|
|
47
|
-
"": string;
|
|
48
|
-
/**
|
|
49
|
-
* - Whether to enable typeahead in the search.
|
|
50
|
-
*/
|
|
51
|
-
typeahead: string;
|
|
52
|
-
};
|
|
53
|
-
export type AzureAddressProviderOptions = {
|
|
54
|
-
/**
|
|
55
|
-
* - The parameters for the Azure Maps API request.
|
|
56
|
-
*/
|
|
57
|
-
params: AzureAddressProviderOptionsParams;
|
|
58
|
-
};
|
|
59
12
|
import { AddressProvider } from './AddressProvider';
|