@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
@@ -31,9 +31,9 @@ const vanilla_text_mask_1 = require("@formio/vanilla-text-mask");
|
|
31
31
|
const tippy_js_1 = __importDefault(require("tippy.js"));
|
32
32
|
const lodash_1 = __importDefault(require("lodash"));
|
33
33
|
const ismobilejs_1 = __importDefault(require("ismobilejs"));
|
34
|
+
const process_1 = require("@formio/core/process");
|
34
35
|
const Formio_1 = require("../../../Formio");
|
35
36
|
const FormioUtils = __importStar(require("../../../utils/utils"));
|
36
|
-
const Validator_1 = __importDefault(require("../../../validator/Validator"));
|
37
37
|
const utils_1 = require("../../../utils/utils");
|
38
38
|
const Element_1 = __importDefault(require("../../../Element"));
|
39
39
|
const ComponentModal_1 = __importDefault(require("../componentModal/ComponentModal"));
|
@@ -191,15 +191,6 @@ class Component extends Element_1.default {
|
|
191
191
|
addons: [],
|
192
192
|
}, ...sources);
|
193
193
|
}
|
194
|
-
/**
|
195
|
-
* Return the validator as part of the component.
|
196
|
-
*
|
197
|
-
* @return {ValidationChecker}
|
198
|
-
* @constructor
|
199
|
-
*/
|
200
|
-
static get Validator() {
|
201
|
-
return Validator_1.default;
|
202
|
-
}
|
203
194
|
/**
|
204
195
|
* Return the simple condition settings as part of the component.
|
205
196
|
*
|
@@ -269,16 +260,21 @@ class Component extends Element_1.default {
|
|
269
260
|
this.options.components[component.type]) {
|
270
261
|
lodash_1.default.merge(component, this.options.components[component.type]);
|
271
262
|
}
|
272
|
-
/**
|
273
|
-
* Set the validator instance.
|
274
|
-
*/
|
275
|
-
this.validator = Validator_1.default;
|
276
263
|
/**
|
277
264
|
* The data path to this specific component instance.
|
278
265
|
*
|
279
266
|
* @type {string}
|
280
267
|
*/
|
281
|
-
this.path = '';
|
268
|
+
this.path = (component === null || component === void 0 ? void 0 : component.key) || '';
|
269
|
+
/**
|
270
|
+
* An array of all the children components errors.
|
271
|
+
*/
|
272
|
+
this.childErrors = [];
|
273
|
+
/**
|
274
|
+
* Last validation errors that have occured.
|
275
|
+
*/
|
276
|
+
this._errors = [];
|
277
|
+
this._visibleErrors = [];
|
282
278
|
/**
|
283
279
|
* The Form.io component JSON schema.
|
284
280
|
* @type {*}
|
@@ -302,11 +298,6 @@ class Component extends Element_1.default {
|
|
302
298
|
* @type {*}
|
303
299
|
*/
|
304
300
|
this._data = data || {};
|
305
|
-
/**
|
306
|
-
* The existing error that this component has.
|
307
|
-
* @type {string}
|
308
|
-
*/
|
309
|
-
this.error = '';
|
310
301
|
/**
|
311
302
|
* Tool tip text after processing
|
312
303
|
* @type {string}
|
@@ -317,6 +308,12 @@ class Component extends Element_1.default {
|
|
317
308
|
* @type {number}
|
318
309
|
*/
|
319
310
|
this.row = this.options.row;
|
311
|
+
/**
|
312
|
+
* Points to a flat map of child components (if applicable).
|
313
|
+
*
|
314
|
+
* @type {Object}
|
315
|
+
*/
|
316
|
+
this.childComponentsMap = {};
|
320
317
|
/**
|
321
318
|
* Determines if this component is disabled, or not.
|
322
319
|
*
|
@@ -328,8 +325,8 @@ class Component extends Element_1.default {
|
|
328
325
|
*
|
329
326
|
* @type {Component}
|
330
327
|
*/
|
331
|
-
this.root = this.options.root;
|
332
|
-
this.localRoot = this.options.localRoot;
|
328
|
+
this.root = this.options.root || this;
|
329
|
+
this.localRoot = this.options.localRoot || this;
|
333
330
|
/**
|
334
331
|
* If this input has been input and provided value.
|
335
332
|
*
|
@@ -343,14 +340,7 @@ class Component extends Element_1.default {
|
|
343
340
|
*/
|
344
341
|
this.parent = this.options.parent;
|
345
342
|
this.options.name = this.options.name || 'data';
|
346
|
-
/**
|
347
|
-
* The validators that are assigned to this component.
|
348
|
-
* @type {[string]}
|
349
|
-
*/
|
350
|
-
this.validators = ['required', 'minLength', 'maxLength', 'minWords', 'maxWords', 'custom', 'pattern', 'json', 'mask'];
|
351
343
|
this._path = '';
|
352
|
-
// Nested forms don't have parents so we need to pass their path in.
|
353
|
-
this._parentPath = this.options.parentPath || '';
|
354
344
|
// Needs for Nextgen Rules Engine
|
355
345
|
this.resetCaches();
|
356
346
|
/**
|
@@ -450,6 +440,15 @@ class Component extends Element_1.default {
|
|
450
440
|
}
|
451
441
|
}
|
452
442
|
/* eslint-enable max-statements */
|
443
|
+
get componentsMap() {
|
444
|
+
var _a;
|
445
|
+
if ((_a = this.localRoot) === null || _a === void 0 ? void 0 : _a.childComponentsMap) {
|
446
|
+
return this.localRoot.childComponentsMap;
|
447
|
+
}
|
448
|
+
const localMap = {};
|
449
|
+
localMap[this.path] = this;
|
450
|
+
return localMap;
|
451
|
+
}
|
453
452
|
get data() {
|
454
453
|
return this._data;
|
455
454
|
}
|
@@ -683,7 +682,7 @@ class Component extends Element_1.default {
|
|
683
682
|
const isRightAlign = this.rightDirection(this.labelPositions[1]);
|
684
683
|
let contentMargin = '';
|
685
684
|
if (this.component.hideLabel) {
|
686
|
-
const margin = this.labelWidth + this.labelMargin;
|
685
|
+
const margin = isCondensed ? 0 : this.labelWidth + this.labelMargin;
|
687
686
|
contentMargin = isRightPosition ? `margin-right: ${margin}%` : '';
|
688
687
|
contentMargin = isLeftPosition ? `margin-left: ${margin}%` : '';
|
689
688
|
}
|
@@ -765,9 +764,9 @@ class Component extends Element_1.default {
|
|
765
764
|
if (text in en_1.default && params._userInput) {
|
766
765
|
return text;
|
767
766
|
}
|
768
|
-
params.data = this.rootValue;
|
769
|
-
params.row = this.data;
|
770
|
-
params.component = this.component;
|
767
|
+
params.data = params.data || this.rootValue;
|
768
|
+
params.row = params.row || this.data;
|
769
|
+
params.component = params.component || this.component;
|
771
770
|
return super.t(text, params, ...args);
|
772
771
|
}
|
773
772
|
labelIsHidden() {
|
@@ -885,8 +884,7 @@ class Component extends Element_1.default {
|
|
885
884
|
*/
|
886
885
|
sanitize(dirty, forceSanitize, options) {
|
887
886
|
var _a;
|
888
|
-
|
889
|
-
if ((!this.shouldSanitizeValue && !forceSanitize) || ((this.options.pdf) && !forceSanitize)) {
|
887
|
+
if (!this.shouldSanitizeValue && !forceSanitize) {
|
890
888
|
return dirty;
|
891
889
|
}
|
892
890
|
return FormioUtils.sanitize(dirty, {
|
@@ -1011,17 +1009,13 @@ class Component extends Element_1.default {
|
|
1011
1009
|
getModalPreviewTemplate() {
|
1012
1010
|
var _a;
|
1013
1011
|
const dataValue = this.component.type === 'password' ? this.dataValue.replace(/./g, '•') : this.dataValue;
|
1014
|
-
const message = this.error ? {
|
1015
|
-
level: 'error',
|
1016
|
-
message: this.error.message,
|
1017
|
-
} : '';
|
1018
1012
|
let modalLabel;
|
1019
1013
|
if (this.hasInput && ((_a = this.component.validate) === null || _a === void 0 ? void 0 : _a.required) && !this.isPDFReadOnlyMode) {
|
1020
1014
|
modalLabel = { className: 'field-required' };
|
1021
1015
|
}
|
1022
1016
|
return this.renderTemplate('modalPreview', {
|
1023
1017
|
previewText: this.getValueAsString(dataValue, { modalPreview: true }) || this.t('Click to set value'),
|
1024
|
-
messages:
|
1018
|
+
messages: '',
|
1025
1019
|
labelInfo: modalLabel,
|
1026
1020
|
});
|
1027
1021
|
}
|
@@ -1510,6 +1504,12 @@ class Component extends Element_1.default {
|
|
1510
1504
|
get name() {
|
1511
1505
|
return this.t(this.component.label || this.component.placeholder || this.key, { _userInput: true });
|
1512
1506
|
}
|
1507
|
+
get visibleErrors() {
|
1508
|
+
return this._visibleErrors;
|
1509
|
+
}
|
1510
|
+
get errors() {
|
1511
|
+
return this._errors;
|
1512
|
+
}
|
1513
1513
|
/**
|
1514
1514
|
* Returns the error label for this component.
|
1515
1515
|
* @return {*}
|
@@ -1831,7 +1831,7 @@ class Component extends Element_1.default {
|
|
1831
1831
|
if (message.message && typeof message.message === 'string') {
|
1832
1832
|
message.message = message.message.replaceAll('<', '<').replaceAll('>', '>');
|
1833
1833
|
}
|
1834
|
-
return this.renderTemplate('message', message);
|
1834
|
+
return this.renderTemplate('message', Object.assign({}, message));
|
1835
1835
|
}).join(''));
|
1836
1836
|
}
|
1837
1837
|
}
|
@@ -1904,7 +1904,7 @@ class Component extends Element_1.default {
|
|
1904
1904
|
this.addClass(this.getElement(), 'formio-modified');
|
1905
1905
|
}
|
1906
1906
|
// If we are supposed to validate on blur, then don't trigger validation yet.
|
1907
|
-
if (this.component.validateOn === 'blur'
|
1907
|
+
if (this.component.validateOn === 'blur') {
|
1908
1908
|
flags.noValidate = true;
|
1909
1909
|
}
|
1910
1910
|
if (this.component.onChange) {
|
@@ -2421,6 +2421,10 @@ class Component extends Element_1.default {
|
|
2421
2421
|
*/
|
2422
2422
|
updateOnChange(flags = {}, changed = false) {
|
2423
2423
|
if (!flags.noUpdateEvent && changed) {
|
2424
|
+
if (flags.fromSubmission) {
|
2425
|
+
// Reset the errors when a submission has been made and allow it to revalidate.
|
2426
|
+
this._errors = [];
|
2427
|
+
}
|
2424
2428
|
this.triggerChange(flags);
|
2425
2429
|
return true;
|
2426
2430
|
}
|
@@ -2588,7 +2592,21 @@ class Component extends Element_1.default {
|
|
2588
2592
|
if (!this.hasInput || (!dirty && this.pristine)) {
|
2589
2593
|
return '';
|
2590
2594
|
}
|
2591
|
-
|
2595
|
+
const validationScope = { errors: [] };
|
2596
|
+
(0, process_1.processOneSync)({
|
2597
|
+
component: this.component,
|
2598
|
+
data,
|
2599
|
+
row,
|
2600
|
+
path: this.path || this.component.key,
|
2601
|
+
scope: validationScope,
|
2602
|
+
instance: this,
|
2603
|
+
processors: [
|
2604
|
+
process_1.validateProcessSync
|
2605
|
+
]
|
2606
|
+
});
|
2607
|
+
const errors = validationScope.errors;
|
2608
|
+
const interpolatedErrors = FormioUtils.interpolateErrors(this.component, errors, this.t.bind(this));
|
2609
|
+
return lodash_1.default.map(interpolatedErrors, 'message').join('\n\n');
|
2592
2610
|
}
|
2593
2611
|
/**
|
2594
2612
|
* Returns if the component is valid or not.
|
@@ -2600,15 +2618,83 @@ class Component extends Element_1.default {
|
|
2600
2618
|
isValid(data, dirty) {
|
2601
2619
|
return !this.invalidMessage(data, dirty);
|
2602
2620
|
}
|
2603
|
-
setComponentValidity(
|
2604
|
-
|
2605
|
-
|
2606
|
-
this.setCustomValidity(messages, dirty);
|
2621
|
+
setComponentValidity(errors, dirty, silentCheck) {
|
2622
|
+
if (silentCheck) {
|
2623
|
+
return [];
|
2607
2624
|
}
|
2608
|
-
|
2609
|
-
|
2625
|
+
const messages = errors.filter(message => !message.fromServer);
|
2626
|
+
if (errors.length && !!messages.length && (!this.isEmpty(this.defaultValue) || dirty || !this.pristine)) {
|
2627
|
+
return this.setCustomValidity(messages, dirty);
|
2628
|
+
}
|
2629
|
+
else {
|
2630
|
+
return this.setCustomValidity('');
|
2610
2631
|
}
|
2611
|
-
|
2632
|
+
}
|
2633
|
+
/**
|
2634
|
+
* Interpolate errors from the validation methods.
|
2635
|
+
* @param {*} errors
|
2636
|
+
* @returns
|
2637
|
+
*/
|
2638
|
+
interpolateErrors(errors) {
|
2639
|
+
var _a;
|
2640
|
+
const interpolatedErrors = FormioUtils.interpolateErrors(this.component, errors, this.t.bind(this));
|
2641
|
+
return ((_a = this.serverErrors) === null || _a === void 0 ? void 0 : _a.length) ? [...interpolatedErrors, ...this.serverErrors] : interpolatedErrors;
|
2642
|
+
}
|
2643
|
+
/**
|
2644
|
+
* Show component validation errors.
|
2645
|
+
* @param {*} errors - An array of errors that have occured.
|
2646
|
+
* @param {*} data - The root submission data.
|
2647
|
+
* @param {*} row - The contextual row data.
|
2648
|
+
* @param {*} flags - The flags to perform validation.
|
2649
|
+
* @returns
|
2650
|
+
*/
|
2651
|
+
showValidationErrors(errors, data, row, flags) {
|
2652
|
+
if (flags.silentCheck) {
|
2653
|
+
return [];
|
2654
|
+
}
|
2655
|
+
if (this.options.alwaysDirty) {
|
2656
|
+
flags.dirty = true;
|
2657
|
+
}
|
2658
|
+
if (flags.fromSubmission && this.hasValue(data)) {
|
2659
|
+
flags.dirty = true;
|
2660
|
+
}
|
2661
|
+
this.setDirty(flags.dirty);
|
2662
|
+
return this.setComponentValidity(errors, flags.dirty, flags.silentCheck, flags.fromSubmission);
|
2663
|
+
}
|
2664
|
+
/**
|
2665
|
+
* Perform a component validation.
|
2666
|
+
* @param {*} data - The root data you wish to use for this component.
|
2667
|
+
* @param {*} row - The contextual row data you wish to use for this component.
|
2668
|
+
* @param {*} flags - The flags to control the behavior of the validation.
|
2669
|
+
* @returns
|
2670
|
+
*/
|
2671
|
+
validateComponent(data, row, flags = {}) {
|
2672
|
+
data = data || this.rootValue;
|
2673
|
+
row = row || this.data;
|
2674
|
+
const { async = false } = flags;
|
2675
|
+
if (this.shouldSkipValidation(data, row, flags)) {
|
2676
|
+
return async ? Promise.resolve([]) : [];
|
2677
|
+
}
|
2678
|
+
const processContext = {
|
2679
|
+
component: this.component,
|
2680
|
+
data,
|
2681
|
+
row,
|
2682
|
+
path: this.path || this.component.key,
|
2683
|
+
instance: this,
|
2684
|
+
scope: { errors: [] },
|
2685
|
+
processors: [
|
2686
|
+
async ? process_1.validateProcess : process_1.validateProcessSync
|
2687
|
+
]
|
2688
|
+
};
|
2689
|
+
if (async) {
|
2690
|
+
return (0, process_1.processOne)(processContext).then(() => {
|
2691
|
+
this._errors = this.interpolateErrors(processContext.scope.errors);
|
2692
|
+
return this._errors;
|
2693
|
+
});
|
2694
|
+
}
|
2695
|
+
(0, process_1.processOneSync)(processContext);
|
2696
|
+
this._errors = this.interpolateErrors(processContext.scope.errors);
|
2697
|
+
return this._errors;
|
2612
2698
|
}
|
2613
2699
|
/**
|
2614
2700
|
* Checks the validity of this component and sets the error message if it is invalid.
|
@@ -2618,33 +2704,47 @@ class Component extends Element_1.default {
|
|
2618
2704
|
* @param row
|
2619
2705
|
* @return {boolean}
|
2620
2706
|
*/
|
2621
|
-
checkComponentValidity(data, dirty, row,
|
2622
|
-
var _a;
|
2707
|
+
checkComponentValidity(data, dirty, row, flags = {}, allErrors = []) {
|
2623
2708
|
data = data || this.rootValue;
|
2624
2709
|
row = row || this.data;
|
2625
|
-
|
2626
|
-
if (
|
2627
|
-
this.
|
2628
|
-
|
2710
|
+
flags.dirty = dirty || false;
|
2711
|
+
if (flags.async) {
|
2712
|
+
return this.validateComponent(data, row, flags).then((errors) => {
|
2713
|
+
allErrors.push(...errors);
|
2714
|
+
if (this.parent && this.parent.childErrors) {
|
2715
|
+
this.parent.childErrors.push(...errors);
|
2716
|
+
}
|
2717
|
+
this.showValidationErrors(errors, data, row, flags);
|
2718
|
+
return errors.length === 0;
|
2719
|
+
});
|
2629
2720
|
}
|
2630
|
-
|
2631
|
-
|
2632
|
-
|
2633
|
-
|
2721
|
+
else {
|
2722
|
+
const errors = this.validateComponent(data, row, flags);
|
2723
|
+
this.showValidationErrors(errors, data, row, flags);
|
2724
|
+
allErrors.push(...errors);
|
2725
|
+
if (this.parent && this.parent.childErrors) {
|
2726
|
+
this.parent.childErrors.push(...errors);
|
2727
|
+
}
|
2728
|
+
return errors.length === 0;
|
2634
2729
|
}
|
2635
|
-
return async ?
|
2636
|
-
validations.then((messages) => this.setComponentValidity(messages, dirty, silentCheck)) :
|
2637
|
-
this.setComponentValidity(validations, dirty, silentCheck);
|
2638
2730
|
}
|
2639
|
-
|
2731
|
+
/**
|
2732
|
+
* Checks the validity of the component.
|
2733
|
+
* @param {*} data
|
2734
|
+
* @param {*} dirty
|
2735
|
+
* @param {*} row
|
2736
|
+
* @param {*} silentCheck
|
2737
|
+
* @returns
|
2738
|
+
*/
|
2739
|
+
checkValidity(data, dirty, row, silentCheck, errors = []) {
|
2640
2740
|
data = data || this.rootValue;
|
2641
2741
|
row = row || this.data;
|
2642
|
-
|
2643
|
-
this.
|
2644
|
-
return isValid;
|
2742
|
+
console.log('Deprecation warning: Component.checkValidity() will be deprecated in 6.x version of renderer. Use Component.validateComponent instead.');
|
2743
|
+
return this.checkComponentValidity(data, dirty, row, { silentCheck }, errors);
|
2645
2744
|
}
|
2646
|
-
checkAsyncValidity(data, dirty, row, silentCheck) {
|
2647
|
-
|
2745
|
+
checkAsyncValidity(data, dirty, row, silentCheck, errors = []) {
|
2746
|
+
console.log('Deprecation warning: Component.checkAsyncValidity() will be deprecated in 6.x version of renderer. Use Component.validateComponent instead.');
|
2747
|
+
return this.checkComponentValidity(data, dirty, row, { async: true, silentCheck }, errors);
|
2648
2748
|
}
|
2649
2749
|
/**
|
2650
2750
|
* Check the conditions, calculations, and validity of a single component and triggers an update if
|
@@ -2672,35 +2772,15 @@ class Component extends Element_1.default {
|
|
2672
2772
|
if (this.id !== flags.triggeredComponentId) {
|
2673
2773
|
this.calculateComponentValue(data, flags, row);
|
2674
2774
|
}
|
2675
|
-
if (flags.noValidate && !flags.validateOnInit && !flags.fromIframe) {
|
2676
|
-
if (flags.fromSubmission && this.rootPristine && this.pristine && this.error && flags.changed) {
|
2677
|
-
this.checkComponentValidity(data, !!this.options.alwaysDirty, row, true);
|
2678
|
-
}
|
2679
|
-
return true;
|
2680
|
-
}
|
2681
|
-
let isDirty = false;
|
2682
|
-
// We need to set dirty if they explicitly set noValidate to false.
|
2683
|
-
if (this.options.alwaysDirty || flags.dirty) {
|
2684
|
-
isDirty = true;
|
2685
|
-
}
|
2686
|
-
// See if they explicitely set the values with setSubmission.
|
2687
|
-
if (flags.fromSubmission && this.hasValue(data)) {
|
2688
|
-
isDirty = true;
|
2689
|
-
}
|
2690
|
-
this.setDirty(isDirty);
|
2691
|
-
if (this.component.validateOn === 'blur' && flags.fromSubmission) {
|
2692
|
-
return true;
|
2693
|
-
}
|
2694
|
-
const isValid = this.checkComponentValidity(data, isDirty, row, flags);
|
2695
|
-
this.checkModal();
|
2696
|
-
return isValid;
|
2697
2775
|
}
|
2698
|
-
checkModal(
|
2776
|
+
checkModal(errors = [], dirty = false) {
|
2777
|
+
const messages = errors.filter(error => !error.fromServer);
|
2778
|
+
const isValid = errors.length === 0;
|
2699
2779
|
if (!this.component.modalEdit || !this.componentModal) {
|
2700
2780
|
return;
|
2701
2781
|
}
|
2702
2782
|
if (dirty && !isValid) {
|
2703
|
-
this.setErrorClasses([this.refs.openModal], dirty, !isValid, !!
|
2783
|
+
this.setErrorClasses([this.refs.openModal], dirty, !isValid, !!messages.length, this.refs.openModalWrapper);
|
2704
2784
|
}
|
2705
2785
|
else {
|
2706
2786
|
this.clearErrorClasses(this.refs.openModalWrapper);
|
@@ -2724,9 +2804,6 @@ class Component extends Element_1.default {
|
|
2724
2804
|
validateMultiple() {
|
2725
2805
|
return true;
|
2726
2806
|
}
|
2727
|
-
get errors() {
|
2728
|
-
return this.error ? [this.error] : [];
|
2729
|
-
}
|
2730
2807
|
clearErrorClasses(element = this.element) {
|
2731
2808
|
this.removeClass(element, this.options.componentErrorClass);
|
2732
2809
|
this.removeClass(element, 'alert alert-danger');
|
@@ -2773,12 +2850,14 @@ class Component extends Element_1.default {
|
|
2773
2850
|
});
|
2774
2851
|
});
|
2775
2852
|
}
|
2853
|
+
// eslint-disable-next-line max-statements
|
2776
2854
|
setCustomValidity(messages, dirty, external) {
|
2777
2855
|
const inputRefs = this.isInputComponent ? this.refs.input || [] : null;
|
2778
2856
|
if (typeof messages === 'string' && messages) {
|
2779
2857
|
messages = {
|
2780
2858
|
level: 'error',
|
2781
2859
|
message: messages,
|
2860
|
+
component: this.component,
|
2782
2861
|
};
|
2783
2862
|
}
|
2784
2863
|
if (!Array.isArray(messages)) {
|
@@ -2789,19 +2868,20 @@ class Component extends Element_1.default {
|
|
2789
2868
|
messages = [];
|
2790
2869
|
}
|
2791
2870
|
}
|
2792
|
-
const
|
2871
|
+
const errors = messages.filter(message => message.level === 'error');
|
2793
2872
|
let invalidInputRefs = inputRefs;
|
2873
|
+
// Filter the invalid input refs in multiple components
|
2794
2874
|
if (this.component.multiple) {
|
2795
|
-
const
|
2796
|
-
|
2875
|
+
const refsArray = Array.from(inputRefs);
|
2876
|
+
refsArray.forEach((input) => {
|
2797
2877
|
this.setElementInvalid(this.performInputMapping(input), false);
|
2798
2878
|
});
|
2799
|
-
this.setInputWidgetErrorClasses(
|
2800
|
-
invalidInputRefs =
|
2879
|
+
this.setInputWidgetErrorClasses(refsArray, false);
|
2880
|
+
invalidInputRefs = refsArray.filter((ref, index) => {
|
2801
2881
|
var _a;
|
2802
2882
|
return (_a = messages.some) === null || _a === void 0 ? void 0 : _a.call(messages, (msg) => {
|
2803
2883
|
var _a;
|
2804
|
-
return ((_a = msg === null || msg === void 0 ? void 0 : msg.context) === null || _a === void 0 ? void 0 : _a.
|
2884
|
+
return ((_a = msg === null || msg === void 0 ? void 0 : msg.context) === null || _a === void 0 ? void 0 : _a.index) === index;
|
2805
2885
|
});
|
2806
2886
|
});
|
2807
2887
|
}
|
@@ -2809,40 +2889,32 @@ class Component extends Element_1.default {
|
|
2809
2889
|
if (this.refs.messageContainer) {
|
2810
2890
|
this.empty(this.refs.messageContainer);
|
2811
2891
|
}
|
2812
|
-
this.
|
2892
|
+
this.emit('componentError', {
|
2893
|
+
instance: this,
|
2813
2894
|
component: this.component,
|
2814
2895
|
message: messages[0].message,
|
2815
2896
|
messages,
|
2816
2897
|
external: !!external,
|
2817
|
-
};
|
2818
|
-
this.emit('componentError', this.error);
|
2898
|
+
});
|
2819
2899
|
this.addMessages(messages, dirty, invalidInputRefs);
|
2820
2900
|
if (invalidInputRefs) {
|
2821
|
-
this.setErrorClasses(invalidInputRefs, dirty,
|
2901
|
+
this.setErrorClasses(invalidInputRefs, dirty, !!errors.length, !!messages.length);
|
2822
2902
|
}
|
2823
2903
|
}
|
2824
|
-
else if (!
|
2904
|
+
else if (!errors.length || (errors[0].external === !!external)) {
|
2825
2905
|
if (this.refs.messageContainer) {
|
2826
2906
|
this.empty(this.refs.messageContainer);
|
2827
2907
|
}
|
2828
2908
|
if (this.refs.modalMessageContainer) {
|
2829
2909
|
this.empty(this.refs.modalMessageContainer);
|
2830
2910
|
}
|
2831
|
-
this.error = null;
|
2832
2911
|
if (invalidInputRefs) {
|
2833
|
-
this.setErrorClasses(invalidInputRefs, dirty,
|
2912
|
+
this.setErrorClasses(invalidInputRefs, dirty, !!errors.length, !!messages.length);
|
2834
2913
|
}
|
2835
2914
|
this.clearErrorClasses();
|
2836
2915
|
}
|
2837
|
-
|
2838
|
-
|
2839
|
-
// }
|
2840
|
-
// this.refs.input.forEach(input => {
|
2841
|
-
// input = this.performInputMapping(input);
|
2842
|
-
// if (typeof input.setCustomValidity === 'function') {
|
2843
|
-
// input.setCustomValidity(message, dirty);
|
2844
|
-
// }
|
2845
|
-
// });
|
2916
|
+
this._visibleErrors = messages;
|
2917
|
+
return messages;
|
2846
2918
|
}
|
2847
2919
|
/**
|
2848
2920
|
* Determines if the value of this component is hidden from the user as if it is coming from the server, but is
|
@@ -2862,8 +2934,10 @@ class Component extends Element_1.default {
|
|
2862
2934
|
}
|
2863
2935
|
return (this.component.protected || !this.component.persistent || (this.component.persistent === 'client-only'));
|
2864
2936
|
}
|
2865
|
-
shouldSkipValidation(data,
|
2937
|
+
shouldSkipValidation(data, row, flags = {}) {
|
2866
2938
|
const rules = [
|
2939
|
+
// Do not validate if the flags say not too.
|
2940
|
+
() => flags.noValidate,
|
2867
2941
|
// Do not check custom validation for empty data if it is not required
|
2868
2942
|
() => this.component.validate.custom && !this.dataValue && !this.component.validate.required,
|
2869
2943
|
// 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;
|
@@ -14,6 +14,33 @@ exports.default = [
|
|
14
14
|
input: true,
|
15
15
|
key: 'addons',
|
16
16
|
label: 'Addons',
|
17
|
+
templates: {
|
18
|
+
// eslint-disable-next-line quotes
|
19
|
+
header: `<div class="row">
|
20
|
+
<div class="col-6">{{ t(components[0].label) }}</div>
|
21
|
+
<div class="col-4">Settings</div>
|
22
|
+
</div>`,
|
23
|
+
// eslint-disable-next-line quotes
|
24
|
+
row: `<div class="row">
|
25
|
+
<div class="col-6">
|
26
|
+
{{ row.name.label }}
|
27
|
+
</div>
|
28
|
+
<div class="col-4 text-muted">
|
29
|
+
Click Edit to see addon's settings
|
30
|
+
</div>
|
31
|
+
|
32
|
+
{% if (!instance.options.readOnly && !instance.disabled) { %}
|
33
|
+
<div class="col-2">
|
34
|
+
<div class="btn-group pull-right">
|
35
|
+
<button class="btn btn-default btn-light btn-sm editRow"><i class="{{ iconClass('edit') }}"></i></button>
|
36
|
+
{% if (!instance.hasRemoveButtons || instance.hasRemoveButtons()) { %}
|
37
|
+
<button class="btn btn-danger btn-sm removeRow"><i class="{{ iconClass('trash') }}"></i></button>
|
38
|
+
{% } %}
|
39
|
+
</div>
|
40
|
+
</div>
|
41
|
+
{% } %}
|
42
|
+
</div>`,
|
43
|
+
},
|
17
44
|
components: [
|
18
45
|
{
|
19
46
|
label: 'Name',
|
@@ -38,7 +65,10 @@ exports.default = [
|
|
38
65
|
}));
|
39
66
|
},
|
40
67
|
},
|
41
|
-
input: true
|
68
|
+
input: true,
|
69
|
+
validate: {
|
70
|
+
required: true,
|
71
|
+
},
|
42
72
|
},
|
43
73
|
...addons_1.editForms,
|
44
74
|
]
|