@formio/js 5.0.0-rc.47 → 5.0.0-rc.48

Sign up to get free protection for your applications and to get access to all the features.
Files changed (52) hide show
  1. package/dist/formio.embed.js +1 -1
  2. package/dist/formio.embed.min.js +1 -1
  3. package/dist/formio.embed.min.js.LICENSE.txt +1 -1
  4. package/dist/formio.form.js +10 -10
  5. package/dist/formio.form.min.js +1 -1
  6. package/dist/formio.form.min.js.LICENSE.txt +1 -1
  7. package/dist/formio.full.js +10 -10
  8. package/dist/formio.full.min.js +1 -1
  9. package/dist/formio.full.min.js.LICENSE.txt +1 -1
  10. package/dist/formio.js +2 -2
  11. package/dist/formio.min.js +1 -1
  12. package/dist/formio.min.js.LICENSE.txt +1 -1
  13. package/dist/formio.utils.js +1 -1
  14. package/dist/formio.utils.min.js +1 -1
  15. package/dist/formio.utils.min.js.LICENSE.txt +1 -1
  16. package/lib/cjs/Webform.d.ts +11 -1
  17. package/lib/cjs/Webform.js +3 -1
  18. package/lib/cjs/components/_classes/component/Component.d.ts +4 -4
  19. package/lib/cjs/components/_classes/component/Component.js +5 -7
  20. package/lib/cjs/components/_classes/nested/NestedComponent.d.ts +5 -6
  21. package/lib/cjs/components/_classes/nested/NestedComponent.js +5 -5
  22. package/lib/cjs/components/_classes/nestedarray/NestedArrayComponent.d.ts +1 -1
  23. package/lib/cjs/components/_classes/nestedarray/NestedArrayComponent.js +1 -1
  24. package/lib/cjs/components/_classes/nesteddata/NestedDataComponent.d.ts +1 -1
  25. package/lib/cjs/components/_classes/nesteddata/NestedDataComponent.js +1 -1
  26. package/lib/cjs/components/day/Day.d.ts +1 -0
  27. package/lib/cjs/components/html/HTML.js +2 -2
  28. package/lib/cjs/components/select/Select.d.ts +4 -1
  29. package/lib/cjs/components/select/Select.js +57 -34
  30. package/lib/cjs/components/select/fixtures/comp22.d.ts +51 -0
  31. package/lib/cjs/components/select/fixtures/comp22.js +43 -0
  32. package/lib/cjs/components/select/fixtures/index.d.ts +2 -1
  33. package/lib/cjs/components/select/fixtures/index.js +3 -1
  34. package/lib/mjs/Webform.d.ts +11 -1
  35. package/lib/mjs/Webform.js +3 -1
  36. package/lib/mjs/components/_classes/component/Component.d.ts +4 -4
  37. package/lib/mjs/components/_classes/component/Component.js +5 -7
  38. package/lib/mjs/components/_classes/nested/NestedComponent.d.ts +5 -6
  39. package/lib/mjs/components/_classes/nested/NestedComponent.js +5 -5
  40. package/lib/mjs/components/_classes/nestedarray/NestedArrayComponent.d.ts +1 -1
  41. package/lib/mjs/components/_classes/nestedarray/NestedArrayComponent.js +1 -1
  42. package/lib/mjs/components/_classes/nesteddata/NestedDataComponent.d.ts +1 -1
  43. package/lib/mjs/components/_classes/nesteddata/NestedDataComponent.js +1 -1
  44. package/lib/mjs/components/day/Day.d.ts +1 -0
  45. package/lib/mjs/components/html/HTML.js +2 -2
  46. package/lib/mjs/components/select/Select.d.ts +4 -1
  47. package/lib/mjs/components/select/Select.js +56 -33
  48. package/lib/mjs/components/select/fixtures/comp22.d.ts +51 -0
  49. package/lib/mjs/components/select/fixtures/comp22.js +41 -0
  50. package/lib/mjs/components/select/fixtures/index.d.ts +2 -1
  51. package/lib/mjs/components/select/fixtures/index.js +2 -1
  52. package/package.json +2 -2
@@ -10,7 +10,7 @@
10
10
  * MIT licensed
11
11
  */
12
12
 
13
- /*! formiojs v5.0.0-rc.47 | https://unpkg.com/formiojs@5.0.0-rc.47/LICENSE.txt */
13
+ /*! formiojs v5.0.0-rc.48 | https://unpkg.com/formiojs@5.0.0-rc.48/LICENSE.txt */
14
14
 
