@formio/js 5.0.0-dev.5915.7385833 → 5.0.0-dev.5917.280d8f5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -4940,7 +4940,7 @@ eval("\nvar __importDefault = (this && this.__importDefault) || function (mod) {
4940
4940
  /***/ (function(__unused_webpack_module, exports, __webpack_require__) {
4941
4941
 
4942
4942
  "use strict";
4943
- eval("\nvar __importDefault = (this && this.__importDefault) || function (mod) {\n return (mod && mod.__esModule) ? mod : { \"default\": mod };\n};\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\nconst utils_1 = __importDefault(__webpack_require__(/*! ./utils */ \"./lib/cjs/components/_classes/component/editForm/utils.js\"));\nconst Evaluator_1 = __webpack_require__(/*! ../../../../utils/Evaluator */ \"./lib/cjs/utils/Evaluator.js\");\n/* eslint-disable quotes, max-len */\nexports[\"default\"] = [\n {\n weight: 10,\n type: 'checkbox',\n label: 'Required',\n tooltip: 'A required field must be filled in before the form can be submitted.',\n key: 'validate.required',\n input: true\n },\n {\n weight: 100,\n type: 'checkbox',\n label: 'Unique',\n tooltip: 'Makes sure the data submitted for this field is unique, and has not been submitted before.',\n key: 'unique',\n input: true\n },\n {\n weight: 100,\n type: 'checkbox',\n label: 'Validate When Hidden',\n tooltip: 'Validates the component when it is hidden/conditionally hidden. Vaildation errors are displayed in the error alert on the form submission.',\n key: 'validateWhenHidden',\n input: true\n },\n {\n weight: 0,\n type: 'select',\n key: 'validateOn',\n defaultValue: 'change',\n input: true,\n label: 'Validate On',\n tooltip: 'Determines when this component should trigger front-end validation.',\n dataSrc: 'values',\n data: {\n values: [\n { label: 'Change', value: 'change' },\n { label: 'Blur', value: 'blur' }\n ]\n }\n },\n {\n weight: 190,\n type: 'textfield',\n input: true,\n key: 'errorLabel',\n label: 'Error Label',\n placeholder: 'Error Label',\n tooltip: 'The label for this field when an error occurs.'\n },\n {\n weight: 200,\n key: 'validate.customMessage',\n label: 'Custom Error Message',\n placeholder: 'Custom Error Message',\n type: 'textfield',\n tooltip: 'Error message displayed if any error occurred.',\n input: true\n },\n {\n type: 'panel',\n title: 'Custom Validation',\n collapsible: true,\n collapsed: true,\n style: { 'margin-bottom': '10px' },\n key: 'custom-validation-js',\n weight: 300,\n customConditional() {\n return !Evaluator_1.Evaluator.noeval || Evaluator_1.Evaluator.protectedEval;\n },\n components: [\n utils_1.default.logicVariablesTable('<tr><th>input</th><td>The value that was input into this component</td></tr>'),\n {\n type: 'textarea',\n key: 'validate.custom',\n rows: 5,\n editor: 'ace',\n hideLabel: true,\n as: 'javascript',\n input: true\n },\n {\n type: 'htmlelement',\n tag: 'div',\n content: `\n <small>\n <p>Enter custom validation code.</p>\n <p>You must assign the <strong>valid</strong> variable as either <strong>true</strong> or an error message if validation fails.</p>\n <h5>Example:</h5>\n <pre>valid = (input === 'Joe') ? true : 'Your name must be \"Joe\"';</pre>\n </small>`\n },\n {\n type: 'well',\n components: [\n {\n weight: 100,\n type: 'checkbox',\n label: 'Secret Validation',\n tooltip: 'Check this if you wish to perform the validation ONLY on the server side. This keeps your validation logic private and secret.',\n description: 'Check this if you wish to perform the validation ONLY on the server side. This keeps your validation logic private and secret.',\n key: 'validate.customPrivate',\n input: true\n }\n ]\n }\n ]\n },\n {\n type: 'panel',\n title: 'JSONLogic Validation',\n collapsible: true,\n collapsed: true,\n key: 'json-validation-json',\n weight: 400,\n components: [\n {\n type: 'htmlelement',\n tag: 'div',\n /* eslint-disable prefer-template */\n content: '<p>Execute custom logic using <a href=\"http://jsonlogic.com/\" target=\"_blank\" rel=\"noopener noreferrer\">JSONLogic</a>.</p>' +\n '<h5>Example:</h5>' +\n '<pre>' + JSON.stringify({\n \"if\": [\n { \"===\": [{ \"var\": \"input\" }, \"Bob\"] },\n true,\n \"Your name must be 'Bob'!\"\n ]\n }, null, 2) + '</pre>'\n /* eslint-enable prefer-template */\n },\n {\n type: 'textarea',\n key: 'validate.json',\n hideLabel: true,\n rows: 5,\n editor: 'ace',\n as: 'json',\n input: true\n }\n ]\n },\n {\n type: 'panel',\n title: 'Custom Errors',\n collapsible: true,\n collapsed: true,\n key: 'errors',\n weight: 400,\n components: [\n {\n type: 'textarea',\n key: 'errors',\n hideLabel: true,\n rows: 5,\n editor: 'ace',\n as: 'json',\n input: true\n },\n {\n type: 'htmlelement',\n tag: 'div',\n content: `\n <p>This allows you to set different custom error messages for different errors\n (in contrast to “Custom Error Message”, which only allows you to set one\n error message for all errors). E.g.</p>\n\n<pre>{\n \"required\": \"{<span/>{ field }} is required. Try again.\",\n \"maxLength\": \"{<span/>{ field }} is too long. Try again.\"\n}</pre>\n\n <p>You can set the following keys (among others):</p>\n <ul>\n <li>r<span/>equired</li>\n <li>m<span/>in</li>\n <li>m<span/>ax</li>\n <li>m<span/>inLength</li>\n <li>m<span/>axLength</li>\n <li>m<span/>inWords</li>\n <li>m<span/>axWords</li>\n <li>i<span/>nvalid_email</li>\n <li>i<span/>nvalid_date</li>\n <li>i<span/>nvalid_day</li>\n <li>i<span/>nvalid_regex</li>\n <li>m<span/>ask</li>\n <li>p<span/>attern</li>\n <li>c<span/>ustom</li>\n </ul>\n\n <p>Depending on the error message some of the following template variables can be used in the script:</p>\n <ul>\n <li><code>{<span/>{ f<span/>ield }}</code> is replaced with the label of the field.</li>\n <li><code>{<span/>{ m<span/>in }}</code></li>\n <li><code>{<span/>{ m<span/>ax }}</code></li>\n <li><code>{<span/>{ l<span/>ength }}</code></li>\n <li><code>{<span/>{ p<span/>attern }}</code></li>\n <li><code>{<span/>{ m<span/>inDate }}</code></li>\n <li><code>{<span/>{ m<span/>axDate }}</code></li>\n <li><code>{<span/>{ m<span/>inYear }}</code></li>\n <li><code>{<span/>{ m<span/>axYear }}</code></li>\n <li><code>{<span/>{ r<span/>egex }}</code></li>\n </ul>\n `\n }\n ]\n }\n];\n/* eslint-enable quotes, max-len */\n\n\n//# sourceURL=webpack://Formio/./lib/cjs/components/_classes/component/editForm/Component.edit.validation.js?");
4943
+ eval("\nvar __importDefault = (this && this.__importDefault) || function (mod) {\n return (mod && mod.__esModule) ? mod : { \"default\": mod };\n};\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\nconst utils_1 = __importDefault(__webpack_require__(/*! ./utils */ \"./lib/cjs/components/_classes/component/editForm/utils.js\"));\nconst Evaluator_1 = __webpack_require__(/*! ../../../../utils/Evaluator */ \"./lib/cjs/utils/Evaluator.js\");\n/* eslint-disable quotes, max-len */\nexports[\"default\"] = [\n {\n weight: 10,\n type: 'checkbox',\n label: 'Required',\n tooltip: 'A required field must be filled in before the form can be submitted.',\n key: 'validate.required',\n input: true\n },\n {\n weight: 100,\n type: 'checkbox',\n label: 'Unique',\n tooltip: 'Makes sure the data submitted for this field is unique, and has not been submitted before.',\n key: 'unique',\n input: true\n },\n {\n weight: 100,\n type: 'checkbox',\n label: 'Validate When Hidden',\n tooltip: 'Validates the component when it is hidden/conditionally hidden. Vaildation errors are displayed in the error alert on the form submission. Use caution when enabling this setting, as it can cause a hidden component to be invalid with no way for the form user to correct it.',\n key: 'validateWhenHidden',\n input: true\n },\n {\n weight: 0,\n type: 'select',\n key: 'validateOn',\n defaultValue: 'change',\n input: true,\n label: 'Validate On',\n tooltip: 'Determines when this component should trigger front-end validation.',\n dataSrc: 'values',\n data: {\n values: [\n { label: 'Change', value: 'change' },\n { label: 'Blur', value: 'blur' }\n ]\n }\n },\n {\n weight: 190,\n type: 'textfield',\n input: true,\n key: 'errorLabel',\n label: 'Error Label',\n placeholder: 'Error Label',\n tooltip: 'The label for this field when an error occurs.'\n },\n {\n weight: 200,\n key: 'validate.customMessage',\n label: 'Custom Error Message',\n placeholder: 'Custom Error Message',\n type: 'textfield',\n tooltip: 'Error message displayed if any error occurred.',\n input: true\n },\n {\n type: 'panel',\n title: 'Custom Validation',\n collapsible: true,\n collapsed: true,\n style: { 'margin-bottom': '10px' },\n key: 'custom-validation-js',\n weight: 300,\n customConditional() {\n return !Evaluator_1.Evaluator.noeval || Evaluator_1.Evaluator.protectedEval;\n },\n components: [\n utils_1.default.logicVariablesTable('<tr><th>input</th><td>The value that was input into this component</td></tr>'),\n {\n type: 'textarea',\n key: 'validate.custom',\n rows: 5,\n editor: 'ace',\n hideLabel: true,\n as: 'javascript',\n input: true\n },\n {\n type: 'htmlelement',\n tag: 'div',\n content: `\n <small>\n <p>Enter custom validation code.</p>\n <p>You must assign the <strong>valid</strong> variable as either <strong>true</strong> or an error message if validation fails.</p>\n <h5>Example:</h5>\n <pre>valid = (input === 'Joe') ? true : 'Your name must be \"Joe\"';</pre>\n </small>`\n },\n {\n type: 'well',\n components: [\n {\n weight: 100,\n type: 'checkbox',\n label: 'Secret Validation',\n tooltip: 'Check this if you wish to perform the validation ONLY on the server side. This keeps your validation logic private and secret.',\n description: 'Check this if you wish to perform the validation ONLY on the server side. This keeps your validation logic private and secret.',\n key: 'validate.customPrivate',\n input: true\n }\n ]\n }\n ]\n },\n {\n type: 'panel',\n title: 'JSONLogic Validation',\n collapsible: true,\n collapsed: true,\n key: 'json-validation-json',\n weight: 400,\n components: [\n {\n type: 'htmlelement',\n tag: 'div',\n /* eslint-disable prefer-template */\n content: '<p>Execute custom logic using <a href=\"http://jsonlogic.com/\" target=\"_blank\" rel=\"noopener noreferrer\">JSONLogic</a>.</p>' +\n '<h5>Example:</h5>' +\n '<pre>' + JSON.stringify({\n \"if\": [\n { \"===\": [{ \"var\": \"input\" }, \"Bob\"] },\n true,\n \"Your name must be 'Bob'!\"\n ]\n }, null, 2) + '</pre>'\n /* eslint-enable prefer-template */\n },\n {\n type: 'textarea',\n key: 'validate.json',\n hideLabel: true,\n rows: 5,\n editor: 'ace',\n as: 'json',\n input: true\n }\n ]\n },\n {\n type: 'panel',\n title: 'Custom Errors',\n collapsible: true,\n collapsed: true,\n key: 'errors',\n weight: 400,\n components: [\n {\n type: 'textarea',\n key: 'errors',\n hideLabel: true,\n rows: 5,\n editor: 'ace',\n as: 'json',\n input: true\n },\n {\n type: 'htmlelement',\n tag: 'div',\n content: `\n <p>This allows you to set different custom error messages for different errors\n (in contrast to “Custom Error Message”, which only allows you to set one\n error message for all errors). E.g.</p>\n\n<pre>{\n \"required\": \"{<span/>{ field }} is required. Try again.\",\n \"maxLength\": \"{<span/>{ field }} is too long. Try again.\"\n}</pre>\n\n <p>You can set the following keys (among others):</p>\n <ul>\n <li>r<span/>equired</li>\n <li>m<span/>in</li>\n <li>m<span/>ax</li>\n <li>m<span/>inLength</li>\n <li>m<span/>axLength</li>\n <li>m<span/>inWords</li>\n <li>m<span/>axWords</li>\n <li>i<span/>nvalid_email</li>\n <li>i<span/>nvalid_date</li>\n <li>i<span/>nvalid_day</li>\n <li>i<span/>nvalid_regex</li>\n <li>m<span/>ask</li>\n <li>p<span/>attern</li>\n <li>c<span/>ustom</li>\n </ul>\n\n <p>Depending on the error message some of the following template variables can be used in the script:</p>\n <ul>\n <li><code>{<span/>{ f<span/>ield }}</code> is replaced with the label of the field.</li>\n <li><code>{<span/>{ m<span/>in }}</code></li>\n <li><code>{<span/>{ m<span/>ax }}</code></li>\n <li><code>{<span/>{ l<span/>ength }}</code></li>\n <li><code>{<span/>{ p<span/>attern }}</code></li>\n <li><code>{<span/>{ m<span/>inDate }}</code></li>\n <li><code>{<span/>{ m<span/>axDate }}</code></li>\n <li><code>{<span/>{ m<span/>inYear }}</code></li>\n <li><code>{<span/>{ m<span/>axYear }}</code></li>\n <li><code>{<span/>{ r<span/>egex }}</code></li>\n </ul>\n `\n }\n ]\n }\n];\n/* eslint-enable quotes, max-len */\n\n\n//# sourceURL=webpack://Formio/./lib/cjs/components/_classes/component/editForm/Component.edit.validation.js?");
4944
4944
 
4945
4945
  /***/ }),
4946
4946