@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
@@ -1,18 +0,0 @@
|
|
1
|
-
"use strict";
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
3
|
-
class Conjunctions {
|
4
|
-
static addConjunction(name, conjunction) {
|
5
|
-
Conjunctions.conjunctions[name] = conjunction;
|
6
|
-
}
|
7
|
-
static addConjunctions(conjunctions) {
|
8
|
-
Conjunctions.conjunctions = Object.assign(Object.assign({}, Conjunctions.conjunctions), conjunctions);
|
9
|
-
}
|
10
|
-
static getConjunction(name) {
|
11
|
-
return Conjunctions.conjunctions[name];
|
12
|
-
}
|
13
|
-
static getConjunctions() {
|
14
|
-
return Conjunctions.conjunctions;
|
15
|
-
}
|
16
|
-
}
|
17
|
-
Conjunctions.conjunctions = {};
|
18
|
-
exports.default = Conjunctions;
|
@@ -1,18 +0,0 @@
|
|
1
|
-
"use strict";
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
3
|
-
class Operators {
|
4
|
-
static addOperator(name, operator) {
|
5
|
-
Operators.operators[name] = operator;
|
6
|
-
}
|
7
|
-
static addOperators(operators) {
|
8
|
-
Operators.operators = Object.assign(Object.assign({}, Operators.operators), operators);
|
9
|
-
}
|
10
|
-
static getOperator(name) {
|
11
|
-
return Operators.operators[name];
|
12
|
-
}
|
13
|
-
static getOperators() {
|
14
|
-
return Operators.operators;
|
15
|
-
}
|
16
|
-
}
|
17
|
-
Operators.operators = {};
|
18
|
-
exports.default = Operators;
|
@@ -1,18 +0,0 @@
|
|
1
|
-
"use strict";
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
3
|
-
class QuickRules {
|
4
|
-
static addQuickRule(name, quickRule) {
|
5
|
-
QuickRules.quickRules[name] = quickRule;
|
6
|
-
}
|
7
|
-
static addQuickRules(quickRules) {
|
8
|
-
QuickRules.quickRules = Object.assign(Object.assign({}, QuickRules.quickRules), quickRules);
|
9
|
-
}
|
10
|
-
static getQuickRule(name) {
|
11
|
-
return QuickRules.quickRules[name];
|
12
|
-
}
|
13
|
-
static getQuickRules() {
|
14
|
-
return QuickRules.quickRules;
|
15
|
-
}
|
16
|
-
}
|
17
|
-
QuickRules.quickRules = {};
|
18
|
-
exports.default = QuickRules;
|
@@ -1,30 +0,0 @@
|
|
1
|
-
"use strict";
|
2
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
3
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
4
|
-
};
|
5
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
6
|
-
const Rule_1 = __importDefault(require("./Rule"));
|
7
|
-
class Custom extends Rule_1.default {
|
8
|
-
constructor() {
|
9
|
-
super(...arguments);
|
10
|
-
this.defaultMessage = '{{error}}';
|
11
|
-
}
|
12
|
-
check(value, data, row, index) {
|
13
|
-
const custom = this.settings.custom;
|
14
|
-
if (!custom) {
|
15
|
-
return true;
|
16
|
-
}
|
17
|
-
const valid = this.component.evaluate(custom, {
|
18
|
-
valid: true,
|
19
|
-
data,
|
20
|
-
row,
|
21
|
-
rowIndex: index,
|
22
|
-
input: value,
|
23
|
-
}, 'valid', true);
|
24
|
-
if (valid === null) {
|
25
|
-
return true;
|
26
|
-
}
|
27
|
-
return valid;
|
28
|
-
}
|
29
|
-
}
|
30
|
-
exports.default = Custom;
|
@@ -1,25 +0,0 @@
|
|
1
|
-
"use strict";
|
2
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
3
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
4
|
-
};
|
5
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
6
|
-
const Rule_1 = __importDefault(require("./Rule"));
|
7
|
-
class DateRule extends Rule_1.default {
|
8
|
-
constructor() {
|
9
|
-
super(...arguments);
|
10
|
-
this.defaultMessage = '{{field}} is not a valid date.';
|
11
|
-
}
|
12
|
-
check(value) {
|
13
|
-
if (!value) {
|
14
|
-
return true;
|
15
|
-
}
|
16
|
-
if (value === 'Invalid date' || value === 'Invalid Date') {
|
17
|
-
return false;
|
18
|
-
}
|
19
|
-
if (typeof value === 'string') {
|
20
|
-
value = new Date(value);
|
21
|
-
}
|
22
|
-
return value instanceof Date === true && value.toString() !== 'Invalid Date';
|
23
|
-
}
|
24
|
-
}
|
25
|
-
exports.default = DateRule;
|
@@ -1,58 +0,0 @@
|
|
1
|
-
"use strict";
|
2
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
3
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
4
|
-
};
|
5
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
6
|
-
const Rule_1 = __importDefault(require("./Rule"));
|
7
|
-
class Day extends Rule_1.default {
|
8
|
-
constructor() {
|
9
|
-
super(...arguments);
|
10
|
-
this.defaultMessage = '{{field}} is not a valid day.';
|
11
|
-
}
|
12
|
-
check(value) {
|
13
|
-
if (!value) {
|
14
|
-
return true;
|
15
|
-
}
|
16
|
-
if (typeof value !== 'string') {
|
17
|
-
return false;
|
18
|
-
}
|
19
|
-
const [DAY, MONTH, YEAR] = this.component.dayFirst ? [0, 1, 2] : [1, 0, 2];
|
20
|
-
const values = value.split('/').map(x => parseInt(x, 10)), day = values[DAY], month = values[MONTH], year = values[YEAR], maxDay = getDaysInMonthCount(month, year);
|
21
|
-
if (isNaN(day) || day < 0 || day > maxDay) {
|
22
|
-
return false;
|
23
|
-
}
|
24
|
-
if (isNaN(month) || month < 0 || month > 12) {
|
25
|
-
return false;
|
26
|
-
}
|
27
|
-
if (isNaN(year) || year < 0 || year > 9999) {
|
28
|
-
return false;
|
29
|
-
}
|
30
|
-
return true;
|
31
|
-
function isLeapYear(year) {
|
32
|
-
// Year is leap if it is evenly divisible by 400 or evenly divisible by 4 and not evenly divisible by 100.
|
33
|
-
return !(year % 400) || (!!(year % 100) && !(year % 4));
|
34
|
-
}
|
35
|
-
function getDaysInMonthCount(month, year) {
|
36
|
-
switch (month) {
|
37
|
-
case 1: // January
|
38
|
-
case 3: // March
|
39
|
-
case 5: // May
|
40
|
-
case 7: // July
|
41
|
-
case 8: // August
|
42
|
-
case 10: // October
|
43
|
-
case 12: // December
|
44
|
-
return 31;
|
45
|
-
case 4: // April
|
46
|
-
case 6: // June
|
47
|
-
case 9: // September
|
48
|
-
case 11: // November
|
49
|
-
return 30;
|
50
|
-
case 2: // February
|
51
|
-
return isLeapYear(year) ? 29 : 28;
|
52
|
-
default:
|
53
|
-
return 31;
|
54
|
-
}
|
55
|
-
}
|
56
|
-
}
|
57
|
-
}
|
58
|
-
exports.default = Day;
|
@@ -1,24 +0,0 @@
|
|
1
|
-
"use strict";
|
2
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
3
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
4
|
-
};
|
5
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
6
|
-
const Rule_1 = __importDefault(require("./Rule"));
|
7
|
-
class Email extends Rule_1.default {
|
8
|
-
constructor() {
|
9
|
-
super(...arguments);
|
10
|
-
this.defaultMessage = '{{field}} must be a valid email.';
|
11
|
-
}
|
12
|
-
check(value) {
|
13
|
-
if (!value) {
|
14
|
-
return true;
|
15
|
-
}
|
16
|
-
/* eslint-disable max-len */
|
17
|
-
// From http://stackoverflow.com/questions/46155/validate-email-address-in-javascript
|
18
|
-
const re = /^(([^<>()[\]\\.,;:\s@"]+(\.[^<>()[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/;
|
19
|
-
/* eslint-enable max-len */
|
20
|
-
// Allow emails to be valid if the component is pristine and no value is provided.
|
21
|
-
return re.test(value);
|
22
|
-
}
|
23
|
-
}
|
24
|
-
exports.default = Email;
|
@@ -1,29 +0,0 @@
|
|
1
|
-
"use strict";
|
2
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
3
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
4
|
-
};
|
5
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
6
|
-
const Rule_1 = __importDefault(require("./Rule"));
|
7
|
-
class JSON extends Rule_1.default {
|
8
|
-
constructor() {
|
9
|
-
super(...arguments);
|
10
|
-
this.defaultMessage = '{{error}}';
|
11
|
-
}
|
12
|
-
check(value, data, row, index) {
|
13
|
-
const { json } = this.settings;
|
14
|
-
if (!json) {
|
15
|
-
return true;
|
16
|
-
}
|
17
|
-
const valid = this.component.evaluate(json, {
|
18
|
-
data,
|
19
|
-
row,
|
20
|
-
rowIndex: index,
|
21
|
-
input: value
|
22
|
-
});
|
23
|
-
if (valid === null) {
|
24
|
-
return true;
|
25
|
-
}
|
26
|
-
return valid;
|
27
|
-
}
|
28
|
-
}
|
29
|
-
exports.default = JSON;
|
@@ -1,32 +0,0 @@
|
|
1
|
-
"use strict";
|
2
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
3
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
4
|
-
};
|
5
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
6
|
-
const utils_1 = require("../../utils/utils");
|
7
|
-
const Rule_1 = __importDefault(require("./Rule"));
|
8
|
-
class Mask extends Rule_1.default {
|
9
|
-
constructor() {
|
10
|
-
super(...arguments);
|
11
|
-
this.defaultMessage = '{{field}} does not match the mask.';
|
12
|
-
}
|
13
|
-
check(value) {
|
14
|
-
let inputMask;
|
15
|
-
if (this.component.isMultipleMasksField) {
|
16
|
-
const maskName = value ? value.maskName : undefined;
|
17
|
-
const formioInputMask = this.component.getMaskByName(maskName);
|
18
|
-
if (formioInputMask) {
|
19
|
-
inputMask = (0, utils_1.getInputMask)(formioInputMask);
|
20
|
-
}
|
21
|
-
value = value ? value.value : value;
|
22
|
-
}
|
23
|
-
else {
|
24
|
-
inputMask = (0, utils_1.getInputMask)(this.settings.mask);
|
25
|
-
}
|
26
|
-
if (value && inputMask) {
|
27
|
-
return (0, utils_1.matchInputMask)(value, inputMask);
|
28
|
-
}
|
29
|
-
return true;
|
30
|
-
}
|
31
|
-
}
|
32
|
-
exports.default = Mask;
|
@@ -1,21 +0,0 @@
|
|
1
|
-
"use strict";
|
2
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
3
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
4
|
-
};
|
5
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
6
|
-
const Rule_1 = __importDefault(require("./Rule"));
|
7
|
-
class Max extends Rule_1.default {
|
8
|
-
constructor() {
|
9
|
-
super(...arguments);
|
10
|
-
this.defaultMessage = '{{field}} cannot be greater than {{settings.limit}}.';
|
11
|
-
}
|
12
|
-
check(value) {
|
13
|
-
const max = parseFloat(this.settings.limit);
|
14
|
-
const parsedValue = parseFloat(value);
|
15
|
-
if (Number.isNaN(max) || Number.isNaN(parsedValue)) {
|
16
|
-
return true;
|
17
|
-
}
|
18
|
-
return parsedValue <= max;
|
19
|
-
}
|
20
|
-
}
|
21
|
-
exports.default = Max;
|
@@ -1,34 +0,0 @@
|
|
1
|
-
"use strict";
|
2
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
3
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
4
|
-
};
|
5
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
6
|
-
const utils_1 = require("../../utils/utils");
|
7
|
-
const moment_1 = __importDefault(require("moment"));
|
8
|
-
const lodash_1 = __importDefault(require("lodash"));
|
9
|
-
const Rule_1 = __importDefault(require("./Rule"));
|
10
|
-
class MaxDate extends Rule_1.default {
|
11
|
-
constructor() {
|
12
|
-
super(...arguments);
|
13
|
-
this.defaultMessage = '{{field}} should not contain date after {{settings.dateLimit}}';
|
14
|
-
}
|
15
|
-
check(value) {
|
16
|
-
if (!value) {
|
17
|
-
return true;
|
18
|
-
}
|
19
|
-
// If they are the exact same string or object, then return true.
|
20
|
-
if (value === this.settings.dateLimit) {
|
21
|
-
return true;
|
22
|
-
}
|
23
|
-
const date = (0, moment_1.default)(value);
|
24
|
-
const maxDate = (0, utils_1.getDateSetting)(this.settings.dateLimit);
|
25
|
-
if (lodash_1.default.isNull(maxDate)) {
|
26
|
-
return true;
|
27
|
-
}
|
28
|
-
else {
|
29
|
-
maxDate.setHours(0, 0, 0, 0);
|
30
|
-
}
|
31
|
-
return date.isBefore(maxDate) || date.isSame(maxDate);
|
32
|
-
}
|
33
|
-
}
|
34
|
-
exports.default = MaxDate;
|
@@ -1,20 +0,0 @@
|
|
1
|
-
"use strict";
|
2
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
3
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
4
|
-
};
|
5
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
6
|
-
const Rule_1 = __importDefault(require("./Rule"));
|
7
|
-
class MaxLength extends Rule_1.default {
|
8
|
-
constructor() {
|
9
|
-
super(...arguments);
|
10
|
-
this.defaultMessage = '{{field}} must have no more than {{- settings.length}} characters.';
|
11
|
-
}
|
12
|
-
check(value) {
|
13
|
-
const maxLength = parseInt(this.settings.length, 10);
|
14
|
-
if (!value || !maxLength || !value.hasOwnProperty('length')) {
|
15
|
-
return true;
|
16
|
-
}
|
17
|
-
return (value.length <= maxLength);
|
18
|
-
}
|
19
|
-
}
|
20
|
-
exports.default = MaxLength;
|
@@ -1,20 +0,0 @@
|
|
1
|
-
"use strict";
|
2
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
3
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
4
|
-
};
|
5
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
6
|
-
const Rule_1 = __importDefault(require("./Rule"));
|
7
|
-
class MaxWords extends Rule_1.default {
|
8
|
-
constructor() {
|
9
|
-
super(...arguments);
|
10
|
-
this.defaultMessage = '{{field}} must have no more than {{- settings.length}} words.';
|
11
|
-
}
|
12
|
-
check(value) {
|
13
|
-
const maxWords = parseInt(this.settings.length, 10);
|
14
|
-
if (!maxWords || (typeof value !== 'string')) {
|
15
|
-
return true;
|
16
|
-
}
|
17
|
-
return (value.trim().split(/\s+/).length <= maxWords);
|
18
|
-
}
|
19
|
-
}
|
20
|
-
exports.default = MaxWords;
|
@@ -1,22 +0,0 @@
|
|
1
|
-
"use strict";
|
2
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
3
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
4
|
-
};
|
5
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
6
|
-
const Rule_1 = __importDefault(require("./Rule"));
|
7
|
-
class MaxYear extends Rule_1.default {
|
8
|
-
constructor() {
|
9
|
-
super(...arguments);
|
10
|
-
this.defaultMessage = '{{field}} should not contain year greater than {{maxYear}}';
|
11
|
-
}
|
12
|
-
check(value) {
|
13
|
-
const maxYear = this.settings;
|
14
|
-
let year = /\d{4}$/.exec(value);
|
15
|
-
year = year ? year[0] : null;
|
16
|
-
if (!(+maxYear) || !(+year)) {
|
17
|
-
return true;
|
18
|
-
}
|
19
|
-
return +year <= +maxYear;
|
20
|
-
}
|
21
|
-
}
|
22
|
-
exports.default = MaxYear;
|
@@ -1,21 +0,0 @@
|
|
1
|
-
"use strict";
|
2
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
3
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
4
|
-
};
|
5
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
6
|
-
const Rule_1 = __importDefault(require("./Rule"));
|
7
|
-
class Min extends Rule_1.default {
|
8
|
-
constructor() {
|
9
|
-
super(...arguments);
|
10
|
-
this.defaultMessage = '{{field}} cannot be less than {{settings.limit}}.';
|
11
|
-
}
|
12
|
-
check(value) {
|
13
|
-
const min = parseFloat(this.settings.limit);
|
14
|
-
const parsedValue = parseFloat(value);
|
15
|
-
if (Number.isNaN(min) || Number.isNaN(parsedValue)) {
|
16
|
-
return true;
|
17
|
-
}
|
18
|
-
return parsedValue >= min;
|
19
|
-
}
|
20
|
-
}
|
21
|
-
exports.default = Min;
|
@@ -1,30 +0,0 @@
|
|
1
|
-
"use strict";
|
2
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
3
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
4
|
-
};
|
5
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
6
|
-
const utils_1 = require("../../utils/utils");
|
7
|
-
const moment_1 = __importDefault(require("moment"));
|
8
|
-
const lodash_1 = __importDefault(require("lodash"));
|
9
|
-
const Rule_1 = __importDefault(require("./Rule"));
|
10
|
-
class MinDate extends Rule_1.default {
|
11
|
-
constructor() {
|
12
|
-
super(...arguments);
|
13
|
-
this.defaultMessage = '{{field}} should not contain date before {{settings.dateLimit}}';
|
14
|
-
}
|
15
|
-
check(value) {
|
16
|
-
if (!value) {
|
17
|
-
return true;
|
18
|
-
}
|
19
|
-
const date = (0, moment_1.default)(value);
|
20
|
-
const minDate = (0, utils_1.getDateSetting)(this.settings.dateLimit);
|
21
|
-
if (lodash_1.default.isNull(minDate)) {
|
22
|
-
return true;
|
23
|
-
}
|
24
|
-
else {
|
25
|
-
minDate.setHours(0, 0, 0, 0);
|
26
|
-
}
|
27
|
-
return date.isAfter(minDate) || date.isSame(minDate);
|
28
|
-
}
|
29
|
-
}
|
30
|
-
exports.default = MinDate;
|
@@ -1,20 +0,0 @@
|
|
1
|
-
"use strict";
|
2
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
3
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
4
|
-
};
|
5
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
6
|
-
const Rule_1 = __importDefault(require("./Rule"));
|
7
|
-
class MinLength extends Rule_1.default {
|
8
|
-
constructor() {
|
9
|
-
super(...arguments);
|
10
|
-
this.defaultMessage = '{{field}} must have no more than {{- settings.length}} characters.';
|
11
|
-
}
|
12
|
-
check(value) {
|
13
|
-
const minLength = parseInt(this.settings.length, 10);
|
14
|
-
if (!minLength || !value || !value.hasOwnProperty('length') || this.component.isEmpty(value)) {
|
15
|
-
return true;
|
16
|
-
}
|
17
|
-
return (value.length >= minLength);
|
18
|
-
}
|
19
|
-
}
|
20
|
-
exports.default = MinLength;
|
@@ -1,20 +0,0 @@
|
|
1
|
-
"use strict";
|
2
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
3
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
4
|
-
};
|
5
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
6
|
-
const Rule_1 = __importDefault(require("./Rule"));
|
7
|
-
class MinWords extends Rule_1.default {
|
8
|
-
constructor() {
|
9
|
-
super(...arguments);
|
10
|
-
this.defaultMessage = '{{field}} must have at least {{- settings.length}} words.';
|
11
|
-
}
|
12
|
-
check(value) {
|
13
|
-
const minWords = parseInt(this.settings.length, 10);
|
14
|
-
if (!minWords || !value || (typeof value !== 'string')) {
|
15
|
-
return true;
|
16
|
-
}
|
17
|
-
return (value.trim().split(/\s+/).length >= minWords);
|
18
|
-
}
|
19
|
-
}
|
20
|
-
exports.default = MinWords;
|
@@ -1,22 +0,0 @@
|
|
1
|
-
"use strict";
|
2
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
3
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
4
|
-
};
|
5
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
6
|
-
const Rule_1 = __importDefault(require("./Rule"));
|
7
|
-
class MinYear extends Rule_1.default {
|
8
|
-
constructor() {
|
9
|
-
super(...arguments);
|
10
|
-
this.defaultMessage = '{{field}} should not contain year less than {{minYear}}';
|
11
|
-
}
|
12
|
-
check(value) {
|
13
|
-
const minYear = this.settings;
|
14
|
-
let year = /\d{4}$/.exec(value);
|
15
|
-
year = year ? year[0] : null;
|
16
|
-
if (!(+minYear) || !(+year)) {
|
17
|
-
return true;
|
18
|
-
}
|
19
|
-
return +year >= +minYear;
|
20
|
-
}
|
21
|
-
}
|
22
|
-
exports.default = MinYear;
|