diff --git a/backend/app/gzac/src/dev/resources/config/case/formio-test/1-0-0/case-definition-process-link/formio-test.case-definition-process-link.json b/backend/app/gzac/src/dev/resources/config/case/formio-test/1-0-0/case-definition-process-link/formio-test.case-definition-process-link.json new file mode 100644 index 0000000000..b923a01f6c --- /dev/null +++ b/backend/app/gzac/src/dev/resources/config/case/formio-test/1-0-0/case-definition-process-link/formio-test.case-definition-process-link.json @@ -0,0 +1,6 @@ +[ + { + "processDefinitionKey": "document-upload", + "linkType": "DOCUMENT_UPLOAD" + } +] \ No newline at end of file diff --git a/backend/apps/dev/src/main/resources/config/case/formio-test/1-0-0/form/valtimo-file-uploader-test.form.json b/backend/apps/dev/src/main/resources/config/case/formio-test/1-0-0/form/valtimo-file-uploader-test.form.json index 55fafb42bd..bca13fa7fc 100644 --- a/backend/apps/dev/src/main/resources/config/case/formio-test/1-0-0/form/valtimo-file-uploader-test.form.json +++ b/backend/apps/dev/src/main/resources/config/case/formio-test/1-0-0/form/valtimo-file-uploader-test.form.json @@ -22,7 +22,7 @@ "validateWhenHidden": false, "truncateMultipleSpaces": false, "validate": { - "required": true + "required": false } }, { diff --git a/documentation/SUMMARY.md b/documentation/SUMMARY.md index af6161bc44..b116115dce 100644 --- a/documentation/SUMMARY.md +++ b/documentation/SUMMARY.md @@ -195,6 +195,8 @@ ## Release notes * [Release notes](release-notes/release-notes.md) +* [14.x.x](release-notes/14.x.x/README.md) + * [14.0.0](release-notes/14.x.x/14.0.0/README.md) * [13.x.x](release-notes/13.x.x/) * [13.41.0](release-notes/13.x.x/13.41.0/README.md) * [13.40.0](release-notes/13.x.x/13.40.0/README.md) diff --git a/documentation/fundamentals/getting-started/compatibility-matrix.md b/documentation/fundamentals/getting-started/compatibility-matrix.md index c7acaab370..4249b3ffde 100644 --- a/documentation/fundamentals/getting-started/compatibility-matrix.md +++ b/documentation/fundamentals/getting-started/compatibility-matrix.md @@ -11,6 +11,13 @@ Mixing versions is not recommended. Valtimo is always tested according to the ma versions. {% endhint %} +## Major 14 + +| Valtimo backend libraries | Valtimo frontend libraries | Java | Kotlin | Spring Boot | Node | Operaton | Angular | +|---------------------------|----------------------------|------|--------|-------------|--------|--------------|--------------------------------------------------------------------------------| +| 14.0.0 | 14.0.0 | 21 | 2.1.20 | 3.4.5 | 20 LTS | 1.0.0-beta-4 | 19 ([browser support](https://angular.dev/reference/versions#browser-support)) | + + ## Major 13 | Valtimo backend libraries | Valtimo frontend libraries | Java | Kotlin | Spring Boot | Node | Operaton | Angular | OpenSearch | diff --git a/documentation/release-notes/14.x.x/14.0.0/README.md b/documentation/release-notes/14.x.x/14.0.0/README.md new file mode 100644 index 0000000000..558b05e419 --- /dev/null +++ b/documentation/release-notes/14.x.x/14.0.0/README.md @@ -0,0 +1,19 @@ +# 14.0.0 + +{% hint style="info" %} +**Release date 00-00-YYYY** +{% endhint %} + +## New Features + +* **New feature title** + + New feature explanation. + +## Enhancements + +* **Upgraded Form.io to version 5** + + Valtimo has upgraded its Form.io implementation to `@formio/js` v5.3.0 and `@formio/angular` v9.0.2. + + **Main change:** The core Form.io library has been renamed from `formiojs` to `@formio/js`. diff --git a/documentation/release-notes/14.x.x/14.0.0/back-end-migration.md b/documentation/release-notes/14.x.x/14.0.0/back-end-migration.md new file mode 100644 index 0000000000..47f777c9de --- /dev/null +++ b/documentation/release-notes/14.x.x/14.0.0/back-end-migration.md @@ -0,0 +1 @@ +# Back-end migration diff --git a/documentation/release-notes/14.x.x/14.0.0/front-end-migration.md b/documentation/release-notes/14.x.x/14.0.0/front-end-migration.md new file mode 100644 index 0000000000..be85469d88 --- /dev/null +++ b/documentation/release-notes/14.x.x/14.0.0/front-end-migration.md @@ -0,0 +1,2 @@ +# Front-end migration + diff --git a/documentation/release-notes/14.x.x/README.md b/documentation/release-notes/14.x.x/README.md new file mode 100644 index 0000000000..3f403d730a --- /dev/null +++ b/documentation/release-notes/14.x.x/README.md @@ -0,0 +1 @@ +# Major 14 diff --git a/frontend/package-lock.json b/frontend/package-lock.json index b939cafb62..87146cd10d 100644 --- a/frontend/package-lock.json +++ b/frontend/package-lock.json @@ -32,7 +32,8 @@ "@carbon/styles": "1.80.0", "@carbon/themes": "11.51.0", "@floating-ui/dom": "1.7.4", - "@formio/angular": "7.0.0", + "@formio/angular": "11.0.5", + "@formio/js": "5.5.1", "@foxythemes/bootstrap-datetime-picker-bs4": "2.3.5", "@mdi/font": "7.4.47", "@ng-bootstrap/ng-bootstrap": "11.0.1", @@ -62,7 +63,6 @@ "dmn-js": "17.2.0", "dropzone": "6.0.0-beta.2", "flatpickr": "4.6.13", - "formiojs": "4.19.5", "hammerjs": "2.0.8", "heatmap.js-fixed": "2.0.2", "ids": "3.0.1", @@ -4079,9 +4079,9 @@ "license": "MIT" }, "node_modules/@formio/angular": { - "version": "7.0.0", - "resolved": "https://registry.npmjs.org/@formio/angular/-/angular-7.0.0.tgz", - "integrity": "sha512-5xPgC7sC9BnpKjSW0q8qmphPntHQKTF3uLKPhMv2H4GOwRT1mNx8cENFa65p5kPGLTSSs9A6kOOuHUz/rVlRVw==", + "version": "11.0.5", + "resolved": "https://registry.npmjs.org/@formio/angular/-/angular-11.0.5.tgz", + "integrity": "sha512-zUTGp4mo9BJJ2ZCKH8UOdLZbiNay2pZazuMLSO1R3yIgCY7mm+jsOwLCy9VeL92lA9rvm9nrQ4rroOCzqHUbdQ==", "license": "MIT", "dependencies": { "tslib": "^2.0.0" @@ -4090,41 +4090,148 @@ "node": ">=6.0.0" }, "peerDependencies": { - "@angular/common": "^16.0.0 || ^17.0.0", - "@angular/core": "^16.0.0 || ^17.0.0", - "@angular/elements": "^16.0.0 || ^17.0.0", - "formiojs": "^4.18.0", + "@angular/common": "^17.0.0 || ^18.0.0 || ^19.0.0 || ^20.0.0 || ^21.0.0", + "@angular/core": "^17.0.0 || ^18.0.0 || ^19.0.0 || ^20.0.0 || ^21.0.0", + "@angular/elements": "^17.0.0 || ^18.0.0 || ^19.0.0 || ^20.0.0 || ^21.0.0", + "@formio/js": "^5.0.0", "lodash": "^4.17.20", - "ngx-bootstrap": "^10.0.0 || ^11.0.0 || ^12.0.0", - "zone.js": "~0.13.0 || ~0.14.0" + "ngx-bootstrap": "^12.0.0 || ^18.0.0 || ^19.0.0 || ^20.0.0 || ^21.0.0", + "zone.js": "~0.14.0 || ~0.15.0" + }, + "peerDependenciesMeta": { + "zone.js": { + "optional": true + } } }, - "node_modules/@formio/bootstrap3": { - "version": "2.12.4-rc.1", - "resolved": "https://registry.npmjs.org/@formio/bootstrap3/-/bootstrap3-2.12.4-rc.1.tgz", - "integrity": "sha512-4B5rs+w9tAk5i+wbdw2/NrTxPqnDX7/W19tiTd9lfXnIGQmaj0ecMEVqDmOJg8pIlyU02g3c4ih6JnA/JVmUbA==", + "node_modules/@formio/bootstrap": { + "version": "4.0.4", + "resolved": "https://registry.npmjs.org/@formio/bootstrap/-/bootstrap-4.0.4.tgz", + "integrity": "sha512-2Bq11OIiXUTt9/xNVvv8eJWBikCaW7lkqnXlk2a8P/9VkSvnYr/On70n0cpvacXXBbl7igk+XwNzkXgf4Tjjcw==", + "license": "MIT" + }, + "node_modules/@formio/core": { + "version": "2.8.1", + "resolved": "https://registry.npmjs.org/@formio/core/-/core-2.8.1.tgz", + "integrity": "sha512-Ov/5P/sGCwxTaTGBvAkGZ+O2hza0lm3LGdjOkLi3pilCjklOazadz+A99z6SDtPL2hsdfsPgYw2TY/qrvfotdg==", "license": "MIT", "dependencies": { - "resize-observer-polyfill": "^1.5.1" + "browser-cookies": "^1.2.0", + "core-js": "^3.39.0", + "dayjs": "^1.11.12", + "dompurify": "^3.4.12", + "eventemitter3": "^5.0.0", + "fast-json-patch": "^3.1.1", + "fetch-ponyfill": "^7.1.0", + "inputmask": "5.0.9", + "json-logic-js": "^2.0.5", + "lodash": "^4.17.23", + "moment": "^2.29.4" } }, - "node_modules/@formio/choices.js": { - "version": "10.2.1", - "resolved": "https://registry.npmjs.org/@formio/choices.js/-/choices.js-10.2.1.tgz", - "integrity": "sha512-NCE5u7jG3XGokJP16MyAbVSUptKu/mpJYAxd4PPIoLiO/l9Do5uoOQ0MgNb9qG9qABJiOX+qNRE8q8RybY/SwQ==", + "node_modules/@formio/core/node_modules/eventemitter3": { + "version": "5.0.4", + "resolved": "https://registry.npmjs.org/eventemitter3/-/eventemitter3-5.0.4.tgz", + "integrity": "sha512-mlsTRyGaPBjPedk6Bvw+aqbsXDtoAyAzm5MO7JgU+yVRyMQ5O8bD4Kcci7BS85f93veegeCPkL8R4GLClnjLFw==", + "license": "MIT" + }, + "node_modules/@formio/core/node_modules/inputmask": { + "version": "5.0.9", + "resolved": "https://registry.npmjs.org/inputmask/-/inputmask-5.0.9.tgz", + "integrity": "sha512-s0lUfqcEbel+EQXtehXqwCJGShutgieOaIImFKC/r4reYNvX3foyrChl6LOEvaEgxEbesePIrw1Zi2jhZaDZbQ==", + "license": "MIT" + }, + "node_modules/@formio/js": { + "version": "5.5.1", + "resolved": "https://registry.npmjs.org/@formio/js/-/js-5.5.1.tgz", + "integrity": "sha512-1j4AxMTr0uPpDsBla8O9cyIKXiK49pBhdtq+p9G47mTEFvjgIqT7fxz1Ru7YVGrAGx9uokpdVTvpAeqSzrCXTA==", "license": "MIT", "dependencies": { - "deepmerge": "^4.2.2", - "fuse.js": "^6.6.2", - "redux": "^4.2.0" + "@formio/bootstrap": "^4.0.4", + "@formio/core": "^2.8.1", + "@formio/text-mask-addons": "^3.8.0-formio.4", + "@formio/vanilla-text-mask": "^5.1.1-formio.1", + "abortcontroller-polyfill": "^1.7.5", + "animation-frame-polyfill": "~1.0.3", + "autocompleter": "^8.0.4", + "bootstrap": "^5.3.3", + "browser-cookies": "^1.2.0", + "browser-md5-file": "^1.1.1", + "choices.js": "^11.0.6", + "compare-versions": "^6.1.1", + "core-js": "^3.37.1", + "dialog-polyfill": "^0.5.6", + "dom-autoscroller": "^2.3.4", + "dompurify": "^3.4.12", + "downloadjs": "^1.4.7", + "dragula": "^3.7.3", + "eventemitter3": "^5.0.1", + "fast-deep-equal": "^3.1.3", + "fast-json-patch": "^3.1.1", + "idb": "^7.1.1", + "inputmask": "^5.0.8", + "ismobilejs": "^1.1.1", + "json-logic-js": "^2.0.2", + "jstimezonedetect": "^1.0.7", + "jwt-decode": "^3.1.2", + "lodash": "^4.17.23", + "moment": "^2.29.4", + "moment-timezone": "^0.5.44", + "quill": "2.0.2", + "signature_pad": "^4.2.0", + "string-hash": "^1.1.3", + "tippy.js": "^6.3.7", + "uuid": "^9.0.0", + "vanilla-picker": "^2.12.3" } }, - "node_modules/@formio/semantic": { - "version": "2.6.1", - "resolved": "https://registry.npmjs.org/@formio/semantic/-/semantic-2.6.1.tgz", - "integrity": "sha512-obp1BT5UnzD+uYBbqmnsTfO2hGxI2A2iR/cj3P5JUFLYSBpnr3TS2ShQ7Ee5GCRRtJPu0JnljuJj+YSKLCMuhg==", + "node_modules/@formio/js/node_modules/animation-frame-polyfill": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/animation-frame-polyfill/-/animation-frame-polyfill-1.0.3.tgz", + "integrity": "sha512-yCtSH77dgrQSnGtjxTGBYyo9E3P2wWmf0B0c6tRhY/lrKOT+QLOI9RGn0OIESptOOVT3Ej8U2ax/a9pq4tgLuQ==", "license": "MIT" }, + "node_modules/@formio/js/node_modules/bootstrap": { + "version": "5.3.8", + "resolved": "https://registry.npmjs.org/bootstrap/-/bootstrap-5.3.8.tgz", + "integrity": "sha512-HP1SZDqaLDPwsNiqRqi5NcP0SSXciX2s9E+RyqJIIqGo+vJeN5AJVM98CXmW/Wux0nQ5L7jeWUdplCEf0Ee+tg==", + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/twbs" + }, + { + "type": "opencollective", + "url": "https://opencollective.com/bootstrap" + } + ], + "peerDependencies": { + "@popperjs/core": "^2.11.8" + } + }, + "node_modules/@formio/js/node_modules/eventemitter3": { + "version": "5.0.4", + "resolved": "https://registry.npmjs.org/eventemitter3/-/eventemitter3-5.0.4.tgz", + "integrity": "sha512-mlsTRyGaPBjPedk6Bvw+aqbsXDtoAyAzm5MO7JgU+yVRyMQ5O8bD4Kcci7BS85f93veegeCPkL8R4GLClnjLFw==" + }, + "node_modules/@formio/js/node_modules/jwt-decode": { + "version": "3.1.2", + "resolved": "https://registry.npmjs.org/jwt-decode/-/jwt-decode-3.1.2.tgz", + "integrity": "sha512-UfpWE/VZn0iP50d8cz9NrZLM9lSWhcJ+0Gt/nm4by88UL+J1SiKN8/5dkjMmbEzwL2CAe+67GsegCbIKtbp75A==" + }, + "node_modules/@formio/js/node_modules/uuid": { + "version": "9.0.1", + "resolved": "https://registry.npmjs.org/uuid/-/uuid-9.0.1.tgz", + "integrity": "sha512-b+1eJOlsR9K8HJpow9Ok3fiWOWSIcIzXodvv0rQjVoOVNpWMpxf1wZNpt4y9h10odCNrqnYp1OBzRktckBe3sA==", + "deprecated": "uuid@10 and below is no longer supported. For ESM codebases, update to uuid@latest. For CommonJS codebases, use uuid@11 (but be aware this version will likely be deprecated in 2028).", + "funding": [ + "https://github.com/sponsors/broofa", + "https://github.com/sponsors/ctavan" + ], + "bin": { + "uuid": "dist/bin/uuid" + } + }, "node_modules/@formio/text-mask-addons": { "version": "3.8.0-formio.4", "resolved": "https://registry.npmjs.org/@formio/text-mask-addons/-/text-mask-addons-3.8.0-formio.4.tgz", @@ -10023,9 +10130,9 @@ "license": "MIT" }, "node_modules/autocompleter": { - "version": "7.1.0", - "resolved": "https://registry.npmjs.org/autocompleter/-/autocompleter-7.1.0.tgz", - "integrity": "sha512-uCToOnq7eAD/GJAteDbYuQ7ksDtrYWOy5CIAq43wh0dT+5frMpPlyD9tp+y5fz8KIcsP+zR2MjzoTAdW5aJESw==", + "version": "8.0.4", + "resolved": "https://registry.npmjs.org/autocompleter/-/autocompleter-8.0.4.tgz", + "integrity": "sha512-q334YswwucSBphN5djVkEt3beVhHotrCtPGNIXmyilw9UnXV9Cb+gNAZ2yhZSfiBSzP6rxHLLT2gpr57xgbcwQ==", "license": "MIT" }, "node_modules/autolinker": { @@ -11002,6 +11109,26 @@ "dev": true, "license": "MIT" }, + "node_modules/choices.js": { + "version": "11.2.3", + "resolved": "https://registry.npmjs.org/choices.js/-/choices.js-11.2.3.tgz", + "integrity": "sha512-K+HA8ShsWWNOVs4ahahjIOtzsvcC/cOFGTdU1BZgMZRhGi/uCQARlFd/80B0hlVVdRIjnrsW7QLDUnpJaW6N7A==", + "dependencies": { + "fuse.js": "^7.0.0" + } + }, + "node_modules/choices.js/node_modules/fuse.js": { + "version": "7.5.0", + "resolved": "https://registry.npmjs.org/fuse.js/-/fuse.js-7.5.0.tgz", + "integrity": "sha512-sQtrEfA+ez/3G0cCZecF70oqpCRttCexYUG4mUrtWL49ULUzUyxokt5kyqwtKzj1270RaKih+hcP3qLcumccow==", + "engines": { + "node": ">=10" + }, + "funding": { + "type": "github", + "url": "https://github.com/sponsors/krisk" + } + }, "node_modules/chokidar": { "version": "4.0.3", "resolved": "https://registry.npmjs.org/chokidar/-/chokidar-4.0.3.tgz", @@ -11663,9 +11790,9 @@ "license": "MIT" }, "node_modules/compare-versions": { - "version": "5.0.3", - "resolved": "https://registry.npmjs.org/compare-versions/-/compare-versions-5.0.3.tgz", - "integrity": "sha512-4UZlZP8Z99MGEY+Ovg/uJxJuvoXuN4M6B3hKaiackiHrgzQFEe3diJi1mf1PNHbFujM7FvLrK2bpgIaImbtZ1A==", + "version": "6.1.1", + "resolved": "https://registry.npmjs.org/compare-versions/-/compare-versions-6.1.1.tgz", + "integrity": "sha512-4hm4VPpIecmlg59CHXnRDnqGplJFrbLG4aFEl5vl6cK1u76ws3LLvX7ikFnTDl5vo39sjWD6AaDPYodJp/NNHg==", "license": "MIT" }, "node_modules/component-event": { @@ -12149,12 +12276,6 @@ "integrity": "sha512-GAj5FOq0Hd+RsCGVJxZuKaIDXDf3h6GQoNEjFgbLLI/trgtavwUbSnZ5pVfg27DVCaWjIohryS0JFwIJyT2cMg==", "license": "MIT" }, - "node_modules/custom-event-polyfill": { - "version": "1.0.7", - "resolved": "https://registry.npmjs.org/custom-event-polyfill/-/custom-event-polyfill-1.0.7.tgz", - "integrity": "sha512-TDDkd5DkaZxZFM8p+1I3yAlvM3rSr1wbrOliG4yJiwinMZN8z/iGL7BTlDkrJcYTmgUSb4ywVCc3ZaUtOtC76w==", - "license": "MIT" - }, "node_modules/d3": { "version": "7.9.0", "resolved": "https://registry.npmjs.org/d3/-/d3-7.9.0.tgz", @@ -12707,6 +12828,12 @@ "node": ">=4.0" } }, + "node_modules/dayjs": { + "version": "1.11.21", + "resolved": "https://registry.npmjs.org/dayjs/-/dayjs-1.11.21.tgz", + "integrity": "sha512-98IT+HOahAisibz/yjKbzuOBwYcjJ7BCLPzARyHiyEBmRz4fatF+KPJszEHXsGYjUG234aH/cOjW1wwTbKUZlA==", + "license": "MIT" + }, "node_modules/debounce": { "version": "1.2.1", "resolved": "https://registry.npmjs.org/debounce/-/debounce-1.2.1.tgz", @@ -15057,6 +15184,7 @@ "version": "4.0.7", "resolved": "https://registry.npmjs.org/eventemitter3/-/eventemitter3-4.0.7.tgz", "integrity": "sha512-8guHBZCwKnFhYdHr2ysuRWErTwhoN2X8XELRlrRwpmfeY2jjuUN4taQMsULKUVo1K4DvZl+0pgfyoysHxvmvEw==", + "dev": true, "license": "MIT" }, "node_modules/events": { @@ -15729,71 +15857,6 @@ "node": ">=0.4.x" } }, - "node_modules/formiojs": { - "version": "4.19.5", - "resolved": "https://registry.npmjs.org/formiojs/-/formiojs-4.19.5.tgz", - "integrity": "sha512-jkFothZR+Fz85br6gzneHhOXf4MZJYyheBtDL3k9NdjOaPhRsfyQZuGaWtvoMCYvZNYWcERoD6UtUwEdyMMY1w==", - "license": "MIT", - "dependencies": { - "@formio/bootstrap3": "2.12.4-rc.1", - "@formio/choices.js": "10.2.1", - "@formio/semantic": "2.6.1", - "@formio/text-mask-addons": "^3.8.0-formio.2", - "@formio/vanilla-text-mask": "^5.1.1-formio.1", - "abortcontroller-polyfill": "^1.7.5", - "autocompleter": "^7.0.1", - "browser-cookies": "^1.2.0", - "browser-md5-file": "^1.1.1", - "compare-versions": "^5.0.1", - "core-js": "^3.26.1", - "custom-event-polyfill": "^1.0.7", - "dialog-polyfill": "^0.5.6", - "dom-autoscroller": "^2.3.4", - "dompurify": "^3.0.5", - "downloadjs": "^1.4.7", - "dragula": "^3.7.3", - "eventemitter3": "^4.0.7", - "fast-deep-equal": "^3.1.3", - "fast-json-patch": "^3.1.1", - "fetch-ponyfill": "^7.1.0", - "i18next": "22.4.12", - "idb": "^7.1.1", - "ismobilejs": "^1.1.1", - "json-logic-js": "^2.0.2", - "jstimezonedetect": "^1.0.7", - "jwt-decode": "^3.1.2", - "lodash": "^4.17.21", - "moment": "^2.29.4", - "moment-timezone": "^0.5.40", - "native-promise-only": "^0.8.1", - "quill": "^2.0.0-dev.3", - "signature_pad": "^4.1.4", - "string-hash": "^1.1.3", - "tippy.js": "^6.3.7", - "uuid": "^9.0.0", - "vanilla-picker": "^2.12.1" - } - }, - "node_modules/formiojs/node_modules/jwt-decode": { - "version": "3.1.2", - "resolved": "https://registry.npmjs.org/jwt-decode/-/jwt-decode-3.1.2.tgz", - "integrity": "sha512-UfpWE/VZn0iP50d8cz9NrZLM9lSWhcJ+0Gt/nm4by88UL+J1SiKN8/5dkjMmbEzwL2CAe+67GsegCbIKtbp75A==", - "license": "MIT" - }, - "node_modules/formiojs/node_modules/uuid": { - "version": "9.0.1", - "resolved": "https://registry.npmjs.org/uuid/-/uuid-9.0.1.tgz", - "integrity": "sha512-b+1eJOlsR9K8HJpow9Ok3fiWOWSIcIzXodvv0rQjVoOVNpWMpxf1wZNpt4y9h10odCNrqnYp1OBzRktckBe3sA==", - "deprecated": "uuid@10 and below is no longer supported. For ESM codebases, update to uuid@latest. For CommonJS codebases, use uuid@11 (but be aware this version will likely be deprecated in 2028).", - "funding": [ - "https://github.com/sponsors/broofa", - "https://github.com/sponsors/ctavan" - ], - "license": "MIT", - "bin": { - "uuid": "dist/bin/uuid" - } - }, "node_modules/forwarded": { "version": "0.2.0", "resolved": "https://registry.npmjs.org/forwarded/-/forwarded-0.2.0.tgz", @@ -15921,15 +15984,6 @@ "url": "https://github.com/sponsors/ljharb" } }, - "node_modules/fuse.js": { - "version": "6.6.2", - "resolved": "https://registry.npmjs.org/fuse.js/-/fuse.js-6.6.2.tgz", - "integrity": "sha512-cJaJkxCCxC8qIIcPBF9yGxY0W/tVZS3uEISDxhYIdtk8OL93pe+6Zj7LjCqVV4dzbqcriOZ+kQ/NE4RXZHsIGA==", - "license": "Apache-2.0", - "engines": { - "node": ">=10" - } - }, "node_modules/generator-function": { "version": "2.0.1", "resolved": "https://registry.npmjs.org/generator-function/-/generator-function-2.0.1.tgz", @@ -16653,29 +16707,6 @@ "node": ">=10.18" } }, - "node_modules/i18next": { - "version": "22.4.12", - "resolved": "https://registry.npmjs.org/i18next/-/i18next-22.4.12.tgz", - "integrity": "sha512-2lE+vRXxQ3lGLub1CVbwgO0IfkLHmUSDVOAVdPh22CsxttMXi+35n2qgxh2wZIkKl6t/NMzPfgFPRDiFQOmiCg==", - "funding": [ - { - "type": "individual", - "url": "https://locize.com" - }, - { - "type": "individual", - "url": "https://locize.com/i18next.html" - }, - { - "type": "individual", - "url": "https://www.i18next.com/how-to/faq#i18next-is-awesome.-how-can-i-support-the-project" - } - ], - "license": "MIT", - "dependencies": { - "@babel/runtime": "^7.20.6" - } - }, "node_modules/iconv-lite": { "version": "0.7.3", "resolved": "https://registry.npmjs.org/iconv-lite/-/iconv-lite-0.7.3.tgz", @@ -16885,6 +16916,12 @@ "tslib": "^2.0.0" } }, + "node_modules/inputmask": { + "version": "5.0.10", + "resolved": "https://registry.npmjs.org/inputmask/-/inputmask-5.0.10.tgz", + "integrity": "sha512-WksYiOYQb9cYLxbpyZsoxWZXQAlRmA/gTj4t0TOgeaEpSxuQKMK+64mKrZtsFA0OYtwlhd+tR7oMp7jRKQAakg==", + "license": "MIT" + }, "node_modules/internal-slot": { "version": "1.1.0", "resolved": "https://registry.npmjs.org/internal-slot/-/internal-slot-1.1.0.tgz", @@ -19763,12 +19800,6 @@ "integrity": "sha512-NzOgmMQ+elxxHeIha+OG/Pv3Oc3p4RU2aBhwWwAqDpXrdTbtRylbRLQztLy8dMMwfl6pclznBdfUhccEn9ZIzw==", "license": "MIT" }, - "node_modules/native-promise-only": { - "version": "0.8.1", - "resolved": "https://registry.npmjs.org/native-promise-only/-/native-promise-only-0.8.1.tgz", - "integrity": "sha512-zkVhZUA3y8mbz652WrL5x0fB0ehrBkulWT3TomAQ9iDtyXZvzKeEA6GPxAItBYeNYl5yngKRX612qHOhvMkDeg==", - "license": "MIT" - }, "node_modules/natural-compare": { "version": "1.4.0", "resolved": "https://registry.npmjs.org/natural-compare/-/natural-compare-1.4.0.tgz", @@ -22704,9 +22735,9 @@ "license": "ISC" }, "node_modules/quill": { - "version": "2.0.3", - "resolved": "https://registry.npmjs.org/quill/-/quill-2.0.3.tgz", - "integrity": "sha512-xEYQBqfYx/sfb33VJiKnSJp8ehloavImQ2A6564GAbqG55PGw1dAWUn1MUbQB62t0azawUS2CZZhWCjO8gRvTw==", + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/quill/-/quill-2.0.2.tgz", + "integrity": "sha512-QfazNrhMakEdRG57IoYFwffUIr04LWJxbS/ZkidRFXYCQt63c1gK6Z7IHUXMx/Vh25WgPBU42oBaNzQ0K1R/xw==", "license": "BSD-3-Clause", "dependencies": { "eventemitter3": "^5.0.1", @@ -23024,15 +23055,6 @@ "url": "https://paulmillr.com/funding/" } }, - "node_modules/redux": { - "version": "4.2.1", - "resolved": "https://registry.npmjs.org/redux/-/redux-4.2.1.tgz", - "integrity": "sha512-LAUYz4lc+Do8/g7aeRa8JkyDErK6ekstQaqWQrNRW//MY1TvCEpMtpTWvlQ+FPbWCx+Xixu/6SHt5N0HR+SB4w==", - "license": "MIT", - "dependencies": { - "@babel/runtime": "^7.9.2" - } - }, "node_modules/redux-immutable": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/redux-immutable/-/redux-immutable-4.0.0.tgz", @@ -23259,12 +23281,6 @@ "integrity": "sha512-AgZ3UOZm3YndfrJ4OYjgrT7bmCm/1iqkjvEfH/oYjzh6PD2qw4QuT3jjnXIrpdt4MTpMXclMT3lXbmRY+XRakw==", "license": "MIT" }, - "node_modules/resize-observer-polyfill": { - "version": "1.5.1", - "resolved": "https://registry.npmjs.org/resize-observer-polyfill/-/resize-observer-polyfill-1.5.1.tgz", - "integrity": "sha512-LwZrotdHOo12nQuZlHEmtuXdqGoOD0OhaxopaNFxWzInpEgaLWoVuAMbTzixuosCx2nEG58ngzW3vxdWoxIgdg==", - "license": "MIT" - }, "node_modules/resolve": { "version": "1.22.10", "resolved": "https://registry.npmjs.org/resolve/-/resolve-1.22.10.tgz", @@ -28102,7 +28118,8 @@ "@carbon/styles": "1.80.0", "@carbon/themes": "11.51.0", "@floating-ui/dom": "1.7.4", - "@formio/angular": "7.0.0", + "@formio/angular": "11.0.5", + "@formio/js": "5.5.1", "@foxythemes/bootstrap-datetime-picker-bs4": "2.3.5", "@mdi/font": "7.4.47", "@ng-bootstrap/ng-bootstrap": "11.0.1", @@ -28116,7 +28133,6 @@ "carbon-components-angular": "5.57.6", "deepmerge-ts": "7.1.5", "flatpickr": "4.6.13", - "formiojs": "4.19.5", "heatmap.js-fixed": "2.0.2", "jquery": "3.7.1", "jwt-decode": "4.0.0", @@ -28238,8 +28254,8 @@ "version": "13.0.1", "license": "EUPL-1.2", "dependencies": { - "@formio/angular": "7.0.0", - "formiojs": "4.19.5" + "@formio/angular": "11.0.5", + "@formio/js": "5.5.1" }, "peerDependencies": { "@angular/common": "19.2.25", diff --git a/frontend/package.json b/frontend/package.json index 4b9d5ed5c5..2a42e17f89 100644 --- a/frontend/package.json +++ b/frontend/package.json @@ -233,7 +233,7 @@ "@carbon/styles": "1.80.0", "@carbon/themes": "11.51.0", "@floating-ui/dom": "1.7.4", - "@formio/angular": "7.0.0", + "@formio/angular": "11.0.5", "@foxythemes/bootstrap-datetime-picker-bs4": "2.3.5", "@mdi/font": "7.4.47", "@ng-bootstrap/ng-bootstrap": "11.0.1", @@ -263,7 +263,7 @@ "dmn-js": "17.2.0", "dropzone": "6.0.0-beta.2", "flatpickr": "4.6.13", - "formiojs": "4.19.5", + "@formio/js": "5.5.1", "hammerjs": "2.0.8", "heatmap.js-fixed": "2.0.2", "ids": "3.0.1", diff --git a/frontend/projects/valtimo/components/ng-package.json b/frontend/projects/valtimo/components/ng-package.json index 780ecbd5b1..fa1c965ce5 100644 --- a/frontend/projects/valtimo/components/ng-package.json +++ b/frontend/projects/valtimo/components/ng-package.json @@ -31,7 +31,7 @@ "flatpickr", "lodash", "jwt-decode", - "formiojs", + "@formio/js", "deepmerge-ts", "@carbon/charts-angular", "@types/topojson", diff --git a/frontend/projects/valtimo/components/package.json b/frontend/projects/valtimo/components/package.json index cb4fe50342..b7592f4432 100644 --- a/frontend/projects/valtimo/components/package.json +++ b/frontend/projects/valtimo/components/package.json @@ -16,8 +16,8 @@ "@ngx-translate/core": "16.0.4", "@ngx-translate/http-loader": "16.0.1", "@ng-bootstrap/ng-bootstrap": "11.0.1", - "@formio/angular": "7.0.0", - "formiojs": "4.19.5", + "@formio/angular": "11.0.5", + "@formio/js": "5.5.1", "monaco-editor": "0.50.0", "ngx-spinner": "19.0.0", "tslib": "2.8.1", diff --git a/frontend/projects/valtimo/components/src/lib/components/form-io/components/form-io-builder/form-io-builder.component.ts b/frontend/projects/valtimo/components/src/lib/components/form-io/components/form-io-builder/form-io-builder.component.ts index 06d00b430f..ecbc979b91 100644 --- a/frontend/projects/valtimo/components/src/lib/components/form-io/components/form-io-builder/form-io-builder.component.ts +++ b/frontend/projects/valtimo/components/src/lib/components/form-io/components/form-io-builder/form-io-builder.component.ts @@ -15,17 +15,16 @@ */ import {Component, EventEmitter, Injector, Input, OnInit, Output} from '@angular/core'; -import {Components} from 'formiojs'; +import {Components} from '@formio/js'; import {distinctUntilChanged, map, switchMap, tap} from 'rxjs/operators'; import {TranslateService} from '@ngx-translate/core'; -import {FormioOptions} from '@formio/angular/'; import {FormIoStateService} from '../../services/form-io-state.service'; import {BehaviorSubject, combineLatest, Observable, startWith} from 'rxjs'; import { addValueResolverSelectorToEditform, modifyEditFormApiKeyInput, } from './form-io-builder.utils'; -import {FormioContextParams, ValtimoFormioOptions} from '../../../../models'; +import {FormioContextParams, FormioOptions, ValtimoFormioOptions} from '../../../../models'; import {deepmerge} from 'deepmerge-ts'; import {isEqual} from 'lodash'; import { diff --git a/frontend/projects/valtimo/components/src/lib/components/form-io/components/form-io-currency/currency-edit-form.ts b/frontend/projects/valtimo/components/src/lib/components/form-io/components/form-io-currency/currency-edit-form.ts index 6219a3a8f2..17b2669b17 100644 --- a/frontend/projects/valtimo/components/src/lib/components/form-io/components/form-io-currency/currency-edit-form.ts +++ b/frontend/projects/valtimo/components/src/lib/components/form-io/components/form-io-currency/currency-edit-form.ts @@ -14,7 +14,7 @@ * limitations under the License. */ -import {Components} from 'formiojs'; +import {Components} from '@formio/js'; const TextFieldEditForm = Components.components.textfield.editForm; diff --git a/frontend/projects/valtimo/components/src/lib/components/form-io/components/form-io-current-user/form-io-current-user-edit-form.ts b/frontend/projects/valtimo/components/src/lib/components/form-io/components/form-io-current-user/form-io-current-user-edit-form.ts index 74207471aa..1f6461c931 100644 --- a/frontend/projects/valtimo/components/src/lib/components/form-io/components/form-io-current-user/form-io-current-user-edit-form.ts +++ b/frontend/projects/valtimo/components/src/lib/components/form-io/components/form-io-current-user/form-io-current-user-edit-form.ts @@ -14,53 +14,11 @@ * limitations under the License. */ -export const formIoCurrentUserEditForm = () => ({ - components: [ - { - key: 'type', - type: 'hidden', - }, - { - key: 'label', - type: 'textfield', - input: true, - label: 'Label', - placeholder: 'Label', - defaultValue: 'Valtimo Current User', - validate: { - required: true, - }, - }, - { - key: 'key', - type: 'textfield', - input: true, - label: 'Property Name', - placeholder: 'Property Name', - tooltip: 'The name of this field in the API endpoint.', - validate: { - required: true, - }, - }, - { - key: 'tableView', - type: 'checkbox', - label: 'Table View', - tooltip: 'If checked, this value will show up in the table view of the submissions list.', - }, - { - key: 'hideLabel', - type: 'checkbox', - label: 'Hide Label', - tooltip: - 'Hide the label of this component. This setting will display the label in the form builder, but hide the label when the form is rendered.', - }, - { - key: 'hidden', - type: 'checkbox', - label: 'Hidden', - tooltip: - 'A hidden field is still a part of the form JSON, but is hidden when viewing the form is rendererd.', - }, - ], -}); +import {Components} from '@formio/js'; + +const TextfieldEditForm = Components.components.textfield.editForm; + +export const formIoCurrentUserEditForm = () => { + const editForm = TextfieldEditForm(); + return editForm; +}; diff --git a/frontend/projects/valtimo/components/src/lib/components/form-io/components/form-io-resource-selector/form-io-resource-selector.formio.ts b/frontend/projects/valtimo/components/src/lib/components/form-io/components/form-io-resource-selector/form-io-resource-selector.formio.ts index e9da99df90..271aa2fd4c 100644 --- a/frontend/projects/valtimo/components/src/lib/components/form-io/components/form-io-resource-selector/form-io-resource-selector.formio.ts +++ b/frontend/projects/valtimo/components/src/lib/components/form-io/components/form-io-resource-selector/form-io-resource-selector.formio.ts @@ -15,7 +15,7 @@ */ import {Injector} from '@angular/core'; -import {Components, Formio} from 'formiojs'; +import {Components, Formio} from '@formio/js'; import {UploadProviderService} from '@valtimo/resource'; import {FormIoStateService} from '../../services/form-io-state.service'; import {take} from 'rxjs/operators'; diff --git a/frontend/projects/valtimo/components/src/lib/components/form-io/components/form-io-uploader/form-io-uploader-edit-form.ts b/frontend/projects/valtimo/components/src/lib/components/form-io/components/form-io-uploader/form-io-uploader-edit-form.ts index d19947fca7..9013302c85 100644 --- a/frontend/projects/valtimo/components/src/lib/components/form-io/components/form-io-uploader/form-io-uploader-edit-form.ts +++ b/frontend/projects/valtimo/components/src/lib/components/form-io/components/form-io-uploader/form-io-uploader-edit-form.ts @@ -14,7 +14,7 @@ * limitations under the License. */ -import {Components} from 'formiojs'; +import {Components} from '@formio/js'; const TextFieldEditForm = Components.components.textfield.editForm; diff --git a/frontend/projects/valtimo/components/src/lib/components/form-io/components/form-io/form-io.component.ts b/frontend/projects/valtimo/components/src/lib/components/form-io/components/form-io/form-io.component.ts index 6fc090a56a..ed1b05da93 100644 --- a/frontend/projects/valtimo/components/src/lib/components/form-io/components/form-io/form-io.component.ts +++ b/frontend/projects/valtimo/components/src/lib/components/form-io/components/form-io/form-io.component.ts @@ -26,13 +26,12 @@ import { Output, SimpleChanges, } from '@angular/core'; -import {ValtimoFormioOptions} from '../../../../models'; +import {FormioOptions, ValtimoFormioOptions} from '../../../../models'; import {ValtimoModalService} from '../../../../services'; import {UserProviderService} from '@valtimo/security'; import { FormioComponent as FormIoSourceComponent, FormioForm, - FormioOptions, FormioRefreshValue, FormioSubmission, } from '@formio/angular'; @@ -45,7 +44,7 @@ import {TranslateService} from '@ngx-translate/core'; import {deepmerge} from 'deepmerge-ts'; import {ConfigService, ValtimoConfig} from '@valtimo/shared'; import {isEqual} from 'lodash'; -import {Formio} from 'formiojs'; +import {Formio} from '@formio/js'; import { FormIoLocalStorageService, FormIoStateService, @@ -91,7 +90,12 @@ export class FormioComponent implements OnInit, OnChanges, OnDestroy { public refreshForm = new EventEmitter(); - public readonly submission$ = new BehaviorSubject({}); + // Annotated explicitly: FormioSubmission defaults its second type parameter to + // FormioSubmissionState, which @formio/angular declares but does not export. An + // inferred type here resolves that default and fails declaration emit with TS4029. + public readonly submission$: BehaviorSubject = new BehaviorSubject( + {} + ); private readonly _form$ = new BehaviorSubject(undefined); diff --git a/frontend/projects/valtimo/components/src/lib/components/form-io/components/formio-value-resolver-selector/formio-value-resolver-selector-edit-form.ts b/frontend/projects/valtimo/components/src/lib/components/form-io/components/formio-value-resolver-selector/formio-value-resolver-selector-edit-form.ts index 382a1e3edc..8cde29d394 100644 --- a/frontend/projects/valtimo/components/src/lib/components/form-io/components/formio-value-resolver-selector/formio-value-resolver-selector-edit-form.ts +++ b/frontend/projects/valtimo/components/src/lib/components/form-io/components/formio-value-resolver-selector/formio-value-resolver-selector-edit-form.ts @@ -14,6 +14,11 @@ * limitations under the License. */ -export const formioValueResolverSelectorEditForm = () => ({ - components: [{key: 'type', type: 'hidden'}], -}); +import {Components} from '@formio/js'; + +const TextfieldEditForm = Components.components.textfield.editForm; + +export const formioValueResolverSelectorEditForm = () => { + const editForm = TextfieldEditForm(); + return editForm; +}; diff --git a/frontend/projects/valtimo/components/src/lib/components/form-io/components/formio-value-resolver-selector/formio-value-resolver-selector.component.ts b/frontend/projects/valtimo/components/src/lib/components/form-io/components/formio-value-resolver-selector/formio-value-resolver-selector.component.ts index 8259910c97..8203de34cd 100644 --- a/frontend/projects/valtimo/components/src/lib/components/form-io/components/formio-value-resolver-selector/formio-value-resolver-selector.component.ts +++ b/frontend/projects/valtimo/components/src/lib/components/form-io/components/formio-value-resolver-selector/formio-value-resolver-selector.component.ts @@ -1,5 +1,5 @@ /* - * Copyright 2015-2025 Ritense BV, the Netherlands. + * Copyright 2015-2026 Ritense BV, the Netherlands. * * Licensed under EUPL, Version 1.2 (the "License"); * you may not use this file except in compliance with the License. diff --git a/frontend/projects/valtimo/components/src/lib/components/form-io/form-io.module.ts b/frontend/projects/valtimo/components/src/lib/components/form-io/form-io.module.ts index 54a5817286..57d6e1140d 100644 --- a/frontend/projects/valtimo/components/src/lib/components/form-io/form-io.module.ts +++ b/frontend/projects/valtimo/components/src/lib/components/form-io/form-io.module.ts @@ -18,7 +18,7 @@ import {NgModule} from '@angular/core'; import {CommonModule} from '@angular/common'; import {FormioComponent} from './components/form-io/form-io.component'; import {FormioBuilderComponent} from './components/form-io-builder/form-io-builder.component'; -import {FormioAppConfig, FormioModule} from '@formio/angular'; +import {Formio, FormioAppConfig, FormioModule} from '@formio/angular'; import {getFormioAppConfig} from './formio-config'; import {FormIoUploaderComponent} from './components/form-io-uploader/form-io-uploader.component'; import {DropzoneModule} from '../dropzone/dropzone.module'; @@ -35,6 +35,7 @@ import {FormioValueResolverSelectorComponent} from './components/formio-value-re import {FormioDummyComponent} from './components/form-io-dummy/dummy.component'; import {LayerModule} from 'carbon-components-angular'; import {FormIoCurrencyComponent} from './components/form-io-currency/currency.component'; +import bootstrap4 from '@formio/bootstrap/bootstrap4'; import {applyDataGridPatch} from './patches/patched-datagrid'; import {registerFormioFlatpickr, setFormioFlatpickrLocale} from './formio-flatpickr'; @@ -83,8 +84,9 @@ applyDataGridPatch(); }) export class FormIoModule { constructor(private translateService: TranslateService) { + Formio.use((bootstrap4 as any)?.default ?? bootstrap4); registerFormioFlatpickr(); - setFormioFlatpickrLocale((this.translateService.currentLang)) + setFormioFlatpickrLocale(this.translateService.currentLang); this.translateService.onLangChange.subscribe(({lang}) => setFormioFlatpickrLocale(lang)); } } diff --git a/frontend/projects/valtimo/components/src/lib/components/form-io/formio-flatpickr.ts b/frontend/projects/valtimo/components/src/lib/components/form-io/formio-flatpickr.ts index 93aad161c8..e5fccc1dd1 100644 --- a/frontend/projects/valtimo/components/src/lib/components/form-io/formio-flatpickr.ts +++ b/frontend/projects/valtimo/components/src/lib/components/form-io/formio-flatpickr.ts @@ -16,7 +16,7 @@ import flatpickr from 'flatpickr'; import {Dutch} from 'flatpickr/dist/l10n/nl'; -import {Formio} from 'formiojs'; +import {Formio} from '@formio/js'; /** * Formio only set the language on the first load. diff --git a/frontend/projects/valtimo/components/src/lib/components/form-io/patches/patched-datagrid.ts b/frontend/projects/valtimo/components/src/lib/components/form-io/patches/patched-datagrid.ts index c6e28b8a7b..d78de57f8a 100644 --- a/frontend/projects/valtimo/components/src/lib/components/form-io/patches/patched-datagrid.ts +++ b/frontend/projects/valtimo/components/src/lib/components/form-io/patches/patched-datagrid.ts @@ -14,7 +14,7 @@ * limitations under the License. */ -import {Components} from 'formiojs'; +import {Components} from '@formio/js'; const BuiltInDataGrid = (Components as any).components['datagrid']; diff --git a/frontend/projects/valtimo/components/src/lib/models/form-io.model.ts b/frontend/projects/valtimo/components/src/lib/models/form-io.model.ts index 0fa177e082..9406f4cdcd 100644 --- a/frontend/projects/valtimo/components/src/lib/models/form-io.model.ts +++ b/frontend/projects/valtimo/components/src/lib/models/form-io.model.ts @@ -19,10 +19,21 @@ import { ErrorsOptions, FormioBeforeSubmit, FormioHookOptions, - FormioOptions, + AngularFormioOptions, } from '@formio/angular'; import {ManagementContext} from '@valtimo/shared'; +interface FormioOptions extends AngularFormioOptions { + language?: string; + i18n?: object; + fileService?: object; + hooks?: FormioHookOptions; + readonly?: boolean; + decimalSeparator?: string; + thousandsSeparator?: string; + [key: string]: any; +} + interface FormioSubmission { data: { [key: string]: any; @@ -170,6 +181,7 @@ export { AlertsOptionsImpl, FormioOptionsImpl, ValtimoFormioOptions, + FormioOptions, ValidateOptions, BuilderInfo, ComponentSchema, diff --git a/frontend/projects/valtimo/components/src/lib/modules/custom-formio-component/create-custom-component.ts b/frontend/projects/valtimo/components/src/lib/modules/custom-formio-component/create-custom-component.ts index f1f0ce8a25..221563f148 100644 --- a/frontend/projects/valtimo/components/src/lib/modules/custom-formio-component/create-custom-component.ts +++ b/frontend/projects/valtimo/components/src/lib/modules/custom-formio-component/create-custom-component.ts @@ -14,7 +14,8 @@ * limitations under the License. */ -import {Components, Utils as FormioUtils} from 'formiojs'; +import {Components} from '@formio/js'; +import {getRandomComponentId} from '@formio/js/utils'; import {FormioCustomComponentInfo, FormioCustomElement, FormioEvent} from './elements.common'; import {clone, isArray, isNil} from 'lodash'; import {BuilderInfo, ExtendedComponentSchema} from '../../models'; @@ -26,7 +27,7 @@ export function createCustomFormioComponent(customComponentOptions: FormioCustom return class CustomComponent extends BaseInputComponent { public static readonly editForm = customComponentOptions.editForm || TextfieldComponent.editForm; - public readonly id = FormioUtils.getRandomComponentId(); + public readonly id = getRandomComponentId(); public readonly type = customComponentOptions.type; _customAngularElement!: FormioCustomElement; diff --git a/frontend/projects/valtimo/components/src/lib/modules/custom-formio-component/register-custom-component.ts b/frontend/projects/valtimo/components/src/lib/modules/custom-formio-component/register-custom-component.ts index 0944675f39..5052a80076 100644 --- a/frontend/projects/valtimo/components/src/lib/modules/custom-formio-component/register-custom-component.ts +++ b/frontend/projects/valtimo/components/src/lib/modules/custom-formio-component/register-custom-component.ts @@ -16,7 +16,7 @@ import {Injector, Type} from '@angular/core'; import {createCustomElement} from '@angular/elements'; -import {Components} from 'formiojs'; +import {Components} from '@formio/js'; import {FormioCustomComponentInfo} from './elements.common'; import {createCustomFormioComponent} from './create-custom-component'; import {CustomTagsService} from '@formio/angular'; diff --git a/frontend/projects/valtimo/form-view-model/ng-package.json b/frontend/projects/valtimo/form-view-model/ng-package.json index 7895125cd0..8dbd3ccc87 100644 --- a/frontend/projects/valtimo/form-view-model/ng-package.json +++ b/frontend/projects/valtimo/form-view-model/ng-package.json @@ -5,5 +5,5 @@ "lib": { "entryFile": "src/public_api.ts" }, - "allowedNonPeerDependencies": ["formiojs", "@formio/angular"] + "allowedNonPeerDependencies": ["@formio/js", "@formio/angular"] } diff --git a/frontend/projects/valtimo/form-view-model/package.json b/frontend/projects/valtimo/form-view-model/package.json index 3d9eb57d1d..9241a42137 100644 --- a/frontend/projects/valtimo/form-view-model/package.json +++ b/frontend/projects/valtimo/form-view-model/package.json @@ -7,7 +7,7 @@ "@angular/core": "19.2.25" }, "dependencies": { - "@formio/angular": "7.0.0", - "formiojs": "4.19.5" + "@formio/angular": "11.0.5", + "@formio/js": "5.5.1" } } diff --git a/frontend/projects/valtimo/form-view-model/src/lib/components/form-view-model/form-view-model.component.ts b/frontend/projects/valtimo/form-view-model/src/lib/components/form-view-model/form-view-model.component.ts index e620e50d22..07a799e996 100644 --- a/frontend/projects/valtimo/form-view-model/src/lib/components/form-view-model/form-view-model.component.ts +++ b/frontend/projects/valtimo/form-view-model/src/lib/components/form-view-model/form-view-model.component.ts @@ -31,14 +31,13 @@ import { import { FormioComponent, FormioModule, - FormioOptions, FormioSubmission, FormioSubmissionCallback, } from '@formio/angular'; import {ViewModelService} from '../../services'; import {distinctUntilChanged, map} from 'rxjs/operators'; import {deepmerge} from 'deepmerge-ts'; -import {FormIoStateService, ValtimoFormioOptions} from '@valtimo/components'; +import {FormIoStateService, ValtimoFormioOptions, FormioOptions} from '@valtimo/components'; import {TranslateService} from '@ngx-translate/core'; import {HttpErrorResponse} from '@angular/common/http'; import {CommonModule} from '@angular/common'; diff --git a/frontend/projects/valtimo/zgw/src/lib/modules/documenten-api/formio/documenten-api-uploader/documenten-api-uploader-edit-form.ts b/frontend/projects/valtimo/zgw/src/lib/modules/documenten-api/formio/documenten-api-uploader/documenten-api-uploader-edit-form.ts index bfb970461d..18cb8982d8 100644 --- a/frontend/projects/valtimo/zgw/src/lib/modules/documenten-api/formio/documenten-api-uploader/documenten-api-uploader-edit-form.ts +++ b/frontend/projects/valtimo/zgw/src/lib/modules/documenten-api/formio/documenten-api-uploader/documenten-api-uploader-edit-form.ts @@ -14,40 +14,14 @@ * limitations under the License. */ -export const documentenApiUploaderEditForm = () => ({ - components: [ - {key: 'type', type: 'hidden'}, - { - type: 'textfield', - input: true, - key: 'label', - label: 'Label', - placeholder: 'Label', - validate: { - required: true, - }, - }, - { - type: 'checkbox', - input: true, - inputType: 'checkbox', - key: 'validate.required', - label: 'Required', - validate: { - required: false, - }, - }, - { - type: 'textfield', - input: true, - key: 'key', - label: 'Property Name', - placeholder: 'Property Name', - tooltip: 'The name of this field in the API endpoint.', - validate: { - required: true, - }, - }, +import {Components} from '@formio/js'; + +const TextfieldEditForm = Components.components.textfield.editForm; + +export const documentenApiUploaderEditForm = () => { + const editForm = TextfieldEditForm(); + + const customComponents = [ { type: 'textfield', input: true, @@ -55,6 +29,7 @@ export const documentenApiUploaderEditForm = () => ({ label: 'Title', placeholder: 'Title', tooltip: 'Leave empty to use the default title', + weight: 10, validate: { required: false, }, @@ -65,6 +40,7 @@ export const documentenApiUploaderEditForm = () => ({ inputType: 'checkbox', key: 'customOptions.hideTitle', label: 'Hide title', + weight: 11, validate: { required: false, }, @@ -76,6 +52,7 @@ export const documentenApiUploaderEditForm = () => ({ label: 'Subtitle', placeholder: 'Title', tooltip: 'Leave empty to hide subtitle', + weight: 12, validate: { required: false, }, @@ -87,6 +64,7 @@ export const documentenApiUploaderEditForm = () => ({ label: 'Maximum file size', placeholder: 'Maximum file size', defaultValue: 5, + weight: 13, validate: { required: true, }, @@ -97,6 +75,7 @@ export const documentenApiUploaderEditForm = () => ({ inputType: 'checkbox', key: 'customOptions.hideMaxFileSize', label: 'Hide maximum file size', + weight: 14, validate: { required: false, }, @@ -119,6 +98,7 @@ export const documentenApiUploaderEditForm = () => ({ inputType: 'checkbox', key: 'customOptions.camera', label: 'Allow camera uploads', + weight: 15, validate: { required: false, }, @@ -130,6 +110,7 @@ export const documentenApiUploaderEditForm = () => ({ key: 'disabled', label: 'Disabled', tooltip: 'Disable the upload field', + weight: 16, validate: { required: false, }, @@ -141,6 +122,7 @@ export const documentenApiUploaderEditForm = () => ({ label: 'Accepted file types (leave blank for no restrictions)', placeholder: '.png, .docx, .pdf', defaultValue: '', + weight: 17, }, { type: 'checkbox', @@ -148,6 +130,7 @@ export const documentenApiUploaderEditForm = () => ({ inputType: 'checkbox', key: 'customOptions.hideAcceptedFiles', label: 'Hide accepted file types', + weight: 18, validate: { required: false, }, @@ -160,6 +143,7 @@ export const documentenApiUploaderEditForm = () => ({ type: 'htmlelement', input: false, tableView: false, + weight: 19, }, { type: 'textfield', @@ -168,6 +152,7 @@ export const documentenApiUploaderEditForm = () => ({ label: 'Document URL', tooltip: "Specify the process variable name where the Documenten API document URL will be stored. Defaults to 'documentUrl' if left empty.", + weight: 20, validate: { required: false, }, @@ -180,6 +165,7 @@ export const documentenApiUploaderEditForm = () => ({ type: 'htmlelement', input: false, tableView: false, + weight: 21, }, { label: 'HTML', @@ -189,6 +175,7 @@ export const documentenApiUploaderEditForm = () => ({ type: 'htmlelement', input: false, tableView: false, + weight: 22, }, { type: 'textfield', @@ -196,6 +183,7 @@ export const documentenApiUploaderEditForm = () => ({ key: 'customOptions.filename', label: 'Default filename', tooltip: 'Leave empty to let the user input their own filename', + weight: 23, validate: { required: false, }, @@ -206,6 +194,7 @@ export const documentenApiUploaderEditForm = () => ({ inputType: 'checkbox', key: 'customOptions.disableFilename', label: 'Disable filename input', + weight: 24, validate: { required: false, }, @@ -216,6 +205,7 @@ export const documentenApiUploaderEditForm = () => ({ inputType: 'checkbox', key: 'customOptions.hideFilename', label: 'Hide filename input', + weight: 25, validate: { required: false, }, @@ -228,6 +218,7 @@ export const documentenApiUploaderEditForm = () => ({ type: 'htmlelement', input: false, tableView: false, + weight: 26, }, { type: 'textfield', @@ -235,6 +226,7 @@ export const documentenApiUploaderEditForm = () => ({ key: 'customOptions.documentTitle', label: 'Default document title', tooltip: 'Leave empty to let the user input their own title', + weight: 27, validate: { required: false, }, @@ -245,6 +237,7 @@ export const documentenApiUploaderEditForm = () => ({ inputType: 'checkbox', key: 'customOptions.disableDocumentTitle', label: 'Disable document title input', + weight: 28, validate: { required: false, }, @@ -255,6 +248,7 @@ export const documentenApiUploaderEditForm = () => ({ inputType: 'checkbox', key: 'customOptions.hideDocumentTitle', label: 'Hide document title input', + weight: 29, validate: { required: false, }, @@ -267,6 +261,7 @@ export const documentenApiUploaderEditForm = () => ({ type: 'htmlelement', input: false, tableView: false, + weight: 30, }, { type: 'textfield', @@ -274,6 +269,7 @@ export const documentenApiUploaderEditForm = () => ({ key: 'customOptions.author', label: 'Default author', tooltip: 'Leave empty to let the user input their own author', + weight: 31, validate: { required: false, }, @@ -284,6 +280,7 @@ export const documentenApiUploaderEditForm = () => ({ inputType: 'checkbox', key: 'customOptions.disableAuthor', label: 'Disable author input', + weight: 32, validate: { required: false, }, @@ -294,6 +291,7 @@ export const documentenApiUploaderEditForm = () => ({ inputType: 'checkbox', key: 'customOptions.hideAuthor', label: 'Hide author input', + weight: 33, validate: { required: false, }, @@ -306,6 +304,7 @@ export const documentenApiUploaderEditForm = () => ({ type: 'htmlelement', input: false, tableView: false, + weight: 34, }, { type: 'textfield', @@ -313,6 +312,7 @@ export const documentenApiUploaderEditForm = () => ({ key: 'customOptions.description', label: 'Default description', tooltip: 'Leave empty to let the user input their own description', + weight: 35, validate: { required: false, }, @@ -323,6 +323,7 @@ export const documentenApiUploaderEditForm = () => ({ inputType: 'checkbox', key: 'customOptions.disableDescription', label: 'Disable description input', + weight: 36, validate: { required: false, }, @@ -333,6 +334,7 @@ export const documentenApiUploaderEditForm = () => ({ inputType: 'checkbox', key: 'customOptions.hideDescription', label: 'Hide description input', + weight: 37, validate: { required: false, }, @@ -345,6 +347,7 @@ export const documentenApiUploaderEditForm = () => ({ type: 'htmlelement', input: false, tableView: false, + weight: 38, }, { type: 'select', @@ -360,6 +363,7 @@ export const documentenApiUploaderEditForm = () => ({ }, dataSrc: 'values', input: true, + weight: 39, validate: { required: false, }, @@ -370,6 +374,7 @@ export const documentenApiUploaderEditForm = () => ({ inputType: 'checkbox', key: 'customOptions.disableLanguage', label: 'Disable language input', + weight: 40, validate: { required: false, }, @@ -380,6 +385,7 @@ export const documentenApiUploaderEditForm = () => ({ inputType: 'checkbox', key: 'customOptions.hideLanguage', label: 'Hide language input', + weight: 41, validate: { required: false, }, @@ -392,6 +398,7 @@ export const documentenApiUploaderEditForm = () => ({ type: 'htmlelement', input: false, tableView: false, + weight: 42, }, { type: 'select', @@ -412,6 +419,7 @@ export const documentenApiUploaderEditForm = () => ({ }, dataSrc: 'values', input: true, + weight: 43, validate: { required: false, }, @@ -422,6 +430,7 @@ export const documentenApiUploaderEditForm = () => ({ inputType: 'checkbox', key: 'customOptions.disableConfidentialityLevel', label: 'Disable confidentiality level input', + weight: 44, validate: { required: false, }, @@ -432,6 +441,7 @@ export const documentenApiUploaderEditForm = () => ({ inputType: 'checkbox', key: 'customOptions.hideConfidentialityLevel', label: 'Hide confidentiality level input', + weight: 45, validate: { required: false, }, @@ -444,6 +454,7 @@ export const documentenApiUploaderEditForm = () => ({ type: 'htmlelement', input: false, tableView: false, + weight: 46, }, { type: 'checkbox', @@ -451,6 +462,7 @@ export const documentenApiUploaderEditForm = () => ({ inputType: 'checkbox', key: 'customOptions.disableCreationDate', label: 'Disable creation date input', + weight: 47, validate: { required: false, }, @@ -461,6 +473,7 @@ export const documentenApiUploaderEditForm = () => ({ inputType: 'checkbox', key: 'customOptions.hideCreationDate', label: 'Hide creation date input', + weight: 48, validate: { required: false, }, @@ -473,6 +486,7 @@ export const documentenApiUploaderEditForm = () => ({ type: 'htmlelement', input: false, tableView: false, + weight: 49, }, { type: 'textfield', @@ -481,6 +495,7 @@ export const documentenApiUploaderEditForm = () => ({ label: 'Default informatieobjecttype url', tooltip: "Sometimes referred to as the 'document-type'. Must match the informatieobjecttype url exactly. Leave empty to let the user input their own informatieobjecttype", + weight: 50, validate: { required: false, }, @@ -491,6 +506,7 @@ export const documentenApiUploaderEditForm = () => ({ inputType: 'checkbox', key: 'customOptions.disableDocumentType', label: 'Disable informatieobjecttype input', + weight: 51, validate: { required: false, }, @@ -501,6 +517,7 @@ export const documentenApiUploaderEditForm = () => ({ inputType: 'checkbox', key: 'customOptions.hideDocumentType', label: 'Hide informatieobjecttype input', + weight: 52, validate: { required: false, }, @@ -513,6 +530,7 @@ export const documentenApiUploaderEditForm = () => ({ type: 'htmlelement', input: false, tableView: false, + weight: 53, }, { type: 'select', @@ -529,6 +547,7 @@ export const documentenApiUploaderEditForm = () => ({ }, dataSrc: 'values', input: true, + weight: 54, validate: { required: false, }, @@ -539,6 +558,7 @@ export const documentenApiUploaderEditForm = () => ({ inputType: 'checkbox', key: 'customOptions.disableStatus', label: 'Disable status input', + weight: 55, validate: { required: false, }, @@ -549,6 +569,7 @@ export const documentenApiUploaderEditForm = () => ({ inputType: 'checkbox', key: 'customOptions.hideStatus', label: 'Hide status input', + weight: 56, validate: { required: false, }, @@ -561,6 +582,7 @@ export const documentenApiUploaderEditForm = () => ({ type: 'htmlelement', input: false, tableView: false, + weight: 57, }, { type: 'checkbox', @@ -568,6 +590,7 @@ export const documentenApiUploaderEditForm = () => ({ inputType: 'checkbox', key: 'customOptions.hideAdditionalDate', label: 'Hide additional date input', + weight: 58, validate: { required: false, }, @@ -580,6 +603,7 @@ export const documentenApiUploaderEditForm = () => ({ type: 'htmlelement', input: false, tableView: false, + weight: 59, }, { type: 'textfield', @@ -587,6 +611,7 @@ export const documentenApiUploaderEditForm = () => ({ key: 'customOptions.tags', label: 'Default tags', tooltip: 'A comma separated list of tags. Leave empty to let the user input their own tags', + weight: 60, validate: { required: false, }, @@ -597,9 +622,20 @@ export const documentenApiUploaderEditForm = () => ({ inputType: 'checkbox', key: 'customOptions.hideTags', label: 'Hide tags input', + weight: 61, validate: { required: false, }, }, - ], -}); + ]; + + const tabsComponent = editForm.components.find(component => component.key === 'tabs'); + if (tabsComponent) { + const displayTab = tabsComponent.components.find(tab => tab.key === 'display'); + if (displayTab) { + displayTab.components.unshift(...customComponents); + } + } + + return editForm; +}; diff --git a/frontend/projects/valtimo/zgw/src/lib/modules/documenten-api/formio/documenten-api-uploader/documenten-api-uploader.formio.ts b/frontend/projects/valtimo/zgw/src/lib/modules/documenten-api/formio/documenten-api-uploader/documenten-api-uploader.formio.ts index dff2d6f564..389fb2541d 100644 --- a/frontend/projects/valtimo/zgw/src/lib/modules/documenten-api/formio/documenten-api-uploader/documenten-api-uploader.formio.ts +++ b/frontend/projects/valtimo/zgw/src/lib/modules/documenten-api/formio/documenten-api-uploader/documenten-api-uploader.formio.ts @@ -23,7 +23,7 @@ export const customDocumentApiUploaderType = 'documenten-api-file'; const COMPONENT_OPTIONS: FormioCustomComponentInfo = { type: customDocumentApiUploaderType, - selector: 'documenten-api-form-io-uploader', + selector: 'valtimo-documenten-api-formio-uploader', title: 'Documenten API File Upload', group: 'advanced', icon: 'upload',