@formio/js 5.0.0-rc.27 → 5.0.0-rc.29
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/dist/fonts/bootstrap-icons.woff +0 -0
- package/dist/fonts/bootstrap-icons.woff2 +0 -0
- 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 +957 -2270
- package/dist/formio.form.min.js +1 -1
- package/dist/formio.form.min.js.LICENSE.txt +4 -2
- package/dist/formio.full.css +100 -3
- package/dist/formio.full.js +961 -2231
- package/dist/formio.full.min.css +2 -2
- package/dist/formio.full.min.js +1 -1
- package/dist/formio.full.min.js.LICENSE.txt +4 -2
- package/dist/formio.js +101 -1966
- package/dist/formio.min.js +1 -1
- package/dist/formio.min.js.LICENSE.txt +1 -3
- package/dist/formio.utils.js +145 -104
- package/dist/formio.utils.min.js +1 -1
- package/dist/formio.utils.min.js.LICENSE.txt +4 -2
- package/lib/cjs/CDN.d.ts +1 -1
- package/lib/cjs/CDN.js +2 -2
- package/lib/cjs/Embed.d.ts +16 -7
- package/lib/cjs/Embed.js +76 -24
- package/lib/cjs/Formio.d.ts +0 -1
- package/lib/cjs/Formio.js +27 -19
- package/lib/cjs/PDF.js +2 -2
- package/lib/cjs/Webform.d.ts +6 -9
- package/lib/cjs/Webform.js +59 -81
- package/lib/cjs/WebformBuilder.d.ts +1 -1
- package/lib/cjs/WebformBuilder.js +33 -16
- package/lib/cjs/Wizard.d.ts +5 -4
- package/lib/cjs/Wizard.js +37 -26
- package/lib/cjs/WizardBuilder.d.ts +1 -0
- package/lib/cjs/addons/PasswordStrength/PasswordStrengthAddon.d.ts +1 -2
- package/lib/cjs/addons/PasswordStrength/PasswordStrengthAddon.js +11 -12
- package/lib/cjs/addons/index.d.ts +1 -0
- package/lib/cjs/addons/index.js +5 -1
- package/lib/cjs/components/Components.d.ts +7 -0
- package/lib/cjs/components/Components.js +30 -0
- package/lib/cjs/components/_classes/component/Component.d.ts +57 -27
- package/lib/cjs/components/_classes/component/Component.js +193 -119
- package/lib/cjs/components/_classes/component/editForm/Component.edit.addons.d.ts +8 -0
- package/lib/cjs/components/_classes/component/editForm/Component.edit.addons.js +31 -1
- package/lib/cjs/components/_classes/nested/NestedComponent.d.ts +28 -11
- package/lib/cjs/components/_classes/nested/NestedComponent.js +88 -57
- package/lib/cjs/components/_classes/nestedarray/NestedArrayComponent.d.ts +4 -3
- package/lib/cjs/components/_classes/nestedarray/NestedArrayComponent.js +17 -4
- package/lib/cjs/components/builder.js +0 -2
- package/lib/cjs/components/button/Button.js +2 -1
- package/lib/cjs/components/columns/Columns.d.ts +1 -0
- package/lib/cjs/components/columns/Columns.js +2 -3
- package/lib/cjs/components/columns/editForm/Columns.edit.display.d.ts +30 -1
- package/lib/cjs/components/columns/editForm/Columns.edit.display.js +23 -1
- package/lib/cjs/components/container/Container.d.ts +1 -0
- package/lib/cjs/components/container/Container.js +2 -6
- package/lib/cjs/components/content/Content.d.ts +1 -0
- package/lib/cjs/components/content/Content.js +1 -0
- package/lib/cjs/components/datagrid/DataGrid.d.ts +0 -8
- package/lib/cjs/components/datagrid/DataGrid.js +9 -26
- package/lib/cjs/components/datamap/DataMap.js +2 -1
- package/lib/cjs/components/datetime/DateTime.js +0 -2
- package/lib/cjs/components/day/Day.js +2 -3
- package/lib/cjs/components/editgrid/EditGrid.d.ts +8 -4
- package/lib/cjs/components/editgrid/EditGrid.js +96 -73
- package/lib/cjs/components/email/Email.js +0 -1
- package/lib/cjs/components/file/File.js +1 -1
- package/lib/cjs/components/file/fixtures/comp3.d.ts +29 -0
- package/lib/cjs/components/file/fixtures/comp3.js +31 -0
- package/lib/cjs/components/form/Form.d.ts +2 -6
- package/lib/cjs/components/form/Form.js +43 -14
- package/lib/cjs/components/index.d.ts +0 -2
- package/lib/cjs/components/index.js +0 -2
- package/lib/cjs/components/number/Number.d.ts +1 -2
- package/lib/cjs/components/number/Number.js +5 -6
- package/lib/cjs/components/panel/Panel.d.ts +0 -1
- package/lib/cjs/components/panel/Panel.js +2 -9
- package/lib/cjs/components/panel/editForm/Panel.edit.display.d.ts +6 -38
- package/lib/cjs/components/panel/editForm/Panel.edit.display.js +3 -16
- package/lib/cjs/components/phonenumber/PhoneNumber.js +17 -0
- package/lib/cjs/components/radio/Radio.js +0 -2
- package/lib/cjs/components/recaptcha/ReCaptcha.d.ts +1 -1
- package/lib/cjs/components/recaptcha/ReCaptcha.js +2 -2
- package/lib/cjs/components/select/Select.js +3 -2
- package/lib/cjs/components/selectboxes/SelectBoxes.d.ts +1 -2
- package/lib/cjs/components/selectboxes/SelectBoxes.js +7 -6
- package/lib/cjs/components/table/editForm/Table.edit.display.d.ts +31 -2
- package/lib/cjs/components/table/editForm/Table.edit.display.js +22 -0
- package/lib/cjs/components/tabs/editForm/Tabs.edit.display.d.ts +30 -2
- package/lib/cjs/components/tabs/editForm/Tabs.edit.display.js +22 -0
- package/lib/cjs/components/textfield/TextField.js +20 -6
- package/lib/cjs/components/time/Time.js +0 -6
- package/lib/cjs/components/url/Url.js +0 -1
- package/lib/cjs/components/well/editForm/Well.edit.display.d.ts +25 -2
- package/lib/cjs/components/well/editForm/Well.edit.display.js +18 -0
- package/lib/cjs/formio.embed.js +5 -3
- package/lib/cjs/formio.form.d.ts +1 -7
- package/lib/cjs/formio.form.js +3 -38
- package/lib/cjs/index.d.ts +2 -1
- package/lib/cjs/index.js +3 -1
- package/lib/cjs/providers/Providers.d.ts +0 -4
- package/lib/cjs/providers/storage/azure.d.ts +0 -2
- package/lib/cjs/providers/storage/azure.js +1 -6
- package/lib/cjs/providers/storage/googleDrive.d.ts +0 -1
- package/lib/cjs/providers/storage/googleDrive.js +0 -4
- package/lib/cjs/providers/storage/s3.d.ts +0 -1
- package/lib/cjs/providers/storage/s3.js +0 -4
- package/lib/cjs/templates/Templates.d.ts +1 -11
- package/lib/cjs/templates/Templates.js +4 -41
- package/lib/cjs/translations/en.d.ts +5 -0
- package/lib/cjs/translations/en.js +5 -0
- package/lib/cjs/utils/formUtils.js +1 -0
- package/lib/cjs/utils/index.d.ts +1 -0
- package/lib/cjs/utils/index.js +2 -0
- package/lib/cjs/utils/utils.d.ts +2 -1
- package/lib/cjs/utils/utils.js +27 -9
- package/lib/mjs/CDN.d.ts +1 -1
- package/lib/mjs/CDN.js +2 -2
- package/lib/mjs/Embed.d.ts +16 -7
- package/lib/mjs/Embed.js +75 -18
- package/lib/mjs/Formio.d.ts +0 -1
- package/lib/mjs/Formio.js +11 -3
- package/lib/mjs/PDF.js +2 -2
- package/lib/mjs/Webform.d.ts +6 -9
- package/lib/mjs/Webform.js +58 -82
- package/lib/mjs/WebformBuilder.d.ts +1 -1
- package/lib/mjs/WebformBuilder.js +31 -10
- package/lib/mjs/Wizard.d.ts +5 -4
- package/lib/mjs/Wizard.js +36 -27
- package/lib/mjs/WizardBuilder.d.ts +1 -0
- package/lib/mjs/addons/PasswordStrength/PasswordStrengthAddon.d.ts +1 -2
- package/lib/mjs/addons/PasswordStrength/PasswordStrengthAddon.js +11 -12
- package/lib/mjs/addons/index.d.ts +1 -0
- package/lib/mjs/addons/index.js +5 -1
- package/lib/mjs/components/Components.d.ts +7 -0
- package/lib/mjs/components/Components.js +29 -0
- package/lib/mjs/components/_classes/component/Component.d.ts +57 -27
- package/lib/mjs/components/_classes/component/Component.js +191 -118
- package/lib/mjs/components/_classes/component/editForm/Component.edit.addons.d.ts +8 -0
- package/lib/mjs/components/_classes/component/editForm/Component.edit.addons.js +31 -1
- package/lib/mjs/components/_classes/nested/NestedComponent.d.ts +28 -11
- package/lib/mjs/components/_classes/nested/NestedComponent.js +88 -57
- package/lib/mjs/components/_classes/nestedarray/NestedArrayComponent.d.ts +4 -3
- package/lib/mjs/components/_classes/nestedarray/NestedArrayComponent.js +18 -5
- package/lib/mjs/components/builder.js +0 -2
- package/lib/mjs/components/button/Button.js +2 -1
- package/lib/mjs/components/columns/Columns.d.ts +1 -0
- package/lib/mjs/components/columns/Columns.js +2 -3
- package/lib/mjs/components/columns/editForm/Columns.edit.display.d.ts +30 -1
- package/lib/mjs/components/columns/editForm/Columns.edit.display.js +23 -1
- package/lib/mjs/components/container/Container.d.ts +1 -0
- package/lib/mjs/components/container/Container.js +2 -6
- package/lib/mjs/components/content/Content.d.ts +1 -0
- package/lib/mjs/components/content/Content.js +1 -0
- package/lib/mjs/components/datagrid/DataGrid.d.ts +0 -8
- package/lib/mjs/components/datagrid/DataGrid.js +9 -26
- package/lib/mjs/components/datamap/DataMap.js +2 -1
- package/lib/mjs/components/datetime/DateTime.js +0 -2
- package/lib/mjs/components/day/Day.js +2 -3
- package/lib/mjs/components/editgrid/EditGrid.d.ts +8 -4
- package/lib/mjs/components/editgrid/EditGrid.js +97 -76
- package/lib/mjs/components/email/Email.js +0 -1
- package/lib/mjs/components/file/File.js +1 -1
- package/lib/mjs/components/file/fixtures/comp3.d.ts +29 -0
- package/lib/mjs/components/file/fixtures/comp3.js +29 -0
- package/lib/mjs/components/form/Form.d.ts +2 -6
- package/lib/mjs/components/form/Form.js +45 -14
- package/lib/mjs/components/index.d.ts +0 -2
- package/lib/mjs/components/index.js +0 -2
- package/lib/mjs/components/number/Number.d.ts +1 -2
- package/lib/mjs/components/number/Number.js +4 -5
- package/lib/mjs/components/panel/Panel.d.ts +0 -1
- package/lib/mjs/components/panel/Panel.js +3 -9
- package/lib/mjs/components/panel/editForm/Panel.edit.display.d.ts +6 -38
- package/lib/mjs/components/panel/editForm/Panel.edit.display.js +3 -16
- package/lib/mjs/components/phonenumber/PhoneNumber.js +17 -0
- package/lib/mjs/components/radio/Radio.js +0 -2
- package/lib/mjs/components/recaptcha/ReCaptcha.d.ts +1 -1
- package/lib/mjs/components/recaptcha/ReCaptcha.js +2 -2
- package/lib/mjs/components/select/Select.js +3 -2
- package/lib/mjs/components/selectboxes/SelectBoxes.d.ts +1 -2
- package/lib/mjs/components/selectboxes/SelectBoxes.js +7 -6
- package/lib/mjs/components/table/editForm/Table.edit.display.d.ts +31 -2
- package/lib/mjs/components/table/editForm/Table.edit.display.js +22 -0
- package/lib/mjs/components/tabs/editForm/Tabs.edit.display.d.ts +30 -2
- package/lib/mjs/components/tabs/editForm/Tabs.edit.display.js +22 -0
- package/lib/mjs/components/textfield/TextField.js +20 -6
- package/lib/mjs/components/time/Time.js +0 -6
- package/lib/mjs/components/url/Url.js +0 -1
- package/lib/mjs/components/well/editForm/Well.edit.display.d.ts +25 -2
- package/lib/mjs/components/well/editForm/Well.edit.display.js +18 -0
- package/lib/mjs/formio.embed.js +5 -3
- package/lib/mjs/formio.form.d.ts +1 -7
- package/lib/mjs/formio.form.js +3 -32
- package/lib/mjs/index.d.ts +2 -1
- package/lib/mjs/index.js +2 -1
- package/lib/mjs/providers/Providers.d.ts +0 -4
- package/lib/mjs/providers/storage/azure.d.ts +0 -2
- package/lib/mjs/providers/storage/azure.js +1 -6
- package/lib/mjs/providers/storage/googleDrive.d.ts +0 -1
- package/lib/mjs/providers/storage/googleDrive.js +0 -4
- package/lib/mjs/providers/storage/s3.d.ts +0 -1
- package/lib/mjs/providers/storage/s3.js +0 -4
- package/lib/mjs/templates/Templates.d.ts +1 -11
- package/lib/mjs/templates/Templates.js +4 -40
- package/lib/mjs/translations/en.d.ts +5 -0
- package/lib/mjs/translations/en.js +5 -0
- package/lib/mjs/utils/formUtils.js +1 -0
- package/lib/mjs/utils/index.d.ts +1 -0
- package/lib/mjs/utils/index.js +1 -0
- package/lib/mjs/utils/utils.d.ts +2 -1
- package/lib/mjs/utils/utils.js +24 -7
- package/package.json +13 -13
- package/lib/cjs/components/tree/Node.d.ts +0 -55
- package/lib/cjs/components/tree/Node.js +0 -185
- package/lib/cjs/components/tree/Tree.d.ts +0 -48
- package/lib/cjs/components/tree/Tree.form.d.ts +0 -3
- package/lib/cjs/components/tree/Tree.form.js +0 -21
- package/lib/cjs/components/tree/Tree.js +0 -383
- package/lib/cjs/components/tree/editForm/Tree.edit.data.d.ts +0 -5
- package/lib/cjs/components/tree/editForm/Tree.edit.data.js +0 -9
- package/lib/cjs/components/tree/editForm/Tree.edit.display.d.ts +0 -9
- package/lib/cjs/components/tree/editForm/Tree.edit.display.js +0 -12
- package/lib/cjs/components/tree/fixtures/comp1.d.ts +0 -23
- package/lib/cjs/components/tree/fixtures/comp1.js +0 -24
- package/lib/cjs/components/tree/fixtures/comp2.d.ts +0 -116
- package/lib/cjs/components/tree/fixtures/comp2.js +0 -82
- package/lib/cjs/components/tree/fixtures/comp3.d.ts +0 -24
- package/lib/cjs/components/tree/fixtures/comp3.js +0 -25
- package/lib/cjs/components/tree/fixtures/comp4.d.ts +0 -42
- package/lib/cjs/components/tree/fixtures/comp4.js +0 -47
- package/lib/cjs/components/tree/fixtures/index.d.ts +0 -5
- package/lib/cjs/components/tree/fixtures/index.js +0 -14
- package/lib/cjs/validator/Rules.d.ts +0 -53
- package/lib/cjs/validator/Rules.js +0 -22
- package/lib/cjs/validator/Validator.d.ts +0 -228
- package/lib/cjs/validator/Validator.js +0 -1113
- package/lib/cjs/validator/conjunctions/index.d.ts +0 -7
- package/lib/cjs/validator/conjunctions/index.js +0 -18
- package/lib/cjs/validator/operators/index.d.ts +0 -7
- package/lib/cjs/validator/operators/index.js +0 -18
- package/lib/cjs/validator/quickRules/index.d.ts +0 -7
- package/lib/cjs/validator/quickRules/index.js +0 -18
- package/lib/cjs/validator/rules/Custom.d.ts +0 -5
- package/lib/cjs/validator/rules/Custom.js +0 -30
- package/lib/cjs/validator/rules/Date.d.ts +0 -5
- package/lib/cjs/validator/rules/Date.js +0 -25
- package/lib/cjs/validator/rules/Day.d.ts +0 -5
- package/lib/cjs/validator/rules/Day.js +0 -58
- package/lib/cjs/validator/rules/Email.d.ts +0 -5
- package/lib/cjs/validator/rules/Email.js +0 -24
- package/lib/cjs/validator/rules/JSON.d.ts +0 -5
- package/lib/cjs/validator/rules/JSON.js +0 -29
- package/lib/cjs/validator/rules/Mask.d.ts +0 -5
- package/lib/cjs/validator/rules/Mask.js +0 -32
- package/lib/cjs/validator/rules/Max.d.ts +0 -5
- package/lib/cjs/validator/rules/Max.js +0 -21
- package/lib/cjs/validator/rules/MaxDate.d.ts +0 -5
- package/lib/cjs/validator/rules/MaxDate.js +0 -34
- package/lib/cjs/validator/rules/MaxLength.d.ts +0 -5
- package/lib/cjs/validator/rules/MaxLength.js +0 -20
- package/lib/cjs/validator/rules/MaxWords.d.ts +0 -5
- package/lib/cjs/validator/rules/MaxWords.js +0 -20
- package/lib/cjs/validator/rules/MaxYear.d.ts +0 -5
- package/lib/cjs/validator/rules/MaxYear.js +0 -22
- package/lib/cjs/validator/rules/Min.d.ts +0 -5
- package/lib/cjs/validator/rules/Min.js +0 -21
- package/lib/cjs/validator/rules/MinDate.d.ts +0 -5
- package/lib/cjs/validator/rules/MinDate.js +0 -30
- package/lib/cjs/validator/rules/MinLength.d.ts +0 -5
- package/lib/cjs/validator/rules/MinLength.js +0 -20
- package/lib/cjs/validator/rules/MinWords.d.ts +0 -5
- package/lib/cjs/validator/rules/MinWords.js +0 -20
- package/lib/cjs/validator/rules/MinYear.d.ts +0 -5
- package/lib/cjs/validator/rules/MinYear.js +0 -22
- package/lib/cjs/validator/rules/Pattern.d.ts +0 -5
- package/lib/cjs/validator/rules/Pattern.js +0 -20
- package/lib/cjs/validator/rules/Required.d.ts +0 -5
- package/lib/cjs/validator/rules/Required.js +0 -17
- package/lib/cjs/validator/rules/Rule.d.ts +0 -7
- package/lib/cjs/validator/rules/Rule.js +0 -12
- package/lib/cjs/validator/rules/Select.d.ts +0 -5
- package/lib/cjs/validator/rules/Select.js +0 -95
- package/lib/cjs/validator/rules/Time.d.ts +0 -5
- package/lib/cjs/validator/rules/Time.js +0 -19
- package/lib/cjs/validator/rules/Unique.d.ts +0 -5
- package/lib/cjs/validator/rules/Unique.js +0 -69
- package/lib/cjs/validator/rules/Url.d.ts +0 -5
- package/lib/cjs/validator/rules/Url.js +0 -23
- package/lib/cjs/validator/rules/index.d.ts +0 -47
- package/lib/cjs/validator/rules/index.js +0 -51
- package/lib/cjs/validator/transformers/index.d.ts +0 -7
- package/lib/cjs/validator/transformers/index.js +0 -18
- package/lib/cjs/validator/valueSources/index.d.ts +0 -7
- package/lib/cjs/validator/valueSources/index.js +0 -18
- package/lib/mjs/components/tree/Node.d.ts +0 -55
- package/lib/mjs/components/tree/Node.js +0 -179
- package/lib/mjs/components/tree/Tree.d.ts +0 -48
- package/lib/mjs/components/tree/Tree.form.d.ts +0 -3
- package/lib/mjs/components/tree/Tree.form.js +0 -15
- package/lib/mjs/components/tree/Tree.js +0 -384
- package/lib/mjs/components/tree/editForm/Tree.edit.data.d.ts +0 -5
- package/lib/mjs/components/tree/editForm/Tree.edit.data.js +0 -7
- package/lib/mjs/components/tree/editForm/Tree.edit.display.d.ts +0 -9
- package/lib/mjs/components/tree/editForm/Tree.edit.display.js +0 -10
- package/lib/mjs/components/tree/fixtures/comp1.d.ts +0 -23
- package/lib/mjs/components/tree/fixtures/comp1.js +0 -22
- package/lib/mjs/components/tree/fixtures/comp2.d.ts +0 -116
- package/lib/mjs/components/tree/fixtures/comp2.js +0 -80
- package/lib/mjs/components/tree/fixtures/comp3.d.ts +0 -24
- package/lib/mjs/components/tree/fixtures/comp3.js +0 -23
- package/lib/mjs/components/tree/fixtures/comp4.d.ts +0 -42
- package/lib/mjs/components/tree/fixtures/comp4.js +0 -45
- package/lib/mjs/components/tree/fixtures/index.d.ts +0 -5
- package/lib/mjs/components/tree/fixtures/index.js +0 -5
- package/lib/mjs/validator/Rules.d.ts +0 -53
- package/lib/mjs/validator/Rules.js +0 -17
- package/lib/mjs/validator/Validator.d.ts +0 -228
- package/lib/mjs/validator/Validator.js +0 -1103
- package/lib/mjs/validator/conjunctions/index.d.ts +0 -7
- package/lib/mjs/validator/conjunctions/index.js +0 -16
- package/lib/mjs/validator/operators/index.d.ts +0 -7
- package/lib/mjs/validator/operators/index.js +0 -16
- package/lib/mjs/validator/quickRules/index.d.ts +0 -7
- package/lib/mjs/validator/quickRules/index.js +0 -16
- package/lib/mjs/validator/rules/Custom.d.ts +0 -5
- package/lib/mjs/validator/rules/Custom.js +0 -21
- package/lib/mjs/validator/rules/Date.d.ts +0 -5
- package/lib/mjs/validator/rules/Date.js +0 -16
- package/lib/mjs/validator/rules/Day.d.ts +0 -5
- package/lib/mjs/validator/rules/Day.js +0 -49
- package/lib/mjs/validator/rules/Email.d.ts +0 -5
- package/lib/mjs/validator/rules/Email.js +0 -15
- package/lib/mjs/validator/rules/JSON.d.ts +0 -5
- package/lib/mjs/validator/rules/JSON.js +0 -20
- package/lib/mjs/validator/rules/Mask.d.ts +0 -5
- package/lib/mjs/validator/rules/Mask.js +0 -23
- package/lib/mjs/validator/rules/Max.d.ts +0 -5
- package/lib/mjs/validator/rules/Max.js +0 -12
- package/lib/mjs/validator/rules/MaxDate.d.ts +0 -5
- package/lib/mjs/validator/rules/MaxDate.js +0 -25
- package/lib/mjs/validator/rules/MaxLength.d.ts +0 -5
- package/lib/mjs/validator/rules/MaxLength.js +0 -11
- package/lib/mjs/validator/rules/MaxWords.d.ts +0 -5
- package/lib/mjs/validator/rules/MaxWords.js +0 -11
- package/lib/mjs/validator/rules/MaxYear.d.ts +0 -5
- package/lib/mjs/validator/rules/MaxYear.js +0 -13
- package/lib/mjs/validator/rules/Min.d.ts +0 -5
- package/lib/mjs/validator/rules/Min.js +0 -12
- package/lib/mjs/validator/rules/MinDate.d.ts +0 -5
- package/lib/mjs/validator/rules/MinDate.js +0 -21
- package/lib/mjs/validator/rules/MinLength.d.ts +0 -5
- package/lib/mjs/validator/rules/MinLength.js +0 -11
- package/lib/mjs/validator/rules/MinWords.d.ts +0 -5
- package/lib/mjs/validator/rules/MinWords.js +0 -11
- package/lib/mjs/validator/rules/MinYear.d.ts +0 -5
- package/lib/mjs/validator/rules/MinYear.js +0 -13
- package/lib/mjs/validator/rules/Pattern.d.ts +0 -5
- package/lib/mjs/validator/rules/Pattern.js +0 -11
- package/lib/mjs/validator/rules/Required.d.ts +0 -5
- package/lib/mjs/validator/rules/Required.js +0 -8
- package/lib/mjs/validator/rules/Rule.d.ts +0 -7
- package/lib/mjs/validator/rules/Rule.js +0 -9
- package/lib/mjs/validator/rules/Select.d.ts +0 -5
- package/lib/mjs/validator/rules/Select.js +0 -86
- package/lib/mjs/validator/rules/Time.d.ts +0 -5
- package/lib/mjs/validator/rules/Time.js +0 -10
- package/lib/mjs/validator/rules/Unique.d.ts +0 -5
- package/lib/mjs/validator/rules/Unique.js +0 -60
- package/lib/mjs/validator/rules/Url.d.ts +0 -5
- package/lib/mjs/validator/rules/Url.js +0 -14
- package/lib/mjs/validator/rules/index.d.ts +0 -47
- package/lib/mjs/validator/rules/index.js +0 -46
- package/lib/mjs/validator/transformers/index.d.ts +0 -7
- package/lib/mjs/validator/transformers/index.js +0 -16
- package/lib/mjs/validator/valueSources/index.d.ts +0 -7
- package/lib/mjs/validator/valueSources/index.js +0 -16
@@ -3,9 +3,9 @@ import { conformToMask } from '@formio/vanilla-text-mask';
|
|
3
3
|
import tippy from 'tippy.js';
|
4
4
|
import _ from 'lodash';
|
5
5
|
import isMobile from 'ismobilejs';
|
6
|
+
import { processOne, processOneSync, validateProcess, validateProcessSync } from '@formio/core/process';
|
6
7
|
import { Formio } from '../../../Formio';
|
7
8
|
import * as FormioUtils from '../../../utils/utils';
|
8
|
-
import Validator from '../../../validator/Validator';
|
9
9
|
import { fastCloneDeep, boolValue, getComponentPath, isInsideScopingComponent, currentTimezone } from '../../../utils/utils';
|
10
10
|
import Element from '../../../Element';
|
11
11
|
import ComponentModal from '../componentModal/ComponentModal';
|
@@ -163,15 +163,6 @@ export default class Component extends Element {
|
|
163
163
|
addons: [],
|
164
164
|
}, ...sources);
|
165
165
|
}
|
166
|
-
/**
|
167
|
-
* Return the validator as part of the component.
|
168
|
-
*
|
169
|
-
* @return {ValidationChecker}
|
170
|
-
* @constructor
|
171
|
-
*/
|
172
|
-
static get Validator() {
|
173
|
-
return Validator;
|
174
|
-
}
|
175
166
|
/**
|
176
167
|
* Return the simple condition settings as part of the component.
|
177
168
|
*
|
@@ -241,16 +232,21 @@ export default class Component extends Element {
|
|
241
232
|
this.options.components[component.type]) {
|
242
233
|
_.merge(component, this.options.components[component.type]);
|
243
234
|
}
|
244
|
-
/**
|
245
|
-
* Set the validator instance.
|
246
|
-
*/
|
247
|
-
this.validator = Validator;
|
248
235
|
/**
|
249
236
|
* The data path to this specific component instance.
|
250
237
|
*
|
251
238
|
* @type {string}
|
252
239
|
*/
|
253
|
-
this.path = '';
|
240
|
+
this.path = component?.key || '';
|
241
|
+
/**
|
242
|
+
* An array of all the children components errors.
|
243
|
+
*/
|
244
|
+
this.childErrors = [];
|
245
|
+
/**
|
246
|
+
* Last validation errors that have occured.
|
247
|
+
*/
|
248
|
+
this._errors = [];
|
249
|
+
this._visibleErrors = [];
|
254
250
|
/**
|
255
251
|
* The Form.io component JSON schema.
|
256
252
|
* @type {*}
|
@@ -274,11 +270,6 @@ export default class Component extends Element {
|
|
274
270
|
* @type {*}
|
275
271
|
*/
|
276
272
|
this._data = data || {};
|
277
|
-
/**
|
278
|
-
* The existing error that this component has.
|
279
|
-
* @type {string}
|
280
|
-
*/
|
281
|
-
this.error = '';
|
282
273
|
/**
|
283
274
|
* Tool tip text after processing
|
284
275
|
* @type {string}
|
@@ -289,6 +280,12 @@ export default class Component extends Element {
|
|
289
280
|
* @type {number}
|
290
281
|
*/
|
291
282
|
this.row = this.options.row;
|
283
|
+
/**
|
284
|
+
* Points to a flat map of child components (if applicable).
|
285
|
+
*
|
286
|
+
* @type {Object}
|
287
|
+
*/
|
288
|
+
this.childComponentsMap = {};
|
292
289
|
/**
|
293
290
|
* Determines if this component is disabled, or not.
|
294
291
|
*
|
@@ -300,8 +297,8 @@ export default class Component extends Element {
|
|
300
297
|
*
|
301
298
|
* @type {Component}
|
302
299
|
*/
|
303
|
-
this.root = this.options.root;
|
304
|
-
this.localRoot = this.options.localRoot;
|
300
|
+
this.root = this.options.root || this;
|
301
|
+
this.localRoot = this.options.localRoot || this;
|
305
302
|
/**
|
306
303
|
* If this input has been input and provided value.
|
307
304
|
*
|
@@ -315,14 +312,7 @@ export default class Component extends Element {
|
|
315
312
|
*/
|
316
313
|
this.parent = this.options.parent;
|
317
314
|
this.options.name = this.options.name || 'data';
|
318
|
-
/**
|
319
|
-
* The validators that are assigned to this component.
|
320
|
-
* @type {[string]}
|
321
|
-
*/
|
322
|
-
this.validators = ['required', 'minLength', 'maxLength', 'minWords', 'maxWords', 'custom', 'pattern', 'json', 'mask'];
|
323
315
|
this._path = '';
|
324
|
-
// Nested forms don't have parents so we need to pass their path in.
|
325
|
-
this._parentPath = this.options.parentPath || '';
|
326
316
|
// Needs for Nextgen Rules Engine
|
327
317
|
this.resetCaches();
|
328
318
|
/**
|
@@ -422,6 +412,14 @@ export default class Component extends Element {
|
|
422
412
|
}
|
423
413
|
}
|
424
414
|
/* eslint-enable max-statements */
|
415
|
+
get componentsMap() {
|
416
|
+
if (this.localRoot?.childComponentsMap) {
|
417
|
+
return this.localRoot.childComponentsMap;
|
418
|
+
}
|
419
|
+
const localMap = {};
|
420
|
+
localMap[this.path] = this;
|
421
|
+
return localMap;
|
422
|
+
}
|
425
423
|
get data() {
|
426
424
|
return this._data;
|
427
425
|
}
|
@@ -653,7 +651,7 @@ export default class Component extends Element {
|
|
653
651
|
const isRightAlign = this.rightDirection(this.labelPositions[1]);
|
654
652
|
let contentMargin = '';
|
655
653
|
if (this.component.hideLabel) {
|
656
|
-
const margin = this.labelWidth + this.labelMargin;
|
654
|
+
const margin = isCondensed ? 0 : this.labelWidth + this.labelMargin;
|
657
655
|
contentMargin = isRightPosition ? `margin-right: ${margin}%` : '';
|
658
656
|
contentMargin = isLeftPosition ? `margin-left: ${margin}%` : '';
|
659
657
|
}
|
@@ -735,9 +733,9 @@ export default class Component extends Element {
|
|
735
733
|
if (text in enTranslation && params._userInput) {
|
736
734
|
return text;
|
737
735
|
}
|
738
|
-
params.data = this.rootValue;
|
739
|
-
params.row = this.data;
|
740
|
-
params.component = this.component;
|
736
|
+
params.data = params.data || this.rootValue;
|
737
|
+
params.row = params.row || this.data;
|
738
|
+
params.component = params.component || this.component;
|
741
739
|
return super.t(text, params, ...args);
|
742
740
|
}
|
743
741
|
labelIsHidden() {
|
@@ -854,8 +852,7 @@ export default class Component extends Element {
|
|
854
852
|
* @returns {*}
|
855
853
|
*/
|
856
854
|
sanitize(dirty, forceSanitize, options) {
|
857
|
-
|
858
|
-
if ((!this.shouldSanitizeValue && !forceSanitize) || ((this.options.pdf) && !forceSanitize)) {
|
855
|
+
if (!this.shouldSanitizeValue && !forceSanitize) {
|
859
856
|
return dirty;
|
860
857
|
}
|
861
858
|
return FormioUtils.sanitize(dirty, {
|
@@ -978,17 +975,13 @@ export default class Component extends Element {
|
|
978
975
|
}
|
979
976
|
getModalPreviewTemplate() {
|
980
977
|
const dataValue = this.component.type === 'password' ? this.dataValue.replace(/./g, '•') : this.dataValue;
|
981
|
-
const message = this.error ? {
|
982
|
-
level: 'error',
|
983
|
-
message: this.error.message,
|
984
|
-
} : '';
|
985
978
|
let modalLabel;
|
986
979
|
if (this.hasInput && this.component.validate?.required && !this.isPDFReadOnlyMode) {
|
987
980
|
modalLabel = { className: 'field-required' };
|
988
981
|
}
|
989
982
|
return this.renderTemplate('modalPreview', {
|
990
983
|
previewText: this.getValueAsString(dataValue, { modalPreview: true }) || this.t('Click to set value'),
|
991
|
-
messages:
|
984
|
+
messages: '',
|
992
985
|
labelInfo: modalLabel,
|
993
986
|
});
|
994
987
|
}
|
@@ -1476,6 +1469,12 @@ export default class Component extends Element {
|
|
1476
1469
|
get name() {
|
1477
1470
|
return this.t(this.component.label || this.component.placeholder || this.key, { _userInput: true });
|
1478
1471
|
}
|
1472
|
+
get visibleErrors() {
|
1473
|
+
return this._visibleErrors;
|
1474
|
+
}
|
1475
|
+
get errors() {
|
1476
|
+
return this._errors;
|
1477
|
+
}
|
1479
1478
|
/**
|
1480
1479
|
* Returns the error label for this component.
|
1481
1480
|
* @return {*}
|
@@ -1796,7 +1795,7 @@ export default class Component extends Element {
|
|
1796
1795
|
if (message.message && typeof message.message === 'string') {
|
1797
1796
|
message.message = message.message.replaceAll('<', '<').replaceAll('>', '>');
|
1798
1797
|
}
|
1799
|
-
return this.renderTemplate('message', message);
|
1798
|
+
return this.renderTemplate('message', { ...message });
|
1800
1799
|
}).join(''));
|
1801
1800
|
}
|
1802
1801
|
}
|
@@ -1869,7 +1868,7 @@ export default class Component extends Element {
|
|
1869
1868
|
this.addClass(this.getElement(), 'formio-modified');
|
1870
1869
|
}
|
1871
1870
|
// If we are supposed to validate on blur, then don't trigger validation yet.
|
1872
|
-
if (this.component.validateOn === 'blur'
|
1871
|
+
if (this.component.validateOn === 'blur') {
|
1873
1872
|
flags.noValidate = true;
|
1874
1873
|
}
|
1875
1874
|
if (this.component.onChange) {
|
@@ -2391,6 +2390,10 @@ export default class Component extends Element {
|
|
2391
2390
|
*/
|
2392
2391
|
updateOnChange(flags = {}, changed = false) {
|
2393
2392
|
if (!flags.noUpdateEvent && changed) {
|
2393
|
+
if (flags.fromSubmission) {
|
2394
|
+
// Reset the errors when a submission has been made and allow it to revalidate.
|
2395
|
+
this._errors = [];
|
2396
|
+
}
|
2394
2397
|
this.triggerChange(flags);
|
2395
2398
|
return true;
|
2396
2399
|
}
|
@@ -2557,7 +2560,21 @@ export default class Component extends Element {
|
|
2557
2560
|
if (!this.hasInput || (!dirty && this.pristine)) {
|
2558
2561
|
return '';
|
2559
2562
|
}
|
2560
|
-
|
2563
|
+
const validationScope = { errors: [] };
|
2564
|
+
processOneSync({
|
2565
|
+
component: this.component,
|
2566
|
+
data,
|
2567
|
+
row,
|
2568
|
+
path: this.path || this.component.key,
|
2569
|
+
scope: validationScope,
|
2570
|
+
instance: this,
|
2571
|
+
processors: [
|
2572
|
+
validateProcessSync
|
2573
|
+
]
|
2574
|
+
});
|
2575
|
+
const errors = validationScope.errors;
|
2576
|
+
const interpolatedErrors = FormioUtils.interpolateErrors(this.component, errors, this.t.bind(this));
|
2577
|
+
return _.map(interpolatedErrors, 'message').join('\n\n');
|
2561
2578
|
}
|
2562
2579
|
/**
|
2563
2580
|
* Returns if the component is valid or not.
|
@@ -2569,15 +2586,82 @@ export default class Component extends Element {
|
|
2569
2586
|
isValid(data, dirty) {
|
2570
2587
|
return !this.invalidMessage(data, dirty);
|
2571
2588
|
}
|
2572
|
-
setComponentValidity(
|
2573
|
-
|
2574
|
-
|
2575
|
-
|
2589
|
+
setComponentValidity(errors, dirty, silentCheck) {
|
2590
|
+
if (silentCheck) {
|
2591
|
+
return [];
|
2592
|
+
}
|
2593
|
+
const messages = errors.filter(message => !message.fromServer);
|
2594
|
+
if (errors.length && !!messages.length && (!this.isEmpty(this.defaultValue) || dirty || !this.pristine)) {
|
2595
|
+
return this.setCustomValidity(messages, dirty);
|
2596
|
+
}
|
2597
|
+
else {
|
2598
|
+
return this.setCustomValidity('');
|
2599
|
+
}
|
2600
|
+
}
|
2601
|
+
/**
|
2602
|
+
* Interpolate errors from the validation methods.
|
2603
|
+
* @param {*} errors
|
2604
|
+
* @returns
|
2605
|
+
*/
|
2606
|
+
interpolateErrors(errors) {
|
2607
|
+
const interpolatedErrors = FormioUtils.interpolateErrors(this.component, errors, this.t.bind(this));
|
2608
|
+
return this.serverErrors?.length ? [...interpolatedErrors, ...this.serverErrors] : interpolatedErrors;
|
2609
|
+
}
|
2610
|
+
/**
|
2611
|
+
* Show component validation errors.
|
2612
|
+
* @param {*} errors - An array of errors that have occured.
|
2613
|
+
* @param {*} data - The root submission data.
|
2614
|
+
* @param {*} row - The contextual row data.
|
2615
|
+
* @param {*} flags - The flags to perform validation.
|
2616
|
+
* @returns
|
2617
|
+
*/
|
2618
|
+
showValidationErrors(errors, data, row, flags) {
|
2619
|
+
if (flags.silentCheck) {
|
2620
|
+
return [];
|
2621
|
+
}
|
2622
|
+
if (this.options.alwaysDirty) {
|
2623
|
+
flags.dirty = true;
|
2624
|
+
}
|
2625
|
+
if (flags.fromSubmission && this.hasValue(data)) {
|
2626
|
+
flags.dirty = true;
|
2627
|
+
}
|
2628
|
+
this.setDirty(flags.dirty);
|
2629
|
+
return this.setComponentValidity(errors, flags.dirty, flags.silentCheck, flags.fromSubmission);
|
2630
|
+
}
|
2631
|
+
/**
|
2632
|
+
* Perform a component validation.
|
2633
|
+
* @param {*} data - The root data you wish to use for this component.
|
2634
|
+
* @param {*} row - The contextual row data you wish to use for this component.
|
2635
|
+
* @param {*} flags - The flags to control the behavior of the validation.
|
2636
|
+
* @returns
|
2637
|
+
*/
|
2638
|
+
validateComponent(data, row, flags = {}) {
|
2639
|
+
data = data || this.rootValue;
|
2640
|
+
row = row || this.data;
|
2641
|
+
const { async = false } = flags;
|
2642
|
+
if (this.shouldSkipValidation(data, row, flags)) {
|
2643
|
+
return async ? Promise.resolve([]) : [];
|
2576
2644
|
}
|
2577
|
-
|
2578
|
-
this.
|
2645
|
+
const processContext = {
|
2646
|
+
component: this.component,
|
2647
|
+
data,
|
2648
|
+
row,
|
2649
|
+
path: this.path || this.component.key,
|
2650
|
+
instance: this,
|
2651
|
+
scope: { errors: [] },
|
2652
|
+
processors: [
|
2653
|
+
async ? validateProcess : validateProcessSync
|
2654
|
+
]
|
2655
|
+
};
|
2656
|
+
if (async) {
|
2657
|
+
return processOne(processContext).then(() => {
|
2658
|
+
this._errors = this.interpolateErrors(processContext.scope.errors);
|
2659
|
+
return this._errors;
|
2660
|
+
});
|
2579
2661
|
}
|
2580
|
-
|
2662
|
+
processOneSync(processContext);
|
2663
|
+
this._errors = this.interpolateErrors(processContext.scope.errors);
|
2664
|
+
return this._errors;
|
2581
2665
|
}
|
2582
2666
|
/**
|
2583
2667
|
* Checks the validity of this component and sets the error message if it is invalid.
|
@@ -2587,32 +2671,47 @@ export default class Component extends Element {
|
|
2587
2671
|
* @param row
|
2588
2672
|
* @return {boolean}
|
2589
2673
|
*/
|
2590
|
-
checkComponentValidity(data, dirty, row,
|
2674
|
+
checkComponentValidity(data, dirty, row, flags = {}, allErrors = []) {
|
2591
2675
|
data = data || this.rootValue;
|
2592
2676
|
row = row || this.data;
|
2593
|
-
|
2594
|
-
if (
|
2595
|
-
this.
|
2596
|
-
|
2677
|
+
flags.dirty = dirty || false;
|
2678
|
+
if (flags.async) {
|
2679
|
+
return this.validateComponent(data, row, flags).then((errors) => {
|
2680
|
+
allErrors.push(...errors);
|
2681
|
+
if (this.parent && this.parent.childErrors) {
|
2682
|
+
this.parent.childErrors.push(...errors);
|
2683
|
+
}
|
2684
|
+
this.showValidationErrors(errors, data, row, flags);
|
2685
|
+
return errors.length === 0;
|
2686
|
+
});
|
2597
2687
|
}
|
2598
|
-
|
2599
|
-
|
2600
|
-
|
2601
|
-
|
2688
|
+
else {
|
2689
|
+
const errors = this.validateComponent(data, row, flags);
|
2690
|
+
this.showValidationErrors(errors, data, row, flags);
|
2691
|
+
allErrors.push(...errors);
|
2692
|
+
if (this.parent && this.parent.childErrors) {
|
2693
|
+
this.parent.childErrors.push(...errors);
|
2694
|
+
}
|
2695
|
+
return errors.length === 0;
|
2602
2696
|
}
|
2603
|
-
return async ?
|
2604
|
-
validations.then((messages) => this.setComponentValidity(messages, dirty, silentCheck)) :
|
2605
|
-
this.setComponentValidity(validations, dirty, silentCheck);
|
2606
2697
|
}
|
2607
|
-
|
2698
|
+
/**
|
2699
|
+
* Checks the validity of the component.
|
2700
|
+
* @param {*} data
|
2701
|
+
* @param {*} dirty
|
2702
|
+
* @param {*} row
|
2703
|
+
* @param {*} silentCheck
|
2704
|
+
* @returns
|
2705
|
+
*/
|
2706
|
+
checkValidity(data, dirty, row, silentCheck, errors = []) {
|
2608
2707
|
data = data || this.rootValue;
|
2609
2708
|
row = row || this.data;
|
2610
|
-
|
2611
|
-
this.
|
2612
|
-
return isValid;
|
2709
|
+
console.log('Deprecation warning: Component.checkValidity() will be deprecated in 6.x version of renderer. Use Component.validateComponent instead.');
|
2710
|
+
return this.checkComponentValidity(data, dirty, row, { silentCheck }, errors);
|
2613
2711
|
}
|
2614
|
-
checkAsyncValidity(data, dirty, row, silentCheck) {
|
2615
|
-
|
2712
|
+
checkAsyncValidity(data, dirty, row, silentCheck, errors = []) {
|
2713
|
+
console.log('Deprecation warning: Component.checkAsyncValidity() will be deprecated in 6.x version of renderer. Use Component.validateComponent instead.');
|
2714
|
+
return this.checkComponentValidity(data, dirty, row, { async: true, silentCheck }, errors);
|
2616
2715
|
}
|
2617
2716
|
/**
|
2618
2717
|
* Check the conditions, calculations, and validity of a single component and triggers an update if
|
@@ -2640,35 +2739,15 @@ export default class Component extends Element {
|
|
2640
2739
|
if (this.id !== flags.triggeredComponentId) {
|
2641
2740
|
this.calculateComponentValue(data, flags, row);
|
2642
2741
|
}
|
2643
|
-
if (flags.noValidate && !flags.validateOnInit && !flags.fromIframe) {
|
2644
|
-
if (flags.fromSubmission && this.rootPristine && this.pristine && this.error && flags.changed) {
|
2645
|
-
this.checkComponentValidity(data, !!this.options.alwaysDirty, row, true);
|
2646
|
-
}
|
2647
|
-
return true;
|
2648
|
-
}
|
2649
|
-
let isDirty = false;
|
2650
|
-
// We need to set dirty if they explicitly set noValidate to false.
|
2651
|
-
if (this.options.alwaysDirty || flags.dirty) {
|
2652
|
-
isDirty = true;
|
2653
|
-
}
|
2654
|
-
// See if they explicitely set the values with setSubmission.
|
2655
|
-
if (flags.fromSubmission && this.hasValue(data)) {
|
2656
|
-
isDirty = true;
|
2657
|
-
}
|
2658
|
-
this.setDirty(isDirty);
|
2659
|
-
if (this.component.validateOn === 'blur' && flags.fromSubmission) {
|
2660
|
-
return true;
|
2661
|
-
}
|
2662
|
-
const isValid = this.checkComponentValidity(data, isDirty, row, flags);
|
2663
|
-
this.checkModal();
|
2664
|
-
return isValid;
|
2665
2742
|
}
|
2666
|
-
checkModal(
|
2743
|
+
checkModal(errors = [], dirty = false) {
|
2744
|
+
const messages = errors.filter(error => !error.fromServer);
|
2745
|
+
const isValid = errors.length === 0;
|
2667
2746
|
if (!this.component.modalEdit || !this.componentModal) {
|
2668
2747
|
return;
|
2669
2748
|
}
|
2670
2749
|
if (dirty && !isValid) {
|
2671
|
-
this.setErrorClasses([this.refs.openModal], dirty, !isValid, !!
|
2750
|
+
this.setErrorClasses([this.refs.openModal], dirty, !isValid, !!messages.length, this.refs.openModalWrapper);
|
2672
2751
|
}
|
2673
2752
|
else {
|
2674
2753
|
this.clearErrorClasses(this.refs.openModalWrapper);
|
@@ -2692,9 +2771,6 @@ export default class Component extends Element {
|
|
2692
2771
|
validateMultiple() {
|
2693
2772
|
return true;
|
2694
2773
|
}
|
2695
|
-
get errors() {
|
2696
|
-
return this.error ? [this.error] : [];
|
2697
|
-
}
|
2698
2774
|
clearErrorClasses(element = this.element) {
|
2699
2775
|
this.removeClass(element, this.options.componentErrorClass);
|
2700
2776
|
this.removeClass(element, 'alert alert-danger');
|
@@ -2741,12 +2817,14 @@ export default class Component extends Element {
|
|
2741
2817
|
});
|
2742
2818
|
});
|
2743
2819
|
}
|
2820
|
+
// eslint-disable-next-line max-statements
|
2744
2821
|
setCustomValidity(messages, dirty, external) {
|
2745
2822
|
const inputRefs = this.isInputComponent ? this.refs.input || [] : null;
|
2746
2823
|
if (typeof messages === 'string' && messages) {
|
2747
2824
|
messages = {
|
2748
2825
|
level: 'error',
|
2749
2826
|
message: messages,
|
2827
|
+
component: this.component,
|
2750
2828
|
};
|
2751
2829
|
}
|
2752
2830
|
if (!Array.isArray(messages)) {
|
@@ -2757,17 +2835,18 @@ export default class Component extends Element {
|
|
2757
2835
|
messages = [];
|
2758
2836
|
}
|
2759
2837
|
}
|
2760
|
-
const
|
2838
|
+
const errors = messages.filter(message => message.level === 'error');
|
2761
2839
|
let invalidInputRefs = inputRefs;
|
2840
|
+
// Filter the invalid input refs in multiple components
|
2762
2841
|
if (this.component.multiple) {
|
2763
|
-
const
|
2764
|
-
|
2842
|
+
const refsArray = Array.from(inputRefs);
|
2843
|
+
refsArray.forEach((input) => {
|
2765
2844
|
this.setElementInvalid(this.performInputMapping(input), false);
|
2766
2845
|
});
|
2767
|
-
this.setInputWidgetErrorClasses(
|
2768
|
-
invalidInputRefs =
|
2846
|
+
this.setInputWidgetErrorClasses(refsArray, false);
|
2847
|
+
invalidInputRefs = refsArray.filter((ref, index) => {
|
2769
2848
|
return messages.some?.((msg) => {
|
2770
|
-
return msg?.context?.
|
2849
|
+
return msg?.context?.index === index;
|
2771
2850
|
});
|
2772
2851
|
});
|
2773
2852
|
}
|
@@ -2775,40 +2854,32 @@ export default class Component extends Element {
|
|
2775
2854
|
if (this.refs.messageContainer) {
|
2776
2855
|
this.empty(this.refs.messageContainer);
|
2777
2856
|
}
|
2778
|
-
this.
|
2857
|
+
this.emit('componentError', {
|
2858
|
+
instance: this,
|
2779
2859
|
component: this.component,
|
2780
2860
|
message: messages[0].message,
|
2781
2861
|
messages,
|
2782
2862
|
external: !!external,
|
2783
|
-
};
|
2784
|
-
this.emit('componentError', this.error);
|
2863
|
+
});
|
2785
2864
|
this.addMessages(messages, dirty, invalidInputRefs);
|
2786
2865
|
if (invalidInputRefs) {
|
2787
|
-
this.setErrorClasses(invalidInputRefs, dirty,
|
2866
|
+
this.setErrorClasses(invalidInputRefs, dirty, !!errors.length, !!messages.length);
|
2788
2867
|
}
|
2789
2868
|
}
|
2790
|
-
else if (!
|
2869
|
+
else if (!errors.length || (errors[0].external === !!external)) {
|
2791
2870
|
if (this.refs.messageContainer) {
|
2792
2871
|
this.empty(this.refs.messageContainer);
|
2793
2872
|
}
|
2794
2873
|
if (this.refs.modalMessageContainer) {
|
2795
2874
|
this.empty(this.refs.modalMessageContainer);
|
2796
2875
|
}
|
2797
|
-
this.error = null;
|
2798
2876
|
if (invalidInputRefs) {
|
2799
|
-
this.setErrorClasses(invalidInputRefs, dirty,
|
2877
|
+
this.setErrorClasses(invalidInputRefs, dirty, !!errors.length, !!messages.length);
|
2800
2878
|
}
|
2801
2879
|
this.clearErrorClasses();
|
2802
2880
|
}
|
2803
|
-
|
2804
|
-
|
2805
|
-
// }
|
2806
|
-
// this.refs.input.forEach(input => {
|
2807
|
-
// input = this.performInputMapping(input);
|
2808
|
-
// if (typeof input.setCustomValidity === 'function') {
|
2809
|
-
// input.setCustomValidity(message, dirty);
|
2810
|
-
// }
|
2811
|
-
// });
|
2881
|
+
this._visibleErrors = messages;
|
2882
|
+
return messages;
|
2812
2883
|
}
|
2813
2884
|
/**
|
2814
2885
|
* Determines if the value of this component is hidden from the user as if it is coming from the server, but is
|
@@ -2828,8 +2899,10 @@ export default class Component extends Element {
|
|
2828
2899
|
}
|
2829
2900
|
return (this.component.protected || !this.component.persistent || (this.component.persistent === 'client-only'));
|
2830
2901
|
}
|
2831
|
-
shouldSkipValidation(data,
|
2902
|
+
shouldSkipValidation(data, row, flags = {}) {
|
2832
2903
|
const rules = [
|
2904
|
+
// Do not validate if the flags say not too.
|
2905
|
+
() => flags.noValidate,
|
2833
2906
|
// Do not check custom validation for empty data if it is not required
|
2834
2907
|
() => this.component.validate.custom && !this.dataValue && !this.component.validate.required,
|
2835
2908
|
// Force valid if component is read-only
|
@@ -6,6 +6,10 @@ declare const _default: {
|
|
6
6
|
input: boolean;
|
7
7
|
key: string;
|
8
8
|
label: string;
|
9
|
+
templates: {
|
10
|
+
header: string;
|
11
|
+
row: string;
|
12
|
+
};
|
9
13
|
components: ({
|
10
14
|
type: string;
|
11
15
|
key: string;
|
@@ -600,6 +604,7 @@ declare const _default: {
|
|
600
604
|
multiple?: undefined;
|
601
605
|
hideLabel?: undefined;
|
602
606
|
})[];
|
607
|
+
tableView: boolean;
|
603
608
|
defaultValue: {
|
604
609
|
data: {
|
605
610
|
rulesSettings: {
|
@@ -640,6 +645,9 @@ declare const _default: {
|
|
640
645
|
}[];
|
641
646
|
};
|
642
647
|
input: boolean;
|
648
|
+
validate: {
|
649
|
+
required: boolean;
|
650
|
+
};
|
643
651
|
})[];
|
644
652
|
}[];
|
645
653
|
export default _default;
|
@@ -9,6 +9,33 @@ export default [
|
|
9
9
|
input: true,
|
10
10
|
key: 'addons',
|
11
11
|
label: 'Addons',
|
12
|
+
templates: {
|
13
|
+
// eslint-disable-next-line quotes
|
14
|
+
header: `<div class="row">
|
15
|
+
<div class="col-6">{{ t(components[0].label) }}</div>
|
16
|
+
<div class="col-4">Settings</div>
|
17
|
+
</div>`,
|
18
|
+
// eslint-disable-next-line quotes
|
19
|
+
row: `<div class="row">
|
20
|
+
<div class="col-6">
|
21
|
+
{{ row.name.label }}
|
22
|
+
</div>
|
23
|
+
<div class="col-4 text-muted">
|
24
|
+
Click Edit to see addon's settings
|
25
|
+
</div>
|
26
|
+
|
27
|
+
{% if (!instance.options.readOnly && !instance.disabled) { %}
|
28
|
+
<div class="col-2">
|
29
|
+
<div class="btn-group pull-right">
|
30
|
+
<button class="btn btn-default btn-light btn-sm editRow"><i class="{{ iconClass('edit') }}"></i></button>
|
31
|
+
{% if (!instance.hasRemoveButtons || instance.hasRemoveButtons()) { %}
|
32
|
+
<button class="btn btn-danger btn-sm removeRow"><i class="{{ iconClass('trash') }}"></i></button>
|
33
|
+
{% } %}
|
34
|
+
</div>
|
35
|
+
</div>
|
36
|
+
{% } %}
|
37
|
+
</div>`,
|
38
|
+
},
|
12
39
|
components: [
|
13
40
|
{
|
14
41
|
label: 'Name',
|
@@ -31,7 +58,10 @@ export default [
|
|
31
58
|
}));
|
32
59
|
},
|
33
60
|
},
|
34
|
-
input: true
|
61
|
+
input: true,
|
62
|
+
validate: {
|
63
|
+
required: true,
|
64
|
+
},
|
35
65
|
},
|
36
66
|
...editForms,
|
37
67
|
]
|
@@ -43,13 +43,6 @@ export default class NestedComponent extends Field {
|
|
43
43
|
* @return {Object} - The component retrieved.
|
44
44
|
*/
|
45
45
|
getComponentById(id: string, fn: Function): Object;
|
46
|
-
/**
|
47
|
-
* Return a path of component's value.
|
48
|
-
*
|
49
|
-
* @param {Object} component - The component instance.
|
50
|
-
* @return {string} - The component's value path.
|
51
|
-
*/
|
52
|
-
calculateComponentPath(component: Object): string;
|
53
46
|
/**
|
54
47
|
* Create a new component and add it to the components array.
|
55
48
|
*
|
@@ -83,7 +76,7 @@ export default class NestedComponent extends Field {
|
|
83
76
|
attachComponentsLogic(components: any): void;
|
84
77
|
attachComponents(element: any, components: any, container: any): Promise<any>;
|
85
78
|
/**
|
86
|
-
* Remove a component from the components array
|
79
|
+
* Remove a component from the components array and from the children object
|
87
80
|
*
|
88
81
|
* @param {Component} component - The component to remove from the components.
|
89
82
|
* @param {Array<Component>} components - An array of components to remove this component from.
|
@@ -106,7 +99,8 @@ export default class NestedComponent extends Field {
|
|
106
99
|
*/
|
107
100
|
removeComponentById(id: string, fn: Function): null;
|
108
101
|
updateValue(value: any, flags?: {}): any;
|
109
|
-
|
102
|
+
shouldSkipValidation(data: any, row: any, flags: any): boolean;
|
103
|
+
checkData(data: any, flags: any, row: any, components: any): true | undefined;
|
110
104
|
checkConditions(data: any, flags: any, row: any): boolean;
|
111
105
|
clearOnHide(show: any): void;
|
112
106
|
restoreComponentsContext(): void;
|
@@ -119,11 +113,34 @@ export default class NestedComponent extends Field {
|
|
119
113
|
calculateValue(data: any, flags: any, row: any): any;
|
120
114
|
isLastPage(): boolean;
|
121
115
|
isValid(data: any, dirty: any): any;
|
122
|
-
|
123
|
-
|
116
|
+
validationProcessor({ scope, data, row, instance }: {
|
117
|
+
scope: any;
|
118
|
+
data: any;
|
119
|
+
row: any;
|
120
|
+
instance: any;
|
121
|
+
}, flags: any): void;
|
122
|
+
/**
|
123
|
+
* Perform a validation on all child components of this nested component.
|
124
|
+
* @param {*} components
|
125
|
+
* @param {*} data
|
126
|
+
* @param {*} flags
|
127
|
+
* @returns
|
128
|
+
*/
|
129
|
+
validateComponents(components: any, data: any, flags?: any): any;
|
130
|
+
/**
|
131
|
+
* Validate a nested component with data, or its own internal data.
|
132
|
+
* @param {*} data
|
133
|
+
* @param {*} flags
|
134
|
+
* @returns
|
135
|
+
*/
|
136
|
+
validate(data: any, flags?: any): any;
|
137
|
+
checkComponentValidity(data: any, dirty: any, row: any, flags?: {}, allErrors?: any[]): boolean;
|
138
|
+
checkValidity(data: any, dirty: any, row: any, silentCheck: any, childErrors?: any[]): boolean;
|
139
|
+
checkAsyncValidity(data: any, dirty: any, row: any, silentCheck: any): Promise<any>;
|
124
140
|
setPristine(pristine: any): void;
|
125
141
|
get isPristine(): any;
|
126
142
|
destroyComponents(all?: boolean): void;
|
143
|
+
get visibleErrors(): any;
|
127
144
|
get errors(): any;
|
128
145
|
get dataReady(): Promise<any[]>;
|
129
146
|
setNestedValue(component: any, value: any, flags?: {}): any;
|