@formio/js 5.3.4 → 5.3.5
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.
- package/dist/formio.embed.js +1 -1
- package/dist/formio.embed.min.js +1 -1
- package/dist/formio.embed.min.js.LICENSE.txt +1 -1
- package/dist/formio.form.js +7 -7
- package/dist/formio.form.min.js +1 -1
- package/dist/formio.form.min.js.LICENSE.txt +1 -1
- package/dist/formio.full.js +7 -7
- package/dist/formio.full.min.js +1 -1
- package/dist/formio.full.min.js.LICENSE.txt +1 -1
- package/dist/formio.js +3 -3
- package/dist/formio.min.js +1 -1
- package/dist/formio.min.js.LICENSE.txt +1 -1
- package/dist/formio.utils.js +1 -1
- package/dist/formio.utils.min.js +1 -1
- package/dist/formio.utils.min.js.LICENSE.txt +1 -1
- package/lib/cjs/Embed.js +1 -1
- package/lib/cjs/Formio.js +1 -1
- package/lib/cjs/components/Components.js +3 -9
- package/lib/cjs/components/_classes/component/Component.d.ts +8 -0
- package/lib/cjs/components/_classes/component/Component.js +18 -0
- package/lib/cjs/components/_classes/nested/NestedComponent.js +4 -9
- package/lib/cjs/components/datagrid/DataGrid.js +18 -3
- package/lib/cjs/package.json +1 -1
- package/lib/mjs/Embed.js +1 -1
- package/lib/mjs/Formio.js +1 -1
- package/lib/mjs/components/Components.js +3 -9
- package/lib/mjs/components/_classes/component/Component.d.ts +8 -0
- package/lib/mjs/components/_classes/component/Component.js +18 -0
- package/lib/mjs/components/_classes/nested/NestedComponent.js +4 -8
- package/lib/mjs/components/datagrid/DataGrid.js +18 -3
- package/lib/mjs/package.json +1 -1
- package/package.json +2 -2
|
@@ -20,7 +20,7 @@
|
|
|
20
20
|
|
|
21
21
|
/*! @license DOMPurify 3.4.0 | (c) Cure53 and other contributors | Released under the Apache license 2.0 and Mozilla Public License 2.0 | github.com/cure53/DOMPurify/blob/3.4.0/LICENSE */
|
|
22
22
|
|
|
23
|
-
/*! formiojs v5.3.
|
|
23
|
+
/*! formiojs v5.3.5 | https://unpkg.com/formiojs@5.3.5/LICENSE.txt */
|
|
24
24
|
|
|
25
25
|
/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */
|
|
26
26
|
|
package/dist/formio.utils.js
CHANGED
|
@@ -1771,7 +1771,7 @@ eval("{\nvar __awaiter = (this && this.__awaiter) || function (thisArg, _argumen
|
|
|
1771
1771
|
/***/ (function(__unused_webpack_module, exports, __webpack_require__) {
|
|
1772
1772
|
|
|
1773
1773
|
"use strict";
|
|
1774
|
-
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.dereferenceProcessInfo = exports.dereferenceProcess = void 0;\nconst error_1 = __webpack_require__(/*! ../../error */ \"../core/lib/error/index.js\");\nconst utils_1 = __webpack_require__(/*! ../../utils */ \"../core/lib/utils/index.js\");\nconst lodash_1 = __webpack_require__(/*! lodash */ \"../../node_modules/.pnpm/lodash@4.18.1/node_modules/lodash/lodash.js\");\nconst isDereferenceableDataTableComponent = (component) => {\n var _a, _b, _c;\n return (component &&\n component.type === 'datatable' &&\n ((_a = component.fetch) === null || _a === void 0 ? void 0 : _a.enableFetch) === true &&\n ((_b = component.fetch) === null || _b === void 0 ? void 0 : _b.dataSrc) === 'resource' &&\n typeof ((_c = component.fetch) === null || _c === void 0 ? void 0 : _c.resource) === 'string');\n};\nconst isDereferenceableSelectResourceComponent = (component) => {\n return (component &&\n component.type === 'select' &&\n component.reference &&\n component.dataSrc === 'resource');\n};\n/**\n * This function is used to dereference reference IDs contained in the form.\n * It is currently only compatible with Data Table components.\n * @todo Add support for other components (if applicable) and for submission data dereferencing (e.g. save-as-reference, currently a property action).\n */\nconst dereferenceProcess = (context) => __awaiter(void 0, void 0, void 0, function* () {\n var _a, _b;\n const { component, config, scope, path, value } = context;\n if (!scope.dereference) {\n scope.dereference = {};\n }\n const dtDereference = isDereferenceableDataTableComponent(component);\n const selectResourceDereference = isDereferenceableSelectResourceComponent(component);\n if (!dtDereference && !selectResourceDereference) {\n return;\n }\n if (!(config === null || config === void 0 ? void 0 : config.database)) {\n throw new error_1.ProcessorError('Cannot dereference resource value without a database config object', context, 'dereference');\n }\n try {\n if (dtDereference) {\n const components = yield ((_a = config.database) === null || _a === void 0 ? void 0 : _a.dereferenceDataTableComponent(component));\n const vmCompatibleComponents = (0, utils_1.fastCloneDeep)(components);\n scope.dereference[path] = vmCompatibleComponents;\n // Modify the components in place; we have to do this now as opposed to a \"post-processor\" step because\n // eachComponentDataAsync will immediately turn around and introspect these components in the case of Data Table\n component.components = vmCompatibleComponents;\n }\n else if (selectResourceDereference) {\n if ((0, lodash_1.isEmpty)(value) || !(0, lodash_1.isObject)(value)) {\n return;\n }\n const references = yield ((_b = config.database) === null || _b === void 0 ? void 0 : _b.dereferenceSelectResourceValue(component, value));\n if ((0, lodash_1.isEmpty)(references) || !(0, lodash_1.isArray)(references)) {\n return;\n }\n scope.dereference[path] =
|
|
1774
|
+
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.dereferenceProcessInfo = exports.dereferenceProcess = void 0;\nconst error_1 = __webpack_require__(/*! ../../error */ \"../core/lib/error/index.js\");\nconst utils_1 = __webpack_require__(/*! ../../utils */ \"../core/lib/utils/index.js\");\nconst lodash_1 = __webpack_require__(/*! lodash */ \"../../node_modules/.pnpm/lodash@4.18.1/node_modules/lodash/lodash.js\");\nconst isDereferenceableDataTableComponent = (component) => {\n var _a, _b, _c;\n return (component &&\n component.type === 'datatable' &&\n ((_a = component.fetch) === null || _a === void 0 ? void 0 : _a.enableFetch) === true &&\n ((_b = component.fetch) === null || _b === void 0 ? void 0 : _b.dataSrc) === 'resource' &&\n typeof ((_c = component.fetch) === null || _c === void 0 ? void 0 : _c.resource) === 'string');\n};\nconst isDereferenceableSelectResourceComponent = (component) => {\n return (component &&\n component.type === 'select' &&\n component.reference &&\n component.dataSrc === 'resource');\n};\n/**\n * This function is used to dereference reference IDs contained in the form.\n * It is currently only compatible with Data Table components.\n * @todo Add support for other components (if applicable) and for submission data dereferencing (e.g. save-as-reference, currently a property action).\n */\nconst dereferenceProcess = (context) => __awaiter(void 0, void 0, void 0, function* () {\n var _a, _b;\n const { component, config, scope, path, value } = context;\n if (!scope.dereference) {\n scope.dereference = {};\n }\n const dtDereference = isDereferenceableDataTableComponent(component);\n const selectResourceDereference = isDereferenceableSelectResourceComponent(component);\n if (!dtDereference && !selectResourceDereference) {\n return;\n }\n if (!(config === null || config === void 0 ? void 0 : config.database)) {\n throw new error_1.ProcessorError('Cannot dereference resource value without a database config object', context, 'dereference');\n }\n try {\n if (dtDereference) {\n const components = yield ((_a = config.database) === null || _a === void 0 ? void 0 : _a.dereferenceDataTableComponent(component));\n const vmCompatibleComponents = (0, utils_1.fastCloneDeep)(components);\n scope.dereference[path] = vmCompatibleComponents;\n // Modify the components in place; we have to do this now as opposed to a \"post-processor\" step because\n // eachComponentDataAsync will immediately turn around and introspect these components in the case of Data Table\n component.components = vmCompatibleComponents;\n }\n else if (selectResourceDereference) {\n if ((0, lodash_1.isEmpty)(value) || !(0, lodash_1.isObject)(value)) {\n return;\n }\n const references = yield ((_b = config.database) === null || _b === void 0 ? void 0 : _b.dereferenceSelectResourceValue(component, value));\n if ((0, lodash_1.isEmpty)(references) || !(0, lodash_1.isArray)(references)) {\n return;\n }\n const vmCompatibleReferences = (0, utils_1.fastCloneDeep)(references);\n scope.dereference[path] = vmCompatibleReferences;\n if (component.multiple) {\n (0, lodash_1.each)(value, (item) => {\n var _a;\n const itemId = (_a = item._id) === null || _a === void 0 ? void 0 : _a.toString();\n const reference = (0, lodash_1.find)(vmCompatibleReferences, (refItem) => { var _a; return ((_a = refItem._id) === null || _a === void 0 ? void 0 : _a.toString()) === itemId; });\n if ((0, lodash_1.isObject)(reference)) {\n (0, lodash_1.assign)(item, reference);\n }\n });\n }\n else {\n (0, lodash_1.assign)(value, vmCompatibleReferences[0]);\n }\n }\n }\n catch (err) {\n throw new error_1.ProcessorError(err.message || err, context, 'dereference');\n }\n});\nexports.dereferenceProcess = dereferenceProcess;\nexports.dereferenceProcessInfo = {\n name: 'dereference',\n shouldProcess: () => true,\n process: exports.dereferenceProcess,\n};\n\n\n//# sourceURL=webpack://Formio/../core/lib/process/dereference/index.js?\n}");
|
|
1775
1775
|
|
|
1776
1776
|
/***/ }),
|
|
1777
1777
|
|