@formio/js 5.0.0-rc.27 → 5.0.0-rc.28
Sign up to get free protection for your applications and to get access to all the features.
- 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 +710 -689
- package/dist/formio.form.min.js +1 -1
- package/dist/formio.form.min.js.LICENSE.txt +2 -2
- package/dist/formio.full.css +100 -3
- package/dist/formio.full.js +715 -727
- package/dist/formio.full.min.css +2 -2
- package/dist/formio.full.min.js +1 -1
- package/dist/formio.full.min.js.LICENSE.txt +2 -2
- package/dist/formio.js +659 -264
- package/dist/formio.min.js +1 -1
- package/dist/formio.min.js.LICENSE.txt +2 -2
- package/dist/formio.utils.js +29 -8
- package/dist/formio.utils.min.js +1 -1
- package/dist/formio.utils.min.js.LICENSE.txt +2 -2
- package/lib/cjs/Embed.d.ts +1 -1
- package/lib/cjs/Embed.js +14 -6
- package/lib/cjs/PDF.js +2 -2
- package/lib/cjs/Webform.d.ts +3 -5
- package/lib/cjs/Webform.js +59 -81
- package/lib/cjs/WebformBuilder.d.ts +1 -1
- package/lib/cjs/WebformBuilder.js +27 -10
- package/lib/cjs/Wizard.d.ts +2 -0
- 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 +2 -38
- package/lib/cjs/index.d.ts +2 -1
- package/lib/cjs/index.js +2 -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/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/utils.d.ts +2 -1
- package/lib/cjs/utils/utils.js +27 -9
- package/lib/mjs/Embed.d.ts +1 -1
- package/lib/mjs/Embed.js +14 -6
- package/lib/mjs/PDF.js +2 -2
- package/lib/mjs/Webform.d.ts +3 -5
- package/lib/mjs/Webform.js +58 -82
- package/lib/mjs/WebformBuilder.d.ts +1 -1
- package/lib/mjs/WebformBuilder.js +28 -7
- package/lib/mjs/Wizard.d.ts +2 -0
- 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 +2 -32
- package/lib/mjs/index.d.ts +2 -1
- package/lib/mjs/index.js +1 -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/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/utils.d.ts +2 -1
- package/lib/mjs/utils/utils.js +24 -7
- package/package.json +5 -5
- 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
@@ -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;
|
@@ -7,6 +7,7 @@ const lodash_1 = __importDefault(require("lodash"));
|
|
7
7
|
const Field_1 = __importDefault(require("../field/Field"));
|
8
8
|
const Components_1 = __importDefault(require("../../Components"));
|
9
9
|
const utils_1 = require("../../../utils/utils");
|
10
|
+
const core_1 = require("@formio/core");
|
10
11
|
class NestedComponent extends Field_1.default {
|
11
12
|
static schema(...extend) {
|
12
13
|
return Field_1.default.schema({
|
@@ -34,7 +35,7 @@ class NestedComponent extends Field_1.default {
|
|
34
35
|
collapse(value) {
|
35
36
|
const promise = this.redraw();
|
36
37
|
if (!value) {
|
37
|
-
this.checkValidity(this.data, !this.pristine
|
38
|
+
this.checkValidity(this.data, !this.pristine);
|
38
39
|
}
|
39
40
|
return promise;
|
40
41
|
}
|
@@ -192,6 +193,14 @@ class NestedComponent extends Field_1.default {
|
|
192
193
|
*/
|
193
194
|
getComponent(path, fn, originalPath) {
|
194
195
|
originalPath = originalPath || (0, utils_1.getStringFromComponentPath)(path);
|
196
|
+
if (this.componentsMap.hasOwnProperty(originalPath)) {
|
197
|
+
if (fn) {
|
198
|
+
return fn(this.componentsMap[originalPath]);
|
199
|
+
}
|
200
|
+
else {
|
201
|
+
return this.componentsMap[originalPath];
|
202
|
+
}
|
203
|
+
}
|
195
204
|
path = (0, utils_1.getArrayFromComponentPath)(path);
|
196
205
|
const pathStr = originalPath;
|
197
206
|
const newPath = lodash_1.default.clone(path);
|
@@ -246,26 +255,6 @@ class NestedComponent extends Field_1.default {
|
|
246
255
|
});
|
247
256
|
return comp;
|
248
257
|
}
|
249
|
-
/**
|
250
|
-
* Return a path of component's value.
|
251
|
-
*
|
252
|
-
* @param {Object} component - The component instance.
|
253
|
-
* @return {string} - The component's value path.
|
254
|
-
*/
|
255
|
-
calculateComponentPath(component) {
|
256
|
-
let path = '';
|
257
|
-
if (component.component.key) {
|
258
|
-
let thisPath = this;
|
259
|
-
while (thisPath && !thisPath.allowData && thisPath.parent) {
|
260
|
-
thisPath = thisPath.parent;
|
261
|
-
}
|
262
|
-
const rowIndex = component.row ? `[${Number.parseInt(component.row)}]` : '';
|
263
|
-
path = thisPath.path ? `${thisPath.path}${rowIndex}.` : '';
|
264
|
-
path += component._parentPath && component.component.shouldIncludeSubFormPath ? component._parentPath : '';
|
265
|
-
path += component.component.key;
|
266
|
-
return path;
|
267
|
-
}
|
268
|
-
}
|
269
258
|
/**
|
270
259
|
* Create a new component and add it to the components array.
|
271
260
|
*
|
@@ -286,14 +275,7 @@ class NestedComponent extends Field_1.default {
|
|
286
275
|
if (!(options.display === 'pdf' && this.builderMode)) {
|
287
276
|
component.id = (0, utils_1.getRandomComponentId)();
|
288
277
|
}
|
289
|
-
if (!this.isInputComponent && this.component.shouldIncludeSubFormPath) {
|
290
|
-
component.shouldIncludeSubFormPath = true;
|
291
|
-
}
|
292
278
|
const comp = Components_1.default.create(component, options, data, true);
|
293
|
-
const path = this.calculateComponentPath(comp);
|
294
|
-
if (path) {
|
295
|
-
comp.path = path;
|
296
|
-
}
|
297
279
|
comp.init();
|
298
280
|
if (component.internal) {
|
299
281
|
return comp;
|
@@ -366,9 +348,6 @@ class NestedComponent extends Field_1.default {
|
|
366
348
|
addComponent(component, data, before, noAdd) {
|
367
349
|
data = data || this.data;
|
368
350
|
this.components = this.components || [];
|
369
|
-
if (this.options.parentPath) {
|
370
|
-
component.shouldIncludeSubFormPath = true;
|
371
|
-
}
|
372
351
|
component = this.hook('addComponent', component, data, before, noAdd);
|
373
352
|
const comp = this.createComponent(component, this.options, data, before ? before : null);
|
374
353
|
if (noAdd) {
|
@@ -455,7 +434,7 @@ class NestedComponent extends Field_1.default {
|
|
455
434
|
return Promise.all(promises);
|
456
435
|
}
|
457
436
|
/**
|
458
|
-
* Remove a component from the components array
|
437
|
+
* Remove a component from the components array and from the children object
|
459
438
|
*
|
460
439
|
* @param {Component} component - The component to remove from the components.
|
461
440
|
* @param {Array<Component>} components - An array of components to remove this component from.
|
@@ -464,6 +443,9 @@ class NestedComponent extends Field_1.default {
|
|
464
443
|
components = components || this.components;
|
465
444
|
component.destroy(all);
|
466
445
|
lodash_1.default.remove(components, { id: component.id });
|
446
|
+
if (this.componentsMap[component.path]) {
|
447
|
+
delete this.componentsMap[component.path];
|
448
|
+
}
|
467
449
|
}
|
468
450
|
/**
|
469
451
|
* Removes a component provided the API key of that component.
|
@@ -512,13 +494,13 @@ class NestedComponent extends Field_1.default {
|
|
512
494
|
return comp.updateValue(null, flags) || changed;
|
513
495
|
}, super.updateValue(value, flags));
|
514
496
|
}
|
515
|
-
shouldSkipValidation(data,
|
497
|
+
shouldSkipValidation(data, row, flags) {
|
516
498
|
// Nested components with no input should not be validated.
|
517
499
|
if (!this.component.input) {
|
518
500
|
return true;
|
519
501
|
}
|
520
502
|
else {
|
521
|
-
return super.shouldSkipValidation(data,
|
503
|
+
return super.shouldSkipValidation(data, row, flags);
|
522
504
|
}
|
523
505
|
}
|
524
506
|
checkData(data, flags, row, components) {
|
@@ -529,11 +511,8 @@ class NestedComponent extends Field_1.default {
|
|
529
511
|
flags = flags || {};
|
530
512
|
row = row || this.data;
|
531
513
|
components = components && lodash_1.default.isArray(components) ? components : this.getComponents();
|
532
|
-
|
533
|
-
|
534
|
-
}, super.checkData(data, flags, row));
|
535
|
-
this.checkModal(isValid, this.isDirty);
|
536
|
-
return isValid;
|
514
|
+
super.checkData(data, flags, row);
|
515
|
+
components.forEach((comp) => comp.checkData(data, flags, row));
|
537
516
|
}
|
538
517
|
checkConditions(data, flags, row) {
|
539
518
|
// check conditions of parent component first, because it may influence on visibility of it's children
|
@@ -571,7 +550,7 @@ class NestedComponent extends Field_1.default {
|
|
571
550
|
* @return {*}
|
572
551
|
*/
|
573
552
|
beforeSubmit() {
|
574
|
-
return Promise.
|
553
|
+
return Promise.allSettled(this.getComponents().map((comp) => comp.beforeSubmit()));
|
575
554
|
}
|
576
555
|
calculateValue(data, flags, row) {
|
577
556
|
// Do not iterate into children and calculateValues if this nested component is conditionally hidden.
|
@@ -586,23 +565,75 @@ class NestedComponent extends Field_1.default {
|
|
586
565
|
isValid(data, dirty) {
|
587
566
|
return this.getComponents().reduce((valid, comp) => comp.isValid(data, dirty) && valid, super.isValid(data, dirty));
|
588
567
|
}
|
589
|
-
|
590
|
-
|
591
|
-
|
592
|
-
|
593
|
-
|
594
|
-
|
595
|
-
|
568
|
+
validationProcessor({ scope, data, row, instance }, flags) {
|
569
|
+
const { dirty } = flags;
|
570
|
+
if (!instance) {
|
571
|
+
return;
|
572
|
+
}
|
573
|
+
instance.checkComponentValidity(data, dirty, row, flags, scope.errors);
|
574
|
+
if (instance.processOwnValidation) {
|
575
|
+
scope.noRecurse = true;
|
596
576
|
}
|
597
|
-
|
598
|
-
|
599
|
-
|
577
|
+
}
|
578
|
+
/**
|
579
|
+
* Perform a validation on all child components of this nested component.
|
580
|
+
* @param {*} components
|
581
|
+
* @param {*} data
|
582
|
+
* @param {*} flags
|
583
|
+
* @returns
|
584
|
+
*/
|
585
|
+
validateComponents(components, data, flags = {}) {
|
586
|
+
components = components || this.component.components;
|
587
|
+
data = data || this.rootValue;
|
588
|
+
const { async, dirty, process } = flags;
|
589
|
+
const processorContext = {
|
590
|
+
process: process || 'unknown',
|
591
|
+
components,
|
592
|
+
instances: this.componentsMap,
|
593
|
+
data: data,
|
594
|
+
scope: { errors: [] },
|
595
|
+
processors: [
|
596
|
+
(context) => this.validationProcessor(context, flags),
|
597
|
+
({ instance, component, components }) => {
|
598
|
+
// If we just validated the last component, and there are errors from our parent, then we need to show a model of those errors.
|
599
|
+
if (instance &&
|
600
|
+
instance.parent &&
|
601
|
+
(component === components[components.length - 1]) &&
|
602
|
+
instance.parent.componentModal) {
|
603
|
+
instance.parent.checkModal(instance.parent.childErrors, dirty);
|
604
|
+
}
|
605
|
+
}
|
606
|
+
]
|
607
|
+
};
|
608
|
+
return async ? (0, core_1.process)(processorContext).then((scope) => scope.errors) : (0, core_1.processSync)(processorContext).errors;
|
609
|
+
}
|
610
|
+
/**
|
611
|
+
* Validate a nested component with data, or its own internal data.
|
612
|
+
* @param {*} data
|
613
|
+
* @param {*} flags
|
614
|
+
* @returns
|
615
|
+
*/
|
616
|
+
validate(data, flags = {}) {
|
617
|
+
data = data || this.rootValue;
|
618
|
+
return this.validateComponents(this.getComponents().map((component) => component.component), data, flags);
|
619
|
+
}
|
620
|
+
checkComponentValidity(data, dirty, row, flags = {}, allErrors = []) {
|
621
|
+
this.childErrors = [];
|
622
|
+
return super.checkComponentValidity(data, dirty, row, flags, allErrors);
|
623
|
+
}
|
624
|
+
checkValidity(data, dirty, row, silentCheck, childErrors = []) {
|
625
|
+
console.log('Deprecation warning: Component.checkValidity() will be deprecated in 6.x version of renderer. Use "validate" method instead.');
|
626
|
+
childErrors.push(...this.validate(data, { dirty, silentCheck }));
|
627
|
+
return this.checkComponentValidity(data, dirty, row, { dirty, silentCheck }, childErrors) && childErrors.length === 0;
|
600
628
|
}
|
601
629
|
checkAsyncValidity(data, dirty, row, silentCheck) {
|
630
|
+
console.log('Deprecation warning: Component.checkAsyncValidity() will be deprecated in 6.x version of renderer.');
|
602
631
|
return this.ready.then(() => {
|
603
|
-
|
604
|
-
|
605
|
-
|
632
|
+
return this.validate(data, { dirty, silentCheck, async: true }).then((childErrors) => {
|
633
|
+
return this.checkComponentValidity(data, dirty, row, { dirty, silentCheck, async: true }, childErrors).then((valid) => {
|
634
|
+
return valid && childErrors.length === 0;
|
635
|
+
});
|
636
|
+
});
|
606
637
|
});
|
607
638
|
}
|
608
639
|
setPristine(pristine) {
|
@@ -636,8 +667,11 @@ class NestedComponent extends Field_1.default {
|
|
636
667
|
components.forEach((comp) => this.removeComponent(comp, this.components, all));
|
637
668
|
this.components = [];
|
638
669
|
}
|
670
|
+
get visibleErrors() {
|
671
|
+
return this.getComponents().reduce((errors, comp) => errors.concat(comp.visibleErrors || []), super.visibleErrors);
|
672
|
+
}
|
639
673
|
get errors() {
|
640
|
-
const thisErrors =
|
674
|
+
const thisErrors = super.errors;
|
641
675
|
return this.getComponents()
|
642
676
|
.reduce((errors, comp) => errors.concat(comp.errors || []), thisErrors)
|
643
677
|
.filter(err => err.level !== 'hidden');
|
@@ -677,9 +711,6 @@ class NestedComponent extends Field_1.default {
|
|
677
711
|
if (!value) {
|
678
712
|
return false;
|
679
713
|
}
|
680
|
-
if (value.submitAsDraft && !value.submit) {
|
681
|
-
flags.noValidate = true;
|
682
|
-
}
|
683
714
|
return this.getComponents().reduce((changed, component) => {
|
684
715
|
return this.setNestedValue(component, value, flags, changed) || changed;
|
685
716
|
}, false);
|
@@ -5,10 +5,11 @@ export default class NestedArrayComponent extends NestedDataComponent {
|
|
5
5
|
prevHasAddButton: any;
|
6
6
|
checkAddButtonChanged(): void;
|
7
7
|
checkData(data: any, flags: any, row: any): any;
|
8
|
-
|
9
|
-
|
8
|
+
processRows(method: any, data: any, opts: any, defaultValue: any, silentCheck: any): any;
|
9
|
+
validate(data: any, flags?: {}): any;
|
10
|
+
processRow(method: any, data: any, opts: any, row: any, components: any, silentCheck: any): any;
|
10
11
|
hasAddButton(): any;
|
11
|
-
getComponent(path: any, fn: any, originalPath: any): any
|
12
|
+
getComponent(path: any, fn: any, originalPath: any): any;
|
12
13
|
everyComponent(fn: any, rowIndex: any, options: any): void;
|
13
14
|
getComponents(rowIndex: any): any;
|
14
15
|
}
|
@@ -44,19 +44,23 @@ class NestedArrayComponent extends NestedDataComponent_1.default {
|
|
44
44
|
flags = flags || {};
|
45
45
|
row = row || this.data;
|
46
46
|
this.checkAddButtonChanged();
|
47
|
-
return this.
|
47
|
+
return this.processRows('checkData', data, flags, Component_1.default.prototype.checkData.call(this, data, flags, row));
|
48
48
|
}
|
49
|
-
|
49
|
+
processRows(method, data, opts, defaultValue, silentCheck) {
|
50
50
|
return this.iteratableRows.reduce((valid, row, rowIndex) => {
|
51
51
|
if (!(opts === null || opts === void 0 ? void 0 : opts.rowIndex) || (opts === null || opts === void 0 ? void 0 : opts.rowIndex) === rowIndex) {
|
52
|
-
return this.
|
52
|
+
return this.processRow(method, data, opts, row.data, row.components, silentCheck) && valid;
|
53
53
|
}
|
54
54
|
else {
|
55
55
|
return valid;
|
56
56
|
}
|
57
57
|
}, defaultValue);
|
58
58
|
}
|
59
|
-
|
59
|
+
validate(data, flags = {}) {
|
60
|
+
data = data || this.data;
|
61
|
+
return this.validateComponents([this.component], data, flags);
|
62
|
+
}
|
63
|
+
processRow(method, data, opts, row, components, silentCheck) {
|
60
64
|
if (opts === null || opts === void 0 ? void 0 : opts.isolateRow) {
|
61
65
|
silentCheck = true;
|
62
66
|
opts.noRefresh = true;
|
@@ -81,6 +85,15 @@ class NestedArrayComponent extends NestedDataComponent_1.default {
|
|
81
85
|
}, 'show'));
|
82
86
|
}
|
83
87
|
getComponent(path, fn, originalPath) {
|
88
|
+
originalPath = originalPath || (0, utils_1.getStringFromComponentPath)(path);
|
89
|
+
if (this.componentsMap.hasOwnProperty(originalPath)) {
|
90
|
+
if (fn) {
|
91
|
+
return fn(this.componentsMap[originalPath]);
|
92
|
+
}
|
93
|
+
else {
|
94
|
+
return this.componentsMap[originalPath];
|
95
|
+
}
|
96
|
+
}
|
84
97
|
path = Array.isArray(path) ? path : [path];
|
85
98
|
let key = path.shift();
|
86
99
|
const remainingPath = path;
|
@@ -42,7 +42,6 @@ const Tags_form_1 = __importDefault(require("./tags/Tags.form"));
|
|
42
42
|
const TextArea_form_1 = __importDefault(require("./textarea/TextArea.form"));
|
43
43
|
const TextField_form_1 = __importDefault(require("./textfield/TextField.form"));
|
44
44
|
const Time_form_1 = __importDefault(require("./time/Time.form"));
|
45
|
-
const Tree_form_1 = __importDefault(require("./tree/Tree.form"));
|
46
45
|
const Unknown_form_1 = __importDefault(require("./unknown/Unknown.form"));
|
47
46
|
const Url_form_1 = __importDefault(require("./url/Url.form"));
|
48
47
|
const Well_form_1 = __importDefault(require("./well/Well.form"));
|
@@ -84,7 +83,6 @@ _1.default.tags.editForm = Tags_form_1.default;
|
|
84
83
|
_1.default.textarea.editForm = TextArea_form_1.default;
|
85
84
|
_1.default.textfield.editForm = TextField_form_1.default;
|
86
85
|
_1.default.time.editForm = Time_form_1.default;
|
87
|
-
_1.default.tree.editForm = Tree_form_1.default;
|
88
86
|
_1.default.unknown.editForm = Unknown_form_1.default;
|
89
87
|
_1.default.url.editForm = Url_form_1.default;
|
90
88
|
_1.default.well.editForm = Well_form_1.default;
|
@@ -195,7 +195,7 @@ class ButtonComponent extends Field_1.default {
|
|
195
195
|
const isSilent = flags && flags.silent;
|
196
196
|
//check root validity only if disableOnInvalid is set and when it is not possible to make submission because of validation errors
|
197
197
|
if (flags && flags.noValidate && (this.component.disableOnInvalid || this.hasError)) {
|
198
|
-
isValid = flags.rootValidity || (this.root ? this.root.
|
198
|
+
isValid = flags.rootValidity || (this.root ? (this.root.validate(this.root.data, { dirty: false, silentCheck: true }).length === 0) : true);
|
199
199
|
flags.rootValidity = isValid;
|
200
200
|
}
|
201
201
|
this.isDisabledOnInvalid = this.component.disableOnInvalid && (isSilent || !isValid);
|
@@ -284,6 +284,7 @@ class ButtonComponent extends Field_1.default {
|
|
284
284
|
event.stopPropagation();
|
285
285
|
this.loading = true;
|
286
286
|
this.emit('submitButton', {
|
287
|
+
noValidate: this.component.state === 'draft',
|
287
288
|
state: this.component.state || 'submitted',
|
288
289
|
component: this.component,
|
289
290
|
instance: this
|
@@ -22,6 +22,7 @@ export default class ColumnsComponent extends NestedComponent {
|
|
22
22
|
* @return {Array.<ColumnComponent[]>}
|
23
23
|
*/
|
24
24
|
groupByRow(): Array<ColumnComponent[]>;
|
25
|
+
checkData(data: any, flags: any, row: any, components: any): void;
|
25
26
|
detach(all: any): void;
|
26
27
|
}
|
27
28
|
import NestedComponent from '../_classes/nested/NestedComponent';
|
@@ -71,7 +71,7 @@ class ColumnsComponent extends NestedComponent_1.default {
|
|
71
71
|
if (!column.size) {
|
72
72
|
column.size = 'md';
|
73
73
|
}
|
74
|
-
column.currentWidth = column.width || 0;
|
74
|
+
column.currentWidth = this.options.condensedMode ? this.gridSize : column.width || 0;
|
75
75
|
// Ensure there is a components array.
|
76
76
|
if (!Array.isArray(column.components)) {
|
77
77
|
column.components = [];
|
@@ -140,14 +140,13 @@ class ColumnsComponent extends NestedComponent_1.default {
|
|
140
140
|
return lodash_1.default.concat(result.rows, [result.stack]);
|
141
141
|
}
|
142
142
|
checkData(data, flags, row, components) {
|
143
|
-
|
143
|
+
super.checkData(data, flags, row, components);
|
144
144
|
if (this.component.autoAdjust && this.options.display !== 'pdf') {
|
145
145
|
const redraw = this.justify();
|
146
146
|
if (redraw) {
|
147
147
|
this.redraw();
|
148
148
|
}
|
149
149
|
}
|
150
|
-
return isValid;
|
151
150
|
}
|
152
151
|
detach(all) {
|
153
152
|
super.detach(all);
|
@@ -5,8 +5,29 @@ declare const _default: ({
|
|
5
5
|
type?: undefined;
|
6
6
|
input?: undefined;
|
7
7
|
label?: undefined;
|
8
|
-
|
8
|
+
placeholder?: undefined;
|
9
9
|
tooltip?: undefined;
|
10
|
+
validate?: undefined;
|
11
|
+
autofocus?: undefined;
|
12
|
+
overrideEditForm?: undefined;
|
13
|
+
addAnother?: undefined;
|
14
|
+
reorder?: undefined;
|
15
|
+
components?: undefined;
|
16
|
+
} | {
|
17
|
+
weight: number;
|
18
|
+
type: string;
|
19
|
+
input: boolean;
|
20
|
+
key: string;
|
21
|
+
label: string;
|
22
|
+
placeholder: string;
|
23
|
+
tooltip: string;
|
24
|
+
validate: {
|
25
|
+
required: boolean;
|
26
|
+
};
|
27
|
+
autofocus: boolean;
|
28
|
+
overrideEditForm: boolean;
|
29
|
+
ignore?: undefined;
|
30
|
+
addAnother?: undefined;
|
10
31
|
reorder?: undefined;
|
11
32
|
components?: undefined;
|
12
33
|
} | {
|
@@ -43,6 +64,10 @@ declare const _default: ({
|
|
43
64
|
data?: undefined;
|
44
65
|
})[];
|
45
66
|
ignore?: undefined;
|
67
|
+
placeholder?: undefined;
|
68
|
+
validate?: undefined;
|
69
|
+
autofocus?: undefined;
|
70
|
+
overrideEditForm?: undefined;
|
46
71
|
} | {
|
47
72
|
weight: number;
|
48
73
|
type: string;
|
@@ -51,6 +76,10 @@ declare const _default: ({
|
|
51
76
|
key: string;
|
52
77
|
input: boolean;
|
53
78
|
ignore?: undefined;
|
79
|
+
placeholder?: undefined;
|
80
|
+
validate?: undefined;
|
81
|
+
autofocus?: undefined;
|
82
|
+
overrideEditForm?: undefined;
|
54
83
|
addAnother?: undefined;
|
55
84
|
reorder?: undefined;
|
56
85
|
components?: undefined;
|
@@ -33,6 +33,24 @@ exports.default = [
|
|
33
33
|
key: 'tableView',
|
34
34
|
ignore: true
|
35
35
|
},
|
36
|
+
{
|
37
|
+
key: 'hideLabel',
|
38
|
+
ignore: true
|
39
|
+
},
|
40
|
+
{
|
41
|
+
weight: 0,
|
42
|
+
type: 'textfield',
|
43
|
+
input: true,
|
44
|
+
key: 'label',
|
45
|
+
label: 'Label',
|
46
|
+
placeholder: 'Field Label',
|
47
|
+
tooltip: 'The label for this field.',
|
48
|
+
validate: {
|
49
|
+
required: true
|
50
|
+
},
|
51
|
+
autofocus: true,
|
52
|
+
overrideEditForm: true
|
53
|
+
},
|
36
54
|
{
|
37
55
|
weight: 150,
|
38
56
|
type: 'datagrid',
|
@@ -96,5 +114,9 @@ exports.default = [
|
|
96
114
|
tooltip: 'Will automatically adjust columns based on if nested components are hidden.',
|
97
115
|
key: 'autoAdjust',
|
98
116
|
input: true
|
99
|
-
}
|
117
|
+
},
|
118
|
+
{
|
119
|
+
key: 'hideLabel',
|
120
|
+
ignore: true
|
121
|
+
},
|
100
122
|
];
|
@@ -10,6 +10,7 @@ export default class ContainerComponent extends NestedDataComponent {
|
|
10
10
|
};
|
11
11
|
constructor(...args: any[]);
|
12
12
|
addComponents(data: any, options: any): void;
|
13
|
+
checkData(data: any, flags: any, row: any, components: any): void;
|
13
14
|
focus(): void;
|
14
15
|
}
|
15
16
|
import NestedDataComponent from '../_classes/nesteddata/NestedDataComponent';
|
@@ -59,12 +59,8 @@ class ContainerComponent extends NestedDataComponent_1.default {
|
|
59
59
|
flags = flags || {};
|
60
60
|
row = row || this.data;
|
61
61
|
components = components && lodash_1.default.isArray(components) ? components : this.getComponents();
|
62
|
-
|
63
|
-
|
64
|
-
}, Component_1.default.prototype.checkData.call(this, data, flags, row));
|
65
|
-
}
|
66
|
-
checkChildComponentsValidity(data, dirty, row, silentCheck, isParentValid) {
|
67
|
-
return super.checkChildComponentsValidity(data, dirty, this.dataValue, silentCheck, isParentValid);
|
62
|
+
Component_1.default.prototype.checkData.call(this, data, flags, row);
|
63
|
+
components.forEach((comp) => comp.checkData(data, flags, this.dataValue));
|
68
64
|
}
|
69
65
|
focus() {
|
70
66
|
const focusableElements = (0, utils_1.getFocusableElements)(this.element);
|
@@ -70,14 +70,6 @@ export default class DataGridComponent extends NestedArrayComponent {
|
|
70
70
|
setRowComponentsData(rowIndex: any, rowData: any): void;
|
71
71
|
createRows(init: any, rebuild: any): boolean;
|
72
72
|
createRowComponents(row: any, rowIndex: any): {};
|
73
|
-
/**
|
74
|
-
* Checks the validity of this datagrid.
|
75
|
-
*
|
76
|
-
* @param data
|
77
|
-
* @param dirty
|
78
|
-
* @return {*}
|
79
|
-
*/
|
80
|
-
checkValidity(data: any, dirty: any, row: any, silentCheck: any): any;
|
81
73
|
checkColumns(data: any, flags?: {}): {
|
82
74
|
rebuild: boolean;
|
83
75
|
show: boolean;
|
@@ -6,6 +6,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
6
|
const lodash_1 = __importDefault(require("lodash"));
|
7
7
|
const NestedArrayComponent_1 = __importDefault(require("../_classes/nestedarray/NestedArrayComponent"));
|
8
8
|
const utils_1 = require("../../utils/utils");
|
9
|
+
const Components_1 = require("../Components");
|
9
10
|
class DataGridComponent extends NestedArrayComponent_1.default {
|
10
11
|
static schema(...extend) {
|
11
12
|
return NestedArrayComponent_1.default.schema({
|
@@ -346,10 +347,13 @@ class DataGridComponent extends NestedArrayComponent_1.default {
|
|
346
347
|
}
|
347
348
|
focusOnNewRowElement(row) {
|
348
349
|
Object.keys(row).find((key) => {
|
349
|
-
const
|
350
|
-
if (
|
351
|
-
focusableElements
|
352
|
-
|
350
|
+
const element = row[key].element;
|
351
|
+
if (element) {
|
352
|
+
const focusableElements = (0, utils_1.getFocusableElements)(element);
|
353
|
+
if (focusableElements && focusableElements[0]) {
|
354
|
+
focusableElements[0].focus();
|
355
|
+
return true;
|
356
|
+
}
|
353
357
|
}
|
354
358
|
return false;
|
355
359
|
});
|
@@ -390,7 +394,7 @@ class DataGridComponent extends NestedArrayComponent_1.default {
|
|
390
394
|
}
|
391
395
|
component.rowIndex = rowIndex;
|
392
396
|
component.row = `${rowIndex}-${colIndex}`;
|
393
|
-
component.path =
|
397
|
+
component.path = Components_1.Components.getComponentPath(component);
|
394
398
|
});
|
395
399
|
}
|
396
400
|
updateRowsComponents(rowIndex) {
|
@@ -473,27 +477,6 @@ class DataGridComponent extends NestedArrayComponent_1.default {
|
|
473
477
|
});
|
474
478
|
return components;
|
475
479
|
}
|
476
|
-
/**
|
477
|
-
* Checks the validity of this datagrid.
|
478
|
-
*
|
479
|
-
* @param data
|
480
|
-
* @param dirty
|
481
|
-
* @return {*}
|
482
|
-
*/
|
483
|
-
checkValidity(data, dirty, row, silentCheck) {
|
484
|
-
data = data || this.rootValue;
|
485
|
-
row = row || this.data;
|
486
|
-
if (!this.checkCondition(row, data)) {
|
487
|
-
this.setCustomValidity('');
|
488
|
-
return true;
|
489
|
-
}
|
490
|
-
if (!this.checkComponentValidity(data, dirty, row, { silentCheck })) {
|
491
|
-
return false;
|
492
|
-
}
|
493
|
-
const isValid = this.checkRows('checkValidity', data, dirty, true, silentCheck);
|
494
|
-
this.checkModal(isValid, dirty);
|
495
|
-
return isValid;
|
496
|
-
}
|
497
480
|
checkColumns(data, flags = {}) {
|
498
481
|
data = data || this.rootValue;
|
499
482
|
let show = false;
|