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

Sign up to get free protection for your applications and to get access to all the features.
Files changed (56) 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 +11 -11
  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 +11 -11
  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 +2 -2
  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/cjs/utils/Evaluator.d.ts +1 -3
  35. package/lib/cjs/utils/Evaluator.js +1 -5
  36. package/lib/mjs/Webform.d.ts +11 -1
  37. package/lib/mjs/Webform.js +3 -1
  38. package/lib/mjs/components/_classes/component/Component.d.ts +4 -4
  39. package/lib/mjs/components/_classes/component/Component.js +5 -7
  40. package/lib/mjs/components/_classes/nested/NestedComponent.d.ts +5 -6
  41. package/lib/mjs/components/_classes/nested/NestedComponent.js +5 -5
  42. package/lib/mjs/components/_classes/nestedarray/NestedArrayComponent.d.ts +1 -1
  43. package/lib/mjs/components/_classes/nestedarray/NestedArrayComponent.js +1 -1
  44. package/lib/mjs/components/_classes/nesteddata/NestedDataComponent.d.ts +1 -1
  45. package/lib/mjs/components/_classes/nesteddata/NestedDataComponent.js +1 -1
  46. package/lib/mjs/components/day/Day.d.ts +1 -0
  47. package/lib/mjs/components/html/HTML.js +2 -2
  48. package/lib/mjs/components/select/Select.d.ts +4 -1
  49. package/lib/mjs/components/select/Select.js +56 -33
  50. package/lib/mjs/components/select/fixtures/comp22.d.ts +51 -0
  51. package/lib/mjs/components/select/fixtures/comp22.js +41 -0
  52. package/lib/mjs/components/select/fixtures/index.d.ts +2 -1
  53. package/lib/mjs/components/select/fixtures/index.js +2 -1
  54. package/lib/mjs/utils/Evaluator.d.ts +1 -3
  55. package/lib/mjs/utils/Evaluator.js +1 -5
  56. package/package.json +2 -2
@@ -10,7 +10,7 @@
10
10
  * MIT licensed
11
11
  */
12
12
 
13
- /*! formiojs v5.0.0-rc.46 | https://unpkg.com/formiojs@5.0.0-rc.46/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
 
@@ -3327,7 +3327,7 @@ eval("\nvar __importDefault = (this && this.__importDefault) || function (mod) {
3327
3327
  /***/ (function(__unused_webpack_module, exports, __webpack_require__) {
3328
3328
 
3329
3329
  "use strict";
3330
- eval("\nvar __importDefault = (this && this.__importDefault) || function (mod) {\n return (mod && mod.__esModule) ? mod : { \"default\": mod };\n};\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\nexports.Evaluator = void 0;\nconst lodash_1 = __importDefault(__webpack_require__(/*! lodash */ \"./node_modules/lodash/lodash.js\"));\nconst string_hash_1 = __importDefault(__webpack_require__(/*! string-hash */ \"./node_modules/string-hash/index.js\"));\nconst utils_1 = __webpack_require__(/*! @formio/core/utils */ \"./node_modules/@formio/core/lib/utils/index.js\");\nclass Evaluator extends utils_1.Evaluator {\n static template(template, hash) {\n hash = hash || (0, string_hash_1.default)(template);\n if (Evaluator.cache[hash]) {\n return Evaluator.cache[hash];\n }\n try {\n // Ensure we handle copied templates from the ejs files.\n template = template.replace(/ctx\\./g, '');\n return (Evaluator.cache[hash] = lodash_1.default.template(template, Evaluator.templateSettings));\n }\n catch (err) {\n console.warn('Error while processing template', err, template);\n }\n }\n static interpolate(rawTemplate, data, _options) {\n // Ensure reverse compatability.\n const options = lodash_1.default.isObject(_options) ? _options : { noeval: _options };\n if (typeof rawTemplate === 'function') {\n try {\n return rawTemplate(data);\n }\n catch (err) {\n console.warn('Error interpolating template', err, data);\n return err.message;\n }\n }\n rawTemplate = String(rawTemplate);\n let template;\n if (Evaluator.noeval || options.noeval) {\n return utils_1.Evaluator.interpolateString(rawTemplate, data, _options);\n }\n else {\n template = Evaluator.template(rawTemplate);\n }\n if (typeof template === 'function') {\n try {\n return template(data);\n }\n catch (err) {\n console.warn('Error interpolating template', err, rawTemplate, data);\n return err.message;\n }\n }\n return template;\n }\n static evaluate(func, args) {\n return Array.isArray(args) ? func(...args) : func(args);\n }\n}\nexports.Evaluator = Evaluator;\nEvaluator.cache = {};\nEvaluator.protectedEval = false;\nEvaluator.registerEvaluator = (evaluator) => {\n Object.keys(evaluator).forEach((key) => {\n Evaluator[key] = evaluator[key];\n });\n};\n\n\n//# sourceURL=webpack://Formio/./lib/cjs/utils/Evaluator.js?");
3330
+ eval("\nvar __importDefault = (this && this.__importDefault) || function (mod) {\n return (mod && mod.__esModule) ? mod : { \"default\": mod };\n};\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\nexports.Evaluator = void 0;\nconst lodash_1 = __importDefault(__webpack_require__(/*! lodash */ \"./node_modules/lodash/lodash.js\"));\nconst string_hash_1 = __importDefault(__webpack_require__(/*! string-hash */ \"./node_modules/string-hash/index.js\"));\nconst utils_1 = __webpack_require__(/*! @formio/core/utils */ \"./node_modules/@formio/core/lib/utils/index.js\");\nclass Evaluator extends utils_1.Evaluator {\n static template(template, hash) {\n hash = hash || (0, string_hash_1.default)(template);\n if (Evaluator.cache[hash]) {\n return Evaluator.cache[hash];\n }\n try {\n // Ensure we handle copied templates from the ejs files.\n template = template.replace(/ctx\\./g, '');\n return (Evaluator.cache[hash] = lodash_1.default.template(template, Evaluator.templateSettings));\n }\n catch (err) {\n console.warn('Error while processing template', err, template);\n }\n }\n static interpolate(rawTemplate, data, _options) {\n // Ensure reverse compatability.\n const options = lodash_1.default.isObject(_options) ? _options : { noeval: _options };\n if (typeof rawTemplate === 'function') {\n try {\n return rawTemplate(data);\n }\n catch (err) {\n console.warn('Error interpolating template', err, data);\n return err.message;\n }\n }\n rawTemplate = String(rawTemplate);\n let template;\n if (Evaluator.noeval || options.noeval) {\n return utils_1.Evaluator.interpolateString(rawTemplate, data, _options);\n }\n else {\n template = Evaluator.template(rawTemplate);\n }\n if (typeof template === 'function') {\n try {\n return template(data);\n }\n catch (err) {\n console.warn('Error interpolating template', err, rawTemplate, data);\n return err.message;\n }\n }\n return template;\n }\n static evaluate(func, args) {\n return Array.isArray(args) ? func(...args) : func(args);\n }\n}\nexports.Evaluator = Evaluator;\nEvaluator.cache = {};\nEvaluator.protectedEval = false;\nEvaluator.noeval = false;\n\n\n//# sourceURL=webpack://Formio/./lib/cjs/utils/Evaluator.js?");
3331
3331
 
3332
3332
  /***/ }),
3333
3333