@formio/js 5.0.0-dev.5613.3476921 → 5.0.0-dev.5614.b5c93f3
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 +73 -4
- package/dist/formio.builder.css +8 -13
- 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 -13
- package/dist/formio.form.js +803 -1226
- 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 -3
- package/dist/formio.full.css +8 -13
- package/dist/formio.full.js +722 -941
- 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 -3
- 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 +1853 -466
- package/dist/formio.utils.min.js +1 -1
- package/dist/formio.utils.min.js.LICENSE.txt +10 -2
- 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 +87 -98
- package/lib/cjs/Element.js +76 -95
- 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 -75
- package/lib/cjs/FormBuilder.d.ts +187 -2
- package/lib/cjs/FormBuilder.js +30 -8
- package/lib/cjs/Formio.js +12 -0
- 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 +7 -16
- package/lib/cjs/PDFBuilder.js +3 -3
- package/lib/cjs/Webform.d.ts +193 -140
- package/lib/cjs/Webform.js +341 -306
- package/lib/cjs/WebformBuilder.d.ts +18 -15
- package/lib/cjs/WebformBuilder.js +34 -27
- package/lib/cjs/Wizard.d.ts +31 -21
- package/lib/cjs/Wizard.js +44 -21
- package/lib/cjs/WizardBuilder.d.ts +1 -1
- package/lib/cjs/addons/FormioAddon.d.ts +0 -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 +516 -270
- 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 +470 -246
- package/lib/cjs/components/_classes/component/editForm/Component.edit.display.js +1 -1
- 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/comp7.d.ts +84 -0
- package/lib/cjs/components/_classes/component/fixtures/comp7.js +86 -0
- package/lib/cjs/components/_classes/component/fixtures/index.d.ts +3 -1
- package/lib/cjs/components/_classes/component/fixtures/index.js +5 -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 +32 -23
- 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 +44 -3
- package/lib/cjs/components/_classes/nested/NestedComponent.d.ts +164 -68
- 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 +182 -62
- 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/address/Address.js +4 -0
- package/lib/cjs/components/address/editForm/Address.edit.provider.js +1 -1
- package/lib/cjs/components/button/Button.d.ts +4 -13
- 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 +12 -7
- package/lib/cjs/components/checkbox/Checkbox.d.ts +5 -28
- 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/checkbox/Checkbox.js +1 -1
- package/lib/cjs/components/checkbox/fixtures/comp6.d.ts +32 -0
- package/lib/cjs/components/checkbox/fixtures/comp6.js +30 -0
- package/lib/cjs/components/checkbox/fixtures/index.d.ts +2 -1
- package/lib/cjs/components/checkbox/fixtures/index.js +3 -1
- 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 +3 -3
- 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 +17 -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 +55 -37
- 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/comp-with-reorder.d.ts +100 -0
- package/lib/cjs/components/datagrid/fixtures/comp-with-reorder.js +139 -0
- package/lib/cjs/components/datagrid/fixtures/comp10.d.ts +81 -0
- package/lib/cjs/components/datagrid/fixtures/comp10.js +87 -0
- package/lib/cjs/components/datagrid/fixtures/comp9.d.ts +41 -0
- package/lib/cjs/components/datagrid/fixtures/comp9.js +44 -0
- package/lib/cjs/components/datagrid/fixtures/index.d.ts +5 -1
- package/lib/cjs/components/datagrid/fixtures/index.js +9 -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/comp8.d.ts +41 -0
- package/lib/cjs/components/day/fixtures/comp8.js +40 -0
- package/lib/cjs/components/day/fixtures/index.d.ts +3 -1
- package/lib/cjs/components/day/fixtures/index.js +5 -1
- package/lib/cjs/components/editgrid/EditGrid.d.ts +8 -4
- 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 +12 -26
- 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 -23
- 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 +3 -4
- package/lib/cjs/components/form/Form.d.ts +38 -20
- 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 +33 -20
- 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 +2 -3
- package/lib/cjs/components/number/fixtures/comp8.d.ts +32 -0
- package/lib/cjs/components/number/fixtures/comp8.js +28 -0
- package/lib/cjs/components/number/fixtures/index.d.ts +2 -1
- package/lib/cjs/components/number/fixtures/index.js +3 -1
- 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/phonenumber/fixtures/comp2.d.ts +16 -0
- package/lib/cjs/components/phonenumber/fixtures/comp2.js +25 -0
- package/lib/cjs/components/phonenumber/fixtures/index.d.ts +2 -1
- package/lib/cjs/components/phonenumber/fixtures/index.js +3 -1
- package/lib/cjs/components/radio/Radio.d.ts +4 -27
- 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 +11 -9
- package/lib/cjs/components/recaptcha/ReCaptcha.d.ts +2 -9
- package/lib/cjs/components/recaptcha/ReCaptcha.form.d.ts +6 -3
- package/lib/cjs/components/recaptcha/ReCaptcha.form.js +7 -2
- package/lib/cjs/components/recaptcha/ReCaptcha.js +1 -8
- package/lib/cjs/components/recaptcha/editForm/ReCaptcha.edit.display.d.ts +33 -2
- package/lib/cjs/components/recaptcha/editForm/ReCaptcha.edit.display.js +13 -2
- 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 +23 -24
- package/lib/cjs/components/select/editForm/Select.edit.data.js +16 -2
- package/lib/cjs/components/select/fixtures/comp22.js +1 -1
- package/lib/cjs/components/select/fixtures/comp23.d.ts +58 -0
- package/lib/cjs/components/select/fixtures/comp23.js +49 -0
- package/lib/cjs/components/select/fixtures/comp24.d.ts +47 -0
- package/lib/cjs/components/select/fixtures/comp24.js +40 -0
- package/lib/cjs/components/select/fixtures/index.d.ts +3 -1
- package/lib/cjs/components/select/fixtures/index.js +5 -1
- 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 +11 -10
- 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/signature/Signature.js +1 -1
- 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 +3 -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/table/Table.js +1 -1
- 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/tags/Tags.js +2 -4
- 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 +135 -6
- package/lib/cjs/providers/address/GoogleAddressProvider.js +95 -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 +5 -0
- package/lib/cjs/translations/en.js +6 -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/conditionOperators/IsEmptyValue.js +4 -3
- package/lib/cjs/utils/conditionOperators/IsEqualTo.js +3 -3
- 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 -218
- package/lib/cjs/utils/utils.js +420 -252
- package/lib/cjs/widgets/CalendarWidget.d.ts +9 -10
- package/lib/cjs/widgets/CalendarWidget.js +11 -13
- package/lib/mjs/CDN.d.ts +1 -0
- package/lib/mjs/CDN.js +6 -3
- package/lib/mjs/Element.d.ts +87 -98
- package/lib/mjs/Element.js +76 -95
- 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 -68
- package/lib/mjs/FormBuilder.d.ts +187 -2
- package/lib/mjs/FormBuilder.js +32 -8
- package/lib/mjs/Formio.js +12 -0
- 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 +7 -16
- package/lib/mjs/PDFBuilder.js +3 -3
- package/lib/mjs/Webform.d.ts +193 -140
- package/lib/mjs/Webform.js +353 -318
- package/lib/mjs/WebformBuilder.d.ts +18 -15
- package/lib/mjs/WebformBuilder.js +34 -27
- package/lib/mjs/Wizard.d.ts +31 -21
- package/lib/mjs/Wizard.js +43 -20
- package/lib/mjs/WizardBuilder.d.ts +1 -1
- package/lib/mjs/addons/FormioAddon.d.ts +0 -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 +516 -270
- 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 +479 -247
- package/lib/mjs/components/_classes/component/editForm/Component.edit.display.js +1 -1
- 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/comp7.d.ts +84 -0
- package/lib/mjs/components/_classes/component/fixtures/comp7.js +84 -0
- package/lib/mjs/components/_classes/component/fixtures/index.d.ts +3 -1
- package/lib/mjs/components/_classes/component/fixtures/index.js +3 -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 +31 -23
- 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 +44 -3
- package/lib/mjs/components/_classes/nested/NestedComponent.d.ts +164 -68
- 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 +182 -62
- 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/address/Address.js +4 -0
- package/lib/mjs/components/address/editForm/Address.edit.provider.js +1 -1
- package/lib/mjs/components/button/Button.d.ts +4 -13
- 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 +12 -7
- package/lib/mjs/components/checkbox/Checkbox.d.ts +5 -28
- 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/checkbox/Checkbox.js +1 -1
- package/lib/mjs/components/checkbox/fixtures/comp6.d.ts +32 -0
- package/lib/mjs/components/checkbox/fixtures/comp6.js +28 -0
- package/lib/mjs/components/checkbox/fixtures/index.d.ts +2 -1
- package/lib/mjs/components/checkbox/fixtures/index.js +2 -1
- 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 +3 -3
- 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 +17 -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 +55 -37
- 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/comp-with-reorder.d.ts +100 -0
- package/lib/mjs/components/datagrid/fixtures/comp-with-reorder.js +137 -0
- package/lib/mjs/components/datagrid/fixtures/comp10.d.ts +81 -0
- package/lib/mjs/components/datagrid/fixtures/comp10.js +85 -0
- package/lib/mjs/components/datagrid/fixtures/comp9.d.ts +41 -0
- package/lib/mjs/components/datagrid/fixtures/comp9.js +42 -0
- package/lib/mjs/components/datagrid/fixtures/index.d.ts +5 -1
- package/lib/mjs/components/datagrid/fixtures/index.js +5 -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/comp8.d.ts +41 -0
- package/lib/mjs/components/day/fixtures/comp8.js +38 -0
- package/lib/mjs/components/day/fixtures/index.d.ts +3 -1
- package/lib/mjs/components/day/fixtures/index.js +3 -1
- package/lib/mjs/components/editgrid/EditGrid.d.ts +8 -4
- 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 +12 -25
- 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 -23
- 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 +3 -4
- package/lib/mjs/components/form/Form.d.ts +38 -20
- 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 +31 -18
- 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 +2 -3
- package/lib/mjs/components/number/fixtures/comp8.d.ts +32 -0
- package/lib/mjs/components/number/fixtures/comp8.js +26 -0
- package/lib/mjs/components/number/fixtures/index.d.ts +2 -1
- package/lib/mjs/components/number/fixtures/index.js +2 -1
- 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/phonenumber/fixtures/comp2.d.ts +16 -0
- package/lib/mjs/components/phonenumber/fixtures/comp2.js +23 -0
- package/lib/mjs/components/phonenumber/fixtures/index.d.ts +2 -1
- package/lib/mjs/components/phonenumber/fixtures/index.js +2 -1
- package/lib/mjs/components/radio/Radio.d.ts +4 -27
- 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 +11 -9
- package/lib/mjs/components/recaptcha/ReCaptcha.d.ts +2 -9
- package/lib/mjs/components/recaptcha/ReCaptcha.form.d.ts +6 -3
- package/lib/mjs/components/recaptcha/ReCaptcha.form.js +7 -2
- package/lib/mjs/components/recaptcha/ReCaptcha.js +1 -8
- package/lib/mjs/components/recaptcha/editForm/ReCaptcha.edit.display.d.ts +33 -2
- package/lib/mjs/components/recaptcha/editForm/ReCaptcha.edit.display.js +13 -2
- 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 +24 -25
- package/lib/mjs/components/select/editForm/Select.edit.data.js +16 -2
- package/lib/mjs/components/select/fixtures/comp22.js +1 -1
- package/lib/mjs/components/select/fixtures/comp23.d.ts +58 -0
- package/lib/mjs/components/select/fixtures/comp23.js +47 -0
- package/lib/mjs/components/select/fixtures/comp24.d.ts +47 -0
- package/lib/mjs/components/select/fixtures/comp24.js +38 -0
- package/lib/mjs/components/select/fixtures/index.d.ts +3 -1
- package/lib/mjs/components/select/fixtures/index.js +3 -1
- 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 +11 -10
- 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/signature/Signature.js +1 -1
- 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 +3 -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/table/Table.js +1 -1
- 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/tags/Tags.js +2 -4
- 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 +135 -6
- package/lib/mjs/providers/address/GoogleAddressProvider.js +94 -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 +5 -0
- package/lib/mjs/translations/en.js +6 -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/conditionOperators/IsEmptyValue.js +3 -3
- package/lib/mjs/utils/conditionOperators/IsEqualTo.js +1 -1
- 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 -218
- package/lib/mjs/utils/utils.js +409 -233
- package/lib/mjs/widgets/CalendarWidget.d.ts +9 -10
- package/lib/mjs/widgets/CalendarWidget.js +11 -13
- package/package.json +22 -23
- package/sdk.d.ts +1 -0
- package/utils.d.ts +1 -0
|
@@ -1,2 +1 @@
|
|
|
1
|
-
export {
|
|
2
|
-
import { Formio } from './Embed';
|
|
1
|
+
export {};
|
package/lib/mjs/formio.embed.js
CHANGED
|
@@ -1,99 +1,2 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
3
|
-
const config = window.FormioConfig || {};
|
|
4
|
-
let thisScript = null;
|
|
5
|
-
let i = scripts.length;
|
|
6
|
-
const scriptName = config.scriptName || 'formio.embed.';
|
|
7
|
-
while (i--) {
|
|
8
|
-
if (scripts[i].src && (scripts[i].src.indexOf(scriptName) !== -1)) {
|
|
9
|
-
thisScript = scripts[i];
|
|
10
|
-
break;
|
|
11
|
-
}
|
|
12
|
-
}
|
|
13
|
-
if (thisScript) {
|
|
14
|
-
const query = {};
|
|
15
|
-
const queryString = thisScript.src.replace(/^[^?]+\??/, '');
|
|
16
|
-
queryString.replace(/\?/g, '&').split('&').forEach((item) => {
|
|
17
|
-
query[item.split('=')[0]] = item.split('=')[1] && decodeURIComponent(item.split('=')[1]);
|
|
18
|
-
});
|
|
19
|
-
let scriptSrc = thisScript.src.replace(/^([^?]+).*/, '$1').split('/');
|
|
20
|
-
scriptSrc.pop();
|
|
21
|
-
if (config.formioPath) {
|
|
22
|
-
config.formioPath(scriptSrc);
|
|
23
|
-
}
|
|
24
|
-
scriptSrc = scriptSrc.join('/');
|
|
25
|
-
const debug = (query.debug === 'true' || query.debug === '1');
|
|
26
|
-
const renderer = debug ? 'formio.form' : 'formio.form.min';
|
|
27
|
-
Formio.config = Object.assign({
|
|
28
|
-
script: query.script || (`${config.updatePath ? config.updatePath() : scriptSrc}/${renderer}.js`),
|
|
29
|
-
style: query.styles || (`${config.updatePath ? config.updatePath() : scriptSrc}/${renderer}.css`),
|
|
30
|
-
cdn: query.cdn,
|
|
31
|
-
class: (query.class || 'formio-form-wrapper'),
|
|
32
|
-
src: query.src,
|
|
33
|
-
form: null,
|
|
34
|
-
submission: null,
|
|
35
|
-
project: query.project,
|
|
36
|
-
base: query.base || 'https://api.form.io',
|
|
37
|
-
submit: query.submit,
|
|
38
|
-
includeLibs: (query.libs === 'true' || query.libs === '1'),
|
|
39
|
-
template: query.template,
|
|
40
|
-
debug: debug,
|
|
41
|
-
config: {},
|
|
42
|
-
redirect: (query.return || query.redirect),
|
|
43
|
-
embedCSS: (`${config.updatePath ? config.updatePath() : scriptSrc}/formio.embed.css`),
|
|
44
|
-
success: query.success || 'Thank you for your submission!',
|
|
45
|
-
before: null,
|
|
46
|
-
after: null
|
|
47
|
-
}, config);
|
|
48
|
-
const form = (Formio.config.form || Formio.config.src);
|
|
49
|
-
if (form) {
|
|
50
|
-
Formio.debug('Embedding Configuration', config);
|
|
51
|
-
if (Formio.config.addPremiumLib) {
|
|
52
|
-
Formio.config.addPremiumLib(Formio.config, scriptSrc);
|
|
53
|
-
}
|
|
54
|
-
// The id for this embedded form.
|
|
55
|
-
Formio.config.id = `formio-${Math.random().toString(36).substring(7)}`;
|
|
56
|
-
Formio.debug('Creating form element');
|
|
57
|
-
const element = Formio.createElement('div', {
|
|
58
|
-
'id': Formio.config.id,
|
|
59
|
-
class: Formio.config.class
|
|
60
|
-
});
|
|
61
|
-
// insertAfter doesn't exist, but effect is identical.
|
|
62
|
-
thisScript.parentNode.insertBefore(element, thisScript.parentNode.firstElementChild.nextSibling);
|
|
63
|
-
Formio.createForm(element, form, Formio.config.config).then((instance) => {
|
|
64
|
-
if (Formio.config.submit) {
|
|
65
|
-
instance.nosubmit = true;
|
|
66
|
-
}
|
|
67
|
-
// Configure a redirect.
|
|
68
|
-
instance.on('submit', (submission) => {
|
|
69
|
-
Formio.debug("on('submit')", submission);
|
|
70
|
-
if (Formio.config.submit) {
|
|
71
|
-
Formio.debug(`Sending submission to ${Formio.config.submit}`);
|
|
72
|
-
const headers = {
|
|
73
|
-
'content-type': 'application/json'
|
|
74
|
-
};
|
|
75
|
-
const token = Formio.FormioClass.getToken();
|
|
76
|
-
if (token) {
|
|
77
|
-
headers['x-jwt-token'] = token;
|
|
78
|
-
}
|
|
79
|
-
Formio.FormioClass.fetch(Formio.config.submit, {
|
|
80
|
-
body: JSON.stringify(submission),
|
|
81
|
-
headers: headers,
|
|
82
|
-
method: 'POST',
|
|
83
|
-
mode: 'cors',
|
|
84
|
-
})
|
|
85
|
-
.then(resp => resp.json())
|
|
86
|
-
.then(submission => Formio.submitDone(instance, submission));
|
|
87
|
-
}
|
|
88
|
-
else {
|
|
89
|
-
Formio.submitDone(instance, submission);
|
|
90
|
-
}
|
|
91
|
-
});
|
|
92
|
-
});
|
|
93
|
-
}
|
|
94
|
-
}
|
|
95
|
-
else {
|
|
96
|
-
// Show an error if the script cannot be found.
|
|
97
|
-
document.write('<span>Could not locate the Embedded form.</span>');
|
|
98
|
-
}
|
|
99
|
-
export { Formio };
|
|
1
|
+
import { embed } from './InlineEmbed';
|
|
2
|
+
embed();
|
package/lib/mjs/formio.form.d.ts
CHANGED
|
@@ -1,10 +1,17 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Register a module
|
|
3
|
-
* @param {
|
|
4
|
-
* @
|
|
3
|
+
* @param {any} mod - The module object to register. This can also be a function which accepts Formio as an argument.
|
|
4
|
+
* @param {Function|null} [defaultFn] - The default function to call if the module does not have a known key.
|
|
5
|
+
* @param {any} options - Options for the module.
|
|
6
|
+
* @returns {void}
|
|
5
7
|
*/
|
|
6
|
-
export function registerModule(mod: any, defaultFn?: null, options?:
|
|
7
|
-
|
|
8
|
+
export function registerModule(mod: any, defaultFn?: Function | null | undefined, options?: any): void;
|
|
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";
|
|
8
15
|
import Components from './components/Components';
|
|
9
16
|
import Displays from './displays/Displays';
|
|
10
17
|
import Providers from './providers';
|
package/lib/mjs/formio.form.js
CHANGED
|
@@ -8,7 +8,7 @@ import Providers from './providers';
|
|
|
8
8
|
import Widgets from './widgets';
|
|
9
9
|
import Form from './Form';
|
|
10
10
|
import Utils from './utils';
|
|
11
|
-
import Evaluator from './utils/Evaluator';
|
|
11
|
+
import { Evaluator } from './utils/Evaluator';
|
|
12
12
|
import Licenses from './licenses';
|
|
13
13
|
import EventEmitter from './EventEmitter';
|
|
14
14
|
import Webform from './Webform';
|
|
@@ -35,8 +35,10 @@ Formio.Formio = Formio;
|
|
|
35
35
|
Formio.Components.setComponents(AllComponents);
|
|
36
36
|
/**
|
|
37
37
|
* Register a module
|
|
38
|
-
* @param {
|
|
39
|
-
* @
|
|
38
|
+
* @param {any} mod - The module object to register. This can also be a function which accepts Formio as an argument.
|
|
39
|
+
* @param {Function|null} [defaultFn] - The default function to call if the module does not have a known key.
|
|
40
|
+
* @param {any} options - Options for the module.
|
|
41
|
+
* @returns {void}
|
|
40
42
|
*/
|
|
41
43
|
export function registerModule(mod, defaultFn = null, options = {}) {
|
|
42
44
|
if (typeof mod === 'function') {
|
|
@@ -97,6 +99,10 @@ export function registerModule(mod, defaultFn = null, options = {}) {
|
|
|
97
99
|
}
|
|
98
100
|
}
|
|
99
101
|
}
|
|
102
|
+
/**
|
|
103
|
+
* @param {Function|null} defaultFn - The default function to call if the module does not have a known key.
|
|
104
|
+
* @returns {void}
|
|
105
|
+
*/
|
|
100
106
|
export function useModule(defaultFn = null) {
|
|
101
107
|
return (plugins, options = {}) => {
|
|
102
108
|
plugins = _.isArray(plugins) ? plugins : [plugins];
|
|
@@ -117,5 +123,6 @@ export function useModule(defaultFn = null) {
|
|
|
117
123
|
* Formio.plugins([plugin1, plugin2, etc], options);
|
|
118
124
|
*/
|
|
119
125
|
Formio.use = useModule();
|
|
126
|
+
export { Formio as FormioCore } from './Formio';
|
|
120
127
|
// Export the components.
|
|
121
128
|
export { Components, Displays, Providers, Widgets, Templates, Utils, Form, Formio, Licenses, EventEmitter, Webform };
|
|
@@ -1,7 +1,14 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @class Providers
|
|
3
|
+
* @classdesc Represents a collection of providers.
|
|
4
|
+
*/
|
|
5
|
+
/**
|
|
6
|
+
* Represents a collection of providers.
|
|
7
|
+
*/
|
|
1
8
|
export default class Providers {
|
|
2
9
|
static providers: {
|
|
3
10
|
address: {
|
|
4
|
-
[x: string]: typeof import("./address/CustomAddressProvider").CustomAddressProvider | typeof import("./address/GoogleAddressProvider").GoogleAddressProvider;
|
|
11
|
+
[x: string]: typeof import("./address/AzureAddressProvider").AzureAddressProvider | typeof import("./address/CustomAddressProvider").CustomAddressProvider | typeof import("./address/GoogleAddressProvider").GoogleAddressProvider | typeof import("./address/NominatimAddressProvider").NominatimAddressProvider;
|
|
5
12
|
};
|
|
6
13
|
auth: {};
|
|
7
14
|
storage: {
|
|
@@ -13,8 +20,32 @@ export default class Providers {
|
|
|
13
20
|
googledrive: typeof import("./storage/googleDrive").default;
|
|
14
21
|
};
|
|
15
22
|
};
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
23
|
+
/**
|
|
24
|
+
* Adds a provider to the collection.
|
|
25
|
+
* @param {string} type - The type of the provider.
|
|
26
|
+
* @param {string} name - The name of the provider.
|
|
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;
|
|
20
51
|
}
|
|
@@ -2,24 +2,53 @@ import _ from 'lodash';
|
|
|
2
2
|
import address from './address';
|
|
3
3
|
import auth from './auth';
|
|
4
4
|
import storage from './storage';
|
|
5
|
+
/**
|
|
6
|
+
* @class Providers
|
|
7
|
+
* @classdesc Represents a collection of providers.
|
|
8
|
+
*/
|
|
9
|
+
/**
|
|
10
|
+
* Represents a collection of providers.
|
|
11
|
+
*/
|
|
5
12
|
export default class Providers {
|
|
6
13
|
static providers = {
|
|
7
14
|
address,
|
|
8
15
|
auth,
|
|
9
16
|
storage,
|
|
10
17
|
};
|
|
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
|
+
*/
|
|
11
24
|
static addProvider(type, name, provider) {
|
|
12
25
|
Providers.providers[type] = Providers.providers[type] || {};
|
|
13
26
|
Providers.providers[type][name] = provider;
|
|
14
27
|
}
|
|
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
|
+
*/
|
|
15
33
|
static addProviders(type, providers) {
|
|
16
34
|
Providers.providers[type] = _.merge(Providers.providers[type], providers);
|
|
17
35
|
}
|
|
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
|
+
*/
|
|
18
42
|
static getProvider(type, name) {
|
|
19
43
|
if (Providers.providers[type] && Providers.providers[type][name]) {
|
|
20
44
|
return Providers.providers[type][name];
|
|
21
45
|
}
|
|
22
46
|
}
|
|
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
|
+
*/
|
|
23
52
|
static getProviders(type) {
|
|
24
53
|
if (Providers.providers[type]) {
|
|
25
54
|
return Providers.providers[type];
|
|
@@ -1,17 +1,136 @@
|
|
|
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
|
+
*/
|
|
1
18
|
export class AddressProvider {
|
|
19
|
+
/**
|
|
20
|
+
* @static
|
|
21
|
+
* @type {string}
|
|
22
|
+
* @description The name of the address provider.
|
|
23
|
+
*/
|
|
2
24
|
static get name(): string;
|
|
25
|
+
/**
|
|
26
|
+
* @static
|
|
27
|
+
* @type {string}
|
|
28
|
+
* @description The display name of the address provider.
|
|
29
|
+
*/
|
|
3
30
|
static get displayName(): string;
|
|
4
|
-
|
|
31
|
+
/**
|
|
32
|
+
* @class
|
|
33
|
+
* @param {object} options - The options for the address provider.
|
|
34
|
+
*/
|
|
35
|
+
constructor(options?: object);
|
|
5
36
|
options: any;
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
37
|
+
/**
|
|
38
|
+
* @private
|
|
39
|
+
* @description Executes before merging the options.
|
|
40
|
+
*/
|
|
41
|
+
private beforeMergeOptions;
|
|
42
|
+
/**
|
|
43
|
+
* @private
|
|
44
|
+
* @type {object}
|
|
45
|
+
* @description The default options for the address provider.
|
|
46
|
+
*/
|
|
47
|
+
private get defaultOptions();
|
|
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;
|
|
17
104
|
}
|
|
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
|
+
};
|
|
@@ -1,46 +1,127 @@
|
|
|
1
1
|
import _ from 'lodash';
|
|
2
2
|
import { Formio } from '../../Formio';
|
|
3
|
+
/**
|
|
4
|
+
* @typedef {object} RequestOptions
|
|
5
|
+
* @property {object} params - The request parameters.
|
|
6
|
+
* @property {boolean} noToken - Whether to include a token in the request.
|
|
7
|
+
*/
|
|
8
|
+
/**
|
|
9
|
+
* @typedef {object} Address
|
|
10
|
+
* @property {string} street - The street address.
|
|
11
|
+
* @property {string} city - The city.
|
|
12
|
+
* @property {string} state - The state.
|
|
13
|
+
* @property {string} country - The country.
|
|
14
|
+
* @property {string} postalCode - The postal code.
|
|
15
|
+
*/
|
|
16
|
+
/**
|
|
17
|
+
* @class AddressProvider
|
|
18
|
+
* @classdesc Represents an address provider.
|
|
19
|
+
*/
|
|
3
20
|
export class AddressProvider {
|
|
21
|
+
/**
|
|
22
|
+
* @static
|
|
23
|
+
* @type {string}
|
|
24
|
+
* @description The name of the address provider.
|
|
25
|
+
*/
|
|
4
26
|
static get name() {
|
|
5
27
|
return 'address';
|
|
6
28
|
}
|
|
29
|
+
/**
|
|
30
|
+
* @static
|
|
31
|
+
* @type {string}
|
|
32
|
+
* @description The display name of the address provider.
|
|
33
|
+
*/
|
|
7
34
|
static get displayName() {
|
|
8
35
|
return 'Address';
|
|
9
36
|
}
|
|
37
|
+
/**
|
|
38
|
+
* @class
|
|
39
|
+
* @param {object} options - The options for the address provider.
|
|
40
|
+
*/
|
|
10
41
|
constructor(options = {}) {
|
|
11
42
|
this.beforeMergeOptions(options);
|
|
12
43
|
this.options = _.merge({}, this.defaultOptions, options);
|
|
13
44
|
}
|
|
45
|
+
/**
|
|
46
|
+
* @private
|
|
47
|
+
* @description Executes before merging the options.
|
|
48
|
+
*/
|
|
14
49
|
beforeMergeOptions() {
|
|
15
50
|
return;
|
|
16
51
|
}
|
|
52
|
+
/**
|
|
53
|
+
* @private
|
|
54
|
+
* @type {object}
|
|
55
|
+
* @description The default options for the address provider.
|
|
56
|
+
*/
|
|
17
57
|
get defaultOptions() {
|
|
18
58
|
return {};
|
|
19
59
|
}
|
|
60
|
+
/**
|
|
61
|
+
* @private
|
|
62
|
+
* @type {string}
|
|
63
|
+
* @description The query property name.
|
|
64
|
+
*/
|
|
20
65
|
get queryProperty() {
|
|
21
66
|
return 'query';
|
|
22
67
|
}
|
|
68
|
+
/**
|
|
69
|
+
* @private
|
|
70
|
+
* @type {string|null}
|
|
71
|
+
* @description The response property name.
|
|
72
|
+
*/
|
|
23
73
|
get responseProperty() {
|
|
24
74
|
return null;
|
|
25
75
|
}
|
|
76
|
+
/**
|
|
77
|
+
* @private
|
|
78
|
+
* @type {string|null}
|
|
79
|
+
* @description The display value property name.
|
|
80
|
+
*/
|
|
26
81
|
get displayValueProperty() {
|
|
27
82
|
return null;
|
|
28
83
|
}
|
|
84
|
+
/**
|
|
85
|
+
* @private
|
|
86
|
+
* @param {object} params - The parameters to serialize.
|
|
87
|
+
* @returns {string} The serialized parameters.
|
|
88
|
+
*/
|
|
29
89
|
serialize(params) {
|
|
30
90
|
return _.toPairs(params).map(([key, value]) => `${encodeURIComponent(key)}=${encodeURIComponent(value)}`).join('&');
|
|
31
91
|
}
|
|
92
|
+
/**
|
|
93
|
+
* @private
|
|
94
|
+
* @param {object} options - The request options.
|
|
95
|
+
* @returns {RequestOptions} The merged request options.
|
|
96
|
+
*/
|
|
32
97
|
getRequestOptions(options = {}) {
|
|
33
98
|
return _.merge({}, this.options, options);
|
|
34
99
|
}
|
|
35
|
-
|
|
36
|
-
|
|
100
|
+
/**
|
|
101
|
+
* @private
|
|
102
|
+
* @param {object} _options - The request options.
|
|
103
|
+
* @throws {Error} Throws an error if the method is not implemented.
|
|
104
|
+
*/
|
|
105
|
+
getRequestUrl(_options = {}) {
|
|
37
106
|
throw new Error('Method AddressProvider#getRequestUrl(options) is abstract.');
|
|
38
107
|
}
|
|
108
|
+
/**
|
|
109
|
+
* @private
|
|
110
|
+
* @param {object} options - The request options.
|
|
111
|
+
* @returns {Promise} A promise that resolves with the request result.
|
|
112
|
+
*/
|
|
39
113
|
makeRequest(options = {}) {
|
|
40
114
|
return Formio.makeStaticRequest(this.getRequestUrl(options), 'GET', null, {
|
|
41
115
|
noToken: true,
|
|
42
116
|
});
|
|
43
117
|
}
|
|
118
|
+
/**
|
|
119
|
+
* @public
|
|
120
|
+
* @description The search parameters for the request.
|
|
121
|
+
* @param {string} query - The search query.
|
|
122
|
+
* @param {object} options - The search options.
|
|
123
|
+
* @returns {Promise<Address[]>} A promise that resolves with the search results.
|
|
124
|
+
*/
|
|
44
125
|
search(query, options = {}) {
|
|
45
126
|
const requestOptions = this.getRequestOptions(options);
|
|
46
127
|
const params = requestOptions.params = requestOptions.params || {};
|
|
@@ -48,6 +129,11 @@ export class AddressProvider {
|
|
|
48
129
|
return this.makeRequest(requestOptions)
|
|
49
130
|
.then((result) => this.responseProperty ? _.get(result, this.responseProperty, []) : result);
|
|
50
131
|
}
|
|
132
|
+
/**
|
|
133
|
+
* @public
|
|
134
|
+
* @param {Address} address - The address object.
|
|
135
|
+
* @returns {string} The display value of the address.
|
|
136
|
+
*/
|
|
51
137
|
getDisplayValue(address) {
|
|
52
138
|
return this.displayValueProperty ? _.get(address, this.displayValueProperty, '') : String(address);
|
|
53
139
|
}
|
|
@@ -1,12 +1,59 @@
|
|
|
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
|
+
*/
|
|
1
13
|
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
|
+
*/
|
|
2
18
|
get defaultOptions(): {
|
|
3
19
|
params: {
|
|
4
20
|
'api-version': string;
|
|
5
21
|
typeahead: string;
|
|
6
22
|
};
|
|
7
23
|
};
|
|
24
|
+
/**
|
|
25
|
+
* Gets the response property for the address provider.
|
|
26
|
+
* @type {string}
|
|
27
|
+
*/
|
|
8
28
|
get responseProperty(): string;
|
|
29
|
+
/**
|
|
30
|
+
* Gets the display value property for the address provider.
|
|
31
|
+
* @type {string}
|
|
32
|
+
*/
|
|
9
33
|
get displayValueProperty(): string;
|
|
10
|
-
|
|
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;
|
|
11
42
|
}
|
|
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
|
+
};
|
|
12
59
|
import { AddressProvider } from './AddressProvider';
|
|
@@ -1,11 +1,35 @@
|
|
|
1
1
|
import { AddressProvider } from './AddressProvider';
|
|
2
|
+
/**
|
|
3
|
+
* @typedef {object} AzureAddressProviderOptionsParams
|
|
4
|
+
* @property {string} 'api-version' - The version of the Azure Maps API.
|
|
5
|
+
* @property {string} typeahead - Whether to enable typeahead in the search.
|
|
6
|
+
* @typedef {object} AzureAddressProviderOptions
|
|
7
|
+
* @property {AzureAddressProviderOptionsParams} params - The parameters for the Azure Maps API request.
|
|
8
|
+
*/
|
|
9
|
+
/**
|
|
10
|
+
* @class
|
|
11
|
+
* @augments AddressProvider
|
|
12
|
+
* @classdesc Represents an Azure Maps address provider.
|
|
13
|
+
*/
|
|
2
14
|
export class AzureAddressProvider extends AddressProvider {
|
|
15
|
+
/**
|
|
16
|
+
* Gets the name of the address provider.
|
|
17
|
+
* @type {string}
|
|
18
|
+
*/
|
|
3
19
|
static get name() {
|
|
4
20
|
return 'azure';
|
|
5
21
|
}
|
|
22
|
+
/**
|
|
23
|
+
* Gets the display name of the address provider.
|
|
24
|
+
* @type {string}
|
|
25
|
+
*/
|
|
6
26
|
static get displayName() {
|
|
7
27
|
return 'Azure Maps';
|
|
8
28
|
}
|
|
29
|
+
/**
|
|
30
|
+
* Gets the default options for the address provider.
|
|
31
|
+
* @returns {{ params: { 'api-version': string, typeahead: string } }} The default options.
|
|
32
|
+
*/
|
|
9
33
|
get defaultOptions() {
|
|
10
34
|
return {
|
|
11
35
|
params: {
|
|
@@ -14,12 +38,25 @@ export class AzureAddressProvider extends AddressProvider {
|
|
|
14
38
|
},
|
|
15
39
|
};
|
|
16
40
|
}
|
|
41
|
+
/**
|
|
42
|
+
* Gets the response property for the address provider.
|
|
43
|
+
* @type {string}
|
|
44
|
+
*/
|
|
17
45
|
get responseProperty() {
|
|
18
46
|
return 'results';
|
|
19
47
|
}
|
|
48
|
+
/**
|
|
49
|
+
* Gets the display value property for the address provider.
|
|
50
|
+
* @type {string}
|
|
51
|
+
*/
|
|
20
52
|
get displayValueProperty() {
|
|
21
53
|
return 'address.freeformAddress';
|
|
22
54
|
}
|
|
55
|
+
/**
|
|
56
|
+
* Gets the request URL for the address provider.
|
|
57
|
+
* @param {{params: any}} options - The request options.
|
|
58
|
+
* @returns {string} The request URL.
|
|
59
|
+
*/
|
|
23
60
|
getRequestUrl(options = {}) {
|
|
24
61
|
const { params } = options;
|
|
25
62
|
return `https://atlas.microsoft.com/search/address/json?${this.serialize(params)}`;
|