@formio/js 5.0.0-rc.19 → 5.0.0-rc.21
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/README.md +1 -1
- package/dist/formio.builder.css +14 -22
- package/dist/formio.builder.min.css +1 -1
- package/dist/formio.embed.css +1 -40
- package/dist/formio.embed.js +2 -90
- package/dist/formio.embed.min.css +1 -1
- package/dist/formio.embed.min.js +1 -1
- package/dist/formio.embed.min.js.LICENSE.txt +1 -1
- package/dist/formio.form.css +10 -2
- package/dist/formio.form.js +1267 -1103
- package/dist/formio.form.min.css +1 -1
- package/dist/formio.form.min.js +1 -1
- package/dist/formio.form.min.js.LICENSE.txt +3 -8
- package/dist/formio.full.css +14 -22
- package/dist/formio.full.js +1302 -1127
- package/dist/formio.full.min.css +1 -1
- package/dist/formio.full.min.js +1 -1
- package/dist/formio.full.min.js.LICENSE.txt +3 -8
- package/dist/formio.js +713 -626
- package/dist/formio.min.js +1 -1
- package/dist/formio.min.js.LICENSE.txt +2 -7
- package/dist/formio.utils.js +220 -13
- package/dist/formio.utils.min.js +1 -1
- package/dist/formio.utils.min.js.LICENSE.txt +2 -7
- package/lib/cjs/CDN.d.ts +1 -0
- package/lib/cjs/CDN.js +2 -1
- package/lib/cjs/Element.js +7 -2
- package/lib/cjs/Embed.d.ts +21 -1
- package/lib/cjs/Embed.js +211 -308
- package/lib/cjs/Form.d.ts +9 -6
- package/lib/cjs/Form.js +53 -11
- package/lib/cjs/PDF.d.ts +11 -3
- package/lib/cjs/PDF.js +4 -5
- package/lib/cjs/PDFBuilder.js +2 -3
- package/lib/cjs/Webform.d.ts +10 -13
- package/lib/cjs/Webform.js +46 -125
- package/lib/cjs/WebformBuilder.d.ts +6 -1
- package/lib/cjs/WebformBuilder.js +105 -65
- package/lib/cjs/Wizard.d.ts +8 -5
- package/lib/cjs/Wizard.js +12 -12
- package/lib/cjs/WizardBuilder.d.ts +6 -4
- package/lib/cjs/WizardBuilder.js +20 -3
- package/lib/cjs/addons/FormioAddon.d.ts +1 -1
- package/lib/cjs/addons/FormioAddon.js +1 -2
- package/lib/cjs/components/_classes/component/Component.d.ts +24 -8
- package/lib/cjs/components/_classes/component/Component.js +44 -14
- package/lib/cjs/components/_classes/input/Input.d.ts +1 -1
- package/lib/cjs/components/_classes/input/Input.js +1 -2
- package/lib/cjs/components/_classes/list/ListComponent.d.ts +4 -0
- package/lib/cjs/components/_classes/list/ListComponent.js +43 -6
- package/lib/cjs/components/_classes/multivalue/Multivalue.d.ts +1 -0
- package/lib/cjs/components/_classes/multivalue/Multivalue.js +10 -4
- package/lib/cjs/components/_classes/nested/NestedComponent.d.ts +5 -2
- package/lib/cjs/components/_classes/nested/NestedComponent.js +9 -10
- package/lib/cjs/components/_classes/nestedarray/NestedArrayComponent.d.ts +1 -0
- package/lib/cjs/components/_classes/nestedarray/NestedArrayComponent.js +4 -0
- package/lib/cjs/components/_classes/nesteddata/NestedDataComponent.d.ts +1 -0
- package/lib/cjs/components/_classes/nesteddata/NestedDataComponent.js +4 -0
- package/lib/cjs/components/address/Address.d.ts +8 -0
- package/lib/cjs/components/address/Address.js +5 -0
- package/lib/cjs/components/button/Button.d.ts +1 -0
- package/lib/cjs/components/button/Button.js +5 -3
- package/lib/cjs/components/checkbox/Checkbox.d.ts +41 -0
- package/lib/cjs/components/checkbox/Checkbox.js +32 -5
- package/lib/cjs/components/columns/Columns.d.ts +2 -0
- package/lib/cjs/components/columns/Columns.js +4 -0
- package/lib/cjs/components/container/Container.d.ts +1 -0
- package/lib/cjs/components/container/Container.js +4 -0
- package/lib/cjs/components/content/Content.d.ts +2 -0
- package/lib/cjs/components/content/Content.js +4 -2
- package/lib/cjs/components/currency/editForm/Currency.edit.data.d.ts +14 -2
- package/lib/cjs/components/currency/editForm/Currency.edit.data.js +4 -0
- package/lib/cjs/components/currency/editForm/Currency.edit.display.js +4 -0
- package/lib/cjs/components/datagrid/DataGrid.d.ts +1 -0
- package/lib/cjs/components/datagrid/DataGrid.js +8 -1
- package/lib/cjs/components/datamap/DataMap.d.ts +1 -0
- package/lib/cjs/components/datamap/DataMap.js +4 -0
- package/lib/cjs/components/datetime/DateTime.d.ts +23 -0
- package/lib/cjs/components/datetime/DateTime.js +20 -1
- package/lib/cjs/components/day/Day.d.ts +22 -1
- package/lib/cjs/components/day/Day.js +20 -6
- package/lib/cjs/components/day/fixtures/comp3.js +2 -2
- package/lib/cjs/components/editgrid/EditGrid.d.ts +4 -3
- package/lib/cjs/components/editgrid/EditGrid.js +11 -6
- package/lib/cjs/components/editgrid/fixtures/comp-with-custom-default-value.d.ts +190 -0
- package/lib/cjs/components/editgrid/fixtures/comp-with-custom-default-value.js +227 -0
- package/lib/cjs/components/editgrid/fixtures/comp15.d.ts +54 -0
- package/lib/cjs/components/editgrid/fixtures/comp15.js +51 -0
- package/lib/cjs/components/editgrid/fixtures/index.d.ts +3 -1
- package/lib/cjs/components/editgrid/fixtures/index.js +5 -1
- package/lib/cjs/components/fieldset/Fieldset.d.ts +2 -0
- package/lib/cjs/components/fieldset/Fieldset.js +4 -0
- package/lib/cjs/components/file/File.d.ts +28 -6
- package/lib/cjs/components/file/File.js +40 -15
- package/lib/cjs/components/file/editForm/File.edit.file.d.ts +62 -0
- package/lib/cjs/components/file/editForm/File.edit.file.js +29 -2
- package/lib/cjs/components/form/Form.d.ts +4 -0
- package/lib/cjs/components/form/Form.js +12 -10
- package/lib/cjs/components/hidden/Hidden.d.ts +1 -0
- package/lib/cjs/components/hidden/Hidden.js +1 -0
- package/lib/cjs/components/html/HTML.d.ts +2 -0
- package/lib/cjs/components/html/HTML.js +4 -0
- package/lib/cjs/components/number/Number.d.ts +24 -1
- package/lib/cjs/components/number/Number.js +18 -6
- package/lib/cjs/components/panel/Panel.d.ts +1 -0
- package/lib/cjs/components/panel/Panel.js +3 -0
- package/lib/cjs/components/phonenumber/PhoneNumber.form.js +9 -0
- package/lib/cjs/components/radio/Radio.d.ts +24 -3
- package/lib/cjs/components/radio/Radio.js +89 -18
- package/lib/cjs/components/recaptcha/ReCaptcha.d.ts +2 -1
- package/lib/cjs/components/recaptcha/ReCaptcha.js +7 -5
- package/lib/cjs/components/resource/Resource.d.ts +7 -0
- package/lib/cjs/components/resource/Resource.js +0 -1
- package/lib/cjs/components/resource/editForm/Resource.edit.display.js +1 -1
- package/lib/cjs/components/select/Select.d.ts +25 -5
- package/lib/cjs/components/select/Select.js +51 -51
- package/lib/cjs/components/selectboxes/SelectBoxes.d.ts +37 -0
- package/lib/cjs/components/selectboxes/SelectBoxes.js +60 -25
- package/lib/cjs/components/selectboxes/fixtures/comp4.d.ts +30 -27
- package/lib/cjs/components/selectboxes/fixtures/comp4.js +47 -32
- package/lib/cjs/components/selectboxes/fixtures/comp6.d.ts +14 -0
- package/lib/cjs/components/selectboxes/fixtures/comp6.js +15 -0
- package/lib/cjs/components/selectboxes/fixtures/index.d.ts +2 -1
- package/lib/cjs/components/selectboxes/fixtures/index.js +3 -1
- package/lib/cjs/components/signature/Signature.d.ts +22 -1
- package/lib/cjs/components/signature/Signature.js +16 -3
- package/lib/cjs/components/survey/Survey.d.ts +21 -0
- package/lib/cjs/components/survey/Survey.js +9 -0
- package/lib/cjs/components/table/Table.d.ts +2 -0
- package/lib/cjs/components/table/Table.js +4 -0
- package/lib/cjs/components/tabs/Tabs.d.ts +2 -0
- package/lib/cjs/components/tabs/Tabs.js +4 -0
- package/lib/cjs/components/tags/Tags.d.ts +21 -0
- package/lib/cjs/components/tags/Tags.js +11 -0
- package/lib/cjs/components/textarea/TextArea.d.ts +3 -2
- package/lib/cjs/components/textarea/TextArea.js +4 -5
- package/lib/cjs/components/textarea/fixtures/comp4.d.ts +30 -0
- package/lib/cjs/components/textarea/fixtures/comp4.js +27 -0
- package/lib/cjs/components/textarea/fixtures/index.d.ts +2 -1
- package/lib/cjs/components/textarea/fixtures/index.js +3 -1
- package/lib/cjs/components/textfield/TextField.d.ts +22 -0
- package/lib/cjs/components/textfield/TextField.js +11 -3
- package/lib/cjs/components/time/Time.d.ts +11 -0
- package/lib/cjs/components/time/Time.js +6 -1
- package/lib/cjs/components/tree/Tree.d.ts +5 -4
- package/lib/cjs/components/tree/Tree.form.js +5 -0
- package/lib/cjs/components/tree/Tree.js +8 -9
- package/lib/cjs/components/tree/editForm/Tree.edit.display.d.ts +9 -0
- package/lib/cjs/components/tree/editForm/Tree.edit.display.js +12 -0
- package/lib/cjs/components/well/Well.d.ts +2 -0
- package/lib/cjs/components/well/Well.js +4 -0
- package/lib/cjs/formio.embed.d.ts +2 -1
- package/lib/cjs/formio.embed.js +96 -1
- package/lib/cjs/formio.form.d.ts +4 -3
- package/lib/cjs/formio.form.js +17 -8
- package/lib/cjs/licenses/Licenses.d.ts +7 -0
- package/lib/cjs/licenses/Licenses.js +22 -0
- package/lib/cjs/licenses/index.d.ts +2 -0
- package/lib/cjs/licenses/index.js +7 -0
- package/lib/cjs/providers/Providers.d.ts +31 -11
- package/lib/cjs/providers/address/GoogleAddressProvider.d.ts +2 -2
- package/lib/cjs/providers/address/GoogleAddressProvider.js +2 -3
- package/lib/cjs/providers/processor/fileProcessor.d.ts +1 -1
- package/lib/cjs/providers/processor/fileProcessor.js +1 -5
- package/lib/cjs/providers/storage/azure.d.ts +10 -1
- package/lib/cjs/providers/storage/azure.js +7 -2
- package/lib/cjs/providers/storage/base64.d.ts +2 -2
- package/lib/cjs/providers/storage/base64.js +2 -6
- package/lib/cjs/providers/storage/dropbox.d.ts +2 -2
- package/lib/cjs/providers/storage/dropbox.js +2 -6
- package/lib/cjs/providers/storage/googleDrive.d.ts +3 -2
- package/lib/cjs/providers/storage/googleDrive.js +6 -6
- package/lib/cjs/providers/storage/indexeddb.d.ts +3 -3
- package/lib/cjs/providers/storage/indexeddb.js +9 -13
- package/lib/cjs/providers/storage/s3.d.ts +11 -1
- package/lib/cjs/providers/storage/s3.js +5 -2
- package/lib/cjs/providers/storage/uploadAdapter.js +1 -5
- package/lib/cjs/providers/storage/url.d.ts +2 -2
- package/lib/cjs/providers/storage/url.js +12 -8
- package/lib/cjs/providers/storage/xhr.d.ts +1 -1
- package/lib/cjs/providers/storage/xhr.js +1 -2
- package/lib/cjs/templates/index.d.ts +226 -1
- package/lib/cjs/utils/Evaluator.js +4 -33
- package/lib/cjs/utils/i18n.d.ts +16 -0
- package/lib/cjs/utils/i18n.js +88 -0
- package/lib/cjs/utils/utils.d.ts +11 -1
- package/lib/cjs/utils/utils.js +29 -10
- package/lib/cjs/validator/Validator.d.ts +30 -2
- package/lib/cjs/validator/Validator.js +32 -9
- package/lib/cjs/validator/rules/Select.js +1 -2
- package/lib/cjs/validator/rules/Unique.d.ts +1 -1
- package/lib/cjs/validator/rules/Unique.js +1 -2
- package/lib/cjs/widgets/CalendarWidget.d.ts +1 -0
- package/lib/cjs/widgets/InputWidget.d.ts +1 -1
- package/lib/cjs/widgets/InputWidget.js +1 -2
- package/lib/mjs/CDN.d.ts +1 -0
- package/lib/mjs/CDN.js +2 -1
- package/lib/mjs/Element.js +6 -2
- package/lib/mjs/Embed.d.ts +21 -1
- package/lib/mjs/Embed.js +208 -319
- package/lib/mjs/Form.d.ts +9 -6
- package/lib/mjs/Form.js +53 -11
- package/lib/mjs/PDF.d.ts +11 -3
- package/lib/mjs/PDF.js +4 -5
- package/lib/mjs/PDFBuilder.js +2 -3
- package/lib/mjs/Webform.d.ts +10 -13
- package/lib/mjs/Webform.js +46 -128
- package/lib/mjs/WebformBuilder.d.ts +6 -1
- package/lib/mjs/WebformBuilder.js +103 -65
- package/lib/mjs/Wizard.d.ts +8 -5
- package/lib/mjs/Wizard.js +12 -12
- package/lib/mjs/WizardBuilder.d.ts +6 -4
- package/lib/mjs/WizardBuilder.js +20 -3
- package/lib/mjs/addons/FormioAddon.d.ts +1 -1
- package/lib/mjs/addons/FormioAddon.js +1 -2
- package/lib/mjs/components/_classes/component/Component.d.ts +24 -8
- package/lib/mjs/components/_classes/component/Component.js +44 -14
- package/lib/mjs/components/_classes/input/Input.d.ts +1 -1
- package/lib/mjs/components/_classes/input/Input.js +1 -2
- package/lib/mjs/components/_classes/list/ListComponent.d.ts +4 -0
- package/lib/mjs/components/_classes/list/ListComponent.js +43 -5
- package/lib/mjs/components/_classes/multivalue/Multivalue.d.ts +1 -0
- package/lib/mjs/components/_classes/multivalue/Multivalue.js +10 -4
- package/lib/mjs/components/_classes/nested/NestedComponent.d.ts +5 -2
- package/lib/mjs/components/_classes/nested/NestedComponent.js +9 -10
- package/lib/mjs/components/_classes/nestedarray/NestedArrayComponent.d.ts +1 -0
- package/lib/mjs/components/_classes/nestedarray/NestedArrayComponent.js +4 -0
- package/lib/mjs/components/_classes/nesteddata/NestedDataComponent.d.ts +1 -0
- package/lib/mjs/components/_classes/nesteddata/NestedDataComponent.js +4 -0
- package/lib/mjs/components/address/Address.d.ts +8 -0
- package/lib/mjs/components/address/Address.js +5 -0
- package/lib/mjs/components/button/Button.d.ts +1 -0
- package/lib/mjs/components/button/Button.js +6 -4
- package/lib/mjs/components/checkbox/Checkbox.d.ts +41 -0
- package/lib/mjs/components/checkbox/Checkbox.js +36 -5
- package/lib/mjs/components/columns/Columns.d.ts +2 -0
- package/lib/mjs/components/columns/Columns.js +4 -0
- package/lib/mjs/components/container/Container.d.ts +1 -0
- package/lib/mjs/components/container/Container.js +5 -1
- package/lib/mjs/components/content/Content.d.ts +2 -0
- package/lib/mjs/components/content/Content.js +4 -2
- package/lib/mjs/components/currency/editForm/Currency.edit.data.d.ts +14 -2
- package/lib/mjs/components/currency/editForm/Currency.edit.data.js +4 -0
- package/lib/mjs/components/currency/editForm/Currency.edit.display.js +4 -0
- package/lib/mjs/components/datagrid/DataGrid.d.ts +1 -0
- package/lib/mjs/components/datagrid/DataGrid.js +8 -1
- package/lib/mjs/components/datamap/DataMap.d.ts +1 -0
- package/lib/mjs/components/datamap/DataMap.js +5 -1
- package/lib/mjs/components/datetime/DateTime.d.ts +23 -0
- package/lib/mjs/components/datetime/DateTime.js +27 -1
- package/lib/mjs/components/day/Day.d.ts +22 -1
- package/lib/mjs/components/day/Day.js +24 -7
- package/lib/mjs/components/day/fixtures/comp3.js +2 -2
- package/lib/mjs/components/editgrid/EditGrid.d.ts +4 -3
- package/lib/mjs/components/editgrid/EditGrid.js +11 -6
- package/lib/mjs/components/editgrid/fixtures/comp-with-custom-default-value.d.ts +190 -0
- package/lib/mjs/components/editgrid/fixtures/comp-with-custom-default-value.js +225 -0
- package/lib/mjs/components/editgrid/fixtures/comp15.d.ts +54 -0
- package/lib/mjs/components/editgrid/fixtures/comp15.js +49 -0
- package/lib/mjs/components/editgrid/fixtures/index.d.ts +3 -1
- package/lib/mjs/components/editgrid/fixtures/index.js +3 -1
- package/lib/mjs/components/fieldset/Fieldset.d.ts +2 -0
- package/lib/mjs/components/fieldset/Fieldset.js +4 -0
- package/lib/mjs/components/file/File.d.ts +28 -6
- package/lib/mjs/components/file/File.js +44 -16
- package/lib/mjs/components/file/editForm/File.edit.file.d.ts +62 -0
- package/lib/mjs/components/file/editForm/File.edit.file.js +29 -2
- package/lib/mjs/components/form/Form.d.ts +4 -0
- package/lib/mjs/components/form/Form.js +13 -11
- package/lib/mjs/components/hidden/Hidden.d.ts +1 -0
- package/lib/mjs/components/hidden/Hidden.js +1 -0
- package/lib/mjs/components/html/HTML.d.ts +2 -0
- package/lib/mjs/components/html/HTML.js +4 -0
- package/lib/mjs/components/number/Number.d.ts +24 -1
- package/lib/mjs/components/number/Number.js +23 -7
- package/lib/mjs/components/panel/Panel.d.ts +1 -0
- package/lib/mjs/components/panel/Panel.js +3 -0
- package/lib/mjs/components/phonenumber/PhoneNumber.form.js +9 -0
- package/lib/mjs/components/radio/Radio.d.ts +24 -3
- package/lib/mjs/components/radio/Radio.js +93 -19
- package/lib/mjs/components/recaptcha/ReCaptcha.d.ts +2 -1
- package/lib/mjs/components/recaptcha/ReCaptcha.js +7 -5
- package/lib/mjs/components/resource/Resource.d.ts +7 -0
- package/lib/mjs/components/resource/Resource.js +0 -1
- package/lib/mjs/components/resource/editForm/Resource.edit.display.js +1 -1
- package/lib/mjs/components/select/Select.d.ts +25 -5
- package/lib/mjs/components/select/Select.js +55 -52
- package/lib/mjs/components/selectboxes/SelectBoxes.d.ts +37 -0
- package/lib/mjs/components/selectboxes/SelectBoxes.js +63 -25
- package/lib/mjs/components/selectboxes/fixtures/comp4.d.ts +30 -27
- package/lib/mjs/components/selectboxes/fixtures/comp4.js +47 -32
- package/lib/mjs/components/selectboxes/fixtures/comp6.d.ts +14 -0
- package/lib/mjs/components/selectboxes/fixtures/comp6.js +13 -0
- package/lib/mjs/components/selectboxes/fixtures/index.d.ts +2 -1
- package/lib/mjs/components/selectboxes/fixtures/index.js +2 -1
- package/lib/mjs/components/signature/Signature.d.ts +22 -1
- package/lib/mjs/components/signature/Signature.js +19 -3
- package/lib/mjs/components/survey/Survey.d.ts +21 -0
- package/lib/mjs/components/survey/Survey.js +13 -1
- package/lib/mjs/components/table/Table.d.ts +2 -0
- package/lib/mjs/components/table/Table.js +4 -0
- package/lib/mjs/components/tabs/Tabs.d.ts +2 -0
- package/lib/mjs/components/tabs/Tabs.js +4 -0
- package/lib/mjs/components/tags/Tags.d.ts +21 -0
- package/lib/mjs/components/tags/Tags.js +14 -0
- package/lib/mjs/components/textarea/TextArea.d.ts +3 -2
- package/lib/mjs/components/textarea/TextArea.js +4 -5
- package/lib/mjs/components/textarea/fixtures/comp4.d.ts +30 -0
- package/lib/mjs/components/textarea/fixtures/comp4.js +25 -0
- package/lib/mjs/components/textarea/fixtures/index.d.ts +2 -1
- package/lib/mjs/components/textarea/fixtures/index.js +2 -1
- package/lib/mjs/components/textfield/TextField.d.ts +22 -0
- package/lib/mjs/components/textfield/TextField.js +14 -3
- package/lib/mjs/components/time/Time.d.ts +11 -0
- package/lib/mjs/components/time/Time.js +12 -1
- package/lib/mjs/components/tree/Tree.d.ts +5 -4
- package/lib/mjs/components/tree/Tree.form.js +5 -0
- package/lib/mjs/components/tree/Tree.js +8 -9
- package/lib/mjs/components/tree/editForm/Tree.edit.display.d.ts +9 -0
- package/lib/mjs/components/tree/editForm/Tree.edit.display.js +10 -0
- package/lib/mjs/components/well/Well.d.ts +2 -0
- package/lib/mjs/components/well/Well.js +4 -0
- package/lib/mjs/formio.embed.d.ts +2 -1
- package/lib/mjs/formio.embed.js +96 -2
- package/lib/mjs/formio.form.d.ts +4 -3
- package/lib/mjs/formio.form.js +16 -8
- package/lib/mjs/licenses/Licenses.d.ts +7 -0
- package/lib/mjs/licenses/Licenses.js +17 -0
- package/lib/mjs/licenses/index.d.ts +2 -0
- package/lib/mjs/licenses/index.js +2 -0
- package/lib/mjs/providers/Providers.d.ts +31 -11
- package/lib/mjs/providers/address/GoogleAddressProvider.d.ts +2 -2
- package/lib/mjs/providers/address/GoogleAddressProvider.js +2 -3
- package/lib/mjs/providers/processor/fileProcessor.d.ts +1 -1
- package/lib/mjs/providers/processor/fileProcessor.js +1 -2
- package/lib/mjs/providers/storage/azure.d.ts +10 -1
- package/lib/mjs/providers/storage/azure.js +7 -2
- package/lib/mjs/providers/storage/base64.d.ts +2 -2
- package/lib/mjs/providers/storage/base64.js +2 -3
- package/lib/mjs/providers/storage/dropbox.d.ts +2 -2
- package/lib/mjs/providers/storage/dropbox.js +2 -3
- package/lib/mjs/providers/storage/googleDrive.d.ts +3 -2
- package/lib/mjs/providers/storage/googleDrive.js +6 -3
- package/lib/mjs/providers/storage/indexeddb.d.ts +3 -3
- package/lib/mjs/providers/storage/indexeddb.js +9 -10
- package/lib/mjs/providers/storage/s3.d.ts +11 -1
- package/lib/mjs/providers/storage/s3.js +5 -2
- package/lib/mjs/providers/storage/uploadAdapter.js +1 -2
- package/lib/mjs/providers/storage/url.d.ts +2 -2
- package/lib/mjs/providers/storage/url.js +12 -5
- package/lib/mjs/providers/storage/xhr.d.ts +1 -1
- package/lib/mjs/providers/storage/xhr.js +1 -2
- package/lib/mjs/templates/index.d.ts +226 -1
- package/lib/mjs/utils/Evaluator.js +4 -33
- package/lib/mjs/utils/i18n.d.ts +16 -0
- package/lib/mjs/utils/i18n.js +81 -0
- package/lib/mjs/utils/utils.d.ts +11 -1
- package/lib/mjs/utils/utils.js +27 -9
- package/lib/mjs/validator/Validator.d.ts +30 -2
- package/lib/mjs/validator/Validator.js +31 -9
- package/lib/mjs/validator/rules/Select.js +1 -2
- package/lib/mjs/validator/rules/Unique.d.ts +1 -1
- package/lib/mjs/validator/rules/Unique.js +1 -2
- package/lib/mjs/widgets/CalendarWidget.d.ts +1 -0
- package/lib/mjs/widgets/InputWidget.d.ts +1 -1
- package/lib/mjs/widgets/InputWidget.js +1 -2
- package/package.json +18 -15
- package/types/index.d.ts +1 -0
- package/types/licenses.d.ts +7 -0
- package/types/utils.d.ts +2 -0
|
@@ -16,11 +16,10 @@ const Field_1 = __importDefault(require("../_classes/field/Field"));
|
|
|
16
16
|
const utils_1 = require("../../utils/utils");
|
|
17
17
|
const downloadjs_1 = __importDefault(require("downloadjs"));
|
|
18
18
|
const lodash_1 = __importDefault(require("lodash"));
|
|
19
|
-
const native_promise_only_1 = __importDefault(require("native-promise-only"));
|
|
20
19
|
const fileProcessor_1 = __importDefault(require("../../providers/processor/fileProcessor"));
|
|
21
20
|
const browser_md5_file_1 = __importDefault(require("browser-md5-file"));
|
|
22
21
|
let Camera;
|
|
23
|
-
let webViewCamera = navigator.camera
|
|
22
|
+
let webViewCamera = 'undefined' !== typeof window ? navigator.camera : Camera;
|
|
24
23
|
// canvas.toBlob polyfill.
|
|
25
24
|
let htmlCanvasElement;
|
|
26
25
|
if (typeof window !== 'undefined') {
|
|
@@ -68,6 +67,16 @@ class FileComponent extends Field_1.default {
|
|
|
68
67
|
schema: FileComponent.schema(),
|
|
69
68
|
};
|
|
70
69
|
}
|
|
70
|
+
static get serverConditionSettings() {
|
|
71
|
+
return FileComponent.conditionOperatorsSettings;
|
|
72
|
+
}
|
|
73
|
+
static get conditionOperatorsSettings() {
|
|
74
|
+
return Object.assign(Object.assign({}, super.conditionOperatorsSettings), { operators: ['isEmpty', 'isNotEmpty'] });
|
|
75
|
+
}
|
|
76
|
+
static savedValueTypes(schema) {
|
|
77
|
+
schema = schema || {};
|
|
78
|
+
return (0, utils_1.getComponentSavedTypes)(schema) || [utils_1.componentValueTypes.object];
|
|
79
|
+
}
|
|
71
80
|
init() {
|
|
72
81
|
super.init();
|
|
73
82
|
webViewCamera = navigator.camera || Camera;
|
|
@@ -85,7 +94,7 @@ class FileComponent extends Field_1.default {
|
|
|
85
94
|
this.fileDropHidden = false;
|
|
86
95
|
}
|
|
87
96
|
get dataReady() {
|
|
88
|
-
return this.filesReady ||
|
|
97
|
+
return this.filesReady || Promise.resolve();
|
|
89
98
|
}
|
|
90
99
|
get defaultSchema() {
|
|
91
100
|
return FileComponent.schema();
|
|
@@ -147,7 +156,7 @@ class FileComponent extends Field_1.default {
|
|
|
147
156
|
videoStream.getVideoTracks().forEach((track) => track.stop());
|
|
148
157
|
}
|
|
149
158
|
getFrame(videoPlayer) {
|
|
150
|
-
return new
|
|
159
|
+
return new Promise((resolve) => {
|
|
151
160
|
const canvas = document.createElement('canvas');
|
|
152
161
|
canvas.height = videoPlayer.videoHeight;
|
|
153
162
|
canvas.width = videoPlayer.videoWidth;
|
|
@@ -201,7 +210,7 @@ class FileComponent extends Field_1.default {
|
|
|
201
210
|
});
|
|
202
211
|
}
|
|
203
212
|
browseFiles(attrs = {}) {
|
|
204
|
-
return new
|
|
213
|
+
return new Promise((resolve) => {
|
|
205
214
|
const fileInput = this.ce('input', Object.assign({ type: 'file', style: 'height: 0; width: 0; visibility: hidden;', tabindex: '-1' }, attrs));
|
|
206
215
|
document.body.appendChild(fileInput);
|
|
207
216
|
fileInput.addEventListener('change', () => {
|
|
@@ -241,9 +250,12 @@ class FileComponent extends Field_1.default {
|
|
|
241
250
|
if (this.component.multiple) {
|
|
242
251
|
options.multiple = true;
|
|
243
252
|
}
|
|
253
|
+
if (this.component.capture) {
|
|
254
|
+
options.capture = this.component.capture;
|
|
255
|
+
}
|
|
244
256
|
//use "accept" attribute only for desktop devices because of its limited support by mobile browsers
|
|
257
|
+
const filePattern = this.component.filePattern.trim() || '';
|
|
245
258
|
if (!this.isMobile.any) {
|
|
246
|
-
const filePattern = this.component.filePattern.trim() || '';
|
|
247
259
|
const imagesPattern = 'image/*';
|
|
248
260
|
if (this.imageUpload && (!filePattern || filePattern === '*')) {
|
|
249
261
|
options.accept = imagesPattern;
|
|
@@ -255,11 +267,23 @@ class FileComponent extends Field_1.default {
|
|
|
255
267
|
options.accept = filePattern;
|
|
256
268
|
}
|
|
257
269
|
}
|
|
270
|
+
// if input capture is set, we need the "accept" attribute to determine which device to launch
|
|
271
|
+
else if (this.component.capture) {
|
|
272
|
+
if (filePattern.includes('video')) {
|
|
273
|
+
options.accept = 'video/*';
|
|
274
|
+
}
|
|
275
|
+
else if (filePattern.includes('audio')) {
|
|
276
|
+
options.accept = 'audio/*';
|
|
277
|
+
}
|
|
278
|
+
else {
|
|
279
|
+
options.accept = 'image/*';
|
|
280
|
+
}
|
|
281
|
+
}
|
|
258
282
|
return options;
|
|
259
283
|
}
|
|
260
284
|
deleteFile(fileInfo) {
|
|
261
285
|
const { options = {} } = this.component;
|
|
262
|
-
if (fileInfo && (['url', 'indexeddb'].includes(this.component.storage))) {
|
|
286
|
+
if (fileInfo && (['url', 'indexeddb', 's3', 'googledrive', 'azure'].includes(this.component.storage))) {
|
|
263
287
|
const { fileService } = this;
|
|
264
288
|
if (fileService && typeof fileService.deleteFile === 'function') {
|
|
265
289
|
fileService.deleteFile(fileInfo, options);
|
|
@@ -337,8 +361,10 @@ class FileComponent extends Field_1.default {
|
|
|
337
361
|
this.refs.fileStatusRemove.forEach((fileStatusRemove, index) => {
|
|
338
362
|
this.addEventListener(fileStatusRemove, 'click', (event) => {
|
|
339
363
|
event.preventDefault();
|
|
340
|
-
|
|
341
|
-
|
|
364
|
+
const fileUpload = this.statuses[index];
|
|
365
|
+
lodash_1.default.pull(this.filesUploading, fileUpload.originalName);
|
|
366
|
+
if (fileUpload.abort) {
|
|
367
|
+
fileUpload.abort();
|
|
342
368
|
}
|
|
343
369
|
this.statuses.splice(index, 1);
|
|
344
370
|
this.redraw();
|
|
@@ -416,7 +442,7 @@ class FileComponent extends Field_1.default {
|
|
|
416
442
|
const fileService = this.fileService;
|
|
417
443
|
if (fileService) {
|
|
418
444
|
const loadingImages = [];
|
|
419
|
-
this.filesReady = new
|
|
445
|
+
this.filesReady = new Promise((resolve, reject) => {
|
|
420
446
|
this.filesReadyResolve = resolve;
|
|
421
447
|
this.filesReadyReject = reject;
|
|
422
448
|
});
|
|
@@ -424,7 +450,7 @@ class FileComponent extends Field_1.default {
|
|
|
424
450
|
loadingImages.push(this.loadImage(this.dataValue[index]).then((url) => (image.src = url)));
|
|
425
451
|
});
|
|
426
452
|
if (loadingImages.length) {
|
|
427
|
-
|
|
453
|
+
Promise.all(loadingImages).then(() => {
|
|
428
454
|
this.filesReadyResolve();
|
|
429
455
|
}).catch(() => this.filesReadyReject());
|
|
430
456
|
}
|
|
@@ -544,6 +570,7 @@ class FileComponent extends Field_1.default {
|
|
|
544
570
|
const fileName = (0, utils_1.uniqueName)(file.name, this.component.fileNameTemplate, this.evalContext());
|
|
545
571
|
const escapedFileName = file.name ? file.name.replaceAll('<', '<').replaceAll('>', '>') : file.name;
|
|
546
572
|
const fileUpload = {
|
|
573
|
+
abort: () => null,
|
|
547
574
|
originalName: escapedFileName,
|
|
548
575
|
name: fileName,
|
|
549
576
|
size: file.size,
|
|
@@ -663,7 +690,7 @@ class FileComponent extends Field_1.default {
|
|
|
663
690
|
}
|
|
664
691
|
}
|
|
665
692
|
}
|
|
666
|
-
fileUpload.message = this.t('Starting upload
|
|
693
|
+
fileUpload.message = this.t('Starting upload...');
|
|
667
694
|
this.redraw();
|
|
668
695
|
const filePromise = fileService.uploadFile(storage, processedFile || file, fileName, dir,
|
|
669
696
|
// Progress callback
|
|
@@ -676,9 +703,7 @@ class FileComponent extends Field_1.default {
|
|
|
676
703
|
// Upload start callback
|
|
677
704
|
() => {
|
|
678
705
|
this.emit('fileUploadingStart', filePromise);
|
|
679
|
-
},
|
|
680
|
-
// Abort upload callback
|
|
681
|
-
(abort) => this.abortUpload = abort).then((fileInfo) => {
|
|
706
|
+
}, (abort) => fileUpload.abort = abort).then((fileInfo) => {
|
|
682
707
|
const index = this.statuses.indexOf(fileUpload);
|
|
683
708
|
if (index !== -1) {
|
|
684
709
|
this.statuses.splice(index, 1);
|
|
@@ -14,6 +14,10 @@ declare const _default: ({
|
|
|
14
14
|
conditional?: undefined;
|
|
15
15
|
rows?: undefined;
|
|
16
16
|
editor?: undefined;
|
|
17
|
+
optionsLabelPosition?: undefined;
|
|
18
|
+
inline?: undefined;
|
|
19
|
+
defaultValue?: undefined;
|
|
20
|
+
values?: undefined;
|
|
17
21
|
components?: undefined;
|
|
18
22
|
} | {
|
|
19
23
|
type: string;
|
|
@@ -38,6 +42,10 @@ declare const _default: ({
|
|
|
38
42
|
data?: undefined;
|
|
39
43
|
rows?: undefined;
|
|
40
44
|
editor?: undefined;
|
|
45
|
+
optionsLabelPosition?: undefined;
|
|
46
|
+
inline?: undefined;
|
|
47
|
+
defaultValue?: undefined;
|
|
48
|
+
values?: undefined;
|
|
41
49
|
components?: undefined;
|
|
42
50
|
} | {
|
|
43
51
|
type: string;
|
|
@@ -62,6 +70,10 @@ declare const _default: ({
|
|
|
62
70
|
data?: undefined;
|
|
63
71
|
rows?: undefined;
|
|
64
72
|
editor?: undefined;
|
|
73
|
+
optionsLabelPosition?: undefined;
|
|
74
|
+
inline?: undefined;
|
|
75
|
+
defaultValue?: undefined;
|
|
76
|
+
values?: undefined;
|
|
65
77
|
components?: undefined;
|
|
66
78
|
} | {
|
|
67
79
|
type: string;
|
|
@@ -86,6 +98,10 @@ declare const _default: ({
|
|
|
86
98
|
valueProperty?: undefined;
|
|
87
99
|
dataSrc?: undefined;
|
|
88
100
|
data?: undefined;
|
|
101
|
+
optionsLabelPosition?: undefined;
|
|
102
|
+
inline?: undefined;
|
|
103
|
+
defaultValue?: undefined;
|
|
104
|
+
values?: undefined;
|
|
89
105
|
components?: undefined;
|
|
90
106
|
} | {
|
|
91
107
|
type: string;
|
|
@@ -110,6 +126,10 @@ declare const _default: ({
|
|
|
110
126
|
data?: undefined;
|
|
111
127
|
rows?: undefined;
|
|
112
128
|
editor?: undefined;
|
|
129
|
+
optionsLabelPosition?: undefined;
|
|
130
|
+
inline?: undefined;
|
|
131
|
+
defaultValue?: undefined;
|
|
132
|
+
values?: undefined;
|
|
113
133
|
components?: undefined;
|
|
114
134
|
} | {
|
|
115
135
|
type: string;
|
|
@@ -125,6 +145,10 @@ declare const _default: ({
|
|
|
125
145
|
conditional?: undefined;
|
|
126
146
|
rows?: undefined;
|
|
127
147
|
editor?: undefined;
|
|
148
|
+
optionsLabelPosition?: undefined;
|
|
149
|
+
inline?: undefined;
|
|
150
|
+
defaultValue?: undefined;
|
|
151
|
+
values?: undefined;
|
|
128
152
|
components?: undefined;
|
|
129
153
|
} | {
|
|
130
154
|
type: string;
|
|
@@ -140,6 +164,10 @@ declare const _default: ({
|
|
|
140
164
|
conditional?: undefined;
|
|
141
165
|
rows?: undefined;
|
|
142
166
|
editor?: undefined;
|
|
167
|
+
optionsLabelPosition?: undefined;
|
|
168
|
+
inline?: undefined;
|
|
169
|
+
defaultValue?: undefined;
|
|
170
|
+
values?: undefined;
|
|
143
171
|
components?: undefined;
|
|
144
172
|
} | {
|
|
145
173
|
type: string;
|
|
@@ -164,6 +192,10 @@ declare const _default: ({
|
|
|
164
192
|
data?: undefined;
|
|
165
193
|
rows?: undefined;
|
|
166
194
|
editor?: undefined;
|
|
195
|
+
optionsLabelPosition?: undefined;
|
|
196
|
+
inline?: undefined;
|
|
197
|
+
defaultValue?: undefined;
|
|
198
|
+
values?: undefined;
|
|
167
199
|
components?: undefined;
|
|
168
200
|
} | {
|
|
169
201
|
type: string;
|
|
@@ -188,6 +220,32 @@ declare const _default: ({
|
|
|
188
220
|
data?: undefined;
|
|
189
221
|
rows?: undefined;
|
|
190
222
|
editor?: undefined;
|
|
223
|
+
optionsLabelPosition?: undefined;
|
|
224
|
+
inline?: undefined;
|
|
225
|
+
defaultValue?: undefined;
|
|
226
|
+
values?: undefined;
|
|
227
|
+
components?: undefined;
|
|
228
|
+
} | {
|
|
229
|
+
type: string;
|
|
230
|
+
input: boolean;
|
|
231
|
+
key: string;
|
|
232
|
+
label: string;
|
|
233
|
+
tooltip: string;
|
|
234
|
+
optionsLabelPosition: string;
|
|
235
|
+
inline: boolean;
|
|
236
|
+
defaultValue: boolean;
|
|
237
|
+
values: {
|
|
238
|
+
label: string;
|
|
239
|
+
value: string;
|
|
240
|
+
}[];
|
|
241
|
+
placeholder?: undefined;
|
|
242
|
+
weight?: undefined;
|
|
243
|
+
valueProperty?: undefined;
|
|
244
|
+
dataSrc?: undefined;
|
|
245
|
+
data?: undefined;
|
|
246
|
+
conditional?: undefined;
|
|
247
|
+
rows?: undefined;
|
|
248
|
+
editor?: undefined;
|
|
191
249
|
components?: undefined;
|
|
192
250
|
} | {
|
|
193
251
|
type: string;
|
|
@@ -209,5 +267,9 @@ declare const _default: ({
|
|
|
209
267
|
conditional?: undefined;
|
|
210
268
|
rows?: undefined;
|
|
211
269
|
editor?: undefined;
|
|
270
|
+
optionsLabelPosition?: undefined;
|
|
271
|
+
inline?: undefined;
|
|
272
|
+
defaultValue?: undefined;
|
|
273
|
+
values?: undefined;
|
|
212
274
|
})[];
|
|
213
275
|
export default _default;
|
|
@@ -83,8 +83,11 @@ exports.default = [
|
|
|
83
83
|
input: true,
|
|
84
84
|
weight: 15,
|
|
85
85
|
placeholder: `{
|
|
86
|
-
|
|
87
|
-
|
|
86
|
+
"withCredentials": true,
|
|
87
|
+
"headers": {
|
|
88
|
+
"Authorization": "Basic <key>"
|
|
89
|
+
}
|
|
90
|
+
}`,
|
|
88
91
|
conditional: {
|
|
89
92
|
json: {
|
|
90
93
|
'===': [{
|
|
@@ -209,6 +212,30 @@ exports.default = [
|
|
|
209
212
|
json: { '==': [{ var: 'data.webcam' }, true] }
|
|
210
213
|
}
|
|
211
214
|
},
|
|
215
|
+
{
|
|
216
|
+
type: 'radio',
|
|
217
|
+
input: true,
|
|
218
|
+
key: 'capture',
|
|
219
|
+
label: 'Enable device capture',
|
|
220
|
+
tooltip: 'This will allow a mobile device to open the camera or microphone directly in capture mode.',
|
|
221
|
+
optionsLabelPosition: 'right',
|
|
222
|
+
inline: true,
|
|
223
|
+
defaultValue: false,
|
|
224
|
+
values: [
|
|
225
|
+
{
|
|
226
|
+
label: 'Disabled',
|
|
227
|
+
value: 'false'
|
|
228
|
+
},
|
|
229
|
+
{
|
|
230
|
+
label: 'Environment (rear camera)',
|
|
231
|
+
value: 'environment'
|
|
232
|
+
},
|
|
233
|
+
{
|
|
234
|
+
label: 'User (front camera)',
|
|
235
|
+
value: 'user'
|
|
236
|
+
}
|
|
237
|
+
]
|
|
238
|
+
},
|
|
212
239
|
{
|
|
213
240
|
type: 'datagrid',
|
|
214
241
|
input: true,
|
|
@@ -7,14 +7,17 @@ export default class FormComponent extends Component {
|
|
|
7
7
|
weight: number;
|
|
8
8
|
schema: any;
|
|
9
9
|
};
|
|
10
|
+
static savedValueTypes(): string[];
|
|
10
11
|
init(): any;
|
|
11
12
|
formObj: any;
|
|
12
13
|
valueChanged: boolean | undefined;
|
|
13
14
|
subForm: any;
|
|
14
15
|
formSrc: any;
|
|
16
|
+
get dataReady(): any;
|
|
15
17
|
get emptyValue(): {
|
|
16
18
|
data: {};
|
|
17
19
|
};
|
|
20
|
+
get ready(): any;
|
|
18
21
|
get useOriginalRevision(): any;
|
|
19
22
|
setFormRevision(rev: any): void;
|
|
20
23
|
subFormRevision: any;
|
|
@@ -26,6 +29,7 @@ export default class FormComponent extends Component {
|
|
|
26
29
|
* Prints out the value of form components as a datagrid value.
|
|
27
30
|
*/
|
|
28
31
|
getValueAsString(value: any): any;
|
|
32
|
+
attach(element: any): Promise<any>;
|
|
29
33
|
get hasLoadedForm(): any;
|
|
30
34
|
get isRevisionChanged(): any;
|
|
31
35
|
subFormReady: any;
|
|
@@ -7,7 +7,6 @@ const lodash_1 = __importDefault(require("lodash"));
|
|
|
7
7
|
const Component_1 = __importDefault(require("../_classes/component/Component"));
|
|
8
8
|
const ComponentModal_1 = __importDefault(require("../_classes/componentModal/ComponentModal"));
|
|
9
9
|
const eventemitter3_1 = __importDefault(require("eventemitter3"));
|
|
10
|
-
const native_promise_only_1 = __importDefault(require("native-promise-only"));
|
|
11
10
|
const utils_1 = require("../../utils/utils");
|
|
12
11
|
const Formio_1 = require("../../Formio");
|
|
13
12
|
const Form_1 = __importDefault(require("../../Form"));
|
|
@@ -34,6 +33,9 @@ class FormComponent extends Component_1.default {
|
|
|
34
33
|
schema: FormComponent.schema()
|
|
35
34
|
};
|
|
36
35
|
}
|
|
36
|
+
static savedValueTypes() {
|
|
37
|
+
return [utils_1.componentValueTypes.object];
|
|
38
|
+
}
|
|
37
39
|
init() {
|
|
38
40
|
super.init();
|
|
39
41
|
this.formObj = {
|
|
@@ -99,7 +101,7 @@ class FormComponent extends Component_1.default {
|
|
|
99
101
|
return this.createSubForm();
|
|
100
102
|
}
|
|
101
103
|
get dataReady() {
|
|
102
|
-
return this.subFormReady ||
|
|
104
|
+
return this.subFormReady || Promise.resolve();
|
|
103
105
|
}
|
|
104
106
|
get defaultValue() {
|
|
105
107
|
// Not not provide a default value unless the subform is ready so that it will initialize correctly.
|
|
@@ -112,7 +114,7 @@ class FormComponent extends Component_1.default {
|
|
|
112
114
|
return { data: {} };
|
|
113
115
|
}
|
|
114
116
|
get ready() {
|
|
115
|
-
return this.subFormReady ||
|
|
117
|
+
return this.subFormReady || Promise.resolve();
|
|
116
118
|
}
|
|
117
119
|
get useOriginalRevision() {
|
|
118
120
|
var _a, _b;
|
|
@@ -388,14 +390,14 @@ class FormComponent extends Component_1.default {
|
|
|
388
390
|
*/
|
|
389
391
|
loadSubForm(fromAttach) {
|
|
390
392
|
if (this.builderMode || this.isHidden() || (this.isSubFormLazyLoad() && !fromAttach)) {
|
|
391
|
-
return
|
|
393
|
+
return Promise.resolve();
|
|
392
394
|
}
|
|
393
|
-
if (this.hasLoadedForm && !this.isRevisionChanged
|
|
395
|
+
if (this.hasLoadedForm && !this.isRevisionChanged) {
|
|
394
396
|
// Pass config down to sub forms.
|
|
395
397
|
if (this.root && this.root.form && this.root.form.config && !this.formObj.config) {
|
|
396
398
|
this.formObj.config = this.root.form.config;
|
|
397
399
|
}
|
|
398
|
-
return
|
|
400
|
+
return Promise.resolve(this.formObj);
|
|
399
401
|
}
|
|
400
402
|
else if (this.formSrc) {
|
|
401
403
|
this.subFormLoading = true;
|
|
@@ -410,7 +412,7 @@ class FormComponent extends Component_1.default {
|
|
|
410
412
|
return null;
|
|
411
413
|
});
|
|
412
414
|
}
|
|
413
|
-
return
|
|
415
|
+
return Promise.resolve();
|
|
414
416
|
}
|
|
415
417
|
get subFormData() {
|
|
416
418
|
var _a;
|
|
@@ -473,7 +475,7 @@ class FormComponent extends Component_1.default {
|
|
|
473
475
|
return this.subForm.getSubmission();
|
|
474
476
|
}
|
|
475
477
|
else {
|
|
476
|
-
return
|
|
478
|
+
return Promise.resolve(this.dataValue);
|
|
477
479
|
}
|
|
478
480
|
}
|
|
479
481
|
/**
|
|
@@ -498,7 +500,7 @@ class FormComponent extends Component_1.default {
|
|
|
498
500
|
this.subForm.showAllErrors = true;
|
|
499
501
|
if (rejectOnError) {
|
|
500
502
|
this.subForm.onSubmissionError(err);
|
|
501
|
-
return
|
|
503
|
+
return Promise.reject(err);
|
|
502
504
|
}
|
|
503
505
|
else {
|
|
504
506
|
return {};
|
|
@@ -528,7 +530,7 @@ class FormComponent extends Component_1.default {
|
|
|
528
530
|
// This submission has already been submitted, so just return the reference data.
|
|
529
531
|
if (isAlreadySubmitted && !((_a = this.subForm) === null || _a === void 0 ? void 0 : _a.wizard)) {
|
|
530
532
|
this.dataValue = submission;
|
|
531
|
-
return
|
|
533
|
+
return Promise.resolve(this.dataValue);
|
|
532
534
|
}
|
|
533
535
|
return this.submitSubForm(false)
|
|
534
536
|
.then(() => {
|
|
@@ -5,8 +5,10 @@ export default class HTMLComponent extends Component {
|
|
|
5
5
|
icon: string;
|
|
6
6
|
weight: number;
|
|
7
7
|
documentation: string;
|
|
8
|
+
showPreview: boolean;
|
|
8
9
|
schema: any;
|
|
9
10
|
};
|
|
11
|
+
static savedValueTypes(): never[];
|
|
10
12
|
get content(): any;
|
|
11
13
|
get singleTags(): string[];
|
|
12
14
|
checkRefreshOn(changed: any): void;
|
|
@@ -24,9 +24,13 @@ class HTMLComponent extends Component_1.default {
|
|
|
24
24
|
icon: 'code',
|
|
25
25
|
weight: 0,
|
|
26
26
|
documentation: '/userguide/form-building/layout-components#html-element',
|
|
27
|
+
showPreview: false,
|
|
27
28
|
schema: HTMLComponent.schema()
|
|
28
29
|
};
|
|
29
30
|
}
|
|
31
|
+
static savedValueTypes() {
|
|
32
|
+
return [];
|
|
33
|
+
}
|
|
30
34
|
get defaultSchema() {
|
|
31
35
|
return HTMLComponent.schema();
|
|
32
36
|
}
|
|
@@ -7,11 +7,34 @@ export default class NumberComponent extends Input {
|
|
|
7
7
|
weight: number;
|
|
8
8
|
schema: any;
|
|
9
9
|
};
|
|
10
|
+
static get serverConditionSettings(): {
|
|
11
|
+
operators: any[];
|
|
12
|
+
valueComponent(classComp: any): any;
|
|
13
|
+
constructor: Function;
|
|
14
|
+
toString(): string;
|
|
15
|
+
toLocaleString(): string;
|
|
16
|
+
valueOf(): Object;
|
|
17
|
+
hasOwnProperty(v: PropertyKey): boolean;
|
|
18
|
+
isPrototypeOf(v: Object): boolean;
|
|
19
|
+
propertyIsEnumerable(v: PropertyKey): boolean;
|
|
20
|
+
};
|
|
21
|
+
static get conditionOperatorsSettings(): {
|
|
22
|
+
operators: any[];
|
|
23
|
+
valueComponent(classComp: any): any;
|
|
24
|
+
constructor: Function;
|
|
25
|
+
toString(): string;
|
|
26
|
+
toLocaleString(): string;
|
|
27
|
+
valueOf(): Object;
|
|
28
|
+
hasOwnProperty(v: PropertyKey): boolean;
|
|
29
|
+
isPrototypeOf(v: Object): boolean;
|
|
30
|
+
propertyIsEnumerable(v: PropertyKey): boolean;
|
|
31
|
+
};
|
|
32
|
+
static savedValueTypes(schema: any): string[];
|
|
10
33
|
constructor(...args: any[]);
|
|
11
34
|
validators: string[];
|
|
12
|
-
decimalSeparator: any;
|
|
13
35
|
delimiter: any;
|
|
14
36
|
decimalLimit: any;
|
|
37
|
+
decimalSeparator: any;
|
|
15
38
|
numberMask: any;
|
|
16
39
|
/**
|
|
17
40
|
* Creates the number mask for normal numbers.
|
|
@@ -3,9 +3,9 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
3
3
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
4
|
};
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
const text_mask_addons_1 = require("@formio/text-mask-addons");
|
|
6
7
|
const vanilla_text_mask_1 = require("@formio/vanilla-text-mask");
|
|
7
8
|
const lodash_1 = __importDefault(require("lodash"));
|
|
8
|
-
const text_mask_addons_1 = require("@formio/text-mask-addons");
|
|
9
9
|
const Input_1 = __importDefault(require("../_classes/input/Input"));
|
|
10
10
|
const utils_1 = require("../../utils/utils");
|
|
11
11
|
class NumberComponent extends Input_1.default {
|
|
@@ -32,25 +32,37 @@ class NumberComponent extends Input_1.default {
|
|
|
32
32
|
schema: NumberComponent.schema()
|
|
33
33
|
};
|
|
34
34
|
}
|
|
35
|
+
static get serverConditionSettings() {
|
|
36
|
+
return NumberComponent.conditionOperatorsSettings;
|
|
37
|
+
}
|
|
38
|
+
static get conditionOperatorsSettings() {
|
|
39
|
+
return Object.assign(Object.assign({}, super.conditionOperatorsSettings), { operators: [...super.conditionOperatorsSettings.operators, 'lessThan', 'greaterThan', 'lessThanOrEqual', 'greaterThanOrEqual'], valueComponent(classComp) {
|
|
40
|
+
return Object.assign(Object.assign({}, classComp), { type: 'number' });
|
|
41
|
+
} });
|
|
42
|
+
}
|
|
43
|
+
static savedValueTypes(schema) {
|
|
44
|
+
schema = schema || {};
|
|
45
|
+
return (0, utils_1.getComponentSavedTypes)(schema) || [utils_1.componentValueTypes.number];
|
|
46
|
+
}
|
|
35
47
|
constructor(...args) {
|
|
36
48
|
var _a, _b;
|
|
37
49
|
super(...args);
|
|
38
50
|
this.validators = this.validators.concat(['min', 'max']);
|
|
39
51
|
const separators = (0, utils_1.getNumberSeparators)(this.options.language || navigator.language);
|
|
40
|
-
|
|
41
|
-
|| ((_a = this.options.properties) === null || _a === void 0 ? void 0 : _a.decimalSeparator)
|
|
42
|
-
|| separators.decimalSeparator;
|
|
52
|
+
const requireDecimal = lodash_1.default.get(this.component, 'requireDecimal', false);
|
|
43
53
|
if (this.component.delimiter) {
|
|
44
54
|
if (this.options.hasOwnProperty('thousandsSeparator')) {
|
|
45
55
|
console.warn("Property 'thousandsSeparator' is deprecated. Please use i18n to specify delimiter.");
|
|
46
56
|
}
|
|
47
|
-
this.delimiter = ((
|
|
57
|
+
this.delimiter = ((_a = this.options.properties) === null || _a === void 0 ? void 0 : _a.thousandsSeparator) || this.options.thousandsSeparator || separators.delimiter;
|
|
48
58
|
}
|
|
49
59
|
else {
|
|
50
60
|
this.delimiter = '';
|
|
51
61
|
}
|
|
52
|
-
const requireDecimal = lodash_1.default.get(this.component, 'requireDecimal', false);
|
|
53
62
|
this.decimalLimit = (0, utils_1.getNumberDecimalLimit)(this.component, requireDecimal ? 2 : 20);
|
|
63
|
+
this.decimalSeparator = this.decimalLimit !== 0 ?
|
|
64
|
+
this.options.decimalSeparator || ((_b = this.options.properties) === null || _b === void 0 ? void 0 : _b.decimalSeparator) || separators.decimalSeparator :
|
|
65
|
+
'';
|
|
54
66
|
// Currencies to override BrowserLanguage Config. Object key {}
|
|
55
67
|
if (lodash_1.default.has(this.options, `languageOverride.${this.options.language}`)) {
|
|
56
68
|
const override = lodash_1.default.get(this.options, `languageOverride.${this.options.language}`);
|
|
@@ -7,6 +7,25 @@ export default class RadioComponent extends ListComponent {
|
|
|
7
7
|
documentation: string;
|
|
8
8
|
schema: any;
|
|
9
9
|
};
|
|
10
|
+
static get conditionOperatorsSettings(): {
|
|
11
|
+
valueComponent(classComp: any): {
|
|
12
|
+
type: string;
|
|
13
|
+
dataSrc: string;
|
|
14
|
+
valueProperty: string;
|
|
15
|
+
dataType: any;
|
|
16
|
+
data: {
|
|
17
|
+
custom(): any;
|
|
18
|
+
};
|
|
19
|
+
};
|
|
20
|
+
constructor: Function;
|
|
21
|
+
toString(): string;
|
|
22
|
+
toLocaleString(): string;
|
|
23
|
+
valueOf(): Object;
|
|
24
|
+
hasOwnProperty(v: PropertyKey): boolean;
|
|
25
|
+
isPrototypeOf(v: Object): boolean;
|
|
26
|
+
propertyIsEnumerable(v: PropertyKey): boolean;
|
|
27
|
+
};
|
|
28
|
+
static savedValueTypes(schema: any): any[];
|
|
10
29
|
constructor(component: any, options: any, data: any);
|
|
11
30
|
previousValue: any;
|
|
12
31
|
get inputInfo(): {
|
|
@@ -23,11 +42,12 @@ export default class RadioComponent extends ListComponent {
|
|
|
23
42
|
get emptyValue(): string;
|
|
24
43
|
get isRadio(): boolean;
|
|
25
44
|
get optionSelectedClass(): string;
|
|
45
|
+
get listData(): any;
|
|
26
46
|
templateData: {} | undefined;
|
|
27
47
|
triggerUpdate: ((...args: any[]) => any) | undefined;
|
|
28
|
-
itemsLoaded: any;
|
|
29
|
-
itemsLoadedResolve: any;
|
|
30
|
-
|
|
48
|
+
itemsLoaded: Promise<any> | undefined;
|
|
49
|
+
itemsLoadedResolve: ((value: any) => void) | undefined;
|
|
50
|
+
optionsLoaded: boolean | undefined;
|
|
31
51
|
loadedOptions: any[] | undefined;
|
|
32
52
|
render(): any;
|
|
33
53
|
detach(element: any): void;
|
|
@@ -36,6 +56,7 @@ export default class RadioComponent extends ListComponent {
|
|
|
36
56
|
getValueAsString(value: any): any;
|
|
37
57
|
setValueAt(index: any, value: any): void;
|
|
38
58
|
loadItems(url: any, search: any, headers: any, options: any, method: any, body: any): void;
|
|
59
|
+
loadItemsFromMetadata(): void;
|
|
39
60
|
setItems(items: any): void;
|
|
40
61
|
setSelectedClasses(): void;
|
|
41
62
|
updateValue(value: any, flags: any): boolean;
|