@formio/js 5.0.0-rc.19 → 5.0.0-rc.21
Sign up to get free protection for your applications and to get access to all the features.
- package/README.md +1 -1
- package/dist/formio.builder.css +14 -22
- package/dist/formio.builder.min.css +1 -1
- package/dist/formio.embed.css +1 -40
- package/dist/formio.embed.js +2 -90
- package/dist/formio.embed.min.css +1 -1
- package/dist/formio.embed.min.js +1 -1
- package/dist/formio.embed.min.js.LICENSE.txt +1 -1
- package/dist/formio.form.css +10 -2
- package/dist/formio.form.js +1267 -1103
- package/dist/formio.form.min.css +1 -1
- package/dist/formio.form.min.js +1 -1
- package/dist/formio.form.min.js.LICENSE.txt +3 -8
- package/dist/formio.full.css +14 -22
- package/dist/formio.full.js +1302 -1127
- package/dist/formio.full.min.css +1 -1
- package/dist/formio.full.min.js +1 -1
- package/dist/formio.full.min.js.LICENSE.txt +3 -8
- package/dist/formio.js +713 -626
- package/dist/formio.min.js +1 -1
- package/dist/formio.min.js.LICENSE.txt +2 -7
- package/dist/formio.utils.js +220 -13
- package/dist/formio.utils.min.js +1 -1
- package/dist/formio.utils.min.js.LICENSE.txt +2 -7
- package/lib/cjs/CDN.d.ts +1 -0
- package/lib/cjs/CDN.js +2 -1
- package/lib/cjs/Element.js +7 -2
- package/lib/cjs/Embed.d.ts +21 -1
- package/lib/cjs/Embed.js +211 -308
- package/lib/cjs/Form.d.ts +9 -6
- package/lib/cjs/Form.js +53 -11
- package/lib/cjs/PDF.d.ts +11 -3
- package/lib/cjs/PDF.js +4 -5
- package/lib/cjs/PDFBuilder.js +2 -3
- package/lib/cjs/Webform.d.ts +10 -13
- package/lib/cjs/Webform.js +46 -125
- package/lib/cjs/WebformBuilder.d.ts +6 -1
- package/lib/cjs/WebformBuilder.js +105 -65
- package/lib/cjs/Wizard.d.ts +8 -5
- package/lib/cjs/Wizard.js +12 -12
- package/lib/cjs/WizardBuilder.d.ts +6 -4
- package/lib/cjs/WizardBuilder.js +20 -3
- package/lib/cjs/addons/FormioAddon.d.ts +1 -1
- package/lib/cjs/addons/FormioAddon.js +1 -2
- package/lib/cjs/components/_classes/component/Component.d.ts +24 -8
- package/lib/cjs/components/_classes/component/Component.js +44 -14
- package/lib/cjs/components/_classes/input/Input.d.ts +1 -1
- package/lib/cjs/components/_classes/input/Input.js +1 -2
- package/lib/cjs/components/_classes/list/ListComponent.d.ts +4 -0
- package/lib/cjs/components/_classes/list/ListComponent.js +43 -6
- package/lib/cjs/components/_classes/multivalue/Multivalue.d.ts +1 -0
- package/lib/cjs/components/_classes/multivalue/Multivalue.js +10 -4
- package/lib/cjs/components/_classes/nested/NestedComponent.d.ts +5 -2
- package/lib/cjs/components/_classes/nested/NestedComponent.js +9 -10
- package/lib/cjs/components/_classes/nestedarray/NestedArrayComponent.d.ts +1 -0
- package/lib/cjs/components/_classes/nestedarray/NestedArrayComponent.js +4 -0
- package/lib/cjs/components/_classes/nesteddata/NestedDataComponent.d.ts +1 -0
- package/lib/cjs/components/_classes/nesteddata/NestedDataComponent.js +4 -0
- package/lib/cjs/components/address/Address.d.ts +8 -0
- package/lib/cjs/components/address/Address.js +5 -0
- package/lib/cjs/components/button/Button.d.ts +1 -0
- package/lib/cjs/components/button/Button.js +5 -3
- package/lib/cjs/components/checkbox/Checkbox.d.ts +41 -0
- package/lib/cjs/components/checkbox/Checkbox.js +32 -5
- package/lib/cjs/components/columns/Columns.d.ts +2 -0
- package/lib/cjs/components/columns/Columns.js +4 -0
- package/lib/cjs/components/container/Container.d.ts +1 -0
- package/lib/cjs/components/container/Container.js +4 -0
- package/lib/cjs/components/content/Content.d.ts +2 -0
- package/lib/cjs/components/content/Content.js +4 -2
- package/lib/cjs/components/currency/editForm/Currency.edit.data.d.ts +14 -2
- package/lib/cjs/components/currency/editForm/Currency.edit.data.js +4 -0
- package/lib/cjs/components/currency/editForm/Currency.edit.display.js +4 -0
- package/lib/cjs/components/datagrid/DataGrid.d.ts +1 -0
- package/lib/cjs/components/datagrid/DataGrid.js +8 -1
- package/lib/cjs/components/datamap/DataMap.d.ts +1 -0
- package/lib/cjs/components/datamap/DataMap.js +4 -0
- package/lib/cjs/components/datetime/DateTime.d.ts +23 -0
- package/lib/cjs/components/datetime/DateTime.js +20 -1
- package/lib/cjs/components/day/Day.d.ts +22 -1
- package/lib/cjs/components/day/Day.js +20 -6
- package/lib/cjs/components/day/fixtures/comp3.js +2 -2
- package/lib/cjs/components/editgrid/EditGrid.d.ts +4 -3
- package/lib/cjs/components/editgrid/EditGrid.js +11 -6
- package/lib/cjs/components/editgrid/fixtures/comp-with-custom-default-value.d.ts +190 -0
- package/lib/cjs/components/editgrid/fixtures/comp-with-custom-default-value.js +227 -0
- package/lib/cjs/components/editgrid/fixtures/comp15.d.ts +54 -0
- package/lib/cjs/components/editgrid/fixtures/comp15.js +51 -0
- package/lib/cjs/components/editgrid/fixtures/index.d.ts +3 -1
- package/lib/cjs/components/editgrid/fixtures/index.js +5 -1
- package/lib/cjs/components/fieldset/Fieldset.d.ts +2 -0
- package/lib/cjs/components/fieldset/Fieldset.js +4 -0
- package/lib/cjs/components/file/File.d.ts +28 -6
- package/lib/cjs/components/file/File.js +40 -15
- package/lib/cjs/components/file/editForm/File.edit.file.d.ts +62 -0
- package/lib/cjs/components/file/editForm/File.edit.file.js +29 -2
- package/lib/cjs/components/form/Form.d.ts +4 -0
- package/lib/cjs/components/form/Form.js +12 -10
- package/lib/cjs/components/hidden/Hidden.d.ts +1 -0
- package/lib/cjs/components/hidden/Hidden.js +1 -0
- package/lib/cjs/components/html/HTML.d.ts +2 -0
- package/lib/cjs/components/html/HTML.js +4 -0
- package/lib/cjs/components/number/Number.d.ts +24 -1
- package/lib/cjs/components/number/Number.js +18 -6
- package/lib/cjs/components/panel/Panel.d.ts +1 -0
- package/lib/cjs/components/panel/Panel.js +3 -0
- package/lib/cjs/components/phonenumber/PhoneNumber.form.js +9 -0
- package/lib/cjs/components/radio/Radio.d.ts +24 -3
- package/lib/cjs/components/radio/Radio.js +89 -18
- package/lib/cjs/components/recaptcha/ReCaptcha.d.ts +2 -1
- package/lib/cjs/components/recaptcha/ReCaptcha.js +7 -5
- package/lib/cjs/components/resource/Resource.d.ts +7 -0
- package/lib/cjs/components/resource/Resource.js +0 -1
- package/lib/cjs/components/resource/editForm/Resource.edit.display.js +1 -1
- package/lib/cjs/components/select/Select.d.ts +25 -5
- package/lib/cjs/components/select/Select.js +51 -51
- package/lib/cjs/components/selectboxes/SelectBoxes.d.ts +37 -0
- package/lib/cjs/components/selectboxes/SelectBoxes.js +60 -25
- package/lib/cjs/components/selectboxes/fixtures/comp4.d.ts +30 -27
- package/lib/cjs/components/selectboxes/fixtures/comp4.js +47 -32
- package/lib/cjs/components/selectboxes/fixtures/comp6.d.ts +14 -0
- package/lib/cjs/components/selectboxes/fixtures/comp6.js +15 -0
- package/lib/cjs/components/selectboxes/fixtures/index.d.ts +2 -1
- package/lib/cjs/components/selectboxes/fixtures/index.js +3 -1
- package/lib/cjs/components/signature/Signature.d.ts +22 -1
- package/lib/cjs/components/signature/Signature.js +16 -3
- package/lib/cjs/components/survey/Survey.d.ts +21 -0
- package/lib/cjs/components/survey/Survey.js +9 -0
- package/lib/cjs/components/table/Table.d.ts +2 -0
- package/lib/cjs/components/table/Table.js +4 -0
- package/lib/cjs/components/tabs/Tabs.d.ts +2 -0
- package/lib/cjs/components/tabs/Tabs.js +4 -0
- package/lib/cjs/components/tags/Tags.d.ts +21 -0
- package/lib/cjs/components/tags/Tags.js +11 -0
- package/lib/cjs/components/textarea/TextArea.d.ts +3 -2
- package/lib/cjs/components/textarea/TextArea.js +4 -5
- package/lib/cjs/components/textarea/fixtures/comp4.d.ts +30 -0
- package/lib/cjs/components/textarea/fixtures/comp4.js +27 -0
- package/lib/cjs/components/textarea/fixtures/index.d.ts +2 -1
- package/lib/cjs/components/textarea/fixtures/index.js +3 -1
- package/lib/cjs/components/textfield/TextField.d.ts +22 -0
- package/lib/cjs/components/textfield/TextField.js +11 -3
- package/lib/cjs/components/time/Time.d.ts +11 -0
- package/lib/cjs/components/time/Time.js +6 -1
- package/lib/cjs/components/tree/Tree.d.ts +5 -4
- package/lib/cjs/components/tree/Tree.form.js +5 -0
- package/lib/cjs/components/tree/Tree.js +8 -9
- package/lib/cjs/components/tree/editForm/Tree.edit.display.d.ts +9 -0
- package/lib/cjs/components/tree/editForm/Tree.edit.display.js +12 -0
- package/lib/cjs/components/well/Well.d.ts +2 -0
- package/lib/cjs/components/well/Well.js +4 -0
- package/lib/cjs/formio.embed.d.ts +2 -1
- package/lib/cjs/formio.embed.js +96 -1
- package/lib/cjs/formio.form.d.ts +4 -3
- package/lib/cjs/formio.form.js +17 -8
- package/lib/cjs/licenses/Licenses.d.ts +7 -0
- package/lib/cjs/licenses/Licenses.js +22 -0
- package/lib/cjs/licenses/index.d.ts +2 -0
- package/lib/cjs/licenses/index.js +7 -0
- package/lib/cjs/providers/Providers.d.ts +31 -11
- package/lib/cjs/providers/address/GoogleAddressProvider.d.ts +2 -2
- package/lib/cjs/providers/address/GoogleAddressProvider.js +2 -3
- package/lib/cjs/providers/processor/fileProcessor.d.ts +1 -1
- package/lib/cjs/providers/processor/fileProcessor.js +1 -5
- package/lib/cjs/providers/storage/azure.d.ts +10 -1
- package/lib/cjs/providers/storage/azure.js +7 -2
- package/lib/cjs/providers/storage/base64.d.ts +2 -2
- package/lib/cjs/providers/storage/base64.js +2 -6
- package/lib/cjs/providers/storage/dropbox.d.ts +2 -2
- package/lib/cjs/providers/storage/dropbox.js +2 -6
- package/lib/cjs/providers/storage/googleDrive.d.ts +3 -2
- package/lib/cjs/providers/storage/googleDrive.js +6 -6
- package/lib/cjs/providers/storage/indexeddb.d.ts +3 -3
- package/lib/cjs/providers/storage/indexeddb.js +9 -13
- package/lib/cjs/providers/storage/s3.d.ts +11 -1
- package/lib/cjs/providers/storage/s3.js +5 -2
- package/lib/cjs/providers/storage/uploadAdapter.js +1 -5
- package/lib/cjs/providers/storage/url.d.ts +2 -2
- package/lib/cjs/providers/storage/url.js +12 -8
- package/lib/cjs/providers/storage/xhr.d.ts +1 -1
- package/lib/cjs/providers/storage/xhr.js +1 -2
- package/lib/cjs/templates/index.d.ts +226 -1
- package/lib/cjs/utils/Evaluator.js +4 -33
- package/lib/cjs/utils/i18n.d.ts +16 -0
- package/lib/cjs/utils/i18n.js +88 -0
- package/lib/cjs/utils/utils.d.ts +11 -1
- package/lib/cjs/utils/utils.js +29 -10
- package/lib/cjs/validator/Validator.d.ts +30 -2
- package/lib/cjs/validator/Validator.js +32 -9
- package/lib/cjs/validator/rules/Select.js +1 -2
- package/lib/cjs/validator/rules/Unique.d.ts +1 -1
- package/lib/cjs/validator/rules/Unique.js +1 -2
- package/lib/cjs/widgets/CalendarWidget.d.ts +1 -0
- package/lib/cjs/widgets/InputWidget.d.ts +1 -1
- package/lib/cjs/widgets/InputWidget.js +1 -2
- package/lib/mjs/CDN.d.ts +1 -0
- package/lib/mjs/CDN.js +2 -1
- package/lib/mjs/Element.js +6 -2
- package/lib/mjs/Embed.d.ts +21 -1
- package/lib/mjs/Embed.js +208 -319
- package/lib/mjs/Form.d.ts +9 -6
- package/lib/mjs/Form.js +53 -11
- package/lib/mjs/PDF.d.ts +11 -3
- package/lib/mjs/PDF.js +4 -5
- package/lib/mjs/PDFBuilder.js +2 -3
- package/lib/mjs/Webform.d.ts +10 -13
- package/lib/mjs/Webform.js +46 -128
- package/lib/mjs/WebformBuilder.d.ts +6 -1
- package/lib/mjs/WebformBuilder.js +103 -65
- package/lib/mjs/Wizard.d.ts +8 -5
- package/lib/mjs/Wizard.js +12 -12
- package/lib/mjs/WizardBuilder.d.ts +6 -4
- package/lib/mjs/WizardBuilder.js +20 -3
- package/lib/mjs/addons/FormioAddon.d.ts +1 -1
- package/lib/mjs/addons/FormioAddon.js +1 -2
- package/lib/mjs/components/_classes/component/Component.d.ts +24 -8
- package/lib/mjs/components/_classes/component/Component.js +44 -14
- package/lib/mjs/components/_classes/input/Input.d.ts +1 -1
- package/lib/mjs/components/_classes/input/Input.js +1 -2
- package/lib/mjs/components/_classes/list/ListComponent.d.ts +4 -0
- package/lib/mjs/components/_classes/list/ListComponent.js +43 -5
- package/lib/mjs/components/_classes/multivalue/Multivalue.d.ts +1 -0
- package/lib/mjs/components/_classes/multivalue/Multivalue.js +10 -4
- package/lib/mjs/components/_classes/nested/NestedComponent.d.ts +5 -2
- package/lib/mjs/components/_classes/nested/NestedComponent.js +9 -10
- package/lib/mjs/components/_classes/nestedarray/NestedArrayComponent.d.ts +1 -0
- package/lib/mjs/components/_classes/nestedarray/NestedArrayComponent.js +4 -0
- package/lib/mjs/components/_classes/nesteddata/NestedDataComponent.d.ts +1 -0
- package/lib/mjs/components/_classes/nesteddata/NestedDataComponent.js +4 -0
- package/lib/mjs/components/address/Address.d.ts +8 -0
- package/lib/mjs/components/address/Address.js +5 -0
- package/lib/mjs/components/button/Button.d.ts +1 -0
- package/lib/mjs/components/button/Button.js +6 -4
- package/lib/mjs/components/checkbox/Checkbox.d.ts +41 -0
- package/lib/mjs/components/checkbox/Checkbox.js +36 -5
- package/lib/mjs/components/columns/Columns.d.ts +2 -0
- package/lib/mjs/components/columns/Columns.js +4 -0
- package/lib/mjs/components/container/Container.d.ts +1 -0
- package/lib/mjs/components/container/Container.js +5 -1
- package/lib/mjs/components/content/Content.d.ts +2 -0
- package/lib/mjs/components/content/Content.js +4 -2
- package/lib/mjs/components/currency/editForm/Currency.edit.data.d.ts +14 -2
- package/lib/mjs/components/currency/editForm/Currency.edit.data.js +4 -0
- package/lib/mjs/components/currency/editForm/Currency.edit.display.js +4 -0
- package/lib/mjs/components/datagrid/DataGrid.d.ts +1 -0
- package/lib/mjs/components/datagrid/DataGrid.js +8 -1
- package/lib/mjs/components/datamap/DataMap.d.ts +1 -0
- package/lib/mjs/components/datamap/DataMap.js +5 -1
- package/lib/mjs/components/datetime/DateTime.d.ts +23 -0
- package/lib/mjs/components/datetime/DateTime.js +27 -1
- package/lib/mjs/components/day/Day.d.ts +22 -1
- package/lib/mjs/components/day/Day.js +24 -7
- package/lib/mjs/components/day/fixtures/comp3.js +2 -2
- package/lib/mjs/components/editgrid/EditGrid.d.ts +4 -3
- package/lib/mjs/components/editgrid/EditGrid.js +11 -6
- package/lib/mjs/components/editgrid/fixtures/comp-with-custom-default-value.d.ts +190 -0
- package/lib/mjs/components/editgrid/fixtures/comp-with-custom-default-value.js +225 -0
- package/lib/mjs/components/editgrid/fixtures/comp15.d.ts +54 -0
- package/lib/mjs/components/editgrid/fixtures/comp15.js +49 -0
- package/lib/mjs/components/editgrid/fixtures/index.d.ts +3 -1
- package/lib/mjs/components/editgrid/fixtures/index.js +3 -1
- package/lib/mjs/components/fieldset/Fieldset.d.ts +2 -0
- package/lib/mjs/components/fieldset/Fieldset.js +4 -0
- package/lib/mjs/components/file/File.d.ts +28 -6
- package/lib/mjs/components/file/File.js +44 -16
- package/lib/mjs/components/file/editForm/File.edit.file.d.ts +62 -0
- package/lib/mjs/components/file/editForm/File.edit.file.js +29 -2
- package/lib/mjs/components/form/Form.d.ts +4 -0
- package/lib/mjs/components/form/Form.js +13 -11
- package/lib/mjs/components/hidden/Hidden.d.ts +1 -0
- package/lib/mjs/components/hidden/Hidden.js +1 -0
- package/lib/mjs/components/html/HTML.d.ts +2 -0
- package/lib/mjs/components/html/HTML.js +4 -0
- package/lib/mjs/components/number/Number.d.ts +24 -1
- package/lib/mjs/components/number/Number.js +23 -7
- package/lib/mjs/components/panel/Panel.d.ts +1 -0
- package/lib/mjs/components/panel/Panel.js +3 -0
- package/lib/mjs/components/phonenumber/PhoneNumber.form.js +9 -0
- package/lib/mjs/components/radio/Radio.d.ts +24 -3
- package/lib/mjs/components/radio/Radio.js +93 -19
- package/lib/mjs/components/recaptcha/ReCaptcha.d.ts +2 -1
- package/lib/mjs/components/recaptcha/ReCaptcha.js +7 -5
- package/lib/mjs/components/resource/Resource.d.ts +7 -0
- package/lib/mjs/components/resource/Resource.js +0 -1
- package/lib/mjs/components/resource/editForm/Resource.edit.display.js +1 -1
- package/lib/mjs/components/select/Select.d.ts +25 -5
- package/lib/mjs/components/select/Select.js +55 -52
- package/lib/mjs/components/selectboxes/SelectBoxes.d.ts +37 -0
- package/lib/mjs/components/selectboxes/SelectBoxes.js +63 -25
- package/lib/mjs/components/selectboxes/fixtures/comp4.d.ts +30 -27
- package/lib/mjs/components/selectboxes/fixtures/comp4.js +47 -32
- package/lib/mjs/components/selectboxes/fixtures/comp6.d.ts +14 -0
- package/lib/mjs/components/selectboxes/fixtures/comp6.js +13 -0
- package/lib/mjs/components/selectboxes/fixtures/index.d.ts +2 -1
- package/lib/mjs/components/selectboxes/fixtures/index.js +2 -1
- package/lib/mjs/components/signature/Signature.d.ts +22 -1
- package/lib/mjs/components/signature/Signature.js +19 -3
- package/lib/mjs/components/survey/Survey.d.ts +21 -0
- package/lib/mjs/components/survey/Survey.js +13 -1
- package/lib/mjs/components/table/Table.d.ts +2 -0
- package/lib/mjs/components/table/Table.js +4 -0
- package/lib/mjs/components/tabs/Tabs.d.ts +2 -0
- package/lib/mjs/components/tabs/Tabs.js +4 -0
- package/lib/mjs/components/tags/Tags.d.ts +21 -0
- package/lib/mjs/components/tags/Tags.js +14 -0
- package/lib/mjs/components/textarea/TextArea.d.ts +3 -2
- package/lib/mjs/components/textarea/TextArea.js +4 -5
- package/lib/mjs/components/textarea/fixtures/comp4.d.ts +30 -0
- package/lib/mjs/components/textarea/fixtures/comp4.js +25 -0
- package/lib/mjs/components/textarea/fixtures/index.d.ts +2 -1
- package/lib/mjs/components/textarea/fixtures/index.js +2 -1
- package/lib/mjs/components/textfield/TextField.d.ts +22 -0
- package/lib/mjs/components/textfield/TextField.js +14 -3
- package/lib/mjs/components/time/Time.d.ts +11 -0
- package/lib/mjs/components/time/Time.js +12 -1
- package/lib/mjs/components/tree/Tree.d.ts +5 -4
- package/lib/mjs/components/tree/Tree.form.js +5 -0
- package/lib/mjs/components/tree/Tree.js +8 -9
- package/lib/mjs/components/tree/editForm/Tree.edit.display.d.ts +9 -0
- package/lib/mjs/components/tree/editForm/Tree.edit.display.js +10 -0
- package/lib/mjs/components/well/Well.d.ts +2 -0
- package/lib/mjs/components/well/Well.js +4 -0
- package/lib/mjs/formio.embed.d.ts +2 -1
- package/lib/mjs/formio.embed.js +96 -2
- package/lib/mjs/formio.form.d.ts +4 -3
- package/lib/mjs/formio.form.js +16 -8
- package/lib/mjs/licenses/Licenses.d.ts +7 -0
- package/lib/mjs/licenses/Licenses.js +17 -0
- package/lib/mjs/licenses/index.d.ts +2 -0
- package/lib/mjs/licenses/index.js +2 -0
- package/lib/mjs/providers/Providers.d.ts +31 -11
- package/lib/mjs/providers/address/GoogleAddressProvider.d.ts +2 -2
- package/lib/mjs/providers/address/GoogleAddressProvider.js +2 -3
- package/lib/mjs/providers/processor/fileProcessor.d.ts +1 -1
- package/lib/mjs/providers/processor/fileProcessor.js +1 -2
- package/lib/mjs/providers/storage/azure.d.ts +10 -1
- package/lib/mjs/providers/storage/azure.js +7 -2
- package/lib/mjs/providers/storage/base64.d.ts +2 -2
- package/lib/mjs/providers/storage/base64.js +2 -3
- package/lib/mjs/providers/storage/dropbox.d.ts +2 -2
- package/lib/mjs/providers/storage/dropbox.js +2 -3
- package/lib/mjs/providers/storage/googleDrive.d.ts +3 -2
- package/lib/mjs/providers/storage/googleDrive.js +6 -3
- package/lib/mjs/providers/storage/indexeddb.d.ts +3 -3
- package/lib/mjs/providers/storage/indexeddb.js +9 -10
- package/lib/mjs/providers/storage/s3.d.ts +11 -1
- package/lib/mjs/providers/storage/s3.js +5 -2
- package/lib/mjs/providers/storage/uploadAdapter.js +1 -2
- package/lib/mjs/providers/storage/url.d.ts +2 -2
- package/lib/mjs/providers/storage/url.js +12 -5
- package/lib/mjs/providers/storage/xhr.d.ts +1 -1
- package/lib/mjs/providers/storage/xhr.js +1 -2
- package/lib/mjs/templates/index.d.ts +226 -1
- package/lib/mjs/utils/Evaluator.js +4 -33
- package/lib/mjs/utils/i18n.d.ts +16 -0
- package/lib/mjs/utils/i18n.js +81 -0
- package/lib/mjs/utils/utils.d.ts +11 -1
- package/lib/mjs/utils/utils.js +27 -9
- package/lib/mjs/validator/Validator.d.ts +30 -2
- package/lib/mjs/validator/Validator.js +31 -9
- package/lib/mjs/validator/rules/Select.js +1 -2
- package/lib/mjs/validator/rules/Unique.d.ts +1 -1
- package/lib/mjs/validator/rules/Unique.js +1 -2
- package/lib/mjs/widgets/CalendarWidget.d.ts +1 -0
- package/lib/mjs/widgets/InputWidget.d.ts +1 -1
- package/lib/mjs/widgets/InputWidget.js +1 -2
- package/package.json +18 -15
- package/types/index.d.ts +1 -0
- package/types/licenses.d.ts +7 -0
- package/types/utils.d.ts +2 -0
@@ -1,4 +1,5 @@
|
|
1
1
|
import _ from 'lodash';
|
2
|
+
import { componentValueTypes, getComponentSavedTypes } from '../../utils/utils';
|
2
3
|
import RadioComponent from '../radio/Radio';
|
3
4
|
export default class SelectBoxesComponent extends RadioComponent {
|
4
5
|
static schema(...extend) {
|
@@ -19,6 +20,28 @@ export default class SelectBoxesComponent extends RadioComponent {
|
|
19
20
|
schema: SelectBoxesComponent.schema()
|
20
21
|
};
|
21
22
|
}
|
23
|
+
static get serverConditionSettings() {
|
24
|
+
return SelectBoxesComponent.conditionOperatorsSettings;
|
25
|
+
}
|
26
|
+
static get conditionOperatorsSettings() {
|
27
|
+
return {
|
28
|
+
...super.conditionOperatorsSettings,
|
29
|
+
valueComponent(classComp) {
|
30
|
+
return {
|
31
|
+
type: 'select',
|
32
|
+
dataSrc: 'custom',
|
33
|
+
valueProperty: 'value',
|
34
|
+
valueType: 'string',
|
35
|
+
data: {
|
36
|
+
custom: `values = ${classComp && classComp.values ? JSON.stringify(classComp.values) : []}`
|
37
|
+
},
|
38
|
+
};
|
39
|
+
}
|
40
|
+
};
|
41
|
+
}
|
42
|
+
static savedValueTypes(schema) {
|
43
|
+
return getComponentSavedTypes(schema) || [componentValueTypes.object];
|
44
|
+
}
|
22
45
|
constructor(...args) {
|
23
46
|
super(...args);
|
24
47
|
this.validators = this.validators.concat('minSelectedCount', 'maxSelectedCount', 'availableValueProperty');
|
@@ -104,6 +127,16 @@ export default class SelectBoxesComponent extends RadioComponent {
|
|
104
127
|
value[val] = true;
|
105
128
|
});
|
106
129
|
}
|
130
|
+
const checkedValues = _.keys(_.pickBy(value, (val) => val));
|
131
|
+
if (this.isSelectURL && this.templateData && _.every(checkedValues, (val) => this.templateData[val])) {
|
132
|
+
const submission = this.root.submission;
|
133
|
+
if (!submission.metadata.selectData) {
|
134
|
+
submission.metadata.selectData = {};
|
135
|
+
}
|
136
|
+
const selectData = [];
|
137
|
+
checkedValues.forEach((value) => selectData.push(this.templateData[value]));
|
138
|
+
_.set(submission.metadata.selectData, this.path, selectData);
|
139
|
+
}
|
107
140
|
return value;
|
108
141
|
}
|
109
142
|
/**
|
@@ -134,6 +167,9 @@ export default class SelectBoxesComponent extends RadioComponent {
|
|
134
167
|
if (!value) {
|
135
168
|
return '';
|
136
169
|
}
|
170
|
+
if (this.isSelectURL) {
|
171
|
+
return _(value).pickBy((val) => val).keys().join(', ');
|
172
|
+
}
|
137
173
|
return _(this.component.values || [])
|
138
174
|
.filter((v) => value[v.value])
|
139
175
|
.map('label')
|
@@ -151,7 +187,7 @@ export default class SelectBoxesComponent extends RadioComponent {
|
|
151
187
|
key = valuesKeys.find((k) => input?.value.toString() === k);
|
152
188
|
}
|
153
189
|
const isChecked = value[key];
|
154
|
-
if (isChecked && key) {
|
190
|
+
if ((isChecked && key) || (this.isSelectURL && !this.shouldLoad && this.listData && _.findIndex(this.selectData, this.listData[index]) !== -1)) {
|
155
191
|
//add class to container when selected
|
156
192
|
this.addClass(wrapper, this.optionSelectedClass);
|
157
193
|
//change "checked" attribute
|
@@ -176,31 +212,33 @@ export default class SelectBoxesComponent extends RadioComponent {
|
|
176
212
|
checkComponentValidity(data, dirty, rowData, options) {
|
177
213
|
const minCount = this.component.validate.minSelectedCount;
|
178
214
|
const maxCount = this.component.validate.maxSelectedCount;
|
179
|
-
|
180
|
-
|
181
|
-
|
182
|
-
|
183
|
-
|
215
|
+
if (!this.shouldSkipValidation(data, dirty, rowData)) {
|
216
|
+
const isValid = this.isValid(data, dirty);
|
217
|
+
if ((maxCount || minCount)) {
|
218
|
+
const count = Object.keys(this.validationValue).reduce((total, key) => {
|
219
|
+
if (this.validationValue[key]) {
|
220
|
+
total++;
|
221
|
+
}
|
222
|
+
return total;
|
223
|
+
}, 0);
|
224
|
+
// Disable the rest of inputs if the max amount is already checked
|
225
|
+
if (maxCount && count >= maxCount) {
|
226
|
+
this.setInputsDisabled(true, true);
|
227
|
+
}
|
228
|
+
else if (maxCount && !this.shouldDisabled) {
|
229
|
+
this.setInputsDisabled(false);
|
230
|
+
}
|
231
|
+
if (!isValid && maxCount && count > maxCount) {
|
232
|
+
const message = this.t(this.component.maxSelectedCountMessage || 'You can only select up to {{maxCount}} items.', { maxCount });
|
233
|
+
this.setCustomValidity(message, dirty);
|
234
|
+
return false;
|
235
|
+
}
|
236
|
+
else if (!isValid && minCount && count < minCount) {
|
237
|
+
this.setInputsDisabled(false);
|
238
|
+
const message = this.t(this.component.minSelectedCountMessage || 'You must select at least {{minCount}} items.', { minCount });
|
239
|
+
this.setCustomValidity(message, dirty);
|
240
|
+
return false;
|
184
241
|
}
|
185
|
-
return total;
|
186
|
-
}, 0);
|
187
|
-
// Disable the rest of inputs if the max amount is already checked
|
188
|
-
if (maxCount && count >= maxCount) {
|
189
|
-
this.setInputsDisabled(true, true);
|
190
|
-
}
|
191
|
-
else if (maxCount && !this.shouldDisabled) {
|
192
|
-
this.setInputsDisabled(false);
|
193
|
-
}
|
194
|
-
if (!isValid && maxCount && count > maxCount) {
|
195
|
-
const message = this.t(this.component.maxSelectedCountMessage || 'You can only select up to {{maxCount}} items.', { maxCount });
|
196
|
-
this.setCustomValidity(message, dirty);
|
197
|
-
return false;
|
198
|
-
}
|
199
|
-
else if (!isValid && minCount && count < minCount) {
|
200
|
-
this.setInputsDisabled(false);
|
201
|
-
const message = this.t(this.component.minSelectedCountMessage || 'You must select at least {{minCount}} items.', { minCount });
|
202
|
-
this.setCustomValidity(message, dirty);
|
203
|
-
return false;
|
204
242
|
}
|
205
243
|
}
|
206
244
|
return super.checkComponentValidity(data, dirty, rowData, options);
|
@@ -11,39 +11,46 @@ declare namespace _default {
|
|
11
11
|
key: string;
|
12
12
|
type: string;
|
13
13
|
input: boolean;
|
14
|
-
optionsLabelPosition?: undefined;
|
15
|
-
defaultValue?: undefined;
|
16
|
-
values?: undefined;
|
17
|
-
validate?: undefined;
|
18
14
|
conditional?: undefined;
|
19
|
-
|
15
|
+
components?: undefined;
|
20
16
|
disableOnInvalid?: undefined;
|
21
17
|
} | {
|
22
18
|
label: string;
|
23
|
-
optionsLabelPosition: string;
|
24
19
|
tableView: boolean;
|
25
|
-
defaultValue: {
|
26
|
-
'1': boolean;
|
27
|
-
'2': boolean;
|
28
|
-
'3': boolean;
|
29
|
-
};
|
30
|
-
values: {
|
31
|
-
label: string;
|
32
|
-
value: string;
|
33
|
-
shortcut: string;
|
34
|
-
}[];
|
35
|
-
validate: {
|
36
|
-
minSelectedCount: number;
|
37
|
-
};
|
38
20
|
key: string;
|
39
21
|
conditional: {
|
40
22
|
show: boolean;
|
41
|
-
|
42
|
-
|
23
|
+
conjunction: string;
|
24
|
+
conditions: {
|
25
|
+
component: string;
|
26
|
+
operator: string;
|
27
|
+
value: boolean;
|
28
|
+
}[];
|
43
29
|
};
|
44
30
|
type: string;
|
45
31
|
input: boolean;
|
46
|
-
|
32
|
+
components: {
|
33
|
+
label: string;
|
34
|
+
optionsLabelPosition: string;
|
35
|
+
tableView: boolean;
|
36
|
+
defaultValue: {
|
37
|
+
'1': boolean;
|
38
|
+
'2': boolean;
|
39
|
+
'3': boolean;
|
40
|
+
};
|
41
|
+
values: {
|
42
|
+
label: string;
|
43
|
+
value: string;
|
44
|
+
shortcut: string;
|
45
|
+
}[];
|
46
|
+
validate: {
|
47
|
+
minSelectedCount: number;
|
48
|
+
};
|
49
|
+
key: string;
|
50
|
+
type: string;
|
51
|
+
input: boolean;
|
52
|
+
inputType: string;
|
53
|
+
}[];
|
47
54
|
disableOnInvalid?: undefined;
|
48
55
|
} | {
|
49
56
|
type: string;
|
@@ -52,12 +59,8 @@ declare namespace _default {
|
|
52
59
|
disableOnInvalid: boolean;
|
53
60
|
input: boolean;
|
54
61
|
tableView: boolean;
|
55
|
-
optionsLabelPosition?: undefined;
|
56
|
-
defaultValue?: undefined;
|
57
|
-
values?: undefined;
|
58
|
-
validate?: undefined;
|
59
62
|
conditional?: undefined;
|
60
|
-
|
63
|
+
components?: undefined;
|
61
64
|
})[];
|
62
65
|
}
|
63
66
|
export default _default;
|
@@ -14,43 +14,58 @@ export default {
|
|
14
14
|
input: true
|
15
15
|
},
|
16
16
|
{
|
17
|
-
label: '
|
18
|
-
optionsLabelPosition: 'right',
|
17
|
+
label: 'Container',
|
19
18
|
tableView: false,
|
20
|
-
|
21
|
-
'1': false,
|
22
|
-
'2': false,
|
23
|
-
'3': false
|
24
|
-
},
|
25
|
-
values: [
|
26
|
-
{
|
27
|
-
label: '1',
|
28
|
-
value: '1',
|
29
|
-
shortcut: ''
|
30
|
-
},
|
31
|
-
{
|
32
|
-
label: '2',
|
33
|
-
value: '2',
|
34
|
-
shortcut: ''
|
35
|
-
},
|
36
|
-
{
|
37
|
-
label: '3',
|
38
|
-
value: '3',
|
39
|
-
shortcut: ''
|
40
|
-
}
|
41
|
-
],
|
42
|
-
validate: {
|
43
|
-
minSelectedCount: 1
|
44
|
-
},
|
45
|
-
key: 'selectBoxes1',
|
19
|
+
key: 'container',
|
46
20
|
conditional: {
|
47
21
|
show: true,
|
48
|
-
|
49
|
-
|
22
|
+
conjunction: 'all',
|
23
|
+
conditions: [
|
24
|
+
{
|
25
|
+
component: 'checkbox',
|
26
|
+
operator: 'isEqual',
|
27
|
+
value: true
|
28
|
+
}
|
29
|
+
]
|
50
30
|
},
|
51
|
-
type: '
|
31
|
+
type: 'container',
|
52
32
|
input: true,
|
53
|
-
|
33
|
+
components: [
|
34
|
+
{
|
35
|
+
label: 'Select Boxes',
|
36
|
+
optionsLabelPosition: 'right',
|
37
|
+
tableView: false,
|
38
|
+
defaultValue: {
|
39
|
+
'1': false,
|
40
|
+
'2': false,
|
41
|
+
'3': false
|
42
|
+
},
|
43
|
+
values: [
|
44
|
+
{
|
45
|
+
label: '1',
|
46
|
+
value: '1',
|
47
|
+
shortcut: ''
|
48
|
+
},
|
49
|
+
{
|
50
|
+
label: '2',
|
51
|
+
value: '2',
|
52
|
+
shortcut: ''
|
53
|
+
},
|
54
|
+
{
|
55
|
+
label: '3',
|
56
|
+
value: '3',
|
57
|
+
shortcut: ''
|
58
|
+
}
|
59
|
+
],
|
60
|
+
validate: {
|
61
|
+
minSelectedCount: 1
|
62
|
+
},
|
63
|
+
key: 'selectBoxes',
|
64
|
+
type: 'selectboxes',
|
65
|
+
input: true,
|
66
|
+
inputType: 'checkbox'
|
67
|
+
}
|
68
|
+
]
|
54
69
|
},
|
55
70
|
{
|
56
71
|
type: 'button',
|
@@ -0,0 +1,14 @@
|
|
1
|
+
declare namespace _default {
|
2
|
+
const label: string;
|
3
|
+
const dataSrc: string;
|
4
|
+
namespace data {
|
5
|
+
const url: string;
|
6
|
+
}
|
7
|
+
const valueProperty: string;
|
8
|
+
const template: string;
|
9
|
+
const key: string;
|
10
|
+
const type: string;
|
11
|
+
const input: boolean;
|
12
|
+
const inputType: string;
|
13
|
+
}
|
14
|
+
export default _default;
|
@@ -0,0 +1,13 @@
|
|
1
|
+
export default {
|
2
|
+
label: 'Select Boxes',
|
3
|
+
dataSrc: 'url',
|
4
|
+
data: {
|
5
|
+
url: 'https://cdn.rawgit.com/mshafrir/2646763/raw/states_titlecase.json'
|
6
|
+
},
|
7
|
+
valueProperty: 'abbreviation',
|
8
|
+
template: '<span>{{ item.name }}</span>',
|
9
|
+
key: 'selectBoxes',
|
10
|
+
type: 'selectboxes',
|
11
|
+
input: true,
|
12
|
+
inputType: 'checkbox',
|
13
|
+
};
|
@@ -7,6 +7,27 @@ export default class SignatureComponent extends Input {
|
|
7
7
|
documentation: string;
|
8
8
|
schema: any;
|
9
9
|
};
|
10
|
+
static get serverConditionSettings(): {
|
11
|
+
operators: string[];
|
12
|
+
constructor: Function;
|
13
|
+
toString(): string;
|
14
|
+
toLocaleString(): string;
|
15
|
+
valueOf(): Object;
|
16
|
+
hasOwnProperty(v: PropertyKey): boolean;
|
17
|
+
isPrototypeOf(v: Object): boolean;
|
18
|
+
propertyIsEnumerable(v: PropertyKey): boolean;
|
19
|
+
};
|
20
|
+
static get conditionOperatorsSettings(): {
|
21
|
+
operators: string[];
|
22
|
+
constructor: Function;
|
23
|
+
toString(): string;
|
24
|
+
toLocaleString(): string;
|
25
|
+
valueOf(): Object;
|
26
|
+
hasOwnProperty(v: PropertyKey): boolean;
|
27
|
+
isPrototypeOf(v: Object): boolean;
|
28
|
+
propertyIsEnumerable(v: PropertyKey): boolean;
|
29
|
+
};
|
30
|
+
static savedValueTypes(schema: any): string[];
|
10
31
|
currentWidth: any;
|
11
32
|
scale: any;
|
12
33
|
ratio: number | undefined;
|
@@ -17,7 +38,7 @@ export default class SignatureComponent extends Input {
|
|
17
38
|
checkSize(force: any, scale: any): void;
|
18
39
|
signaturePad: SignaturePad | null | undefined;
|
19
40
|
observer: _ResizeObserver | null | undefined;
|
20
|
-
getValueAsString(value: any): "Yes" | "No";
|
41
|
+
getValueAsString(value: any): "" | "Yes" | "No";
|
21
42
|
focus(): void;
|
22
43
|
setDataToSigaturePad(): void;
|
23
44
|
}
|
@@ -2,6 +2,7 @@ import SignaturePad from 'signature_pad';
|
|
2
2
|
import _ResizeObserver from 'resize-observer-polyfill';
|
3
3
|
import Input from '../_classes/input/Input';
|
4
4
|
import _ from 'lodash';
|
5
|
+
import { componentValueTypes, getComponentSavedTypes } from '../../utils/utils';
|
5
6
|
export default class SignatureComponent extends Input {
|
6
7
|
static schema(...extend) {
|
7
8
|
return Input.schema({
|
@@ -28,11 +29,23 @@ export default class SignatureComponent extends Input {
|
|
28
29
|
schema: SignatureComponent.schema()
|
29
30
|
};
|
30
31
|
}
|
32
|
+
static get serverConditionSettings() {
|
33
|
+
return SignatureComponent.conditionOperatorsSettings;
|
34
|
+
}
|
35
|
+
static get conditionOperatorsSettings() {
|
36
|
+
return {
|
37
|
+
...super.conditionOperatorsSettings,
|
38
|
+
operators: ['isEmpty', 'isNotEmpty'],
|
39
|
+
};
|
40
|
+
}
|
41
|
+
static savedValueTypes(schema) {
|
42
|
+
schema = schema || {};
|
43
|
+
return getComponentSavedTypes(schema) || [componentValueTypes.string];
|
44
|
+
}
|
31
45
|
init() {
|
32
46
|
super.init();
|
33
47
|
this.currentWidth = 0;
|
34
48
|
this.scale = 1;
|
35
|
-
this.ratio = 1;
|
36
49
|
if (!this.component.width) {
|
37
50
|
this.component.width = '100%';
|
38
51
|
}
|
@@ -129,9 +142,9 @@ export default class SignatureComponent extends Input {
|
|
129
142
|
this.scale = force ? scale : this.scale;
|
130
143
|
this.currentWidth = this.refs.padBody.offsetWidth;
|
131
144
|
const width = this.currentWidth * this.scale;
|
132
|
-
this.refs.canvas.width = width;
|
133
145
|
const height = this.ratio ? width / this.ratio : this.refs.padBody.offsetHeight * this.scale;
|
134
|
-
const maxHeight = this.refs.padBody.offsetHeight * this.scale;
|
146
|
+
const maxHeight = this.ratio ? height : this.refs.padBody.offsetHeight * this.scale;
|
147
|
+
this.refs.canvas.width = width;
|
135
148
|
this.refs.canvas.height = height > maxHeight ? maxHeight : height;
|
136
149
|
this.refs.canvas.style.maxWidth = `${this.currentWidth * this.scale}px`;
|
137
150
|
this.refs.canvas.style.maxHeight = `${maxHeight}px`;
|
@@ -225,6 +238,9 @@ export default class SignatureComponent extends Input {
|
|
225
238
|
super.detach();
|
226
239
|
}
|
227
240
|
getValueAsString(value) {
|
241
|
+
if (_.isUndefined(value) && this.inDataTable) {
|
242
|
+
return '';
|
243
|
+
}
|
228
244
|
return value ? 'Yes' : 'No';
|
229
245
|
}
|
230
246
|
focus() {
|
@@ -7,6 +7,27 @@ export default class SurveyComponent extends Field {
|
|
7
7
|
documentation: string;
|
8
8
|
schema: any;
|
9
9
|
};
|
10
|
+
static get serverConditionSettings(): {
|
11
|
+
operators: string[];
|
12
|
+
constructor: Function;
|
13
|
+
toString(): string;
|
14
|
+
toLocaleString(): string;
|
15
|
+
valueOf(): Object;
|
16
|
+
hasOwnProperty(v: PropertyKey): boolean;
|
17
|
+
isPrototypeOf(v: Object): boolean;
|
18
|
+
propertyIsEnumerable(v: PropertyKey): boolean;
|
19
|
+
};
|
20
|
+
static get conditionOperatorsSettings(): {
|
21
|
+
operators: string[];
|
22
|
+
constructor: Function;
|
23
|
+
toString(): string;
|
24
|
+
toLocaleString(): string;
|
25
|
+
valueOf(): Object;
|
26
|
+
hasOwnProperty(v: PropertyKey): boolean;
|
27
|
+
isPrototypeOf(v: Object): boolean;
|
28
|
+
propertyIsEnumerable(v: PropertyKey): boolean;
|
29
|
+
};
|
30
|
+
static savedValueTypes(schema: any): string[];
|
10
31
|
render(): any;
|
11
32
|
setValue(value: any, flags?: {}): boolean;
|
12
33
|
get emptyValue(): {};
|
@@ -1,6 +1,6 @@
|
|
1
1
|
import _ from 'lodash';
|
2
2
|
import Field from '../_classes/field/Field';
|
3
|
-
import { boolValue } from '../../utils/utils';
|
3
|
+
import { boolValue, componentValueTypes, getComponentSavedTypes } from '../../utils/utils';
|
4
4
|
export default class SurveyComponent extends Field {
|
5
5
|
static schema(...extend) {
|
6
6
|
return Field.schema({
|
@@ -21,6 +21,18 @@ export default class SurveyComponent extends Field {
|
|
21
21
|
schema: SurveyComponent.schema()
|
22
22
|
};
|
23
23
|
}
|
24
|
+
static get serverConditionSettings() {
|
25
|
+
return SurveyComponent.conditionOperatorsSettings;
|
26
|
+
}
|
27
|
+
static get conditionOperatorsSettings() {
|
28
|
+
return {
|
29
|
+
...super.conditionOperatorsSettings,
|
30
|
+
operators: ['isEmpty', 'isNotEmpty'],
|
31
|
+
};
|
32
|
+
}
|
33
|
+
static savedValueTypes(schema) {
|
34
|
+
return getComponentSavedTypes(schema) || [componentValueTypes.object];
|
35
|
+
}
|
24
36
|
get defaultSchema() {
|
25
37
|
return SurveyComponent.schema();
|
26
38
|
}
|
@@ -8,8 +8,10 @@ export default class TableComponent extends NestedComponent {
|
|
8
8
|
icon: string;
|
9
9
|
weight: number;
|
10
10
|
documentation: string;
|
11
|
+
showPreview: boolean;
|
11
12
|
schema: any;
|
12
13
|
};
|
14
|
+
static savedValueTypes(): never[];
|
13
15
|
constructor(...args: any[]);
|
14
16
|
get cellClassName(): string;
|
15
17
|
get tableKey(): string;
|
@@ -39,9 +39,13 @@ export default class TableComponent extends NestedComponent {
|
|
39
39
|
icon: 'table',
|
40
40
|
weight: 40,
|
41
41
|
documentation: '/userguide/form-building/layout-components#table',
|
42
|
+
showPreview: false,
|
42
43
|
schema: TableComponent.schema()
|
43
44
|
};
|
44
45
|
}
|
46
|
+
static savedValueTypes() {
|
47
|
+
return [];
|
48
|
+
}
|
45
49
|
get defaultSchema() {
|
46
50
|
return TableComponent.schema();
|
47
51
|
}
|
@@ -5,8 +5,10 @@ export default class TabsComponent extends NestedComponent {
|
|
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
|
constructor(...args: any[]);
|
11
13
|
get tabKey(): string;
|
12
14
|
get tabLikey(): string;
|
@@ -26,9 +26,13 @@ export default class TabsComponent extends NestedComponent {
|
|
26
26
|
icon: 'folder-o',
|
27
27
|
weight: 50,
|
28
28
|
documentation: '/userguide/form-building/layout-components#tabs',
|
29
|
+
showPreview: false,
|
29
30
|
schema: TabsComponent.schema(),
|
30
31
|
};
|
31
32
|
}
|
33
|
+
static savedValueTypes() {
|
34
|
+
return [];
|
35
|
+
}
|
32
36
|
get defaultSchema() {
|
33
37
|
return TabsComponent.schema();
|
34
38
|
}
|
@@ -7,6 +7,27 @@ export default class TagsComponent extends Input {
|
|
7
7
|
weight: number;
|
8
8
|
schema: any;
|
9
9
|
};
|
10
|
+
static get serverConditionSettings(): {
|
11
|
+
operators: any[];
|
12
|
+
constructor: Function;
|
13
|
+
toString(): string;
|
14
|
+
toLocaleString(): string;
|
15
|
+
valueOf(): Object;
|
16
|
+
hasOwnProperty(v: PropertyKey): boolean;
|
17
|
+
isPrototypeOf(v: Object): boolean;
|
18
|
+
propertyIsEnumerable(v: PropertyKey): boolean;
|
19
|
+
};
|
20
|
+
static get conditionOperatorsSettings(): {
|
21
|
+
operators: any[];
|
22
|
+
constructor: Function;
|
23
|
+
toString(): string;
|
24
|
+
toLocaleString(): string;
|
25
|
+
valueOf(): Object;
|
26
|
+
hasOwnProperty(v: PropertyKey): boolean;
|
27
|
+
isPrototypeOf(v: Object): boolean;
|
28
|
+
propertyIsEnumerable(v: PropertyKey): boolean;
|
29
|
+
};
|
30
|
+
static savedValueTypes(schema: any): any[];
|
10
31
|
get emptyValue(): "" | never[];
|
11
32
|
get delimiter(): any;
|
12
33
|
attachElement(element: any, index: any): void;
|
@@ -1,3 +1,4 @@
|
|
1
|
+
import { componentValueTypes, getComponentSavedTypes } from '../../utils/utils';
|
1
2
|
import Input from '../_classes/input/Input';
|
2
3
|
import Choices from '@formio/choices.js';
|
3
4
|
export default class TagsComponent extends Input {
|
@@ -21,6 +22,19 @@ export default class TagsComponent extends Input {
|
|
21
22
|
schema: TagsComponent.schema()
|
22
23
|
};
|
23
24
|
}
|
25
|
+
static get serverConditionSettings() {
|
26
|
+
return TagsComponent.conditionOperatorsSettings;
|
27
|
+
}
|
28
|
+
static get conditionOperatorsSettings() {
|
29
|
+
return {
|
30
|
+
...super.conditionOperatorsSettings,
|
31
|
+
operators: [...super.conditionOperatorsSettings.operators, 'includes', 'notIncludes'],
|
32
|
+
};
|
33
|
+
}
|
34
|
+
static savedValueTypes(schema) {
|
35
|
+
schema = schema || {};
|
36
|
+
return getComponentSavedTypes(schema) || [componentValueTypes[schema.storeas] || componentValueTypes.string];
|
37
|
+
}
|
24
38
|
init() {
|
25
39
|
super.init();
|
26
40
|
}
|
@@ -10,6 +10,7 @@ export default class TextAreaComponent extends TextFieldComponent {
|
|
10
10
|
*/
|
11
11
|
updateEditorValue(index: any, newValue: any): void;
|
12
12
|
autoModified: boolean | undefined;
|
13
|
+
attachElement(element: any, index: any): any;
|
13
14
|
imageHandler(moduleInstance: any, range: any, files: any): void;
|
14
15
|
get isPlain(): boolean;
|
15
16
|
get htmlView(): any;
|
@@ -19,8 +20,8 @@ export default class TextAreaComponent extends TextFieldComponent {
|
|
19
20
|
setReadOnlyValue(value: any, index: any): void;
|
20
21
|
get isJsonValue(): any;
|
21
22
|
setConvertedValue(value: any, index: any): any;
|
22
|
-
setAsyncConvertedValue(value: any): any
|
23
|
-
setImagesUrl(images: any): any
|
23
|
+
setAsyncConvertedValue(value: any): Promise<any>;
|
24
|
+
setImagesUrl(images: any): Promise<any>;
|
24
25
|
addAutoExpanding(textarea: any, index: any): void;
|
25
26
|
trimBlanks(value: any): any;
|
26
27
|
onChange(flags: any, fromRoot: any): {
|
@@ -1,7 +1,6 @@
|
|
1
1
|
/* global Quill */
|
2
2
|
import TextFieldComponent from '../textfield/TextField';
|
3
3
|
import _ from 'lodash';
|
4
|
-
import NativePromise from 'native-promise-only';
|
5
4
|
import { uniqueName, getBrowserInfo } from '../../utils/utils';
|
6
5
|
export default class TextAreaComponent extends TextFieldComponent {
|
7
6
|
static schema(...extend) {
|
@@ -112,7 +111,7 @@ export default class TextAreaComponent extends TextFieldComponent {
|
|
112
111
|
this.wysiwygDefault[this.component.editor] || this.wysiwygDefault.default
|
113
112
|
: this.component.wysiwyg;
|
114
113
|
// Keep track of when this editor is ready.
|
115
|
-
this.editorsReady[index] = new
|
114
|
+
this.editorsReady[index] = new Promise((editorReady) => {
|
116
115
|
// Attempt to add a wysiwyg editor. In order to add one, it must be included on the global scope.
|
117
116
|
switch (this.component.editor) {
|
118
117
|
case 'ace':
|
@@ -280,7 +279,7 @@ export default class TextAreaComponent extends TextFieldComponent {
|
|
280
279
|
this.setConvertedValue(value);
|
281
280
|
return super.setValue(value, flags);
|
282
281
|
}
|
283
|
-
flags.skipWysiwyg = _.isEqual(value, this.getValue());
|
282
|
+
flags.skipWysiwyg = value === '' && flags.resetValue ? false : _.isEqual(value, this.getValue());
|
284
283
|
return super.setValue(value, flags);
|
285
284
|
}
|
286
285
|
setContent(element, content, forceSanitize) {
|
@@ -342,11 +341,11 @@ export default class TextAreaComponent extends TextFieldComponent {
|
|
342
341
|
});
|
343
342
|
}
|
344
343
|
else {
|
345
|
-
return
|
344
|
+
return Promise.resolve(value);
|
346
345
|
}
|
347
346
|
}
|
348
347
|
setImagesUrl(images) {
|
349
|
-
return
|
348
|
+
return Promise.all(_.map(images, image => {
|
350
349
|
let requestData;
|
351
350
|
try {
|
352
351
|
requestData = JSON.parse(image.getAttribute('alt'));
|