@formio/js 5.0.0-dev.5633.8d2b30d → 5.0.0-dev.5633.fde3bc9
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/Changelog.md +47 -2
- package/dist/formio.builder.css +8 -8
- package/dist/formio.builder.min.css +1 -1
- package/dist/formio.embed.js +1 -1
- package/dist/formio.embed.min.js +1 -1
- package/dist/formio.embed.min.js.LICENSE.txt +1 -1
- package/dist/formio.form.css +8 -8
- package/dist/formio.form.js +615 -1196
- package/dist/formio.form.min.css +1 -1
- package/dist/formio.form.min.js +1 -1
- package/dist/formio.form.min.js.LICENSE.txt +3 -5
- package/dist/formio.full.css +8 -8
- package/dist/formio.full.js +659 -920
- package/dist/formio.full.min.css +1 -1
- package/dist/formio.full.min.js +1 -1
- package/dist/formio.full.min.js.LICENSE.txt +3 -5
- package/dist/formio.js +18 -18
- package/dist/formio.min.js +1 -1
- package/dist/formio.min.js.LICENSE.txt +1 -1
- package/dist/formio.utils.js +1829 -492
- package/dist/formio.utils.min.js +1 -1
- package/dist/formio.utils.min.js.LICENSE.txt +10 -4
- package/embed.d.ts +1 -0
- package/form.d.ts +1 -0
- package/lib/cjs/CDN.d.ts +1 -0
- package/lib/cjs/CDN.js +6 -3
- package/lib/cjs/Element.d.ts +86 -96
- package/lib/cjs/Element.js +68 -78
- package/lib/cjs/Embed.d.ts +1 -1
- package/lib/cjs/Embed.js +52 -12
- package/lib/cjs/Form.d.ts +365 -36
- package/lib/cjs/Form.js +50 -64
- package/lib/cjs/FormBuilder.d.ts +187 -2
- package/lib/cjs/FormBuilder.js +30 -8
- package/lib/cjs/InlineEmbed.d.ts +7 -0
- package/lib/cjs/InlineEmbed.js +116 -0
- package/lib/cjs/PDF.d.ts +11 -13
- package/lib/cjs/PDF.js +6 -8
- package/lib/cjs/Webform.d.ts +183 -143
- package/lib/cjs/Webform.js +310 -298
- package/lib/cjs/WebformBuilder.d.ts +16 -14
- package/lib/cjs/WebformBuilder.js +11 -10
- package/lib/cjs/Wizard.d.ts +31 -21
- package/lib/cjs/Wizard.js +43 -20
- package/lib/cjs/WizardBuilder.d.ts +1 -1
- package/lib/cjs/addons/PasswordStrength/PasswordStrengthAddon.d.ts +8 -5
- package/lib/cjs/addons/PasswordStrength/PasswordStrengthAddon.js +6 -3
- package/lib/cjs/components/Components.d.ts +4 -4
- package/lib/cjs/components/Components.js +3 -3
- package/lib/cjs/components/_classes/component/Component.d.ts +507 -276
- package/lib/cjs/components/_classes/component/Component.form.d.ts +6 -3
- package/lib/cjs/components/_classes/component/Component.form.js +5 -0
- package/lib/cjs/components/_classes/component/Component.js +438 -196
- package/lib/cjs/components/_classes/component/editForm/Component.edit.display.js +0 -8
- package/lib/cjs/components/_classes/component/editForm/Component.edit.validation.js +2 -2
- package/lib/cjs/components/_classes/component/editForm/utils.js +2 -2
- package/lib/cjs/components/_classes/component/fixtures/comp6.d.ts +77 -0
- package/lib/cjs/components/_classes/component/fixtures/comp6.js +59 -0
- package/lib/cjs/components/_classes/component/fixtures/index.d.ts +2 -1
- package/lib/cjs/components/_classes/component/fixtures/index.js +3 -1
- package/lib/cjs/components/_classes/field/Field.d.ts +11 -2
- package/lib/cjs/components/_classes/field/Field.js +13 -1
- package/lib/cjs/components/_classes/input/Input.d.ts +4 -3
- package/lib/cjs/components/_classes/input/Input.js +8 -6
- package/lib/cjs/components/_classes/list/ListComponent.d.ts +2 -2
- package/lib/cjs/components/_classes/list/ListComponent.form.d.ts +6 -3
- package/lib/cjs/components/_classes/list/ListComponent.form.js +5 -0
- package/lib/cjs/components/_classes/multivalue/Multivalue.d.ts +43 -12
- package/lib/cjs/components/_classes/multivalue/Multivalue.js +37 -3
- package/lib/cjs/components/_classes/nested/NestedComponent.d.ts +163 -67
- package/lib/cjs/components/_classes/nested/NestedComponent.form.d.ts +6 -3
- package/lib/cjs/components/_classes/nested/NestedComponent.form.js +5 -0
- package/lib/cjs/components/_classes/nested/NestedComponent.js +175 -54
- package/lib/cjs/components/_classes/nestedarray/NestedArrayComponent.d.ts +2 -2
- package/lib/cjs/components/_classes/nestedarray/NestedArrayComponent.js +1 -1
- package/lib/cjs/components/_classes/nesteddata/NestedDataComponent.d.ts +7 -1
- package/lib/cjs/components/_classes/nesteddata/NestedDataComponent.js +2 -3
- package/lib/cjs/components/address/Address.d.ts +4 -2
- package/lib/cjs/components/address/Address.form.d.ts +6 -3
- package/lib/cjs/components/address/Address.form.js +5 -0
- package/lib/cjs/components/button/Button.d.ts +3 -12
- package/lib/cjs/components/button/Button.form.d.ts +6 -3
- package/lib/cjs/components/button/Button.form.js +5 -0
- package/lib/cjs/components/button/Button.js +5 -0
- package/lib/cjs/components/checkbox/Checkbox.d.ts +4 -27
- package/lib/cjs/components/checkbox/Checkbox.form.d.ts +6 -3
- package/lib/cjs/components/checkbox/Checkbox.form.js +5 -0
- package/lib/cjs/components/columns/Columns.d.ts +3 -2
- package/lib/cjs/components/columns/Columns.form.d.ts +6 -3
- package/lib/cjs/components/columns/Columns.form.js +5 -0
- package/lib/cjs/components/columns/Columns.js +1 -1
- package/lib/cjs/components/container/Container.form.d.ts +6 -3
- package/lib/cjs/components/container/Container.form.js +5 -0
- package/lib/cjs/components/content/Content.d.ts +2 -1
- package/lib/cjs/components/content/Content.form.d.ts +6 -3
- package/lib/cjs/components/content/Content.form.js +5 -0
- package/lib/cjs/components/currency/Currency.form.d.ts +6 -3
- package/lib/cjs/components/currency/Currency.form.js +5 -0
- package/lib/cjs/components/currency/Currency.js +1 -2
- package/lib/cjs/components/datagrid/DataGrid.d.ts +8 -7
- package/lib/cjs/components/datagrid/DataGrid.form.d.ts +6 -3
- package/lib/cjs/components/datagrid/DataGrid.form.js +5 -0
- package/lib/cjs/components/datagrid/DataGrid.js +5 -5
- package/lib/cjs/components/datagrid/fixtures/comp-with-checkboxes.d.ts +29 -0
- package/lib/cjs/components/datagrid/fixtures/comp-with-checkboxes.js +36 -0
- package/lib/cjs/components/datagrid/fixtures/index.d.ts +2 -1
- package/lib/cjs/components/datagrid/fixtures/index.js +3 -1
- package/lib/cjs/components/datamap/DataMap.d.ts +1 -0
- package/lib/cjs/components/datamap/DataMap.form.d.ts +6 -3
- package/lib/cjs/components/datamap/DataMap.form.js +5 -0
- package/lib/cjs/components/datetime/DateTime.d.ts +0 -14
- package/lib/cjs/components/datetime/DateTime.form.d.ts +6 -3
- package/lib/cjs/components/datetime/DateTime.form.js +5 -0
- package/lib/cjs/components/datetime/editForm/DateTime.edit.date.js +2 -2
- package/lib/cjs/components/day/Day.d.ts +23 -49
- package/lib/cjs/components/day/Day.form.d.ts +6 -3
- package/lib/cjs/components/day/Day.form.js +5 -0
- package/lib/cjs/components/day/Day.js +16 -21
- package/lib/cjs/components/day/fixtures/comp7.d.ts +109 -0
- package/lib/cjs/components/day/fixtures/comp7.js +109 -0
- package/lib/cjs/components/day/fixtures/index.d.ts +2 -1
- package/lib/cjs/components/day/fixtures/index.js +3 -1
- package/lib/cjs/components/editgrid/EditGrid.d.ts +7 -3
- package/lib/cjs/components/editgrid/EditGrid.form.d.ts +6 -3
- package/lib/cjs/components/editgrid/EditGrid.form.js +5 -0
- package/lib/cjs/components/editgrid/EditGrid.js +3 -3
- package/lib/cjs/components/editgrid/editForm/EditGrid.edit.display.js +2 -5
- package/lib/cjs/components/editgrid/editForm/EditGrid.edit.templates.js +6 -9
- package/lib/cjs/components/email/Email.form.d.ts +6 -3
- package/lib/cjs/components/email/Email.form.js +5 -0
- package/lib/cjs/components/fieldset/Fieldset.form.d.ts +6 -3
- package/lib/cjs/components/fieldset/Fieldset.form.js +5 -0
- package/lib/cjs/components/file/File.d.ts +9 -22
- package/lib/cjs/components/file/File.form.d.ts +6 -3
- package/lib/cjs/components/file/File.form.js +5 -0
- package/lib/cjs/components/file/File.js +1 -2
- package/lib/cjs/components/form/Form.d.ts +34 -24
- package/lib/cjs/components/form/Form.form.d.ts +6 -3
- package/lib/cjs/components/form/Form.form.js +5 -0
- package/lib/cjs/components/form/Form.js +15 -13
- package/lib/cjs/components/hidden/Hidden.d.ts +1 -11
- package/lib/cjs/components/hidden/Hidden.form.d.ts +6 -3
- package/lib/cjs/components/hidden/Hidden.form.js +5 -0
- package/lib/cjs/components/hidden/Hidden.js +1 -2
- package/lib/cjs/components/html/HTML.d.ts +2 -1
- package/lib/cjs/components/html/HTML.form.d.ts +6 -3
- package/lib/cjs/components/html/HTML.form.js +5 -0
- package/lib/cjs/components/number/Number.d.ts +3 -17
- package/lib/cjs/components/number/Number.form.d.ts +6 -3
- package/lib/cjs/components/number/Number.form.js +5 -0
- package/lib/cjs/components/number/Number.js +1 -2
- package/lib/cjs/components/panel/Panel.form.d.ts +6 -3
- package/lib/cjs/components/panel/Panel.form.js +5 -0
- package/lib/cjs/components/panel/Panel.js +0 -1
- package/lib/cjs/components/password/Password.form.d.ts +6 -3
- package/lib/cjs/components/password/Password.form.js +5 -0
- package/lib/cjs/components/phonenumber/PhoneNumber.form.d.ts +6 -3
- package/lib/cjs/components/phonenumber/PhoneNumber.form.js +5 -0
- package/lib/cjs/components/radio/Radio.d.ts +3 -26
- package/lib/cjs/components/radio/Radio.form.d.ts +6 -3
- package/lib/cjs/components/radio/Radio.form.js +5 -0
- package/lib/cjs/components/radio/Radio.js +6 -6
- package/lib/cjs/components/recaptcha/ReCaptcha.d.ts +1 -1
- package/lib/cjs/components/recaptcha/ReCaptcha.form.d.ts +6 -3
- package/lib/cjs/components/recaptcha/ReCaptcha.form.js +5 -0
- package/lib/cjs/components/select/Select.d.ts +16 -39
- package/lib/cjs/components/select/Select.form.d.ts +6 -3
- package/lib/cjs/components/select/Select.form.js +5 -0
- package/lib/cjs/components/select/Select.js +13 -16
- package/lib/cjs/components/selectboxes/SelectBoxes.d.ts +2 -17
- package/lib/cjs/components/selectboxes/SelectBoxes.form.d.ts +6 -3
- package/lib/cjs/components/selectboxes/SelectBoxes.form.js +5 -0
- package/lib/cjs/components/selectboxes/SelectBoxes.js +7 -9
- package/lib/cjs/components/signature/Signature.d.ts +0 -14
- package/lib/cjs/components/signature/Signature.form.d.ts +6 -3
- package/lib/cjs/components/signature/Signature.form.js +5 -0
- package/lib/cjs/components/survey/Survey.d.ts +3 -15
- package/lib/cjs/components/survey/Survey.form.d.ts +6 -3
- package/lib/cjs/components/survey/Survey.form.js +5 -0
- package/lib/cjs/components/table/Table.d.ts +2 -1
- package/lib/cjs/components/table/Table.form.d.ts +6 -3
- package/lib/cjs/components/table/Table.form.js +5 -0
- package/lib/cjs/components/tabs/Tabs.d.ts +4 -4
- package/lib/cjs/components/tabs/Tabs.form.d.ts +6 -3
- package/lib/cjs/components/tabs/Tabs.form.js +5 -0
- package/lib/cjs/components/tabs/Tabs.js +1 -2
- package/lib/cjs/components/tags/Tags.d.ts +0 -14
- package/lib/cjs/components/tags/Tags.form.d.ts +6 -3
- package/lib/cjs/components/tags/Tags.form.js +5 -0
- package/lib/cjs/components/textarea/TextArea.d.ts +4 -9
- package/lib/cjs/components/textarea/TextArea.form.d.ts +6 -3
- package/lib/cjs/components/textarea/TextArea.form.js +5 -0
- package/lib/cjs/components/textarea/TextArea.js +2 -2
- package/lib/cjs/components/textfield/TextField.d.ts +14 -30
- package/lib/cjs/components/textfield/TextField.form.d.ts +6 -3
- package/lib/cjs/components/textfield/TextField.form.js +5 -0
- package/lib/cjs/components/textfield/TextField.js +16 -17
- package/lib/cjs/components/time/Time.form.d.ts +6 -3
- package/lib/cjs/components/time/Time.form.js +5 -0
- package/lib/cjs/components/unknown/Unknown.form.d.ts +5 -34
- package/lib/cjs/components/unknown/Unknown.form.js +4 -0
- package/lib/cjs/components/url/Url.form.d.ts +6 -3
- package/lib/cjs/components/url/Url.form.js +5 -0
- package/lib/cjs/components/well/Well.form.d.ts +6 -3
- package/lib/cjs/components/well/Well.form.js +5 -0
- package/lib/cjs/formio.embed.d.ts +1 -2
- package/lib/cjs/formio.embed.js +2 -100
- package/lib/cjs/formio.form.d.ts +11 -4
- package/lib/cjs/formio.form.js +13 -5
- package/lib/cjs/providers/Providers.d.ts +36 -5
- package/lib/cjs/providers/Providers.js +29 -0
- package/lib/cjs/providers/address/AddressProvider.d.ts +131 -12
- package/lib/cjs/providers/address/AddressProvider.js +88 -2
- package/lib/cjs/providers/address/AzureAddressProvider.d.ts +48 -1
- package/lib/cjs/providers/address/AzureAddressProvider.js +37 -0
- package/lib/cjs/providers/address/CustomAddressProvider.d.ts +27 -4
- package/lib/cjs/providers/address/CustomAddressProvider.js +34 -0
- package/lib/cjs/providers/address/GoogleAddressProvider.d.ts +130 -6
- package/lib/cjs/providers/address/GoogleAddressProvider.js +73 -1
- package/lib/cjs/providers/address/NominatimAddressProvider.d.ts +32 -7
- package/lib/cjs/providers/address/NominatimAddressProvider.js +33 -0
- package/lib/cjs/providers/address/index.d.ts +3 -1
- package/lib/cjs/providers/processor/fileProcessor.d.ts +7 -1
- package/lib/cjs/providers/processor/fileProcessor.js +6 -0
- package/lib/cjs/providers/storage/azure.d.ts +6 -13
- package/lib/cjs/providers/storage/azure.js +5 -0
- package/lib/cjs/providers/storage/base64.d.ts +5 -6
- package/lib/cjs/providers/storage/base64.js +4 -0
- package/lib/cjs/providers/storage/dropbox.d.ts +6 -4
- package/lib/cjs/providers/storage/dropbox.js +5 -0
- package/lib/cjs/providers/storage/googleDrive.d.ts +7 -5
- package/lib/cjs/providers/storage/googleDrive.js +6 -0
- package/lib/cjs/providers/storage/indexeddb.d.ts +5 -7
- package/lib/cjs/providers/storage/indexeddb.js +4 -0
- package/lib/cjs/providers/storage/s3.d.ts +6 -20
- package/lib/cjs/providers/storage/s3.js +5 -0
- package/lib/cjs/providers/storage/url.d.ts +6 -7
- package/lib/cjs/providers/storage/url.js +10 -0
- package/lib/cjs/providers/storage/util.d.ts +24 -1
- package/lib/cjs/providers/storage/util.js +18 -0
- package/lib/cjs/templates/Templates.d.ts +1 -0
- package/lib/cjs/translations/en.d.ts +2 -0
- package/lib/cjs/translations/en.js +3 -1
- package/lib/cjs/utils/ChoicesWrapper.d.ts +1 -1
- package/lib/cjs/utils/ChoicesWrapper.js +13 -2
- package/lib/cjs/utils/Evaluator.d.ts +6 -3
- package/lib/cjs/utils/Evaluator.js +11 -20
- package/lib/cjs/utils/builder.d.ts +9 -7
- package/lib/cjs/utils/builder.js +10 -5
- package/lib/cjs/utils/calendarUtils.d.ts +7 -13
- package/lib/cjs/utils/calendarUtils.js +10 -17
- package/lib/cjs/utils/formUtils.d.ts +43 -171
- package/lib/cjs/utils/formUtils.js +38 -569
- package/lib/cjs/utils/utils.d.ts +367 -221
- package/lib/cjs/utils/utils.js +335 -228
- package/lib/cjs/widgets/CalendarWidget.d.ts +9 -10
- package/lib/cjs/widgets/CalendarWidget.js +9 -11
- package/lib/mjs/CDN.d.ts +1 -0
- package/lib/mjs/CDN.js +6 -3
- package/lib/mjs/Element.d.ts +86 -96
- package/lib/mjs/Element.js +68 -78
- package/lib/mjs/Embed.d.ts +1 -1
- package/lib/mjs/Embed.js +52 -12
- package/lib/mjs/Form.d.ts +365 -36
- package/lib/mjs/Form.js +140 -57
- package/lib/mjs/FormBuilder.d.ts +187 -2
- package/lib/mjs/FormBuilder.js +32 -8
- package/lib/mjs/InlineEmbed.d.ts +7 -0
- package/lib/mjs/InlineEmbed.js +112 -0
- package/lib/mjs/PDF.d.ts +11 -13
- package/lib/mjs/PDF.js +6 -8
- package/lib/mjs/Webform.d.ts +183 -143
- package/lib/mjs/Webform.js +322 -310
- package/lib/mjs/WebformBuilder.d.ts +16 -14
- package/lib/mjs/WebformBuilder.js +11 -10
- package/lib/mjs/Wizard.d.ts +31 -21
- package/lib/mjs/Wizard.js +42 -19
- package/lib/mjs/WizardBuilder.d.ts +1 -1
- package/lib/mjs/addons/PasswordStrength/PasswordStrengthAddon.d.ts +8 -5
- package/lib/mjs/addons/PasswordStrength/PasswordStrengthAddon.js +6 -3
- package/lib/mjs/components/Components.d.ts +4 -4
- package/lib/mjs/components/Components.js +3 -3
- package/lib/mjs/components/_classes/component/Component.d.ts +507 -276
- package/lib/mjs/components/_classes/component/Component.form.d.ts +6 -3
- package/lib/mjs/components/_classes/component/Component.form.js +5 -0
- package/lib/mjs/components/_classes/component/Component.js +438 -196
- package/lib/mjs/components/_classes/component/editForm/Component.edit.display.js +0 -8
- package/lib/mjs/components/_classes/component/editForm/Component.edit.validation.js +1 -1
- package/lib/mjs/components/_classes/component/editForm/utils.js +1 -1
- package/lib/mjs/components/_classes/component/fixtures/comp6.d.ts +77 -0
- package/lib/mjs/components/_classes/component/fixtures/comp6.js +57 -0
- package/lib/mjs/components/_classes/component/fixtures/index.d.ts +2 -1
- package/lib/mjs/components/_classes/component/fixtures/index.js +2 -1
- package/lib/mjs/components/_classes/field/Field.d.ts +11 -2
- package/lib/mjs/components/_classes/field/Field.js +13 -1
- package/lib/mjs/components/_classes/input/Input.d.ts +4 -3
- package/lib/mjs/components/_classes/input/Input.js +8 -6
- package/lib/mjs/components/_classes/list/ListComponent.d.ts +2 -2
- package/lib/mjs/components/_classes/list/ListComponent.form.d.ts +6 -3
- package/lib/mjs/components/_classes/list/ListComponent.form.js +5 -0
- package/lib/mjs/components/_classes/multivalue/Multivalue.d.ts +43 -12
- package/lib/mjs/components/_classes/multivalue/Multivalue.js +37 -3
- package/lib/mjs/components/_classes/nested/NestedComponent.d.ts +163 -67
- package/lib/mjs/components/_classes/nested/NestedComponent.form.d.ts +6 -3
- package/lib/mjs/components/_classes/nested/NestedComponent.form.js +5 -0
- package/lib/mjs/components/_classes/nested/NestedComponent.js +175 -54
- package/lib/mjs/components/_classes/nestedarray/NestedArrayComponent.d.ts +2 -2
- package/lib/mjs/components/_classes/nestedarray/NestedArrayComponent.js +1 -1
- package/lib/mjs/components/_classes/nesteddata/NestedDataComponent.d.ts +7 -1
- package/lib/mjs/components/_classes/nesteddata/NestedDataComponent.js +2 -3
- package/lib/mjs/components/address/Address.d.ts +4 -2
- package/lib/mjs/components/address/Address.form.d.ts +6 -3
- package/lib/mjs/components/address/Address.form.js +5 -0
- package/lib/mjs/components/button/Button.d.ts +3 -12
- package/lib/mjs/components/button/Button.form.d.ts +6 -3
- package/lib/mjs/components/button/Button.form.js +5 -0
- package/lib/mjs/components/button/Button.js +5 -0
- package/lib/mjs/components/checkbox/Checkbox.d.ts +4 -27
- package/lib/mjs/components/checkbox/Checkbox.form.d.ts +6 -3
- package/lib/mjs/components/checkbox/Checkbox.form.js +5 -0
- package/lib/mjs/components/columns/Columns.d.ts +3 -2
- package/lib/mjs/components/columns/Columns.form.d.ts +6 -3
- package/lib/mjs/components/columns/Columns.form.js +5 -0
- package/lib/mjs/components/columns/Columns.js +1 -1
- package/lib/mjs/components/container/Container.form.d.ts +6 -3
- package/lib/mjs/components/container/Container.form.js +5 -0
- package/lib/mjs/components/content/Content.d.ts +2 -1
- package/lib/mjs/components/content/Content.form.d.ts +6 -3
- package/lib/mjs/components/content/Content.form.js +5 -0
- package/lib/mjs/components/currency/Currency.form.d.ts +6 -3
- package/lib/mjs/components/currency/Currency.form.js +5 -0
- package/lib/mjs/components/currency/Currency.js +1 -2
- package/lib/mjs/components/datagrid/DataGrid.d.ts +8 -7
- package/lib/mjs/components/datagrid/DataGrid.form.d.ts +6 -3
- package/lib/mjs/components/datagrid/DataGrid.form.js +5 -0
- package/lib/mjs/components/datagrid/DataGrid.js +5 -5
- package/lib/mjs/components/datagrid/fixtures/comp-with-checkboxes.d.ts +29 -0
- package/lib/mjs/components/datagrid/fixtures/comp-with-checkboxes.js +34 -0
- package/lib/mjs/components/datagrid/fixtures/index.d.ts +2 -1
- package/lib/mjs/components/datagrid/fixtures/index.js +2 -1
- package/lib/mjs/components/datamap/DataMap.d.ts +1 -0
- package/lib/mjs/components/datamap/DataMap.form.d.ts +6 -3
- package/lib/mjs/components/datamap/DataMap.form.js +5 -0
- package/lib/mjs/components/datetime/DateTime.d.ts +0 -14
- package/lib/mjs/components/datetime/DateTime.form.d.ts +6 -3
- package/lib/mjs/components/datetime/DateTime.form.js +5 -0
- package/lib/mjs/components/datetime/editForm/DateTime.edit.date.js +1 -1
- package/lib/mjs/components/day/Day.d.ts +23 -49
- package/lib/mjs/components/day/Day.form.d.ts +6 -3
- package/lib/mjs/components/day/Day.form.js +5 -0
- package/lib/mjs/components/day/Day.js +16 -21
- package/lib/mjs/components/day/fixtures/comp7.d.ts +109 -0
- package/lib/mjs/components/day/fixtures/comp7.js +107 -0
- package/lib/mjs/components/day/fixtures/index.d.ts +2 -1
- package/lib/mjs/components/day/fixtures/index.js +2 -1
- package/lib/mjs/components/editgrid/EditGrid.d.ts +7 -3
- package/lib/mjs/components/editgrid/EditGrid.form.d.ts +6 -3
- package/lib/mjs/components/editgrid/EditGrid.form.js +5 -0
- package/lib/mjs/components/editgrid/EditGrid.js +3 -3
- package/lib/mjs/components/editgrid/editForm/EditGrid.edit.display.js +1 -1
- package/lib/mjs/components/editgrid/editForm/EditGrid.edit.templates.js +1 -1
- package/lib/mjs/components/email/Email.form.d.ts +6 -3
- package/lib/mjs/components/email/Email.form.js +5 -0
- package/lib/mjs/components/fieldset/Fieldset.form.d.ts +6 -3
- package/lib/mjs/components/fieldset/Fieldset.form.js +5 -0
- package/lib/mjs/components/file/File.d.ts +9 -22
- package/lib/mjs/components/file/File.form.d.ts +6 -3
- package/lib/mjs/components/file/File.form.js +5 -0
- package/lib/mjs/components/file/File.js +1 -2
- package/lib/mjs/components/form/Form.d.ts +34 -24
- package/lib/mjs/components/form/Form.form.d.ts +6 -3
- package/lib/mjs/components/form/Form.form.js +5 -0
- package/lib/mjs/components/form/Form.js +15 -13
- package/lib/mjs/components/hidden/Hidden.d.ts +1 -11
- package/lib/mjs/components/hidden/Hidden.form.d.ts +6 -3
- package/lib/mjs/components/hidden/Hidden.form.js +5 -0
- package/lib/mjs/components/hidden/Hidden.js +1 -2
- package/lib/mjs/components/html/HTML.d.ts +2 -1
- package/lib/mjs/components/html/HTML.form.d.ts +6 -3
- package/lib/mjs/components/html/HTML.form.js +5 -0
- package/lib/mjs/components/number/Number.d.ts +3 -17
- package/lib/mjs/components/number/Number.form.d.ts +6 -3
- package/lib/mjs/components/number/Number.form.js +5 -0
- package/lib/mjs/components/number/Number.js +1 -2
- package/lib/mjs/components/panel/Panel.form.d.ts +6 -3
- package/lib/mjs/components/panel/Panel.form.js +5 -0
- package/lib/mjs/components/panel/Panel.js +0 -1
- package/lib/mjs/components/password/Password.form.d.ts +6 -3
- package/lib/mjs/components/password/Password.form.js +5 -0
- package/lib/mjs/components/phonenumber/PhoneNumber.form.d.ts +6 -3
- package/lib/mjs/components/phonenumber/PhoneNumber.form.js +5 -0
- package/lib/mjs/components/radio/Radio.d.ts +3 -26
- package/lib/mjs/components/radio/Radio.form.d.ts +6 -3
- package/lib/mjs/components/radio/Radio.form.js +5 -0
- package/lib/mjs/components/radio/Radio.js +6 -6
- package/lib/mjs/components/recaptcha/ReCaptcha.d.ts +1 -1
- package/lib/mjs/components/recaptcha/ReCaptcha.form.d.ts +6 -3
- package/lib/mjs/components/recaptcha/ReCaptcha.form.js +5 -0
- package/lib/mjs/components/select/Select.d.ts +16 -39
- package/lib/mjs/components/select/Select.form.d.ts +6 -3
- package/lib/mjs/components/select/Select.form.js +5 -0
- package/lib/mjs/components/select/Select.js +14 -17
- package/lib/mjs/components/selectboxes/SelectBoxes.d.ts +2 -17
- package/lib/mjs/components/selectboxes/SelectBoxes.form.d.ts +6 -3
- package/lib/mjs/components/selectboxes/SelectBoxes.form.js +5 -0
- package/lib/mjs/components/selectboxes/SelectBoxes.js +7 -9
- package/lib/mjs/components/signature/Signature.d.ts +0 -14
- package/lib/mjs/components/signature/Signature.form.d.ts +6 -3
- package/lib/mjs/components/signature/Signature.form.js +5 -0
- package/lib/mjs/components/survey/Survey.d.ts +3 -15
- package/lib/mjs/components/survey/Survey.form.d.ts +6 -3
- package/lib/mjs/components/survey/Survey.form.js +5 -0
- package/lib/mjs/components/table/Table.d.ts +2 -1
- package/lib/mjs/components/table/Table.form.d.ts +6 -3
- package/lib/mjs/components/table/Table.form.js +5 -0
- package/lib/mjs/components/tabs/Tabs.d.ts +4 -4
- package/lib/mjs/components/tabs/Tabs.form.d.ts +6 -3
- package/lib/mjs/components/tabs/Tabs.form.js +5 -0
- package/lib/mjs/components/tabs/Tabs.js +1 -2
- package/lib/mjs/components/tags/Tags.d.ts +0 -14
- package/lib/mjs/components/tags/Tags.form.d.ts +6 -3
- package/lib/mjs/components/tags/Tags.form.js +5 -0
- package/lib/mjs/components/textarea/TextArea.d.ts +4 -9
- package/lib/mjs/components/textarea/TextArea.form.d.ts +6 -3
- package/lib/mjs/components/textarea/TextArea.form.js +5 -0
- package/lib/mjs/components/textarea/TextArea.js +2 -2
- package/lib/mjs/components/textfield/TextField.d.ts +14 -30
- package/lib/mjs/components/textfield/TextField.form.d.ts +6 -3
- package/lib/mjs/components/textfield/TextField.form.js +5 -0
- package/lib/mjs/components/textfield/TextField.js +16 -17
- package/lib/mjs/components/time/Time.form.d.ts +6 -3
- package/lib/mjs/components/time/Time.form.js +5 -0
- package/lib/mjs/components/unknown/Unknown.form.d.ts +5 -34
- package/lib/mjs/components/unknown/Unknown.form.js +4 -0
- package/lib/mjs/components/url/Url.form.d.ts +6 -3
- package/lib/mjs/components/url/Url.form.js +5 -0
- package/lib/mjs/components/well/Well.form.d.ts +6 -3
- package/lib/mjs/components/well/Well.form.js +5 -0
- package/lib/mjs/formio.embed.d.ts +1 -2
- package/lib/mjs/formio.embed.js +2 -99
- package/lib/mjs/formio.form.d.ts +11 -4
- package/lib/mjs/formio.form.js +10 -3
- package/lib/mjs/providers/Providers.d.ts +36 -5
- package/lib/mjs/providers/Providers.js +29 -0
- package/lib/mjs/providers/address/AddressProvider.d.ts +131 -12
- package/lib/mjs/providers/address/AddressProvider.js +88 -2
- package/lib/mjs/providers/address/AzureAddressProvider.d.ts +48 -1
- package/lib/mjs/providers/address/AzureAddressProvider.js +37 -0
- package/lib/mjs/providers/address/CustomAddressProvider.d.ts +27 -4
- package/lib/mjs/providers/address/CustomAddressProvider.js +34 -0
- package/lib/mjs/providers/address/GoogleAddressProvider.d.ts +130 -6
- package/lib/mjs/providers/address/GoogleAddressProvider.js +73 -1
- package/lib/mjs/providers/address/NominatimAddressProvider.d.ts +32 -7
- package/lib/mjs/providers/address/NominatimAddressProvider.js +33 -0
- package/lib/mjs/providers/address/index.d.ts +3 -1
- package/lib/mjs/providers/processor/fileProcessor.d.ts +7 -1
- package/lib/mjs/providers/processor/fileProcessor.js +6 -0
- package/lib/mjs/providers/storage/azure.d.ts +6 -13
- package/lib/mjs/providers/storage/azure.js +5 -0
- package/lib/mjs/providers/storage/base64.d.ts +5 -6
- package/lib/mjs/providers/storage/base64.js +4 -0
- package/lib/mjs/providers/storage/dropbox.d.ts +6 -4
- package/lib/mjs/providers/storage/dropbox.js +5 -0
- package/lib/mjs/providers/storage/googleDrive.d.ts +7 -5
- package/lib/mjs/providers/storage/googleDrive.js +6 -0
- package/lib/mjs/providers/storage/indexeddb.d.ts +5 -7
- package/lib/mjs/providers/storage/indexeddb.js +4 -0
- package/lib/mjs/providers/storage/s3.d.ts +6 -20
- package/lib/mjs/providers/storage/s3.js +5 -0
- package/lib/mjs/providers/storage/url.d.ts +6 -7
- package/lib/mjs/providers/storage/url.js +10 -0
- package/lib/mjs/providers/storage/util.d.ts +24 -1
- package/lib/mjs/providers/storage/util.js +18 -0
- package/lib/mjs/templates/Templates.d.ts +1 -0
- package/lib/mjs/translations/en.d.ts +2 -0
- package/lib/mjs/translations/en.js +3 -1
- package/lib/mjs/utils/ChoicesWrapper.d.ts +1 -1
- package/lib/mjs/utils/ChoicesWrapper.js +13 -2
- package/lib/mjs/utils/Evaluator.d.ts +6 -3
- package/lib/mjs/utils/Evaluator.js +9 -20
- package/lib/mjs/utils/builder.d.ts +9 -7
- package/lib/mjs/utils/builder.js +10 -5
- package/lib/mjs/utils/calendarUtils.d.ts +7 -13
- package/lib/mjs/utils/calendarUtils.js +10 -17
- package/lib/mjs/utils/formUtils.d.ts +43 -171
- package/lib/mjs/utils/formUtils.js +6 -554
- package/lib/mjs/utils/utils.d.ts +367 -221
- package/lib/mjs/utils/utils.js +329 -222
- package/lib/mjs/widgets/CalendarWidget.d.ts +9 -10
- package/lib/mjs/widgets/CalendarWidget.js +9 -11
- package/package.json +22 -22
- package/sdk.d.ts +1 -0
- package/utils.d.ts +1 -0
package/lib/cjs/Element.js
CHANGED
|
@@ -70,21 +70,18 @@ class Element {
|
|
|
70
70
|
this.options.i18next = this.i18next = this.options.i18next || i18n_1.I18n.init(this.options.i18n);
|
|
71
71
|
/**
|
|
72
72
|
* An instance of the EventEmitter class to handle the emitting and registration of events.
|
|
73
|
-
*
|
|
74
73
|
* @type {EventEmitter}
|
|
75
74
|
*/
|
|
76
75
|
this.events = (options && options.events) ? options.events : new EventEmitter_1.default();
|
|
77
76
|
this.defaultMask = null;
|
|
78
77
|
/**
|
|
79
78
|
* Conditional to show or hide helplinks in editForm
|
|
80
|
-
*
|
|
81
79
|
* @type {*|boolean}
|
|
82
80
|
*/
|
|
83
81
|
this.helplinks = (this.options.helplinks === 'false') ? false : (this.options.helplinks || 'https://help.form.io');
|
|
84
82
|
}
|
|
85
83
|
/**
|
|
86
84
|
* Register for a new event within this component.
|
|
87
|
-
*
|
|
88
85
|
* @example
|
|
89
86
|
* let component = new BaseComponent({
|
|
90
87
|
* type: 'textfield',
|
|
@@ -94,12 +91,11 @@ class Element {
|
|
|
94
91
|
* component.on('componentChange', (changed) => {
|
|
95
92
|
* console.log('this element is changed.');
|
|
96
93
|
* });
|
|
97
|
-
*
|
|
98
|
-
*
|
|
99
94
|
* @param {string} event - The event you wish to register the handler for.
|
|
100
|
-
* @param {
|
|
95
|
+
* @param {Function} cb - The callback handler to handle this event.
|
|
101
96
|
* @param {boolean} [internal] - This is an internal event handler.
|
|
102
97
|
* @param {boolean} [once] - This event should only fire once.
|
|
98
|
+
* @returns {EventEmitter | void} - The event emitter instance.
|
|
103
99
|
*/
|
|
104
100
|
on(event, cb, internal, once = false) {
|
|
105
101
|
if (!this.events) {
|
|
@@ -115,18 +111,18 @@ class Element {
|
|
|
115
111
|
}
|
|
116
112
|
/**
|
|
117
113
|
* Register for a new single-fire event within this component.
|
|
118
|
-
*
|
|
119
114
|
* @param {string} event - The event you wish to register the handler for.
|
|
120
|
-
* @param {
|
|
115
|
+
* @param {Function} cb - The callback handler to handle this event.
|
|
116
|
+
* @param {boolean} internal - This is an internal event handler.
|
|
117
|
+
* @returns {EventEmitter} - The event emitter instance.
|
|
121
118
|
*/
|
|
122
119
|
once(event, cb, internal) {
|
|
123
120
|
return this.on(event, cb, internal, true);
|
|
124
121
|
}
|
|
125
122
|
/**
|
|
126
123
|
* Allow catching any event.
|
|
127
|
-
*
|
|
128
|
-
* @
|
|
129
|
-
* @returns {this}
|
|
124
|
+
* @param {Function} cb - The callback handler to handle this event.
|
|
125
|
+
* @returns {EventEmitter | void} - The event emitter instance.
|
|
130
126
|
*/
|
|
131
127
|
onAny(cb) {
|
|
132
128
|
if (!this.events) {
|
|
@@ -136,9 +132,8 @@ class Element {
|
|
|
136
132
|
}
|
|
137
133
|
/**
|
|
138
134
|
* Removes the listener that will be fired when any event is emitted.
|
|
139
|
-
*
|
|
140
|
-
* @
|
|
141
|
-
* @returns {this}
|
|
135
|
+
* @param {Function} cb - The callback handler to handle this event.
|
|
136
|
+
* @returns {EventEmitter | void} - The event emitter instance.
|
|
142
137
|
*/
|
|
143
138
|
offAny(cb) {
|
|
144
139
|
if (!this.events) {
|
|
@@ -148,9 +143,8 @@ class Element {
|
|
|
148
143
|
}
|
|
149
144
|
/**
|
|
150
145
|
* Removes a listener for a certain event. Not passing the 2nd arg will remove all listeners for that event.
|
|
151
|
-
*
|
|
152
146
|
* @param {string} event - The event you wish to register the handler for.
|
|
153
|
-
* @param {
|
|
147
|
+
* @param {Function | undefined} cb - The callback handler to handle this event.
|
|
154
148
|
*/
|
|
155
149
|
off(event, cb) {
|
|
156
150
|
if (!this.events) {
|
|
@@ -171,9 +165,8 @@ class Element {
|
|
|
171
165
|
}
|
|
172
166
|
/**
|
|
173
167
|
* Emit a new event.
|
|
174
|
-
*
|
|
175
168
|
* @param {string} event - The event to emit.
|
|
176
|
-
* @param {
|
|
169
|
+
* @param {object} data - The data to emit with the handler.
|
|
177
170
|
*/
|
|
178
171
|
emit(event, ...data) {
|
|
179
172
|
if (this.events) {
|
|
@@ -182,9 +175,8 @@ class Element {
|
|
|
182
175
|
}
|
|
183
176
|
/**
|
|
184
177
|
* Check if the component has an event handler set up for the event.
|
|
185
|
-
*
|
|
186
178
|
* @param {string} event - The event name.
|
|
187
|
-
* @returns {boolean}
|
|
179
|
+
* @returns {boolean} - TRUE if the event is registered, FALSE otherwise.
|
|
188
180
|
*/
|
|
189
181
|
hasEventHandler(event) {
|
|
190
182
|
if (!this.events) {
|
|
@@ -200,15 +192,12 @@ class Element {
|
|
|
200
192
|
}
|
|
201
193
|
/**
|
|
202
194
|
* Wrapper method to add an event listener to an HTML element.
|
|
203
|
-
*
|
|
204
|
-
* @param
|
|
205
|
-
*
|
|
206
|
-
* @param
|
|
207
|
-
*
|
|
208
|
-
* @
|
|
209
|
-
* The callback function to be executed when the listener is triggered.
|
|
210
|
-
* @param persistent
|
|
211
|
-
* If this listener should persist beyond "destroy" commands.
|
|
195
|
+
* @param {HtmlElement} obj - The DOM element to add the event to.
|
|
196
|
+
* @param {string} type - The event name to add.
|
|
197
|
+
* @param {Function} func - The callback function to be executed when the listener is triggered.
|
|
198
|
+
* @param {boolean} persistent - If this listener should persist beyond "destroy" commands.
|
|
199
|
+
* @param {boolean} capture - If this listener should be executed in the capture phase.
|
|
200
|
+
* @returns {void | this} - The instance of the element.
|
|
212
201
|
*/
|
|
213
202
|
addEventListener(obj, type, func, persistent, capture) {
|
|
214
203
|
if (!obj) {
|
|
@@ -227,9 +216,10 @@ class Element {
|
|
|
227
216
|
}
|
|
228
217
|
/**
|
|
229
218
|
* Remove an event listener from the object.
|
|
230
|
-
*
|
|
231
|
-
* @param
|
|
232
|
-
* @param
|
|
219
|
+
* @param {HTMLElement} obj - The DOM element to remove the event from.
|
|
220
|
+
* @param {string} type - The event name to remove.
|
|
221
|
+
* @param {Function} func - The callback function to remove.
|
|
222
|
+
* @returns {this | void} - The instance of the element.
|
|
233
223
|
*/
|
|
234
224
|
removeEventListener(obj, type, func = null) {
|
|
235
225
|
const indexes = [];
|
|
@@ -275,6 +265,7 @@ class Element {
|
|
|
275
265
|
}
|
|
276
266
|
/**
|
|
277
267
|
* Removes all event listeners attached to this component.
|
|
268
|
+
* @param {boolean} all - If all events should be removed, including external events.
|
|
278
269
|
*/
|
|
279
270
|
destroy(all = false) {
|
|
280
271
|
this.removeEventListeners();
|
|
@@ -285,9 +276,9 @@ class Element {
|
|
|
285
276
|
}
|
|
286
277
|
/**
|
|
287
278
|
* Append an HTML DOM element to a container.
|
|
288
|
-
*
|
|
289
|
-
* @param element
|
|
290
|
-
* @
|
|
279
|
+
* @param {HTMLElement} element - The DOM element to append.
|
|
280
|
+
* @param {HTMLElement} container - The DOM element that is the container of the element getting appended.
|
|
281
|
+
* @returns {this} - The instance of the element.
|
|
291
282
|
*/
|
|
292
283
|
appendTo(element, container) {
|
|
293
284
|
container === null || container === void 0 ? void 0 : container.appendChild(element);
|
|
@@ -295,9 +286,9 @@ class Element {
|
|
|
295
286
|
}
|
|
296
287
|
/**
|
|
297
288
|
* Prepend an HTML DOM element to a container.
|
|
298
|
-
*
|
|
299
289
|
* @param {HTMLElement} element - The DOM element to prepend.
|
|
300
290
|
* @param {HTMLElement} container - The DOM element that is the container of the element getting prepended.
|
|
291
|
+
* @returns {this} - The instance of the element.
|
|
301
292
|
*/
|
|
302
293
|
prependTo(element, container) {
|
|
303
294
|
if (container) {
|
|
@@ -318,9 +309,9 @@ class Element {
|
|
|
318
309
|
}
|
|
319
310
|
/**
|
|
320
311
|
* Removes an HTML DOM element from its bounding container.
|
|
321
|
-
*
|
|
322
312
|
* @param {HTMLElement} element - The element to remove.
|
|
323
313
|
* @param {HTMLElement} container - The DOM element that is the container of the element to remove.
|
|
314
|
+
* @returns {this} - The instance of the element.
|
|
324
315
|
*/
|
|
325
316
|
removeChildFrom(element, container) {
|
|
326
317
|
if (container && container.contains(element)) {
|
|
@@ -335,12 +326,10 @@ class Element {
|
|
|
335
326
|
}
|
|
336
327
|
/**
|
|
337
328
|
* Alias for document.createElement.
|
|
338
|
-
*
|
|
339
329
|
* @param {string} type - The type of element to create
|
|
340
|
-
* @param {
|
|
330
|
+
* @param {object} attr - The element attributes to add to the created element.
|
|
341
331
|
* @param {Various} children - Child elements. Can be a DOM Element, string or array of both.
|
|
342
|
-
*
|
|
343
|
-
* @return {HTMLElement} - The created element.
|
|
332
|
+
* @returns {HTMLElement} - The created element.
|
|
344
333
|
*/
|
|
345
334
|
ce(type, attr, children = null) {
|
|
346
335
|
// console.warn('Call to deprecated this.ce(). Dom elements should be created with templates, not manually with ce.');
|
|
@@ -356,8 +345,9 @@ class Element {
|
|
|
356
345
|
}
|
|
357
346
|
/**
|
|
358
347
|
* Append different types of children.
|
|
359
|
-
*
|
|
360
|
-
* @param child
|
|
348
|
+
* @param {HTMLElement} element - The element to append to.
|
|
349
|
+
* @param {HTMLElement} child - The child element to append.
|
|
350
|
+
* @returns {this} - The instance of the element.
|
|
361
351
|
*/
|
|
362
352
|
appendChild(element, child) {
|
|
363
353
|
if (Array.isArray(child)) {
|
|
@@ -379,16 +369,19 @@ class Element {
|
|
|
379
369
|
maskPlaceholder(mask) {
|
|
380
370
|
return mask.map((char) => (char instanceof RegExp) ? this.placeholderChar : char).join('');
|
|
381
371
|
}
|
|
372
|
+
/**
|
|
373
|
+
* Get the placeholder character for the input mask.
|
|
374
|
+
* @returns {string} - The placeholder character.
|
|
375
|
+
*/
|
|
382
376
|
get placeholderChar() {
|
|
383
377
|
var _a;
|
|
384
378
|
return ((_a = this.component) === null || _a === void 0 ? void 0 : _a.inputMaskPlaceholderChar) || '_';
|
|
385
379
|
}
|
|
386
380
|
/**
|
|
387
381
|
* Sets the input mask for an input.
|
|
388
|
-
*
|
|
389
382
|
* @param {HTMLElement} input - The html input to apply the mask to.
|
|
390
|
-
* @param {
|
|
391
|
-
* @param {
|
|
383
|
+
* @param {string} inputMask - The input mask to add to this input.
|
|
384
|
+
* @param {boolean} usePlaceholder - Set the mask placeholder on the input.
|
|
392
385
|
*/
|
|
393
386
|
setInputMask(input, inputMask, usePlaceholder) {
|
|
394
387
|
if (input && inputMask) {
|
|
@@ -421,17 +414,17 @@ class Element {
|
|
|
421
414
|
}
|
|
422
415
|
/**
|
|
423
416
|
* Translate a text using the i18n system.
|
|
424
|
-
*
|
|
425
417
|
* @param {string|Array<string>} text - The i18n identifier.
|
|
426
|
-
* @param {
|
|
418
|
+
* @param {...any} args - The arguments to pass to the i18n translation.
|
|
419
|
+
* @returns {string} - The translated text.
|
|
427
420
|
*/
|
|
428
421
|
t(text, ...args) {
|
|
429
422
|
return this.i18next ? this.i18next.t(text, ...args) : text;
|
|
430
423
|
}
|
|
431
424
|
/**
|
|
432
425
|
* Alias to create a text node.
|
|
433
|
-
* @param text
|
|
434
|
-
* @returns {
|
|
426
|
+
* @param {string} text - The text to create.
|
|
427
|
+
* @returns {HtmlElement} - The created text node.
|
|
435
428
|
*/
|
|
436
429
|
text(text) {
|
|
437
430
|
return document.createTextNode(this.t(text));
|
|
@@ -439,7 +432,7 @@ class Element {
|
|
|
439
432
|
/**
|
|
440
433
|
* Adds an object of attributes onto an element.
|
|
441
434
|
* @param {HtmlElement} element - The element to add the attributes to.
|
|
442
|
-
* @param {
|
|
435
|
+
* @param {object} attr - The attributes to add to the input element.
|
|
443
436
|
*/
|
|
444
437
|
attr(element, attr) {
|
|
445
438
|
if (!element) {
|
|
@@ -462,6 +455,9 @@ class Element {
|
|
|
462
455
|
* Determines if an element has a class.
|
|
463
456
|
*
|
|
464
457
|
* Taken from jQuery https://j11y.io/jquery/#v=1.5.0&fn=jQuery.fn.hasClass
|
|
458
|
+
* @param {HTMLElement} element - The element to check for the class.
|
|
459
|
+
* @param {string} className - The class to check for.
|
|
460
|
+
* @returns {boolean} - TRUE if the element has the class, FALSE otherwise.
|
|
465
461
|
*/
|
|
466
462
|
hasClass(element, className) {
|
|
467
463
|
if (!element) {
|
|
@@ -473,11 +469,9 @@ class Element {
|
|
|
473
469
|
}
|
|
474
470
|
/**
|
|
475
471
|
* Adds a class to a DOM element.
|
|
476
|
-
*
|
|
477
|
-
* @param
|
|
478
|
-
*
|
|
479
|
-
* @param className
|
|
480
|
-
* The name of the class to add.
|
|
472
|
+
* @param {HTMLElement} element - The element to add a class to.
|
|
473
|
+
* @param {string} className - The name of the class to add.
|
|
474
|
+
* @returns {this} - The instance of the element.
|
|
481
475
|
*/
|
|
482
476
|
addClass(element, className) {
|
|
483
477
|
if (!element || !(element instanceof HTMLElement)) {
|
|
@@ -492,11 +486,9 @@ class Element {
|
|
|
492
486
|
}
|
|
493
487
|
/**
|
|
494
488
|
* Remove a class from a DOM element.
|
|
495
|
-
*
|
|
496
|
-
* @param
|
|
497
|
-
*
|
|
498
|
-
* @param className
|
|
499
|
-
* The name of the class that is to be removed.
|
|
489
|
+
* @param {HTMLElement} element - The DOM element to remove the class from.
|
|
490
|
+
* @param {string} className - The name of the class that is to be removed.
|
|
491
|
+
* @returns {this} - The instance of the element.
|
|
500
492
|
*/
|
|
501
493
|
removeClass(element, className) {
|
|
502
494
|
if (!element || !className || !(element instanceof HTMLElement)) {
|
|
@@ -512,7 +504,6 @@ class Element {
|
|
|
512
504
|
}
|
|
513
505
|
/**
|
|
514
506
|
* Empty's an HTML DOM element.
|
|
515
|
-
*
|
|
516
507
|
* @param {HTMLElement} element - The element you wish to empty.
|
|
517
508
|
*/
|
|
518
509
|
empty(element) {
|
|
@@ -524,9 +515,8 @@ class Element {
|
|
|
524
515
|
}
|
|
525
516
|
/**
|
|
526
517
|
* Create an evaluation context for all script executions and interpolations.
|
|
527
|
-
*
|
|
528
|
-
* @
|
|
529
|
-
* @return {*}
|
|
518
|
+
* @param {object} additional - Additional context to apply to the evaluation context.
|
|
519
|
+
* @returns {*} - The evaluation context.
|
|
530
520
|
*/
|
|
531
521
|
evalContext(additional) {
|
|
532
522
|
var _a;
|
|
@@ -551,10 +541,10 @@ class Element {
|
|
|
551
541
|
}
|
|
552
542
|
/**
|
|
553
543
|
* Performs an interpolation using the evaluation context of this component.
|
|
554
|
-
*
|
|
555
|
-
* @param
|
|
556
|
-
* @param
|
|
557
|
-
* @
|
|
544
|
+
* @param {string} string - The string to interpolate.
|
|
545
|
+
* @param {object} data - The data to use in the interpolation.
|
|
546
|
+
* @param {object} options - The options to pass to the interpolation.
|
|
547
|
+
* @returns {XML|string|*|void} - The interpolated string.
|
|
558
548
|
*/
|
|
559
549
|
interpolate(string, data, options = {}) {
|
|
560
550
|
if (typeof string !== 'function' && (this.component.content || this.component.html)
|
|
@@ -570,19 +560,19 @@ class Element {
|
|
|
570
560
|
}
|
|
571
561
|
/**
|
|
572
562
|
* Performs an evaluation using the evaluation context of this component.
|
|
573
|
-
*
|
|
574
|
-
* @param
|
|
575
|
-
* @param
|
|
576
|
-
* @param
|
|
577
|
-
* @param
|
|
578
|
-
* @
|
|
563
|
+
* @param {string|Function|object} func - The function or string to evaluate.
|
|
564
|
+
* @param {object} args - The arguments to pass to the evaluation.
|
|
565
|
+
* @param {string} ret - The name of the variable within the evaluation context to return.
|
|
566
|
+
* @param {boolean} interpolate - Determines if it should replace all {{ }} token references with actual data.
|
|
567
|
+
* @param {import('@formio/core').EvaluatorOptions} options - The options to pass to the evaluation.
|
|
568
|
+
* @returns {*} - The result of the evaluation.
|
|
579
569
|
*/
|
|
580
|
-
evaluate(func, args, ret,
|
|
581
|
-
return FormioUtils.evaluate(func, this.evalContext(args), ret,
|
|
570
|
+
evaluate(func, args, ret, interpolate, options = {}) {
|
|
571
|
+
return FormioUtils.evaluate(func, this.evalContext(args), ret, interpolate, options);
|
|
582
572
|
}
|
|
583
573
|
/**
|
|
584
574
|
* Allow for options to hook into the functionality of this renderer.
|
|
585
|
-
* @
|
|
575
|
+
* @returns {*} - The result of the hook function.
|
|
586
576
|
*/
|
|
587
577
|
hook() {
|
|
588
578
|
const name = arguments[0];
|
package/lib/cjs/Embed.d.ts
CHANGED
|
@@ -26,7 +26,7 @@ export class Formio {
|
|
|
26
26
|
static addStyles(wrapper: any, href: any): Promise<void>;
|
|
27
27
|
static submitDone(instance: any, submission: any): Promise<void>;
|
|
28
28
|
static formioScript(script: any, builder: any): any;
|
|
29
|
-
static addLibrary(
|
|
29
|
+
static addLibrary(libWrapper: any, lib: any, name: any): Promise<void>;
|
|
30
30
|
static addLoader(wrapper: any): Promise<void>;
|
|
31
31
|
static init(element: any, options?: {}, builder?: boolean): Promise<any>;
|
|
32
32
|
static afterCreate(instance: any, wrapper: any, readyEvent: any): Promise<any>;
|
package/lib/cjs/Embed.js
CHANGED
|
@@ -80,6 +80,9 @@ class Formio {
|
|
|
80
80
|
}
|
|
81
81
|
static createElement(type, attrs, children) {
|
|
82
82
|
const element = document.createElement(type);
|
|
83
|
+
if (!attrs) {
|
|
84
|
+
return element;
|
|
85
|
+
}
|
|
83
86
|
Object.keys(attrs).forEach(key => {
|
|
84
87
|
element.setAttribute(key, attrs[key]);
|
|
85
88
|
});
|
|
@@ -144,6 +147,9 @@ class Formio {
|
|
|
144
147
|
static submitDone(instance, submission) {
|
|
145
148
|
return __awaiter(this, void 0, void 0, function* () {
|
|
146
149
|
_a.debug('Submision Complete', submission);
|
|
150
|
+
if (_a.config.submitDone) {
|
|
151
|
+
_a.config.submitDone(submission, instance);
|
|
152
|
+
}
|
|
147
153
|
const successMessage = (_a.config.success || '').toString();
|
|
148
154
|
if (successMessage && successMessage.toLowerCase() !== 'false' && instance.element) {
|
|
149
155
|
instance.element.innerHTML = `<div class="alert-success" role="alert">${successMessage}</div>`;
|
|
@@ -184,21 +190,22 @@ class Formio {
|
|
|
184
190
|
}
|
|
185
191
|
return script;
|
|
186
192
|
}
|
|
187
|
-
static addLibrary(
|
|
193
|
+
static addLibrary(libWrapper, lib, name) {
|
|
188
194
|
return __awaiter(this, void 0, void 0, function* () {
|
|
189
195
|
if (!lib) {
|
|
190
196
|
return;
|
|
191
197
|
}
|
|
192
198
|
if (lib.dependencies) {
|
|
193
199
|
for (let i = 0; i < lib.dependencies.length; i++) {
|
|
194
|
-
|
|
200
|
+
const libName = lib.dependencies[i];
|
|
201
|
+
yield _a.addLibrary(libWrapper, _a.config.libs[libName], libName);
|
|
195
202
|
}
|
|
196
203
|
}
|
|
197
204
|
if (lib.css) {
|
|
198
|
-
yield _a.addStyles(
|
|
205
|
+
yield _a.addStyles((lib.global ? document.body : libWrapper), lib.css);
|
|
199
206
|
}
|
|
200
207
|
if (lib.js) {
|
|
201
|
-
const module = yield _a.addScript(
|
|
208
|
+
const module = yield _a.addScript((lib.global ? document.body : libWrapper), lib.js, lib.use ? name : false);
|
|
202
209
|
if (lib.use) {
|
|
203
210
|
_a.debug(`Using ${name}`);
|
|
204
211
|
const options = lib.options || {};
|
|
@@ -208,6 +215,12 @@ class Formio {
|
|
|
208
215
|
_a.use((typeof lib.use === 'function' ? lib.use(module) : module), options);
|
|
209
216
|
}
|
|
210
217
|
}
|
|
218
|
+
if (lib.globalStyle) {
|
|
219
|
+
const style = _a.createElement('style');
|
|
220
|
+
style.type = 'text/css';
|
|
221
|
+
style.innerHTML = lib.globalStyle;
|
|
222
|
+
document.body.appendChild(style);
|
|
223
|
+
}
|
|
211
224
|
});
|
|
212
225
|
}
|
|
213
226
|
static addLoader(wrapper) {
|
|
@@ -240,7 +253,16 @@ class Formio {
|
|
|
240
253
|
use: true
|
|
241
254
|
},
|
|
242
255
|
fontawesome: {
|
|
243
|
-
|
|
256
|
+
// Due to an issue with font-face not loading in the shadowdom (https://issues.chromium.org/issues/41085401), we need
|
|
257
|
+
// to do 2 things. 1.) Load the fonts from the global cdn, and 2.) add the font-face to the global styles on the page.
|
|
258
|
+
css: `https://cdn.jsdelivr.net/npm/font-awesome@4.7.0/css/font-awesome.min.css`,
|
|
259
|
+
globalStyle: `@font-face {
|
|
260
|
+
font-family: 'FontAwesome';
|
|
261
|
+
src: url('https://cdn.jsdelivr.net/npm/font-awesome@4.7.0/fonts/fontawesome-webfont.eot?v=4.7.0');
|
|
262
|
+
src: url('https://cdn.jsdelivr.net/npm/font-awesome@4.7.0/fonts/fontawesome-webfont.eot?#iefix&v=4.7.0') format('embedded-opentype'), url('https://cdn.jsdelivr.net/npm/font-awesome@4.7.0/fonts/fontawesome-webfont.woff2?v=4.7.0') format('woff2'), url('https://cdn.jsdelivr.net/npm/font-awesome@4.7.0/fonts/fontawesome-webfont.woff?v=4.7.0') format('woff'), url('https://cdn.jsdelivr.net/npm/font-awesome@4.7.0/fonts/fontawesome-webfont.ttf?v=4.7.0') format('truetype'), url('https://cdn.jsdelivr.net/npm/font-awesome@4.7.0/fonts/fontawesome-webfont.svg?v=4.7.0#fontawesomeregular') format('svg');
|
|
263
|
+
font-weight: normal;
|
|
264
|
+
font-style: normal;
|
|
265
|
+
}`
|
|
244
266
|
},
|
|
245
267
|
bootstrap4: {
|
|
246
268
|
dependencies: ['fontawesome'],
|
|
@@ -251,9 +273,24 @@ class Formio {
|
|
|
251
273
|
css: `${_a.cdn.bootstrap}/css/bootstrap.min.css`
|
|
252
274
|
},
|
|
253
275
|
'bootstrap-icons': {
|
|
254
|
-
|
|
276
|
+
// Due to an issue with font-face not loading in the shadowdom (https://issues.chromium.org/issues/41085401), we need
|
|
277
|
+
// to do 2 things. 1.) Load the fonts from the global cdn, and 2.) add the font-face to the global styles on the page.
|
|
278
|
+
css: 'https://cdn.jsdelivr.net/npm/bootstrap-icons/font/bootstrap-icons.min.css',
|
|
279
|
+
globalStyle: `@font-face {
|
|
280
|
+
font-display: block;
|
|
281
|
+
font-family: "bootstrap-icons";
|
|
282
|
+
src: url("https://cdn.jsdelivr.net/npm/bootstrap-icons/font/fonts/bootstrap-icons.woff2?dd67030699838ea613ee6dbda90effa6") format("woff2"),
|
|
283
|
+
url("https://cdn.jsdelivr.net/npm/bootstrap-icons/font/fonts/bootstrap-icons.woff?dd67030699838ea613ee6dbda90effa6") format("woff");
|
|
284
|
+
}`
|
|
255
285
|
}
|
|
256
286
|
};
|
|
287
|
+
// Add all bootswatch templates.
|
|
288
|
+
['cerulean', 'cosmo', 'cyborg', 'darkly', 'flatly', 'journal', 'litera', 'lumen', 'lux', 'materia', 'minty', 'pulse', 'sandstone', 'simplex', 'sketchy', 'slate', 'solar', 'spacelab', 'superhero', 'united', 'yeti'].forEach((template) => {
|
|
289
|
+
_a.config.libs[template] = {
|
|
290
|
+
dependencies: ['bootstrap-icons'],
|
|
291
|
+
css: `${_a.cdn.bootswatch}/dist/${template}/bootstrap.min.css`
|
|
292
|
+
};
|
|
293
|
+
});
|
|
257
294
|
const id = _a.config.id || `formio-${Math.random().toString(36).substring(7)}`;
|
|
258
295
|
// Create a new wrapper and add the element inside of a new wrapper.
|
|
259
296
|
let wrapper = _a.createElement('div', {
|
|
@@ -261,7 +298,7 @@ class Formio {
|
|
|
261
298
|
});
|
|
262
299
|
element.parentNode.insertBefore(wrapper, element);
|
|
263
300
|
// If we include the libraries, then we will attempt to run this in shadow dom.
|
|
264
|
-
const useShadowDom = _a.config.includeLibs && (typeof wrapper.attachShadow === 'function');
|
|
301
|
+
const useShadowDom = _a.config.includeLibs && !_a.config.noshadow && (typeof wrapper.attachShadow === 'function');
|
|
265
302
|
if (useShadowDom) {
|
|
266
303
|
wrapper = wrapper.attachShadow({
|
|
267
304
|
mode: 'open'
|
|
@@ -297,14 +334,17 @@ class Formio {
|
|
|
297
334
|
if (_a.config.template && _a.config.includeLibs) {
|
|
298
335
|
yield _a.addLibrary(libWrapper, _a.config.libs[_a.config.template], _a.config.template);
|
|
299
336
|
}
|
|
300
|
-
|
|
337
|
+
if (!_a.config.libraries) {
|
|
338
|
+
_a.config.libraries = _a.config.modules || {};
|
|
339
|
+
}
|
|
340
|
+
// Adding premium if it is provided via the config.
|
|
301
341
|
if (_a.config.premium) {
|
|
302
|
-
_a.config.
|
|
342
|
+
_a.config.libraries.premium = _a.config.premium;
|
|
303
343
|
}
|
|
304
344
|
// Allow adding dynamic modules.
|
|
305
|
-
if (_a.config.
|
|
306
|
-
for (const name in _a.config.
|
|
307
|
-
const lib = _a.config.
|
|
345
|
+
if (_a.config.libraries) {
|
|
346
|
+
for (const name in _a.config.libraries) {
|
|
347
|
+
const lib = _a.config.libraries[name];
|
|
308
348
|
lib.use = lib.use || true;
|
|
309
349
|
yield _a.addLibrary(libWrapper, lib, name);
|
|
310
350
|
}
|