@formio/js 5.0.0-rc.54 → 5.0.0-rc.55
Sign up to get free protection for your applications and to get access to all the features.
- package/dist/formio.embed.js +1 -1
- package/dist/formio.embed.min.js +1 -1
- package/dist/formio.embed.min.js.LICENSE.txt +1 -1
- package/dist/formio.form.js +563 -563
- package/dist/formio.form.min.js +1 -1
- package/dist/formio.form.min.js.LICENSE.txt +3 -3
- package/dist/formio.full.js +606 -606
- package/dist/formio.full.min.js +1 -1
- package/dist/formio.full.min.js.LICENSE.txt +3 -3
- package/dist/formio.js +3 -3
- package/dist/formio.min.js +1 -1
- package/dist/formio.min.js.LICENSE.txt +1 -1
- package/dist/formio.utils.js +16 -16
- package/dist/formio.utils.min.js +1 -1
- package/dist/formio.utils.min.js.LICENSE.txt +3 -3
- package/lib/cjs/Element.d.ts +3 -2
- package/lib/cjs/Element.js +4 -3
- package/lib/cjs/Form.d.ts +99 -36
- package/lib/cjs/Form.js +23 -18
- package/lib/cjs/PDF.d.ts +8 -7
- package/lib/cjs/PDF.js +6 -5
- package/lib/cjs/Webform.d.ts +0 -3
- package/lib/cjs/Webform.js +18 -15
- package/lib/cjs/WebformBuilder.d.ts +15 -14
- package/lib/cjs/WebformBuilder.js +11 -10
- package/lib/cjs/Wizard.d.ts +0 -11
- package/lib/cjs/Wizard.js +16 -14
- package/lib/cjs/WizardBuilder.d.ts +1 -1
- package/lib/cjs/addons/PasswordStrength/PasswordStrengthAddon.d.ts +2 -2
- package/lib/cjs/addons/PasswordStrength/PasswordStrengthAddon.form.d.ts +2 -2
- package/lib/cjs/addons/index.d.ts +2 -2
- package/lib/cjs/components/Components.d.ts +6 -5
- package/lib/cjs/components/Components.js +2 -1
- package/lib/cjs/components/_classes/component/Component.form.d.ts +4 -5
- package/lib/cjs/components/_classes/component/Component.form.js +3 -2
- package/lib/cjs/components/_classes/component/Component.js +3 -2
- package/lib/cjs/components/_classes/component/editForm/Component.edit.addons.d.ts +2 -2
- package/lib/cjs/components/_classes/component/editForm/Component.edit.conditional.d.ts +1 -1
- package/lib/cjs/components/_classes/component/editForm/Component.edit.data.d.ts +1 -1
- package/lib/cjs/components/_classes/component/editForm/Component.edit.validation.d.ts +1 -1
- package/lib/cjs/components/_classes/component/editForm/Component.edit.validation.js +2 -2
- package/lib/cjs/components/_classes/component/editForm/utils.d.ts +1 -1
- package/lib/cjs/components/_classes/component/editForm/utils.js +2 -2
- package/lib/cjs/components/_classes/list/ListComponent.d.ts +2 -2
- package/lib/cjs/components/_classes/list/ListComponent.form.d.ts +4 -4
- package/lib/cjs/components/_classes/list/ListComponent.form.js +3 -3
- package/lib/cjs/components/_classes/nested/NestedComponent.form.d.ts +4 -5
- package/lib/cjs/components/_classes/nested/NestedComponent.form.js +3 -2
- package/lib/cjs/components/_classes/nested/NestedComponent.js +0 -2
- package/lib/cjs/components/_classes/nesteddata/NestedDataComponent.d.ts +1 -1
- package/lib/cjs/components/_classes/nesteddata/NestedDataComponent.js +1 -1
- package/lib/cjs/components/address/Address.form.d.ts +4 -5
- package/lib/cjs/components/address/Address.form.js +3 -2
- package/lib/cjs/components/button/Button.form.d.ts +4 -5
- package/lib/cjs/components/button/Button.form.js +3 -2
- package/lib/cjs/components/button/Button.js +3 -2
- package/lib/cjs/components/checkbox/Checkbox.form.d.ts +4 -5
- package/lib/cjs/components/checkbox/Checkbox.form.js +3 -2
- package/lib/cjs/components/checkbox/Checkbox.js +2 -9
- package/lib/cjs/components/checkbox/fixtures/comp5.d.ts +34 -0
- package/lib/cjs/components/checkbox/fixtures/comp5.js +55 -0
- package/lib/cjs/components/checkbox/fixtures/index.d.ts +2 -1
- package/lib/cjs/components/checkbox/fixtures/index.js +3 -1
- package/lib/cjs/components/columns/Columns.d.ts +1 -1
- package/lib/cjs/components/columns/Columns.form.d.ts +4 -5
- package/lib/cjs/components/columns/Columns.form.js +3 -2
- package/lib/cjs/components/columns/Columns.js +1 -1
- package/lib/cjs/components/container/Container.form.d.ts +4 -5
- package/lib/cjs/components/container/Container.form.js +3 -2
- package/lib/cjs/components/content/Content.form.d.ts +4 -5
- package/lib/cjs/components/content/Content.form.js +3 -2
- package/lib/cjs/components/currency/Currency.form.d.ts +4 -5
- package/lib/cjs/components/currency/Currency.form.js +3 -2
- package/lib/cjs/components/currency/Currency.js +1 -1
- package/lib/cjs/components/datagrid/DataGrid.d.ts +4 -4
- package/lib/cjs/components/datagrid/DataGrid.form.d.ts +4 -5
- package/lib/cjs/components/datagrid/DataGrid.form.js +3 -2
- package/lib/cjs/components/datagrid/DataGrid.js +4 -4
- package/lib/cjs/components/datamap/DataMap.form.d.ts +4 -5
- package/lib/cjs/components/datamap/DataMap.form.js +3 -2
- package/lib/cjs/components/datetime/DateTime.form.d.ts +4 -5
- package/lib/cjs/components/datetime/DateTime.form.js +3 -2
- package/lib/cjs/components/datetime/editForm/DateTime.edit.date.d.ts +1 -1
- package/lib/cjs/components/datetime/editForm/DateTime.edit.date.js +2 -2
- package/lib/cjs/components/day/Day.d.ts +18 -23
- package/lib/cjs/components/day/Day.form.d.ts +4 -5
- package/lib/cjs/components/day/Day.form.js +3 -2
- package/lib/cjs/components/day/Day.js +15 -14
- package/lib/cjs/components/editgrid/EditGrid.d.ts +4 -3
- package/lib/cjs/components/editgrid/EditGrid.form.d.ts +4 -5
- package/lib/cjs/components/editgrid/EditGrid.form.js +3 -2
- 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.d.ts +1 -1
- package/lib/cjs/components/editgrid/editForm/EditGrid.edit.templates.js +6 -9
- package/lib/cjs/components/email/Email.form.d.ts +4 -5
- package/lib/cjs/components/email/Email.form.js +3 -2
- package/lib/cjs/components/fieldset/Fieldset.form.d.ts +4 -5
- package/lib/cjs/components/fieldset/Fieldset.form.js +3 -2
- package/lib/cjs/components/file/File.form.d.ts +4 -5
- package/lib/cjs/components/file/File.form.js +3 -2
- package/lib/cjs/components/form/Form.d.ts +23 -20
- package/lib/cjs/components/form/Form.form.d.ts +4 -5
- package/lib/cjs/components/form/Form.form.js +3 -2
- package/lib/cjs/components/form/Form.js +18 -11
- package/lib/cjs/components/form/editForm/Form.edit.data.d.ts +1 -1
- package/lib/cjs/components/form/fixtures/comp7.d.ts +36 -0
- package/lib/cjs/components/form/fixtures/comp7.js +37 -0
- package/lib/cjs/components/form/fixtures/comp8.d.ts +26 -0
- package/lib/cjs/components/form/fixtures/comp8.js +29 -0
- package/lib/cjs/components/form/fixtures/index.d.ts +3 -1
- package/lib/cjs/components/form/fixtures/index.js +5 -1
- package/lib/cjs/components/hidden/Hidden.form.d.ts +4 -5
- package/lib/cjs/components/hidden/Hidden.form.js +3 -2
- package/lib/cjs/components/hidden/Hidden.js +1 -1
- package/lib/cjs/components/html/HTML.form.d.ts +4 -5
- package/lib/cjs/components/html/HTML.form.js +3 -2
- package/lib/cjs/components/number/Number.d.ts +1 -1
- package/lib/cjs/components/number/Number.form.d.ts +4 -5
- package/lib/cjs/components/number/Number.form.js +3 -2
- package/lib/cjs/components/number/Number.js +1 -1
- package/lib/cjs/components/panel/Panel.form.d.ts +4 -5
- package/lib/cjs/components/panel/Panel.form.js +3 -2
- package/lib/cjs/components/panel/editForm/Panel.edit.conditional.d.ts +1 -1
- package/lib/cjs/components/password/Password.form.d.ts +4 -5
- package/lib/cjs/components/password/Password.form.js +3 -2
- package/lib/cjs/components/phonenumber/PhoneNumber.form.d.ts +4 -5
- package/lib/cjs/components/phonenumber/PhoneNumber.form.js +3 -2
- package/lib/cjs/components/radio/Radio.form.d.ts +4 -3
- package/lib/cjs/components/radio/Radio.form.js +3 -2
- package/lib/cjs/components/recaptcha/ReCaptcha.form.d.ts +3 -4
- package/lib/cjs/components/recaptcha/ReCaptcha.form.js +2 -1
- package/lib/cjs/components/select/Select.d.ts +2 -2
- package/lib/cjs/components/select/Select.form.d.ts +4 -3
- package/lib/cjs/components/select/Select.form.js +3 -2
- package/lib/cjs/components/select/Select.js +1 -1
- package/lib/cjs/components/selectboxes/SelectBoxes.d.ts +2 -8
- package/lib/cjs/components/selectboxes/SelectBoxes.form.d.ts +4 -3
- package/lib/cjs/components/selectboxes/SelectBoxes.form.js +3 -2
- package/lib/cjs/components/selectboxes/SelectBoxes.js +7 -6
- package/lib/cjs/components/signature/Signature.form.d.ts +4 -5
- package/lib/cjs/components/signature/Signature.form.js +3 -2
- package/lib/cjs/components/survey/Survey.form.d.ts +4 -5
- package/lib/cjs/components/survey/Survey.form.js +3 -2
- package/lib/cjs/components/table/Table.form.d.ts +4 -5
- package/lib/cjs/components/table/Table.form.js +3 -2
- package/lib/cjs/components/tabs/Tabs.d.ts +2 -2
- package/lib/cjs/components/tabs/Tabs.form.d.ts +4 -5
- package/lib/cjs/components/tabs/Tabs.form.js +3 -2
- package/lib/cjs/components/tabs/Tabs.js +1 -1
- package/lib/cjs/components/tags/Tags.form.d.ts +4 -5
- package/lib/cjs/components/tags/Tags.form.js +3 -2
- package/lib/cjs/components/textarea/TextArea.d.ts +3 -3
- package/lib/cjs/components/textarea/TextArea.form.d.ts +4 -5
- package/lib/cjs/components/textarea/TextArea.form.js +3 -2
- package/lib/cjs/components/textarea/TextArea.js +2 -2
- package/lib/cjs/components/textfield/TextField.d.ts +12 -19
- package/lib/cjs/components/textfield/TextField.form.d.ts +4 -5
- package/lib/cjs/components/textfield/TextField.form.js +3 -2
- package/lib/cjs/components/textfield/TextField.js +13 -12
- package/lib/cjs/components/time/Time.form.d.ts +4 -5
- package/lib/cjs/components/time/Time.form.js +3 -2
- package/lib/cjs/components/unknown/Unknown.form.d.ts +3 -35
- package/lib/cjs/components/unknown/Unknown.form.js +2 -1
- package/lib/cjs/components/url/Url.form.d.ts +4 -5
- package/lib/cjs/components/url/Url.form.js +3 -2
- package/lib/cjs/components/well/Well.form.d.ts +4 -5
- package/lib/cjs/components/well/Well.form.js +3 -2
- package/lib/cjs/formio.form.js +2 -2
- package/lib/cjs/utils/Evaluator.d.ts +0 -1
- package/lib/cjs/utils/Evaluator.js +2 -5
- package/lib/cjs/utils/formUtils.d.ts +1 -1
- package/lib/cjs/utils/utils.d.ts +106 -83
- package/lib/cjs/utils/utils.js +96 -140
- package/lib/cjs/widgets/CalendarWidget.d.ts +8 -7
- package/lib/cjs/widgets/CalendarWidget.js +8 -7
- package/lib/mjs/Element.d.ts +3 -2
- package/lib/mjs/Element.js +4 -3
- package/lib/mjs/Form.d.ts +99 -36
- package/lib/mjs/Form.js +43 -38
- package/lib/mjs/PDF.d.ts +8 -7
- package/lib/mjs/PDF.js +6 -5
- package/lib/mjs/Webform.d.ts +0 -3
- package/lib/mjs/Webform.js +18 -15
- package/lib/mjs/WebformBuilder.d.ts +15 -14
- package/lib/mjs/WebformBuilder.js +11 -10
- package/lib/mjs/Wizard.d.ts +0 -11
- package/lib/mjs/Wizard.js +14 -12
- package/lib/mjs/WizardBuilder.d.ts +1 -1
- package/lib/mjs/addons/PasswordStrength/PasswordStrengthAddon.d.ts +2 -2
- package/lib/mjs/addons/PasswordStrength/PasswordStrengthAddon.form.d.ts +2 -2
- package/lib/mjs/addons/index.d.ts +2 -2
- package/lib/mjs/components/Components.d.ts +6 -5
- package/lib/mjs/components/Components.js +2 -1
- package/lib/mjs/components/_classes/component/Component.form.d.ts +4 -5
- package/lib/mjs/components/_classes/component/Component.form.js +3 -2
- package/lib/mjs/components/_classes/component/Component.js +3 -2
- package/lib/mjs/components/_classes/component/editForm/Component.edit.addons.d.ts +2 -2
- package/lib/mjs/components/_classes/component/editForm/Component.edit.conditional.d.ts +1 -1
- package/lib/mjs/components/_classes/component/editForm/Component.edit.data.d.ts +1 -1
- package/lib/mjs/components/_classes/component/editForm/Component.edit.validation.d.ts +1 -1
- package/lib/mjs/components/_classes/component/editForm/Component.edit.validation.js +1 -1
- package/lib/mjs/components/_classes/component/editForm/utils.d.ts +1 -1
- package/lib/mjs/components/_classes/component/editForm/utils.js +1 -1
- package/lib/mjs/components/_classes/list/ListComponent.d.ts +2 -2
- package/lib/mjs/components/_classes/list/ListComponent.form.d.ts +4 -4
- package/lib/mjs/components/_classes/list/ListComponent.form.js +3 -3
- package/lib/mjs/components/_classes/nested/NestedComponent.form.d.ts +4 -5
- package/lib/mjs/components/_classes/nested/NestedComponent.form.js +3 -2
- package/lib/mjs/components/_classes/nested/NestedComponent.js +0 -2
- package/lib/mjs/components/_classes/nesteddata/NestedDataComponent.d.ts +1 -1
- package/lib/mjs/components/_classes/nesteddata/NestedDataComponent.js +1 -1
- package/lib/mjs/components/address/Address.form.d.ts +4 -5
- package/lib/mjs/components/address/Address.form.js +3 -2
- package/lib/mjs/components/button/Button.form.d.ts +4 -5
- package/lib/mjs/components/button/Button.form.js +3 -2
- package/lib/mjs/components/button/Button.js +3 -2
- package/lib/mjs/components/checkbox/Checkbox.form.d.ts +4 -5
- package/lib/mjs/components/checkbox/Checkbox.form.js +3 -2
- package/lib/mjs/components/checkbox/Checkbox.js +2 -9
- package/lib/mjs/components/checkbox/fixtures/comp5.d.ts +34 -0
- package/lib/mjs/components/checkbox/fixtures/comp5.js +53 -0
- package/lib/mjs/components/checkbox/fixtures/index.d.ts +2 -1
- package/lib/mjs/components/checkbox/fixtures/index.js +2 -1
- package/lib/mjs/components/columns/Columns.d.ts +1 -1
- package/lib/mjs/components/columns/Columns.form.d.ts +4 -5
- package/lib/mjs/components/columns/Columns.form.js +3 -2
- package/lib/mjs/components/columns/Columns.js +1 -1
- package/lib/mjs/components/container/Container.form.d.ts +4 -5
- package/lib/mjs/components/container/Container.form.js +3 -2
- package/lib/mjs/components/content/Content.form.d.ts +4 -5
- package/lib/mjs/components/content/Content.form.js +3 -2
- package/lib/mjs/components/currency/Currency.form.d.ts +4 -5
- package/lib/mjs/components/currency/Currency.form.js +3 -2
- package/lib/mjs/components/currency/Currency.js +1 -1
- package/lib/mjs/components/datagrid/DataGrid.d.ts +4 -4
- package/lib/mjs/components/datagrid/DataGrid.form.d.ts +4 -5
- package/lib/mjs/components/datagrid/DataGrid.form.js +3 -2
- package/lib/mjs/components/datagrid/DataGrid.js +4 -4
- package/lib/mjs/components/datamap/DataMap.form.d.ts +4 -5
- package/lib/mjs/components/datamap/DataMap.form.js +3 -2
- package/lib/mjs/components/datetime/DateTime.form.d.ts +4 -5
- package/lib/mjs/components/datetime/DateTime.form.js +3 -2
- package/lib/mjs/components/datetime/editForm/DateTime.edit.date.d.ts +1 -1
- package/lib/mjs/components/datetime/editForm/DateTime.edit.date.js +1 -1
- package/lib/mjs/components/day/Day.d.ts +18 -23
- package/lib/mjs/components/day/Day.form.d.ts +4 -5
- package/lib/mjs/components/day/Day.form.js +3 -2
- package/lib/mjs/components/day/Day.js +15 -14
- package/lib/mjs/components/editgrid/EditGrid.d.ts +4 -3
- package/lib/mjs/components/editgrid/EditGrid.form.d.ts +4 -5
- package/lib/mjs/components/editgrid/EditGrid.form.js +3 -2
- 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.d.ts +1 -1
- package/lib/mjs/components/editgrid/editForm/EditGrid.edit.templates.js +1 -1
- package/lib/mjs/components/email/Email.form.d.ts +4 -5
- package/lib/mjs/components/email/Email.form.js +3 -2
- package/lib/mjs/components/fieldset/Fieldset.form.d.ts +4 -5
- package/lib/mjs/components/fieldset/Fieldset.form.js +3 -2
- package/lib/mjs/components/file/File.form.d.ts +4 -5
- package/lib/mjs/components/file/File.form.js +3 -2
- package/lib/mjs/components/form/Form.d.ts +23 -20
- package/lib/mjs/components/form/Form.form.d.ts +4 -5
- package/lib/mjs/components/form/Form.form.js +3 -2
- package/lib/mjs/components/form/Form.js +18 -11
- package/lib/mjs/components/form/editForm/Form.edit.data.d.ts +1 -1
- package/lib/mjs/components/form/fixtures/comp7.d.ts +36 -0
- package/lib/mjs/components/form/fixtures/comp7.js +35 -0
- package/lib/mjs/components/form/fixtures/comp8.d.ts +26 -0
- package/lib/mjs/components/form/fixtures/comp8.js +27 -0
- package/lib/mjs/components/form/fixtures/index.d.ts +3 -1
- package/lib/mjs/components/form/fixtures/index.js +3 -1
- package/lib/mjs/components/hidden/Hidden.form.d.ts +4 -5
- package/lib/mjs/components/hidden/Hidden.form.js +3 -2
- package/lib/mjs/components/hidden/Hidden.js +1 -1
- package/lib/mjs/components/html/HTML.form.d.ts +4 -5
- package/lib/mjs/components/html/HTML.form.js +3 -2
- package/lib/mjs/components/number/Number.d.ts +1 -1
- package/lib/mjs/components/number/Number.form.d.ts +4 -5
- package/lib/mjs/components/number/Number.form.js +3 -2
- package/lib/mjs/components/number/Number.js +1 -1
- package/lib/mjs/components/panel/Panel.form.d.ts +4 -5
- package/lib/mjs/components/panel/Panel.form.js +3 -2
- package/lib/mjs/components/panel/editForm/Panel.edit.conditional.d.ts +1 -1
- package/lib/mjs/components/password/Password.form.d.ts +4 -5
- package/lib/mjs/components/password/Password.form.js +3 -2
- package/lib/mjs/components/phonenumber/PhoneNumber.form.d.ts +4 -5
- package/lib/mjs/components/phonenumber/PhoneNumber.form.js +3 -2
- package/lib/mjs/components/radio/Radio.form.d.ts +4 -3
- package/lib/mjs/components/radio/Radio.form.js +3 -2
- package/lib/mjs/components/recaptcha/ReCaptcha.form.d.ts +3 -4
- package/lib/mjs/components/recaptcha/ReCaptcha.form.js +2 -1
- package/lib/mjs/components/select/Select.d.ts +2 -2
- package/lib/mjs/components/select/Select.form.d.ts +4 -3
- package/lib/mjs/components/select/Select.form.js +3 -2
- package/lib/mjs/components/select/Select.js +1 -1
- package/lib/mjs/components/selectboxes/SelectBoxes.d.ts +2 -8
- package/lib/mjs/components/selectboxes/SelectBoxes.form.d.ts +4 -3
- package/lib/mjs/components/selectboxes/SelectBoxes.form.js +3 -2
- package/lib/mjs/components/selectboxes/SelectBoxes.js +7 -6
- package/lib/mjs/components/signature/Signature.form.d.ts +4 -5
- package/lib/mjs/components/signature/Signature.form.js +3 -2
- package/lib/mjs/components/survey/Survey.form.d.ts +4 -5
- package/lib/mjs/components/survey/Survey.form.js +3 -2
- package/lib/mjs/components/table/Table.form.d.ts +4 -5
- package/lib/mjs/components/table/Table.form.js +3 -2
- package/lib/mjs/components/tabs/Tabs.d.ts +2 -2
- package/lib/mjs/components/tabs/Tabs.form.d.ts +4 -5
- package/lib/mjs/components/tabs/Tabs.form.js +3 -2
- package/lib/mjs/components/tabs/Tabs.js +1 -1
- package/lib/mjs/components/tags/Tags.form.d.ts +4 -5
- package/lib/mjs/components/tags/Tags.form.js +3 -2
- package/lib/mjs/components/textarea/TextArea.d.ts +3 -3
- package/lib/mjs/components/textarea/TextArea.form.d.ts +4 -5
- package/lib/mjs/components/textarea/TextArea.form.js +3 -2
- package/lib/mjs/components/textarea/TextArea.js +2 -2
- package/lib/mjs/components/textfield/TextField.d.ts +12 -19
- package/lib/mjs/components/textfield/TextField.form.d.ts +4 -5
- package/lib/mjs/components/textfield/TextField.form.js +3 -2
- package/lib/mjs/components/textfield/TextField.js +13 -12
- package/lib/mjs/components/time/Time.form.d.ts +4 -5
- package/lib/mjs/components/time/Time.form.js +3 -2
- package/lib/mjs/components/unknown/Unknown.form.d.ts +3 -35
- package/lib/mjs/components/unknown/Unknown.form.js +2 -1
- package/lib/mjs/components/url/Url.form.d.ts +4 -5
- package/lib/mjs/components/url/Url.form.js +3 -2
- package/lib/mjs/components/well/Well.form.d.ts +4 -5
- package/lib/mjs/components/well/Well.form.js +3 -2
- package/lib/mjs/formio.form.js +1 -1
- package/lib/mjs/utils/Evaluator.d.ts +0 -1
- package/lib/mjs/utils/Evaluator.js +1 -4
- package/lib/mjs/utils/formUtils.d.ts +1 -1
- package/lib/mjs/utils/utils.d.ts +106 -83
- package/lib/mjs/utils/utils.js +96 -140
- package/lib/mjs/widgets/CalendarWidget.d.ts +8 -7
- package/lib/mjs/widgets/CalendarWidget.js +8 -7
- package/package.json +5 -8
package/lib/cjs/utils/utils.js
CHANGED
@@ -83,65 +83,12 @@ function setPathToComponentAndPerentSchema(component) {
|
|
83
83
|
* @param {Function|string|object} func - The function to evaluate.
|
84
84
|
* @param {*} args - A map of arguments to pass to the function.
|
85
85
|
* @param {string} ret - The name of the "return" variable in the script.
|
86
|
-
* @param {boolean}
|
86
|
+
* @param {boolean} interpolate - True if the script should be interpolated before being executed.
|
87
|
+
* @param {import('@formio/core').EvaluatorOptions} options - The evaluator options.
|
87
88
|
* @returns {*} - The result of the evaluation.
|
88
89
|
*/
|
89
|
-
function evaluate(func, args, ret,
|
90
|
-
|
91
|
-
const component = args.component ? args.component : { key: 'unknown' };
|
92
|
-
if (!args.form && args.instance) {
|
93
|
-
args.form = lodash_1.default.get(args.instance, 'root._form', {});
|
94
|
-
}
|
95
|
-
const componentKey = component.key;
|
96
|
-
if (typeof func === 'string') {
|
97
|
-
if (ret) {
|
98
|
-
func += `;return ${ret}`;
|
99
|
-
}
|
100
|
-
if (tokenize) {
|
101
|
-
// Replace all {{ }} references with actual data.
|
102
|
-
func = func.replace(/({{\s+(.*)\s+}})/, (match, $1, $2) => {
|
103
|
-
if ($2.indexOf('data.') === 0) {
|
104
|
-
return lodash_1.default.get(args.data, $2.replace('data.', ''));
|
105
|
-
}
|
106
|
-
else if ($2.indexOf('row.') === 0) {
|
107
|
-
return lodash_1.default.get(args.row, $2.replace('row.', ''));
|
108
|
-
}
|
109
|
-
// Support legacy...
|
110
|
-
return lodash_1.default.get(args.data, $2);
|
111
|
-
});
|
112
|
-
}
|
113
|
-
try {
|
114
|
-
func = Evaluator_1.Evaluator.evaluator(func, args);
|
115
|
-
args = lodash_1.default.values(args);
|
116
|
-
}
|
117
|
-
catch (err) {
|
118
|
-
console.warn(`An error occured within the custom function for ${componentKey}`, err);
|
119
|
-
returnVal = null;
|
120
|
-
func = false;
|
121
|
-
}
|
122
|
-
}
|
123
|
-
if (typeof func === 'function') {
|
124
|
-
try {
|
125
|
-
returnVal = Evaluator_1.Evaluator.evaluate(func, args);
|
126
|
-
}
|
127
|
-
catch (err) {
|
128
|
-
returnVal = null;
|
129
|
-
console.warn(`An error occured within custom function for ${componentKey}`, err);
|
130
|
-
}
|
131
|
-
}
|
132
|
-
else if (typeof func === 'object') {
|
133
|
-
try {
|
134
|
-
returnVal = json_logic_js_1.default.apply(func, args);
|
135
|
-
}
|
136
|
-
catch (err) {
|
137
|
-
returnVal = null;
|
138
|
-
console.warn(`An error occured within custom function for ${componentKey}`, err);
|
139
|
-
}
|
140
|
-
}
|
141
|
-
else if (func) {
|
142
|
-
console.warn(`Unknown function type for ${componentKey}`);
|
143
|
-
}
|
144
|
-
return returnVal;
|
90
|
+
function evaluate(func, args, ret, interpolate, options = {}) {
|
91
|
+
return Evaluator_1.Evaluator.evaluate(func, args, ret, interpolate, undefined, options);
|
145
92
|
}
|
146
93
|
exports.evaluate = evaluate;
|
147
94
|
/**
|
@@ -1100,9 +1047,9 @@ function iterateKey(key) {
|
|
1100
1047
|
exports.iterateKey = iterateKey;
|
1101
1048
|
/**
|
1102
1049
|
* Determines a unique key within a map provided the base key.
|
1103
|
-
* @param map
|
1104
|
-
* @param base
|
1105
|
-
* @returns {
|
1050
|
+
* @param {Record<string, string>} map - The map to check for uniqueness.
|
1051
|
+
* @param {string} base - The base path of the key.
|
1052
|
+
* @returns {string} - The unique key.
|
1106
1053
|
*/
|
1107
1054
|
function uniqueKey(map, base) {
|
1108
1055
|
let newKey = base;
|
@@ -1114,8 +1061,9 @@ function uniqueKey(map, base) {
|
|
1114
1061
|
exports.uniqueKey = uniqueKey;
|
1115
1062
|
/**
|
1116
1063
|
* Determines the major version number of bootstrap.
|
1117
|
-
* @param options
|
1118
|
-
* @
|
1064
|
+
* @param {object} options - The options to check for bootstrap version.
|
1065
|
+
* @param {string} options.bootstrap - The bootstrap version to use.
|
1066
|
+
* @returns {number} - The bootstrap version.
|
1119
1067
|
*/
|
1120
1068
|
function bootstrapVersion(options) {
|
1121
1069
|
if (options.bootstrap) {
|
@@ -1133,9 +1081,8 @@ exports.bootstrapVersion = bootstrapVersion;
|
|
1133
1081
|
/**
|
1134
1082
|
* Retrun provided argument.
|
1135
1083
|
* If argument is a function, returns the result of a function call.
|
1136
|
-
* @param {
|
1137
|
-
* @
|
1138
|
-
* @returns {*}
|
1084
|
+
* @param {Function|any} e - The argument to check if a function and call if so.
|
1085
|
+
* @returns {any} - Either the result of the function call (e) or e if it is not a function.
|
1139
1086
|
*/
|
1140
1087
|
function unfold(e) {
|
1141
1088
|
if (typeof e === 'function') {
|
@@ -1146,36 +1093,31 @@ function unfold(e) {
|
|
1146
1093
|
exports.unfold = unfold;
|
1147
1094
|
/**
|
1148
1095
|
* Map values through unfold and return first non-nil value.
|
1149
|
-
* @param {Array<T>} collection
|
1150
|
-
* @returns {T}
|
1096
|
+
* @param {Array<T>} collection - The collection to map through unfold.;
|
1097
|
+
* @returns {T} - The first non-nil value.
|
1151
1098
|
*/
|
1152
1099
|
exports.firstNonNil = lodash_1.default.flow([
|
1153
1100
|
lodash_1.default.partialRight(lodash_1.default.map, unfold),
|
1154
1101
|
lodash_1.default.partialRight(lodash_1.default.find, v => !lodash_1.default.isUndefined(v))
|
1155
1102
|
]);
|
1156
|
-
|
1157
|
-
* Create enclosed state.
|
1158
|
-
* Returns functions to getting and cycling between states.
|
1103
|
+
/**
|
1104
|
+
* Create enclosed state. Returns functions to getting and cycling between states.
|
1159
1105
|
* @param {*} a - initial state.
|
1160
1106
|
* @param {*} b - next state.
|
1161
|
-
* @
|
1162
|
-
*/
|
1163
|
-
/**
|
1164
|
-
*
|
1165
|
-
* @param a
|
1166
|
-
* @param b
|
1107
|
+
* @returns {Functions[]} -- [get, toggle];
|
1167
1108
|
*/
|
1168
1109
|
function withSwitch(a, b) {
|
1169
1110
|
let state = a;
|
1170
1111
|
let next = b;
|
1171
1112
|
/**
|
1172
|
-
*
|
1113
|
+
* Returns the state of the switch.
|
1114
|
+
* @returns {*} - The current state.
|
1173
1115
|
*/
|
1174
1116
|
function get() {
|
1175
1117
|
return state;
|
1176
1118
|
}
|
1177
1119
|
/**
|
1178
|
-
*
|
1120
|
+
* Toggles the state of the switch.
|
1179
1121
|
*/
|
1180
1122
|
function toggle() {
|
1181
1123
|
const prev = state;
|
@@ -1186,9 +1128,12 @@ function withSwitch(a, b) {
|
|
1186
1128
|
}
|
1187
1129
|
exports.withSwitch = withSwitch;
|
1188
1130
|
/**
|
1189
|
-
*
|
1190
|
-
* @param callback
|
1191
|
-
* @param options
|
1131
|
+
* Create a function that will call the provided function only the provided limit.
|
1132
|
+
* @param {Function} callback - The callback to call.
|
1133
|
+
* @param {object} options - The options to use.
|
1134
|
+
* @param {number} options.limit - The limit to call the callback.
|
1135
|
+
* @param {number} options.delay - The delay to wait before resetting the call count.
|
1136
|
+
* @returns {Function} - The function that will call the callback only the provided limit.
|
1192
1137
|
*/
|
1193
1138
|
function observeOverload(callback, options = {}) {
|
1194
1139
|
const { limit = 50, delay = 500 } = options;
|
@@ -1211,12 +1156,13 @@ function observeOverload(callback, options = {}) {
|
|
1211
1156
|
}
|
1212
1157
|
exports.observeOverload = observeOverload;
|
1213
1158
|
/**
|
1214
|
-
*
|
1215
|
-
* @param context
|
1216
|
-
* @param excludeNested
|
1217
|
-
* @param excludedTypes
|
1159
|
+
* Returns the components that are provided within an evaluation context.
|
1160
|
+
* @param {any} context - The evaluation context to get the components from.
|
1161
|
+
* @param {boolean} excludeNested - Exclude nested components.
|
1162
|
+
* @param {Array<string>} excludedTypes - The types of components to exclude.
|
1163
|
+
* @returns {Array} - The components within the evaluation context.
|
1218
1164
|
*/
|
1219
|
-
function getContextComponents(context, excludeNested
|
1165
|
+
function getContextComponents(context, excludeNested, excludedTypes = []) {
|
1220
1166
|
const values = [];
|
1221
1167
|
context.utils.eachComponent(context.instance.options.editForm.components, (component, path) => {
|
1222
1168
|
const addToContextComponents = excludeNested ? !component.tree : true;
|
@@ -1231,8 +1177,9 @@ function getContextComponents(context, excludeNested = false, excludedTypes = []
|
|
1231
1177
|
}
|
1232
1178
|
exports.getContextComponents = getContextComponents;
|
1233
1179
|
/**
|
1234
|
-
*
|
1235
|
-
* @param context
|
1180
|
+
* Returns the button components that are within an evaluation context.
|
1181
|
+
* @param {any} context - The evaluation context to get the components from.
|
1182
|
+
* @returns {Array} - The button components within the evaluation context.
|
1236
1183
|
*/
|
1237
1184
|
function getContextButtons(context) {
|
1238
1185
|
const values = [];
|
@@ -1251,10 +1198,9 @@ exports.getContextButtons = getContextButtons;
|
|
1251
1198
|
const inTextTags = ['#text', 'A', 'B', 'EM', 'I', 'SMALL', 'STRONG', 'SUB', 'SUP', 'INS', 'DEL', 'MARK', 'CODE'];
|
1252
1199
|
/**
|
1253
1200
|
* Helper function for 'translateHTMLTemplate'. Translates text value of the passed html element.
|
1254
|
-
* @param {HTMLElement} elem
|
1255
|
-
* @param {Function} translate
|
1256
|
-
* @returns {string}
|
1257
|
-
* Translated element template.
|
1201
|
+
* @param {HTMLElement} elem - The element to translate.
|
1202
|
+
* @param {Function} translate - The translation function.
|
1203
|
+
* @returns {string} - Translated element template.
|
1258
1204
|
*/
|
1259
1205
|
function translateElemValue(elem, translate) {
|
1260
1206
|
if (!elem.innerText) {
|
@@ -1285,8 +1231,8 @@ function translateElemValue(elem, translate) {
|
|
1285
1231
|
}
|
1286
1232
|
/**
|
1287
1233
|
* Helper function for 'translateHTMLTemplate'. Goes deep through html tag children and calls function to translate their text values.
|
1288
|
-
* @param {HTMLElement} tag
|
1289
|
-
* @param {Function} translate
|
1234
|
+
* @param {HTMLElement} tag - The tag to translate.
|
1235
|
+
* @param {Function} translate - The translation function.
|
1290
1236
|
* @returns {void}
|
1291
1237
|
*/
|
1292
1238
|
function translateDeepTag(tag, translate) {
|
@@ -1302,10 +1248,9 @@ function translateDeepTag(tag, translate) {
|
|
1302
1248
|
}
|
1303
1249
|
/**
|
1304
1250
|
* Translates text values in html template.
|
1305
|
-
* @param {string} template
|
1306
|
-
* @param {Function} translate
|
1307
|
-
* @returns {string}
|
1308
|
-
* Html template with translated values.
|
1251
|
+
* @param {string} template - The template to translate.
|
1252
|
+
* @param {Function} translate - The translation function.
|
1253
|
+
* @returns {string} - Html template with translated values.
|
1309
1254
|
*/
|
1310
1255
|
function translateHTMLTemplate(template, translate) {
|
1311
1256
|
const isHTML = /<[^>]*>/.test(template);
|
@@ -1323,9 +1268,9 @@ function translateHTMLTemplate(template, translate) {
|
|
1323
1268
|
exports.translateHTMLTemplate = translateHTMLTemplate;
|
1324
1269
|
/**
|
1325
1270
|
* Sanitize an html string.
|
1326
|
-
* @param string
|
1327
|
-
* @param options
|
1328
|
-
* @returns {
|
1271
|
+
* @param {string} string - The string to sanitize.
|
1272
|
+
* @param {any} options - The options to use for sanitization.
|
1273
|
+
* @returns {string} - The sanitized html string.
|
1329
1274
|
*/
|
1330
1275
|
function sanitize(string, options) {
|
1331
1276
|
if (typeof dompurify_1.default.sanitize !== 'function') {
|
@@ -1374,15 +1319,17 @@ function sanitize(string, options) {
|
|
1374
1319
|
exports.sanitize = sanitize;
|
1375
1320
|
/**
|
1376
1321
|
* Fast cloneDeep for JSON objects only.
|
1377
|
-
* @param obj
|
1322
|
+
* @param {any} obj - The object to perform a fast clone deep against.
|
1323
|
+
* @returns {any} - The cloned object.
|
1378
1324
|
*/
|
1379
1325
|
function fastCloneDeep(obj) {
|
1380
1326
|
return obj ? JSON.parse(JSON.stringify(obj)) : obj;
|
1381
1327
|
}
|
1382
1328
|
exports.fastCloneDeep = fastCloneDeep;
|
1383
1329
|
/**
|
1384
|
-
*
|
1385
|
-
* @param componentJson
|
1330
|
+
* Returns if the component is an input component.
|
1331
|
+
* @param {import('@formio/core').Component} componentJson - The JSON of a component.
|
1332
|
+
* @returns {bool} - TRUE if the component is an input component; FALSE otherwise.
|
1386
1333
|
*/
|
1387
1334
|
function isInputComponent(componentJson) {
|
1388
1335
|
if (componentJson.input === false || componentJson.input === true) {
|
@@ -1405,8 +1352,9 @@ function isInputComponent(componentJson) {
|
|
1405
1352
|
}
|
1406
1353
|
exports.isInputComponent = isInputComponent;
|
1407
1354
|
/**
|
1408
|
-
*
|
1409
|
-
* @param pathStr
|
1355
|
+
* Takes a component path, and returns a component path array.
|
1356
|
+
* @param {string} pathStr - The path string to convert to an array.
|
1357
|
+
* @returns {Arryay<number>} - The array of paths.
|
1410
1358
|
*/
|
1411
1359
|
function getArrayFromComponentPath(pathStr) {
|
1412
1360
|
if (!pathStr || !lodash_1.default.isString(pathStr)) {
|
@@ -1423,9 +1371,10 @@ function getArrayFromComponentPath(pathStr) {
|
|
1423
1371
|
}
|
1424
1372
|
exports.getArrayFromComponentPath = getArrayFromComponentPath;
|
1425
1373
|
/**
|
1426
|
-
*
|
1427
|
-
* @param child
|
1428
|
-
* @param parent
|
1374
|
+
* Returns true if the component is a child of the parent.
|
1375
|
+
* @param {any} child - The child component to check.
|
1376
|
+
* @param {any} parent - The parent component to check.
|
1377
|
+
* @returns {boolean} - TRUE if the child is a child of the parent; FALSE otherwise.
|
1429
1378
|
*/
|
1430
1379
|
function isChildOf(child, parent) {
|
1431
1380
|
while (child && child.parent) {
|
@@ -1438,8 +1387,9 @@ function isChildOf(child, parent) {
|
|
1438
1387
|
}
|
1439
1388
|
exports.isChildOf = isChildOf;
|
1440
1389
|
/**
|
1441
|
-
*
|
1442
|
-
* @param path
|
1390
|
+
* Takes an array of component path indexes, and returns a string version of that array.
|
1391
|
+
* @param {Array<number>} path - The path array to convert to a string.
|
1392
|
+
* @returns {string} - The string version of the path.
|
1443
1393
|
*/
|
1444
1394
|
function getStringFromComponentPath(path) {
|
1445
1395
|
if (!lodash_1.default.isArray(path)) {
|
@@ -1458,20 +1408,21 @@ function getStringFromComponentPath(path) {
|
|
1458
1408
|
}
|
1459
1409
|
exports.getStringFromComponentPath = getStringFromComponentPath;
|
1460
1410
|
/**
|
1461
|
-
*
|
1462
|
-
* @param number
|
1463
|
-
* @param precision
|
1411
|
+
* Takes a number and rounds it to the provided precision amount.
|
1412
|
+
* @param {number} number - The number to round.
|
1413
|
+
* @param {number} precision - The precision to round the number to.
|
1414
|
+
* @returns {string} - The rounded number.
|
1464
1415
|
*/
|
1465
1416
|
function round(number, precision) {
|
1466
1417
|
if (lodash_1.default.isNumber(number)) {
|
1467
1418
|
return number.toFixed(precision);
|
1468
1419
|
}
|
1469
|
-
return number;
|
1420
|
+
return number.toString();
|
1470
1421
|
}
|
1471
1422
|
exports.round = round;
|
1472
1423
|
/**
|
1473
1424
|
* Check for Internet Explorer browser version
|
1474
|
-
* @returns {(number|null)}
|
1425
|
+
* @returns {(number|null)} - The IE browser version or null if not IE
|
1475
1426
|
*/
|
1476
1427
|
function getIEBrowserVersion() {
|
1477
1428
|
const { ie, version } = getBrowserInfo();
|
@@ -1530,8 +1481,9 @@ function getBrowserInfo() {
|
|
1530
1481
|
}
|
1531
1482
|
exports.getBrowserInfo = getBrowserInfo;
|
1532
1483
|
/**
|
1533
|
-
*
|
1534
|
-
* @param path
|
1484
|
+
* Takes a component path, which may include array indicies (i.e. [0][1]), and returns the compoennt path without the indicies.
|
1485
|
+
* @param {string} path - The path to remove the indicies from.
|
1486
|
+
* @returns {string} - The path without the indicies.
|
1535
1487
|
*/
|
1536
1488
|
function getComponentPathWithoutIndicies(path = '') {
|
1537
1489
|
return path.replace(/\[\d+\]/, '');
|
@@ -1539,8 +1491,9 @@ function getComponentPathWithoutIndicies(path = '') {
|
|
1539
1491
|
exports.getComponentPathWithoutIndicies = getComponentPathWithoutIndicies;
|
1540
1492
|
/**
|
1541
1493
|
* Returns a path to the component which based on its schema
|
1542
|
-
* @param {
|
1543
|
-
* @param path
|
1494
|
+
* @param {import('@formio/core').Component} component - Component containing link to its parent's schema in the 'parent' property
|
1495
|
+
* @param {string} path - Path to the component
|
1496
|
+
* @returns {string} - Path to the component
|
1544
1497
|
*/
|
1545
1498
|
function getComponentPath(component, path = '') {
|
1546
1499
|
var _a;
|
@@ -1553,8 +1506,8 @@ function getComponentPath(component, path = '') {
|
|
1553
1506
|
exports.getComponentPath = getComponentPath;
|
1554
1507
|
/**
|
1555
1508
|
* Returns a parent component of the passed component instance skipping all the Layout components
|
1556
|
-
* @param {
|
1557
|
-
* @returns {
|
1509
|
+
* @param {Component} componentInstance - The component to check for the parent.
|
1510
|
+
* @returns {Component|undefined} - The parent data component.
|
1558
1511
|
*/
|
1559
1512
|
function getDataParentComponent(componentInstance) {
|
1560
1513
|
if (!componentInstance) {
|
@@ -1571,8 +1524,8 @@ function getDataParentComponent(componentInstance) {
|
|
1571
1524
|
exports.getDataParentComponent = getDataParentComponent;
|
1572
1525
|
/**
|
1573
1526
|
* Returns whether the value is a promise
|
1574
|
-
* @param value
|
1575
|
-
* @returns {boolean}
|
1527
|
+
* @param {any} value - The value to check
|
1528
|
+
* @returns {boolean} - TRUE if the value is a promise; FALSE otherwise
|
1576
1529
|
*/
|
1577
1530
|
function isPromise(value) {
|
1578
1531
|
return value
|
@@ -1584,9 +1537,9 @@ exports.isPromise = isPromise;
|
|
1584
1537
|
/**
|
1585
1538
|
* Determines if the component has a scoping parent in tree (a component which scopes its children and manages its
|
1586
1539
|
* changes by itself, e.g. EditGrid)
|
1587
|
-
* @param componentInstance
|
1588
|
-
* @param firstPass
|
1589
|
-
* @returns {boolean
|
1540
|
+
* @param {Component} componentInstance - The component to check for the scoping parent.
|
1541
|
+
* @param {boolean} firstPass - Whether it is the first pass of the function
|
1542
|
+
* @returns {boolean|*} - TRUE if the component has a scoping parent; FALSE otherwise
|
1590
1543
|
*/
|
1591
1544
|
function isInsideScopingComponent(componentInstance, firstPass = true) {
|
1592
1545
|
if (!firstPass && (componentInstance === null || componentInstance === void 0 ? void 0 : componentInstance.hasScopedChildren)) {
|
@@ -1603,8 +1556,9 @@ function isInsideScopingComponent(componentInstance, firstPass = true) {
|
|
1603
1556
|
}
|
1604
1557
|
exports.isInsideScopingComponent = isInsideScopingComponent;
|
1605
1558
|
/**
|
1606
|
-
*
|
1607
|
-
* @param element
|
1559
|
+
* Returns all the focusable elements within the provided dom element.
|
1560
|
+
* @param {HTMLElement} element - The element to get the focusable elements from.
|
1561
|
+
* @returns {NodeList<HTMLElement>} - The focusable elements within the provided element.
|
1608
1562
|
*/
|
1609
1563
|
function getFocusableElements(element) {
|
1610
1564
|
const focusableSelector = `button:not([disabled]), input:not([disabled]), select:not([disabled]),
|
@@ -1622,8 +1576,9 @@ exports.componentValueTypes = {
|
|
1622
1576
|
any: 'any',
|
1623
1577
|
};
|
1624
1578
|
/**
|
1625
|
-
*
|
1626
|
-
* @param fullSchema
|
1579
|
+
* Returns the saved types for the component
|
1580
|
+
* @param {import('@formio/core').Component} fullSchema - The component schema
|
1581
|
+
* @returns {Array<string>|null} - The saved types for the component
|
1627
1582
|
*/
|
1628
1583
|
function getComponentSavedTypes(fullSchema) {
|
1629
1584
|
const schema = fullSchema || {};
|
@@ -1638,11 +1593,10 @@ function getComponentSavedTypes(fullSchema) {
|
|
1638
1593
|
exports.getComponentSavedTypes = getComponentSavedTypes;
|
1639
1594
|
/**
|
1640
1595
|
* Interpolates @formio/core errors so that they are compatible with the renderer
|
1641
|
-
* @param component
|
1642
|
-
* @param {FieldError[]} errors
|
1643
|
-
* @param
|
1644
|
-
* @
|
1645
|
-
* @returns {[]}
|
1596
|
+
* @param {Component} component - The component to interpolate the errors for
|
1597
|
+
* @param {FieldError[]} errors - The errors to interpolate
|
1598
|
+
* @param {Function} interpolateFn - The interpolation function
|
1599
|
+
* @returns {[]} - The interpolated errors
|
1646
1600
|
*/
|
1647
1601
|
const interpolateErrors = (component, errors, interpolateFn) => {
|
1648
1602
|
return errors.map((error) => {
|
@@ -1654,8 +1608,9 @@ const interpolateErrors = (component, errors, interpolateFn) => {
|
|
1654
1608
|
};
|
1655
1609
|
exports.interpolateErrors = interpolateErrors;
|
1656
1610
|
/**
|
1657
|
-
*
|
1658
|
-
* @param template
|
1611
|
+
* Returns the template keys inside the template code.
|
1612
|
+
* @param {string} template - The template to get the keys from.
|
1613
|
+
* @returns {Array<string>} - The keys inside the template.
|
1659
1614
|
*/
|
1660
1615
|
function getItemTemplateKeys(template) {
|
1661
1616
|
const templateKeys = [];
|
@@ -1675,8 +1630,9 @@ function getItemTemplateKeys(template) {
|
|
1675
1630
|
}
|
1676
1631
|
exports.getItemTemplateKeys = getItemTemplateKeys;
|
1677
1632
|
/**
|
1678
|
-
*
|
1679
|
-
* @param comp
|
1633
|
+
* Returns if the component is a select resource with an object for its value.
|
1634
|
+
* @param {import('@formio/core').Component} comp - The component to check.
|
1635
|
+
* @returns {boolean} - TRUE if the component is a select resource with an object for its value; FALSE otherwise.
|
1680
1636
|
*/
|
1681
1637
|
function isSelectResourceWithObjectValue(comp = {}) {
|
1682
1638
|
const { reference, dataSrc, valueProperty } = comp;
|
@@ -70,17 +70,18 @@ export default class CalendarWidget extends InputWidget {
|
|
70
70
|
get dateTimeFormat(): string;
|
71
71
|
get dateFormat(): any;
|
72
72
|
/**
|
73
|
-
* Return the date value.
|
74
|
-
* @param date
|
75
|
-
* @param format
|
76
|
-
* @param useTimezone
|
77
|
-
* @returns {string}
|
73
|
+
* Return the date value as a string.
|
74
|
+
* @param {string|Date} date - The date object or a date string that is momentjs compatible.
|
75
|
+
* @param {string} format - The DateParser code format.
|
76
|
+
* @param {boolean} [useTimezone] - If the timezone should be used.
|
77
|
+
* @returns {string} - Returns the formatted date string.
|
78
78
|
*/
|
79
|
-
getDateValue(date:
|
79
|
+
getDateValue(date: string | Date, format: string, useTimezone?: boolean | undefined): string;
|
80
80
|
isValueISO8601(value: any): any;
|
81
81
|
/**
|
82
82
|
* Set the selected date value.
|
83
|
-
* @param value
|
83
|
+
* @param {*} value - The value to set.
|
84
|
+
* @returns {void}
|
84
85
|
*/
|
85
86
|
setValue(value: any): void;
|
86
87
|
getValueAsString(value: any, format: any): string;
|
@@ -254,11 +254,11 @@ class CalendarWidget extends InputWidget_1.default {
|
|
254
254
|
return lodash_1.default.get(this.settings, 'format', DEFAULT_FORMAT);
|
255
255
|
}
|
256
256
|
/**
|
257
|
-
* Return the date value.
|
258
|
-
* @param date
|
259
|
-
* @param format
|
260
|
-
* @param useTimezone
|
261
|
-
* @returns {string}
|
257
|
+
* Return the date value as a string.
|
258
|
+
* @param {string|Date} date - The date object or a date string that is momentjs compatible.
|
259
|
+
* @param {string} format - The DateParser code format.
|
260
|
+
* @param {boolean} [useTimezone] - If the timezone should be used.
|
261
|
+
* @returns {string} - Returns the formatted date string.
|
262
262
|
*/
|
263
263
|
getDateValue(date, format, useTimezone) {
|
264
264
|
if (useTimezone) {
|
@@ -268,7 +268,7 @@ class CalendarWidget extends InputWidget_1.default {
|
|
268
268
|
}
|
269
269
|
/**
|
270
270
|
* Return the value of the selected date.
|
271
|
-
* @returns {*}
|
271
|
+
* @returns {*} - The value of the selected date.
|
272
272
|
*/
|
273
273
|
getValue() {
|
274
274
|
// Standard output format.
|
@@ -290,7 +290,8 @@ class CalendarWidget extends InputWidget_1.default {
|
|
290
290
|
}
|
291
291
|
/**
|
292
292
|
* Set the selected date value.
|
293
|
-
* @param value
|
293
|
+
* @param {*} value - The value to set.
|
294
|
+
* @returns {void}
|
294
295
|
*/
|
295
296
|
setValue(value) {
|
296
297
|
const saveAsText = (this.settings.saveAs === 'text');
|
package/lib/mjs/Element.d.ts
CHANGED
@@ -233,10 +233,11 @@ export default class Element {
|
|
233
233
|
* @param {string|Function|object} func - The function or string to evaluate.
|
234
234
|
* @param {object} args - The arguments to pass to the evaluation.
|
235
235
|
* @param {string} ret - The name of the variable within the evaluation context to return.
|
236
|
-
* @param {boolean}
|
236
|
+
* @param {boolean} interpolate - Determines if it should replace all {{ }} token references with actual data.
|
237
|
+
* @param {import('@formio/core').EvaluatorOptions} options - The options to pass to the evaluation.
|
237
238
|
* @returns {*} - The result of the evaluation.
|
238
239
|
*/
|
239
|
-
evaluate(func: string | Function | object, args: object, ret: string,
|
240
|
+
evaluate(func: string | Function | object, args: object, ret: string, interpolate: boolean, options?: import('@formio/core').EvaluatorOptions): any;
|
240
241
|
/**
|
241
242
|
* Allow for options to hook into the functionality of this renderer.
|
242
243
|
* @returns {*} - The result of the hook function.
|
package/lib/mjs/Element.js
CHANGED
@@ -532,11 +532,12 @@ export default class Element {
|
|
532
532
|
* @param {string|Function|object} func - The function or string to evaluate.
|
533
533
|
* @param {object} args - The arguments to pass to the evaluation.
|
534
534
|
* @param {string} ret - The name of the variable within the evaluation context to return.
|
535
|
-
* @param {boolean}
|
535
|
+
* @param {boolean} interpolate - Determines if it should replace all {{ }} token references with actual data.
|
536
|
+
* @param {import('@formio/core').EvaluatorOptions} options - The options to pass to the evaluation.
|
536
537
|
* @returns {*} - The result of the evaluation.
|
537
538
|
*/
|
538
|
-
evaluate(func, args, ret,
|
539
|
-
return FormioUtils.evaluate(func, this.evalContext(args), ret,
|
539
|
+
evaluate(func, args, ret, interpolate, options = {}) {
|
540
|
+
return FormioUtils.evaluate(func, this.evalContext(args), ret, interpolate, options);
|
540
541
|
}
|
541
542
|
/**
|
542
543
|
* Allow for options to hook into the functionality of this renderer.
|