@formio/js 5.0.0-rc.26 → 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 +2 -1
- package/lib/cjs/Embed.js +20 -7
- 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 +2 -1
- package/lib/mjs/Embed.js +20 -7
- 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 +6 -6
- 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,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 Pattern extends Rule_1.default {
|
8
|
-
constructor() {
|
9
|
-
super(...arguments);
|
10
|
-
this.defaultMessage = '{{field}} does not match the pattern {{settings.pattern}}';
|
11
|
-
}
|
12
|
-
check(value) {
|
13
|
-
const { pattern } = this.settings;
|
14
|
-
if (!pattern) {
|
15
|
-
return true;
|
16
|
-
}
|
17
|
-
return (new RegExp(`^${pattern}$`)).test(value);
|
18
|
-
}
|
19
|
-
}
|
20
|
-
exports.default = Pattern;
|
@@ -1,17 +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 Required extends Rule_1.default {
|
8
|
-
constructor() {
|
9
|
-
super(...arguments);
|
10
|
-
this.defaultMessage = '{{field}} is required';
|
11
|
-
}
|
12
|
-
check(value) {
|
13
|
-
// TODO: Day, Survey overrides.
|
14
|
-
return !this.component.isValueHidden() && !this.component.isEmpty(value);
|
15
|
-
}
|
16
|
-
}
|
17
|
-
exports.default = Required;
|
@@ -1,12 +0,0 @@
|
|
1
|
-
"use strict";
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
3
|
-
class Rule {
|
4
|
-
constructor(component, settings, config) {
|
5
|
-
this.component = component;
|
6
|
-
this.settings = settings;
|
7
|
-
this.config = config;
|
8
|
-
}
|
9
|
-
check() {
|
10
|
-
}
|
11
|
-
}
|
12
|
-
exports.default = Rule;
|
@@ -1,95 +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 fetch_ponyfill_1 = __importDefault(require("fetch-ponyfill"));
|
8
|
-
const { fetch, Headers, Request } = (0, fetch_ponyfill_1.default)({
|
9
|
-
Promise: Promise
|
10
|
-
});
|
11
|
-
const lodash_1 = __importDefault(require("lodash"));
|
12
|
-
const Rule_1 = __importDefault(require("./Rule"));
|
13
|
-
class Select extends Rule_1.default {
|
14
|
-
constructor() {
|
15
|
-
super(...arguments);
|
16
|
-
this.defaultMessage = '{{field}} contains an invalid selection';
|
17
|
-
}
|
18
|
-
check(value, data, row, async) {
|
19
|
-
// Skip if value is empty
|
20
|
-
if (!value || lodash_1.default.isEmpty(value)) {
|
21
|
-
return true;
|
22
|
-
}
|
23
|
-
// Skip if we're not async-capable
|
24
|
-
if (!async) {
|
25
|
-
return true;
|
26
|
-
}
|
27
|
-
const schema = this.component.component;
|
28
|
-
// Initialize the request options
|
29
|
-
const requestOptions = {
|
30
|
-
url: this.settings.url,
|
31
|
-
method: 'GET',
|
32
|
-
qs: {},
|
33
|
-
json: true,
|
34
|
-
headers: {}
|
35
|
-
};
|
36
|
-
// If the url is a boolean value
|
37
|
-
if (lodash_1.default.isBoolean(requestOptions.url)) {
|
38
|
-
requestOptions.url = !!requestOptions.url;
|
39
|
-
if (!requestOptions.url ||
|
40
|
-
schema.dataSrc !== 'url' ||
|
41
|
-
!schema.data.url ||
|
42
|
-
!schema.searchField) {
|
43
|
-
return true;
|
44
|
-
}
|
45
|
-
// Get the validation url
|
46
|
-
requestOptions.url = schema.data.url;
|
47
|
-
// Add the search field
|
48
|
-
requestOptions.qs[schema.searchField] = value;
|
49
|
-
// Add the filters
|
50
|
-
if (schema.filter) {
|
51
|
-
requestOptions.url += (!requestOptions.url.includes('?') ? '?' : '&') + schema.filter;
|
52
|
-
}
|
53
|
-
// If they only wish to return certain fields.
|
54
|
-
if (schema.selectFields) {
|
55
|
-
requestOptions.qs.select = schema.selectFields;
|
56
|
-
}
|
57
|
-
}
|
58
|
-
if (!requestOptions.url) {
|
59
|
-
return true;
|
60
|
-
}
|
61
|
-
// Make sure to interpolate.
|
62
|
-
requestOptions.url = (0, utils_1.interpolate)(requestOptions.url, { data: this.component.data });
|
63
|
-
// Add query string to URL
|
64
|
-
requestOptions.url += (requestOptions.url.includes('?') ? '&' : '?') + lodash_1.default.chain(requestOptions.qs)
|
65
|
-
.map((val, key) => `${encodeURIComponent(key)}=${encodeURIComponent(val)}`)
|
66
|
-
.join('&')
|
67
|
-
.value();
|
68
|
-
// Set custom headers.
|
69
|
-
if (schema.data && schema.data.headers) {
|
70
|
-
lodash_1.default.each(schema.data.headers, header => {
|
71
|
-
if (header.key) {
|
72
|
-
requestOptions.headers[header.key] = header.value;
|
73
|
-
}
|
74
|
-
});
|
75
|
-
}
|
76
|
-
// Set form.io authentication.
|
77
|
-
if (schema.authenticate && this.config.token) {
|
78
|
-
requestOptions.headers['x-jwt-token'] = this.config.token;
|
79
|
-
}
|
80
|
-
return fetch(new Request(requestOptions.url, {
|
81
|
-
headers: new Headers(requestOptions.headers)
|
82
|
-
}))
|
83
|
-
.then(response => {
|
84
|
-
if (!response.ok) {
|
85
|
-
return false;
|
86
|
-
}
|
87
|
-
return response.json();
|
88
|
-
})
|
89
|
-
.then((results) => {
|
90
|
-
return results && results.length;
|
91
|
-
})
|
92
|
-
.catch(() => false);
|
93
|
-
}
|
94
|
-
}
|
95
|
-
exports.default = Select;
|
@@ -1,19 +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
|
-
const moment_1 = __importDefault(require("moment"));
|
8
|
-
class Time extends Rule_1.default {
|
9
|
-
constructor() {
|
10
|
-
super(...arguments);
|
11
|
-
this.defaultMessage = '{{field}} must contain valid time';
|
12
|
-
}
|
13
|
-
check(value) {
|
14
|
-
if (this.component.isEmpty(value))
|
15
|
-
return true;
|
16
|
-
return (0, moment_1.default)(value, this.component.component.format).isValid();
|
17
|
-
}
|
18
|
-
}
|
19
|
-
exports.default = Time;
|
@@ -1,69 +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 lodash_1 = __importDefault(require("lodash"));
|
8
|
-
const Rule_1 = __importDefault(require("./Rule"));
|
9
|
-
class Unique extends Rule_1.default {
|
10
|
-
constructor() {
|
11
|
-
super(...arguments);
|
12
|
-
this.defaultMessage = '{{field}} must be unique';
|
13
|
-
}
|
14
|
-
check(value) {
|
15
|
-
// Skip if value is empty object or falsy
|
16
|
-
if (!value || lodash_1.default.isObjectLike(value) && lodash_1.default.isEmpty(value)) {
|
17
|
-
return true;
|
18
|
-
}
|
19
|
-
// Skip if we don't have a database connection
|
20
|
-
if (!this.config.db) {
|
21
|
-
return true;
|
22
|
-
}
|
23
|
-
return new Promise(resolve => {
|
24
|
-
const form = this.config.form;
|
25
|
-
const submission = this.config.submission;
|
26
|
-
const path = `data.${this.component.path}`;
|
27
|
-
// Build the query
|
28
|
-
const query = { form: form._id };
|
29
|
-
if (lodash_1.default.isString(value)) {
|
30
|
-
query[path] = {
|
31
|
-
$regex: new RegExp(`^${(0, utils_1.escapeRegExCharacters)(value)}$`),
|
32
|
-
$options: 'i'
|
33
|
-
};
|
34
|
-
}
|
35
|
-
else if (lodash_1.default.isPlainObject(value) &&
|
36
|
-
value.address &&
|
37
|
-
value.address['address_components'] &&
|
38
|
-
value.address['place_id']) {
|
39
|
-
query[`${path}.address.place_id`] = {
|
40
|
-
$regex: new RegExp(`^${(0, utils_1.escapeRegExCharacters)(value.address['place_id'])}$`),
|
41
|
-
$options: 'i'
|
42
|
-
};
|
43
|
-
}
|
44
|
-
// Compare the contents of arrays vs the order.
|
45
|
-
else if (lodash_1.default.isArray(value)) {
|
46
|
-
query[path] = { $all: value };
|
47
|
-
}
|
48
|
-
else if (lodash_1.default.isObject(value) || lodash_1.default.isNumber(value)) {
|
49
|
-
query[path] = { $eq: value };
|
50
|
-
}
|
51
|
-
// Only search for non-deleted items
|
52
|
-
query.deleted = { $eq: null };
|
53
|
-
// Try to find an existing value within the form
|
54
|
-
this.config.db.findOne(query, (err, result) => {
|
55
|
-
if (err) {
|
56
|
-
return resolve(false);
|
57
|
-
}
|
58
|
-
else if (result) {
|
59
|
-
// Only OK if it matches the current submission
|
60
|
-
return resolve(submission._id && (result._id.toString() === submission._id));
|
61
|
-
}
|
62
|
-
else {
|
63
|
-
return resolve(true);
|
64
|
-
}
|
65
|
-
});
|
66
|
-
}).catch(() => false);
|
67
|
-
}
|
68
|
-
}
|
69
|
-
exports.default = Unique;
|
@@ -1,23 +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 Url extends Rule_1.default {
|
8
|
-
constructor() {
|
9
|
-
super(...arguments);
|
10
|
-
this.defaultMessage = '{{field}} must be a valid url.';
|
11
|
-
}
|
12
|
-
check(value) {
|
13
|
-
/* eslint-disable max-len */
|
14
|
-
// From https://stackoverflow.com/questions/8667070/javascript-regular-expression-to-validate-url
|
15
|
-
const re = /^(?:(?:(?:https?|ftp):)?\/\/)?(?:\S+(?::\S*)?@)?(?:(?!(?:10|127)(?:\.\d{1,3}){3})(?!(?:169\.254|192\.168)(?:\.\d{1,3}){2})(?!172\.(?:1[6-9]|2\d|3[0-1])(?:\.\d{1,3}){2})(?:[1-9]\d?|1\d\d|2[01]\d|22[0-3])(?:\.(?:1?\d{1,2}|2[0-4]\d|25[0-5])){2}(?:\.(?:[1-9]\d?|1\d\d|2[0-4]\d|25[0-4]))|(?:(?:[a-z\u00a1-\uffff0-9]-*)*[a-z\u00a1-\uffff0-9]+)(?:\.(?:[a-z\u00a1-\uffff0-9]-*)*[a-z\u00a1-\uffff0-9]+)*(?:\.(?:[a-z\u00a1-\uffff]{2,})))(?::\d{2,5})?(?:[/?#]\S*)?$/i;
|
16
|
-
// From http://stackoverflow.com/questions/46155/validate-email-address-in-javascript
|
17
|
-
const emailRe = /^(([^<>()[\]\\.,;:\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,}))$/;
|
18
|
-
/* eslint-enable max-len */
|
19
|
-
// Allow urls to be valid if the component is pristine and no value is provided.
|
20
|
-
return !value || (re.test(value) && !emailRe.test(value));
|
21
|
-
}
|
22
|
-
}
|
23
|
-
exports.default = Url;
|
@@ -1,47 +0,0 @@
|
|
1
|
-
declare namespace _default {
|
2
|
-
export { custom };
|
3
|
-
export { date };
|
4
|
-
export { day };
|
5
|
-
export { email };
|
6
|
-
export { json };
|
7
|
-
export { mask };
|
8
|
-
export { max };
|
9
|
-
export { maxDate };
|
10
|
-
export { maxLength };
|
11
|
-
export { maxWords };
|
12
|
-
export { min };
|
13
|
-
export { minDate };
|
14
|
-
export { minLength };
|
15
|
-
export { minWords };
|
16
|
-
export { pattern };
|
17
|
-
export { required };
|
18
|
-
export { select };
|
19
|
-
export { unique };
|
20
|
-
export { url };
|
21
|
-
export { minYear };
|
22
|
-
export { maxYear };
|
23
|
-
export { time };
|
24
|
-
}
|
25
|
-
export default _default;
|
26
|
-
import custom from './Custom';
|
27
|
-
import date from './Date';
|
28
|
-
import day from './Day';
|
29
|
-
import email from './Email';
|
30
|
-
import json from './JSON';
|
31
|
-
import mask from './Mask';
|
32
|
-
import max from './Max';
|
33
|
-
import maxDate from './MaxDate';
|
34
|
-
import maxLength from './MaxLength';
|
35
|
-
import maxWords from './MaxWords';
|
36
|
-
import min from './Min';
|
37
|
-
import minDate from './MinDate';
|
38
|
-
import minLength from './MinLength';
|
39
|
-
import minWords from './MinWords';
|
40
|
-
import pattern from './Pattern';
|
41
|
-
import required from './Required';
|
42
|
-
import select from './Select';
|
43
|
-
import unique from './Unique';
|
44
|
-
import url from './Url';
|
45
|
-
import minYear from './MinYear';
|
46
|
-
import maxYear from './MaxYear';
|
47
|
-
import time from './Time';
|
@@ -1,51 +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 Custom_1 = __importDefault(require("./Custom"));
|
7
|
-
const Date_1 = __importDefault(require("./Date"));
|
8
|
-
const Day_1 = __importDefault(require("./Day"));
|
9
|
-
const Email_1 = __importDefault(require("./Email"));
|
10
|
-
const JSON_1 = __importDefault(require("./JSON"));
|
11
|
-
const Mask_1 = __importDefault(require("./Mask"));
|
12
|
-
const Max_1 = __importDefault(require("./Max"));
|
13
|
-
const MaxDate_1 = __importDefault(require("./MaxDate"));
|
14
|
-
const MaxLength_1 = __importDefault(require("./MaxLength"));
|
15
|
-
const MaxWords_1 = __importDefault(require("./MaxWords"));
|
16
|
-
const Min_1 = __importDefault(require("./Min"));
|
17
|
-
const MinDate_1 = __importDefault(require("./MinDate"));
|
18
|
-
const MinLength_1 = __importDefault(require("./MinLength"));
|
19
|
-
const MinWords_1 = __importDefault(require("./MinWords"));
|
20
|
-
const Pattern_1 = __importDefault(require("./Pattern"));
|
21
|
-
const Required_1 = __importDefault(require("./Required"));
|
22
|
-
const Select_1 = __importDefault(require("./Select"));
|
23
|
-
const Unique_1 = __importDefault(require("./Unique"));
|
24
|
-
const Url_1 = __importDefault(require("./Url"));
|
25
|
-
const MinYear_1 = __importDefault(require("./MinYear"));
|
26
|
-
const MaxYear_1 = __importDefault(require("./MaxYear"));
|
27
|
-
const Time_1 = __importDefault(require("./Time"));
|
28
|
-
exports.default = {
|
29
|
-
custom: Custom_1.default,
|
30
|
-
date: Date_1.default,
|
31
|
-
day: Day_1.default,
|
32
|
-
email: Email_1.default,
|
33
|
-
json: JSON_1.default,
|
34
|
-
mask: Mask_1.default,
|
35
|
-
max: Max_1.default,
|
36
|
-
maxDate: MaxDate_1.default,
|
37
|
-
maxLength: MaxLength_1.default,
|
38
|
-
maxWords: MaxWords_1.default,
|
39
|
-
min: Min_1.default,
|
40
|
-
minDate: MinDate_1.default,
|
41
|
-
minLength: MinLength_1.default,
|
42
|
-
minWords: MinWords_1.default,
|
43
|
-
pattern: Pattern_1.default,
|
44
|
-
required: Required_1.default,
|
45
|
-
select: Select_1.default,
|
46
|
-
unique: Unique_1.default,
|
47
|
-
url: Url_1.default,
|
48
|
-
minYear: MinYear_1.default,
|
49
|
-
maxYear: MaxYear_1.default,
|
50
|
-
time: Time_1.default,
|
51
|
-
};
|
@@ -1,18 +0,0 @@
|
|
1
|
-
"use strict";
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
3
|
-
class Transformers {
|
4
|
-
static addTransformer(name, transformer) {
|
5
|
-
Transformers.transformers[name] = transformer;
|
6
|
-
}
|
7
|
-
static addTransformers(transformers) {
|
8
|
-
Transformers.transformers = Object.assign(Object.assign({}, Transformers.transformers), transformers);
|
9
|
-
}
|
10
|
-
static getTransformer(name) {
|
11
|
-
return Transformers.transformers[name];
|
12
|
-
}
|
13
|
-
static getTransformers() {
|
14
|
-
return Transformers.transformers;
|
15
|
-
}
|
16
|
-
}
|
17
|
-
Transformers.transformers = {};
|
18
|
-
exports.default = Transformers;
|
@@ -1,18 +0,0 @@
|
|
1
|
-
"use strict";
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
3
|
-
class ValueSources {
|
4
|
-
static addValueSource(name, valueSource) {
|
5
|
-
ValueSources.valueSources[name] = valueSource;
|
6
|
-
}
|
7
|
-
static addValueSources(valueSources) {
|
8
|
-
ValueSources.valueSources = Object.assign(Object.assign({}, ValueSources.valueSources), valueSources);
|
9
|
-
}
|
10
|
-
static getValueSource(name) {
|
11
|
-
return ValueSources.valueSources[name];
|
12
|
-
}
|
13
|
-
static getValueSources() {
|
14
|
-
return ValueSources.valueSources;
|
15
|
-
}
|
16
|
-
}
|
17
|
-
ValueSources.valueSources = {};
|
18
|
-
exports.default = ValueSources;
|
@@ -1,55 +0,0 @@
|
|
1
|
-
export default class Node {
|
2
|
-
constructor(parent: any, { data, children, }?: {
|
3
|
-
data?: {} | undefined;
|
4
|
-
children?: any[] | undefined;
|
5
|
-
}, { checkNode, createComponents, isNew, removeComponents, parentPath }?: {
|
6
|
-
checkNode: any;
|
7
|
-
createComponents: any;
|
8
|
-
isNew?: boolean | undefined;
|
9
|
-
removeComponents: any;
|
10
|
-
parentPath?: string | undefined;
|
11
|
-
});
|
12
|
-
parent: any;
|
13
|
-
previousData: {};
|
14
|
-
persistentData: any;
|
15
|
-
new: boolean;
|
16
|
-
createComponents: any;
|
17
|
-
checkNode: any;
|
18
|
-
removeComponents: any;
|
19
|
-
revertAvailable: boolean;
|
20
|
-
editing: boolean;
|
21
|
-
collapsed: boolean;
|
22
|
-
components: any[];
|
23
|
-
children: Node[];
|
24
|
-
parentPath: string;
|
25
|
-
get value(): any;
|
26
|
-
get isRoot(): boolean;
|
27
|
-
get changing(): boolean;
|
28
|
-
get hasChangingChildren(): any;
|
29
|
-
get hasData(): boolean;
|
30
|
-
get hasChildren(): boolean;
|
31
|
-
getChildrenPath(index: any): string;
|
32
|
-
eachChild(iteratee: any): Node;
|
33
|
-
getComponents(): any;
|
34
|
-
validateNode(): boolean;
|
35
|
-
addChild(): Node | null;
|
36
|
-
removeChild(childToRemove: any): Node;
|
37
|
-
edit(): Node;
|
38
|
-
save(): boolean;
|
39
|
-
cancel(): Node;
|
40
|
-
remove(): Node;
|
41
|
-
revert(): Node;
|
42
|
-
data: any;
|
43
|
-
commitData(): Node;
|
44
|
-
resetData(): Node;
|
45
|
-
updateComponentsContext(): Node;
|
46
|
-
instantiateComponents(): void;
|
47
|
-
clearComponents(): void;
|
48
|
-
/**
|
49
|
-
* Return a path of component's value.
|
50
|
-
*
|
51
|
-
* @param {Object} component - The component instance.
|
52
|
-
* @return {string} - The component's value path.
|
53
|
-
*/
|
54
|
-
calculateComponentPath(component: Object): string;
|
55
|
-
}
|