@formio/js 5.0.0-rc.10 → 5.0.0-rc.12
Sign up to get free protection for your applications and to get access to all the features.
- package/dist/formio.embed.min.js.LICENSE.txt +1 -1
- package/dist/formio.form.js +24 -24
- package/dist/formio.form.min.js +1 -1
- package/dist/formio.form.min.js.LICENSE.txt +1 -1
- package/dist/formio.full.js +121 -25
- package/dist/formio.full.min.js +1 -1
- package/dist/formio.full.min.js.LICENSE.txt +1 -1
- package/dist/formio.js +1 -1
- package/dist/formio.min.js +1 -1
- package/dist/formio.min.js.LICENSE.txt +1 -1
- package/dist/formio.utils.min.js.LICENSE.txt +1 -1
- package/lib/cjs/WebformBuilder.js +4 -8
- package/lib/cjs/validator/rules/Custom.js +0 -1
- package/lib/cjs/validator/rules/Date.js +0 -1
- package/lib/cjs/validator/rules/Day.js +0 -1
- package/lib/cjs/validator/rules/Email.js +0 -1
- package/lib/cjs/validator/rules/JSON.js +0 -1
- package/lib/cjs/validator/rules/Mask.js +0 -1
- package/lib/cjs/validator/rules/Max.js +0 -1
- package/lib/cjs/validator/rules/MaxDate.js +0 -1
- package/lib/cjs/validator/rules/MaxLength.js +0 -1
- package/lib/cjs/validator/rules/MaxWords.js +0 -1
- package/lib/cjs/validator/rules/MaxYear.js +0 -1
- package/lib/cjs/validator/rules/Min.js +0 -1
- package/lib/cjs/validator/rules/MinDate.js +0 -1
- package/lib/cjs/validator/rules/MinLength.js +0 -1
- package/lib/cjs/validator/rules/MinWords.js +0 -1
- package/lib/cjs/validator/rules/MinYear.js +0 -1
- package/lib/cjs/validator/rules/Pattern.js +0 -1
- package/lib/cjs/validator/rules/Required.js +0 -1
- package/lib/cjs/validator/rules/Rule.js +0 -1
- package/lib/cjs/validator/rules/Select.js +0 -1
- package/lib/cjs/validator/rules/Time.js +0 -1
- package/lib/cjs/validator/rules/Unique.js +0 -1
- package/lib/cjs/validator/rules/Url.js +0 -1
- package/lib/mjs/WebformBuilder.js +2 -6
- package/lib/mjs/validator/rules/Custom.js +0 -1
- package/lib/mjs/validator/rules/Date.js +0 -1
- package/lib/mjs/validator/rules/Day.js +0 -1
- package/lib/mjs/validator/rules/Email.js +0 -1
- package/lib/mjs/validator/rules/JSON.js +0 -1
- package/lib/mjs/validator/rules/Mask.js +0 -1
- package/lib/mjs/validator/rules/Max.js +0 -1
- package/lib/mjs/validator/rules/MaxDate.js +0 -1
- package/lib/mjs/validator/rules/MaxLength.js +0 -1
- package/lib/mjs/validator/rules/MaxWords.js +0 -1
- package/lib/mjs/validator/rules/MaxYear.js +0 -1
- package/lib/mjs/validator/rules/Min.js +0 -1
- package/lib/mjs/validator/rules/MinDate.js +0 -1
- package/lib/mjs/validator/rules/MinLength.js +0 -1
- package/lib/mjs/validator/rules/MinWords.js +0 -1
- package/lib/mjs/validator/rules/MinYear.js +0 -1
- package/lib/mjs/validator/rules/Pattern.js +0 -1
- package/lib/mjs/validator/rules/Required.js +0 -1
- package/lib/mjs/validator/rules/Rule.js +0 -1
- package/lib/mjs/validator/rules/Select.js +0 -1
- package/lib/mjs/validator/rules/Time.js +0 -1
- package/lib/mjs/validator/rules/Unique.js +0 -1
- package/lib/mjs/validator/rules/Url.js +0 -1
- package/package.json +1 -1
@@ -1 +1 @@
|
|
1
|
-
/*! formiojs v5.0.0-rc.
|
1
|
+
/*! formiojs v5.0.0-rc.12 | https://unpkg.com/formiojs@5.0.0-rc.12/LICENSE.txt */
|
package/dist/formio.form.js
CHANGED
@@ -6100,7 +6100,7 @@ eval("\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\nclas
|
|
6100
6100
|
/***/ (function(__unused_webpack_module, exports, __webpack_require__) {
|
6101
6101
|
|
6102
6102
|
"use strict";
|
6103
|
-
eval("\nvar __importDefault = (this && this.__importDefault) || function (mod) {\n return (mod && mod.__esModule) ? mod : { \"default\": mod };\n};\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\nconst Rule_1 = __importDefault(__webpack_require__(/*! ./Rule */ \"./lib/cjs/validator/rules/Rule.js\"));\nclass Custom extends Rule_1.default {\n constructor() {\n super(...arguments);\n this.defaultMessage = '{{error}}';\n }\n check(value, data, row, index) {\n const custom = this.settings.custom;\n if (!custom) {\n return true;\n }\n const valid = this.component.evaluate(custom, {\n valid: true,\n data,\n row,\n rowIndex: index,\n input: value,\n }, 'valid', true);\n if (valid === null) {\n return true;\n }\n return valid;\n }\n}\nexports[\"default\"] = Custom;\n
|
6103
|
+
eval("\nvar __importDefault = (this && this.__importDefault) || function (mod) {\n return (mod && mod.__esModule) ? mod : { \"default\": mod };\n};\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\nconst Rule_1 = __importDefault(__webpack_require__(/*! ./Rule */ \"./lib/cjs/validator/rules/Rule.js\"));\nclass Custom extends Rule_1.default {\n constructor() {\n super(...arguments);\n this.defaultMessage = '{{error}}';\n }\n check(value, data, row, index) {\n const custom = this.settings.custom;\n if (!custom) {\n return true;\n }\n const valid = this.component.evaluate(custom, {\n valid: true,\n data,\n row,\n rowIndex: index,\n input: value,\n }, 'valid', true);\n if (valid === null) {\n return true;\n }\n return valid;\n }\n}\nexports[\"default\"] = Custom;\n\n\n//# sourceURL=webpack://Formio/./lib/cjs/validator/rules/Custom.js?");
|
6104
6104
|
|
6105
6105
|
/***/ }),
|
6106
6106
|
|
@@ -6111,7 +6111,7 @@ eval("\nvar __importDefault = (this && this.__importDefault) || function (mod) {
|
|
6111
6111
|
/***/ (function(__unused_webpack_module, exports, __webpack_require__) {
|
6112
6112
|
|
6113
6113
|
"use strict";
|
6114
|
-
eval("\nvar __importDefault = (this && this.__importDefault) || function (mod) {\n return (mod && mod.__esModule) ? mod : { \"default\": mod };\n};\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\nconst Rule_1 = __importDefault(__webpack_require__(/*! ./Rule */ \"./lib/cjs/validator/rules/Rule.js\"));\nclass DateRule extends Rule_1.default {\n constructor() {\n super(...arguments);\n this.defaultMessage = '{{field}} is not a valid date.';\n }\n check(value) {\n if (!value) {\n return true;\n }\n if (value === 'Invalid date' || value === 'Invalid Date') {\n return false;\n }\n if (typeof value === 'string') {\n value = new Date(value);\n }\n return value instanceof Date === true && value.toString() !== 'Invalid Date';\n }\n}\nexports[\"default\"] = DateRule;\n
|
6114
|
+
eval("\nvar __importDefault = (this && this.__importDefault) || function (mod) {\n return (mod && mod.__esModule) ? mod : { \"default\": mod };\n};\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\nconst Rule_1 = __importDefault(__webpack_require__(/*! ./Rule */ \"./lib/cjs/validator/rules/Rule.js\"));\nclass DateRule extends Rule_1.default {\n constructor() {\n super(...arguments);\n this.defaultMessage = '{{field}} is not a valid date.';\n }\n check(value) {\n if (!value) {\n return true;\n }\n if (value === 'Invalid date' || value === 'Invalid Date') {\n return false;\n }\n if (typeof value === 'string') {\n value = new Date(value);\n }\n return value instanceof Date === true && value.toString() !== 'Invalid Date';\n }\n}\nexports[\"default\"] = DateRule;\n\n\n//# sourceURL=webpack://Formio/./lib/cjs/validator/rules/Date.js?");
|
6115
6115
|
|
6116
6116
|
/***/ }),
|
6117
6117
|
|
@@ -6122,7 +6122,7 @@ eval("\nvar __importDefault = (this && this.__importDefault) || function (mod) {
|
|
6122
6122
|
/***/ (function(__unused_webpack_module, exports, __webpack_require__) {
|
6123
6123
|
|
6124
6124
|
"use strict";
|
6125
|
-
eval("\nvar __importDefault = (this && this.__importDefault) || function (mod) {\n return (mod && mod.__esModule) ? mod : { \"default\": mod };\n};\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\nconst Rule_1 = __importDefault(__webpack_require__(/*! ./Rule */ \"./lib/cjs/validator/rules/Rule.js\"));\nclass Day extends Rule_1.default {\n constructor() {\n super(...arguments);\n this.defaultMessage = '{{field}} is not a valid day.';\n }\n check(value) {\n if (!value) {\n return true;\n }\n if (typeof value !== 'string') {\n return false;\n }\n const [DAY, MONTH, YEAR] = this.component.dayFirst ? [0, 1, 2] : [1, 0, 2];\n const values = value.split('/').map(x => parseInt(x, 10)), day = values[DAY], month = values[MONTH], year = values[YEAR], maxDay = getDaysInMonthCount(month, year);\n if (isNaN(day) || day < 0 || day > maxDay) {\n return false;\n }\n if (isNaN(month) || month < 0 || month > 12) {\n return false;\n }\n if (isNaN(year) || year < 0 || year > 9999) {\n return false;\n }\n return true;\n function isLeapYear(year) {\n // Year is leap if it is evenly divisible by 400 or evenly divisible by 4 and not evenly divisible by 100.\n return !(year % 400) || (!!(year % 100) && !(year % 4));\n }\n function getDaysInMonthCount(month, year) {\n switch (month) {\n case 1: // January\n case 3: // March\n case 5: // May\n case 7: // July\n case 8: // August\n case 10: // October\n case 12: // December\n return 31;\n case 4: // April\n case 6: // June\n case 9: // September\n case 11: // November\n return 30;\n case 2: // February\n return isLeapYear(year) ? 29 : 28;\n default:\n return 31;\n }\n }\n }\n}\nexports[\"default\"] = Day;\n
|
6125
|
+
eval("\nvar __importDefault = (this && this.__importDefault) || function (mod) {\n return (mod && mod.__esModule) ? mod : { \"default\": mod };\n};\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\nconst Rule_1 = __importDefault(__webpack_require__(/*! ./Rule */ \"./lib/cjs/validator/rules/Rule.js\"));\nclass Day extends Rule_1.default {\n constructor() {\n super(...arguments);\n this.defaultMessage = '{{field}} is not a valid day.';\n }\n check(value) {\n if (!value) {\n return true;\n }\n if (typeof value !== 'string') {\n return false;\n }\n const [DAY, MONTH, YEAR] = this.component.dayFirst ? [0, 1, 2] : [1, 0, 2];\n const values = value.split('/').map(x => parseInt(x, 10)), day = values[DAY], month = values[MONTH], year = values[YEAR], maxDay = getDaysInMonthCount(month, year);\n if (isNaN(day) || day < 0 || day > maxDay) {\n return false;\n }\n if (isNaN(month) || month < 0 || month > 12) {\n return false;\n }\n if (isNaN(year) || year < 0 || year > 9999) {\n return false;\n }\n return true;\n function isLeapYear(year) {\n // Year is leap if it is evenly divisible by 400 or evenly divisible by 4 and not evenly divisible by 100.\n return !(year % 400) || (!!(year % 100) && !(year % 4));\n }\n function getDaysInMonthCount(month, year) {\n switch (month) {\n case 1: // January\n case 3: // March\n case 5: // May\n case 7: // July\n case 8: // August\n case 10: // October\n case 12: // December\n return 31;\n case 4: // April\n case 6: // June\n case 9: // September\n case 11: // November\n return 30;\n case 2: // February\n return isLeapYear(year) ? 29 : 28;\n default:\n return 31;\n }\n }\n }\n}\nexports[\"default\"] = Day;\n\n\n//# sourceURL=webpack://Formio/./lib/cjs/validator/rules/Day.js?");
|
6126
6126
|
|
6127
6127
|
/***/ }),
|
6128
6128
|
|
@@ -6133,7 +6133,7 @@ eval("\nvar __importDefault = (this && this.__importDefault) || function (mod) {
|
|
6133
6133
|
/***/ (function(__unused_webpack_module, exports, __webpack_require__) {
|
6134
6134
|
|
6135
6135
|
"use strict";
|
6136
|
-
eval("\nvar __importDefault = (this && this.__importDefault) || function (mod) {\n return (mod && mod.__esModule) ? mod : { \"default\": mod };\n};\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\nconst Rule_1 = __importDefault(__webpack_require__(/*! ./Rule */ \"./lib/cjs/validator/rules/Rule.js\"));\nclass Email extends Rule_1.default {\n constructor() {\n super(...arguments);\n this.defaultMessage = '{{field}} must be a valid email.';\n }\n check(value) {\n if (!value) {\n return true;\n }\n /* eslint-disable max-len */\n // From http://stackoverflow.com/questions/46155/validate-email-address-in-javascript\n 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,}))$/;\n /* eslint-enable max-len */\n // Allow emails to be valid if the component is pristine and no value is provided.\n return re.test(value);\n }\n}\nexports[\"default\"] = Email;\n
|
6136
|
+
eval("\nvar __importDefault = (this && this.__importDefault) || function (mod) {\n return (mod && mod.__esModule) ? mod : { \"default\": mod };\n};\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\nconst Rule_1 = __importDefault(__webpack_require__(/*! ./Rule */ \"./lib/cjs/validator/rules/Rule.js\"));\nclass Email extends Rule_1.default {\n constructor() {\n super(...arguments);\n this.defaultMessage = '{{field}} must be a valid email.';\n }\n check(value) {\n if (!value) {\n return true;\n }\n /* eslint-disable max-len */\n // From http://stackoverflow.com/questions/46155/validate-email-address-in-javascript\n 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,}))$/;\n /* eslint-enable max-len */\n // Allow emails to be valid if the component is pristine and no value is provided.\n return re.test(value);\n }\n}\nexports[\"default\"] = Email;\n\n\n//# sourceURL=webpack://Formio/./lib/cjs/validator/rules/Email.js?");
|
6137
6137
|
|
6138
6138
|
/***/ }),
|
6139
6139
|
|
@@ -6144,7 +6144,7 @@ eval("\nvar __importDefault = (this && this.__importDefault) || function (mod) {
|
|
6144
6144
|
/***/ (function(__unused_webpack_module, exports, __webpack_require__) {
|
6145
6145
|
|
6146
6146
|
"use strict";
|
6147
|
-
eval("\nvar __importDefault = (this && this.__importDefault) || function (mod) {\n return (mod && mod.__esModule) ? mod : { \"default\": mod };\n};\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\nconst Rule_1 = __importDefault(__webpack_require__(/*! ./Rule */ \"./lib/cjs/validator/rules/Rule.js\"));\nclass JSON extends Rule_1.default {\n constructor() {\n super(...arguments);\n this.defaultMessage = '{{error}}';\n }\n check(value, data, row, index) {\n const { json } = this.settings;\n if (!json) {\n return true;\n }\n const valid = this.component.evaluate(json, {\n data,\n row,\n rowIndex: index,\n input: value\n });\n if (valid === null) {\n return true;\n }\n return valid;\n }\n}\nexports[\"default\"] = JSON;\n
|
6147
|
+
eval("\nvar __importDefault = (this && this.__importDefault) || function (mod) {\n return (mod && mod.__esModule) ? mod : { \"default\": mod };\n};\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\nconst Rule_1 = __importDefault(__webpack_require__(/*! ./Rule */ \"./lib/cjs/validator/rules/Rule.js\"));\nclass JSON extends Rule_1.default {\n constructor() {\n super(...arguments);\n this.defaultMessage = '{{error}}';\n }\n check(value, data, row, index) {\n const { json } = this.settings;\n if (!json) {\n return true;\n }\n const valid = this.component.evaluate(json, {\n data,\n row,\n rowIndex: index,\n input: value\n });\n if (valid === null) {\n return true;\n }\n return valid;\n }\n}\nexports[\"default\"] = JSON;\n\n\n//# sourceURL=webpack://Formio/./lib/cjs/validator/rules/JSON.js?");
|
6148
6148
|
|
6149
6149
|
/***/ }),
|
6150
6150
|
|
@@ -6155,7 +6155,7 @@ eval("\nvar __importDefault = (this && this.__importDefault) || function (mod) {
|
|
6155
6155
|
/***/ (function(__unused_webpack_module, exports, __webpack_require__) {
|
6156
6156
|
|
6157
6157
|
"use strict";
|
6158
|
-
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 = __webpack_require__(/*! ../../utils/utils */ \"./lib/cjs/utils/utils.js\");\nconst Rule_1 = __importDefault(__webpack_require__(/*! ./Rule */ \"./lib/cjs/validator/rules/Rule.js\"));\nclass Mask extends Rule_1.default {\n constructor() {\n super(...arguments);\n this.defaultMessage = '{{field}} does not match the mask.';\n }\n check(value) {\n let inputMask;\n if (this.component.isMultipleMasksField) {\n const maskName = value ? value.maskName : undefined;\n const formioInputMask = this.component.getMaskByName(maskName);\n if (formioInputMask) {\n inputMask = (0, utils_1.getInputMask)(formioInputMask);\n }\n value = value ? value.value : value;\n }\n else {\n inputMask = (0, utils_1.getInputMask)(this.settings.mask);\n }\n if (value && inputMask) {\n return (0, utils_1.matchInputMask)(value, inputMask);\n }\n return true;\n }\n}\nexports[\"default\"] = Mask;\n
|
6158
|
+
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 = __webpack_require__(/*! ../../utils/utils */ \"./lib/cjs/utils/utils.js\");\nconst Rule_1 = __importDefault(__webpack_require__(/*! ./Rule */ \"./lib/cjs/validator/rules/Rule.js\"));\nclass Mask extends Rule_1.default {\n constructor() {\n super(...arguments);\n this.defaultMessage = '{{field}} does not match the mask.';\n }\n check(value) {\n let inputMask;\n if (this.component.isMultipleMasksField) {\n const maskName = value ? value.maskName : undefined;\n const formioInputMask = this.component.getMaskByName(maskName);\n if (formioInputMask) {\n inputMask = (0, utils_1.getInputMask)(formioInputMask);\n }\n value = value ? value.value : value;\n }\n else {\n inputMask = (0, utils_1.getInputMask)(this.settings.mask);\n }\n if (value && inputMask) {\n return (0, utils_1.matchInputMask)(value, inputMask);\n }\n return true;\n }\n}\nexports[\"default\"] = Mask;\n\n\n//# sourceURL=webpack://Formio/./lib/cjs/validator/rules/Mask.js?");
|
6159
6159
|
|
6160
6160
|
/***/ }),
|
6161
6161
|
|
@@ -6166,7 +6166,7 @@ eval("\nvar __importDefault = (this && this.__importDefault) || function (mod) {
|
|
6166
6166
|
/***/ (function(__unused_webpack_module, exports, __webpack_require__) {
|
6167
6167
|
|
6168
6168
|
"use strict";
|
6169
|
-
eval("\nvar __importDefault = (this && this.__importDefault) || function (mod) {\n return (mod && mod.__esModule) ? mod : { \"default\": mod };\n};\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\nconst Rule_1 = __importDefault(__webpack_require__(/*! ./Rule */ \"./lib/cjs/validator/rules/Rule.js\"));\nclass Max extends Rule_1.default {\n constructor() {\n super(...arguments);\n this.defaultMessage = '{{field}} cannot be greater than {{settings.limit}}.';\n }\n check(value) {\n const max = parseFloat(this.settings.limit);\n const parsedValue = parseFloat(value);\n if (Number.isNaN(max) || Number.isNaN(parsedValue)) {\n return true;\n }\n return parsedValue <= max;\n }\n}\nexports[\"default\"] = Max;\n
|
6169
|
+
eval("\nvar __importDefault = (this && this.__importDefault) || function (mod) {\n return (mod && mod.__esModule) ? mod : { \"default\": mod };\n};\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\nconst Rule_1 = __importDefault(__webpack_require__(/*! ./Rule */ \"./lib/cjs/validator/rules/Rule.js\"));\nclass Max extends Rule_1.default {\n constructor() {\n super(...arguments);\n this.defaultMessage = '{{field}} cannot be greater than {{settings.limit}}.';\n }\n check(value) {\n const max = parseFloat(this.settings.limit);\n const parsedValue = parseFloat(value);\n if (Number.isNaN(max) || Number.isNaN(parsedValue)) {\n return true;\n }\n return parsedValue <= max;\n }\n}\nexports[\"default\"] = Max;\n\n\n//# sourceURL=webpack://Formio/./lib/cjs/validator/rules/Max.js?");
|
6170
6170
|
|
6171
6171
|
/***/ }),
|
6172
6172
|
|
@@ -6177,7 +6177,7 @@ eval("\nvar __importDefault = (this && this.__importDefault) || function (mod) {
|
|
6177
6177
|
/***/ (function(__unused_webpack_module, exports, __webpack_require__) {
|
6178
6178
|
|
6179
6179
|
"use strict";
|
6180
|
-
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 = __webpack_require__(/*! ../../utils/utils */ \"./lib/cjs/utils/utils.js\");\nconst moment_1 = __importDefault(__webpack_require__(/*! moment */ \"./node_modules/moment/moment.js\"));\nconst lodash_1 = __importDefault(__webpack_require__(/*! lodash */ \"./node_modules/lodash/lodash.js\"));\nconst Rule_1 = __importDefault(__webpack_require__(/*! ./Rule */ \"./lib/cjs/validator/rules/Rule.js\"));\nclass MaxDate extends Rule_1.default {\n constructor() {\n super(...arguments);\n this.defaultMessage = '{{field}} should not contain date after {{settings.dateLimit}}';\n }\n check(value) {\n if (!value) {\n return true;\n }\n // If they are the exact same string or object, then return true.\n if (value === this.settings.dateLimit) {\n return true;\n }\n const date = (0, moment_1.default)(value);\n const maxDate = (0, utils_1.getDateSetting)(this.settings.dateLimit);\n if (lodash_1.default.isNull(maxDate)) {\n return true;\n }\n else {\n maxDate.setHours(0, 0, 0, 0);\n }\n return date.isBefore(maxDate) || date.isSame(maxDate);\n }\n}\nexports[\"default\"] = MaxDate;\n
|
6180
|
+
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 = __webpack_require__(/*! ../../utils/utils */ \"./lib/cjs/utils/utils.js\");\nconst moment_1 = __importDefault(__webpack_require__(/*! moment */ \"./node_modules/moment/moment.js\"));\nconst lodash_1 = __importDefault(__webpack_require__(/*! lodash */ \"./node_modules/lodash/lodash.js\"));\nconst Rule_1 = __importDefault(__webpack_require__(/*! ./Rule */ \"./lib/cjs/validator/rules/Rule.js\"));\nclass MaxDate extends Rule_1.default {\n constructor() {\n super(...arguments);\n this.defaultMessage = '{{field}} should not contain date after {{settings.dateLimit}}';\n }\n check(value) {\n if (!value) {\n return true;\n }\n // If they are the exact same string or object, then return true.\n if (value === this.settings.dateLimit) {\n return true;\n }\n const date = (0, moment_1.default)(value);\n const maxDate = (0, utils_1.getDateSetting)(this.settings.dateLimit);\n if (lodash_1.default.isNull(maxDate)) {\n return true;\n }\n else {\n maxDate.setHours(0, 0, 0, 0);\n }\n return date.isBefore(maxDate) || date.isSame(maxDate);\n }\n}\nexports[\"default\"] = MaxDate;\n\n\n//# sourceURL=webpack://Formio/./lib/cjs/validator/rules/MaxDate.js?");
|
6181
6181
|
|
6182
6182
|
/***/ }),
|
6183
6183
|
|
@@ -6188,7 +6188,7 @@ eval("\nvar __importDefault = (this && this.__importDefault) || function (mod) {
|
|
6188
6188
|
/***/ (function(__unused_webpack_module, exports, __webpack_require__) {
|
6189
6189
|
|
6190
6190
|
"use strict";
|
6191
|
-
eval("\nvar __importDefault = (this && this.__importDefault) || function (mod) {\n return (mod && mod.__esModule) ? mod : { \"default\": mod };\n};\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\nconst Rule_1 = __importDefault(__webpack_require__(/*! ./Rule */ \"./lib/cjs/validator/rules/Rule.js\"));\nclass MaxLength extends Rule_1.default {\n constructor() {\n super(...arguments);\n this.defaultMessage = '{{field}} must have no more than {{- settings.length}} characters.';\n }\n check(value) {\n const maxLength = parseInt(this.settings.length, 10);\n if (!value || !maxLength || !value.hasOwnProperty('length')) {\n return true;\n }\n return (value.length <= maxLength);\n }\n}\nexports[\"default\"] = MaxLength;\n
|
6191
|
+
eval("\nvar __importDefault = (this && this.__importDefault) || function (mod) {\n return (mod && mod.__esModule) ? mod : { \"default\": mod };\n};\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\nconst Rule_1 = __importDefault(__webpack_require__(/*! ./Rule */ \"./lib/cjs/validator/rules/Rule.js\"));\nclass MaxLength extends Rule_1.default {\n constructor() {\n super(...arguments);\n this.defaultMessage = '{{field}} must have no more than {{- settings.length}} characters.';\n }\n check(value) {\n const maxLength = parseInt(this.settings.length, 10);\n if (!value || !maxLength || !value.hasOwnProperty('length')) {\n return true;\n }\n return (value.length <= maxLength);\n }\n}\nexports[\"default\"] = MaxLength;\n\n\n//# sourceURL=webpack://Formio/./lib/cjs/validator/rules/MaxLength.js?");
|
6192
6192
|
|
6193
6193
|
/***/ }),
|
6194
6194
|
|
@@ -6199,7 +6199,7 @@ eval("\nvar __importDefault = (this && this.__importDefault) || function (mod) {
|
|
6199
6199
|
/***/ (function(__unused_webpack_module, exports, __webpack_require__) {
|
6200
6200
|
|
6201
6201
|
"use strict";
|
6202
|
-
eval("\nvar __importDefault = (this && this.__importDefault) || function (mod) {\n return (mod && mod.__esModule) ? mod : { \"default\": mod };\n};\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\nconst Rule_1 = __importDefault(__webpack_require__(/*! ./Rule */ \"./lib/cjs/validator/rules/Rule.js\"));\nclass MaxWords extends Rule_1.default {\n constructor() {\n super(...arguments);\n this.defaultMessage = '{{field}} must have no more than {{- settings.length}} words.';\n }\n check(value) {\n const maxWords = parseInt(this.settings.length, 10);\n if (!maxWords || (typeof value !== 'string')) {\n return true;\n }\n return (value.trim().split(/\\s+/).length <= maxWords);\n }\n}\nexports[\"default\"] = MaxWords;\n
|
6202
|
+
eval("\nvar __importDefault = (this && this.__importDefault) || function (mod) {\n return (mod && mod.__esModule) ? mod : { \"default\": mod };\n};\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\nconst Rule_1 = __importDefault(__webpack_require__(/*! ./Rule */ \"./lib/cjs/validator/rules/Rule.js\"));\nclass MaxWords extends Rule_1.default {\n constructor() {\n super(...arguments);\n this.defaultMessage = '{{field}} must have no more than {{- settings.length}} words.';\n }\n check(value) {\n const maxWords = parseInt(this.settings.length, 10);\n if (!maxWords || (typeof value !== 'string')) {\n return true;\n }\n return (value.trim().split(/\\s+/).length <= maxWords);\n }\n}\nexports[\"default\"] = MaxWords;\n\n\n//# sourceURL=webpack://Formio/./lib/cjs/validator/rules/MaxWords.js?");
|
6203
6203
|
|
6204
6204
|
/***/ }),
|
6205
6205
|
|
@@ -6210,7 +6210,7 @@ eval("\nvar __importDefault = (this && this.__importDefault) || function (mod) {
|
|
6210
6210
|
/***/ (function(__unused_webpack_module, exports, __webpack_require__) {
|
6211
6211
|
|
6212
6212
|
"use strict";
|
6213
|
-
eval("\nvar __importDefault = (this && this.__importDefault) || function (mod) {\n return (mod && mod.__esModule) ? mod : { \"default\": mod };\n};\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\nconst Rule_1 = __importDefault(__webpack_require__(/*! ./Rule */ \"./lib/cjs/validator/rules/Rule.js\"));\nclass MaxYear extends Rule_1.default {\n constructor() {\n super(...arguments);\n this.defaultMessage = '{{field}} should not contain year greater than {{maxYear}}';\n }\n check(value) {\n const maxYear = this.settings;\n let year = /\\d{4}$/.exec(value);\n year = year ? year[0] : null;\n if (!(+maxYear) || !(+year)) {\n return true;\n }\n return +year <= +maxYear;\n }\n}\nexports[\"default\"] = MaxYear;\n
|
6213
|
+
eval("\nvar __importDefault = (this && this.__importDefault) || function (mod) {\n return (mod && mod.__esModule) ? mod : { \"default\": mod };\n};\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\nconst Rule_1 = __importDefault(__webpack_require__(/*! ./Rule */ \"./lib/cjs/validator/rules/Rule.js\"));\nclass MaxYear extends Rule_1.default {\n constructor() {\n super(...arguments);\n this.defaultMessage = '{{field}} should not contain year greater than {{maxYear}}';\n }\n check(value) {\n const maxYear = this.settings;\n let year = /\\d{4}$/.exec(value);\n year = year ? year[0] : null;\n if (!(+maxYear) || !(+year)) {\n return true;\n }\n return +year <= +maxYear;\n }\n}\nexports[\"default\"] = MaxYear;\n\n\n//# sourceURL=webpack://Formio/./lib/cjs/validator/rules/MaxYear.js?");
|
6214
6214
|
|
6215
6215
|
/***/ }),
|
6216
6216
|
|
@@ -6221,7 +6221,7 @@ eval("\nvar __importDefault = (this && this.__importDefault) || function (mod) {
|
|
6221
6221
|
/***/ (function(__unused_webpack_module, exports, __webpack_require__) {
|
6222
6222
|
|
6223
6223
|
"use strict";
|
6224
|
-
eval("\nvar __importDefault = (this && this.__importDefault) || function (mod) {\n return (mod && mod.__esModule) ? mod : { \"default\": mod };\n};\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\nconst Rule_1 = __importDefault(__webpack_require__(/*! ./Rule */ \"./lib/cjs/validator/rules/Rule.js\"));\nclass Min extends Rule_1.default {\n constructor() {\n super(...arguments);\n this.defaultMessage = '{{field}} cannot be less than {{settings.limit}}.';\n }\n check(value) {\n const min = parseFloat(this.settings.limit);\n const parsedValue = parseFloat(value);\n if (Number.isNaN(min) || Number.isNaN(parsedValue)) {\n return true;\n }\n return parsedValue >= min;\n }\n}\nexports[\"default\"] = Min;\n
|
6224
|
+
eval("\nvar __importDefault = (this && this.__importDefault) || function (mod) {\n return (mod && mod.__esModule) ? mod : { \"default\": mod };\n};\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\nconst Rule_1 = __importDefault(__webpack_require__(/*! ./Rule */ \"./lib/cjs/validator/rules/Rule.js\"));\nclass Min extends Rule_1.default {\n constructor() {\n super(...arguments);\n this.defaultMessage = '{{field}} cannot be less than {{settings.limit}}.';\n }\n check(value) {\n const min = parseFloat(this.settings.limit);\n const parsedValue = parseFloat(value);\n if (Number.isNaN(min) || Number.isNaN(parsedValue)) {\n return true;\n }\n return parsedValue >= min;\n }\n}\nexports[\"default\"] = Min;\n\n\n//# sourceURL=webpack://Formio/./lib/cjs/validator/rules/Min.js?");
|
6225
6225
|
|
6226
6226
|
/***/ }),
|
6227
6227
|
|
@@ -6232,7 +6232,7 @@ eval("\nvar __importDefault = (this && this.__importDefault) || function (mod) {
|
|
6232
6232
|
/***/ (function(__unused_webpack_module, exports, __webpack_require__) {
|
6233
6233
|
|
6234
6234
|
"use strict";
|
6235
|
-
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 = __webpack_require__(/*! ../../utils/utils */ \"./lib/cjs/utils/utils.js\");\nconst moment_1 = __importDefault(__webpack_require__(/*! moment */ \"./node_modules/moment/moment.js\"));\nconst lodash_1 = __importDefault(__webpack_require__(/*! lodash */ \"./node_modules/lodash/lodash.js\"));\nconst Rule_1 = __importDefault(__webpack_require__(/*! ./Rule */ \"./lib/cjs/validator/rules/Rule.js\"));\nclass MinDate extends Rule_1.default {\n constructor() {\n super(...arguments);\n this.defaultMessage = '{{field}} should not contain date before {{settings.dateLimit}}';\n }\n check(value) {\n if (!value) {\n return true;\n }\n const date = (0, moment_1.default)(value);\n const minDate = (0, utils_1.getDateSetting)(this.settings.dateLimit);\n if (lodash_1.default.isNull(minDate)) {\n return true;\n }\n else {\n minDate.setHours(0, 0, 0, 0);\n }\n return date.isAfter(minDate) || date.isSame(minDate);\n }\n}\nexports[\"default\"] = MinDate;\n
|
6235
|
+
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 = __webpack_require__(/*! ../../utils/utils */ \"./lib/cjs/utils/utils.js\");\nconst moment_1 = __importDefault(__webpack_require__(/*! moment */ \"./node_modules/moment/moment.js\"));\nconst lodash_1 = __importDefault(__webpack_require__(/*! lodash */ \"./node_modules/lodash/lodash.js\"));\nconst Rule_1 = __importDefault(__webpack_require__(/*! ./Rule */ \"./lib/cjs/validator/rules/Rule.js\"));\nclass MinDate extends Rule_1.default {\n constructor() {\n super(...arguments);\n this.defaultMessage = '{{field}} should not contain date before {{settings.dateLimit}}';\n }\n check(value) {\n if (!value) {\n return true;\n }\n const date = (0, moment_1.default)(value);\n const minDate = (0, utils_1.getDateSetting)(this.settings.dateLimit);\n if (lodash_1.default.isNull(minDate)) {\n return true;\n }\n else {\n minDate.setHours(0, 0, 0, 0);\n }\n return date.isAfter(minDate) || date.isSame(minDate);\n }\n}\nexports[\"default\"] = MinDate;\n\n\n//# sourceURL=webpack://Formio/./lib/cjs/validator/rules/MinDate.js?");
|
6236
6236
|
|
6237
6237
|
/***/ }),
|
6238
6238
|
|
@@ -6243,7 +6243,7 @@ eval("\nvar __importDefault = (this && this.__importDefault) || function (mod) {
|
|
6243
6243
|
/***/ (function(__unused_webpack_module, exports, __webpack_require__) {
|
6244
6244
|
|
6245
6245
|
"use strict";
|
6246
|
-
eval("\nvar __importDefault = (this && this.__importDefault) || function (mod) {\n return (mod && mod.__esModule) ? mod : { \"default\": mod };\n};\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\nconst Rule_1 = __importDefault(__webpack_require__(/*! ./Rule */ \"./lib/cjs/validator/rules/Rule.js\"));\nclass MinLength extends Rule_1.default {\n constructor() {\n super(...arguments);\n this.defaultMessage = '{{field}} must have no more than {{- settings.length}} characters.';\n }\n check(value) {\n const minLength = parseInt(this.settings.length, 10);\n if (!minLength || !value || !value.hasOwnProperty('length') || this.component.isEmpty(value)) {\n return true;\n }\n return (value.length >= minLength);\n }\n}\nexports[\"default\"] = MinLength;\n
|
6246
|
+
eval("\nvar __importDefault = (this && this.__importDefault) || function (mod) {\n return (mod && mod.__esModule) ? mod : { \"default\": mod };\n};\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\nconst Rule_1 = __importDefault(__webpack_require__(/*! ./Rule */ \"./lib/cjs/validator/rules/Rule.js\"));\nclass MinLength extends Rule_1.default {\n constructor() {\n super(...arguments);\n this.defaultMessage = '{{field}} must have no more than {{- settings.length}} characters.';\n }\n check(value) {\n const minLength = parseInt(this.settings.length, 10);\n if (!minLength || !value || !value.hasOwnProperty('length') || this.component.isEmpty(value)) {\n return true;\n }\n return (value.length >= minLength);\n }\n}\nexports[\"default\"] = MinLength;\n\n\n//# sourceURL=webpack://Formio/./lib/cjs/validator/rules/MinLength.js?");
|
6247
6247
|
|
6248
6248
|
/***/ }),
|
6249
6249
|
|
@@ -6254,7 +6254,7 @@ eval("\nvar __importDefault = (this && this.__importDefault) || function (mod) {
|
|
6254
6254
|
/***/ (function(__unused_webpack_module, exports, __webpack_require__) {
|
6255
6255
|
|
6256
6256
|
"use strict";
|
6257
|
-
eval("\nvar __importDefault = (this && this.__importDefault) || function (mod) {\n return (mod && mod.__esModule) ? mod : { \"default\": mod };\n};\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\nconst Rule_1 = __importDefault(__webpack_require__(/*! ./Rule */ \"./lib/cjs/validator/rules/Rule.js\"));\nclass MinWords extends Rule_1.default {\n constructor() {\n super(...arguments);\n this.defaultMessage = '{{field}} must have at least {{- settings.length}} words.';\n }\n check(value) {\n const minWords = parseInt(this.settings.length, 10);\n if (!minWords || !value || (typeof value !== 'string')) {\n return true;\n }\n return (value.trim().split(/\\s+/).length >= minWords);\n }\n}\nexports[\"default\"] = MinWords;\n
|
6257
|
+
eval("\nvar __importDefault = (this && this.__importDefault) || function (mod) {\n return (mod && mod.__esModule) ? mod : { \"default\": mod };\n};\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\nconst Rule_1 = __importDefault(__webpack_require__(/*! ./Rule */ \"./lib/cjs/validator/rules/Rule.js\"));\nclass MinWords extends Rule_1.default {\n constructor() {\n super(...arguments);\n this.defaultMessage = '{{field}} must have at least {{- settings.length}} words.';\n }\n check(value) {\n const minWords = parseInt(this.settings.length, 10);\n if (!minWords || !value || (typeof value !== 'string')) {\n return true;\n }\n return (value.trim().split(/\\s+/).length >= minWords);\n }\n}\nexports[\"default\"] = MinWords;\n\n\n//# sourceURL=webpack://Formio/./lib/cjs/validator/rules/MinWords.js?");
|
6258
6258
|
|
6259
6259
|
/***/ }),
|
6260
6260
|
|
@@ -6265,7 +6265,7 @@ eval("\nvar __importDefault = (this && this.__importDefault) || function (mod) {
|
|
6265
6265
|
/***/ (function(__unused_webpack_module, exports, __webpack_require__) {
|
6266
6266
|
|
6267
6267
|
"use strict";
|
6268
|
-
eval("\nvar __importDefault = (this && this.__importDefault) || function (mod) {\n return (mod && mod.__esModule) ? mod : { \"default\": mod };\n};\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\nconst Rule_1 = __importDefault(__webpack_require__(/*! ./Rule */ \"./lib/cjs/validator/rules/Rule.js\"));\nclass MinYear extends Rule_1.default {\n constructor() {\n super(...arguments);\n this.defaultMessage = '{{field}} should not contain year less than {{minYear}}';\n }\n check(value) {\n const minYear = this.settings;\n let year = /\\d{4}$/.exec(value);\n year = year ? year[0] : null;\n if (!(+minYear) || !(+year)) {\n return true;\n }\n return +year >= +minYear;\n }\n}\nexports[\"default\"] = MinYear;\n
|
6268
|
+
eval("\nvar __importDefault = (this && this.__importDefault) || function (mod) {\n return (mod && mod.__esModule) ? mod : { \"default\": mod };\n};\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\nconst Rule_1 = __importDefault(__webpack_require__(/*! ./Rule */ \"./lib/cjs/validator/rules/Rule.js\"));\nclass MinYear extends Rule_1.default {\n constructor() {\n super(...arguments);\n this.defaultMessage = '{{field}} should not contain year less than {{minYear}}';\n }\n check(value) {\n const minYear = this.settings;\n let year = /\\d{4}$/.exec(value);\n year = year ? year[0] : null;\n if (!(+minYear) || !(+year)) {\n return true;\n }\n return +year >= +minYear;\n }\n}\nexports[\"default\"] = MinYear;\n\n\n//# sourceURL=webpack://Formio/./lib/cjs/validator/rules/MinYear.js?");
|
6269
6269
|
|
6270
6270
|
/***/ }),
|
6271
6271
|
|
@@ -6276,7 +6276,7 @@ eval("\nvar __importDefault = (this && this.__importDefault) || function (mod) {
|
|
6276
6276
|
/***/ (function(__unused_webpack_module, exports, __webpack_require__) {
|
6277
6277
|
|
6278
6278
|
"use strict";
|
6279
|
-
eval("\nvar __importDefault = (this && this.__importDefault) || function (mod) {\n return (mod && mod.__esModule) ? mod : { \"default\": mod };\n};\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\nconst Rule_1 = __importDefault(__webpack_require__(/*! ./Rule */ \"./lib/cjs/validator/rules/Rule.js\"));\nclass Pattern extends Rule_1.default {\n constructor() {\n super(...arguments);\n this.defaultMessage = '{{field}} does not match the pattern {{settings.pattern}}';\n }\n check(value) {\n const { pattern } = this.settings;\n if (!pattern) {\n return true;\n }\n return (new RegExp(`^${pattern}$`)).test(value);\n }\n}\nexports[\"default\"] = Pattern;\n
|
6279
|
+
eval("\nvar __importDefault = (this && this.__importDefault) || function (mod) {\n return (mod && mod.__esModule) ? mod : { \"default\": mod };\n};\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\nconst Rule_1 = __importDefault(__webpack_require__(/*! ./Rule */ \"./lib/cjs/validator/rules/Rule.js\"));\nclass Pattern extends Rule_1.default {\n constructor() {\n super(...arguments);\n this.defaultMessage = '{{field}} does not match the pattern {{settings.pattern}}';\n }\n check(value) {\n const { pattern } = this.settings;\n if (!pattern) {\n return true;\n }\n return (new RegExp(`^${pattern}$`)).test(value);\n }\n}\nexports[\"default\"] = Pattern;\n\n\n//# sourceURL=webpack://Formio/./lib/cjs/validator/rules/Pattern.js?");
|
6280
6280
|
|
6281
6281
|
/***/ }),
|
6282
6282
|
|
@@ -6287,7 +6287,7 @@ eval("\nvar __importDefault = (this && this.__importDefault) || function (mod) {
|
|
6287
6287
|
/***/ (function(__unused_webpack_module, exports, __webpack_require__) {
|
6288
6288
|
|
6289
6289
|
"use strict";
|
6290
|
-
eval("\nvar __importDefault = (this && this.__importDefault) || function (mod) {\n return (mod && mod.__esModule) ? mod : { \"default\": mod };\n};\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\nconst Rule_1 = __importDefault(__webpack_require__(/*! ./Rule */ \"./lib/cjs/validator/rules/Rule.js\"));\nclass Required extends Rule_1.default {\n constructor() {\n super(...arguments);\n this.defaultMessage = '{{field}} is required';\n }\n check(value) {\n // TODO: Day, Survey overrides.\n return !this.component.isValueHidden() && !this.component.isEmpty(value);\n }\n}\nexports[\"default\"] = Required;\n
|
6290
|
+
eval("\nvar __importDefault = (this && this.__importDefault) || function (mod) {\n return (mod && mod.__esModule) ? mod : { \"default\": mod };\n};\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\nconst Rule_1 = __importDefault(__webpack_require__(/*! ./Rule */ \"./lib/cjs/validator/rules/Rule.js\"));\nclass Required extends Rule_1.default {\n constructor() {\n super(...arguments);\n this.defaultMessage = '{{field}} is required';\n }\n check(value) {\n // TODO: Day, Survey overrides.\n return !this.component.isValueHidden() && !this.component.isEmpty(value);\n }\n}\nexports[\"default\"] = Required;\n\n\n//# sourceURL=webpack://Formio/./lib/cjs/validator/rules/Required.js?");
|
6291
6291
|
|
6292
6292
|
/***/ }),
|
6293
6293
|
|
@@ -6298,7 +6298,7 @@ eval("\nvar __importDefault = (this && this.__importDefault) || function (mod) {
|
|
6298
6298
|
/***/ (function(__unused_webpack_module, exports) {
|
6299
6299
|
|
6300
6300
|
"use strict";
|
6301
|
-
eval("\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\nclass Rule {\n constructor(component, settings, config) {\n this.component = component;\n this.settings = settings;\n this.config = config;\n }\n check() {\n }\n}\nexports[\"default\"] = Rule;\n
|
6301
|
+
eval("\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\nclass Rule {\n constructor(component, settings, config) {\n this.component = component;\n this.settings = settings;\n this.config = config;\n }\n check() {\n }\n}\nexports[\"default\"] = Rule;\n\n\n//# sourceURL=webpack://Formio/./lib/cjs/validator/rules/Rule.js?");
|
6302
6302
|
|
6303
6303
|
/***/ }),
|
6304
6304
|
|
@@ -6309,7 +6309,7 @@ eval("\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\nclas
|
|
6309
6309
|
/***/ (function(__unused_webpack_module, exports, __webpack_require__) {
|
6310
6310
|
|
6311
6311
|
"use strict";
|
6312
|
-
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 = __webpack_require__(/*! ../../utils/utils */ \"./lib/cjs/utils/utils.js\");\nconst native_promise_only_1 = __importDefault(__webpack_require__(/*! native-promise-only */ \"./node_modules/native-promise-only/lib/npo.src.js\"));\nconst fetch_ponyfill_1 = __importDefault(__webpack_require__(/*! fetch-ponyfill */ \"./node_modules/fetch-ponyfill/build/fetch-browser.js\"));\nconst { fetch, Headers, Request } = (0, fetch_ponyfill_1.default)({\n Promise: native_promise_only_1.default\n});\nconst lodash_1 = __importDefault(__webpack_require__(/*! lodash */ \"./node_modules/lodash/lodash.js\"));\nconst Rule_1 = __importDefault(__webpack_require__(/*! ./Rule */ \"./lib/cjs/validator/rules/Rule.js\"));\nclass Select extends Rule_1.default {\n constructor() {\n super(...arguments);\n this.defaultMessage = '{{field}} contains an invalid selection';\n }\n check(value, data, row, async) {\n // Skip if value is empty\n if (!value || lodash_1.default.isEmpty(value)) {\n return true;\n }\n // Skip if we're not async-capable\n if (!async) {\n return true;\n }\n const schema = this.component.component;\n // Initialize the request options\n const requestOptions = {\n url: this.settings.url,\n method: 'GET',\n qs: {},\n json: true,\n headers: {}\n };\n // If the url is a boolean value\n if (lodash_1.default.isBoolean(requestOptions.url)) {\n requestOptions.url = !!requestOptions.url;\n if (!requestOptions.url ||\n schema.dataSrc !== 'url' ||\n !schema.data.url ||\n !schema.searchField) {\n return true;\n }\n // Get the validation url\n requestOptions.url = schema.data.url;\n // Add the search field\n requestOptions.qs[schema.searchField] = value;\n // Add the filters\n if (schema.filter) {\n requestOptions.url += (!requestOptions.url.includes('?') ? '?' : '&') + schema.filter;\n }\n // If they only wish to return certain fields.\n if (schema.selectFields) {\n requestOptions.qs.select = schema.selectFields;\n }\n }\n if (!requestOptions.url) {\n return true;\n }\n // Make sure to interpolate.\n requestOptions.url = (0, utils_1.interpolate)(requestOptions.url, { data: this.component.data });\n // Add query string to URL\n requestOptions.url += (requestOptions.url.includes('?') ? '&' : '?') + lodash_1.default.chain(requestOptions.qs)\n .map((val, key) => `${encodeURIComponent(key)}=${encodeURIComponent(val)}`)\n .join('&')\n .value();\n // Set custom headers.\n if (schema.data && schema.data.headers) {\n lodash_1.default.each(schema.data.headers, header => {\n if (header.key) {\n requestOptions.headers[header.key] = header.value;\n }\n });\n }\n // Set form.io authentication.\n if (schema.authenticate && this.config.token) {\n requestOptions.headers['x-jwt-token'] = this.config.token;\n }\n return fetch(new Request(requestOptions.url, {\n headers: new Headers(requestOptions.headers)\n }))\n .then(response => {\n if (!response.ok) {\n return false;\n }\n return response.json();\n })\n .then((results) => {\n return results && results.length;\n })\n .catch(() => false);\n }\n}\nexports[\"default\"] = Select;\n
|
6312
|
+
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 = __webpack_require__(/*! ../../utils/utils */ \"./lib/cjs/utils/utils.js\");\nconst native_promise_only_1 = __importDefault(__webpack_require__(/*! native-promise-only */ \"./node_modules/native-promise-only/lib/npo.src.js\"));\nconst fetch_ponyfill_1 = __importDefault(__webpack_require__(/*! fetch-ponyfill */ \"./node_modules/fetch-ponyfill/build/fetch-browser.js\"));\nconst { fetch, Headers, Request } = (0, fetch_ponyfill_1.default)({\n Promise: native_promise_only_1.default\n});\nconst lodash_1 = __importDefault(__webpack_require__(/*! lodash */ \"./node_modules/lodash/lodash.js\"));\nconst Rule_1 = __importDefault(__webpack_require__(/*! ./Rule */ \"./lib/cjs/validator/rules/Rule.js\"));\nclass Select extends Rule_1.default {\n constructor() {\n super(...arguments);\n this.defaultMessage = '{{field}} contains an invalid selection';\n }\n check(value, data, row, async) {\n // Skip if value is empty\n if (!value || lodash_1.default.isEmpty(value)) {\n return true;\n }\n // Skip if we're not async-capable\n if (!async) {\n return true;\n }\n const schema = this.component.component;\n // Initialize the request options\n const requestOptions = {\n url: this.settings.url,\n method: 'GET',\n qs: {},\n json: true,\n headers: {}\n };\n // If the url is a boolean value\n if (lodash_1.default.isBoolean(requestOptions.url)) {\n requestOptions.url = !!requestOptions.url;\n if (!requestOptions.url ||\n schema.dataSrc !== 'url' ||\n !schema.data.url ||\n !schema.searchField) {\n return true;\n }\n // Get the validation url\n requestOptions.url = schema.data.url;\n // Add the search field\n requestOptions.qs[schema.searchField] = value;\n // Add the filters\n if (schema.filter) {\n requestOptions.url += (!requestOptions.url.includes('?') ? '?' : '&') + schema.filter;\n }\n // If they only wish to return certain fields.\n if (schema.selectFields) {\n requestOptions.qs.select = schema.selectFields;\n }\n }\n if (!requestOptions.url) {\n return true;\n }\n // Make sure to interpolate.\n requestOptions.url = (0, utils_1.interpolate)(requestOptions.url, { data: this.component.data });\n // Add query string to URL\n requestOptions.url += (requestOptions.url.includes('?') ? '&' : '?') + lodash_1.default.chain(requestOptions.qs)\n .map((val, key) => `${encodeURIComponent(key)}=${encodeURIComponent(val)}`)\n .join('&')\n .value();\n // Set custom headers.\n if (schema.data && schema.data.headers) {\n lodash_1.default.each(schema.data.headers, header => {\n if (header.key) {\n requestOptions.headers[header.key] = header.value;\n }\n });\n }\n // Set form.io authentication.\n if (schema.authenticate && this.config.token) {\n requestOptions.headers['x-jwt-token'] = this.config.token;\n }\n return fetch(new Request(requestOptions.url, {\n headers: new Headers(requestOptions.headers)\n }))\n .then(response => {\n if (!response.ok) {\n return false;\n }\n return response.json();\n })\n .then((results) => {\n return results && results.length;\n })\n .catch(() => false);\n }\n}\nexports[\"default\"] = Select;\n\n\n//# sourceURL=webpack://Formio/./lib/cjs/validator/rules/Select.js?");
|
6313
6313
|
|
6314
6314
|
/***/ }),
|
6315
6315
|
|
@@ -6320,7 +6320,7 @@ eval("\nvar __importDefault = (this && this.__importDefault) || function (mod) {
|
|
6320
6320
|
/***/ (function(__unused_webpack_module, exports, __webpack_require__) {
|
6321
6321
|
|
6322
6322
|
"use strict";
|
6323
|
-
eval("\nvar __importDefault = (this && this.__importDefault) || function (mod) {\n return (mod && mod.__esModule) ? mod : { \"default\": mod };\n};\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\nconst Rule_1 = __importDefault(__webpack_require__(/*! ./Rule */ \"./lib/cjs/validator/rules/Rule.js\"));\nconst moment_1 = __importDefault(__webpack_require__(/*! moment */ \"./node_modules/moment/moment.js\"));\nclass Time extends Rule_1.default {\n constructor() {\n super(...arguments);\n this.defaultMessage = '{{field}} must contain valid time';\n }\n check(value) {\n if (this.component.isEmpty(value))\n return true;\n return (0, moment_1.default)(value, this.component.component.format).isValid();\n }\n}\nexports[\"default\"] = Time;\n
|
6323
|
+
eval("\nvar __importDefault = (this && this.__importDefault) || function (mod) {\n return (mod && mod.__esModule) ? mod : { \"default\": mod };\n};\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\nconst Rule_1 = __importDefault(__webpack_require__(/*! ./Rule */ \"./lib/cjs/validator/rules/Rule.js\"));\nconst moment_1 = __importDefault(__webpack_require__(/*! moment */ \"./node_modules/moment/moment.js\"));\nclass Time extends Rule_1.default {\n constructor() {\n super(...arguments);\n this.defaultMessage = '{{field}} must contain valid time';\n }\n check(value) {\n if (this.component.isEmpty(value))\n return true;\n return (0, moment_1.default)(value, this.component.component.format).isValid();\n }\n}\nexports[\"default\"] = Time;\n\n\n//# sourceURL=webpack://Formio/./lib/cjs/validator/rules/Time.js?");
|
6324
6324
|
|
6325
6325
|
/***/ }),
|
6326
6326
|
|
@@ -6331,7 +6331,7 @@ eval("\nvar __importDefault = (this && this.__importDefault) || function (mod) {
|
|
6331
6331
|
/***/ (function(__unused_webpack_module, exports, __webpack_require__) {
|
6332
6332
|
|
6333
6333
|
"use strict";
|
6334
|
-
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 = __webpack_require__(/*! ../../utils/utils */ \"./lib/cjs/utils/utils.js\");\nconst lodash_1 = __importDefault(__webpack_require__(/*! lodash */ \"./node_modules/lodash/lodash.js\"));\nconst native_promise_only_1 = __importDefault(__webpack_require__(/*! native-promise-only */ \"./node_modules/native-promise-only/lib/npo.src.js\"));\nconst Rule_1 = __importDefault(__webpack_require__(/*! ./Rule */ \"./lib/cjs/validator/rules/Rule.js\"));\nclass Unique extends Rule_1.default {\n constructor() {\n super(...arguments);\n this.defaultMessage = '{{field}} must be unique';\n }\n check(value) {\n // Skip if value is empty object or falsy\n if (!value || lodash_1.default.isObjectLike(value) && lodash_1.default.isEmpty(value)) {\n return true;\n }\n // Skip if we don't have a database connection\n if (!this.config.db) {\n return true;\n }\n return new native_promise_only_1.default(resolve => {\n const form = this.config.form;\n const submission = this.config.submission;\n const path = `data.${this.component.path}`;\n // Build the query\n const query = { form: form._id };\n if (lodash_1.default.isString(value)) {\n query[path] = {\n $regex: new RegExp(`^${(0, utils_1.escapeRegExCharacters)(value)}$`),\n $options: 'i'\n };\n }\n else if (lodash_1.default.isPlainObject(value) &&\n value.address &&\n value.address['address_components'] &&\n value.address['place_id']) {\n query[`${path}.address.place_id`] = {\n $regex: new RegExp(`^${(0, utils_1.escapeRegExCharacters)(value.address['place_id'])}$`),\n $options: 'i'\n };\n }\n // Compare the contents of arrays vs the order.\n else if (lodash_1.default.isArray(value)) {\n query[path] = { $all: value };\n }\n else if (lodash_1.default.isObject(value) || lodash_1.default.isNumber(value)) {\n query[path] = { $eq: value };\n }\n // Only search for non-deleted items\n query.deleted = { $eq: null };\n // Try to find an existing value within the form\n this.config.db.findOne(query, (err, result) => {\n if (err) {\n return resolve(false);\n }\n else if (result) {\n // Only OK if it matches the current submission\n return resolve(submission._id && (result._id.toString() === submission._id));\n }\n else {\n return resolve(true);\n }\n });\n }).catch(() => false);\n }\n}\nexports[\"default\"] = Unique;\n
|
6334
|
+
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 = __webpack_require__(/*! ../../utils/utils */ \"./lib/cjs/utils/utils.js\");\nconst lodash_1 = __importDefault(__webpack_require__(/*! lodash */ \"./node_modules/lodash/lodash.js\"));\nconst native_promise_only_1 = __importDefault(__webpack_require__(/*! native-promise-only */ \"./node_modules/native-promise-only/lib/npo.src.js\"));\nconst Rule_1 = __importDefault(__webpack_require__(/*! ./Rule */ \"./lib/cjs/validator/rules/Rule.js\"));\nclass Unique extends Rule_1.default {\n constructor() {\n super(...arguments);\n this.defaultMessage = '{{field}} must be unique';\n }\n check(value) {\n // Skip if value is empty object or falsy\n if (!value || lodash_1.default.isObjectLike(value) && lodash_1.default.isEmpty(value)) {\n return true;\n }\n // Skip if we don't have a database connection\n if (!this.config.db) {\n return true;\n }\n return new native_promise_only_1.default(resolve => {\n const form = this.config.form;\n const submission = this.config.submission;\n const path = `data.${this.component.path}`;\n // Build the query\n const query = { form: form._id };\n if (lodash_1.default.isString(value)) {\n query[path] = {\n $regex: new RegExp(`^${(0, utils_1.escapeRegExCharacters)(value)}$`),\n $options: 'i'\n };\n }\n else if (lodash_1.default.isPlainObject(value) &&\n value.address &&\n value.address['address_components'] &&\n value.address['place_id']) {\n query[`${path}.address.place_id`] = {\n $regex: new RegExp(`^${(0, utils_1.escapeRegExCharacters)(value.address['place_id'])}$`),\n $options: 'i'\n };\n }\n // Compare the contents of arrays vs the order.\n else if (lodash_1.default.isArray(value)) {\n query[path] = { $all: value };\n }\n else if (lodash_1.default.isObject(value) || lodash_1.default.isNumber(value)) {\n query[path] = { $eq: value };\n }\n // Only search for non-deleted items\n query.deleted = { $eq: null };\n // Try to find an existing value within the form\n this.config.db.findOne(query, (err, result) => {\n if (err) {\n return resolve(false);\n }\n else if (result) {\n // Only OK if it matches the current submission\n return resolve(submission._id && (result._id.toString() === submission._id));\n }\n else {\n return resolve(true);\n }\n });\n }).catch(() => false);\n }\n}\nexports[\"default\"] = Unique;\n\n\n//# sourceURL=webpack://Formio/./lib/cjs/validator/rules/Unique.js?");
|
6335
6335
|
|
6336
6336
|
/***/ }),
|
6337
6337
|
|
@@ -6342,7 +6342,7 @@ eval("\nvar __importDefault = (this && this.__importDefault) || function (mod) {
|
|
6342
6342
|
/***/ (function(__unused_webpack_module, exports, __webpack_require__) {
|
6343
6343
|
|
6344
6344
|
"use strict";
|
6345
|
-
eval("\nvar __importDefault = (this && this.__importDefault) || function (mod) {\n return (mod && mod.__esModule) ? mod : { \"default\": mod };\n};\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\nconst Rule_1 = __importDefault(__webpack_require__(/*! ./Rule */ \"./lib/cjs/validator/rules/Rule.js\"));\nclass Url extends Rule_1.default {\n constructor() {\n super(...arguments);\n this.defaultMessage = '{{field}} must be a valid url.';\n }\n check(value) {\n /* eslint-disable max-len */\n // From https://stackoverflow.com/questions/8667070/javascript-regular-expression-to-validate-url\n 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;\n // From http://stackoverflow.com/questions/46155/validate-email-address-in-javascript\n 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,}))$/;\n /* eslint-enable max-len */\n // Allow urls to be valid if the component is pristine and no value is provided.\n return !value || (re.test(value) && !emailRe.test(value));\n }\n}\nexports[\"default\"] = Url;\n
|
6345
|
+
eval("\nvar __importDefault = (this && this.__importDefault) || function (mod) {\n return (mod && mod.__esModule) ? mod : { \"default\": mod };\n};\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\nconst Rule_1 = __importDefault(__webpack_require__(/*! ./Rule */ \"./lib/cjs/validator/rules/Rule.js\"));\nclass Url extends Rule_1.default {\n constructor() {\n super(...arguments);\n this.defaultMessage = '{{field}} must be a valid url.';\n }\n check(value) {\n /* eslint-disable max-len */\n // From https://stackoverflow.com/questions/8667070/javascript-regular-expression-to-validate-url\n 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;\n // From http://stackoverflow.com/questions/46155/validate-email-address-in-javascript\n 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,}))$/;\n /* eslint-enable max-len */\n // Allow urls to be valid if the component is pristine and no value is provided.\n return !value || (re.test(value) && !emailRe.test(value));\n }\n}\nexports[\"default\"] = Url;\n\n\n//# sourceURL=webpack://Formio/./lib/cjs/validator/rules/Url.js?");
|
6346
6346
|
|
6347
6347
|
/***/ }),
|
6348
6348
|
|
@@ -8147,7 +8147,7 @@ eval("\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\nexpo
|
|
8147
8147
|
/***/ (function(__unused_webpack_module, exports, __webpack_require__) {
|
8148
8148
|
|
8149
8149
|
"use strict";
|
8150
|
-
eval("\nvar __importDefault = (this && this.__importDefault) || function (mod) {\n return (mod && mod.__esModule) ? mod : { \"default\": mod };\n};\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\nexports.Formio = void 0;\nconst core_1 = __webpack_require__(/*! @formio/core */ \"./node_modules/@formio/core/lib/index.js\");\nObject.defineProperty(exports, \"Formio\", ({ enumerable: true, get: function () { return core_1.Formio; } }));\nconst CDN_1 = __importDefault(__webpack_require__(/*! ./CDN */ \"./lib/cjs/CDN.js\"));\nconst providers_1 = __importDefault(__webpack_require__(/*! ./providers */ \"./lib/cjs/providers/index.js\"));\ncore_1.Formio.cdn = new CDN_1.default();\ncore_1.Formio.Providers = providers_1.default;\ncore_1.Formio.version = '5.0.0-rc.
|
8150
|
+
eval("\nvar __importDefault = (this && this.__importDefault) || function (mod) {\n return (mod && mod.__esModule) ? mod : { \"default\": mod };\n};\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\nexports.Formio = void 0;\nconst core_1 = __webpack_require__(/*! @formio/core */ \"./node_modules/@formio/core/lib/index.js\");\nObject.defineProperty(exports, \"Formio\", ({ enumerable: true, get: function () { return core_1.Formio; } }));\nconst CDN_1 = __importDefault(__webpack_require__(/*! ./CDN */ \"./lib/cjs/CDN.js\"));\nconst providers_1 = __importDefault(__webpack_require__(/*! ./providers */ \"./lib/cjs/providers/index.js\"));\ncore_1.Formio.cdn = new CDN_1.default();\ncore_1.Formio.Providers = providers_1.default;\ncore_1.Formio.version = '5.0.0-rc.12';\nconst isNil = (val) => val === null || val === undefined;\ncore_1.Formio.prototype.uploadFile = function (storage, file, fileName, dir, progressCallback, url, options, fileKey, groupPermissions, groupId, uploadStartCallback, abortCallback) {\n const requestArgs = {\n provider: storage,\n method: 'upload',\n file: file,\n fileName: fileName,\n dir: dir\n };\n fileKey = fileKey || 'file';\n const request = core_1.Formio.pluginWait('preRequest', requestArgs)\n .then(() => {\n return core_1.Formio.pluginGet('fileRequest', requestArgs)\n .then((result) => {\n if (storage && isNil(result)) {\n const Provider = providers_1.default.getProvider('storage', storage);\n if (Provider) {\n const provider = new Provider(this);\n if (uploadStartCallback) {\n uploadStartCallback();\n }\n return provider.uploadFile(file, fileName, dir, progressCallback, url, options, fileKey, groupPermissions, groupId, abortCallback);\n }\n else {\n throw ('Storage provider not found');\n }\n }\n return result || { url: '' };\n });\n });\n return core_1.Formio.pluginAlter('wrapFileRequestPromise', request, requestArgs);\n};\ncore_1.Formio.prototype.downloadFile = function (file, options) {\n const requestArgs = {\n method: 'download',\n file: file\n };\n const request = core_1.Formio.pluginWait('preRequest', requestArgs)\n .then(() => {\n return core_1.Formio.pluginGet('fileRequest', requestArgs)\n .then((result) => {\n if (file.storage && isNil(result)) {\n const Provider = providers_1.default.getProvider('storage', file.storage);\n if (Provider) {\n const provider = new Provider(this);\n return provider.downloadFile(file, options);\n }\n else {\n throw ('Storage provider not found');\n }\n }\n return result || { url: '' };\n });\n });\n return core_1.Formio.pluginAlter('wrapFileRequestPromise', request, requestArgs);\n};\ncore_1.Formio.prototype.deleteFile = function (file, options) {\n const requestArgs = {\n method: 'delete',\n file: file\n };\n const request = core_1.Formio.pluginWait('preRequest', requestArgs)\n .then(() => {\n return core_1.Formio.pluginGet('fileRequest', requestArgs)\n .then((result) => {\n if (file.storage && isNil(result)) {\n const Provider = providers_1.default.getProvider('storage', file.storage);\n if (Provider) {\n const provider = new Provider(this);\n return provider.deleteFile(file, options);\n }\n else {\n throw ('Storage provider not found');\n }\n }\n return result || { url: '' };\n });\n });\n return core_1.Formio.pluginAlter('wrapFileRequestPromise', request, requestArgs);\n};\n// For reverse compatability.\ncore_1.Formio.Promise = Promise;\n\n\n//# sourceURL=webpack://Formio/./lib/cjs/Formio.js?");
|
8151
8151
|
|
8152
8152
|
/***/ }),
|
8153
8153
|
|