15
15
  /**
16
16
  * @license
@@ -598,7 +598,7 @@ eval("\nvar __awaiter = (this && this.__awaiter) || function (thisArg, _argument
598
598
  /***/ (function(__unused_webpack_module, exports, __webpack_require__) {
599
599
 
600
600
  "use strict";
601
- eval("\nvar __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {\n function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }\n return new (P || (P = Promise))(function (resolve, reject) {\n function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\n function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\n function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }\n step((generator = generator.apply(thisArg, _arguments || [])).next());\n });\n};\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\nexports.validateRequiredInfo = exports.validateRequiredSync = exports.validateRequired = exports.shouldValidate = void 0;\nconst error_1 = __webpack_require__(/*! ../../../error */ \"./node_modules/@formio/core/lib/error/index.js\");\nconst util_1 = __webpack_require__(/*! ../util */ \"./node_modules/@formio/core/lib/process/validation/util.js\");\nconst isAddressComponentDataObject = (value) => {\n return value !== null && typeof value === 'object' && value.mode && value.address && typeof value.address === 'object';\n};\nconst shouldValidate = (context) => {\n var _a;\n const { component } = context;\n if ((_a = component.validate) === null || _a === void 0 ? void 0 : _a.required) {\n return true;\n }\n return false;\n};\nexports.shouldValidate = shouldValidate;\nconst validateRequired = (context) => __awaiter(void 0, void 0, void 0, function* () {\n return (0, exports.validateRequiredSync)(context);\n});\nexports.validateRequired = validateRequired;\nconst validateRequiredSync = (context) => {\n const error = new error_1.FieldError('required', Object.assign(Object.assign({}, context), { setting: true }));\n const { component, value } = context;\n if (!(0, exports.shouldValidate)(context)) {\n return null;\n }\n if ((value === null || value === undefined || (0, util_1.isEmptyObject)(value) || (!!value === false && value !== 0)) &&\n !component.hidden) {\n return error;\n }\n else if (Array.isArray(value) && value.length === 0) {\n return error;\n }\n else if (component.type === 'address' && isAddressComponentDataObject(value)) {\n return (0, util_1.isEmptyObject)(value.address) ? error : Object.values(value.address).every((val) => !!val) ? null : error;\n }\n else if (component.type === 'day' && value === '00/00/0000') {\n return error;\n }\n else if (typeof value === 'object' && value !== null) {\n return Object.values(value).some((val) => !!val) ? null : error;\n }\n return null;\n};\nexports.validateRequiredSync = validateRequiredSync;\nexports.validateRequiredInfo = {\n name: 'validateRequired',\n process: exports.validateRequired,\n processSync: exports.validateRequiredSync,\n shouldProcess: exports.shouldValidate,\n};\n\n\n//# sourceURL=webpack://Formio/./node_modules/@formio/core/lib/process/validation/rules/validateRequired.js?");
601
+ eval("\nvar __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {\n function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }\n return new (P || (P = Promise))(function (resolve, reject) {\n function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\n function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\n function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }\n step((generator = generator.apply(thisArg, _arguments || [])).next());\n });\n};\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\nexports.validateRequiredInfo = exports.validateRequiredSync = exports.validateRequired = exports.shouldValidate = void 0;\nconst error_1 = __webpack_require__(/*! ../../../error */ \"./node_modules/@formio/core/lib/error/index.js\");\nconst util_1 = __webpack_require__(/*! ../util */ \"./node_modules/@formio/core/lib/process/validation/util.js\");\nconst isAddressComponent = (component) => {\n return component.type === 'address';\n};\nconst isDayComponent = (component) => {\n return component.type === 'day';\n};\nconst isAddressComponentDataObject = (value) => {\n return value !== null && typeof value === 'object' && value.mode && value.address && typeof value.address === 'object';\n};\n// Checkboxes and selectboxes consider false to be falsy, whereas other components with\n// settable values (e.g. radio, select, datamap, container, etc.) consider it truthy\nconst isComponentThatCannotHaveFalseValue = (component) => {\n return component.type === 'checkbox' || component.type === 'selectboxes';\n};\nconst valueIsPresent = (value, considerFalseTruthy) => {\n // Evaluate for 3 out of 6 falsy values (\"\", null, undefined), don't check for 0\n // and only check for false under certain conditions\n if (value === null || value === undefined || value === \"\" || (!considerFalseTruthy && value === false)) {\n return false;\n }\n // Evaluate for empty object\n else if ((0, util_1.isEmptyObject)(value)) {\n return false;\n }\n // Evaluate for empty array\n else if (Array.isArray(value) && value.length === 0) {\n return false;\n }\n // Recursively evaluate\n else if (typeof value === 'object') {\n return Object.values(value).some((val) => valueIsPresent(val, considerFalseTruthy));\n }\n return true;\n};\nconst shouldValidate = (context) => {\n var _a;\n const { component } = context;\n if (((_a = component.validate) === null || _a === void 0 ? void 0 : _a.required) && !component.hidden) {\n return true;\n }\n return false;\n};\nexports.shouldValidate = shouldValidate;\nconst validateRequired = (context) => __awaiter(void 0, void 0, void 0, function* () {\n return (0, exports.validateRequiredSync)(context);\n});\nexports.validateRequired = validateRequired;\nconst validateRequiredSync = (context) => {\n const error = new error_1.FieldError('required', Object.assign(Object.assign({}, context), { setting: true }));\n const { component, value } = context;\n if (!(0, exports.shouldValidate)(context)) {\n return null;\n }\n if (isAddressComponent(component) && isAddressComponentDataObject(value)) {\n return (0, util_1.isEmptyObject)(value.address) ? error : Object.values(value.address).every((val) => !!val) ? null : error;\n }\n else if (isDayComponent(component) && value === '00/00/0000') {\n return error;\n }\n else if (isComponentThatCannotHaveFalseValue(component)) {\n return !valueIsPresent(value, false) ? error : null;\n }\n return !valueIsPresent(value, true) ? error : null;\n};\nexports.validateRequiredSync = validateRequiredSync;\nexports.validateRequiredInfo = {\n name: 'validateRequired',\n process: exports.validateRequired,\n processSync: exports.validateRequiredSync,\n shouldProcess: exports.shouldValidate,\n};\n\n\n//# sourceURL=webpack://Formio/./node_modules/@formio/core/lib/process/validation/rules/validateRequired.js?");
602
602
 
603
603
  /***/ }),
604
604