diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index ba28d3e..1f34924 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -33,7 +33,7 @@ jobs: uses: actions/upload-artifact@v4 with: name: build - path: lib/ + path: dist/ retention-days: 1 prettier: @@ -70,7 +70,7 @@ jobs: uses: actions/download-artifact@v4 with: name: build - path: lib/ + path: dist/ - name: Install dependencies run: npm ci @@ -167,7 +167,7 @@ jobs: uses: actions/download-artifact@v4 with: name: build - path: lib/ + path: dist/ - name: Publish package to NPM run: | diff --git a/README.md b/README.md index c5ce922..db01671 100644 --- a/README.md +++ b/README.md @@ -85,3 +85,20 @@ git push origin main --tags If you have PGP keys set up, you can use them for the git tag operation. The CI pipeline will then publish the new version to npmjs. + +## Coding style / guidelines + +A common debate in TS is `interface` vs `type` aliases. They're mostly equivalent - the biggest +exception is probably that interfaces can be augmented by downstream code. Some may also argue that +the code is cleaner. + +In this repository, we apply some rules to decide which to use: + +- when the shape of the object exists by itself and is not expected to be further extended, use an + `interface` for the improved readability +- when the type is a base to be composed into more complex types (e.g. variants of the same + component type), use a `type`, combined with the `Prettify` helper on the final result for better + readability in code editors +- for component types, always use `type` for consistency - there are a number of component + types/variants that result in unions, and allowing interfaces leads to a mix of types that are + harder to read. diff --git a/package-lock.json b/package-lock.json index 088899b..b78727b 100644 --- a/package-lock.json +++ b/package-lock.json @@ -10,7 +10,6 @@ "license": "EUPL-1.2", "devDependencies": { "@trivago/prettier-plugin-sort-imports": "^4.1.1", - "formiojs": "^4.14.13", "prettier": "^2.8.8", "tsd": "^0.32.0", "typedoc": "0.28.7", @@ -176,18 +175,6 @@ "node": ">=6.0.0" } }, - "node_modules/@babel/runtime": { - "version": "7.21.5", - "resolved": "https://registry.npmjs.org/@babel/runtime/-/runtime-7.21.5.tgz", - "integrity": "sha512-8jI69toZqqcsnqGGqwGS4Qb1VwLOEp4hz+CXPywcvjs60u3B4Pom/U/7rm4W8tMOYEB+E9wgD0mW1l3r8qlI9Q==", - "dev": true, - "dependencies": { - "regenerator-runtime": "^0.13.11" - }, - "engines": { - "node": ">=6.9.0" - } - }, "node_modules/@babel/template": { "version": "7.22.15", "resolved": "https://registry.npmjs.org/@babel/template/-/template-7.22.15.tgz", @@ -279,44 +266,6 @@ "node": ">=6.9.0" } }, - "node_modules/@formio/bootstrap3": { - "version": "2.12.2", - "resolved": "https://registry.npmjs.org/@formio/bootstrap3/-/bootstrap3-2.12.2.tgz", - "integrity": "sha512-Y1WD/U22HHKRl1MzUt65bXeFHYO9Wlt+wefRqXFrOhIgbmkfTjCx6e0n2b8t/IYz9FUMg+/GTKdqaBrTZgjrTA==", - "dev": true, - "dependencies": { - "resize-observer-polyfill": "^1.5.1" - } - }, - "node_modules/@formio/choices.js": { - "version": "9.0.1", - "resolved": "https://registry.npmjs.org/@formio/choices.js/-/choices.js-9.0.1.tgz", - "integrity": "sha512-+JQRWH0yhaeemVJGE1L4oPe9KPFhipzDlms3Pd31gePXpy8q7Mf3Is54/f0fc88+mWeMjK4GyIhcKIKmuGx5Xw==", - "dev": true, - "dependencies": { - "deepmerge": "^4.2.0", - "fuse.js": "^3.4.5", - "redux": "^4.0.4" - } - }, - "node_modules/@formio/semantic": { - "version": "2.6.0", - "resolved": "https://registry.npmjs.org/@formio/semantic/-/semantic-2.6.0.tgz", - "integrity": "sha512-RwMEVXkyz+B6RivflrrKIqvvnGR/eZDLQs74u67StcrzO6n3/5D2J8XqTQRSUzQzr5QV6Wq0eZ51z/+mGm6THw==", - "dev": true - }, - "node_modules/@formio/text-mask-addons": { - "version": "3.8.0-formio.2", - "resolved": "https://registry.npmjs.org/@formio/text-mask-addons/-/text-mask-addons-3.8.0-formio.2.tgz", - "integrity": "sha512-H4Sm+1Sx59jbrlKxtKbzethhp5OIcP8Oi4JBpsvH/SB8P/KCRmtjKbN5ACqURnXmYtBHLJC6Yr9KZibOVRGxpA==", - "dev": true - }, - "node_modules/@formio/vanilla-text-mask": { - "version": "5.1.1-formio.1", - "resolved": "https://registry.npmjs.org/@formio/vanilla-text-mask/-/vanilla-text-mask-5.1.1-formio.1.tgz", - "integrity": "sha512-rYBlvIPMNUd6sAaduOaiIwI4vfTAjHDRonko2qJn2RP1O//TQ7rcFIPYVYePJZ4OtOpwHiHAvAIh79McphZotQ==", - "dev": true - }, "node_modules/@gerrit0/mini-shiki": { "version": "3.8.1", "resolved": "https://registry.npmjs.org/@gerrit0/mini-shiki/-/mini-shiki-3.8.1.tgz", @@ -426,16 +375,6 @@ "node": ">= 8" } }, - "node_modules/@popperjs/core": { - "version": "2.11.7", - "resolved": "https://registry.npmjs.org/@popperjs/core/-/core-2.11.7.tgz", - "integrity": "sha512-Cr4OjIkipTtcXKjAsm8agyleBuDHvxzeBoa1v543lbv1YaIwQjESsVcmjiWiPEbC1FIeHOG/Op9kdCmAmiS3Kw==", - "dev": true, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/popperjs" - } - }, "node_modules/@shikijs/engine-oniguruma": { "version": "3.8.1", "resolved": "https://registry.npmjs.org/@shikijs/engine-oniguruma/-/engine-oniguruma-3.8.1.tgz", @@ -491,12 +430,6 @@ "integrity": "sha512-XJfwUVUKDHF5ugKwIcxEgc9k8b7HbznCp6eUfWgu710hMPNIO4aw4/zB5RogDQz8nd6gyCDpU9O/m6qYEWY6yQ==", "dev": true }, - "node_modules/@sphinxxxx/color-conversion": { - "version": "2.2.2", - "resolved": "https://registry.npmjs.org/@sphinxxxx/color-conversion/-/color-conversion-2.2.2.tgz", - "integrity": "sha512-XExJS3cLqgrmNBIP3bBw6+1oQ1ksGjFh0+oClDKFYpCCqx/hlqwWO5KO/S63fzUo67SxI9dMrF0y5T/Ey7h8Zw==", - "dev": true - }, "node_modules/@trivago/prettier-plugin-sort-imports": { "version": "4.3.0", "resolved": "https://registry.npmjs.org/@trivago/prettier-plugin-sort-imports/-/prettier-plugin-sort-imports-4.3.0.tgz", @@ -624,19 +557,6 @@ "dev": true, "license": "Python-2.0" }, - "node_modules/array-buffer-byte-length": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/array-buffer-byte-length/-/array-buffer-byte-length-1.0.0.tgz", - "integrity": "sha512-LPuwb2P+NrQw3XhxGc36+XSvuBPopovXYTR9Ew++Du9Yb/bx5AzBfrIsBoj0EZUifjQU+sHL21sseZ3jerWO/A==", - "dev": true, - "dependencies": { - "call-bind": "^1.0.2", - "is-array-buffer": "^3.0.1" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, "node_modules/array-union": { "version": "2.1.0", "resolved": "https://registry.npmjs.org/array-union/-/array-union-2.1.0.tgz", @@ -655,30 +575,6 @@ "node": ">=0.10.0" } }, - "node_modules/atoa": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/atoa/-/atoa-1.0.0.tgz", - "integrity": "sha512-VVE1H6cc4ai+ZXo/CRWoJiHXrA1qfA31DPnx6D20+kSI547hQN5Greh51LQ1baMRMfxO5K5M4ImMtZbZt2DODQ==", - "dev": true - }, - "node_modules/autocompleter": { - "version": "6.1.3", - "resolved": "https://registry.npmjs.org/autocompleter/-/autocompleter-6.1.3.tgz", - "integrity": "sha512-Pjb5R5r+S0/zDFudLP9a8CW7/xMc7O/uVCtaTf3f+RdNLAQQ5oUG018c3IRdDJMRVvT+OeZ1NYQoUH5GHlORKQ==", - "dev": true - }, - "node_modules/available-typed-arrays": { - "version": "1.0.5", - "resolved": "https://registry.npmjs.org/available-typed-arrays/-/available-typed-arrays-1.0.5.tgz", - "integrity": "sha512-DMD0KiN46eipeziST1LPP/STfDU0sufISXmjSgvVsoU2tqxctQeASejWcfNtxYKqETM1UxQ8sp2OrSBWpHY6sw==", - "dev": true, - "engines": { - "node": ">= 0.4" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, "node_modules/balanced-match": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.2.tgz", @@ -708,34 +604,6 @@ "node": ">=8" } }, - "node_modules/browser-cookies": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/browser-cookies/-/browser-cookies-1.2.0.tgz", - "integrity": "sha512-cg2WuoOJo+F+g2XjEaP8nmeRp1vDHjt7sqpKJMsTNXKrpyIBNVslYJeehvs6FEddj8usV2+qyRSBEX244yN5/g==", - "dev": true - }, - "node_modules/browser-md5-file": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/browser-md5-file/-/browser-md5-file-1.1.1.tgz", - "integrity": "sha512-9h2UViTtZPhBa7oHvp5mb7MvJaX5OKEPUsplDwJ800OIV+In7BOR3RXOMB78obn2iQVIiS3WkVLhG7Zu1EMwbw==", - "dev": true, - "dependencies": { - "spark-md5": "^2.0.2" - } - }, - "node_modules/call-bind": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/call-bind/-/call-bind-1.0.2.tgz", - "integrity": "sha512-7O+FbCihrB5WGbFYesctwmTKae6rOiIzmz1icreWJ+0aA7LJfuqhEso2T9ncpcFtzMQtzXf2QGGueWJGTYsqrA==", - "dev": true, - "dependencies": { - "function-bind": "^1.1.1", - "get-intrinsic": "^1.0.2" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, "node_modules/camelcase": { "version": "5.3.1", "resolved": "https://registry.npmjs.org/camelcase/-/camelcase-5.3.1.tgz", @@ -776,15 +644,6 @@ "node": ">=4" } }, - "node_modules/clone": { - "version": "2.1.2", - "resolved": "https://registry.npmjs.org/clone/-/clone-2.1.2.tgz", - "integrity": "sha512-3Pe/CF1Nn94hyhIYpjtiLhdCoEoz0DqQ+988E9gmeEdQZlojxnOb74wctFyuwWQHzqyf9X7C7MG8juUpqBJT8w==", - "dev": true, - "engines": { - "node": ">=0.8" - } - }, "node_modules/color-convert": { "version": "1.9.3", "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-1.9.3.tgz", @@ -800,54 +659,6 @@ "integrity": "sha512-72fSenhMw2HZMTVHeCA9KCmpEIbzWiQsjN+BHcBbS9vr1mtt+vJjPdksIBNUmKAW8TFUDPJK5SUU3QhE9NEXDw==", "dev": true }, - "node_modules/compare-versions": { - "version": "4.1.4", - "resolved": "https://registry.npmjs.org/compare-versions/-/compare-versions-4.1.4.tgz", - "integrity": "sha512-FemMreK9xNyL8gQevsdRMrvO4lFCkQP7qbuktn1q8ndcNk1+0mz7lgE7b/sNvbhVgY4w6tMN1FDp6aADjqw2rw==", - "dev": true - }, - "node_modules/contra": { - "version": "1.9.4", - "resolved": "https://registry.npmjs.org/contra/-/contra-1.9.4.tgz", - "integrity": "sha512-N9ArHAqwR/lhPq4OdIAwH4e1btn6EIZMAz4TazjnzCiVECcWUPTma+dRAM38ERImEJBh8NiCCpjoQruSZ+agYg==", - "dev": true, - "dependencies": { - "atoa": "1.0.0", - "ticky": "1.0.1" - } - }, - "node_modules/core-js": { - "version": "3.30.1", - "resolved": "https://registry.npmjs.org/core-js/-/core-js-3.30.1.tgz", - "integrity": "sha512-ZNS5nbiSwDTq4hFosEDqm65izl2CWmLz0hARJMyNQBgkUZMIF51cQiMvIQKA6hvuaeWxQDP3hEedM1JZIgTldQ==", - "dev": true, - "hasInstallScript": true, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/core-js" - } - }, - "node_modules/crossvent": { - "version": "1.5.5", - "resolved": "https://registry.npmjs.org/crossvent/-/crossvent-1.5.5.tgz", - "integrity": "sha512-MY4xhBYEnVi+pmTpHCOCsCLYczc0PVtGdPBz6NXNXxikLaUZo4HdAeUb1UqAo3t3yXAloSelTmfxJ+/oUqkW5w==", - "dev": true, - "dependencies": { - "custom-event": "^1.0.0" - } - }, - "node_modules/custom-event": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/custom-event/-/custom-event-1.0.1.tgz", - "integrity": "sha512-GAj5FOq0Hd+RsCGVJxZuKaIDXDf3h6GQoNEjFgbLLI/trgtavwUbSnZ5pVfg27DVCaWjIohryS0JFwIJyT2cMg==", - "dev": true - }, - "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==", - "dev": true - }, "node_modules/debug": { "version": "4.3.4", "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.4.tgz", @@ -899,66 +710,6 @@ "node": ">=0.10.0" } }, - "node_modules/deep-equal": { - "version": "2.2.1", - "resolved": "https://registry.npmjs.org/deep-equal/-/deep-equal-2.2.1.tgz", - "integrity": "sha512-lKdkdV6EOGoVn65XaOsPdH4rMxTZOnmFyuIkMjM1i5HHCbfjC97dawgTAy0deYNfuqUqW+Q5VrVaQYtUpSd6yQ==", - "dev": true, - "dependencies": { - "array-buffer-byte-length": "^1.0.0", - "call-bind": "^1.0.2", - "es-get-iterator": "^1.1.3", - "get-intrinsic": "^1.2.0", - "is-arguments": "^1.1.1", - "is-array-buffer": "^3.0.2", - "is-date-object": "^1.0.5", - "is-regex": "^1.1.4", - "is-shared-array-buffer": "^1.0.2", - "isarray": "^2.0.5", - "object-is": "^1.1.5", - "object-keys": "^1.1.1", - "object.assign": "^4.1.4", - "regexp.prototype.flags": "^1.5.0", - "side-channel": "^1.0.4", - "which-boxed-primitive": "^1.0.2", - "which-collection": "^1.0.1", - "which-typed-array": "^1.1.9" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, - "node_modules/deepmerge": { - "version": "4.3.1", - "resolved": "https://registry.npmjs.org/deepmerge/-/deepmerge-4.3.1.tgz", - "integrity": "sha512-3sUqbMEc77XqpdNO7FRyRog+eW3ph+GYCbj+rK+uYyRMuwsVy0rMiVtPn+QJlKFvWP/1PYpapqYn0Me2knFn+A==", - "dev": true, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/define-properties": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/define-properties/-/define-properties-1.2.0.tgz", - "integrity": "sha512-xvqAVKGfT1+UAvPwKTVw/njhdQ8ZhXK4lI0bCIuCMrp2up9nPnaDftrLtmpTazqd1o+UY4zgzU+avtMbDP+ldA==", - "dev": true, - "dependencies": { - "has-property-descriptors": "^1.0.0", - "object-keys": "^1.1.1" - }, - "engines": { - "node": ">= 0.4" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, - "node_modules/dialog-polyfill": { - "version": "0.5.6", - "resolved": "https://registry.npmjs.org/dialog-polyfill/-/dialog-polyfill-0.5.6.tgz", - "integrity": "sha512-ZbVDJI9uvxPAKze6z146rmfUZjBqNEwcnFTVamQzXH+svluiV7swmVIGr7miwADgfgt1G2JQIytypM9fbyhX4w==", - "dev": true - }, "node_modules/diff-sequences": { "version": "29.4.3", "resolved": "https://registry.npmjs.org/diff-sequences/-/diff-sequences-29.4.3.tgz", @@ -980,29 +731,6 @@ "node": ">=8" } }, - "node_modules/dompurify": { - "version": "2.5.8", - "resolved": "https://registry.npmjs.org/dompurify/-/dompurify-2.5.8.tgz", - "integrity": "sha512-o1vSNgrmYMQObbSSvF/1brBYEQPHhV1+gsmrusO7/GXtp1T9rCS8cXFqVxK/9crT1jA6Ccv+5MTSjBNqr7Sovw==", - "dev": true, - "license": "(MPL-2.0 OR Apache-2.0)" - }, - "node_modules/downloadjs": { - "version": "1.4.7", - "resolved": "https://registry.npmjs.org/downloadjs/-/downloadjs-1.4.7.tgz", - "integrity": "sha512-LN1gO7+u9xjU5oEScGFKvXhYf7Y/empUIIEAGBs1LzUq/rg5duiDrkuH5A2lQGd5jfMOb9X9usDa2oVXwJ0U/Q==", - "dev": true - }, - "node_modules/dragula": { - "version": "3.7.3", - "resolved": "https://registry.npmjs.org/dragula/-/dragula-3.7.3.tgz", - "integrity": "sha512-/rRg4zRhcpf81TyDhaHLtXt6sEywdfpv1cRUMeFFy7DuypH2U0WUL0GTdyAQvXegviT4PJK4KuMmOaIDpICseQ==", - "dev": true, - "dependencies": { - "contra": "1.9.4", - "crossvent": "1.5.5" - } - }, "node_modules/emoji-regex": { "version": "8.0.0", "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-8.0.0.tgz", @@ -1031,26 +759,6 @@ "is-arrayish": "^0.2.1" } }, - "node_modules/es-get-iterator": { - "version": "1.1.3", - "resolved": "https://registry.npmjs.org/es-get-iterator/-/es-get-iterator-1.1.3.tgz", - "integrity": "sha512-sPZmqHBe6JIiTfN5q2pEi//TwxmAFHwj/XEuYjTuse78i8KxaqMTTzxPoFKuzRpDpTJ+0NAbpfenkmH2rePtuw==", - "dev": true, - "dependencies": { - "call-bind": "^1.0.2", - "get-intrinsic": "^1.1.3", - "has-symbols": "^1.0.3", - "is-arguments": "^1.1.1", - "is-map": "^2.0.2", - "is-set": "^2.0.2", - "is-string": "^1.0.7", - "isarray": "^2.0.5", - "stop-iteration-iterator": "^1.0.0" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, "node_modules/escape-string-regexp": { "version": "1.0.5", "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz", @@ -1158,30 +866,6 @@ "integrity": "sha512-+TQ+x4JdTnDoFEXXb3fDvfGOwnyNV7duH8fXWTPD1ieaBmB8omj7Gw/pMBBu4uI2uJCCU8APDaQJzWuXnTsH4A==", "dev": true }, - "node_modules/eventemitter3": { - "version": "4.0.7", - "resolved": "https://registry.npmjs.org/eventemitter3/-/eventemitter3-4.0.7.tgz", - "integrity": "sha512-8guHBZCwKnFhYdHr2ysuRWErTwhoN2X8XELRlrRwpmfeY2jjuUN4taQMsULKUVo1K4DvZl+0pgfyoysHxvmvEw==", - "dev": true - }, - "node_modules/extend": { - "version": "3.0.2", - "resolved": "https://registry.npmjs.org/extend/-/extend-3.0.2.tgz", - "integrity": "sha512-fjquC59cD7CyW6urNXK0FBufkZcoiGG80wTuPujX590cB5Ttln20E2UB4S/WARVqhXffZl2LNgS+gQdPIIim/g==", - "dev": true - }, - "node_modules/fast-deep-equal": { - "version": "3.1.3", - "resolved": "https://registry.npmjs.org/fast-deep-equal/-/fast-deep-equal-3.1.3.tgz", - "integrity": "sha512-f3qQ9oQy9j2AhBe/H9VC91wLmKBCCU/gDOnKNAYG5hswO7BLKj09Hc5HYNz9cGI++xlpDCIgDaitVs03ATR84Q==", - "dev": true - }, - "node_modules/fast-diff": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/fast-diff/-/fast-diff-1.2.0.tgz", - "integrity": "sha512-xJuoT5+L99XlZ8twedaRf6Ax2TgQVxvgZOYoPKqZufmJib0tL2tegPBOZb1pVNgIhlqDlA0eO0c3wBvQcmzx4w==", - "dev": true - }, "node_modules/fast-glob": { "version": "3.2.12", "resolved": "https://registry.npmjs.org/fast-glob/-/fast-glob-3.2.12.tgz", @@ -1198,12 +882,6 @@ "node": ">=8.6.0" } }, - "node_modules/fast-json-patch": { - "version": "3.1.1", - "resolved": "https://registry.npmjs.org/fast-json-patch/-/fast-json-patch-3.1.1.tgz", - "integrity": "sha512-vf6IHUX2SBcA+5/+4883dsIjpBTqmfBjmYiWK1savxQmFk4JfBMLa7ynTYOs1Rolp/T1betJxHiGD3g1Mn8lUQ==", - "dev": true - }, "node_modules/fastq": { "version": "1.15.0", "resolved": "https://registry.npmjs.org/fastq/-/fastq-1.15.0.tgz", @@ -1213,15 +891,6 @@ "reusify": "^1.0.4" } }, - "node_modules/fetch-ponyfill": { - "version": "7.1.0", - "resolved": "https://registry.npmjs.org/fetch-ponyfill/-/fetch-ponyfill-7.1.0.tgz", - "integrity": "sha512-FhbbL55dj/qdVO3YNK7ZEkshvj3eQ7EuIGV2I6ic/2YiocvyWv+7jg2s4AyS0wdRU75s3tA8ZxI/xPigb0v5Aw==", - "dev": true, - "dependencies": { - "node-fetch": "~2.6.1" - } - }, "node_modules/fill-range": { "version": "7.1.1", "resolved": "https://registry.npmjs.org/fill-range/-/fill-range-7.1.1.tgz", @@ -1247,97 +916,12 @@ "node": ">=8" } }, - "node_modules/for-each": { - "version": "0.3.3", - "resolved": "https://registry.npmjs.org/for-each/-/for-each-0.3.3.tgz", - "integrity": "sha512-jqYfLp7mo9vIyQf8ykW2v7A+2N4QjeCeI5+Dz9XraiO1ign81wjiH7Fb9vSOWvQfNtmSa4H2RoQTrrXivdUZmw==", - "dev": true, - "dependencies": { - "is-callable": "^1.1.3" - } - }, - "node_modules/formiojs": { - "version": "4.14.13", - "resolved": "https://registry.npmjs.org/formiojs/-/formiojs-4.14.13.tgz", - "integrity": "sha512-x8ZFYexjc6hYL9sVT6vv6YUId9adq8g84sOB92ZH6MEOw3OyDfaTzVUrb4oo7zlEHZw2UC4CNKrIHoXffwYN3Q==", - "dev": true, - "dependencies": { - "@formio/bootstrap3": "^2.12.2", - "@formio/choices.js": "^9.0.1", - "@formio/semantic": "^2.6.0", - "@formio/text-mask-addons": "^3.8.0-formio.2", - "@formio/vanilla-text-mask": "^5.1.1-formio.1", - "autocompleter": "^6.1.2", - "browser-cookies": "^1.2.0", - "browser-md5-file": "^1.1.1", - "compare-versions": "^4.1.3", - "core-js": "^3.21.1", - "custom-event-polyfill": "^1.0.7", - "dialog-polyfill": "^0.5.6", - "dompurify": "^2.3.4", - "downloadjs": "^1.4.7", - "dragula": "^3.7.3", - "eventemitter3": "^4.0.7", - "fast-deep-equal": "^3.1.3", - "fast-json-patch": "^3.1.0", - "fetch-ponyfill": "^7.1.0", - "i18next": "^21.6.0", - "idb": "^6.1.5", - "ismobilejs": "^1.1.1", - "json-logic-js": "^2.0.0", - "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", - "resize-observer-polyfill": "^1.5.1", - "signature_pad": "^4.0.4", - "string-hash": "^1.1.3", - "tippy.js": "^6.3.7", - "uuid": "^8.3.2", - "vanilla-picker": "^2.12.1" - } - }, "node_modules/function-bind": { "version": "1.1.1", "resolved": "https://registry.npmjs.org/function-bind/-/function-bind-1.1.1.tgz", "integrity": "sha512-yIovAzMX49sF8Yl58fSCWJ5svSLuaibPxXQJFLmBObTuCr0Mf1KiPopGM9NiFjiYBCbfaa2Fh6breQ6ANVTI0A==", "dev": true }, - "node_modules/functions-have-names": { - "version": "1.2.3", - "resolved": "https://registry.npmjs.org/functions-have-names/-/functions-have-names-1.2.3.tgz", - "integrity": "sha512-xckBUXyTIqT97tq2x2AMb+g163b5JFysYk0x4qxNFwbfQkmNZoiRHb6sPzI9/QV33WeuvVYBUIiD4NzNIyqaRQ==", - "dev": true, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, - "node_modules/fuse.js": { - "version": "3.6.1", - "resolved": "https://registry.npmjs.org/fuse.js/-/fuse.js-3.6.1.tgz", - "integrity": "sha512-hT9yh/tiinkmirKrlv4KWOjztdoZo1mx9Qh4KvWqC7isoXwdUY3PNWUxceF4/qO9R6riA2C29jdTOeQOIROjgw==", - "dev": true, - "engines": { - "node": ">=6" - } - }, - "node_modules/get-intrinsic": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/get-intrinsic/-/get-intrinsic-1.2.0.tgz", - "integrity": "sha512-L049y6nFOuom5wGyRc3/gdTLO94dySVKRACj1RmJZBQXlbTMhtNIgkWkUHq+jYmZvKf14EW1EoJnnjbmoHij0Q==", - "dev": true, - "dependencies": { - "function-bind": "^1.1.1", - "has": "^1.0.3", - "has-symbols": "^1.0.3" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, "node_modules/glob-parent": { "version": "5.1.2", "resolved": "https://registry.npmjs.org/glob-parent/-/glob-parent-5.1.2.tgz", @@ -1379,18 +963,6 @@ "url": "https://github.com/sponsors/sindresorhus" } }, - "node_modules/gopd": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/gopd/-/gopd-1.0.1.tgz", - "integrity": "sha512-d65bNlIadxvpb/A2abVdlqKqV563juRnZ1Wtk6s1sIR8uNsXR70xqIzVqxVf1eTqDunwT2MkczEeaezCKTZhwA==", - "dev": true, - "dependencies": { - "get-intrinsic": "^1.1.3" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, "node_modules/hard-rejection": { "version": "2.1.0", "resolved": "https://registry.npmjs.org/hard-rejection/-/hard-rejection-2.1.0.tgz", @@ -1412,15 +984,6 @@ "node": ">= 0.4.0" } }, - "node_modules/has-bigints": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/has-bigints/-/has-bigints-1.0.2.tgz", - "integrity": "sha512-tSvCKtBr9lkF0Ex0aQiP9N+OpV4zi2r/Nee5VkRDbaqv35RLYMzbwQfFSZZH0kR+Rd6302UJZ2p/bJCEoR3VoQ==", - "dev": true, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, "node_modules/has-flag": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-3.0.0.tgz", @@ -1430,45 +993,6 @@ "node": ">=4" } }, - "node_modules/has-property-descriptors": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/has-property-descriptors/-/has-property-descriptors-1.0.0.tgz", - "integrity": "sha512-62DVLZGoiEBDHQyqG4w9xCuZ7eJEwNmJRWw2VY84Oedb7WFcA27fiEVe8oUQx9hAUJ4ekurquucTGwsyO1XGdQ==", - "dev": true, - "dependencies": { - "get-intrinsic": "^1.1.1" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, - "node_modules/has-symbols": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/has-symbols/-/has-symbols-1.0.3.tgz", - "integrity": "sha512-l3LCuF6MgDNwTDKkdYGEihYjt5pRPbEg46rtlmnSPlUbgmB8LOIrKJbYYFBSbnPaJexMKtiPO8hmeRjRz2Td+A==", - "dev": true, - "engines": { - "node": ">= 0.4" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, - "node_modules/has-tostringtag": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/has-tostringtag/-/has-tostringtag-1.0.0.tgz", - "integrity": "sha512-kFjcSNhnlGV1kyoGk7OXKSawH5JOb/LzUc5w9B02hOTO0dfFRjbHQKvg1d6cf3HbeUmtU9VbbV3qzZ2Teh97WQ==", - "dev": true, - "dependencies": { - "has-symbols": "^1.0.2" - }, - "engines": { - "node": ">= 0.4" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, "node_modules/hosted-git-info": { "version": "4.1.0", "resolved": "https://registry.npmjs.org/hosted-git-info/-/hosted-git-info-4.1.0.tgz", @@ -1481,35 +1005,6 @@ "node": ">=10" } }, - "node_modules/i18next": { - "version": "21.10.0", - "resolved": "https://registry.npmjs.org/i18next/-/i18next-21.10.0.tgz", - "integrity": "sha512-YeuIBmFsGjUfO3qBmMOc0rQaun4mIpGKET5WDwvu8lU7gvwpcariZLNtL0Fzj+zazcHUrlXHiptcFhBMFaxzfg==", - "dev": true, - "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" - } - ], - "dependencies": { - "@babel/runtime": "^7.17.2" - } - }, - "node_modules/idb": { - "version": "6.1.5", - "resolved": "https://registry.npmjs.org/idb/-/idb-6.1.5.tgz", - "integrity": "sha512-IJtugpKkiVXQn5Y+LteyBCNk1N8xpGV3wWZk9EVtZWH8DYkjBn0bX1XnGP9RkyZF0sAcywa6unHqSWKe7q4LGw==", - "dev": true - }, "node_modules/ignore": { "version": "5.2.4", "resolved": "https://registry.npmjs.org/ignore/-/ignore-5.2.4.tgz", @@ -1528,20 +1023,6 @@ "node": ">=8" } }, - "node_modules/internal-slot": { - "version": "1.0.5", - "resolved": "https://registry.npmjs.org/internal-slot/-/internal-slot-1.0.5.tgz", - "integrity": "sha512-Y+R5hJrzs52QCG2laLn4udYVnxsfny9CpOhNhUvk/SSSVyF6T27FzRbF0sroPidSu3X8oEAkOn2K804mjpt6UQ==", - "dev": true, - "dependencies": { - "get-intrinsic": "^1.2.0", - "has": "^1.0.3", - "side-channel": "^1.0.4" - }, - "engines": { - "node": ">= 0.4" - } - }, "node_modules/irregular-plurals": { "version": "3.5.0", "resolved": "https://registry.npmjs.org/irregular-plurals/-/irregular-plurals-3.5.0.tgz", @@ -1551,82 +1032,12 @@ "node": ">=8" } }, - "node_modules/is-arguments": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/is-arguments/-/is-arguments-1.1.1.tgz", - "integrity": "sha512-8Q7EARjzEnKpt/PCD7e1cgUS0a6X8u5tdSiMqXhojOdoV9TsMsiO+9VLC5vAmO8N7/GmXn7yjR8qnA6bVAEzfA==", - "dev": true, - "dependencies": { - "call-bind": "^1.0.2", - "has-tostringtag": "^1.0.0" - }, - "engines": { - "node": ">= 0.4" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, - "node_modules/is-array-buffer": { - "version": "3.0.2", - "resolved": "https://registry.npmjs.org/is-array-buffer/-/is-array-buffer-3.0.2.tgz", - "integrity": "sha512-y+FyyR/w8vfIRq4eQcM1EYgSTnmHXPqaF+IgzgraytCFq5Xh8lllDVmAZolPJiZttZLeFSINPYMaEJ7/vWUa1w==", - "dev": true, - "dependencies": { - "call-bind": "^1.0.2", - "get-intrinsic": "^1.2.0", - "is-typed-array": "^1.1.10" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, "node_modules/is-arrayish": { "version": "0.2.1", "resolved": "https://registry.npmjs.org/is-arrayish/-/is-arrayish-0.2.1.tgz", "integrity": "sha512-zz06S8t0ozoDXMG+ube26zeCTNXcKIPJZJi8hBrF4idCLms4CG9QtK7qBl1boi5ODzFpjswb5JPmHCbMpjaYzg==", "dev": true }, - "node_modules/is-bigint": { - "version": "1.0.4", - "resolved": "https://registry.npmjs.org/is-bigint/-/is-bigint-1.0.4.tgz", - "integrity": "sha512-zB9CruMamjym81i2JZ3UMn54PKGsQzsJeo6xvN3HJJ4CAsQNB6iRutp2To77OfCNuoxspsIhzaPoO1zyCEhFOg==", - "dev": true, - "dependencies": { - "has-bigints": "^1.0.1" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, - "node_modules/is-boolean-object": { - "version": "1.1.2", - "resolved": "https://registry.npmjs.org/is-boolean-object/-/is-boolean-object-1.1.2.tgz", - "integrity": "sha512-gDYaKHJmnj4aWxyj6YHyXVpdQawtVLHU5cb+eztPGczf6cjuTdwve5ZIEfgXqH4e57An1D1AKf8CZ3kYrQRqYA==", - "dev": true, - "dependencies": { - "call-bind": "^1.0.2", - "has-tostringtag": "^1.0.0" - }, - "engines": { - "node": ">= 0.4" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, - "node_modules/is-callable": { - "version": "1.2.7", - "resolved": "https://registry.npmjs.org/is-callable/-/is-callable-1.2.7.tgz", - "integrity": "sha512-1BC0BVFhS/p0qtw6enp8e+8OD0UrK0oFLztSjNzhcKA3WDuJxxAPXzPuPtKkjEY9UUoEWlX/8fgKeu2S8i9JTA==", - "dev": true, - "engines": { - "node": ">= 0.4" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, "node_modules/is-core-module": { "version": "2.12.0", "resolved": "https://registry.npmjs.org/is-core-module/-/is-core-module-2.12.0.tgz", @@ -1639,21 +1050,6 @@ "url": "https://github.com/sponsors/ljharb" } }, - "node_modules/is-date-object": { - "version": "1.0.5", - "resolved": "https://registry.npmjs.org/is-date-object/-/is-date-object-1.0.5.tgz", - "integrity": "sha512-9YQaSxsAiSwcvS33MBk3wTCVnWK+HhF8VZR2jRxehM16QcVOdHqPn4VPHmRK4lSr38n9JriurInLcP90xsYNfQ==", - "dev": true, - "dependencies": { - "has-tostringtag": "^1.0.0" - }, - "engines": { - "node": ">= 0.4" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, "node_modules/is-extglob": { "version": "2.1.1", "resolved": "https://registry.npmjs.org/is-extglob/-/is-extglob-2.1.1.tgz", @@ -1684,15 +1080,6 @@ "node": ">=0.10.0" } }, - "node_modules/is-map": { - "version": "2.0.2", - "resolved": "https://registry.npmjs.org/is-map/-/is-map-2.0.2.tgz", - "integrity": "sha512-cOZFQQozTha1f4MxLFzlgKYPTyj26picdZTx82hbc/Xf4K/tZOOXSCkMvU4pKioRXGDLJRn0GM7Upe7kR721yg==", - "dev": true, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, "node_modules/is-number": { "version": "7.0.0", "resolved": "https://registry.npmjs.org/is-number/-/is-number-7.0.0.tgz", @@ -1702,21 +1089,6 @@ "node": ">=0.12.0" } }, - "node_modules/is-number-object": { - "version": "1.0.7", - "resolved": "https://registry.npmjs.org/is-number-object/-/is-number-object-1.0.7.tgz", - "integrity": "sha512-k1U0IRzLMo7ZlYIfzRu23Oh6MiIFasgpb9X76eqfFZAqwH44UI4KTBvBYIZ1dSL9ZzChTB9ShHfLkR4pdW5krQ==", - "dev": true, - "dependencies": { - "has-tostringtag": "^1.0.0" - }, - "engines": { - "node": ">= 0.4" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, "node_modules/is-plain-obj": { "version": "1.1.0", "resolved": "https://registry.npmjs.org/is-plain-obj/-/is-plain-obj-1.1.0.tgz", @@ -1726,92 +1098,6 @@ "node": ">=0.10.0" } }, - "node_modules/is-regex": { - "version": "1.1.4", - "resolved": "https://registry.npmjs.org/is-regex/-/is-regex-1.1.4.tgz", - "integrity": "sha512-kvRdxDsxZjhzUX07ZnLydzS1TU/TJlTUHHY4YLL87e37oUA49DfkLqgy+VjFocowy29cKvcSiu+kIv728jTTVg==", - "dev": true, - "dependencies": { - "call-bind": "^1.0.2", - "has-tostringtag": "^1.0.0" - }, - "engines": { - "node": ">= 0.4" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, - "node_modules/is-set": { - "version": "2.0.2", - "resolved": "https://registry.npmjs.org/is-set/-/is-set-2.0.2.tgz", - "integrity": "sha512-+2cnTEZeY5z/iXGbLhPrOAaK/Mau5k5eXq9j14CpRTftq0pAJu2MwVRSZhyZWBzx3o6X795Lz6Bpb6R0GKf37g==", - "dev": true, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, - "node_modules/is-shared-array-buffer": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/is-shared-array-buffer/-/is-shared-array-buffer-1.0.2.tgz", - "integrity": "sha512-sqN2UDu1/0y6uvXyStCOzyhAjCSlHceFoMKJW8W9EU9cvic/QdsZ0kEU93HEy3IUEFZIiH/3w+AH/UQbPHNdhA==", - "dev": true, - "dependencies": { - "call-bind": "^1.0.2" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, - "node_modules/is-string": { - "version": "1.0.7", - "resolved": "https://registry.npmjs.org/is-string/-/is-string-1.0.7.tgz", - "integrity": "sha512-tE2UXzivje6ofPW7l23cjDOMa09gb7xlAqG6jG5ej6uPV32TlWP3NKPigtaGeHNu9fohccRYvIiZMfOOnOYUtg==", - "dev": true, - "dependencies": { - "has-tostringtag": "^1.0.0" - }, - "engines": { - "node": ">= 0.4" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, - "node_modules/is-symbol": { - "version": "1.0.4", - "resolved": "https://registry.npmjs.org/is-symbol/-/is-symbol-1.0.4.tgz", - "integrity": "sha512-C/CPBqKWnvdcxqIARxyOh4v1UUEOCHpgDa0WYgpKDFMszcrPcffg5uhwSgPCLD2WWxmq6isisz87tzT01tuGhg==", - "dev": true, - "dependencies": { - "has-symbols": "^1.0.2" - }, - "engines": { - "node": ">= 0.4" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, - "node_modules/is-typed-array": { - "version": "1.1.10", - "resolved": "https://registry.npmjs.org/is-typed-array/-/is-typed-array-1.1.10.tgz", - "integrity": "sha512-PJqgEHiWZvMpaFZ3uTc8kHPM4+4ADTlDniuQL7cU/UDA0Ql7F70yGfHph3cLNe+c9toaigv+DFzTJKhc2CtO6A==", - "dev": true, - "dependencies": { - "available-typed-arrays": "^1.0.5", - "call-bind": "^1.0.2", - "for-each": "^0.3.3", - "gopd": "^1.0.1", - "has-tostringtag": "^1.0.0" - }, - "engines": { - "node": ">= 0.4" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, "node_modules/is-unicode-supported": { "version": "0.1.0", "resolved": "https://registry.npmjs.org/is-unicode-supported/-/is-unicode-supported-0.1.0.tgz", @@ -1824,40 +1110,6 @@ "url": "https://github.com/sponsors/sindresorhus" } }, - "node_modules/is-weakmap": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/is-weakmap/-/is-weakmap-2.0.1.tgz", - "integrity": "sha512-NSBR4kH5oVj1Uwvv970ruUkCV7O1mzgVFO4/rev2cLRda9Tm9HrL70ZPut4rOHgY0FNrUu9BCbXA2sdQ+x0chA==", - "dev": true, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, - "node_modules/is-weakset": { - "version": "2.0.2", - "resolved": "https://registry.npmjs.org/is-weakset/-/is-weakset-2.0.2.tgz", - "integrity": "sha512-t2yVvttHkQktwnNNmBQ98AhENLdPUTDTE21uPqAQ0ARwQfGeQKRVS0NNurH7bTf7RrvcVn1OOge45CnBeHCSmg==", - "dev": true, - "dependencies": { - "call-bind": "^1.0.2", - "get-intrinsic": "^1.1.1" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, - "node_modules/isarray": { - "version": "2.0.5", - "resolved": "https://registry.npmjs.org/isarray/-/isarray-2.0.5.tgz", - "integrity": "sha512-xHjhDr3cNBK0BzdUJSPXZntQUx/mwMS5Rw4A7lPJ90XGAO6ISP/ePDNuo0vhqOZU+UD5JoodwCAAoZQd3FeAKw==", - "dev": true - }, - "node_modules/ismobilejs": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/ismobilejs/-/ismobilejs-1.1.1.tgz", - "integrity": "sha512-VaFW53yt8QO61k2WJui0dHf4SlL8lxBofUuUmwBo0ljPk0Drz2TiuDW4jo3wDcv41qy/SxrJ+VAzJ/qYqsmzRw==", - "dev": true - }, "node_modules/javascript-natural-sort": { "version": "0.7.1", "resolved": "https://registry.npmjs.org/javascript-natural-sort/-/javascript-natural-sort-0.7.1.tgz", @@ -1976,30 +1228,12 @@ "node": ">=4" } }, - "node_modules/json-logic-js": { - "version": "2.0.2", - "resolved": "https://registry.npmjs.org/json-logic-js/-/json-logic-js-2.0.2.tgz", - "integrity": "sha512-ZBtBdMJieqQcH7IX/LaBsr5pX+Y5JIW+EhejtM3Ffg2jdN9Iwf+Ht6TbHnvAZ/YtwyuhPaCBlnvzrwVeWdvGDQ==", - "dev": true - }, "node_modules/json-parse-even-better-errors": { "version": "2.3.1", "resolved": "https://registry.npmjs.org/json-parse-even-better-errors/-/json-parse-even-better-errors-2.3.1.tgz", "integrity": "sha512-xyFwyhro/JEof6Ghe2iz2NcXoj2sloNsWr/XsERDK/oiPCfaNhl5ONfp+jQdAZRQQ0IJWNzH9zIZF7li91kh2w==", "dev": true }, - "node_modules/jstimezonedetect": { - "version": "1.0.7", - "resolved": "https://registry.npmjs.org/jstimezonedetect/-/jstimezonedetect-1.0.7.tgz", - "integrity": "sha512-ARADHortktl9IZ1tr4GHwGPIAzgz3mLNCbR/YjWtRtc/O0o634O3NeFlpLjv95EvuDA5dc8z6yfgbS8nUc4zcQ==", - "dev": true - }, - "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==", - "dev": true - }, "node_modules/kind-of": { "version": "6.0.3", "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-6.0.3.tgz", @@ -2257,152 +1491,53 @@ }, "node_modules/minimatch": { "version": "9.0.5", - "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-9.0.5.tgz", - "integrity": "sha512-G6T0ZX48xgozx7587koeX9Ys2NYy6Gmv//P89sEte9V9whIapMNF4idKxnW2QtCcLiTWlb/wfCabAtAFWhhBow==", - "dev": true, - "license": "ISC", - "dependencies": { - "brace-expansion": "^2.0.1" - }, - "engines": { - "node": ">=16 || 14 >=14.17" - }, - "funding": { - "url": "https://github.com/sponsors/isaacs" - } - }, - "node_modules/minimist-options": { - "version": "4.1.0", - "resolved": "https://registry.npmjs.org/minimist-options/-/minimist-options-4.1.0.tgz", - "integrity": "sha512-Q4r8ghd80yhO/0j1O3B2BjweX3fiHg9cdOwjJd2J76Q135c+NDxGCqdYKQ1SKBuFfgWbAUzBfvYjPUEeNgqN1A==", - "dev": true, - "dependencies": { - "arrify": "^1.0.1", - "is-plain-obj": "^1.1.0", - "kind-of": "^6.0.3" - }, - "engines": { - "node": ">= 6" - } - }, - "node_modules/moment": { - "version": "2.29.4", - "resolved": "https://registry.npmjs.org/moment/-/moment-2.29.4.tgz", - "integrity": "sha512-5LC9SOxjSc2HF6vO2CyuTDNivEdoz2IvyJJGj6X8DJ0eFyfszE0QiEd+iXmBvUP3WHxSjFH/vIsA0EN00cgr8w==", - "dev": true, - "engines": { - "node": "*" - } - }, - "node_modules/moment-timezone": { - "version": "0.5.43", - "resolved": "https://registry.npmjs.org/moment-timezone/-/moment-timezone-0.5.43.tgz", - "integrity": "sha512-72j3aNyuIsDxdF1i7CEgV2FfxM1r6aaqJyLB2vwb33mXYyoyLly+F1zbWqhA3/bVIoJ4szlUoMbUnVdid32NUQ==", - "dev": true, - "dependencies": { - "moment": "^2.29.4" - }, - "engines": { - "node": "*" - } - }, - "node_modules/ms": { - "version": "2.1.2", - "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz", - "integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==", - "dev": true - }, - "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==", - "dev": true - }, - "node_modules/node-fetch": { - "version": "2.6.9", - "resolved": "https://registry.npmjs.org/node-fetch/-/node-fetch-2.6.9.tgz", - "integrity": "sha512-DJm/CJkZkRjKKj4Zi4BsKVZh3ValV5IR5s7LVZnW+6YMh0W1BfNA8XSs6DLMGYlId5F3KnA70uu2qepcR08Qqg==", - "dev": true, - "dependencies": { - "whatwg-url": "^5.0.0" - }, - "engines": { - "node": "4.x || >=6.0.0" - }, - "peerDependencies": { - "encoding": "^0.1.0" - }, - "peerDependenciesMeta": { - "encoding": { - "optional": true - } - } - }, - "node_modules/normalize-package-data": { - "version": "3.0.3", - "resolved": "https://registry.npmjs.org/normalize-package-data/-/normalize-package-data-3.0.3.tgz", - "integrity": "sha512-p2W1sgqij3zMMyRC067Dg16bfzVH+w7hyegmpIvZ4JNjqtGOVAIvLmjBx3yP7YTe9vKJgkoNOPjwQGogDoMXFA==", - "dev": true, - "dependencies": { - "hosted-git-info": "^4.0.1", - "is-core-module": "^2.5.0", - "semver": "^7.3.4", - "validate-npm-package-license": "^3.0.1" - }, - "engines": { - "node": ">=10" - } - }, - "node_modules/object-inspect": { - "version": "1.12.3", - "resolved": "https://registry.npmjs.org/object-inspect/-/object-inspect-1.12.3.tgz", - "integrity": "sha512-geUvdk7c+eizMNUDkRpW1wJwgfOiOeHbxBR/hLXK1aT6zmVSO0jsQcs7fj6MGw89jC/cjGfLcNOrtMYtGqm81g==", - "dev": true, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, - "node_modules/object-is": { - "version": "1.1.5", - "resolved": "https://registry.npmjs.org/object-is/-/object-is-1.1.5.tgz", - "integrity": "sha512-3cyDsyHgtmi7I7DfSSI2LDp6SK2lwvtbg0p0R1e0RvTqF5ceGx+K2dfSjm1bKDMVCFEDAQvy+o8c6a7VujOddw==", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-9.0.5.tgz", + "integrity": "sha512-G6T0ZX48xgozx7587koeX9Ys2NYy6Gmv//P89sEte9V9whIapMNF4idKxnW2QtCcLiTWlb/wfCabAtAFWhhBow==", "dev": true, + "license": "ISC", "dependencies": { - "call-bind": "^1.0.2", - "define-properties": "^1.1.3" + "brace-expansion": "^2.0.1" }, "engines": { - "node": ">= 0.4" + "node": ">=16 || 14 >=14.17" }, "funding": { - "url": "https://github.com/sponsors/ljharb" + "url": "https://github.com/sponsors/isaacs" } }, - "node_modules/object-keys": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/object-keys/-/object-keys-1.1.1.tgz", - "integrity": "sha512-NuAESUOUMrlIXOfHKzD6bpPu3tYt3xvjNdRIQ+FeT0lNb4K8WR70CaDxhuNguS2XG+GjkyMwOzsN5ZktImfhLA==", + "node_modules/minimist-options": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/minimist-options/-/minimist-options-4.1.0.tgz", + "integrity": "sha512-Q4r8ghd80yhO/0j1O3B2BjweX3fiHg9cdOwjJd2J76Q135c+NDxGCqdYKQ1SKBuFfgWbAUzBfvYjPUEeNgqN1A==", "dev": true, + "dependencies": { + "arrify": "^1.0.1", + "is-plain-obj": "^1.1.0", + "kind-of": "^6.0.3" + }, "engines": { - "node": ">= 0.4" + "node": ">= 6" } }, - "node_modules/object.assign": { - "version": "4.1.4", - "resolved": "https://registry.npmjs.org/object.assign/-/object.assign-4.1.4.tgz", - "integrity": "sha512-1mxKf0e58bvyjSCtKYY4sRe9itRk3PJpquJOjeIkz885CczcI4IvJJDLPS72oowuSh+pBxUFROpX+TU++hxhZQ==", + "node_modules/ms": { + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz", + "integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==", + "dev": true + }, + "node_modules/normalize-package-data": { + "version": "3.0.3", + "resolved": "https://registry.npmjs.org/normalize-package-data/-/normalize-package-data-3.0.3.tgz", + "integrity": "sha512-p2W1sgqij3zMMyRC067Dg16bfzVH+w7hyegmpIvZ4JNjqtGOVAIvLmjBx3yP7YTe9vKJgkoNOPjwQGogDoMXFA==", "dev": true, "dependencies": { - "call-bind": "^1.0.2", - "define-properties": "^1.1.4", - "has-symbols": "^1.0.3", - "object-keys": "^1.1.1" + "hosted-git-info": "^4.0.1", + "is-core-module": "^2.5.0", + "semver": "^7.3.4", + "validate-npm-package-license": "^3.0.1" }, "engines": { - "node": ">= 0.4" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" + "node": ">=10" } }, "node_modules/p-limit": { @@ -2441,12 +1576,6 @@ "node": ">=6" } }, - "node_modules/parchment": { - "version": "2.0.0-dev.2", - "resolved": "https://registry.npmjs.org/parchment/-/parchment-2.0.0-dev.2.tgz", - "integrity": "sha512-4fgRny4pPISoML08Zp7poi52Dff3E2G1ORTi2D/acJ/RiROdDAMDB6VcQNfBcmehrX5Wixp6dxh6JjLyE5yUNQ==", - "dev": true - }, "node_modules/parse-json": { "version": "5.2.0", "resolved": "https://registry.npmjs.org/parse-json/-/parse-json-5.2.0.tgz", @@ -2596,48 +1725,6 @@ "node": ">=8" } }, - "node_modules/quill": { - "version": "2.0.0-dev.4", - "resolved": "https://registry.npmjs.org/quill/-/quill-2.0.0-dev.4.tgz", - "integrity": "sha512-9WmMVCEIhf3lDdhzl+i+GBDeDl0BFi65waC4Im8Y4HudEJ9kEEb1lciAz9A8pcDmLMjiMbvz84lNt/U5OBS8Vg==", - "dev": true, - "dependencies": { - "clone": "^2.1.2", - "deep-equal": "^2.0.2", - "eventemitter3": "^4.0.0", - "extend": "^3.0.2", - "parchment": "2.0.0-dev.2", - "quill-delta": "4.2.1" - } - }, - "node_modules/quill-delta": { - "version": "4.2.1", - "resolved": "https://registry.npmjs.org/quill-delta/-/quill-delta-4.2.1.tgz", - "integrity": "sha512-Y2nksOj6Q+4hizre8n0dml76vLNGK4/y86EoI1d7rv6EL1bx7DPDYRmqQMPu1UqFQO/uQuVHQ3fOmm4ZSzWrfA==", - "dev": true, - "dependencies": { - "deep-equal": "^1.0.1", - "extend": "^3.0.2", - "fast-diff": "1.2.0" - } - }, - "node_modules/quill-delta/node_modules/deep-equal": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/deep-equal/-/deep-equal-1.1.1.tgz", - "integrity": "sha512-yd9c5AdiqVcR+JjcwUQb9DkhJc8ngNr0MahEBGvDiJw8puWab2yZlh+nkasOnZP+EGTAP6rRp2JzJhJZzvNF8g==", - "dev": true, - "dependencies": { - "is-arguments": "^1.0.4", - "is-date-object": "^1.0.1", - "is-regex": "^1.0.4", - "object-is": "^1.0.1", - "object-keys": "^1.1.1", - "regexp.prototype.flags": "^1.2.0" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, "node_modules/react-is": { "version": "18.2.0", "resolved": "https://registry.npmjs.org/react-is/-/react-is-18.2.0.tgz", @@ -2734,44 +1821,6 @@ "node": ">=8" } }, - "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==", - "dev": true, - "dependencies": { - "@babel/runtime": "^7.9.2" - } - }, - "node_modules/regenerator-runtime": { - "version": "0.13.11", - "resolved": "https://registry.npmjs.org/regenerator-runtime/-/regenerator-runtime-0.13.11.tgz", - "integrity": "sha512-kY1AZVr2Ra+t+piVaJ4gxaFaReZVH40AKNo7UCX6W+dEwBo/2oZJzqfuN1qLq1oL45o56cPaTXELwrTh8Fpggg==", - "dev": true - }, - "node_modules/regexp.prototype.flags": { - "version": "1.5.0", - "resolved": "https://registry.npmjs.org/regexp.prototype.flags/-/regexp.prototype.flags-1.5.0.tgz", - "integrity": "sha512-0SutC3pNudRKgquxGoRGIz946MZVHqbNfPjBdxeOhBrdgDKlRoXmYLQN9xRbrR09ZXWeGAdPuif7egofn6v5LA==", - "dev": true, - "dependencies": { - "call-bind": "^1.0.2", - "define-properties": "^1.2.0", - "functions-have-names": "^1.2.3" - }, - "engines": { - "node": ">= 0.4" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, - "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==", - "dev": true - }, "node_modules/resolve": { "version": "1.22.2", "resolved": "https://registry.npmjs.org/resolve/-/resolve-1.22.2.tgz", @@ -2837,26 +1886,6 @@ "node": ">=10" } }, - "node_modules/side-channel": { - "version": "1.0.4", - "resolved": "https://registry.npmjs.org/side-channel/-/side-channel-1.0.4.tgz", - "integrity": "sha512-q5XPytqFEIKHkGdiMIrY10mvLRvnQh42/+GoBlFW3b2LXLE2xxJpZFdm94we0BaoV3RwJyGqg5wS7epxTv0Zvw==", - "dev": true, - "dependencies": { - "call-bind": "^1.0.0", - "get-intrinsic": "^1.0.2", - "object-inspect": "^1.9.0" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, - "node_modules/signature_pad": { - "version": "4.1.5", - "resolved": "https://registry.npmjs.org/signature_pad/-/signature_pad-4.1.5.tgz", - "integrity": "sha512-VOE846UbQMeLBbcR08KwjwE1wNLgp3gqC7yr/AELkgSMs/BdRpxIZna6K5XyZJpA7IWq9GiInw1C8PLm57VO6Q==", - "dev": true - }, "node_modules/slash": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/slash/-/slash-3.0.0.tgz", @@ -2875,12 +1904,6 @@ "node": ">=0.10.0" } }, - "node_modules/spark-md5": { - "version": "2.0.2", - "resolved": "https://registry.npmjs.org/spark-md5/-/spark-md5-2.0.2.tgz", - "integrity": "sha512-9WfT+FYBEvlrOOBEs484/zmbtSX4BlGjzXih1qIEWA1yhHbcqgcMHkiwXoWk2Sq1aJjLpcs6ZKV7JxrDNjIlNg==", - "dev": true - }, "node_modules/spdx-correct": { "version": "3.2.0", "resolved": "https://registry.npmjs.org/spdx-correct/-/spdx-correct-3.2.0.tgz", @@ -2913,24 +1936,6 @@ "integrity": "sha512-XkD+zwiqXHikFZm4AX/7JSCXA98U5Db4AFd5XUg/+9UNtnH75+Z9KxtpYiJZx36mUDVOwH83pl7yvCer6ewM3w==", "dev": true }, - "node_modules/stop-iteration-iterator": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/stop-iteration-iterator/-/stop-iteration-iterator-1.0.0.tgz", - "integrity": "sha512-iCGQj+0l0HOdZ2AEeBADlsRC+vsnDsZsbdSiH1yNSjcfKM7fdpCMfqAL/dwF5BLiw/XhRft/Wax6zQbhq2BcjQ==", - "dev": true, - "dependencies": { - "internal-slot": "^1.0.4" - }, - "engines": { - "node": ">= 0.4" - } - }, - "node_modules/string-hash": { - "version": "1.1.3", - "resolved": "https://registry.npmjs.org/string-hash/-/string-hash-1.1.3.tgz", - "integrity": "sha512-kJUvRUFK49aub+a7T1nNE66EJbZBMnBgoC1UbCZ5n6bsZKBRga4KgBRTMn/pFkeCZSYtNeSyMxPDM0AXWELk2A==", - "dev": true - }, "node_modules/string-width": { "version": "4.2.3", "resolved": "https://registry.npmjs.org/string-width/-/string-width-4.2.3.tgz", @@ -3027,21 +2032,6 @@ "url": "https://github.com/sponsors/ljharb" } }, - "node_modules/ticky": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/ticky/-/ticky-1.0.1.tgz", - "integrity": "sha512-RX35iq/D+lrsqhcPWIazM9ELkjOe30MSeoBHQHSsRwd1YuhJO5ui1K1/R0r7N3mFvbLBs33idw+eR6j+w6i/DA==", - "dev": true - }, - "node_modules/tippy.js": { - "version": "6.3.7", - "resolved": "https://registry.npmjs.org/tippy.js/-/tippy.js-6.3.7.tgz", - "integrity": "sha512-E1d3oP2emgJ9dRQZdf3Kkn0qJgI6ZLpyS5z6ZkY1DF3kaQaBsGZsndEpHwx+eC+tYM41HaSNvNtLx8tU57FzTQ==", - "dev": true, - "dependencies": { - "@popperjs/core": "^2.9.0" - } - }, "node_modules/to-fast-properties": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/to-fast-properties/-/to-fast-properties-2.0.0.tgz", @@ -3063,12 +2053,6 @@ "node": ">=8.0" } }, - "node_modules/tr46": { - "version": "0.0.3", - "resolved": "https://registry.npmjs.org/tr46/-/tr46-0.0.3.tgz", - "integrity": "sha512-N3WMsuqV66lT30CrXNbEjx4GEwlow3v6rr4mCcv6prnfwhS01rkgyFdjPNBYd9br7LpXV1+Emh01fHnq2Gdgrw==", - "dev": true - }, "node_modules/trim-newlines": { "version": "3.0.1", "resolved": "https://registry.npmjs.org/trim-newlines/-/trim-newlines-3.0.1.tgz", @@ -3157,15 +2141,6 @@ "dev": true, "license": "MIT" }, - "node_modules/uuid": { - "version": "8.3.2", - "resolved": "https://registry.npmjs.org/uuid/-/uuid-8.3.2.tgz", - "integrity": "sha512-+NYs2QeMWy+GWFOEm9xnn6HCDp0l7QBD7ml8zLUmJ+93Q5NF0NocErnwkTkXVFNiX3/fpC6afS8Dhb/gz7R7eg==", - "dev": true, - "bin": { - "uuid": "dist/bin/uuid" - } - }, "node_modules/validate-npm-package-license": { "version": "3.0.4", "resolved": "https://registry.npmjs.org/validate-npm-package-license/-/validate-npm-package-license-3.0.4.tgz", @@ -3176,82 +2151,6 @@ "spdx-expression-parse": "^3.0.0" } }, - "node_modules/vanilla-picker": { - "version": "2.12.1", - "resolved": "https://registry.npmjs.org/vanilla-picker/-/vanilla-picker-2.12.1.tgz", - "integrity": "sha512-2qrEP9VYylKXbyzXKsbu2dferBTvqnlsr29XjHwFE+/MEp0VNj6oEUESLDtKZ7DWzGdSv1x/+ujqFZF+KsO3cg==", - "dev": true, - "dependencies": { - "@sphinxxxx/color-conversion": "^2.2.2" - } - }, - "node_modules/webidl-conversions": { - "version": "3.0.1", - "resolved": "https://registry.npmjs.org/webidl-conversions/-/webidl-conversions-3.0.1.tgz", - "integrity": "sha512-2JAn3z8AR6rjK8Sm8orRC0h/bcl/DqL7tRPdGZ4I1CjdF+EaMLmYxBHyXuKL849eucPFhvBoxMsflfOb8kxaeQ==", - "dev": true - }, - "node_modules/whatwg-url": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/whatwg-url/-/whatwg-url-5.0.0.tgz", - "integrity": "sha512-saE57nupxk6v3HY35+jzBwYa0rKSy0XR8JSxZPwgLr7ys0IBzhGviA1/TUGJLmSVqs8pb9AnvICXEuOHLprYTw==", - "dev": true, - "dependencies": { - "tr46": "~0.0.3", - "webidl-conversions": "^3.0.0" - } - }, - "node_modules/which-boxed-primitive": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/which-boxed-primitive/-/which-boxed-primitive-1.0.2.tgz", - "integrity": "sha512-bwZdv0AKLpplFY2KZRX6TvyuN7ojjr7lwkg6ml0roIy9YeuSr7JS372qlNW18UQYzgYK9ziGcerWqZOmEn9VNg==", - "dev": true, - "dependencies": { - "is-bigint": "^1.0.1", - "is-boolean-object": "^1.1.0", - "is-number-object": "^1.0.4", - "is-string": "^1.0.5", - "is-symbol": "^1.0.3" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, - "node_modules/which-collection": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/which-collection/-/which-collection-1.0.1.tgz", - "integrity": "sha512-W8xeTUwaln8i3K/cY1nGXzdnVZlidBcagyNFtBdD5kxnb4TvGKR7FfSIS3mYpwWS1QUCutfKz8IY8RjftB0+1A==", - "dev": true, - "dependencies": { - "is-map": "^2.0.1", - "is-set": "^2.0.1", - "is-weakmap": "^2.0.1", - "is-weakset": "^2.0.1" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, - "node_modules/which-typed-array": { - "version": "1.1.9", - "resolved": "https://registry.npmjs.org/which-typed-array/-/which-typed-array-1.1.9.tgz", - "integrity": "sha512-w9c4xkx6mPidwp7180ckYWfMmvxpjlZuIudNtDf4N/tTAUB8VJbX25qZoAsrtGuYNnGw3pa0AXgbGKRB8/EceA==", - "dev": true, - "dependencies": { - "available-typed-arrays": "^1.0.5", - "call-bind": "^1.0.2", - "for-each": "^0.3.3", - "gopd": "^1.0.1", - "has-tostringtag": "^1.0.0", - "is-typed-array": "^1.1.10" - }, - "engines": { - "node": ">= 0.4" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, "node_modules/yallist": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/yallist/-/yallist-4.0.0.tgz", @@ -3405,15 +2304,6 @@ "integrity": "sha512-uVsWNvlVsIninV2prNz/3lHCb+5CJ+e+IUBfbjToAHODtfGYLfCFuY4AU7TskI+dAKk+njsPiBjq1gKTvZOBaw==", "dev": true }, - "@babel/runtime": { - "version": "7.21.5", - "resolved": "https://registry.npmjs.org/@babel/runtime/-/runtime-7.21.5.tgz", - "integrity": "sha512-8jI69toZqqcsnqGGqwGS4Qb1VwLOEp4hz+CXPywcvjs60u3B4Pom/U/7rm4W8tMOYEB+E9wgD0mW1l3r8qlI9Q==", - "dev": true, - "requires": { - "regenerator-runtime": "^0.13.11" - } - }, "@babel/template": { "version": "7.22.15", "resolved": "https://registry.npmjs.org/@babel/template/-/template-7.22.15.tgz", @@ -3491,44 +2381,6 @@ "to-fast-properties": "^2.0.0" } }, - "@formio/bootstrap3": { - "version": "2.12.2", - "resolved": "https://registry.npmjs.org/@formio/bootstrap3/-/bootstrap3-2.12.2.tgz", - "integrity": "sha512-Y1WD/U22HHKRl1MzUt65bXeFHYO9Wlt+wefRqXFrOhIgbmkfTjCx6e0n2b8t/IYz9FUMg+/GTKdqaBrTZgjrTA==", - "dev": true, - "requires": { - "resize-observer-polyfill": "^1.5.1" - } - }, - "@formio/choices.js": { - "version": "9.0.1", - "resolved": "https://registry.npmjs.org/@formio/choices.js/-/choices.js-9.0.1.tgz", - "integrity": "sha512-+JQRWH0yhaeemVJGE1L4oPe9KPFhipzDlms3Pd31gePXpy8q7Mf3Is54/f0fc88+mWeMjK4GyIhcKIKmuGx5Xw==", - "dev": true, - "requires": { - "deepmerge": "^4.2.0", - "fuse.js": "^3.4.5", - "redux": "^4.0.4" - } - }, - "@formio/semantic": { - "version": "2.6.0", - "resolved": "https://registry.npmjs.org/@formio/semantic/-/semantic-2.6.0.tgz", - "integrity": "sha512-RwMEVXkyz+B6RivflrrKIqvvnGR/eZDLQs74u67StcrzO6n3/5D2J8XqTQRSUzQzr5QV6Wq0eZ51z/+mGm6THw==", - "dev": true - }, - "@formio/text-mask-addons": { - "version": "3.8.0-formio.2", - "resolved": "https://registry.npmjs.org/@formio/text-mask-addons/-/text-mask-addons-3.8.0-formio.2.tgz", - "integrity": "sha512-H4Sm+1Sx59jbrlKxtKbzethhp5OIcP8Oi4JBpsvH/SB8P/KCRmtjKbN5ACqURnXmYtBHLJC6Yr9KZibOVRGxpA==", - "dev": true - }, - "@formio/vanilla-text-mask": { - "version": "5.1.1-formio.1", - "resolved": "https://registry.npmjs.org/@formio/vanilla-text-mask/-/vanilla-text-mask-5.1.1-formio.1.tgz", - "integrity": "sha512-rYBlvIPMNUd6sAaduOaiIwI4vfTAjHDRonko2qJn2RP1O//TQ7rcFIPYVYePJZ4OtOpwHiHAvAIh79McphZotQ==", - "dev": true - }, "@gerrit0/mini-shiki": { "version": "3.8.1", "resolved": "https://registry.npmjs.org/@gerrit0/mini-shiki/-/mini-shiki-3.8.1.tgz", @@ -3616,12 +2468,6 @@ "fastq": "^1.6.0" } }, - "@popperjs/core": { - "version": "2.11.7", - "resolved": "https://registry.npmjs.org/@popperjs/core/-/core-2.11.7.tgz", - "integrity": "sha512-Cr4OjIkipTtcXKjAsm8agyleBuDHvxzeBoa1v543lbv1YaIwQjESsVcmjiWiPEbC1FIeHOG/Op9kdCmAmiS3Kw==", - "dev": true - }, "@shikijs/engine-oniguruma": { "version": "3.8.1", "resolved": "https://registry.npmjs.org/@shikijs/engine-oniguruma/-/engine-oniguruma-3.8.1.tgz", @@ -3672,12 +2518,6 @@ "integrity": "sha512-XJfwUVUKDHF5ugKwIcxEgc9k8b7HbznCp6eUfWgu710hMPNIO4aw4/zB5RogDQz8nd6gyCDpU9O/m6qYEWY6yQ==", "dev": true }, - "@sphinxxxx/color-conversion": { - "version": "2.2.2", - "resolved": "https://registry.npmjs.org/@sphinxxxx/color-conversion/-/color-conversion-2.2.2.tgz", - "integrity": "sha512-XExJS3cLqgrmNBIP3bBw6+1oQ1ksGjFh0+oClDKFYpCCqx/hlqwWO5KO/S63fzUo67SxI9dMrF0y5T/Ey7h8Zw==", - "dev": true - }, "@trivago/prettier-plugin-sort-imports": { "version": "4.3.0", "resolved": "https://registry.npmjs.org/@trivago/prettier-plugin-sort-imports/-/prettier-plugin-sort-imports-4.3.0.tgz", @@ -3777,16 +2617,6 @@ "integrity": "sha512-8+9WqebbFzpX9OR+Wa6O29asIogeRMzcGtAINdpMHHyAg10f05aSFVBbcEqGf/PXw1EjAZ+q2/bEBg3DvurK3Q==", "dev": true }, - "array-buffer-byte-length": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/array-buffer-byte-length/-/array-buffer-byte-length-1.0.0.tgz", - "integrity": "sha512-LPuwb2P+NrQw3XhxGc36+XSvuBPopovXYTR9Ew++Du9Yb/bx5AzBfrIsBoj0EZUifjQU+sHL21sseZ3jerWO/A==", - "dev": true, - "requires": { - "call-bind": "^1.0.2", - "is-array-buffer": "^3.0.1" - } - }, "array-union": { "version": "2.1.0", "resolved": "https://registry.npmjs.org/array-union/-/array-union-2.1.0.tgz", @@ -3799,24 +2629,6 @@ "integrity": "sha512-3CYzex9M9FGQjCGMGyi6/31c8GJbgb0qGyrx5HWxPd0aCwh4cB2YjMb2Xf9UuoogrMrlO9cTqnB5rI5GHZTcUA==", "dev": true }, - "atoa": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/atoa/-/atoa-1.0.0.tgz", - "integrity": "sha512-VVE1H6cc4ai+ZXo/CRWoJiHXrA1qfA31DPnx6D20+kSI547hQN5Greh51LQ1baMRMfxO5K5M4ImMtZbZt2DODQ==", - "dev": true - }, - "autocompleter": { - "version": "6.1.3", - "resolved": "https://registry.npmjs.org/autocompleter/-/autocompleter-6.1.3.tgz", - "integrity": "sha512-Pjb5R5r+S0/zDFudLP9a8CW7/xMc7O/uVCtaTf3f+RdNLAQQ5oUG018c3IRdDJMRVvT+OeZ1NYQoUH5GHlORKQ==", - "dev": true - }, - "available-typed-arrays": { - "version": "1.0.5", - "resolved": "https://registry.npmjs.org/available-typed-arrays/-/available-typed-arrays-1.0.5.tgz", - "integrity": "sha512-DMD0KiN46eipeziST1LPP/STfDU0sufISXmjSgvVsoU2tqxctQeASejWcfNtxYKqETM1UxQ8sp2OrSBWpHY6sw==", - "dev": true - }, "balanced-match": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.2.tgz", @@ -3841,31 +2653,6 @@ "fill-range": "^7.1.1" } }, - "browser-cookies": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/browser-cookies/-/browser-cookies-1.2.0.tgz", - "integrity": "sha512-cg2WuoOJo+F+g2XjEaP8nmeRp1vDHjt7sqpKJMsTNXKrpyIBNVslYJeehvs6FEddj8usV2+qyRSBEX244yN5/g==", - "dev": true - }, - "browser-md5-file": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/browser-md5-file/-/browser-md5-file-1.1.1.tgz", - "integrity": "sha512-9h2UViTtZPhBa7oHvp5mb7MvJaX5OKEPUsplDwJ800OIV+In7BOR3RXOMB78obn2iQVIiS3WkVLhG7Zu1EMwbw==", - "dev": true, - "requires": { - "spark-md5": "^2.0.2" - } - }, - "call-bind": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/call-bind/-/call-bind-1.0.2.tgz", - "integrity": "sha512-7O+FbCihrB5WGbFYesctwmTKae6rOiIzmz1icreWJ+0aA7LJfuqhEso2T9ncpcFtzMQtzXf2QGGueWJGTYsqrA==", - "dev": true, - "requires": { - "function-bind": "^1.1.1", - "get-intrinsic": "^1.0.2" - } - }, "camelcase": { "version": "5.3.1", "resolved": "https://registry.npmjs.org/camelcase/-/camelcase-5.3.1.tgz", @@ -3894,12 +2681,6 @@ "supports-color": "^5.3.0" } }, - "clone": { - "version": "2.1.2", - "resolved": "https://registry.npmjs.org/clone/-/clone-2.1.2.tgz", - "integrity": "sha512-3Pe/CF1Nn94hyhIYpjtiLhdCoEoz0DqQ+988E9gmeEdQZlojxnOb74wctFyuwWQHzqyf9X7C7MG8juUpqBJT8w==", - "dev": true - }, "color-convert": { "version": "1.9.3", "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-1.9.3.tgz", @@ -3915,49 +2696,6 @@ "integrity": "sha512-72fSenhMw2HZMTVHeCA9KCmpEIbzWiQsjN+BHcBbS9vr1mtt+vJjPdksIBNUmKAW8TFUDPJK5SUU3QhE9NEXDw==", "dev": true }, - "compare-versions": { - "version": "4.1.4", - "resolved": "https://registry.npmjs.org/compare-versions/-/compare-versions-4.1.4.tgz", - "integrity": "sha512-FemMreK9xNyL8gQevsdRMrvO4lFCkQP7qbuktn1q8ndcNk1+0mz7lgE7b/sNvbhVgY4w6tMN1FDp6aADjqw2rw==", - "dev": true - }, - "contra": { - "version": "1.9.4", - "resolved": "https://registry.npmjs.org/contra/-/contra-1.9.4.tgz", - "integrity": "sha512-N9ArHAqwR/lhPq4OdIAwH4e1btn6EIZMAz4TazjnzCiVECcWUPTma+dRAM38ERImEJBh8NiCCpjoQruSZ+agYg==", - "dev": true, - "requires": { - "atoa": "1.0.0", - "ticky": "1.0.1" - } - }, - "core-js": { - "version": "3.30.1", - "resolved": "https://registry.npmjs.org/core-js/-/core-js-3.30.1.tgz", - "integrity": "sha512-ZNS5nbiSwDTq4hFosEDqm65izl2CWmLz0hARJMyNQBgkUZMIF51cQiMvIQKA6hvuaeWxQDP3hEedM1JZIgTldQ==", - "dev": true - }, - "crossvent": { - "version": "1.5.5", - "resolved": "https://registry.npmjs.org/crossvent/-/crossvent-1.5.5.tgz", - "integrity": "sha512-MY4xhBYEnVi+pmTpHCOCsCLYczc0PVtGdPBz6NXNXxikLaUZo4HdAeUb1UqAo3t3yXAloSelTmfxJ+/oUqkW5w==", - "dev": true, - "requires": { - "custom-event": "^1.0.0" - } - }, - "custom-event": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/custom-event/-/custom-event-1.0.1.tgz", - "integrity": "sha512-GAj5FOq0Hd+RsCGVJxZuKaIDXDf3h6GQoNEjFgbLLI/trgtavwUbSnZ5pVfg27DVCaWjIohryS0JFwIJyT2cMg==", - "dev": true - }, - "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==", - "dev": true - }, "debug": { "version": "4.3.4", "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.4.tgz", @@ -3991,54 +2729,6 @@ } } }, - "deep-equal": { - "version": "2.2.1", - "resolved": "https://registry.npmjs.org/deep-equal/-/deep-equal-2.2.1.tgz", - "integrity": "sha512-lKdkdV6EOGoVn65XaOsPdH4rMxTZOnmFyuIkMjM1i5HHCbfjC97dawgTAy0deYNfuqUqW+Q5VrVaQYtUpSd6yQ==", - "dev": true, - "requires": { - "array-buffer-byte-length": "^1.0.0", - "call-bind": "^1.0.2", - "es-get-iterator": "^1.1.3", - "get-intrinsic": "^1.2.0", - "is-arguments": "^1.1.1", - "is-array-buffer": "^3.0.2", - "is-date-object": "^1.0.5", - "is-regex": "^1.1.4", - "is-shared-array-buffer": "^1.0.2", - "isarray": "^2.0.5", - "object-is": "^1.1.5", - "object-keys": "^1.1.1", - "object.assign": "^4.1.4", - "regexp.prototype.flags": "^1.5.0", - "side-channel": "^1.0.4", - "which-boxed-primitive": "^1.0.2", - "which-collection": "^1.0.1", - "which-typed-array": "^1.1.9" - } - }, - "deepmerge": { - "version": "4.3.1", - "resolved": "https://registry.npmjs.org/deepmerge/-/deepmerge-4.3.1.tgz", - "integrity": "sha512-3sUqbMEc77XqpdNO7FRyRog+eW3ph+GYCbj+rK+uYyRMuwsVy0rMiVtPn+QJlKFvWP/1PYpapqYn0Me2knFn+A==", - "dev": true - }, - "define-properties": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/define-properties/-/define-properties-1.2.0.tgz", - "integrity": "sha512-xvqAVKGfT1+UAvPwKTVw/njhdQ8ZhXK4lI0bCIuCMrp2up9nPnaDftrLtmpTazqd1o+UY4zgzU+avtMbDP+ldA==", - "dev": true, - "requires": { - "has-property-descriptors": "^1.0.0", - "object-keys": "^1.1.1" - } - }, - "dialog-polyfill": { - "version": "0.5.6", - "resolved": "https://registry.npmjs.org/dialog-polyfill/-/dialog-polyfill-0.5.6.tgz", - "integrity": "sha512-ZbVDJI9uvxPAKze6z146rmfUZjBqNEwcnFTVamQzXH+svluiV7swmVIGr7miwADgfgt1G2JQIytypM9fbyhX4w==", - "dev": true - }, "diff-sequences": { "version": "29.4.3", "resolved": "https://registry.npmjs.org/diff-sequences/-/diff-sequences-29.4.3.tgz", @@ -4054,28 +2744,6 @@ "path-type": "^4.0.0" } }, - "dompurify": { - "version": "2.5.8", - "resolved": "https://registry.npmjs.org/dompurify/-/dompurify-2.5.8.tgz", - "integrity": "sha512-o1vSNgrmYMQObbSSvF/1brBYEQPHhV1+gsmrusO7/GXtp1T9rCS8cXFqVxK/9crT1jA6Ccv+5MTSjBNqr7Sovw==", - "dev": true - }, - "downloadjs": { - "version": "1.4.7", - "resolved": "https://registry.npmjs.org/downloadjs/-/downloadjs-1.4.7.tgz", - "integrity": "sha512-LN1gO7+u9xjU5oEScGFKvXhYf7Y/empUIIEAGBs1LzUq/rg5duiDrkuH5A2lQGd5jfMOb9X9usDa2oVXwJ0U/Q==", - "dev": true - }, - "dragula": { - "version": "3.7.3", - "resolved": "https://registry.npmjs.org/dragula/-/dragula-3.7.3.tgz", - "integrity": "sha512-/rRg4zRhcpf81TyDhaHLtXt6sEywdfpv1cRUMeFFy7DuypH2U0WUL0GTdyAQvXegviT4PJK4KuMmOaIDpICseQ==", - "dev": true, - "requires": { - "contra": "1.9.4", - "crossvent": "1.5.5" - } - }, "emoji-regex": { "version": "8.0.0", "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-8.0.0.tgz", @@ -4097,23 +2765,6 @@ "is-arrayish": "^0.2.1" } }, - "es-get-iterator": { - "version": "1.1.3", - "resolved": "https://registry.npmjs.org/es-get-iterator/-/es-get-iterator-1.1.3.tgz", - "integrity": "sha512-sPZmqHBe6JIiTfN5q2pEi//TwxmAFHwj/XEuYjTuse78i8KxaqMTTzxPoFKuzRpDpTJ+0NAbpfenkmH2rePtuw==", - "dev": true, - "requires": { - "call-bind": "^1.0.2", - "get-intrinsic": "^1.1.3", - "has-symbols": "^1.0.3", - "is-arguments": "^1.1.1", - "is-map": "^2.0.2", - "is-set": "^2.0.2", - "is-string": "^1.0.7", - "isarray": "^2.0.5", - "stop-iteration-iterator": "^1.0.0" - } - }, "escape-string-regexp": { "version": "1.0.5", "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz", @@ -4185,36 +2836,12 @@ "has-flag": "^4.0.0" } } - } - }, - "eslint-rule-docs": { - "version": "1.1.235", - "resolved": "https://registry.npmjs.org/eslint-rule-docs/-/eslint-rule-docs-1.1.235.tgz", - "integrity": "sha512-+TQ+x4JdTnDoFEXXb3fDvfGOwnyNV7duH8fXWTPD1ieaBmB8omj7Gw/pMBBu4uI2uJCCU8APDaQJzWuXnTsH4A==", - "dev": true - }, - "eventemitter3": { - "version": "4.0.7", - "resolved": "https://registry.npmjs.org/eventemitter3/-/eventemitter3-4.0.7.tgz", - "integrity": "sha512-8guHBZCwKnFhYdHr2ysuRWErTwhoN2X8XELRlrRwpmfeY2jjuUN4taQMsULKUVo1K4DvZl+0pgfyoysHxvmvEw==", - "dev": true - }, - "extend": { - "version": "3.0.2", - "resolved": "https://registry.npmjs.org/extend/-/extend-3.0.2.tgz", - "integrity": "sha512-fjquC59cD7CyW6urNXK0FBufkZcoiGG80wTuPujX590cB5Ttln20E2UB4S/WARVqhXffZl2LNgS+gQdPIIim/g==", - "dev": true - }, - "fast-deep-equal": { - "version": "3.1.3", - "resolved": "https://registry.npmjs.org/fast-deep-equal/-/fast-deep-equal-3.1.3.tgz", - "integrity": "sha512-f3qQ9oQy9j2AhBe/H9VC91wLmKBCCU/gDOnKNAYG5hswO7BLKj09Hc5HYNz9cGI++xlpDCIgDaitVs03ATR84Q==", - "dev": true + } }, - "fast-diff": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/fast-diff/-/fast-diff-1.2.0.tgz", - "integrity": "sha512-xJuoT5+L99XlZ8twedaRf6Ax2TgQVxvgZOYoPKqZufmJib0tL2tegPBOZb1pVNgIhlqDlA0eO0c3wBvQcmzx4w==", + "eslint-rule-docs": { + "version": "1.1.235", + "resolved": "https://registry.npmjs.org/eslint-rule-docs/-/eslint-rule-docs-1.1.235.tgz", + "integrity": "sha512-+TQ+x4JdTnDoFEXXb3fDvfGOwnyNV7duH8fXWTPD1ieaBmB8omj7Gw/pMBBu4uI2uJCCU8APDaQJzWuXnTsH4A==", "dev": true }, "fast-glob": { @@ -4230,12 +2857,6 @@ "micromatch": "^4.0.4" } }, - "fast-json-patch": { - "version": "3.1.1", - "resolved": "https://registry.npmjs.org/fast-json-patch/-/fast-json-patch-3.1.1.tgz", - "integrity": "sha512-vf6IHUX2SBcA+5/+4883dsIjpBTqmfBjmYiWK1savxQmFk4JfBMLa7ynTYOs1Rolp/T1betJxHiGD3g1Mn8lUQ==", - "dev": true - }, "fastq": { "version": "1.15.0", "resolved": "https://registry.npmjs.org/fastq/-/fastq-1.15.0.tgz", @@ -4245,15 +2866,6 @@ "reusify": "^1.0.4" } }, - "fetch-ponyfill": { - "version": "7.1.0", - "resolved": "https://registry.npmjs.org/fetch-ponyfill/-/fetch-ponyfill-7.1.0.tgz", - "integrity": "sha512-FhbbL55dj/qdVO3YNK7ZEkshvj3eQ7EuIGV2I6ic/2YiocvyWv+7jg2s4AyS0wdRU75s3tA8ZxI/xPigb0v5Aw==", - "dev": true, - "requires": { - "node-fetch": "~2.6.1" - } - }, "fill-range": { "version": "7.1.1", "resolved": "https://registry.npmjs.org/fill-range/-/fill-range-7.1.1.tgz", @@ -4273,88 +2885,12 @@ "path-exists": "^4.0.0" } }, - "for-each": { - "version": "0.3.3", - "resolved": "https://registry.npmjs.org/for-each/-/for-each-0.3.3.tgz", - "integrity": "sha512-jqYfLp7mo9vIyQf8ykW2v7A+2N4QjeCeI5+Dz9XraiO1ign81wjiH7Fb9vSOWvQfNtmSa4H2RoQTrrXivdUZmw==", - "dev": true, - "requires": { - "is-callable": "^1.1.3" - } - }, - "formiojs": { - "version": "4.14.13", - "resolved": "https://registry.npmjs.org/formiojs/-/formiojs-4.14.13.tgz", - "integrity": "sha512-x8ZFYexjc6hYL9sVT6vv6YUId9adq8g84sOB92ZH6MEOw3OyDfaTzVUrb4oo7zlEHZw2UC4CNKrIHoXffwYN3Q==", - "dev": true, - "requires": { - "@formio/bootstrap3": "^2.12.2", - "@formio/choices.js": "^9.0.1", - "@formio/semantic": "^2.6.0", - "@formio/text-mask-addons": "^3.8.0-formio.2", - "@formio/vanilla-text-mask": "^5.1.1-formio.1", - "autocompleter": "^6.1.2", - "browser-cookies": "^1.2.0", - "browser-md5-file": "^1.1.1", - "compare-versions": "^4.1.3", - "core-js": "^3.21.1", - "custom-event-polyfill": "^1.0.7", - "dialog-polyfill": "^0.5.6", - "dompurify": "^2.3.4", - "downloadjs": "^1.4.7", - "dragula": "^3.7.3", - "eventemitter3": "^4.0.7", - "fast-deep-equal": "^3.1.3", - "fast-json-patch": "^3.1.0", - "fetch-ponyfill": "^7.1.0", - "i18next": "^21.6.0", - "idb": "^6.1.5", - "ismobilejs": "^1.1.1", - "json-logic-js": "^2.0.0", - "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", - "resize-observer-polyfill": "^1.5.1", - "signature_pad": "^4.0.4", - "string-hash": "^1.1.3", - "tippy.js": "^6.3.7", - "uuid": "^8.3.2", - "vanilla-picker": "^2.12.1" - } - }, "function-bind": { "version": "1.1.1", "resolved": "https://registry.npmjs.org/function-bind/-/function-bind-1.1.1.tgz", "integrity": "sha512-yIovAzMX49sF8Yl58fSCWJ5svSLuaibPxXQJFLmBObTuCr0Mf1KiPopGM9NiFjiYBCbfaa2Fh6breQ6ANVTI0A==", "dev": true }, - "functions-have-names": { - "version": "1.2.3", - "resolved": "https://registry.npmjs.org/functions-have-names/-/functions-have-names-1.2.3.tgz", - "integrity": "sha512-xckBUXyTIqT97tq2x2AMb+g163b5JFysYk0x4qxNFwbfQkmNZoiRHb6sPzI9/QV33WeuvVYBUIiD4NzNIyqaRQ==", - "dev": true - }, - "fuse.js": { - "version": "3.6.1", - "resolved": "https://registry.npmjs.org/fuse.js/-/fuse.js-3.6.1.tgz", - "integrity": "sha512-hT9yh/tiinkmirKrlv4KWOjztdoZo1mx9Qh4KvWqC7isoXwdUY3PNWUxceF4/qO9R6riA2C29jdTOeQOIROjgw==", - "dev": true - }, - "get-intrinsic": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/get-intrinsic/-/get-intrinsic-1.2.0.tgz", - "integrity": "sha512-L049y6nFOuom5wGyRc3/gdTLO94dySVKRACj1RmJZBQXlbTMhtNIgkWkUHq+jYmZvKf14EW1EoJnnjbmoHij0Q==", - "dev": true, - "requires": { - "function-bind": "^1.1.1", - "has": "^1.0.3", - "has-symbols": "^1.0.3" - } - }, "glob-parent": { "version": "5.1.2", "resolved": "https://registry.npmjs.org/glob-parent/-/glob-parent-5.1.2.tgz", @@ -4384,15 +2920,6 @@ "slash": "^3.0.0" } }, - "gopd": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/gopd/-/gopd-1.0.1.tgz", - "integrity": "sha512-d65bNlIadxvpb/A2abVdlqKqV563juRnZ1Wtk6s1sIR8uNsXR70xqIzVqxVf1eTqDunwT2MkczEeaezCKTZhwA==", - "dev": true, - "requires": { - "get-intrinsic": "^1.1.3" - } - }, "hard-rejection": { "version": "2.1.0", "resolved": "https://registry.npmjs.org/hard-rejection/-/hard-rejection-2.1.0.tgz", @@ -4408,42 +2935,12 @@ "function-bind": "^1.1.1" } }, - "has-bigints": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/has-bigints/-/has-bigints-1.0.2.tgz", - "integrity": "sha512-tSvCKtBr9lkF0Ex0aQiP9N+OpV4zi2r/Nee5VkRDbaqv35RLYMzbwQfFSZZH0kR+Rd6302UJZ2p/bJCEoR3VoQ==", - "dev": true - }, "has-flag": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-3.0.0.tgz", "integrity": "sha512-sKJf1+ceQBr4SMkvQnBDNDtf4TXpVhVGateu0t918bl30FnbE2m4vNLX+VWe/dpjlb+HugGYzW7uQXH98HPEYw==", "dev": true }, - "has-property-descriptors": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/has-property-descriptors/-/has-property-descriptors-1.0.0.tgz", - "integrity": "sha512-62DVLZGoiEBDHQyqG4w9xCuZ7eJEwNmJRWw2VY84Oedb7WFcA27fiEVe8oUQx9hAUJ4ekurquucTGwsyO1XGdQ==", - "dev": true, - "requires": { - "get-intrinsic": "^1.1.1" - } - }, - "has-symbols": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/has-symbols/-/has-symbols-1.0.3.tgz", - "integrity": "sha512-l3LCuF6MgDNwTDKkdYGEihYjt5pRPbEg46rtlmnSPlUbgmB8LOIrKJbYYFBSbnPaJexMKtiPO8hmeRjRz2Td+A==", - "dev": true - }, - "has-tostringtag": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/has-tostringtag/-/has-tostringtag-1.0.0.tgz", - "integrity": "sha512-kFjcSNhnlGV1kyoGk7OXKSawH5JOb/LzUc5w9B02hOTO0dfFRjbHQKvg1d6cf3HbeUmtU9VbbV3qzZ2Teh97WQ==", - "dev": true, - "requires": { - "has-symbols": "^1.0.2" - } - }, "hosted-git-info": { "version": "4.1.0", "resolved": "https://registry.npmjs.org/hosted-git-info/-/hosted-git-info-4.1.0.tgz", @@ -4453,21 +2950,6 @@ "lru-cache": "^6.0.0" } }, - "i18next": { - "version": "21.10.0", - "resolved": "https://registry.npmjs.org/i18next/-/i18next-21.10.0.tgz", - "integrity": "sha512-YeuIBmFsGjUfO3qBmMOc0rQaun4mIpGKET5WDwvu8lU7gvwpcariZLNtL0Fzj+zazcHUrlXHiptcFhBMFaxzfg==", - "dev": true, - "requires": { - "@babel/runtime": "^7.17.2" - } - }, - "idb": { - "version": "6.1.5", - "resolved": "https://registry.npmjs.org/idb/-/idb-6.1.5.tgz", - "integrity": "sha512-IJtugpKkiVXQn5Y+LteyBCNk1N8xpGV3wWZk9EVtZWH8DYkjBn0bX1XnGP9RkyZF0sAcywa6unHqSWKe7q4LGw==", - "dev": true - }, "ignore": { "version": "5.2.4", "resolved": "https://registry.npmjs.org/ignore/-/ignore-5.2.4.tgz", @@ -4480,75 +2962,18 @@ "integrity": "sha512-EdDDZu4A2OyIK7Lr/2zG+w5jmbuk1DVBnEwREQvBzspBJkCEbRa8GxU1lghYcaGJCnRWibjDXlq779X1/y5xwg==", "dev": true }, - "internal-slot": { - "version": "1.0.5", - "resolved": "https://registry.npmjs.org/internal-slot/-/internal-slot-1.0.5.tgz", - "integrity": "sha512-Y+R5hJrzs52QCG2laLn4udYVnxsfny9CpOhNhUvk/SSSVyF6T27FzRbF0sroPidSu3X8oEAkOn2K804mjpt6UQ==", - "dev": true, - "requires": { - "get-intrinsic": "^1.2.0", - "has": "^1.0.3", - "side-channel": "^1.0.4" - } - }, "irregular-plurals": { "version": "3.5.0", "resolved": "https://registry.npmjs.org/irregular-plurals/-/irregular-plurals-3.5.0.tgz", "integrity": "sha512-1ANGLZ+Nkv1ptFb2pa8oG8Lem4krflKuX/gINiHJHjJUKaJHk/SXk5x6K3J+39/p0h1RQ2saROclJJ+QLvETCQ==", "dev": true }, - "is-arguments": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/is-arguments/-/is-arguments-1.1.1.tgz", - "integrity": "sha512-8Q7EARjzEnKpt/PCD7e1cgUS0a6X8u5tdSiMqXhojOdoV9TsMsiO+9VLC5vAmO8N7/GmXn7yjR8qnA6bVAEzfA==", - "dev": true, - "requires": { - "call-bind": "^1.0.2", - "has-tostringtag": "^1.0.0" - } - }, - "is-array-buffer": { - "version": "3.0.2", - "resolved": "https://registry.npmjs.org/is-array-buffer/-/is-array-buffer-3.0.2.tgz", - "integrity": "sha512-y+FyyR/w8vfIRq4eQcM1EYgSTnmHXPqaF+IgzgraytCFq5Xh8lllDVmAZolPJiZttZLeFSINPYMaEJ7/vWUa1w==", - "dev": true, - "requires": { - "call-bind": "^1.0.2", - "get-intrinsic": "^1.2.0", - "is-typed-array": "^1.1.10" - } - }, "is-arrayish": { "version": "0.2.1", "resolved": "https://registry.npmjs.org/is-arrayish/-/is-arrayish-0.2.1.tgz", "integrity": "sha512-zz06S8t0ozoDXMG+ube26zeCTNXcKIPJZJi8hBrF4idCLms4CG9QtK7qBl1boi5ODzFpjswb5JPmHCbMpjaYzg==", "dev": true }, - "is-bigint": { - "version": "1.0.4", - "resolved": "https://registry.npmjs.org/is-bigint/-/is-bigint-1.0.4.tgz", - "integrity": "sha512-zB9CruMamjym81i2JZ3UMn54PKGsQzsJeo6xvN3HJJ4CAsQNB6iRutp2To77OfCNuoxspsIhzaPoO1zyCEhFOg==", - "dev": true, - "requires": { - "has-bigints": "^1.0.1" - } - }, - "is-boolean-object": { - "version": "1.1.2", - "resolved": "https://registry.npmjs.org/is-boolean-object/-/is-boolean-object-1.1.2.tgz", - "integrity": "sha512-gDYaKHJmnj4aWxyj6YHyXVpdQawtVLHU5cb+eztPGczf6cjuTdwve5ZIEfgXqH4e57An1D1AKf8CZ3kYrQRqYA==", - "dev": true, - "requires": { - "call-bind": "^1.0.2", - "has-tostringtag": "^1.0.0" - } - }, - "is-callable": { - "version": "1.2.7", - "resolved": "https://registry.npmjs.org/is-callable/-/is-callable-1.2.7.tgz", - "integrity": "sha512-1BC0BVFhS/p0qtw6enp8e+8OD0UrK0oFLztSjNzhcKA3WDuJxxAPXzPuPtKkjEY9UUoEWlX/8fgKeu2S8i9JTA==", - "dev": true - }, "is-core-module": { "version": "2.12.0", "resolved": "https://registry.npmjs.org/is-core-module/-/is-core-module-2.12.0.tgz", @@ -4558,15 +2983,6 @@ "has": "^1.0.3" } }, - "is-date-object": { - "version": "1.0.5", - "resolved": "https://registry.npmjs.org/is-date-object/-/is-date-object-1.0.5.tgz", - "integrity": "sha512-9YQaSxsAiSwcvS33MBk3wTCVnWK+HhF8VZR2jRxehM16QcVOdHqPn4VPHmRK4lSr38n9JriurInLcP90xsYNfQ==", - "dev": true, - "requires": { - "has-tostringtag": "^1.0.0" - } - }, "is-extglob": { "version": "2.1.1", "resolved": "https://registry.npmjs.org/is-extglob/-/is-extglob-2.1.1.tgz", @@ -4588,123 +3004,24 @@ "is-extglob": "^2.1.1" } }, - "is-map": { - "version": "2.0.2", - "resolved": "https://registry.npmjs.org/is-map/-/is-map-2.0.2.tgz", - "integrity": "sha512-cOZFQQozTha1f4MxLFzlgKYPTyj26picdZTx82hbc/Xf4K/tZOOXSCkMvU4pKioRXGDLJRn0GM7Upe7kR721yg==", - "dev": true - }, "is-number": { "version": "7.0.0", "resolved": "https://registry.npmjs.org/is-number/-/is-number-7.0.0.tgz", "integrity": "sha512-41Cifkg6e8TylSpdtTpeLVMqvSBEVzTttHvERD741+pnZ8ANv0004MRL43QKPDlK9cGvNp6NZWZUBlbGXYxxng==", "dev": true }, - "is-number-object": { - "version": "1.0.7", - "resolved": "https://registry.npmjs.org/is-number-object/-/is-number-object-1.0.7.tgz", - "integrity": "sha512-k1U0IRzLMo7ZlYIfzRu23Oh6MiIFasgpb9X76eqfFZAqwH44UI4KTBvBYIZ1dSL9ZzChTB9ShHfLkR4pdW5krQ==", - "dev": true, - "requires": { - "has-tostringtag": "^1.0.0" - } - }, "is-plain-obj": { "version": "1.1.0", "resolved": "https://registry.npmjs.org/is-plain-obj/-/is-plain-obj-1.1.0.tgz", "integrity": "sha512-yvkRyxmFKEOQ4pNXCmJG5AEQNlXJS5LaONXo5/cLdTZdWvsZ1ioJEonLGAosKlMWE8lwUy/bJzMjcw8az73+Fg==", "dev": true }, - "is-regex": { - "version": "1.1.4", - "resolved": "https://registry.npmjs.org/is-regex/-/is-regex-1.1.4.tgz", - "integrity": "sha512-kvRdxDsxZjhzUX07ZnLydzS1TU/TJlTUHHY4YLL87e37oUA49DfkLqgy+VjFocowy29cKvcSiu+kIv728jTTVg==", - "dev": true, - "requires": { - "call-bind": "^1.0.2", - "has-tostringtag": "^1.0.0" - } - }, - "is-set": { - "version": "2.0.2", - "resolved": "https://registry.npmjs.org/is-set/-/is-set-2.0.2.tgz", - "integrity": "sha512-+2cnTEZeY5z/iXGbLhPrOAaK/Mau5k5eXq9j14CpRTftq0pAJu2MwVRSZhyZWBzx3o6X795Lz6Bpb6R0GKf37g==", - "dev": true - }, - "is-shared-array-buffer": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/is-shared-array-buffer/-/is-shared-array-buffer-1.0.2.tgz", - "integrity": "sha512-sqN2UDu1/0y6uvXyStCOzyhAjCSlHceFoMKJW8W9EU9cvic/QdsZ0kEU93HEy3IUEFZIiH/3w+AH/UQbPHNdhA==", - "dev": true, - "requires": { - "call-bind": "^1.0.2" - } - }, - "is-string": { - "version": "1.0.7", - "resolved": "https://registry.npmjs.org/is-string/-/is-string-1.0.7.tgz", - "integrity": "sha512-tE2UXzivje6ofPW7l23cjDOMa09gb7xlAqG6jG5ej6uPV32TlWP3NKPigtaGeHNu9fohccRYvIiZMfOOnOYUtg==", - "dev": true, - "requires": { - "has-tostringtag": "^1.0.0" - } - }, - "is-symbol": { - "version": "1.0.4", - "resolved": "https://registry.npmjs.org/is-symbol/-/is-symbol-1.0.4.tgz", - "integrity": "sha512-C/CPBqKWnvdcxqIARxyOh4v1UUEOCHpgDa0WYgpKDFMszcrPcffg5uhwSgPCLD2WWxmq6isisz87tzT01tuGhg==", - "dev": true, - "requires": { - "has-symbols": "^1.0.2" - } - }, - "is-typed-array": { - "version": "1.1.10", - "resolved": "https://registry.npmjs.org/is-typed-array/-/is-typed-array-1.1.10.tgz", - "integrity": "sha512-PJqgEHiWZvMpaFZ3uTc8kHPM4+4ADTlDniuQL7cU/UDA0Ql7F70yGfHph3cLNe+c9toaigv+DFzTJKhc2CtO6A==", - "dev": true, - "requires": { - "available-typed-arrays": "^1.0.5", - "call-bind": "^1.0.2", - "for-each": "^0.3.3", - "gopd": "^1.0.1", - "has-tostringtag": "^1.0.0" - } - }, "is-unicode-supported": { "version": "0.1.0", "resolved": "https://registry.npmjs.org/is-unicode-supported/-/is-unicode-supported-0.1.0.tgz", "integrity": "sha512-knxG2q4UC3u8stRGyAVJCOdxFmv5DZiRcdlIaAQXAbSfJya+OhopNotLQrstBhququ4ZpuKbDc/8S6mgXgPFPw==", "dev": true }, - "is-weakmap": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/is-weakmap/-/is-weakmap-2.0.1.tgz", - "integrity": "sha512-NSBR4kH5oVj1Uwvv970ruUkCV7O1mzgVFO4/rev2cLRda9Tm9HrL70ZPut4rOHgY0FNrUu9BCbXA2sdQ+x0chA==", - "dev": true - }, - "is-weakset": { - "version": "2.0.2", - "resolved": "https://registry.npmjs.org/is-weakset/-/is-weakset-2.0.2.tgz", - "integrity": "sha512-t2yVvttHkQktwnNNmBQ98AhENLdPUTDTE21uPqAQ0ARwQfGeQKRVS0NNurH7bTf7RrvcVn1OOge45CnBeHCSmg==", - "dev": true, - "requires": { - "call-bind": "^1.0.2", - "get-intrinsic": "^1.1.1" - } - }, - "isarray": { - "version": "2.0.5", - "resolved": "https://registry.npmjs.org/isarray/-/isarray-2.0.5.tgz", - "integrity": "sha512-xHjhDr3cNBK0BzdUJSPXZntQUx/mwMS5Rw4A7lPJ90XGAO6ISP/ePDNuo0vhqOZU+UD5JoodwCAAoZQd3FeAKw==", - "dev": true - }, - "ismobilejs": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/ismobilejs/-/ismobilejs-1.1.1.tgz", - "integrity": "sha512-VaFW53yt8QO61k2WJui0dHf4SlL8lxBofUuUmwBo0ljPk0Drz2TiuDW4jo3wDcv41qy/SxrJ+VAzJ/qYqsmzRw==", - "dev": true - }, "javascript-natural-sort": { "version": "0.7.1", "resolved": "https://registry.npmjs.org/javascript-natural-sort/-/javascript-natural-sort-0.7.1.tgz", @@ -4792,30 +3109,12 @@ "integrity": "sha512-OYu7XEzjkCQ3C5Ps3QIZsQfNpqoJyZZA99wd9aWd05NCtC5pWOkShK2mkL6HXQR6/Cy2lbNdPlZBpuQHXE63gA==", "dev": true }, - "json-logic-js": { - "version": "2.0.2", - "resolved": "https://registry.npmjs.org/json-logic-js/-/json-logic-js-2.0.2.tgz", - "integrity": "sha512-ZBtBdMJieqQcH7IX/LaBsr5pX+Y5JIW+EhejtM3Ffg2jdN9Iwf+Ht6TbHnvAZ/YtwyuhPaCBlnvzrwVeWdvGDQ==", - "dev": true - }, "json-parse-even-better-errors": { "version": "2.3.1", "resolved": "https://registry.npmjs.org/json-parse-even-better-errors/-/json-parse-even-better-errors-2.3.1.tgz", "integrity": "sha512-xyFwyhro/JEof6Ghe2iz2NcXoj2sloNsWr/XsERDK/oiPCfaNhl5ONfp+jQdAZRQQ0IJWNzH9zIZF7li91kh2w==", "dev": true }, - "jstimezonedetect": { - "version": "1.0.7", - "resolved": "https://registry.npmjs.org/jstimezonedetect/-/jstimezonedetect-1.0.7.tgz", - "integrity": "sha512-ARADHortktl9IZ1tr4GHwGPIAzgz3mLNCbR/YjWtRtc/O0o634O3NeFlpLjv95EvuDA5dc8z6yfgbS8nUc4zcQ==", - "dev": true - }, - "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==", - "dev": true - }, "kind-of": { "version": "6.0.3", "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-6.0.3.tgz", @@ -5024,42 +3323,12 @@ "kind-of": "^6.0.3" } }, - "moment": { - "version": "2.29.4", - "resolved": "https://registry.npmjs.org/moment/-/moment-2.29.4.tgz", - "integrity": "sha512-5LC9SOxjSc2HF6vO2CyuTDNivEdoz2IvyJJGj6X8DJ0eFyfszE0QiEd+iXmBvUP3WHxSjFH/vIsA0EN00cgr8w==", - "dev": true - }, - "moment-timezone": { - "version": "0.5.43", - "resolved": "https://registry.npmjs.org/moment-timezone/-/moment-timezone-0.5.43.tgz", - "integrity": "sha512-72j3aNyuIsDxdF1i7CEgV2FfxM1r6aaqJyLB2vwb33mXYyoyLly+F1zbWqhA3/bVIoJ4szlUoMbUnVdid32NUQ==", - "dev": true, - "requires": { - "moment": "^2.29.4" - } - }, "ms": { "version": "2.1.2", "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz", "integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==", "dev": true }, - "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==", - "dev": true - }, - "node-fetch": { - "version": "2.6.9", - "resolved": "https://registry.npmjs.org/node-fetch/-/node-fetch-2.6.9.tgz", - "integrity": "sha512-DJm/CJkZkRjKKj4Zi4BsKVZh3ValV5IR5s7LVZnW+6YMh0W1BfNA8XSs6DLMGYlId5F3KnA70uu2qepcR08Qqg==", - "dev": true, - "requires": { - "whatwg-url": "^5.0.0" - } - }, "normalize-package-data": { "version": "3.0.3", "resolved": "https://registry.npmjs.org/normalize-package-data/-/normalize-package-data-3.0.3.tgz", @@ -5072,40 +3341,6 @@ "validate-npm-package-license": "^3.0.1" } }, - "object-inspect": { - "version": "1.12.3", - "resolved": "https://registry.npmjs.org/object-inspect/-/object-inspect-1.12.3.tgz", - "integrity": "sha512-geUvdk7c+eizMNUDkRpW1wJwgfOiOeHbxBR/hLXK1aT6zmVSO0jsQcs7fj6MGw89jC/cjGfLcNOrtMYtGqm81g==", - "dev": true - }, - "object-is": { - "version": "1.1.5", - "resolved": "https://registry.npmjs.org/object-is/-/object-is-1.1.5.tgz", - "integrity": "sha512-3cyDsyHgtmi7I7DfSSI2LDp6SK2lwvtbg0p0R1e0RvTqF5ceGx+K2dfSjm1bKDMVCFEDAQvy+o8c6a7VujOddw==", - "dev": true, - "requires": { - "call-bind": "^1.0.2", - "define-properties": "^1.1.3" - } - }, - "object-keys": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/object-keys/-/object-keys-1.1.1.tgz", - "integrity": "sha512-NuAESUOUMrlIXOfHKzD6bpPu3tYt3xvjNdRIQ+FeT0lNb4K8WR70CaDxhuNguS2XG+GjkyMwOzsN5ZktImfhLA==", - "dev": true - }, - "object.assign": { - "version": "4.1.4", - "resolved": "https://registry.npmjs.org/object.assign/-/object.assign-4.1.4.tgz", - "integrity": "sha512-1mxKf0e58bvyjSCtKYY4sRe9itRk3PJpquJOjeIkz885CczcI4IvJJDLPS72oowuSh+pBxUFROpX+TU++hxhZQ==", - "dev": true, - "requires": { - "call-bind": "^1.0.2", - "define-properties": "^1.1.4", - "has-symbols": "^1.0.3", - "object-keys": "^1.1.1" - } - }, "p-limit": { "version": "2.3.0", "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-2.3.0.tgz", @@ -5130,12 +3365,6 @@ "integrity": "sha512-R4nPAVTAU0B9D35/Gk3uJf/7XYbQcyohSKdvAxIRSNghFl4e71hVoGnBNQz9cWaXxO2I10KTC+3jMdvvoKw6dQ==", "dev": true }, - "parchment": { - "version": "2.0.0-dev.2", - "resolved": "https://registry.npmjs.org/parchment/-/parchment-2.0.0-dev.2.tgz", - "integrity": "sha512-4fgRny4pPISoML08Zp7poi52Dff3E2G1ORTi2D/acJ/RiROdDAMDB6VcQNfBcmehrX5Wixp6dxh6JjLyE5yUNQ==", - "dev": true - }, "parse-json": { "version": "5.2.0", "resolved": "https://registry.npmjs.org/parse-json/-/parse-json-5.2.0.tgz", @@ -5224,47 +3453,6 @@ "integrity": "sha512-ARhCpm70fzdcvNQfPoy49IaanKkTlRWF2JMzqhcJbhSFRZv7nPTvZJdcY7301IPmvW+/p0RgIWnQDLJxifsQ7g==", "dev": true }, - "quill": { - "version": "2.0.0-dev.4", - "resolved": "https://registry.npmjs.org/quill/-/quill-2.0.0-dev.4.tgz", - "integrity": "sha512-9WmMVCEIhf3lDdhzl+i+GBDeDl0BFi65waC4Im8Y4HudEJ9kEEb1lciAz9A8pcDmLMjiMbvz84lNt/U5OBS8Vg==", - "dev": true, - "requires": { - "clone": "^2.1.2", - "deep-equal": "^2.0.2", - "eventemitter3": "^4.0.0", - "extend": "^3.0.2", - "parchment": "2.0.0-dev.2", - "quill-delta": "4.2.1" - } - }, - "quill-delta": { - "version": "4.2.1", - "resolved": "https://registry.npmjs.org/quill-delta/-/quill-delta-4.2.1.tgz", - "integrity": "sha512-Y2nksOj6Q+4hizre8n0dml76vLNGK4/y86EoI1d7rv6EL1bx7DPDYRmqQMPu1UqFQO/uQuVHQ3fOmm4ZSzWrfA==", - "dev": true, - "requires": { - "deep-equal": "^1.0.1", - "extend": "^3.0.2", - "fast-diff": "1.2.0" - }, - "dependencies": { - "deep-equal": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/deep-equal/-/deep-equal-1.1.1.tgz", - "integrity": "sha512-yd9c5AdiqVcR+JjcwUQb9DkhJc8ngNr0MahEBGvDiJw8puWab2yZlh+nkasOnZP+EGTAP6rRp2JzJhJZzvNF8g==", - "dev": true, - "requires": { - "is-arguments": "^1.0.4", - "is-date-object": "^1.0.1", - "is-regex": "^1.0.4", - "object-is": "^1.0.1", - "object-keys": "^1.1.1", - "regexp.prototype.flags": "^1.2.0" - } - } - } - }, "react-is": { "version": "18.2.0", "resolved": "https://registry.npmjs.org/react-is/-/react-is-18.2.0.tgz", @@ -5344,38 +3532,6 @@ "strip-indent": "^3.0.0" } }, - "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==", - "dev": true, - "requires": { - "@babel/runtime": "^7.9.2" - } - }, - "regenerator-runtime": { - "version": "0.13.11", - "resolved": "https://registry.npmjs.org/regenerator-runtime/-/regenerator-runtime-0.13.11.tgz", - "integrity": "sha512-kY1AZVr2Ra+t+piVaJ4gxaFaReZVH40AKNo7UCX6W+dEwBo/2oZJzqfuN1qLq1oL45o56cPaTXELwrTh8Fpggg==", - "dev": true - }, - "regexp.prototype.flags": { - "version": "1.5.0", - "resolved": "https://registry.npmjs.org/regexp.prototype.flags/-/regexp.prototype.flags-1.5.0.tgz", - "integrity": "sha512-0SutC3pNudRKgquxGoRGIz946MZVHqbNfPjBdxeOhBrdgDKlRoXmYLQN9xRbrR09ZXWeGAdPuif7egofn6v5LA==", - "dev": true, - "requires": { - "call-bind": "^1.0.2", - "define-properties": "^1.2.0", - "functions-have-names": "^1.2.3" - } - }, - "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==", - "dev": true - }, "resolve": { "version": "1.22.2", "resolved": "https://registry.npmjs.org/resolve/-/resolve-1.22.2.tgz", @@ -5411,23 +3567,6 @@ "lru-cache": "^6.0.0" } }, - "side-channel": { - "version": "1.0.4", - "resolved": "https://registry.npmjs.org/side-channel/-/side-channel-1.0.4.tgz", - "integrity": "sha512-q5XPytqFEIKHkGdiMIrY10mvLRvnQh42/+GoBlFW3b2LXLE2xxJpZFdm94we0BaoV3RwJyGqg5wS7epxTv0Zvw==", - "dev": true, - "requires": { - "call-bind": "^1.0.0", - "get-intrinsic": "^1.0.2", - "object-inspect": "^1.9.0" - } - }, - "signature_pad": { - "version": "4.1.5", - "resolved": "https://registry.npmjs.org/signature_pad/-/signature_pad-4.1.5.tgz", - "integrity": "sha512-VOE846UbQMeLBbcR08KwjwE1wNLgp3gqC7yr/AELkgSMs/BdRpxIZna6K5XyZJpA7IWq9GiInw1C8PLm57VO6Q==", - "dev": true - }, "slash": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/slash/-/slash-3.0.0.tgz", @@ -5440,12 +3579,6 @@ "integrity": "sha512-LbrmJOMUSdEVxIKvdcJzQC+nQhe8FUZQTXQy6+I75skNgn3OoQ0DZA8YnFa7gp8tqtL3KPf1kmo0R5DoApeSGQ==", "dev": true }, - "spark-md5": { - "version": "2.0.2", - "resolved": "https://registry.npmjs.org/spark-md5/-/spark-md5-2.0.2.tgz", - "integrity": "sha512-9WfT+FYBEvlrOOBEs484/zmbtSX4BlGjzXih1qIEWA1yhHbcqgcMHkiwXoWk2Sq1aJjLpcs6ZKV7JxrDNjIlNg==", - "dev": true - }, "spdx-correct": { "version": "3.2.0", "resolved": "https://registry.npmjs.org/spdx-correct/-/spdx-correct-3.2.0.tgz", @@ -5478,21 +3611,6 @@ "integrity": "sha512-XkD+zwiqXHikFZm4AX/7JSCXA98U5Db4AFd5XUg/+9UNtnH75+Z9KxtpYiJZx36mUDVOwH83pl7yvCer6ewM3w==", "dev": true }, - "stop-iteration-iterator": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/stop-iteration-iterator/-/stop-iteration-iterator-1.0.0.tgz", - "integrity": "sha512-iCGQj+0l0HOdZ2AEeBADlsRC+vsnDsZsbdSiH1yNSjcfKM7fdpCMfqAL/dwF5BLiw/XhRft/Wax6zQbhq2BcjQ==", - "dev": true, - "requires": { - "internal-slot": "^1.0.4" - } - }, - "string-hash": { - "version": "1.1.3", - "resolved": "https://registry.npmjs.org/string-hash/-/string-hash-1.1.3.tgz", - "integrity": "sha512-kJUvRUFK49aub+a7T1nNE66EJbZBMnBgoC1UbCZ5n6bsZKBRga4KgBRTMn/pFkeCZSYtNeSyMxPDM0AXWELk2A==", - "dev": true - }, "string-width": { "version": "4.2.3", "resolved": "https://registry.npmjs.org/string-width/-/string-width-4.2.3.tgz", @@ -5564,21 +3682,6 @@ "integrity": "sha512-ot0WnXS9fgdkgIcePe6RHNk1WA8+muPa6cSjeR3V8K27q9BB1rTE3R1p7Hv0z1ZyAc8s6Vvv8DIyWf681MAt0w==", "dev": true }, - "ticky": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/ticky/-/ticky-1.0.1.tgz", - "integrity": "sha512-RX35iq/D+lrsqhcPWIazM9ELkjOe30MSeoBHQHSsRwd1YuhJO5ui1K1/R0r7N3mFvbLBs33idw+eR6j+w6i/DA==", - "dev": true - }, - "tippy.js": { - "version": "6.3.7", - "resolved": "https://registry.npmjs.org/tippy.js/-/tippy.js-6.3.7.tgz", - "integrity": "sha512-E1d3oP2emgJ9dRQZdf3Kkn0qJgI6ZLpyS5z6ZkY1DF3kaQaBsGZsndEpHwx+eC+tYM41HaSNvNtLx8tU57FzTQ==", - "dev": true, - "requires": { - "@popperjs/core": "^2.9.0" - } - }, "to-fast-properties": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/to-fast-properties/-/to-fast-properties-2.0.0.tgz", @@ -5594,12 +3697,6 @@ "is-number": "^7.0.0" } }, - "tr46": { - "version": "0.0.3", - "resolved": "https://registry.npmjs.org/tr46/-/tr46-0.0.3.tgz", - "integrity": "sha512-N3WMsuqV66lT30CrXNbEjx4GEwlow3v6rr4mCcv6prnfwhS01rkgyFdjPNBYd9br7LpXV1+Emh01fHnq2Gdgrw==", - "dev": true - }, "trim-newlines": { "version": "3.0.1", "resolved": "https://registry.npmjs.org/trim-newlines/-/trim-newlines-3.0.1.tgz", @@ -5652,12 +3749,6 @@ "integrity": "sha512-ARDJmphmdvUk6Glw7y9DQ2bFkKBHwQHLi2lsaH6PPmz/Ka9sFOBsBluozhDltWmnv9u/cF6Rt87znRTPV+yp/A==", "dev": true }, - "uuid": { - "version": "8.3.2", - "resolved": "https://registry.npmjs.org/uuid/-/uuid-8.3.2.tgz", - "integrity": "sha512-+NYs2QeMWy+GWFOEm9xnn6HCDp0l7QBD7ml8zLUmJ+93Q5NF0NocErnwkTkXVFNiX3/fpC6afS8Dhb/gz7R7eg==", - "dev": true - }, "validate-npm-package-license": { "version": "3.0.4", "resolved": "https://registry.npmjs.org/validate-npm-package-license/-/validate-npm-package-license-3.0.4.tgz", @@ -5668,70 +3759,6 @@ "spdx-expression-parse": "^3.0.0" } }, - "vanilla-picker": { - "version": "2.12.1", - "resolved": "https://registry.npmjs.org/vanilla-picker/-/vanilla-picker-2.12.1.tgz", - "integrity": "sha512-2qrEP9VYylKXbyzXKsbu2dferBTvqnlsr29XjHwFE+/MEp0VNj6oEUESLDtKZ7DWzGdSv1x/+ujqFZF+KsO3cg==", - "dev": true, - "requires": { - "@sphinxxxx/color-conversion": "^2.2.2" - } - }, - "webidl-conversions": { - "version": "3.0.1", - "resolved": "https://registry.npmjs.org/webidl-conversions/-/webidl-conversions-3.0.1.tgz", - "integrity": "sha512-2JAn3z8AR6rjK8Sm8orRC0h/bcl/DqL7tRPdGZ4I1CjdF+EaMLmYxBHyXuKL849eucPFhvBoxMsflfOb8kxaeQ==", - "dev": true - }, - "whatwg-url": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/whatwg-url/-/whatwg-url-5.0.0.tgz", - "integrity": "sha512-saE57nupxk6v3HY35+jzBwYa0rKSy0XR8JSxZPwgLr7ys0IBzhGviA1/TUGJLmSVqs8pb9AnvICXEuOHLprYTw==", - "dev": true, - "requires": { - "tr46": "~0.0.3", - "webidl-conversions": "^3.0.0" - } - }, - "which-boxed-primitive": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/which-boxed-primitive/-/which-boxed-primitive-1.0.2.tgz", - "integrity": "sha512-bwZdv0AKLpplFY2KZRX6TvyuN7ojjr7lwkg6ml0roIy9YeuSr7JS372qlNW18UQYzgYK9ziGcerWqZOmEn9VNg==", - "dev": true, - "requires": { - "is-bigint": "^1.0.1", - "is-boolean-object": "^1.1.0", - "is-number-object": "^1.0.4", - "is-string": "^1.0.5", - "is-symbol": "^1.0.3" - } - }, - "which-collection": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/which-collection/-/which-collection-1.0.1.tgz", - "integrity": "sha512-W8xeTUwaln8i3K/cY1nGXzdnVZlidBcagyNFtBdD5kxnb4TvGKR7FfSIS3mYpwWS1QUCutfKz8IY8RjftB0+1A==", - "dev": true, - "requires": { - "is-map": "^2.0.1", - "is-set": "^2.0.1", - "is-weakmap": "^2.0.1", - "is-weakset": "^2.0.1" - } - }, - "which-typed-array": { - "version": "1.1.9", - "resolved": "https://registry.npmjs.org/which-typed-array/-/which-typed-array-1.1.9.tgz", - "integrity": "sha512-w9c4xkx6mPidwp7180ckYWfMmvxpjlZuIudNtDf4N/tTAUB8VJbX25qZoAsrtGuYNnGw3pa0AXgbGKRB8/EceA==", - "dev": true, - "requires": { - "available-typed-arrays": "^1.0.5", - "call-bind": "^1.0.2", - "for-each": "^0.3.3", - "gopd": "^1.0.1", - "has-tostringtag": "^1.0.0", - "is-typed-array": "^1.1.10" - } - }, "yallist": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/yallist/-/yallist-4.0.0.tgz", diff --git a/package.json b/package.json index d9fce09..f297b15 100644 --- a/package.json +++ b/package.json @@ -1,16 +1,15 @@ { "name": "@open-formulieren/types", "version": "0.52.0", - "description": "Typescript type definitions for Open Forms' Form.io extensions", - "main": "index.js", - "module": "./lib/index.js", - "types": "./lib/index.d.ts", + "description": "Typescript type definitions for Open Forms' Form.io components", + "types": "./dist/index.d.ts", "files": [ - "lib" + "dist" ], + "sideEffects": false, "scripts": { "build": "tsc --emitDeclarationOnly", - "build:docs": "typedoc", + "build:docs": "typedoc --name 'Open Forms TS types'", "test": "npm run build && tsd", "format": "prettier --write 'src/**/*'", "checkformat": "prettier --check 'src/**/*'" @@ -20,9 +19,9 @@ "url": "git+ssh://git@github.com/open-formulieren/types.git" }, "keywords": [ + "open forms", + "open formulieren", "formio", - "open", - "forms", "typescript" ], "author": "Maykin Media ", @@ -33,7 +32,6 @@ "homepage": "https://github.com/open-formulieren/types#readme", "devDependencies": { "@trivago/prettier-plugin-sort-imports": "^4.1.1", - "formiojs": "^4.14.13", "prettier": "^2.8.8", "tsd": "^0.32.0", "typedoc": "0.28.7", diff --git a/src/base.ts b/src/base.ts new file mode 100644 index 0000000..a698971 --- /dev/null +++ b/src/base.ts @@ -0,0 +1,80 @@ +/** + * Base functionality to define Formio component types. + * + * It provides the building blocks for built-in and custom component types, allowing + * for nuances between layout and data components. + * + * @module base + */ + +/** + * Utility type for complex composed types to make them more readable. + * + * Taken from {@link https://www.totaltypescript.com/concepts/the-prettify-helper} + */ +export type Prettify = { + [K in keyof T]: T[K]; +} & {}; + +/** + * The shared base for all component types. + * + * The type parameter `T` is used for the discriminator to figure out what kind of + * component it is. + */ +export interface BaseComponent { + /** + * Discriminator to determine the component type. Uniquely determines the shape of the + * component configuration options. + */ + type: T; + + /** + * Unique ID for a component in a form definition. Used to render HTML IDs. + * + * @deprecated The new renderer does not need this. + */ + id: string; + + /** + * Unique key for the component in a larger form definition. + * + * The value must comply with the `(\w|\w[\w.\-]*\w)` regex, meaning that periods/dots + * are allowed unless they're start or end. The period character creates a nesting + * level in the submission data. + * + * @example + * 'myField' + * @example + * 'parent.child' // creates `{parent: {child: = + | { + /** + * Flag that controls the multi-value mode of the field. + * + * If multiple values are enabled, typically an array of values will be submitted + * for the field instead of a single item. + */ + multiple?: false; + /** + * The default/initial value to populate the field with if no value is set yet. + */ + defaultValue?: TSingle; + } + | { + /** + * Flag that controls the multi-value mode of the field. + * + * If multiple values are enabled, typically an array of values will be submitted + * for the field instead of a single item. + */ + multiple: true; + /** + * The default/initial value to populate the field with if no value is set yet. + */ + defaultValue?: TSingle[]; + }; diff --git a/src/common.ts b/src/common.ts new file mode 100644 index 0000000..989f3b9 --- /dev/null +++ b/src/common.ts @@ -0,0 +1,105 @@ +/** + * Property definitions that are commonly used in various component types. + * + * Defined as standalone types so they can easily be merged/composed to define a + * particular component type. + * + * @module common + */ + +export type Label = { + /** + * The form field label text. + */ + label: string; +}; + +export type Description = { + /** + * Additional information for the form field, displayed unconditionally. + */ + description?: string; +}; + +export type Tooltip = { + /** + * Extra information or background for the form field. Displayed after interacting + * with the tooltip icon/control near the label. + */ + tooltip?: string; +}; + +export type Hidden = { + /** + * Hide or show the form field. This only controls the visibility - whether + * submission data is retained or not is controlled through {@link clearOnHide}. + */ + hidden?: boolean; +}; + +export type ClearOnHide = { + /** + * Clear the value (remove the key from the submission data) when the field is + * hidden. This is applied if the component itself or any parent is hidden, + * irrespective the mechanism that made it hidden. + * + * Related: {@link hidden}, {@link conditional} + */ + clearOnHide?: boolean; +}; + +export type IsSensitiveData = { + /** + * Marker for a form field that requests potentially (privacy) sensitive information. + * + * Pruning of submission data will clear the data of components marked as sensitive + * data. + * + * This is specific to Open Forms. + */ + isSensitiveData?: boolean; +}; + +export type AutoComplete = { + /** + * How to autocomplete the input field by the browser. Matches the native HTML + * attribute. + */ + autocomplete?: string; +}; + +export type ReadOnly = { + /** + * Should be named `readOnly` instead - displays the field, includes the data in + * the submission but editing is not allowed. + */ + disabled?: boolean; +}; + +export type Placeholder = { + /** + * Placeholder text displayed in the input field. Matches the native HTML attribute. + */ + placeholder?: string; +}; + +export type ShowCharCount = { + /** + * If enabled, the number of characters entered into the input is displayed. If + * there's also a `maxLength` configured in the component validation, the available + * number of characters is displayed instead. + * + * @see validate + */ + showCharCount?: boolean; +}; + +export type DefaultValue = { + /** + * The default/initial value to populate the field with if no value is set yet. + * + * The typevar `T` determines the (intrinsic) value type of the component. If the + * component supports the `multiple` property, use the `WithMultiple` type instead. + */ + defaultValue?: T; +}; diff --git a/src/components/addressNL.ts b/src/components/addressNL.ts new file mode 100644 index 0000000..4590be1 --- /dev/null +++ b/src/components/addressNL.ts @@ -0,0 +1,98 @@ +import {BaseComponent, Prettify} from '../base'; +import {ClearOnHide, Description, Hidden, IsSensitiveData, Label, Tooltip} from '../common'; +import {Conditional, DisplayConfig, OFExtensions, Registration} from '../extensions'; +import {Validation} from '../validation'; + +/** + * Shape of the form field value in the submission data. + */ +export interface AddressData { + /** + * The postcode of the address, in the format `1234 AB` (space optional). + * + * Together with {@link houseNumber}, the street name and city can be derived. + */ + postcode: string; + /** + * The house/address number, without any additions. + * + * Together with {@link postcode}, the street name and city can be derived. + */ + houseNumber: string; + /** + * Optional house letter to narrow the exact address. If not applicable, use an empty + * string. + */ + houseLetter: string; + /** + * Optional addition to narrow the exact address. If not applicable, use an empty + * string. + */ + houseNumberAddition: string; + /** + * City/municipality part of the address. May be absent if no autofill of the address + * was performed. + */ + city?: string; + /** + * Street name ('openbare ruimte') part of the address. May be absent if no autofill + * of the address was performed. + */ + streetName?: string; + /** + * Anti-tampering hash for the resolved {@link city} and {@link streetName} generated + * on the server. Client-side data tampering will invalidate the hash. + */ + secretStreetCity?: string; + /** + * Marker to indicate that the address was autofilled or not (manually filled). + * + * Currently unused, but planned to be used in the component improvements. + */ + autoPopulated?: boolean; +} + +interface AddressNLExtensions { + /** + * Configuration options for the nested components/fields used in the addressNL + * component. + */ + components?: { + postcode?: Prettify, 'validate' | 'translatedErrors'>>; + city?: Prettify, 'validate' | 'translatedErrors'>>; + }; +} + +/** + * Component shape/options for the addressNL component. + * + * @warning The generated documentation might be slightly off due to rendering the type + * alias as an interface. Double check with the actual TS types! + * + * @interface + * + * @category Special components + */ +export type AddressNLComponentSchema = Prettify< + BaseComponent<'addressNL'> & + Label & + Description & + Tooltip & + DisplayConfig & + Hidden & + ClearOnHide & + IsSensitiveData & { + /** + * Which layout variant to render in the frontend, presentational only. + */ + layout: 'singleColumn' | 'doubleColumn'; + /** + * Whether the {@link city} and {@link streetName} fields should be shown and + * auto-filled through the backend based on {@link postcode} and {@link houseNumber}. + */ + deriveAddress: boolean; + } & Conditional & + Validation<'required'> & + Registration & + OFExtensions<'label' | 'description' | 'tooltip', AddressNLExtensions> +>; diff --git a/src/components/bsn.ts b/src/components/bsn.ts new file mode 100644 index 0000000..c1acaea --- /dev/null +++ b/src/components/bsn.ts @@ -0,0 +1,42 @@ +import {BaseComponent, Prettify, WithMultiple} from '../base'; +import { + ClearOnHide, + Description, + Hidden, + IsSensitiveData, + Label, + ReadOnly, + Tooltip, +} from '../common'; +import {Conditional, DisplayConfig, OFExtensions, Prefill, Registration} from '../extensions'; +import {Validation} from '../validation'; + +/** + * Component shape/options for a BSN component. + * + * @warning The generated documentation might be slightly off due to rendering the type + * alias as an interface. Double check with the actual TS types! + * + * @interface + * + * @category Special components + */ +export type BsnComponentSchema = Prettify< + BaseComponent<'bsn'> & + Label & + Description & + Tooltip & + DisplayConfig & + Hidden & + ClearOnHide & + IsSensitiveData & + ReadOnly & + Conditional & + Validation<'required'> & + Registration & + Prefill & + OFExtensions<'label' | 'description' | 'tooltip'> & + // Unfortunately, this results in a top-level union and there's nothing we can do + // about it due to TS limitations :( + WithMultiple +>; diff --git a/src/components/checkbox.ts b/src/components/checkbox.ts new file mode 100644 index 0000000..7175449 --- /dev/null +++ b/src/components/checkbox.ts @@ -0,0 +1,38 @@ +import {BaseComponent, Prettify} from '../base'; +import { + ClearOnHide, + DefaultValue, + Description, + Hidden, + IsSensitiveData, + Label, + Tooltip, +} from '../common'; +import {Conditional, DisplayConfig, OFExtensions, Registration} from '../extensions'; +import {Validation} from '../validation'; + +/** + * Component shape/options for a checkbox component. + * + * @warning The generated documentation might be slightly off due to rendering the type + * alias as an interface. Double check with the actual TS types! + * + * @interface + * + * @category Basic components + */ +export type CheckboxComponentSchema = Prettify< + BaseComponent<'checkbox'> & + Label & + Description & + Tooltip & + DisplayConfig & + Hidden & + ClearOnHide & + IsSensitiveData & + DefaultValue & + Conditional & + Validation<'required'> & + Registration & + OFExtensions<'label' | 'description' | 'tooltip'> +>; diff --git a/src/components/children.ts b/src/components/children.ts new file mode 100644 index 0000000..6f783e9 --- /dev/null +++ b/src/components/children.ts @@ -0,0 +1,47 @@ +import {BaseComponent, Prettify} from '../base'; +import {ClearOnHide, Description, Hidden, IsSensitiveData, Label, Tooltip} from '../common'; +import {Conditional, OFExtensions, Registration} from '../extensions'; + +export interface ChildDetails { + bsn: string; + firstNames: string; + /** + * @remarks + * TODO: add support for Date instances? + */ + dateOfBirth: string; + /** + * If child selection is enabled, the submission data will include this key. If it's + * not selected, the entire record is absent. + */ + selected?: true; +} + +/** + * Component shape/options for the children (family members) component. + * + * @warning The generated documentation might be slightly off due to rendering the type + * alias as an interface. Double check with the actual TS types! + * + * @interface + * + * @category Special components + */ +export type ChildrenComponentSchema = Prettify< + BaseComponent<'children'> & + Label & + Description & + Tooltip & + Hidden & + ClearOnHide & + IsSensitiveData & { + /** + * If selection is not enabled, all retrieved/entered children are submitted. If + * it is enabled, the user must select the relevant children and only those will + * be part of the submission data. + */ + enableSelection: boolean; + } & Conditional & + Registration & + OFExtensions<'label' | 'description' | 'tooltip'> +>; diff --git a/src/components/columns.ts b/src/components/columns.ts new file mode 100644 index 0000000..59ce941 --- /dev/null +++ b/src/components/columns.ts @@ -0,0 +1,54 @@ +import {BaseComponent, Prettify} from '../base'; +import {ClearOnHide} from '../common'; +import {AnyComponentSchema} from './index'; + +/** + * Configuration of a single column. + * + * @remarks + * Vanilla/standard formio.js has a whole set of different properties, which are + * tightly coupled to bootstrap classes for the column sizes. As Open Forms doesn't + * use Bootstrap, we've opted for our own schema here instead. + */ +export interface Column { + /** + * Size on non-mobile viewports. + * + * The size specifies the number of columns spanned in a 12-column grid. Does not act + * as a fallback for mobile viewports - if the `sizeMobile` property is not set, a + * fallback to 100% width is used. + */ + size: 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12; + /** + * Size on mobile viewports. + * + * The mobile size specifies the numbers of columns spanned in a 4-column grid. + * + * @privateRemarks Add backend migration to ensure this attribute is set everywhere. + */ + sizeMobile?: 1 | 2 | 3 | 4; + /** + * Nested components inside a single column. + */ + components: AnyComponentSchema[]; +} + +/** + * Component shape/options for a columns component. + * + * @warning The generated documentation might be slightly off due to rendering the type + * alias as an interface. Double check with the actual TS types! + * + * @interface + * + * @category Layout components + */ +export type ColumnsComponentSchema = Prettify< + BaseComponent<'columns'> & + ClearOnHide & { + /** + * The columns to display side-by-side, each with their configured size. + */ + columns: Column[]; + } +>; diff --git a/src/components/content.ts b/src/components/content.ts new file mode 100644 index 0000000..0ad8600 --- /dev/null +++ b/src/components/content.ts @@ -0,0 +1,31 @@ +import {BaseComponent, Prettify} from '../base'; +import {Hidden} from '../common'; +import {Conditional, DisplayConfig, OFExtensions} from '../extensions'; + +/** + * Component shape/options for a content (rich text) component. + * + * @warning The generated documentation might be slightly off due to rendering the type + * alias as an interface. Double check with the actual TS types! + * + * @interface + * + * @category Layout components + */ +export type ContentComponentSchema = Prettify< + BaseComponent<'content'> & + Hidden & + DisplayConfig & + Conditional & + OFExtensions<'html'> & { + /** + * Rich text content, in HTML form. It may be post-processed by the backend for + * compatibility with CSP headers. + */ + html: string; + /** + * A custom CSS class/modifier to apply to convey the type of information. + */ + customClass?: '' | 'success' | 'info' | 'warning' | 'error'; + } +>; diff --git a/src/components/cosign.ts b/src/components/cosign.ts new file mode 100644 index 0000000..5ade36e --- /dev/null +++ b/src/components/cosign.ts @@ -0,0 +1,64 @@ +import {BaseComponent, Prettify} from '../base'; +import { + AutoComplete, + ClearOnHide, + DefaultValue, + Description, + Hidden, + IsSensitiveData, + Label, + Tooltip, +} from '../common'; +import {Conditional, DisplayConfig, OFExtensions, Registration} from '../extensions'; +import {Validation} from '../validation'; + +/** + * Component shape/options for the legacy cosign (v1) component. + * + * @deprecated + * + * @warning The generated documentation might be slightly off due to rendering the type + * alias as an interface. Double check with the actual TS types! + * + * @interface + * + * @category Special components + */ +export type CosignV1ComponentSchema = Prettify< + BaseComponent<'coSign'> & + Label & + Description & + Hidden & { + /** + * Which authentication plugin to use to log the cosigner in with. + */ + authPlugin: string; + } & OFExtensions<'label' | 'description'> +>; + +/** + * Component shape/options for the cosign (v2) component. + * + * @warning The generated documentation might be slightly off due to rendering the type + * alias as an interface. Double check with the actual TS types! + * + * @interface + * + * @category Special components + */ +export type CosignV2ComponentSchema = Prettify< + BaseComponent<'cosign'> & + Label & + Description & + Tooltip & + DisplayConfig & + Hidden & + ClearOnHide & + IsSensitiveData & + DefaultValue & + AutoComplete & + Conditional & + Validation<'required'> & + Registration & + OFExtensions<'label' | 'description' | 'tooltip'> +>; diff --git a/src/components/currency.ts b/src/components/currency.ts new file mode 100644 index 0000000..603e13f --- /dev/null +++ b/src/components/currency.ts @@ -0,0 +1,58 @@ +import {BaseComponent, Prettify} from '../base'; +import { + ClearOnHide, + DefaultValue, + Description, + Hidden, + IsSensitiveData, + Label, + Tooltip, +} from '../common'; +import {Conditional, DisplayConfig, OFExtensions, Registration} from '../extensions'; +import {Validation} from '../validation'; + +type CurrencyExtras = { + /** + * The currency used in the component. Fixed to EUR. + */ + currency: 'EUR'; + /** + * Maximum number of decimal places after the decimal separator. + */ + decimalLimit?: 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10; + /** + * Controls whether negative values are allowed or not (minus sign). + * + * @remarks + * TODO: incorporate this into/derive from the `validate.min` instead? See + * {@link https://github.com/open-formulieren/open-forms/issues/3430} + */ + allowNegative?: boolean; +}; + +/** + * Component shape/options for a currency (EUR) component. + * + * @warning The generated documentation might be slightly off due to rendering the type + * alias as an interface. Double check with the actual TS types! + * + * @interface + * + * @category Basic components + */ +export type CurrencyComponentSchema = Prettify< + BaseComponent<'currency'> & + Label & + Description & + Tooltip & + DisplayConfig & + Hidden & + ClearOnHide & + IsSensitiveData & + DefaultValue & + Conditional & + Validation<'required' | 'min' | 'max'> & + Registration & + CurrencyExtras & + OFExtensions<'label' | 'description' | 'tooltip'> +>; diff --git a/src/components/customerProfile.ts b/src/components/customerProfile.ts new file mode 100644 index 0000000..5b8662f --- /dev/null +++ b/src/components/customerProfile.ts @@ -0,0 +1,77 @@ +import {BaseComponent, Prettify} from '../base'; +import {ClearOnHide, Description, Hidden, IsSensitiveData, Label, Tooltip} from '../common'; +import {Conditional, DisplayConfig, OFExtensions} from '../extensions'; + +/** + * Different kinds of digital addresses that a user may wish to receive communication + * on. Also known as a "communication channel". + */ +export type DigitalAddressType = 'email' | 'phoneNumber'; + +/** + * Possible ways to treat a user's digital address - if they're authenticated, there's + * an option to update their customer profile, otherwise it's single use. + */ +export type PreferenceUpdateOptions = 'useOnlyOnce' | 'isNewPreferred'; + +/** + * Details for a single digital address of a user. + */ +export type DigitalAddress = { + /** + * The address type. A user can provide multiple address of different types. + */ + type: DigitalAddressType; + /** + * The value of the address. The shape and semantics are determined by the `type`. + */ + address: string; + /** + * How to process this address when interacting with the customer profile. Absent for + * anonymous users for which there's no known profile. + */ + preferenceUpdate?: PreferenceUpdateOptions; +}; + +interface CustomerProfileExtra { + /** + * Which address types can be displayed and/or provided. + */ + digitalAddressTypes: DigitalAddressType[]; + /** + * If enabled and communication preferences were prefilled for a user, then the + * profile in the customer interactions API can be updated when the submission is + * processed. Disable to only register the preferences once without updating any + * profile. + */ + shouldUpdateCustomerData: boolean; +} + +/** + * Component shape/options for the customer profile component. + * + * The customer profile is typically used for digital communication preferences, and + * can interact with the customer interaction APIs. + * + * The intrinsic value type in the submission data is an array of `DigitalAddress` items. + * + * @warning The generated documentation might be slightly off due to rendering the type + * alias as an interface. Double check with the actual TS types! + * + * @interface + * + * @category Special components + */ +export type CustomerProfileComponentSchema = Prettify< + BaseComponent<'customerProfile'> & + Label & + Description & + Tooltip & + DisplayConfig & + CustomerProfileExtra & + Hidden & + ClearOnHide & + IsSensitiveData & + Conditional & + OFExtensions<'label' | 'description' | 'tooltip'> +>; diff --git a/src/components/date.ts b/src/components/date.ts new file mode 100644 index 0000000..bcb268f --- /dev/null +++ b/src/components/date.ts @@ -0,0 +1,124 @@ +import {BaseComponent, Prettify, WithMultiple} from '../base'; +import { + ClearOnHide, + Description, + Hidden, + IsSensitiveData, + Label, + ReadOnly, + Tooltip, +} from '../common'; +import { + Conditional, + DisplayConfig, + FixedValueDateConstraint, + FutureDateConstraint, + NoDateConstraint, + OFExtensions, + PastDateConstraint, + Prefill, + Registration, + RelativeDateConstraint, +} from '../extensions'; +import {Validation} from '../validation'; + +/** + * The configuration options for the `datePicker`. + * + * This is a stripped down version from what Formio.js itself actually uses, keeping + * only what's relevant for our backend and/or renderer. The latter implements its own + * date picker widget, so the options for flatpickr at no longer relevant. + * + * @remarks + * The date picker configuration actually holds the min/max date validation values, + * which you'd normally expect in the valiate property. We may consider moving this + * for consistency sake. + */ +interface DatePicker { + /** + * The earliest available date in the datepicker. Also used for the input validation. + */ + minDate: string | null; + /** + * The last available date in the datepicker. Also used for the input validation. + */ + maxDate: string | null; +} + +/** + * Additional properties specific to the date component definition. + */ +interface DateExtras { + datePicker?: DatePicker; +} + +/** + * Additional date-component configuration options that are custom from Formio.js, + * stored in the top-level `openForms` property. + * + * These configurations are used by the backend and/or renderer. + */ +interface DateExtensions { + /** + * How to display the date component input field. The `inputGroup` provides separate + * input fields for day, month and year, while the `datePicker` provides an input + * field and toggle to open a date picker widget. + * + * The `inputGroup` is most convenient for "known dates" like birthdays. + */ + widget?: 'inputGroup' | 'datePicker'; + /** + * Options for how to derive/calculate the minimum allowed date. + */ + minDate?: + | NoDateConstraint + | FixedValueDateConstraint + | FutureDateConstraint + | RelativeDateConstraint; + /** + * Options for how to derive/calculate the maximum allowed date. + */ + maxDate?: + | NoDateConstraint + | FixedValueDateConstraint + | PastDateConstraint + | RelativeDateConstraint; +} + +/** + * Component shape/options for a date component. + * + * The smallest supported resolution is minutes - seconds are truncated to be 0 seconds. + * + * @remarks + * Note that the value/`defaultValue` type is just a plain string - a serialized + * ISO-8601 date. A `Date` instance could be explored in the future, but the time aspect + * of it will need to be discarded. + * + * @warning The generated documentation might be slightly off due to rendering the type + * alias as an interface. Double check with the actual TS types! + * + * @interface + * + * @category Basic components + */ +export type DateComponentSchema = Prettify< + BaseComponent<'date'> & + Label & + Description & + Tooltip & + DisplayConfig & + Hidden & + ClearOnHide & + IsSensitiveData & + ReadOnly & + Conditional & + Validation<'required' | 'minDate' | 'maxDate'> & + DateExtras & + Registration & + Prefill & + OFExtensions<'label' | 'description' | 'tooltip', DateExtensions> & + // Unfortunately, this results in a top-level union and there's nothing we can do + // about it due to TS limitations :( + WithMultiple +>; diff --git a/src/components/datetime.ts b/src/components/datetime.ts new file mode 100644 index 0000000..8c793d3 --- /dev/null +++ b/src/components/datetime.ts @@ -0,0 +1,121 @@ +import {BaseComponent, Prettify, WithMultiple} from '../base'; +import { + ClearOnHide, + Description, + Hidden, + IsSensitiveData, + Label, + ReadOnly, + Tooltip, +} from '../common'; +import { + Conditional, + DisplayConfig, + FixedValueDateConstraint, + FutureDateConstraint, + NoDateConstraint, + OFExtensions, + PastDateConstraint, + Prefill, + Registration, + RelativeDateConstraint, +} from '../extensions'; +import {Validation} from '../validation'; + +/** + * The configuration options for the `datePicker`. + * + * This is a stripped down version from what Formio.js itself actually uses, keeping + * only what's relevant for our backend and/or renderer. The latter implements its own + * date picker widget, so the options for flatpickr at no longer relevant. + * + * @remarks + * The date picker configuration actually holds the min/max date validation values, + * which you'd normally expect in the valiate property. We may consider moving this + * for consistency sake. + */ +interface DatePicker { + /** + * The earliest available datetime in the datepicker. Also used for the input validation. + * + * @remarks + * Check if we can use the `Date` type here in the future. + */ + minDate: string | null; + /** + * The last available datetime in the datepicker. Also used for the input validation. + * + * @remarks + * Check if we can use the `Date` type here in the future. + */ + maxDate: string | null; +} + +/** + * Additional properties specific to the date component definition. + */ +interface DateTimeExtras { + datePicker?: DatePicker; +} + +/** + * Additional date-component configuration options that are custom from Formio.js, + * stored in the top-level `openForms` property. + * + * These configurations are used by the backend and/or renderer. + */ +interface DateExtensions { + /** + * Options for how to derive/calculate the minimum allowed date. + */ + minDate?: + | NoDateConstraint + | FixedValueDateConstraint + | FutureDateConstraint + | RelativeDateConstraint; + /** + * Options for how to derive/calculate the maximum allowed date. + */ + maxDate?: + | NoDateConstraint + | FixedValueDateConstraint + | PastDateConstraint + | RelativeDateConstraint; +} + +/** + * Component shape/options for a date + time component. + * + * The smallest supported resolution is minutes - seconds are truncated to be 0 seconds. + * + * @remarks + * Note that the value/`defaultValue` type is just a plain string - a serialized + * ISO-8601 datetime. A `Date` instance could be explored in the future. + * + * @warning The generated documentation might be slightly off due to rendering the type + * alias as an interface. Double check with the actual TS types! + * + * @interface + * + * @category Basic components + */ +export type DateTimeComponentSchema = Prettify< + BaseComponent<'datetime'> & + Label & + Description & + Tooltip & + DisplayConfig & + Hidden & + ClearOnHide & + IsSensitiveData & + ReadOnly & + Conditional & + Validation<'required' | 'minDate' | 'maxDate'> & + DateTimeExtras & + Registration & + Prefill & + OFExtensions<'label' | 'description' | 'tooltip', DateExtensions> & + // Unfortunately, this results in a top-level union and there's nothing we can do + // about it due to TS limitations :( + WithMultiple +>; diff --git a/src/components/editgrid.ts b/src/components/editgrid.ts new file mode 100644 index 0000000..c18c1c1 --- /dev/null +++ b/src/components/editgrid.ts @@ -0,0 +1,80 @@ +import {BaseComponent, Prettify} from '../base'; +import { + ClearOnHide, + DefaultValue, + Description, + Hidden, + IsSensitiveData, + Label, + Tooltip, +} from '../common'; +import {OFExtensions} from '../extensions'; +import {Validation} from '../validation'; +import {AnyComponentSchema} from './index'; + +interface EditGridExtras { + /** + * Form definition for each item in the repeating group. + */ + components: AnyComponentSchema[]; + /** + * If enabled, the label of the group will not be displayed. + */ + hideLabel?: boolean; + /** + * Control whether any rows can be added or removed. + */ + disableAddingRemovingRows: boolean; + /** + * Button label to add another item. + */ + addAnother?: string; + /** + * Button label to save/confirm a single item. + */ + saveRow?: string; + /** + * Button label to remove a single item or cancel editing it. + */ + removeRow?: string; + /** + * Label for an individual item, interpolated with the index of each item. + * + * Specific to Open Forms. + */ + groupLabel: string; +} + +/** + * Component shape/options for the edit grid component. + * + * Edit grids are used for "repeating groups". The `components` configuration inside + * the editgrid component describes a blueprint for each item - effectively creating a + * list of nested forms with all their usual features. + * + * The intrinsic data type is an array of objects, where the shape of each object is + * described by the `component.components` property. + * + * @warning The generated documentation might be slightly off due to rendering the type + * alias as an interface. Double check with the actual TS types! + * + * @interface + * + * @category Special components + */ +export type EditGridComponentSchema = Prettify< + BaseComponent<'editgrid'> & + Label & + Description & + Tooltip & + Hidden & + // TODO: see if we can drop the `null` + DefaultValue & + ClearOnHide & + IsSensitiveData & + EditGridExtras & + Pick, 'validate'> & + OFExtensions< + 'label' | 'description' | 'tooltip' | 'groupLabel' | 'addAnother' | 'saveRow' | 'removeRow' + > +>; diff --git a/src/components/email.ts b/src/components/email.ts new file mode 100644 index 0000000..d2a9e85 --- /dev/null +++ b/src/components/email.ts @@ -0,0 +1,57 @@ +import {BaseComponent, Prettify, WithMultiple} from '../base'; +import { + AutoComplete, + ClearOnHide, + Description, + Hidden, + IsSensitiveData, + Label, + Tooltip, +} from '../common'; +import {Conditional, DisplayConfig, OFExtensions, Registration} from '../extensions'; +import {Validation} from '../validation'; + +interface EmailExtensions { + /** + * If enabled, then the user must confirm ownership/access of the provided email + * address. + */ + requireVerification?: boolean; +} + +/** + * Component shape/options for an email component. + * + * @warning The generated documentation might be slightly off due to rendering the type + * alias as an interface. Double check with the actual TS types! + * + * @interface + * + * @category Basic components + */ +export type EmailComponentSchema = Prettify< + BaseComponent<'email'> & + Label & + Description & + Tooltip & + DisplayConfig & + Hidden & + ClearOnHide & + IsSensitiveData & + AutoComplete & { + /** + * Set to `true` to treat this email address as a recipient of the confirmation email. + * + * @remarks + * TODO: move this into the `OFExtensions` instead, and prefix with `is`, which + * will also require backend updates. + */ + confirmationRecipient?: boolean; + } & Conditional & + Validation<'required'> & + Registration & + OFExtensions<'label' | 'description' | 'tooltip', EmailExtensions> & + // Unfortunately, this results in a top-level union and there's nothing we can do + // about it due to TS limitations :( + WithMultiple +>; diff --git a/src/components/fieldset.ts b/src/components/fieldset.ts new file mode 100644 index 0000000..cc878a1 --- /dev/null +++ b/src/components/fieldset.ts @@ -0,0 +1,36 @@ +import {BaseComponent, Prettify} from '../base'; +import {ClearOnHide, Hidden, Label, Tooltip} from '../common'; +import {Conditional, OFExtensions} from '../extensions'; +import {AnyComponentSchema} from './index'; + +/** + * Component shape/options for a fieldset component. + * + * @warning The generated documentation might be slightly off due to rendering the type + * alias as an interface. Double check with the actual TS types! + * + * @interface + * + * @category Layout components + */ +export type FieldsetComponentSchema = Prettify< + BaseComponent<'fieldset'> & + Label & + Tooltip & + Hidden & + ClearOnHide & + Conditional & + OFExtensions<'label'> & { + /** + * Control whether the fieldset header/legend is displayed or not. + * + * @deprecated This should probably use the built-in `hideLabel` property instead, + * which requires a backend data migration and update to the SDK code. + */ + hideHeader: boolean; + /** + * Nested components/fields inside the fieldset. + */ + components: AnyComponentSchema[]; + } +>; diff --git a/src/components/file.ts b/src/components/file.ts new file mode 100644 index 0000000..5a0ebca --- /dev/null +++ b/src/components/file.ts @@ -0,0 +1,207 @@ +import {BaseComponent, Prettify} from '../base'; +import {ClearOnHide, Description, Hidden, IsSensitiveData, Label, Tooltip} from '../common'; +import {Conditional, DisplayConfig, OFExtensions} from '../extensions'; +import {Validation} from '../validation'; + +/** + * Shape of a single file upload from Form.io to the backend. + */ +export interface FileUploadData { + data: { + /** + * Full backend URL of the uploaded file (API endpoint). + * + * The value appears to be identical to the root `url` key. + */ + url: string; + /** + * Does not seem to be set to a meaningful value. + */ + form: ''; + /** + * File name of uploaded file. + * + * The value is different from the root `name` key. + */ + name: string; + /** + * File size in bytes, (positive) integer value. + * + * The value appears to be identical to the root `size` key. + */ + size: number; + /** + * Formio base URL configuration option, set to the root of our own API. + */ + baseUrl: string; + /** + * Does not seem to be set to a meaningful value. + */ + project: ''; + }; + name: string; + originalName: string; + /** + * File size in bytes, (positive) integer value. + */ + size: number; + /** + * We only support file uploads to a backend URL. + */ + storage: 'url'; + /** + * MIME type, determined by the browser during upload. If the OS/browser doesn't know + * it, it seems to be an empty string (see https://github.com/open-formulieren/open-forms-sdk/ + * blob/27877938249cdd627294871b70291ab8dc66fd61/src/formio/components/FileField.js#L279) + */ + type: string; + /** + * Full backend URL of the uploaded file (API endpoint). + */ + url: string; +} + +/** + * File-specific properties that aren't worth defining in the common module. + * + * There are many more Formio properties for the file component that we omitted because + * they're irrelevant for our builder/renderer anyway, e.g. the `storage` and `webcam` + * properties. + */ +interface FileExtras { + /** + * Flag that controls the multi-value mode of the field. + * + * @remarks + * There is some interaction with the configuration option for the maximum number of + * files - it could be inferred if that is unset, then multiple is allowed, otherwise + * set it to `1` or any other fixed number. + */ + multiple?: boolean; + /** + * File selection and processing options. + */ + file: { + /** + * Optional template for the file name. This is picked up in the backend, whereas + * Formio.js typically applies it client-side already. + */ + name: string; + /** + * Allowed file types, expressed as mime type (e.g. `image/*`) or the wildcard + * literal. + */ + type: (`${string}/${string}` | '*')[]; + /** + * Display labels for the specified allowed file types, injected by the backend. + */ + readonly allowedTypesLabels: string[]; + }; + /** + * File pattern string, created from the allowed file types and used for the browser + * file selection input (the `accept` attribute). + * + * May be an empty string, which has the same behaviour as a wildcard. + * + * @deprecated + * This is probably obsoleted by the new renderer, which uses the {@link file} + * configuration instead. + */ + filePattern: string; + /** + * The file size limit for an individual file. + * + * Example values: 10MB, 1GB... + * + * The value is parsed into a "number of bytes" integer. + */ + fileMaxSize?: string; // strings like 10MB, 1GB... parsed by Form.io + + /** + * Apply the file type configuration from the global configuration instead of options + * on this component. + * + * @deprecated + * To be moved into the `openForms` top-level key. + */ + useConfigFiletypes?: boolean; + /** + * Image processing configuration options. Only used in the backend. + * + * @deprecated + * To be moved into the `openForms` top-level key. + */ + of?: { + image?: { + resize?: { + apply?: boolean; + // backend falls back to defaults if the keys are absent, but if they are + // provided, they must be ints + width?: number; + height?: number; + }; + }; + }; + /** + * The maximum number of files that may be added for this component. + * + * @deprecated + * To be moved in the `validate` configuration options? + */ + maxNumberOfFiles?: number | null; + + /** + * Custom registration options for registration plugins. + * + * @deprecated + * This will be moved to a dedicated section in the new admin UI and removed from the + * component configuration, as it doesn't play well with multiple registration backend + * configurations/options at the form level. + */ + registration?: { + informatieobjecttype?: string; + bronorganisatie?: string; + docVertrouwelijkheidaanduiding?: string; + titel?: string; + }; +} + +interface FileExtensions { + /** + * Mark the component as "soft-required", a weaker version of `validate.required`. + * This should be paired with the `softRequiredErrors` component. + * + * When a component is soft required, proceeding to the next step/submitting the form + * is possible without providing a value, but it's strongly recommended to not leave + * the field empty. + */ + softRequired?: boolean; +} + +/** + * Component shape/options for the file component. + * + * The file component is a bit weird - it always uses an array of values, irrespective + * of the `multiple` property value. + * + * @warning The generated documentation might be slightly off due to rendering the type + * alias as an interface. Double check with the actual TS types! + * + * @interface + * + * @category Basic components + */ +export type FileComponentSchema = Prettify< + BaseComponent<'file'> & + Label & + Description & + Tooltip & + DisplayConfig & + Hidden & + ClearOnHide & + IsSensitiveData & + Conditional & + Validation<'required', false> & + OFExtensions<'label' | 'description' | 'tooltip', FileExtensions> & + FileExtras +>; diff --git a/src/components/iban.ts b/src/components/iban.ts new file mode 100644 index 0000000..4aba877 --- /dev/null +++ b/src/components/iban.ts @@ -0,0 +1,32 @@ +import {BaseComponent, Prettify, WithMultiple} from '../base'; +import {ClearOnHide, Description, Hidden, IsSensitiveData, Label, Tooltip} from '../common'; +import {Conditional, DisplayConfig, OFExtensions, Registration} from '../extensions'; +import {Validation} from '../validation'; + +/** + * Component shape/options for a IBAN component. + * + * @warning The generated documentation might be slightly off due to rendering the type + * alias as an interface. Double check with the actual TS types! + * + * @interface + * + * @category Special components + */ +export type IbanComponentSchema = Prettify< + BaseComponent<'iban'> & + Label & + Description & + Tooltip & + DisplayConfig & + Hidden & + ClearOnHide & + IsSensitiveData & + Conditional & + Validation<'required'> & + Registration & + OFExtensions<'label' | 'description' | 'tooltip'> & + // Unfortunately, this results in a top-level union and there's nothing we can do + // about it due to TS limitations :( + WithMultiple +>; diff --git a/src/formio/index.ts b/src/components/index.ts similarity index 51% rename from src/formio/index.ts rename to src/components/index.ts index f1950a1..b77040b 100644 --- a/src/formio/index.ts +++ b/src/components/index.ts @@ -1,89 +1,75 @@ -import { - AddressNLComponentSchema, - BsnComponentSchema, - CheckboxComponentSchema, - ChildrenComponentSchema, - ColumnsComponentSchema, - ContentComponentSchema, - CosignV1ComponentSchema, - CosignV2ComponentSchema, - CurrencyComponentSchema, - CustomerProfileComponentSchema, - DateComponentSchema, - DateTimeComponentSchema, - EditGridComponentSchema, - EmailComponentSchema, - FieldsetComponentSchema, - FileComponentSchema, - IbanComponentSchema, - LicensePlateComponentSchema, - MapComponentSchema, - NpFamilyMembersComponentSchema, - NumberComponentSchema, - PartnersComponentSchema, - PhoneNumberComponentSchema, - PostcodeComponentSchema, - ProductPriceComponentSchema, - RadioComponentSchema, - SelectComponentSchema, - SelectboxesComponentSchema, - SignatureComponentSchema, - SoftRequiredErrorsComponentSchema, - TextFieldComponentSchema, - TextareaComponentSchema, - TimeComponentSchema, -} from './components'; - /** - * A fallback, minimal schema to handle the cases where component.type is something unknown. + * Entrypoint for all available Formio component type schema definitions. * - * This could be because someone pasted a JSON configuration from Form.io's hosted - * form builder into our components or just wrote component definitions directly to our - * API endpoints. - * - * @group Form.io components - * @category Concrete types + * @module components */ -export interface FallbackSchema { - type?: string; -} - -export * from './base'; -export * from './components'; +import {AddressNLComponentSchema} from './addressNL'; +import {BsnComponentSchema} from './bsn'; +import {CheckboxComponentSchema} from './checkbox'; +import {ChildrenComponentSchema} from './children'; +import {ColumnsComponentSchema} from './columns'; +import {ContentComponentSchema} from './content'; +import {CosignV1ComponentSchema, CosignV2ComponentSchema} from './cosign'; +import {CurrencyComponentSchema} from './currency'; +import {CustomerProfileComponentSchema} from './customerProfile'; +import {DateComponentSchema} from './date'; +import {DateTimeComponentSchema} from './datetime'; +import {EditGridComponentSchema} from './editgrid'; +import {EmailComponentSchema} from './email'; +import {FieldsetComponentSchema} from './fieldset'; +import {FileComponentSchema} from './file'; +import {IbanComponentSchema} from './iban'; +import {LicensePlateComponentSchema} from './licensePlate'; +import {MapComponentSchema} from './map'; +import {NpFamilyMembersComponentSchema} from './npFamilyMembers'; +import {NumberComponentSchema} from './number'; +import {PartnersComponentSchema} from './partners'; +import {PhoneNumberComponentSchema} from './phoneNumber'; +import {PostcodeComponentSchema} from './postcode'; +import {RadioComponentSchema} from './radio'; +import {SelectComponentSchema} from './select'; +import {SelectboxesComponentSchema} from './selectboxes'; +import {SignatureComponentSchema} from './signature'; +import {SoftRequiredErrorsComponentSchema} from './softRequiredErrors'; +import {TextareaComponentSchema} from './textarea'; +import {TextFieldComponentSchema} from './textfield'; +import {TimeComponentSchema} from './time'; /** - * Convenience type alias for all supported concrete component schemas. + * Convenience type alias for all supported component schemas. * - * @group Form.io components - * @category Convenience + * @remarks + * While the components may look like individual union members here, keep in mind that + * each component itself may be a union - this is common for components that support the + * `multiple` property. */ export type AnyComponentSchema = - // inputs + // basic | TextFieldComponentSchema | EmailComponentSchema | DateComponentSchema | DateTimeComponentSchema | TimeComponentSchema | PhoneNumberComponentSchema + | PostcodeComponentSchema | FileComponentSchema | TextareaComponentSchema | NumberComponentSchema - | SelectComponentSchema | CheckboxComponentSchema | SelectboxesComponentSchema + | SelectComponentSchema | CurrencyComponentSchema | RadioComponentSchema - // special types + // special | IbanComponentSchema | LicensePlateComponentSchema | BsnComponentSchema - | AddressNLComponentSchema | NpFamilyMembersComponentSchema - | ProductPriceComponentSchema | SignatureComponentSchema | CosignV2ComponentSchema | MapComponentSchema | EditGridComponentSchema + | AddressNLComponentSchema | PartnersComponentSchema | ChildrenComponentSchema | CustomerProfileComponentSchema @@ -93,13 +79,54 @@ export type AnyComponentSchema = | FieldsetComponentSchema | SoftRequiredErrorsComponentSchema // deprecated - | PostcodeComponentSchema | CosignV1ComponentSchema; +export { + // basic + TextFieldComponentSchema, + EmailComponentSchema, + DateComponentSchema, + DateTimeComponentSchema, + TimeComponentSchema, + PhoneNumberComponentSchema, + PostcodeComponentSchema, + FileComponentSchema, + TextareaComponentSchema, + NumberComponentSchema, + CheckboxComponentSchema, + SelectboxesComponentSchema, + SelectComponentSchema, + CurrencyComponentSchema, + RadioComponentSchema, + // special + IbanComponentSchema, + LicensePlateComponentSchema, + BsnComponentSchema, + NpFamilyMembersComponentSchema, + SignatureComponentSchema, + CosignV2ComponentSchema, + MapComponentSchema, + EditGridComponentSchema, + AddressNLComponentSchema, + PartnersComponentSchema, + ChildrenComponentSchema, + CustomerProfileComponentSchema, + // layout + ContentComponentSchema, + ColumnsComponentSchema, + FieldsetComponentSchema, + SoftRequiredErrorsComponentSchema, + // deprecated + CosignV1ComponentSchema, +}; + /** - * Convenience type alias for all supported concrete component schema types. + * A fallback, minimal schema to handle the cases where component.type is something unknown. * - * @group Form.io components - * @category Convenience + * This could be because someone pasted a JSON configuration from Form.io's hosted + * form builder into our components or just wrote component definitions directly to our + * API endpoints. */ -export type AnyComponentSchemaType = AnyComponentSchema['type']; +export interface FallbackSchema { + type?: string; +} diff --git a/src/components/licensePlate.ts b/src/components/licensePlate.ts new file mode 100644 index 0000000..c747a05 --- /dev/null +++ b/src/components/licensePlate.ts @@ -0,0 +1,56 @@ +import {BaseComponent, Prettify, WithMultiple} from '../base'; +import {ClearOnHide, Description, Hidden, IsSensitiveData, Label, Tooltip} from '../common'; +import {Conditional, DisplayConfig, OFExtensions, Registration} from '../extensions'; +import {Validation} from '../validation'; + +/** + * Component shape/options for a license plate component. + * + * @warning The generated documentation might be slightly off due to rendering the type + * alias as an interface. Double check with the actual TS types! + * + * @interface + * + * @category Special components + */ +export type LicensePlateComponentSchema = Prettify< + BaseComponent<'licenseplate'> & + Label & + Description & + Tooltip & + DisplayConfig & + Hidden & + ClearOnHide & + IsSensitiveData & + Conditional & + (Validation<'required' | 'pattern'> & { + validate: { + /** + * The license plate pattern is fixed, defining a structure like `XXX-XXX-XXX`, + * where `X` may be an alphanumeric character. + * + * This is barebones validation - it appears that within a group only the same + * class of characters can be used (either letters or numbers), and there are + * certain prefixes/ranges that are issued in particular years. We opt for the + * minimal validation. + * + * @deprecated + * This hardcoded regex will be removed in the future - the renderer itself will + * implement the correct regex and apply it unless an override is specified. + * + * Possibly in the builder we will then allow form builders to provide their + * own range/pattern. + * + * @remarks + * The backslash escape is probably not necessary? The literal dash should be + * sufficient. + */ + pattern: '^[a-zA-Z0-9]{1,3}\\-[a-zA-Z0-9]{1,3}\\-[a-zA-Z0-9]{1,3}$'; + }; + }) & + Registration & + OFExtensions<'label' | 'description' | 'tooltip'> & + // Unfortunately, this results in a top-level union and there's nothing we can do + // about it due to TS limitations :( + WithMultiple +>; diff --git a/src/components/map.ts b/src/components/map.ts new file mode 100644 index 0000000..66e4470 --- /dev/null +++ b/src/components/map.ts @@ -0,0 +1,192 @@ +import {BaseComponent, Prettify} from '../base'; +import {ClearOnHide, Description, Hidden, IsSensitiveData, Label, Tooltip} from '../common'; +import {Conditional, DisplayConfig, OFExtensions, Registration} from '../extensions'; +import {Validation} from '../validation'; + +/** + * Longitude, in decimal degrees. + */ +type Lon = number; +/** + * Latitude, in decimal degrees. + */ +type Lat = number; + +/** + * A pair of coordinates. Note that in GeoJSON longitude comes before latitude. + */ +export type CoordinatePair = [Lon, Lat]; + +/** + * A single point, identified by its coordinates. + */ +export interface PointGeometry { + type: 'Point'; + coordinates: CoordinatePair; +} + +/** + * A line drawn by connecting the points together. + */ +export interface LineStringGeometry { + type: 'LineString'; + coordinates: CoordinatePair[]; +} + +/** + * A polygon, made up of an array of closed line strings with four or more points. The + * last point of the linestring must be equal to the first. + */ +export interface PolygonGeometry { + type: 'Polygon'; + coordinates: Array< + [CoordinatePair, CoordinatePair, CoordinatePair, CoordinatePair, ...CoordinatePair[]] + >; +} + +/** + * Supported GeoJSON geometries. + * + * See {@link https://www.rfc-editor.org/rfc/rfc7946} for the GeoJSON specification. + */ +export type GeoJsonGeometry = PointGeometry | LineStringGeometry | PolygonGeometry; + +/** + * The possible submission data value type(s) for a map component. + */ +export type MapValue = GeoJsonGeometry | null; + +/** + * Definition of a single overlay layer in the map. + */ +interface Overlay { + /** + * The unique identifier of the tile layer, defined in/by the backend. + */ + uuid: string; + /** + * (Base) url of the tile layer, understood by the renderer to be able to fetch the + * layer data/images to display. It is dynamically set by the backend by resolving the + * `uuid` to the database definition of the layer. + */ + readonly url: string; + /** + * Human readable display name of the layer. Used in the button to toggle layers on/off. + */ + label: string; + type: 'wms' | 'wfs'; + layers: string[]; +} + +/** + * Additional properties specific to the map comonent. + */ +interface MapExtras { + /** + * If true, the backend must apply the globally configured defaults to a particular + * map instance. This results in populating `defaultZoom` and `initialCenter` and is + * therefore only relevant for the backend. + * + * @privateRemarks Make property required, which requires a data migration. + */ + useConfigDefaultMapSettings?: boolean; + /** + * Default zoom level, limited by Leaflet and the available tile service zoom levels. + * + * Leaflet zoom level is a range of 1-20, but the Dutch tile service only supports up + * to level 13. + * + * @privateRemarks Make property required, which requires a data migration. + */ + defaultZoom?: null | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13; + /** + * Coordinates to center the map on initially. + * + * @privateRemarks Make property required, which requires a data migration. + */ + initialCenter?: { + lng?: Lon; + lat?: Lat; + }; + /** + * The identifier used for the background tile layer. + */ + tileLayerIdentifier?: string; + /** + * The url belonging to the connected tile layer object, determined by + * tileLayerIdentifier. + * + * This value should not be definable by admins, but should be fetched + * from the related tile layer object. This happens when fetching the + * component from the backend. + */ + readonly tileLayerUrl?: string; + /** + * Shapes available for users to draw on the map, which set the value of the + * field/component. + * + * These interaction options are based on the options available in leaflet draw: + * {@link https://leaflet.github.io/Leaflet.draw/docs/leaflet-draw-latest.html#drawoptions} + * + * If no interactions are specified at all, this is equivalent to interactions that + * only allow the marker. + */ + interactions?: { + /** + * Allow putting a marker on the map, setting a single point (`PointGeometry`). + */ + marker: boolean; + /** + * Allow drawing a line on the map, setting a list of points (`LineStringGeometry`). + */ + polyline: boolean; + /** + * Allow drawing a closed line string, creating a polygon (`PolygonGeometry`). + */ + polygon: boolean; + }; + /** + * Overlays contain additional (visual) information and may be toggled on/off by the + * end-user. They are displayed above the background tile layer, and layered in the + * order of the definition. They can be used to show heat-maps, highlight certain + * points of interest, or provide additional context. WMS and WFS tile layers provide + * access to lower-level layers, to specify which parts of the entire data-collection + * should be shown in the map. + */ + overlays?: Overlay[]; +} + +/** + * Component shape/options for the map component. + * + * The map displays a geographic map of (a part of) the Netherlands, typically using + * the tile layer(s) from PDOK. The coorindate system is fixed to the Dutch CRS - + * Rijksdriehoek. + * + * Users can draw geometries on the map, which become the input value for the component + * in the submission. They are always GeoJSON. + * + * Map components do not have default values. + * + * @warning The generated documentation might be slightly off due to rendering the type + * alias as an interface. Double check with the actual TS types! + * + * @interface + * + * @category Special components + */ +export type MapComponentSchema = Prettify< + BaseComponent<'map'> & + Label & + Description & + Tooltip & + DisplayConfig & + Hidden & + ClearOnHide & + IsSensitiveData & + MapExtras & + Conditional & + Validation<'required'> & + Registration & + OFExtensions<'label' | 'description' | 'tooltip'> +>; diff --git a/src/components/npFamilyMembers.ts b/src/components/npFamilyMembers.ts new file mode 100644 index 0000000..e657ae3 --- /dev/null +++ b/src/components/npFamilyMembers.ts @@ -0,0 +1,44 @@ +import {BaseComponent, Prettify} from '../base'; +import {ClearOnHide, Description, Hidden, IsSensitiveData, Label, Tooltip} from '../common'; +import {Conditional, DisplayConfig, OFExtensions, Registration} from '../extensions'; +import {Validation} from '../validation'; + +/** + * Component shape/options for the "natural person family members" component. + * + * This component is dynamically transformed into a selectboxes component by the + * backend - only the configuration options are relevant. + * + * The option values are the `bsn` of each family members, and labels are their names. + * + * @deprecated Use the `children` and/or `partners` components instead, if possible. + * + * @warning The generated documentation might be slightly off due to rendering the type + * alias as an interface. Double check with the actual TS types! + * + * @interface + * + * @category Special components + */ +export type NpFamilyMembersComponentSchema = Prettify< + BaseComponent<'npFamilyMembers'> & + Label & + Description & + Tooltip & + DisplayConfig & + Hidden & + ClearOnHide & + IsSensitiveData & { + /** + * Whether the look up and include options for partners of the authenticated user. + */ + includePartners: boolean; + /** + * Whether the look up and include options for children of the authenticated user. + */ + includeChildren: boolean; + } & Conditional & + Validation<'required'> & + Registration & + OFExtensions<'label' | 'description' | 'tooltip'> +>; diff --git a/src/components/number.ts b/src/components/number.ts new file mode 100644 index 0000000..2f0c395 --- /dev/null +++ b/src/components/number.ts @@ -0,0 +1,68 @@ +import {BaseComponent, Prettify} from '../base'; +import { + ClearOnHide, + DefaultValue, + Description, + Hidden, + IsSensitiveData, + Label, + Tooltip, +} from '../common'; +import {Conditional, DisplayConfig, OFExtensions, Prefill, Registration} from '../extensions'; +import {Validation} from '../validation'; + +type NumberFieldExtras = { + /** + * Short indicator that describes the field value, displayed before the input. + * + * A limited set of HTML elements are supported. + */ + prefix?: string; + /** + * Short indicator that describes the field value, displayed after the input. Typically used for units. + * + * A limited set of HTML elements are supported. + */ + suffix?: string; + + /** + * Maximum number of decimal places after the decimal separator. + */ + decimalLimit?: 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10; + /** + * Controls whether negative values are allowed or not (minus sign). + * + * @remarks + * TODO: incorporate this into/derive from the `validate.min` instead? See + * {@link https://github.com/open-formulieren/open-forms/issues/3430} + */ + allowNegative?: boolean; +}; + +/** + * Component shape/options for a number component. + * + * @warning The generated documentation might be slightly off due to rendering the type + * alias as an interface. Double check with the actual TS types! + * + * @interface + * + * @category Basic components + */ +export type NumberComponentSchema = Prettify< + BaseComponent<'number'> & + Label & + Description & + Tooltip & + NumberFieldExtras & + DisplayConfig & + Hidden & + ClearOnHide & + IsSensitiveData & + DefaultValue & + Conditional & + Validation<'required' | 'min' | 'max'> & + Registration & + Prefill & + OFExtensions<'label' | 'description' | 'tooltip' | 'prefix' | 'suffix'> +>; diff --git a/src/components/partners.ts b/src/components/partners.ts new file mode 100644 index 0000000..934411d --- /dev/null +++ b/src/components/partners.ts @@ -0,0 +1,41 @@ +import {BaseComponent, Prettify} from '../base'; +import {ClearOnHide, Description, Hidden, IsSensitiveData, Label, Tooltip} from '../common'; +import {Conditional, OFExtensions, Registration} from '../extensions'; + +export interface PartnerDetails { + bsn: string; + initials: string; + affixes: string; + lastName: string; + /** + * @remarks + * TODO: add support for Date instances? + */ + dateOfBirth: string; +} + +/** + * Component shape/options for the partners (family members) component. + * + * The submission data type is always an array of `PartnerDetails`, even if at most one + * partner is expected. + * + * @warning The generated documentation might be slightly off due to rendering the type + * alias as an interface. Double check with the actual TS types! + * + * @interface + * + * @category Special components + */ +export type PartnersComponentSchema = Prettify< + BaseComponent<'partners'> & + Label & + Description & + Tooltip & + Hidden & + ClearOnHide & + IsSensitiveData & + Conditional & + Registration & + OFExtensions<'label' | 'description' | 'tooltip'> +>; diff --git a/src/components/phoneNumber.ts b/src/components/phoneNumber.ts new file mode 100644 index 0000000..28cecca --- /dev/null +++ b/src/components/phoneNumber.ts @@ -0,0 +1,41 @@ +import {BaseComponent, Prettify, WithMultiple} from '../base'; +import { + AutoComplete, + ClearOnHide, + Description, + Hidden, + IsSensitiveData, + Label, + Tooltip, +} from '../common'; +import {Conditional, DisplayConfig, OFExtensions, Registration} from '../extensions'; +import {Validation} from '../validation'; + +/** + * Component shape/options for a phone number component. + * + * @warning The generated documentation might be slightly off due to rendering the type + * alias as an interface. Double check with the actual TS types! + * + * @interface + * + * @category Basic components + */ +export type PhoneNumberComponentSchema = Prettify< + BaseComponent<'phoneNumber'> & + Label & + Description & + Tooltip & + DisplayConfig & + Hidden & + ClearOnHide & + IsSensitiveData & + AutoComplete & + Conditional & + Validation<'required' | 'pattern'> & + Registration & + OFExtensions<'label' | 'description' | 'tooltip'> & + // Unfortunately, this results in a top-level union and there's nothing we can do + // about it due to TS limitations :( + WithMultiple +>; diff --git a/src/components/postcode.ts b/src/components/postcode.ts new file mode 100644 index 0000000..66023df --- /dev/null +++ b/src/components/postcode.ts @@ -0,0 +1,61 @@ +import {BaseComponent, Prettify, WithMultiple} from '../base'; +import { + ClearOnHide, + Description, + Hidden, + IsSensitiveData, + Label, + ReadOnly, + Tooltip, +} from '../common'; +import {Conditional, DisplayConfig, OFExtensions, Prefill, Registration} from '../extensions'; +import {Validation} from '../validation'; + +/** + * Component shape/options for a postcode component. + * + * @warning The generated documentation might be slightly off due to rendering the type + * alias as an interface. Double check with the actual TS types! + * + * @interface + * + * @category Basic components + */ +export type PostcodeComponentSchema = Prettify< + BaseComponent<'postcode'> & + Label & + Description & + Tooltip & + DisplayConfig & + Hidden & + ClearOnHide & + IsSensitiveData & + ReadOnly & + Conditional & + (Validation<'required' | 'pattern'> & { + validate: { + /** + * The postcode pattern is fixed, defining a structure like `1234 AB`. Certain + * letter combinations are prohibited. + * + * A Dutch postcode has 4 numbers and 2 letters (case insensitive). Letter + * combinations SS, SD and SA are not used due to the Nazi-association. + * See {@link https://stackoverflow.com/a/17898538/7146757 and https://nl.wikipedia.org/wiki/Postcodes_in_Nederland} + * + * @deprecated + * This hardcoded regex will be removed in the future - the renderer itself will + * implement the correct regex and apply it unless an override is specified. + * + * Possibly in the builder we will then allow form builders to provide their + * own range/pattern. + */ + pattern: '^[1-9][0-9]{3} ?(?!sa|sd|ss|SA|SD|SS)[a-zA-Z]{2}$'; + }; + }) & + Registration & + Prefill & + OFExtensions<'label' | 'description' | 'tooltip'> & + // Unfortunately, this results in a top-level union and there's nothing we can do + // about it due to TS limitations :( + WithMultiple +>; diff --git a/src/components/radio.ts b/src/components/radio.ts new file mode 100644 index 0000000..d0ec9ff --- /dev/null +++ b/src/components/radio.ts @@ -0,0 +1,67 @@ +import {BaseComponent, Prettify} from '../base'; +import { + ClearOnHide, + DefaultValue, + Description, + Hidden, + IsSensitiveData, + Label, + Tooltip, +} from '../common'; +import {Conditional, DisplayConfig, OFExtensions, Registration} from '../extensions'; +import {ManualValues, Option, ReferenceListsValues, VariableValues} from '../options'; +import {Validation} from '../validation'; + +/** + * Additional radio-component configuration options that are custom from Formio.js, + * stored in the top-level `openForms` property. + * + * These configurations are used by the backend and/or renderer. + */ +type RadioExtensions = ManualValues | VariableValues | ReferenceListsValues; + +/** + * Additional properties specific to the radio component definition. + */ +interface RadioExtra { + /** + * The available options that the user can choose from. Either configured manually on + * the component itself, or programmatically by the backend after resolving the + * configured data source set in `openForms.dataSrc`. + */ + values: Option[]; +} + +/** + * Component shape/options for the radio component. + * + * Radio allows users to check exactly one option in a set of predefined options. + * + * @remarks + * The submission data value type is the `value` property of the selected option, always + * a string. + * + * @warning The generated documentation might be slightly off due to rendering the type + * alias as an interface. Double check with the actual TS types! + * + * @interface + * + * @category Basic components + */ +export type RadioComponentSchema = Prettify< + BaseComponent<'radio'> & + Label & + Description & + Tooltip & + DisplayConfig & + Hidden & + ClearOnHide & + IsSensitiveData & + // TODO: we can probably drop `null` because empty strings for `value` are not allowed. + DefaultValue & + RadioExtra & + Conditional & + Validation<'required'> & + Registration & + Required> +>; diff --git a/src/components/select.ts b/src/components/select.ts new file mode 100644 index 0000000..b0157f1 --- /dev/null +++ b/src/components/select.ts @@ -0,0 +1,76 @@ +import {BaseComponent, Prettify, WithMultiple} from '../base'; +import {ClearOnHide, Description, Hidden, IsSensitiveData, Label, Tooltip} from '../common'; +import {Conditional, DisplayConfig, OFExtensions, Registration} from '../extensions'; +import {ManualValues, Option, ReferenceListsValues, VariableValues} from '../options'; +import {Validation} from '../validation'; + +/** + * Additional select-component configuration options that are custom from Formio.js, + * stored in the top-level `openForms` property. + * + * These configurations are used by the backend and/or renderer. + */ +type SelectExtensions = ManualValues | VariableValues | ReferenceListsValues; + +/** + * Additional properties specific to the select component definition. + * + * Vanilla formio supports additional properties, such as `dataSrc`. Our renderer only + * supports manual values, so those extra properties have been omitted since they're not + * relevant for us. + */ +interface SelectExtra { + /** + * Data for the select component, containing the available values. + * + * This a Formio.js implementation detail handling the polymorphism through `dataSrc`. + * For Open Forms, this is not relevant, but we comply with the upstream configuration. + * + * If other data sources are used (through `openForms.dataSrc`), they result in `data` + * and `data.values` being set by the backend. + */ + data: { + /** + * The available options that the user can choose from. Either configured manually on + * the component itself, or programmatically by the backend after resolving the + * configured data source set in `openForms.dataSrc`. + */ + values: Option[]; + }; +} + +/** + * Component shape/options for the select component. + * + * Select allows users to check one or more options from a set of predefined options, + * depending on component configuration. + * + * @remarks + * The submission data value type depends on the value of `multiple` - for single value + * components, it's a string matching the `value` the `value` property of the selected + * option. For multi-value fields, it's an array of strings that match the options + * values. + * + * @warning The generated documentation might be slightly off due to rendering the type + * alias as an interface. Double check with the actual TS types! + * + * @interface + * + * @category Basic components + */ +export type SelectComponentSchema = Prettify< + BaseComponent<'select'> & + Label & + Description & + Tooltip & + DisplayConfig & + Hidden & + ClearOnHide & + IsSensitiveData & + SelectExtra & + Conditional & + Validation<'required'> & + Registration & + Required> & + WithMultiple +>; diff --git a/src/components/selectboxes.ts b/src/components/selectboxes.ts new file mode 100644 index 0000000..6e30401 --- /dev/null +++ b/src/components/selectboxes.ts @@ -0,0 +1,67 @@ +import {BaseComponent, Prettify} from '../base'; +import { + ClearOnHide, + DefaultValue, + Description, + Hidden, + IsSensitiveData, + Label, + Tooltip, +} from '../common'; +import {Conditional, DisplayConfig, OFExtensions, Registration} from '../extensions'; +import {ManualValues, Option, ReferenceListsValues, VariableValues} from '../options'; +import {Validation} from '../validation'; + +/** + * Additional selectboxes-component configuration options that are custom from Formio.js, + * stored in the top-level `openForms` property. + * + * These configurations are used by the backend and/or renderer. + */ +type SelectboxesExtensions = ManualValues | VariableValues | ReferenceListsValues; + +/** + * Additional properties specific to the selectboxes component definition. + */ +interface SelectboxesExtra { + /** + * The available options that the user can choose from. Either configured manually on + * the component itself, or programmatically by the backend after resolving the + * configured data source set in `openForms.dataSrc`. + */ + values: Option[]; +} + +/** + * Component shape/options for the selectboxes component. + * + * Selectboxes allow users to check one or more checkboxes for predefined options. It's + * the multi-option variant of the `radio` component. + * + * @remarks + * The submission data value type is a mapping of the `option` value to a boolean that + * indicates if the option is checked or not. + * + * @warning The generated documentation might be slightly off due to rendering the type + * alias as an interface. Double check with the actual TS types! + * + * @interface + * + * @category Basic components + */ +export type SelectboxesComponentSchema = Prettify< + BaseComponent<'selectboxes'> & + Label & + Description & + Tooltip & + DisplayConfig & + Hidden & + ClearOnHide & + IsSensitiveData & + DefaultValue> & + SelectboxesExtra & + Conditional & + Validation<'required' | 'minSelectedCount' | 'maxSelectedCount'> & + Registration & + Required> +>; diff --git a/src/components/signature.ts b/src/components/signature.ts new file mode 100644 index 0000000..7a8ca1e --- /dev/null +++ b/src/components/signature.ts @@ -0,0 +1,47 @@ +import {BaseComponent, Prettify} from '../base'; +import {ClearOnHide, Description, Hidden, IsSensitiveData, Label, Tooltip} from '../common'; +import {Conditional, DisplayConfig, OFExtensions, Registration} from '../extensions'; +import {Validation} from '../validation'; + +/** + * The value is base64 encoded binary (image) data, or unset and then it's a string. + * + * When a non-empty value is set, enforce that it is serialized as a data URI. + */ +export type SignatureValue = `data:image/png;base64,${string}`; + +/** + * Component shape/options for a signature component. + * + * @deprecated The signature component has serious accesibility issues - ideally we'd + * like to remove it. + * + * @warning The generated documentation might be slightly off due to rendering the type + * alias as an interface. Double check with the actual TS types! + * + * @interface + * + * @category Special components + */ +export type SignatureComponentSchema = Prettify< + BaseComponent<'signature'> & + Label & + Description & + Tooltip & + DisplayConfig & + Hidden & + ClearOnHide & + IsSensitiveData & { + /** + * The footer is a text displayed below the drawing canvas which may hint the + * user to what is expected of them. + * + * @remarks + * It's a bit unclear what the difference is with the `description` field. + */ + footer?: string; + } & Conditional & + Validation<'required'> & + Registration & + OFExtensions<'label' | 'description' | 'tooltip' | 'footer'> +>; diff --git a/src/components/softRequiredErrors.ts b/src/components/softRequiredErrors.ts new file mode 100644 index 0000000..f26ed78 --- /dev/null +++ b/src/components/softRequiredErrors.ts @@ -0,0 +1,28 @@ +import {BaseComponent, Prettify} from '../base'; +import {OFExtensions} from '../extensions'; + +/** + * Component shape/options for a "soft required errors" component. + * + * This component tracks the values of other components that are marked as + * "soft required" - i.e. you can continue without filling in a value, but it's highly + * recommended *not to do that*. This component is responsible for displaying a warning + * message. + * + * @warning The generated documentation might be slightly off due to rendering the type + * alias as an interface. Double check with the actual TS types! + * + * @interface + * + * @category Layout components + */ +export type SoftRequiredErrorsComponentSchema = Prettify< + BaseComponent<'softRequiredErrors'> & + OFExtensions<'html'> & { + /** + * Rich text content, in HTML form. Expected to contain the `{{ missingFields }}` + * placeholder/token. + */ + html: string; + } +>; diff --git a/src/components/textarea.ts b/src/components/textarea.ts new file mode 100644 index 0000000..cbb7430 --- /dev/null +++ b/src/components/textarea.ts @@ -0,0 +1,58 @@ +import {BaseComponent, Prettify, WithMultiple} from '../base'; +import { + AutoComplete, + ClearOnHide, + Description, + Hidden, + IsSensitiveData, + Label, + Placeholder, + ReadOnly, + ShowCharCount, + Tooltip, +} from '../common'; +import {Conditional, DisplayConfig, OFExtensions} from '../extensions'; +import {Validation} from '../validation'; + +type TextareaExtras = { + /** + * Number of rows making up the (starting) height of the textbox. + */ + rows?: number; + /** + * If enabled, the textbox grows in size as the user types more text in it. + */ + autoExpand: boolean; +}; + +/** + * Component shape/options for a textarea component. + * + * @warning The generated documentation might be slightly off due to rendering the type + * alias as an interface. Double check with the actual TS types! + * + * @interface + * + * @category Basic components + */ +export type TextareaComponentSchema = Prettify< + BaseComponent<'textarea'> & + Label & + Description & + Tooltip & + DisplayConfig & + Hidden & + ClearOnHide & + IsSensitiveData & + AutoComplete & + ReadOnly & + Placeholder & + ShowCharCount & + Conditional & + Validation<'required' | 'maxLength' | 'pattern'> & + OFExtensions<'label' | 'description' | 'tooltip' | 'placeholder'> & + TextareaExtras & + // Unfortunately, this results in a top-level union and there's nothing we can do + // about it due to TS limitations :( + WithMultiple +>; diff --git a/src/components/textfield.ts b/src/components/textfield.ts new file mode 100644 index 0000000..e64e29f --- /dev/null +++ b/src/components/textfield.ts @@ -0,0 +1,64 @@ +import {BaseComponent, Prettify, WithMultiple} from '../base'; +import { + AutoComplete, + ClearOnHide, + Description, + Hidden, + IsSensitiveData, + Label, + Placeholder, + ReadOnly, + ShowCharCount, + Tooltip, +} from '../common'; +import {Conditional, DisplayConfig, OFExtensions, Prefill, Registration} from '../extensions'; +import {Validation} from '../validation'; + +/** + * Component shape/options for a textfield component. + * + * @warning The generated documentation might be slightly off due to rendering the type + * alias as an interface. Double check with the actual TS types! + * + * @interface + * + * @category Basic components + */ +export type TextFieldComponentSchema = Prettify< + BaseComponent<'textfield'> & + Label & + Description & + Tooltip & + DisplayConfig & + Hidden & + ClearOnHide & + IsSensitiveData & + AutoComplete & + ReadOnly & + Placeholder & + ShowCharCount & + Conditional & + Validation<'required' | 'maxLength' | 'pattern'> & + Registration & + Prefill & { + /** + * @deprecated in favour of addressNL component + */ + deriveStreetName?: boolean; + /** + * @deprecated in favour of addressNL component + */ + deriveCity?: boolean; + /** + * @deprecated in favour of addressNL component + */ + derivePostcode?: string; + /** + * @deprecated in favour of addressNL component + */ + deriveHouseNumber?: string; + } & OFExtensions<'label' | 'description' | 'tooltip' | 'placeholder'> & + // Unfortunately, this results in a top-level union and there's nothing we can do + // about it due to TS limitations :( + WithMultiple +>; diff --git a/src/components/time.ts b/src/components/time.ts new file mode 100644 index 0000000..a630043 --- /dev/null +++ b/src/components/time.ts @@ -0,0 +1,47 @@ +import {BaseComponent, Prettify, WithMultiple} from '../base'; +import { + ClearOnHide, + Description, + Hidden, + IsSensitiveData, + Label, + ReadOnly, + Tooltip, +} from '../common'; +import {Conditional, DisplayConfig, OFExtensions, Registration} from '../extensions'; +import {Validation} from '../validation'; + +/** + * Component shape/options for a time component. + * + * The smallest supported resolution is minutes - seconds are truncated to be 0 seconds. + * + * @remarks + * Note that the value/`defaultValue` type is just a plain string - a serialized + * ISO-8601 time. There's no native time type in JS that we can use instead. + * + * @warning The generated documentation might be slightly off due to rendering the type + * alias as an interface. Double check with the actual TS types! + * + * @interface + * + * @category Basic components + */ +export type TimeComponentSchema = Prettify< + BaseComponent<'time'> & + Label & + Description & + Tooltip & + DisplayConfig & + Hidden & + ClearOnHide & + IsSensitiveData & + ReadOnly & + Conditional & + Validation<'required' | 'minTime' | 'maxTime'> & + Registration & + OFExtensions<'label' | 'description' | 'tooltip'> & + // Unfortunately, this results in a top-level union and there's nothing we can do + // about it due to TS limitations :( + WithMultiple +>; diff --git a/src/extensions.ts b/src/extensions.ts new file mode 100644 index 0000000..2a67da0 --- /dev/null +++ b/src/extensions.ts @@ -0,0 +1,260 @@ +/** + * Open Forms-specific extensions to Formio component types. + * + * Historically, Open Forms has been adding extra configuration options haphazardly, + * rather than properly namespacing those. The types in this module bundle logical units + * together. + * + * @module extensions + */ +import {Prettify} from 'base'; + +import {SupportedLocales} from './i18n'; + +/** + * Properties controlling in which kind of summaries the backend will include the + * component for display. + * + * @group Open Forms schema extensions + * @todo Move into `openForms` top-level key + */ +export interface DisplayConfig { + /** + * Include the component and its value in the submission data summary on the + * confirmation page or not. + */ + showInSummary?: boolean; + /** + * Include the component and its value in the confirmation email data. + */ + showInEmail?: boolean; + /** + * Include the component and its value in the submission report PDF available for + * download by the end-user and often included in registration plugins. + */ + showInPDF?: boolean; +} + +/** + * Describe that the component is conditionally visible: `show` (or hide) this component + * when the component with key `when` is equal to `eq`. + * + * The behaviour is not always obvious: + * - `show: true` -> show the component when the condition is met, otherwise hide it + * - `show: false` -> hide the component when the condition is met, otherwise show it + * - the reference `when` may be an item inside an editgrid, in which case the key must + * be `editgridKey.componentKey` and the conditional is evaluated with the edit grid + * item data as scope (merged with the root scope) + * - `eq` tests for equality, except when the reference component is an array of values + * (e.g. when the component has `multiple: true`), then the test is a membership check + * of the expected value. + * + * This type definition is different from Formio's `ConditionalOptions`: + * + * - we don't support `json` + * - `eq` can be any JSON-serializable type, not just string. Note that our builder + * uses appropriate JS types for the component type referenced via `when`. + */ +export interface Conditional { + conditional?: { + /** + * Whether the field should be shown (`true`) or hidden (`false`) when the condition + * is met. + */ + show?: boolean; + /** + * The reference component `key`. Its value will be retrieved and tested against `eq`. + */ + when?: string; + /** + * The value that should be checked against the reference component value. + * + * For array values (of the reference component), the array is checked if it contains + * the specified value. + * + * @note Only (a subset of) primitives are supported. + */ + eq?: string | number | boolean; + }; +} + +/** + * @group Open Forms schema extensions + */ +export interface Registration { + /** + * Configuration on how to process the value of the component in the registration + * plugin(s). + * + * @deprecated Component-level registration configuration does not work reliably when + * multiple registration plugins are enabled on the form. This will be moved in the + * new admin UI. + */ + registration?: { + attribute: string; + }; +} + +/** + * @group Open Forms schema extensions + */ +export interface Prefill { + /** + * Configuration on how to prefill the value of the component for the (authenticated) + * user. + * + * @deprecated Component-level prefill configuration is not flexible enough, this will + * be moved in the new admin UI. + */ + prefill?: { + /** + * The plugin to use for prefill. If there's no prefill, the value must be an empty + * string. + */ + plugin: string; + /** + * Attribute within the plugin to read to extract the prefill value. If there's no + * prefill, the value must be an empty string. + */ + attribute: string; + /** + * In the event of a mandate, should the prefill be looked up from the beneficiary + * or the authorizee? + */ + identifierRole: 'main' | 'authorised_person'; + }; +} + +/** + * Open Forms extensions, scoped under the top-level `openForms` key.` + * + * The `TP` type var expects a union of property names that can be translated, i.e. for + * designers can supply translations for these properties and the backend will pick the + * correct one. + * + * The `Extra` type var allows injection of additional component-specific extensions + * under the `openForms` key. + */ +export interface OFExtensions< + TP extends string = never, + Extra extends object = Record +> { + openForms?: Prettify< + { + translations?: { + [K in SupportedLocales]?: { + [K in TP]?: string; + }; + }; + } & Extra + >; +} + +/** + * @groupDescription Date/datetime validations + * + * Date and datetime components can be configured with certain minimum/maximum date + * validation modes, which are evaluated dynamically in the backend to resolve to + * specific `min` or `max` values for the validation. + * + * The configurations are stored in the top-level `openForms` property of the component + * definitions. + * + * @showGroups + */ + +/** + * Definition of a delta for a date constraint, in number of years, months and/or days. + * + * @remarks The numbers are expected to be integers. + * + * @group Date/datetime validations + */ +export interface DateConstraintDelta { + /** + * Number of years relative to the anchor date(time). Leaving this empty is equivalent + * to 0. Summed together with the other properties to calculate an offset. + */ + years: number | null; + /** + * Number of months relative to the anchor date(time). Leaving this empty is equivalent + * to 0. Summed together with the other properties to calculate an offset. + */ + months: number | null; + /** + * Number of days relative to the anchor date(time). Leaving this empty is equivalent + * to 0. Summed together with the other properties to calculate an offset. + */ + days: number | null; +} + +/** + * @group Date/datetime validations + */ +export interface NoDateConstraint { + mode: ''; +} + +/** + * Fixed date/datetime anchor point. The value is stored in the `component.datePicker` + * configuration. + * + * @group Date/datetime validations + */ +export interface FixedValueDateConstraint { + mode: 'fixedValue'; +} + +interface IncludeToday { + /** + * If true, then the current day/date is considered an allowed value too. + */ + includeToday: boolean | null; +} + +/** + * Allow dates later than "now/today". For dates, `includeToday` controls if the current + * day is valid too. + * + * @group Date/datetime validations + */ +export type FutureDateConstraint = Prettify< + { + mode: 'future'; + } & (WithIncludeToday extends true ? IncludeToday : Record) +>; + +/** + * Allow dates before "now/today". For dates, `includeToday` controls if the current + * day is valid too. + * + * @group Date/datetime validations + */ +export type PastDateConstraint = Prettify< + { + mode: 'past'; + } & (WithIncludeToday extends true ? IncludeToday : Record) +>; + +/** + * Allow values that fall within the range determined by applying a delta to the + * reference value/variable. + * + * @group Date/datetime validations + */ +export interface RelativeDateConstraint { + mode: 'relativeToVariable'; + /** + * Which (other) variable to add or subtract the delta to/from, resulting in a + * calculated date/datetime to use as boundary. + */ + variable?: string; + /** + * The amount of days to add to/subtract from the reference variable. + */ + delta: DateConstraintDelta; + /** + * Whether to calculate a date after or before the reference variable. + */ + operator?: 'add' | 'subtract'; +} diff --git a/src/formio/base.ts b/src/formio/base.ts deleted file mode 100644 index 0ec0df3..0000000 --- a/src/formio/base.ts +++ /dev/null @@ -1,226 +0,0 @@ -import {ComponentSchema as FormioComponentSchema} from 'formiojs'; - -import {ComponentTranslations, ErrorTranslations} from './i18n'; -import { - ComponentErrorKeys, - ComponentErrors, - CuratedValidatorNames, - OFValidateOptions, -} from './validation'; - -// Refinements of form.io 'builtin' types. - -/** - * The `HasValidation` interfaces encapsulates properties involved in validation. - * - * - The `validate` property defines the types for each possible Formio validator, e.g. - * a `pattern` must be a string, while a `maxLength` must be a number. Open Forms - * also supports backend validators that are called async, which is specified as a - * list of strings for the validator names. - * - The `errors` property defines the (translated) error messages that may be returned - * by the backend, at runtime. The possible keys are coupled with the possible - * validator names in the `validate` property. The resulting strings are the strings - * that are ultimately presented to the end user. - * - The `translatedErrors` property is used to store the translated error messages. The - * keys are the supported language codes, the values have the same shape as the - * `errors` property. Effectively, at runtime, this object is assigned for the active - * language: `Object.assign(obj.errors, obj.translatedErrors[activeLanguage])`. - * - * There are some generics involed: - * - * - `VN`: the relevant validator names. Most components only use a small subset of - * validator options depending on their type. E.g. a `pattern` makes no sense for a - * number field, only for textfield/textarea etc. Likewise, `max` only has meaning for - * numbers, but not for strings. Typically you pass in a union: - * `'pattern' | 'maxLength'`. This generic is then used to populate the `errors` and - * `translatedErrors` objects with only the relevant keys. - * - `WithPlugins` - most components support plugin validation, but the error messages - * come from the server. The `plugins` key is never included in the `errors` and - * `translatedErrors` objects. Pass `false` if plugin validation is not available for - * the component. - */ -export interface HasValidation< - VN extends CuratedValidatorNames, - WithPlugins extends boolean = true -> { - validate?: OFValidateOptions; - errors?: ComponentErrors>; - translatedErrors?: ErrorTranslations>; -} - -// any schema having (localised) validators -export type SchemaWithValidation = HasValidation; -// given a specific component schema, extract the possible keys that can be used for -// translated/specific validation errors. This returns the translatable error keys, not -// the validator names. -export type PossibleValidatorErrorKeys = Exclude< - keyof Required['errors'], - // MultiCapable causes objects to be part of the type, resulting in keyof Object - // also being a valid key, but it isn't. - keyof Object ->; - -/** - * Replacement of Formio's `ConditionalOptions`, changes are: - * - * - we don't support `json` - * - `eq` can be any JSON-serializable type, not just string. Note that our builder - * uses appropriate JS types for the component type referenced via `when`.` - */ -export interface OFConditionalOptions { - /** If the field should show if the condition is true */ - show?: boolean; - /** The field API key that it should compare its value against to determine if the condition is triggered. */ - when?: string; - /** - * The value that should be checked against the comparison component. - * - * For array values, the array is checked if it contains the specified value. - * - * @note Only (a subset of) primitives are supported. - */ - eq?: string | number | boolean; -} - -interface ComponentSchema extends Omit, 'conditional'> { - /** - * Dynamically determines if the component is visible/available. - */ - conditional?: OFConditionalOptions; -} - -/** - * @group Open Forms schema extensions - */ -export interface DisplayConfig { - showInSummary?: boolean; - showInEmail?: boolean; - showInPDF?: boolean; -} - -/** - * @group Open Forms schema extensions - */ -export interface PrefillConfig { - prefill?: { - plugin: string; // when no prefill is applicable, the value must be empty string - attribute: string; // when no prefill is applicable, the value must be empty string - identifierRole: 'main' | 'authorised_person'; - }; -} - -/** - * @group Open Forms schema extensions - * - * The `Extra` type variable allows specifying additional, component-specific, - * extensions namespaced under the `openForms` key. - */ -export interface OFExtensions { - isSensitiveData?: boolean; - openForms?: { - translations: ComponentTranslations; - } & Extra; - registration?: { - attribute: string; - }; -} - -// Form.io defines *a lot* of optional properties in their component schema. We can omit -// the ones we never make use of to reduce confusion for the formio-renderer and -// formio-builder libraries. -type UnusedFormioProperties = - | 'input' // often present in the schema, but I don't think we do anything with it - | 'tableView' - | 'protected' - | 'prefix' - | 'suffix' - | 'unique' - | 'persistent' - | 'logic' // the backend handles any logic - this may change in the future - | 'customClass' // only used in the content component -> re-add it there - | 'dataGridLabel' - | 'labelPosition' - | 'labelWidth' - | 'labelMargin' - | 'errorLabel' - | 'tabindex' - | 'autofocus' - | 'dbIndex' - | 'customDefaultValue' - | 'calculateValue' - | 'allowCalculateOverride' - | 'widget' - | 'refreshOn' - | 'clearOnRefresh' - // we roll our own validate with only the relevant keys for each component - | 'validate'; - -/** - * Define a strict variant of Form.io's ComponentSchema interface. - * - * This schema refines Form.io's (too loose) schema. It applies to *most* of the - * component types we support. - * - * We also exclude 'multiple' here to force people to explicitly opt-in through the - * `MultipleCapable` for components that support it. - * - * @group Schema primitives - */ -export interface StrictComponentSchema - extends Omit, UnusedFormioProperties | 'multiple'> { - id: string; - key: string; - type: string; - label: string; -} - -export interface Multiple { - multiple: true; - defaultValue?: T[]; -} - -export interface Single { - multiple?: false; - defaultValue?: T; -} - -/** - * Make a given component schema multiple capable by type narrowing the `defaultValue` - * based on the (literal) value of the multiple key. - * - * This is done by inferring the canonical data type of the component schema and - * checking which generic type var is passed in to decide on the correct decision - * branch. The T typevar is fed all the way down to Form.io's ComponentSchema. - * - * Note that this requires the InputComponentSchema to define upfront that the - * value can be T or T[], as the base type needs to be sufficiently wide. - */ -export type MultipleCapable = S extends {defaultValue?: infer DV} - ? DV extends Array - ? S & Multiple - : S & Single - : never; - -// (user) inputs - -/** - * @group Schema primitives - * - * The `ExtraExtensions` type variable allows specifying additional, component-specific, - * extensions namespaced under the `openForms` key. - */ -export type InputComponentSchema< - T = unknown, - VN extends CuratedValidatorNames = CuratedValidatorNames, - TK extends string = string, - ExtraExtensions = {} -> = StrictComponentSchema & - DisplayConfig & - OFExtensions & - HasValidation; - -/** - * @group Schema primitives - */ -export interface LayoutComponentSchema - extends Omit, UnusedFormioProperties> {} diff --git a/src/formio/common.ts b/src/formio/common.ts deleted file mode 100644 index 3520076..0000000 --- a/src/formio/common.ts +++ /dev/null @@ -1,38 +0,0 @@ -import {JSONObject} from '../types'; -import {ComponentTranslations} from './i18n'; - -/** - * @category Utilities - */ -export interface Option { - value: string; - label: string; - description?: string; - openForms?: { - translations: ComponentTranslations<'label' | 'description'>; - }; -} - -/** - * @category Utilities - */ -export interface ManualValues { - dataSrc: 'manual'; -} - -/** - * @category Utilities - */ -export interface VariableValues { - dataSrc: 'variable'; - itemsExpression: string | JSONObject; -} - -/** - * @category Utilities - */ -export interface ReferenceListsValues { - dataSrc: 'referenceLists'; - service: string; - code: string; -} diff --git a/src/formio/components/addressNL.ts b/src/formio/components/addressNL.ts deleted file mode 100644 index 212f585..0000000 --- a/src/formio/components/addressNL.ts +++ /dev/null @@ -1,42 +0,0 @@ -import {HasValidation, InputComponentSchema} from '..'; - -type Validator = 'required'; -type TranslatableKeys = 'label' | 'description' | 'tooltip'; - -export interface AddressData { - postcode: string; - houseNumber: string; - houseLetter: string; - houseNumberAddition: string; - city?: string; - streetName?: string; - secretStreetCity?: string; - autoPopulated?: boolean; -} - -export interface AddressComponents { - postcode?: HasValidation<'pattern', false>; - city?: HasValidation<'pattern', false>; -} - -export interface AddressNLExtensions { - components?: AddressComponents; -} - -export type AddressNLInputSchema = InputComponentSchema< - AddressData, - Validator, - TranslatableKeys, - AddressNLExtensions ->; - -/** - * @group Form.io components - * @category Concrete types - */ -export interface AddressNLComponentSchema - extends Omit { - type: 'addressNL'; - deriveAddress: boolean; - layout: 'singleColumn' | 'doubleColumn'; -} diff --git a/src/formio/components/bsn.ts b/src/formio/components/bsn.ts deleted file mode 100644 index d0165a5..0000000 --- a/src/formio/components/bsn.ts +++ /dev/null @@ -1,30 +0,0 @@ -import {InputComponentSchema, MultipleCapable, PrefillConfig} from '..'; - -type Validator = 'required'; -type TranslatableKeys = 'label' | 'description' | 'tooltip'; - -export type BsnInputSchema = InputComponentSchema; - -/** - * @group Form.io components - * @category Base types - */ -export interface BsnProperties { - type: 'bsn'; - inputMask: '999999999'; - validateOn: 'blur'; -} - -/** - * @group Form.io components - * @category Base types - */ -export type BaseBsnComponentSchema = Omit & - BsnProperties & - PrefillConfig; - -/** - * @group Form.io components - * @category Concrete types - */ -export type BsnComponentSchema = MultipleCapable; diff --git a/src/formio/components/checkbox.ts b/src/formio/components/checkbox.ts deleted file mode 100644 index 342313a..0000000 --- a/src/formio/components/checkbox.ts +++ /dev/null @@ -1,16 +0,0 @@ -import {InputComponentSchema} from '..'; - -type Validator = 'required'; -type TranslatableKeys = 'label' | 'description' | 'tooltip'; - -export type CheckboxInputSchema = InputComponentSchema; - -/** - * @group Form.io components - * @category Concrete types - */ -export interface CheckboxComponentSchema - extends Omit { - type: 'checkbox'; - defaultValue: boolean; -} diff --git a/src/formio/components/children.ts b/src/formio/components/children.ts deleted file mode 100644 index e84842b..0000000 --- a/src/formio/components/children.ts +++ /dev/null @@ -1,17 +0,0 @@ -import {OFExtensions, StrictComponentSchema} from '..'; - -export interface ChildDetails { - bsn: string; - firstNames: string; - dateOfBirth: string; -} -/** - * @group Form.io components - * @category Concrete types - */ -export interface ChildrenComponentSchema - extends Omit, 'placeholder' | 'disabled' | 'validateOn'>, - OFExtensions { - type: 'children'; - enableSelection: boolean; -} diff --git a/src/formio/components/columns.ts b/src/formio/components/columns.ts deleted file mode 100644 index f1ffef3..0000000 --- a/src/formio/components/columns.ts +++ /dev/null @@ -1,59 +0,0 @@ -import {AnyComponentSchema, LayoutComponentSchema} from '..'; - -/** - * Configuration of a single column. - * - * Note that this deviates from Formio.js' own schema, as they are tightly coupled with - * Bootstrap properties/class names, which we deliberately avoid. - */ -export interface Column { - /** - * Size on non-mobile viewports. - * - * The size specifies the number of columns spanned in a 12-column grid. If no mobile - * size is specified, a 100% width is assumed. - */ - size: 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12; - /** - * Size on mobile viewports. - * - * The mobile size specifies the numbers of columns spanned in a 4-column grid. - * - * @privateRemarks Add backend migration to ensure this attribute is set everywhere. - */ - sizeMobile: 1 | 2 | 3 | 4; - /** - * Nested components inside a single column. - */ - components: AnyComponentSchema[]; -} - -/** - * The columns component schema. - * - * Columns are used to manage layout on desktop and mobile viewports by grouping nested - * components inside into columns. - * - * @group Form.io components - * @category Concrete types - */ -export interface ColumnsComponentSchema - extends Omit< - LayoutComponentSchema, - | 'label' - | 'placeholder' - | 'multiple' - | 'defaultValue' - | 'conditional' - | 'errors' - | 'description' - | 'tooltip' - | 'hideLabel' - | 'disabled' - | 'validateOn' - > { - id: string; - key: string; - type: 'columns'; - columns: Column[]; -} diff --git a/src/formio/components/content.ts b/src/formio/components/content.ts deleted file mode 100644 index 34ca015..0000000 --- a/src/formio/components/content.ts +++ /dev/null @@ -1,43 +0,0 @@ -import {DisplayConfig, LayoutComponentSchema, OFExtensions} from '..'; - -type TranslatableKeys = 'html'; - -/** - * The content component schema, intended for WYSIWYG content. - * - * The content component type is a mechanism to include additional text/content by - * form designers to provide additional information. It is not possible to submit any - * value(s) for it. - * - * @group Form.io components - * @category Concrete types - */ -export interface ContentComponentSchema - extends Omit< - LayoutComponentSchema, - | 'tooltip' - | 'multiple' - | 'defaultValue' - | 'clearOnHide' - | 'validate' - | 'errors' - | 'description' - | 'hideLabel' - | 'disabled' - | 'widget' - | 'validateOn' - | 'placeholder' - >, - DisplayConfig, - OFExtensions { - id: string; - key: string; - type: 'content'; - /** - * Even though the label is present, it is typically not displayed anywhere. - */ - html: string; - label?: string; - hidden?: boolean; - customClass?: '' | 'success' | 'info' | 'warning' | 'error'; -} diff --git a/src/formio/components/cosign.ts b/src/formio/components/cosign.ts deleted file mode 100644 index f8917de..0000000 --- a/src/formio/components/cosign.ts +++ /dev/null @@ -1,65 +0,0 @@ -import {OFExtensions, StrictComponentSchema} from '..'; -import {EmailInputSchema} from './email'; - -type TranslatableKeys = 'label' | 'description'; - -/** - * We don't currently support these properties - they get added in by base types, so we - * need to strip them out again. - */ -type KeysToOmit = - | 'hideLabel' - | 'placeholder' - | 'multiple' - | 'clearOnHide' - | 'conditional' - | 'errors' - | 'disabled' - | 'validateOn' - | 'tooltip'; - -export type CosignV1InputSchema = StrictComponentSchema & - Pick, 'openForms'>; - -/** - * The legacy Cosign component type, otherwise known as 'CosignOld'. - * - * The component does not actually provide any input data, it mostly functions as a - * marker in the form that cosigning is expected, hence the `never` value type. In the - * UI, it displays a button to start an (additional) login session to authenticate the - * cosigner and requires them to be physically in the same space. - * - * @group Form.io components - * @category Concrete types - * - * @deprecated - * - * The in-band cosign flow is problematic with existing DigiD/eHerkenning sessions. It - * is currently not scheduled for removal, but we recommend using the V2 variant for - * better UX. - */ -export interface CosignV1ComponentSchema extends Omit { - type: 'coSign'; - authPlugin: string; // plugin identifiers in the backend are dynamic -} - -type V2KeysToOmit = 'hideLabel' | 'disabled' | 'placeholder'; - -/** - * The cosign component type, otherwise known as 'Cosign'. - * - * This is a custom component sharing most of the functionality with the email input - * component type - it collects the e-mail address of any/a cosigner so that they - * receive a notification they're expected to cosign. The actual cosigning happens - * out-of-band. This component *does* take form data input, as opposed to the V1 - * component implementation. - * - * @group Form.io components - * @category Concrete types - */ -export interface CosignV2ComponentSchema extends Omit { - type: 'cosign'; - validateOn: 'blur'; - defaultValue?: string; // no multiple support, so must always be a single string - autocomplete?: string; -} diff --git a/src/formio/components/currency.ts b/src/formio/components/currency.ts deleted file mode 100644 index 4c0e8a2..0000000 --- a/src/formio/components/currency.ts +++ /dev/null @@ -1,19 +0,0 @@ -import {InputComponentSchema} from '..'; - -type Validator = 'required' | 'min' | 'max'; -type TranslatableKeys = 'label' | 'description' | 'tooltip'; - -export type CurrencyInputSchema = InputComponentSchema; - -/** - * @group Form.io components - * @category Concrete types - */ -export interface CurrencyComponentSchema extends Omit { - type: 'currency'; - // additional properties - currency: 'EUR'; - decimalLimit?: 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10; - allowNegative?: boolean; - defaultValue?: number | null; -} diff --git a/src/formio/components/customerProfile.ts b/src/formio/components/customerProfile.ts deleted file mode 100644 index 2ba1431..0000000 --- a/src/formio/components/customerProfile.ts +++ /dev/null @@ -1,41 +0,0 @@ -import {InputComponentSchema} from '..'; - -type Validator = 'required'; -type TranslatableKeys = 'label' | 'description' | 'tooltip'; - -export type DigitalAddressType = 'email' | 'phoneNumber'; -export type PreferenceUpdateOptions = 'useOnlyOnce' | 'isNewPreferred'; - -export type DigitalAddress = { - address: string; - type: DigitalAddressType; - preferenceUpdate?: PreferenceUpdateOptions; -}; - -export type CustomerProfileData = DigitalAddress[]; - -export type CustomerProfileInputSchema = InputComponentSchema< - CustomerProfileData, - Validator, - TranslatableKeys ->; - -/** - * @group Form.io components - * @category Base types - */ -export interface CustomerProfileProperties { - type: 'customerProfile'; - shouldUpdateCustomerData: boolean; - digitalAddressTypes: DigitalAddressType[]; -} - -/** - * @group Form.io components - * @category Concrete types - */ -export type CustomerProfileComponentSchema = Omit< - CustomerProfileInputSchema, - 'hideLabel' | 'placeholder' | 'disabled' | 'validateOn' -> & - CustomerProfileProperties; diff --git a/src/formio/components/date.ts b/src/formio/components/date.ts deleted file mode 100644 index 9f84281..0000000 --- a/src/formio/components/date.ts +++ /dev/null @@ -1,54 +0,0 @@ -import {InputComponentSchema, MultipleCapable, PrefillConfig} from '..'; -import { - FutureDateConstraint as BaseFutureDateConstraint, - PastDateConstraint as BasePastDateConstraint, - DateConstraintConfiguration, - DatePickerConfig, - PickerCustomOptions, -} from '../dates'; - -type Validator = 'required' | 'minDate' | 'maxDate'; -type TranslatableKeys = 'label' | 'description' | 'tooltip'; - -export interface IncludeToday { - includeToday: boolean | null; -} - -type FutureOrPastDateConstraint = BaseFutureDateConstraint | BasePastDateConstraint; -type FutureDateConstraint = BaseFutureDateConstraint & IncludeToday; -type PastDateConstraint = BasePastDateConstraint & IncludeToday; - -export interface DateExtensions { - widget?: 'inputGroup' | 'datePicker'; - minDate?: Exclude | FutureDateConstraint; - maxDate?: Exclude | PastDateConstraint; -} - -export type DateInputSchema = InputComponentSchema< - string, - Validator, - TranslatableKeys, - DateExtensions ->; - -/** - * @group Form.io components - * @category Base types - */ -export interface BaseDateComponentSchema extends Omit, PrefillConfig { - type: 'date'; - datePicker?: DatePickerConfig; - customOptions?: PickerCustomOptions; -} - -/** - * A date component schema. - * - * Note that the value/`defaultValue` type is just a plain string, as native Date - * objects must be serialized into a string for data exchange via JSON. The expected - * date format is ISO-8601, i.e. YYYY-MM-DD. - * - * @group Form.io components - * @category Concrete types - */ -export type DateComponentSchema = MultipleCapable; diff --git a/src/formio/components/datetime.ts b/src/formio/components/datetime.ts deleted file mode 100644 index 35e9853..0000000 --- a/src/formio/components/datetime.ts +++ /dev/null @@ -1,49 +0,0 @@ -import {InputComponentSchema, MultipleCapable, PrefillConfig} from '..'; -import { - DateConstraintConfiguration, - DatePickerConfig, - FutureDateConstraint, - PastDateConstraint, - PickerCustomOptions, -} from '../dates'; - -type Validator = 'required' | 'minDate' | 'maxDate'; -type TranslatableKeys = 'label' | 'description' | 'tooltip'; - -export interface DateTimeExtensions { - minDate?: Exclude; - maxDate?: Exclude; -} - -export type DateTimeInputSchema = InputComponentSchema< - string, - Validator, - TranslatableKeys, - DateTimeExtensions ->; - -/** - * @group Form.io components - * @category Base types - */ -export interface BaseDateTimeComponentSchema - extends Omit, - PrefillConfig { - type: 'datetime'; - datePicker?: DatePickerConfig; - customOptions?: PickerCustomOptions; -} - -/** - * A date component schema. - * - * Note that the value/`defaultValue` type is just a plain string, as native Date - * objects must be serialized into a string for data exchange via JSON. The expected - * date format is ISO-8601 with time information, e.g. YYYY-MM-DDThh:mmZ. - * - * The smallest supported resolution is minutes, seconds are truncated to be 0 seconds. - * - * @group Form.io components - * @category Concrete types - */ -export type DateTimeComponentSchema = MultipleCapable; diff --git a/src/formio/components/editgrid.ts b/src/formio/components/editgrid.ts deleted file mode 100644 index ae86557..0000000 --- a/src/formio/components/editgrid.ts +++ /dev/null @@ -1,98 +0,0 @@ -import {AnyComponentSchema, InputComponentSchema} from '..'; -import {OFValidateOptions} from '../validation'; - -type Validator = 'required' | 'maxLength'; -type TranslatableKeys = - | 'label' - | 'description' - | 'tooltip' - | 'groupLabel' - | 'addAnother' - | 'saveRow' - | 'removeRow'; - -/** - * We don't currently support these properties - they get added in by base types, so we - * need to strip them out again. - */ -type KeysToOmit = - | 'registration' - | 'placeholder' - | 'multiple' - // added by HasValidation, but currently not exposed in the form builder - | 'errors' - // added by HasValidation, but currently not exposed in the form builder - | 'translatedErrors' - | 'disabled' - | 'validateOn' - | 'showInSummary' - | 'showInEmail' - | 'showInPDF'; - -export type EditGridInputSchema = Omit< - InputComponentSchema, - 'validate' -> & { - /** - * Input mode is implicitly multiple: true, so the (default) value must always have an array - * shape. - * - * We don't know what the shape inside of components is at compile time, hence the `unknown`. - */ - defaultValue?: unknown[]; - // do not include the plugins validator, this behaviour is undefined - validate?: OFValidateOptions; -}; - -/** - * The editgrid component schema. - * - * Edit grids ("repeating groups") are used as a blueprint for array values with complex - * nested structures (as opposed to textfield with multiple true) inside. - * - * The nested components describe a single group of fields that are repeated for every - * item. Because of that, the `defaultValue` type cannot be statically defined, as it - * is derived from the dynamic configuration. - * - * Edit grids are essentially always 'multiple: true', so this property does not apply - * to this component type either. - * - * @privateRemarks - * - * There are probably a bunch of properties used in the SDK that are not exposed in the - * form builder -> add them when we know what they are! - * - * @group Form.io components - * @category Concrete types - */ -export interface EditGridComponentSchema extends Omit { - type: 'editgrid'; - /** - * Nested components inside the group. - */ - components: AnyComponentSchema[]; - - /** - * Control whether any rows can be added or removed. - */ - disableAddingRemovingRows: boolean; - /** - * Button label to add another item. - */ - addAnother?: string; - /** - * Button label to save/confirm a single item. - */ - saveRow?: string; - /** - * Button label to remove a single item. - */ - removeRow?: string; - - // custom properties - - /** - * Label for an individual item, interpolated with the index of each item. - */ - groupLabel: string; -} diff --git a/src/formio/components/email.ts b/src/formio/components/email.ts deleted file mode 100644 index f51f7d1..0000000 --- a/src/formio/components/email.ts +++ /dev/null @@ -1,34 +0,0 @@ -import {InputComponentSchema, MultipleCapable} from '..'; - -type Validator = 'required'; -type TranslatableKeys = 'label' | 'description' | 'tooltip'; - -export interface EmailExtensions { - requireVerification?: boolean; -} - -export type EmailInputSchema = InputComponentSchema< - string, - Validator, - TranslatableKeys, - EmailExtensions ->; - -/** - * @group Form.io components - * @category Base types - */ -export interface BaseEmailComponentSchema extends Omit { - type: 'email'; - validateOn: 'blur'; - // additional properties - autocomplete?: string; - // OF custom properties - confirmationRecipient?: boolean; -} - -/** - * @group Form.io components - * @category Concrete types - */ -export type EmailComponentSchema = MultipleCapable; diff --git a/src/formio/components/fieldset.ts b/src/formio/components/fieldset.ts deleted file mode 100644 index 0e08d26..0000000 --- a/src/formio/components/fieldset.ts +++ /dev/null @@ -1,50 +0,0 @@ -import {AnyComponentSchema, LayoutComponentSchema, OFExtensions} from '..'; - -type TranslatableKeys = 'label'; - -/** - * The fieldset component schema. - * - * Fieldsets are used to manage group fields together. They can improve accessibility - * by grouping related fields together. - * - * The `key` property has no effect on the submission data structure (it does not create - * a nesting level, the component is purely presentational). - * - * The label is displayed as the legend element, while the upstream component uses an - * explicit legend property for this purpose. - * - * @group Form.io components - * @category Concrete types - */ -export interface FieldsetComponentSchema - extends Omit< - LayoutComponentSchema, - | 'placeholder' - | 'multiple' - | 'defaultValue' - | 'errors' - | 'description' - | 'hideLabel' - | 'disabled' - | 'validateOn' - > { - id: string; - key: string; - type: 'fieldset'; - label: string; - /** - * Nested components inside the group/fieldset. - */ - components: AnyComponentSchema[]; - - // custom properties - /** - * Control whether the fieldset header/legend is displayed or not. - * - * @deprecated This should probably use the built-in `hideLabel` property instead, - * which requires a backend data migration and update to the SDK code. - */ - hideHeader: boolean; - openForms?: OFExtensions['openForms']; -} diff --git a/src/formio/components/file.ts b/src/formio/components/file.ts deleted file mode 100644 index df67a02..0000000 --- a/src/formio/components/file.ts +++ /dev/null @@ -1,142 +0,0 @@ -import {DisplayConfig, HasValidation, OFExtensions, StrictComponentSchema} from '../base'; -import {OFValidateOptions} from '../validation'; - -type UnusedFileProperties = 'hideLabel' | 'placeholder' | 'disabled' | 'widget' | 'validate'; - -type Validator = 'required'; -type TranslatableKeys = 'label' | 'description' | 'tooltip'; - -/** - * Shape of a single file upload from Form.io to the backend. - */ -export interface FileUploadData { - data: { - /** - * Full backend URL of the uploaded file (API endpoint). - * - * The value appears to be identical to the root `url` key. - */ - url: string; - /** - * Does not seem to be set to a meaningful value. - */ - form: ''; - /** - * File name of uploaded file. - * - * The value is different from the root `name` key. - */ - name: string; - /** - * File size in bytes, (positive) integer value. - * - * The value appears to be identical to the root `size` key. - */ - size: number; - /** - * Formio base URL configuration option, set to the root of our own API. - */ - baseUrl: string; - /** - * Does not seem to be set to a meaningful value. - */ - project: ''; - }; - name: string; - originalName: string; - /** - * File size in bytes, (positive) integer value. - */ - size: number; - /** - * We only support file uploads to a backend URL. - */ - storage: 'url'; - /** - * MIME type, determined by the browser during upload. If the OS/browser doesn't know - * it, it seems to be an empty string (see https://github.com/open-formulieren/open-forms-sdk/ - * blob/27877938249cdd627294871b70291ab8dc66fd61/src/formio/components/FileField.js#L279) - */ - type: string; - /** - * Full backend URL of the uploaded file (API endpoint). - */ - url: string; -} - -export interface FileUploadConfiguration { - // vanilla Form.io - name: string; - type: string[]; - // custom, injected by the backend or calculated by the builder - allowedTypesLabels: string[]; -} - -/** - * @group Form.io components - * @category Base types - */ -export interface BaseFileComponentSchema - extends Omit, UnusedFileProperties | 'errors'>, - DisplayConfig, - Omit, 'registration'>, - HasValidation { - validate?: OFValidateOptions; - type: 'file'; - multiple?: boolean; - // (possibly) more-constrained existing formio properties - webcam: false; - options: {withCredentials: true}; - storage: 'url'; - url: string; - file: FileUploadConfiguration; - filePattern: string; // can be empty string, which sort of acts like wildcard - fileMaxSize?: string; // strings like 10MB, 1GB... parsed by Form.io - - // custom open forms properties. - // TODO: this should all be merged in the openForms namespace, but that's a rather - // big refactor/cleanup :( - useConfigFiletypes?: boolean; - // backend gloms it with defaults, so it anticipates keys being absent. Note that this - // is also only used in the backend! - of?: { - image?: { - resize?: { - apply?: boolean; - // backend falls back to defaults if the keys are absent, but if they are - // provided, they must be ints - width?: number; - height?: number; - }; - }; - }; - maxNumberOfFiles?: number | null; // should maybe go in validate.maxNumberOfFiles? - registration?: { - informatieobjecttype?: string; - bronorganisatie?: string; - docVertrouwelijkheidaanduiding?: string; - titel?: string; - }; -} - -export type SingleFileComponentSchema = BaseFileComponentSchema & { - multiple?: false; - defaultValue?: [] | [FileUploadData]; -}; - -export type MultipleFileComponentSchema = BaseFileComponentSchema & { - multiple: true; - defaultValue?: FileUploadData[]; -}; - -/** - * The shape of a file upload component. - * - * Note that while `defaultValue` is defined here, this is only to be able to derive - * the submission data type. A file upload component cannot actually have default - * values. - * - * @group Form.io components - * @category Concrete types - */ -export type FileComponentSchema = SingleFileComponentSchema | MultipleFileComponentSchema; diff --git a/src/formio/components/iban.ts b/src/formio/components/iban.ts deleted file mode 100644 index f8ebf2f..0000000 --- a/src/formio/components/iban.ts +++ /dev/null @@ -1,22 +0,0 @@ -import {InputComponentSchema, MultipleCapable} from '..'; - -type Validator = 'required'; -type TranslatableKeys = 'label' | 'description' | 'tooltip'; - -export type IbanInputSchema = InputComponentSchema; - -/** - * @group Form.io components - * @category Base types - */ -export interface BaseIbanComponentSchema - extends Omit { - type: 'iban'; - validateOn: 'blur'; -} - -/** - * @group Form.io components - * @category Concrete types - */ -export type IbanComponentSchema = MultipleCapable; diff --git a/src/formio/components/index.ts b/src/formio/components/index.ts deleted file mode 100644 index 71740ee..0000000 --- a/src/formio/components/index.ts +++ /dev/null @@ -1,37 +0,0 @@ -// Input components -export * from './textfield'; -export * from './textarea'; -export * from './currency'; -export * from './email'; -export * from './date'; -export * from './datetime'; -export * from './time'; -export * from './phonenumber'; -export * from './postcode'; -export * from './iban'; -export * from './licenseplate'; -export * from './bsn'; -export * from './npFamilyMembers'; -export * from './productPrice'; -export * from './number'; -export * from './select'; -export * from './checkbox'; -export * from './selectboxes'; -export * from './file'; -export * from './radio'; -export * from './addressNL'; -export * from './map'; -export * from './editgrid'; -export * from './signature'; -export * from './cosign'; - -// Special components -export * from './children'; -export * from './customerProfile'; -export * from './partners'; - -// Layout components -export * from './content'; -export * from './columns'; -export * from './fieldset'; -export * from './softRequiredErrors'; diff --git a/src/formio/components/licenseplate.ts b/src/formio/components/licenseplate.ts deleted file mode 100644 index 00d921c..0000000 --- a/src/formio/components/licenseplate.ts +++ /dev/null @@ -1,34 +0,0 @@ -import {InputComponentSchema, MultipleCapable} from '..'; - -type Validator = 'required' | 'pattern'; -type TranslatableKeys = 'label' | 'description' | 'tooltip'; - -export type LicensePlateInputSchema = InputComponentSchema; - -/** - * @group Form.io components - * @category Base types - */ -export interface LicensePlateProperties { - type: 'licenseplate'; - validate: { - pattern: '^[a-zA-Z0-9]{1,3}\\-[a-zA-Z0-9]{1,3}\\-[a-zA-Z0-9]{1,3}$'; - }; - validateOn: 'blur'; -} - -/** - * @group Form.io components - * @category Base types - */ -export type BaseLicensePlateComponentSchema = Omit< - LicensePlateInputSchema, - 'hideLabel' | 'placeholder' -> & - LicensePlateProperties; - -/** - * @group Form.io components - * @category Concrete types - */ -export type LicensePlateComponentSchema = MultipleCapable; diff --git a/src/formio/components/map.ts b/src/formio/components/map.ts deleted file mode 100644 index b90b30e..0000000 --- a/src/formio/components/map.ts +++ /dev/null @@ -1,127 +0,0 @@ -import {InputComponentSchema} from '..'; - -type Validator = 'required'; -type TranslatableKeys = 'label' | 'description' | 'tooltip'; - -export type CoordinatePair = [number, number]; -interface PointGeometry { - type: 'Point'; - coordinates: CoordinatePair; -} - -interface LineGeometry { - type: 'LineString'; - coordinates: CoordinatePair[]; -} - -interface PolygonGeometry { - type: 'Polygon'; - coordinates: CoordinatePair[][]; -} -export type GeoJsonGeometry = PointGeometry | LineGeometry | PolygonGeometry; - -export type MapInputSchema = InputComponentSchema< - null | GeoJsonGeometry, - Validator, - TranslatableKeys ->; - -/** - * Custom Formio component type. - * - * @group Form.io components - * @category Concrete types - */ -export interface MapComponentSchema - extends Omit { - type: 'map'; - /** - * Default zoom level, limited by Leaflet and the available tile service zoom levels. - * - * Leaflet zoom level is a range of 1-20, but the Dutch tile service only supports up - * to level 13. - * - * @privateRemarks Make property required, which requires a data migration. - */ - defaultZoom?: null | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13; - /** - * Coordinates to center the map on initially. - * - * @privateRemarks Make property required, which requires a data migration. - */ - initialCenter?: { - lat?: number; - lng?: number; - }; - /** - * The tile layer identifier used for the map component tile layer. - */ - tileLayerIdentifier?: string; - /** - * The url belonging to the connected tile layer object, determined by - * tileLayerIdentifier. - * - * This value should not be definable by admins, but should be fetched - * from the related tile layer object. This happens when fetching the - * component from the backend. - */ - tileLayerUrl?: string; - /** - * Interactions users can use when working with the map component. - * - * These interaction options are based on the options available in leaflet draw: - * https://leaflet.github.io/Leaflet.draw/docs/leaflet-draw-latest.html#drawoptions - */ - interactions?: { - polygon: boolean; - polyline: boolean; - marker: boolean; - }; - /** - * Overlays to display on the map component. - * - * Overlays are used to provide additional visual information to the map component. - * They can be used to show heat-maps, highlight certain points of interest, or provide - * additional context. WMS and WFS tile layers provide access to lower-level layers, - * to specify which parts of the entire data-collection should be shown in the map. - * - * @property uuid The UUID of the selected WMS or WFS tile layer, defined in the OF - * admin. - * @property url The url of the selected WMS or WFS tile layer. This url should not be - * saved to the database, instead it should be fetched/defined before serving the map - * component to the frontend. - * @property label The label used for the layer button in the SDK layers menu. - * The button is used to toggle the display of the layer on and off. - * @property type The type of tile layer used for the overlay. This affects the - * retrieving and rendering of the layers. The `type` should reflect the type of the - * tile layer associated with the selected `uuid`. - * @property layers The lower-level layers of the selected WMS or WFS tile layer, that - * should be displayed in the SDK. These will actually determine the added visuals in - * the map. The order of this list affects the rendering of the layer. The first item - * is shown above the second, the second above the third, etc. - * See the leaflet example for WMS layers: https://leafletjs.com/examples/wms/wms.html#wms-in-leaflet - */ - overlays?: { - uuid: string; - url: string; - label: string; - type: 'wms' | 'wfs'; - layers: string[]; - }[]; - /** - * If true, the backend must apply the globally configured defaults to a particular - * map instance. This results in populating `defaultZoom` and `initialCenter`, so for - * the SDK this property has no effect. - * - * @privateRemarks Make property required, which requires a data migration. - */ - useConfigDefaultMapSettings?: boolean; - /** - * Only specified to be able to type the submission data value. We do not see a use - * case for pre-selecting a particular location on a map component, as the SDK asks - * the user for their location anyway. - * - * @privateRemarks Do not add the default value to the builder. - */ - defaultValue?: null | GeoJsonGeometry; -} diff --git a/src/formio/components/npFamilyMembers.ts b/src/formio/components/npFamilyMembers.ts deleted file mode 100644 index fdb002b..0000000 --- a/src/formio/components/npFamilyMembers.ts +++ /dev/null @@ -1,21 +0,0 @@ -import {InputComponentSchema} from '..'; - -type Validator = 'required'; -type TranslatableKeys = 'label' | 'description' | 'tooltip'; - -export type NpFamilyMembersInputSchema = InputComponentSchema< - never, // No value whatsoever, done by the backend - Validator, - TranslatableKeys ->; - -/** - * @group Form.io components - * @category Concrete types - */ -export interface NpFamilyMembersComponentSchema - extends Omit { - type: 'npFamilyMembers'; - includePartners: boolean; - includeChildren: boolean; -} diff --git a/src/formio/components/number.ts b/src/formio/components/number.ts deleted file mode 100644 index 140bbe3..0000000 --- a/src/formio/components/number.ts +++ /dev/null @@ -1,32 +0,0 @@ -import {InputComponentSchema, PrefillConfig} from '..'; - -type Validator = 'required' | 'min' | 'max'; -type TranslatableKeys = 'label' | 'description' | 'tooltip' | 'suffix'; - -export type NumberInputSchema = InputComponentSchema; - -/** - * @group Form.io components - * @category Base types - */ -export interface BaseNumberComponentSchema - extends Omit, - PrefillConfig { - type: 'number'; - defaultValue?: number | null; - /* - formio does math on `decimalLimit`` and feeds it to lodash.repeat -> must be int at - runtime. There does not appear to be a more elegant way to only allow positive integers. - */ - decimalLimit?: 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10; - allowNegative?: boolean; - // re-add - prefix?: string; - suffix?: string; -} - -/** - * @group Form.io components - * @category Concrete types - */ -export type NumberComponentSchema = BaseNumberComponentSchema; diff --git a/src/formio/components/partners.ts b/src/formio/components/partners.ts deleted file mode 100644 index 479243a..0000000 --- a/src/formio/components/partners.ts +++ /dev/null @@ -1,18 +0,0 @@ -import {OFExtensions, StrictComponentSchema} from '..'; - -export interface PartnerDetails { - bsn: string; - initials: string; - affixes: string; - lastName: string; - dateOfBirth: string; -} -/** - * @group Form.io components - * @category Concrete types - */ -export interface PartnersComponentSchema - extends Omit, 'placeholder' | 'disabled' | 'validateOn'>, - OFExtensions { - type: 'partners'; -} diff --git a/src/formio/components/phonenumber.ts b/src/formio/components/phonenumber.ts deleted file mode 100644 index ad691a3..0000000 --- a/src/formio/components/phonenumber.ts +++ /dev/null @@ -1,23 +0,0 @@ -import {InputComponentSchema, MultipleCapable} from '..'; - -type Validator = 'required' | 'pattern'; -type TranslatableKeys = 'label' | 'description' | 'tooltip'; - -export type PhoneNumberInputSchema = InputComponentSchema; - -/** - * @group Form.io components - * @category Base types - */ -export interface BasePhoneNumberComponentSchema extends Omit { - type: 'phoneNumber'; - inputMask: null; - // additional properties - autocomplete?: string; -} - -/** - * @group Form.io components - * @category Concrete types - */ -export type PhoneNumberComponentSchema = MultipleCapable; diff --git a/src/formio/components/postcode.ts b/src/formio/components/postcode.ts deleted file mode 100644 index f8fc848..0000000 --- a/src/formio/components/postcode.ts +++ /dev/null @@ -1,43 +0,0 @@ -import {InputComponentSchema, MultipleCapable, PrefillConfig} from '..'; - -type Validator = 'required' | 'pattern' | 'customMessage'; -type TranslatableKeys = 'label' | 'description' | 'tooltip'; - -export type PostCodeInputSchema = InputComponentSchema; - -/** - * The textfield component properties that configure it for Dutch postal codes. - * - * @group Form.io components - * @category Base types - */ -export interface PostcodeProperties { - inputMask: '9999 AA'; - validate: { - // Dutch postcode has 4 numbers and 2 letters (case insensitive). Letter combinations SS, SD and SA - // are not used due to the Nazi-association. - // See https://stackoverflow.com/a/17898538/7146757 and https://nl.wikipedia.org/wiki/Postcodes_in_Nederland - pattern: '^[1-9][0-9]{3} ?(?!sa|sd|ss|SA|SD|SS)[a-zA-Z]{2}$'; - }; - validateOn: 'blur'; -} - -/** - * @group Form.io components - * @category Base types - * @deprecated Use textfield instead, with the additional hardcoded properties. - */ -export type BasePostcodeComponentSchema = Omit & - PrefillConfig & - PostcodeProperties & { - type: 'postcode'; - // additional properties - autocomplete?: string; - }; - -/** - * @group Form.io components - * @category Concrete types - * @deprecated Use textfield instead, with the additional hardcoded properties. - */ -export type PostcodeComponentSchema = MultipleCapable; diff --git a/src/formio/components/productPrice.ts b/src/formio/components/productPrice.ts deleted file mode 100644 index 0366db5..0000000 --- a/src/formio/components/productPrice.ts +++ /dev/null @@ -1,17 +0,0 @@ -import {InputComponentSchema} from '..'; - -type Validator = 'required'; -type TranslatableKeys = 'label' | 'description' | 'tooltip'; - -export type ProductPriceInputSchema = InputComponentSchema; - -/** - * Experimental feature that could change. - * @experimental - * @group Form.io components - * @category Concrete types - */ -export interface ProductPriceComponentSchema - extends Omit { - type: 'productPrice'; -} diff --git a/src/formio/components/radio.ts b/src/formio/components/radio.ts deleted file mode 100644 index 44d0096..0000000 --- a/src/formio/components/radio.ts +++ /dev/null @@ -1,59 +0,0 @@ -import {InputComponentSchema} from '..'; -import {ManualValues, Option, ReferenceListsValues, VariableValues} from '../common'; -import {Require} from '../util'; - -type Validator = 'required'; -type TranslatableKeys = 'label' | 'description' | 'tooltip'; - -export type RadioInputSchema = InputComponentSchema< - string | null, - Validator, - TranslatableKeys, - Extensions ->; - -export type RadioUnsupported = 'hideLabel' | 'disabled'; - -/** - * @group Form.io components - * @category Base types - */ -interface BaseRadioSchema { - type: 'radio'; - defaultValue: string | null; -} - -/** - * @group Form.io components - * @category Base types - */ -type RadioManualValuesSchema = Omit, RadioUnsupported> & - BaseRadioSchema & { - values: Option[]; - }; - -/** - * @group Form.io components - * @category Base types - */ -type RadioVariableValuesSchema = Omit, RadioUnsupported> & - BaseRadioSchema; - -/** - * @group Form.io components - * @category Base types - */ -type RadioReferenceListsValuesSchema = Omit< - RadioInputSchema, - RadioUnsupported -> & - BaseRadioSchema; - -/** - * @group Form.io components - * @category Concrete types - */ -export type RadioComponentSchema = Require< - RadioManualValuesSchema | RadioVariableValuesSchema | RadioReferenceListsValuesSchema, - 'openForms' ->; diff --git a/src/formio/components/select.ts b/src/formio/components/select.ts deleted file mode 100644 index 58352ee..0000000 --- a/src/formio/components/select.ts +++ /dev/null @@ -1,72 +0,0 @@ -import {InputComponentSchema} from '..'; -import {MultipleCapable} from '../base'; -import {ManualValues, Option, ReferenceListsValues, VariableValues} from '../common'; -import {Require} from '../util'; - -type Validator = 'required'; -type TranslatableKeys = 'label' | 'description' | 'tooltip'; - -export type SelectInputSchema = InputComponentSchema< - string, - Validator, - TranslatableKeys, - Extensions ->; - -export type SelectUnsupported = 'hideLabel' | 'disabled' | 'placeholder'; - -/** - * @group Form.io components - * @category Base types - */ -interface BaseSelectSchema { - type: 'select'; - // not to be confused with openforms.dataSrc. Formio itself supports dynamic sources - // like json/url/resource/custom but we don't use any of that, our backend resolves - // dynamic values into data.values already. - // So our openForms.dataSrc == itemsExpression results in dataSrc == values. - dataSrc: 'values'; - // Fix for https://github.com/open-formulieren/open-forms/issues/4772 - // ensure the datatype is set to string to avoid formio casting it to other - // types (such as integer) - dataType: 'string'; -} - -/** - * @group Form.io components - * @category Base types - */ -type SelectManualValuesSchema = Omit, SelectUnsupported> & - BaseSelectSchema & { - data: { - values: Option[]; - }; - }; - -/** - * @group Form.io components - * @category Base types - */ -type SelectVariableValuesSchema = Omit, SelectUnsupported> & - BaseSelectSchema; - -/** - * @group Form.io components - * @category Base types - */ -type SelectReferenceListsValuesSchema = Omit< - SelectInputSchema, - SelectUnsupported -> & - BaseSelectSchema; - -/** - * @group Form.io components - * @category Concrete types - */ -export type SelectComponentSchema = MultipleCapable< - Require< - SelectManualValuesSchema | SelectVariableValuesSchema | SelectReferenceListsValuesSchema, - 'openForms' - > ->; diff --git a/src/formio/components/selectboxes.ts b/src/formio/components/selectboxes.ts deleted file mode 100644 index 6ec2403..0000000 --- a/src/formio/components/selectboxes.ts +++ /dev/null @@ -1,67 +0,0 @@ -import {InputComponentSchema} from '..'; -import {ManualValues, Option, ReferenceListsValues, VariableValues} from '../common'; -import {Require} from '../util'; - -type Validator = 'required' | 'minSelectedCount' | 'maxSelectedCount'; -type TranslatableKeys = 'label' | 'description' | 'tooltip'; - -export type SelectboxesInputSchema = InputComponentSchema< - Record, - Validator, - TranslatableKeys, - Extensions ->; - -export type SelectboxesUnsupported = 'hideLabel' | 'disabled'; - -/** - * @group Form.io components - * @category Base types - */ -interface BaseSelectboxesSchema { - type: 'selectboxes'; - defaultValue: Record; -} - -/** - * @group Form.io components - * @category Base types - */ -type SelectboxesManualValuesSchema = Omit< - SelectboxesInputSchema, - SelectboxesUnsupported -> & - BaseSelectboxesSchema & { - values: Option[]; - }; - -/** - * @group Form.io components - * @category Base types - */ -type SelectboxesVariableValuesSchema = Omit< - SelectboxesInputSchema, - SelectboxesUnsupported -> & - BaseSelectboxesSchema; - -/** - * @group Form.io components - * @category Base types - */ -type SelectboxesReferenceListsValuesSchema = Omit< - SelectboxesInputSchema, - SelectboxesUnsupported -> & - BaseSelectboxesSchema; - -/** - * @group Form.io components - * @category Concrete types - */ -export type SelectboxesComponentSchema = Require< - | SelectboxesManualValuesSchema - | SelectboxesVariableValuesSchema - | SelectboxesReferenceListsValuesSchema, - 'openForms' ->; diff --git a/src/formio/components/signature.ts b/src/formio/components/signature.ts deleted file mode 100644 index 0e86402..0000000 --- a/src/formio/components/signature.ts +++ /dev/null @@ -1,61 +0,0 @@ -import {InputComponentSchema} from '..'; - -type Validator = 'required'; -type TranslatableKeys = 'label' | 'description' | 'tooltip' | 'footer'; - -/** - * The value is base64 encoded binary (image) data, or unset and then it's a string. - * - * When a non-empty value is set, enforce that it is serialized as a data URI. - */ -export type SignatureValue = `data:image/png;base64,${string}`; - -export type SignatureInputSchema = InputComponentSchema< - SignatureValue | '', - Validator, - TranslatableKeys ->; - -/** - * The built-in Formio.js signature component type. - * - * Source code this is based on: - * https://github.com/formio/formio.js/blob/4.13.x/src/components/signature/Signature.js - * - * Note that we don't offer support for many properties through our form builder, like: - * - * - width - * - height - * - penColor - * - backgroundColor - * - minWidth - * - maxWidth - * - * Because of that, they are also not added to the type definitions (yet). That may - * change once we implement our own renderer. - * - * @group Form.io components - * @category Concrete types - */ -export interface SignatureComponentSchema - extends Omit< - SignatureInputSchema, - 'hideLabel' | 'disabled' | 'placeholder' | 'validateOn' | 'multiple' - > { - type: 'signature'; - /** - * The footer is a text displayed below the drawing canvas which may hint the user on - * what is expected of them. - * - * I'm not sure what the difference is with the 'description' field. - */ - footer?: string; // translatable instruction - - /** - * The value type of the component. We don't support `multiple: true` in this component. - * - * Note that we use the `defaultValue` property to infer the value type, we do not - * support actually setting a component default value. - */ - defaultValue?: SignatureValue | ''; -} diff --git a/src/formio/components/softRequiredErrors.ts b/src/formio/components/softRequiredErrors.ts deleted file mode 100644 index 665bcd7..0000000 --- a/src/formio/components/softRequiredErrors.ts +++ /dev/null @@ -1,45 +0,0 @@ -import {LayoutComponentSchema, OFExtensions} from '..'; - -type TranslatableKeys = 'html'; - -/** - * The softRequiredErrors component schema. It's a variation on the WYSIWYG content - * component. - * - * Any validation errors related to soft-required fields (the fields are required but - * don't block progressing in the form and are therefore mostly informational/warnings) - * are displayed here. The form designer can control the body text, and the SDK will - * then interpolate the actual field labels that violate the requirement(s). If there - * are no errors, the component is not to be displayed. - * - * @group Form.io components - * @category Concrete types - */ -export interface SoftRequiredErrorsComponentSchema - extends Omit< - LayoutComponentSchema, - | 'conditional' - | 'tooltip' - | 'multiple' - | 'defaultValue' - | 'clearOnHide' - | 'validate' - | 'errors' - | 'description' - | 'hidden' - | 'hideLabel' - | 'disabled' - | 'widget' - | 'validateOn' - | 'placeholder' - >, - Omit, 'registration' | 'isSensitiveData'> { - id: string; - key: string; - type: 'softRequiredErrors'; - /** - * Even though the label is present, it is typically not displayed anywhere. - */ - html: string; - label?: string; -} diff --git a/src/formio/components/textarea.ts b/src/formio/components/textarea.ts deleted file mode 100644 index 4cab191..0000000 --- a/src/formio/components/textarea.ts +++ /dev/null @@ -1,25 +0,0 @@ -import {InputComponentSchema, MultipleCapable} from '..'; - -type Validator = 'required' | 'maxLength' | 'pattern'; -type TranslatableKeys = 'label' | 'description' | 'tooltip' | 'placeholder'; - -export type TextareaInputSchema = InputComponentSchema; - -/** - * @group Form.io components - * @category Base types - */ -export interface BaseTextareaComponentSchema extends Omit { - type: 'textarea'; - // additional properties - showCharCount?: boolean; - autocomplete?: string; - rows?: number; - autoExpand: boolean; -} - -/** - * @group Form.io components - * @category Concrete types - */ -export type TextareaComponentSchema = MultipleCapable; diff --git a/src/formio/components/textfield.ts b/src/formio/components/textfield.ts deleted file mode 100644 index e27600e..0000000 --- a/src/formio/components/textfield.ts +++ /dev/null @@ -1,30 +0,0 @@ -import {InputComponentSchema, MultipleCapable, PrefillConfig} from '..'; - -type Validator = 'required' | 'maxLength' | 'pattern'; -type TranslatableKeys = 'label' | 'description' | 'tooltip' | 'placeholder'; - -export type TextFieldInputSchema = InputComponentSchema; - -/** - * @group Form.io components - * @category Base types - */ -export interface BaseTextFieldComponentSchema - extends Omit, - PrefillConfig { - type: 'textfield'; - // additional properties - showCharCount?: boolean; - autocomplete?: string; - // OF custom properties - deriveStreetName?: boolean; - deriveCity?: boolean; - derivePostcode?: string; - deriveHouseNumber?: string; -} - -/** - * @group Form.io components - * @category Concrete types - */ -export type TextFieldComponentSchema = MultipleCapable; diff --git a/src/formio/components/time.ts b/src/formio/components/time.ts deleted file mode 100644 index 4f62120..0000000 --- a/src/formio/components/time.ts +++ /dev/null @@ -1,31 +0,0 @@ -import {InputComponentSchema, MultipleCapable} from '..'; - -type Validator = 'required' | 'minTime' | 'maxTime'; -type TranslatableKeys = 'label' | 'description' | 'tooltip'; - -export type TimeInputSchema = InputComponentSchema; - -/** - * @group Form.io components - * @category Base types - */ -export interface BaseTimeComponentSchema extends Omit { - type: 'time'; - // hardcoded in builder - inputType: 'text'; - format: 'HH:mm'; - validateOn: 'blur'; -} - -/** - * A time component schema. - * - * Note that the value/`defaultValue` type is just a plain string - a serialized - * ISO-8601 time. - * - * The smallest supported resolution is minutes, seconds are truncated to be 0 seconds. - * - * @group Form.io components - * @category Concrete types - */ -export type TimeComponentSchema = MultipleCapable; diff --git a/src/formio/dates.ts b/src/formio/dates.ts deleted file mode 100644 index 7840387..0000000 --- a/src/formio/dates.ts +++ /dev/null @@ -1,90 +0,0 @@ -/** - * Date picker min/max date validation types. - * - * These are processed in the backend. For the implementation and type definitions: - * https://github.com/open-formulieren/open-forms/blob/master/src/openforms/formio/dynamic_config/date.py#L53 - */ - -/** - * Expression of a date constraint delta. - * - * @remarks The numbers are expected to be integers. - * - * @group Utilities - */ -export interface DateConstraintDelta { - years: number | null; - months: number | null; - days: number | null; -} - -/** - * @group Utilities - */ -export interface NoDateConstraint { - mode: ''; -} - -/** - * @group Utilities - */ -export interface FixedValueDateConstraint { - mode: 'fixedValue'; -} - -/** - * @group Utilities - */ -export interface FutureDateConstraint { - mode: 'future'; -} - -/** - * @group Utilities - */ -export interface PastDateConstraint { - mode: 'past'; -} - -/** - * @group Utilities - */ -export interface RelativeDateConstraint { - mode: 'relativeToVariable'; - variable?: string; - delta: DateConstraintDelta; - operator?: 'add' | 'subtract'; -} - -/** - * @group Utilities - */ -export type DateConstraintConfiguration = - | NoDateConstraint - | FixedValueDateConstraint - | FutureDateConstraint - | PastDateConstraint - | RelativeDateConstraint; - -/** - * A lot of this is *guesswork*, except for `minDate`/`maxDate`. At this time it's also - * unclear how relevant each property is, except for `minDate`/`maxDate`. - * - * @group Form.io - */ -export interface DatePickerConfig { - showWeeks: boolean; - startingDay: 0 | 1 | 2 | 3 | 4 | 5 | 6; - initDate: string; - minMode: 'day' | 'month' | 'year'; - maxMode: 'day' | 'month' | 'year'; - yearRows: number; - yearColumns: number; - minDate: string | null; - maxDate: string | null; -} - -/** Flatpickr specific custom options for the widget **/ -export interface PickerCustomOptions { - allowInvalidPreload?: boolean; -} diff --git a/src/formio/i18n.ts b/src/formio/i18n.ts deleted file mode 100644 index 9b97a1b..0000000 --- a/src/formio/i18n.ts +++ /dev/null @@ -1,18 +0,0 @@ -import {TranslationsContainer} from '../i18n'; -import {BaseErrorKeys} from './validation'; - -/** - * A single translated literal. - * - * Keys should be possible properties of the component. - */ -export type Translation = { - [key in K]?: string; -}; - -export type ComponentTranslations = TranslationsContainer< - Translation ->; -export type ErrorTranslations = TranslationsContainer<{ - [key in K]?: string; -}>; diff --git a/src/formio/util.ts b/src/formio/util.ts deleted file mode 100644 index 9608692..0000000 --- a/src/formio/util.ts +++ /dev/null @@ -1,8 +0,0 @@ -/** - * Given a type `T` with optional key(s) `K`, make the key(s) `K` required. - * - * The ternary is to force distribution over unions in `T`. - */ -export type Require = T extends any - ? Omit & Required> - : never; diff --git a/src/formio/validation.ts b/src/formio/validation.ts deleted file mode 100644 index 21a776f..0000000 --- a/src/formio/validation.ts +++ /dev/null @@ -1,143 +0,0 @@ -/** - * @module validation Types related to (client-side) formio validation and their error message overrides. - * - * This module is responsible for defining: - * - the available validation constraints - * - the corresponding (translatable) error codes. - * - * The `ValidateOptions` interface (which is extended/restricted for our needs) defines - * the available validation constraints that can be used by a component. By using our custom - * `OFValidateOptions` interface, one can define the available `validate` keys: - * - * ```ts - * type TimeComponentSchema = SomeBaseComponent & {validate: OFValidateOptions<'min' | 'max'>}; - * - * // a component with such a type can be defined as: - * const timeComponent: TimeComponentSchema = { - * validate: { - * minTime: '11:00', - * maxTime: '13:00', - * } - * } - * ``` - * - * Each validation constraint key can provide possible error keys if validation fails. This mapping - * of constraint keys (e.g. `minTime`, `maxTime`) to the error keys is defined in `VALIDATOR_TO_ERROR_KEY`. - * - * This can be used when defining the error messages: - * - * ```ts - * type TimeComponentSchema = SomeBaseComponent & {errors: ComponentErrors>}; - * - * // a component with such a type can be defined as: - * const numberComponent: NumberComponentSchema = { - * errors: { - * minTime: 'Time should be greater than ...', - * maxTime: 'Time should be lower than ...', - * invalid_time: 'Invalid time', // Both `minTime` and `maxTime` provides the `invalid_time` error key. - * } - * } - * ``` - * - * NOTE: In some places of the file, we refer to the validation constraint keys as "validator names". Those should - * *NOT* be confused with validator keys used in the SDK (e.g. `timeMinMax`). - */ -import {ValidateOptions} from 'formiojs'; - -// extend formio's validate interface with our custom extension(s) -declare module 'formiojs' { - interface ValidateOptions { - // it's not a validator but formio uses it and we can provide translations support - // in the future - customMessage?: string; - plugins?: string[]; - minTime?: string | null; - maxTime?: string | null; - } -} - -// See formio.js/src/validator/Validator.js constructor for the source of available -// (translatable) error keys. -export type BaseErrorKeys = - | 'required' - | 'min' - | 'max' - | 'maxLength' - | 'invalid_email' - | 'pattern' - | 'minDate' - | 'maxDate' - | 'customMessage' - | 'minSelectedCount' - | 'maxSelectedCount' - | 'invalid_date' - // custom, added by OF - | 'minTime' - | 'maxTime' - | 'invalid_time' - | 'invalid_datetime'; - -export type ComponentErrors = { - [K in Keys]?: string; -}; - -// We don't support all validators of Form.io, exclude the options that are not -// supported anywhere. - -type UnsupportedValidateNames = - | 'minLength' - | 'custom' - | 'customPrivate' - | 'minWords' - | 'maxWords' - | 'email' // email component is exposed, but adds the validation implicitly - | 'url' - | 'date' - | 'day' - | 'json' - | 'mask'; // not to be confused with component.inputMask - -export type CuratedValidateOptions = Omit; -export type CuratedValidatorNames = keyof CuratedValidateOptions; - -type ValidatorToErrorMap = Required<{[K in CuratedValidatorNames]: BaseErrorKeys}>; -const VALIDATOR_TO_ERROR_KEY = { - customMessage: 'customMessage', - required: 'required', - min: 'min', - max: 'max', - maxLength: 'maxLength', - pattern: 'pattern', - minSelectedCount: 'minSelectedCount', - maxSelectedCount: 'maxSelectedCount', - // 'email': 'invalid_email', // email component is exposed, but adds the validation implicitly - // `min/maxDate` is a constraint used by both the date and datetime component: - minDate: 'minDate' as 'minDate' | 'invalid_date' | 'invalid_datetime', - maxDate: 'maxDate' as 'maxDate' | 'invalid_date' | 'invalid_datetime', - // custom, for time component - minTime: 'minTime' as 'minTime' | 'invalid_time', - maxTime: 'maxTime' as 'maxTime' | 'invalid_time', -} as const satisfies ValidatorToErrorMap; - -// infer valid component error keys from the mapping of validation error code to the -// error key (used for localisation/custom error messages) -export type ComponentErrorKeys = Pick< - typeof VALIDATOR_TO_ERROR_KEY, - VN ->[VN]; - -/* - Open Forms-specific extensions. - */ - -export interface ExtendedValidateOptions extends CuratedValidateOptions { - plugins?: string[]; -} -export type OFValidatorNames = keyof ExtendedValidateOptions; - -// Get a subset of validate options -// OFValidateOptions<'required' | 'plugins'> -export type OFValidateOptions = Pick< - ExtendedValidateOptions, - K ->; diff --git a/src/i18n.ts b/src/i18n.ts index 8055bef..e870006 100644 --- a/src/i18n.ts +++ b/src/i18n.ts @@ -1,5 +1 @@ export type SupportedLocales = 'en' | 'nl'; - -export type TranslationsContainer = { - [key in SupportedLocales]?: T; -}; diff --git a/src/index.ts b/src/index.ts index 77af36e..38ab959 100644 --- a/src/index.ts +++ b/src/index.ts @@ -1,2 +1,4 @@ -export * from './formio'; -export * from './i18n'; +export * from './json'; +export {Option} from './options'; +export {SupportedLocales} from './i18n'; +export * from './components'; diff --git a/src/types.ts b/src/json.ts similarity index 76% rename from src/types.ts rename to src/json.ts index e793a40..bf7dda0 100644 --- a/src/types.ts +++ b/src/json.ts @@ -1,4 +1,4 @@ export type JSONPrimitive = string | number | boolean | null; export type JSONValue = JSONPrimitive | JSONObject | JSONArray; export type JSONObject = {[member: string]: JSONValue}; -export interface JSONArray extends Array {} +export type JSONArray = JSONValue[]; diff --git a/src/options.ts b/src/options.ts new file mode 100644 index 0000000..8e647ba --- /dev/null +++ b/src/options.ts @@ -0,0 +1,112 @@ +/** + * Type definitions for components that support selection of pre-defined options. + * + * @module options + */ +import {SupportedLocales} from './i18n'; +import {JSONValue} from './json'; + +/** + * A predefined choice/option definition. + */ +export interface Option { + /** + * The system value that uniquely identifies the option. The `value` is what + * ultimately gets sent to registration backends. + */ + value: string; + /** + * Human readable label that helps the user understand the meaning of the option. + */ + label: string; + /** + * Optional additional information explaining the meaning of the option. + */ + description?: string; + /** + * Open Forms specific extensions. + */ + openForms?: { + /** + * Translations for the user-facing texts. The backend processes this and assigns + * the matching top-level properties. + */ + translations: { + [K in SupportedLocales]?: { + label?: string; + description?: string; + }; + }; + }; +} + +/** + * @groupDescription Option data sources + * + * Components like select, radio and selectboxes present pre-defined options that the + * user has to choose from. These options can be set/retrieved dynamically in the + * backend from various data sources. Each data source comes with its own configuration + * properties. + * + * @showGroups + */ + +/** + * Type for a JSON logic expression. It is an object with that should have a single + * string key (the operator), and the value is anything that can be JSON serialized, + * depending on the specific operation. + * + * @remarks + * It's not possible to express that exactly one key is present, unless we define + * all possible operators explicitly. + * + * @example + * {"var": "foo"} + * {"+": [{"var": "foo"}, {"var": "bar"}]} + */ +export type JsonLogicExpression = { + [operator: string]: string | JSONValue[]; +}; + +/** + * The available options are defined manually on the component itself. + * + * @group Option data sources + */ +export interface ManualValues { + dataSrc: 'manual'; +} + +/** + * The options are extracted from another form variable using a JsonLogic expression. + * + * @group Option data sources + */ +export interface VariableValues { + dataSrc: 'variable'; + /** + * {@link https://jsonlogic.com/operations.html | JsonLogic} expression to extract + * the available options. The result must be an array of `[value, label]` tuples. + */ + itemsExpression: JsonLogicExpression; +} + +/** + * Retrieve the available options from a reference list. + * + * @group Option data sources + */ +export interface ReferenceListsValues { + dataSrc: 'referenceLists'; + /** + * Identifier to resolve the service pointing to the + * {@link https://github.com/maykinmedia/referentielijsten | reference lists API}. + */ + service: string; + /** + * Identifying code for a table in the + * {@link https://github.com/maykinmedia/referentielijsten | reference lists API}. + * The items present in this table will be returned as options. + */ + code: string; +} diff --git a/src/validation.ts b/src/validation.ts new file mode 100644 index 0000000..c83b727 --- /dev/null +++ b/src/validation.ts @@ -0,0 +1,181 @@ +/** + * Available validators in Open Forms, a subset *and* extension of the validators + * in Formio. + * + * Validation describes the possible validator names (like `required` or `maxLength`), + * and integrates with the validation error message machinery where a custom text can + * be specified for each language, for each validator error key. Note that some + * validators may support multiple errors keys! + * + * @module validation + */ +import {Prettify} from './base'; +import {SupportedLocales} from './i18n'; + +export interface ValidateOptions { + /** + * Set to true to require a non-empty value to be provided for the field. + */ + required?: boolean; + /** + * Maximum length of a value for text-based fields. + */ + maxLength?: number; + /** + * RegExp pattern that the value of text-based fields must match. + */ + pattern?: string; + /** + * Minimum value for numeric values. + */ + min?: number; + /** + * Maximum value for numeric values. + */ + max?: number; + /** + * The minimum number of options that must be selected for fields that support + * multi-option selection, like select and selectboxes. + */ + minSelectedCount?: number; + /** + * The maximum number of options that may be selected for fields that support + * multi-option selection, like select and selectboxes. + */ + maxSelectedCount?: number; + /** + * Minimum date or datetime, including the boundary. The value must be on or after + * this day/moment. + * + * @todo Support `Date` instances for native types - doing the parsing once. + */ + minDate?: string | null; + /** + * Maximum date or datetime, including the boundary. The value must be on or before + * this day/moment. + * + * @todo Support `Date` instances for native types - doing the parsing once. + */ + maxDate?: string | null; + /** + * Minimum time, including the boundary. The value must be later than this time, + * unless a `maxTime` is specified that comes before `minTime`, then the interval is + * considered to span midnight. + * + * This is an Open Forms-specific feature. + * + * @todo Support `Date` instances for native types - doing the parsing once. + */ + minTime?: string | null; + /** + * Maximum time, including the boundary. The value must be before this time, + * unless a `minTime` is specified that comes after `maxTime`, then the interval is + * considered to span midnight. + * This is an Open Forms-specific feature. + * + * @todo Support `Date` instances for native types - doing the parsing once. + */ + maxTime?: string | null; + /** + * List of plugin identifiers for async backend validation. The value is considered + * valid as soon as one plugin considers the value valid. + * + * This is an Open Forms-specific feature. + */ + plugins?: string[]; +} + +export type ValidatorNames = Prettify>; + +type AllSupportedErrorKeys = + | 'required' + | 'min' + | 'max' + | 'maxLength' + | 'invalid_email' + | 'pattern' + | 'minDate' + | 'maxDate' + | 'minSelectedCount' + | 'maxSelectedCount' + | 'invalid_date' + | 'minTime' + | 'maxTime' + | 'invalid_time' + | 'invalid_datetime'; + +type ValidatorToErrorMap = Required<{[K in ValidatorNames]: AllSupportedErrorKeys}>; +const VALIDATOR_TO_ERROR_KEY = { + required: 'required', + min: 'min', + max: 'max', + maxLength: 'maxLength', + pattern: 'pattern', + minSelectedCount: 'minSelectedCount', + maxSelectedCount: 'maxSelectedCount', + // 'email': 'invalid_email', // email component is exposed, but adds the validation implicitly + // `min/maxDate` is a constraint used by both the date and datetime component: + minDate: 'minDate' as 'minDate' | 'invalid_date' | 'invalid_datetime', + maxDate: 'maxDate' as 'maxDate' | 'invalid_date' | 'invalid_datetime', + // custom, for time component + minTime: 'minTime' as 'minTime' | 'invalid_time', + maxTime: 'maxTime' as 'maxTime' | 'invalid_time', +} as const satisfies ValidatorToErrorMap; + +/** + * Infer the available error message keys for the requested validators. + * + * The `VALIDATOR_TO_ERROR_KEY` mapping tracks which error message keys can be used + * by a given validator. + */ +export type ErrorMessageKeys = Pick< + typeof VALIDATOR_TO_ERROR_KEY, + VN +>[VN]; + +/** + * Build the validation properties from the requested validator names. + * + * - Constructs the validate shape. + * - Constructs the translated options shape. + * + * @example + * type F = Validate<'required' | 'maxLength' | 'pattern'>; // also includes the 'plugins' + * type G = Validate<'required' | 'min', false> // omits the 'plugins' + * + * If for some reason you don't need part of the shape, you can omit those parts (or + * `Pick` just what you need). + * + * @example + * type OnlyValidate = Omit, 'translatedErrors'>; + * + * The typevars are: + * - `V` - union of validator names (the keys of `ValidateOptions`) + * - `WithPlugins` - boolean (default `true`) whether the `plugins` validate option + * should be included or not. + */ +export type Validation = { + /** + * The validation configuration of the component. + */ + validate?: Prettify>; + /** + * Custom, user-supplied validation error messages for each error message type + * supported by the validators used in the validation configuration. + * + * Specified for each supported language - the backend reads this configuration and + * writes it to `errors`. + */ + translatedErrors?: { + [K in SupportedLocales]?: { + [K in ErrorMessageKeys]?: string; + }; + }; + /** + * Resolved custom error messages, for the active locale. Set by the backend from + * `translatedErrors` - should never be written to. + */ + readonly errors?: { + readonly [K in ErrorMessageKeys]?: string; + }; +}; diff --git a/test-d/formio/base.test-d.ts b/test-d/formio/base.test-d.ts deleted file mode 100644 index 8db352f..0000000 --- a/test-d/formio/base.test-d.ts +++ /dev/null @@ -1,30 +0,0 @@ -import {expectAssignable, expectNotAssignable} from 'tsd'; - -import {TextFieldComponentSchema} from '../../lib'; -import {PossibleValidatorErrorKeys, SchemaWithValidation} from '../../lib/formio/base'; - -// SchemaWithValidation tests - -expectAssignable({ - errors: {required: 'foo'}, -}); - -type EK = PossibleValidatorErrorKeys; -expectAssignable('required'); -expectNotAssignable('any string'); -expectNotAssignable(Symbol('foo')); -expectNotAssignable(123); - -// Extract error keys tests - -type ValidatorErrorKeys = PossibleValidatorErrorKeys; - -expectAssignable('required'); -expectAssignable('maxLength'); -expectAssignable('pattern'); - -expectNotAssignable(''); -expectNotAssignable('foo'); -expectNotAssignable('minLength'); -expectNotAssignable('min'); -expectNotAssignable('constructor'); diff --git a/test-d/formio/components/addressNL.test-d.ts b/test-d/formio/components/addressNL.test-d.ts index c9910ca..d13ed92 100644 --- a/test-d/formio/components/addressNL.test-d.ts +++ b/test-d/formio/components/addressNL.test-d.ts @@ -1,6 +1,6 @@ import {expectAssignable, expectNotAssignable} from 'tsd'; -import {AddressNLComponentSchema} from '../../../lib'; +import {AddressNLComponentSchema} from '../../../dist'; // minimal Address (NL) component schema expectAssignable({ @@ -12,26 +12,6 @@ expectAssignable({ layout: 'doubleColumn', }); -// appropriate default value type -expectAssignable({ - id: 'yejak', - type: 'addressNL', - key: 'someAddressNL', - label: 'Some AddressNL', - deriveAddress: false, - layout: 'doubleColumn', - defaultValue: { - postcode: '', - houseNumber: '', - houseLetter: '', - houseNumberAddition: '', - city: '', - streetName: '', - secretStreetCity: '', - autoPopulated: false, - }, -}); - // full, correct schema expectAssignable({ id: 'yejak', @@ -72,7 +52,6 @@ expectAssignable({ nl: {label: 'foo'}, }, }, - // fixed but not editable }); // Non supported keys diff --git a/test-d/formio/components/bsn.test-d.ts b/test-d/formio/components/bsn.test-d.ts index a4e16f5..ea27bef 100644 --- a/test-d/formio/components/bsn.test-d.ts +++ b/test-d/formio/components/bsn.test-d.ts @@ -1,6 +1,6 @@ import {expectAssignable, expectNotAssignable} from 'tsd'; -import {BsnComponentSchema} from '../../../lib/'; +import {BsnComponentSchema} from '../../../dist/'; // minimal bsn component schema expectAssignable({ @@ -8,8 +8,6 @@ expectAssignable({ type: 'bsn', key: 'someInput', label: 'Some input', - inputMask: '999999999', - validateOn: 'blur', }); // multiple false and appropriate default value type @@ -18,8 +16,6 @@ expectAssignable({ type: 'bsn', key: 'someInput', label: 'Some input', - inputMask: '999999999', - validateOn: 'blur', multiple: false, defaultValue: '123456789', }); @@ -30,8 +26,6 @@ expectAssignable({ type: 'bsn', key: 'someInput', label: 'Some input', - inputMask: '999999999', - validateOn: 'blur', multiple: true, defaultValue: ['123456789'], }); @@ -40,10 +34,8 @@ expectAssignable({ expectAssignable({ id: 'yejak', type: 'bsn', - validateOn: 'blur', // basic tab in builder form label: 'Some input', - inputMask: '999999999', key: 'someInput', description: 'A description', tooltip: 'A tooltip', @@ -103,8 +95,6 @@ expectNotAssignable({ type: 'textfield', key: 'someInput', label: 'Some input', - inputMask: '999999999', - validateOn: 'blur', } as const); // using unsupported properties @@ -113,8 +103,6 @@ expectNotAssignable({ type: 'bsn', key: 'someInput', label: 'Some input', - inputMask: '999999999', - validateOn: 'blur', placeholder: 'no placeholder', } as const); @@ -124,11 +112,9 @@ expectNotAssignable({ type: 'bsn', key: 'someInput', label: 'Some input', - inputMask: '999999999', validate: { maxLength: 7, }, - validateOn: 'blur', } as const); // invalid, multiple true and non-array default value @@ -137,8 +123,6 @@ expectNotAssignable({ type: 'bsn', key: 'someInput', label: 'Some input', - inputMask: '999999999', - validateOn: 'blur', multiple: true, defaultValue: '', } as const); @@ -149,8 +133,6 @@ expectNotAssignable({ type: 'bsn', key: 'someInput', label: 'Some input', - inputMask: '999999999', - validateOn: 'blur', multiple: false, defaultValue: [''], } as const); @@ -161,8 +143,6 @@ expectNotAssignable({ type: 'bsn', key: 'someInput', label: 'Some input', - inputMask: '999999999', - validateOn: 'blur', multiple: true, defaultValue: [123], } as const); @@ -173,5 +153,4 @@ expectNotAssignable({ type: 'bsn', key: 'someInput', label: 'Some input', - inputMask: '999999999', }); diff --git a/test-d/formio/components/checkbox.test-d.ts b/test-d/formio/components/checkbox.test-d.ts index 11a1630..e664c5a 100644 --- a/test-d/formio/components/checkbox.test-d.ts +++ b/test-d/formio/components/checkbox.test-d.ts @@ -1,6 +1,6 @@ import {expectAssignable, expectNotAssignable} from 'tsd'; -import {CheckboxComponentSchema} from '../../../lib'; +import {CheckboxComponentSchema} from '../../../dist'; // minimal component schema expectAssignable({ @@ -8,10 +8,8 @@ expectAssignable({ type: 'checkbox', key: 'someCheckbox', label: 'Some checkbox', - defaultValue: true, }); - // full, correct schema expectAssignable({ id: 'yejak', @@ -51,8 +49,6 @@ expectAssignable({ nl: {label: 'foo'}, }, }, - // fixed but not editable - validateOn: 'blur', }); // multiple not allowed diff --git a/test-d/formio/components/children.test-d.ts b/test-d/formio/components/children.test-d.ts index 652ef7a..69d6deb 100644 --- a/test-d/formio/components/children.test-d.ts +++ b/test-d/formio/components/children.test-d.ts @@ -1,6 +1,6 @@ import {expectAssignable, expectNotAssignable} from 'tsd'; -import {ChildrenComponentSchema} from '../../../lib'; +import {ChildrenComponentSchema} from '../../../dist'; // minimal children component schema expectAssignable({ @@ -20,13 +20,10 @@ expectAssignable({ label: 'children', enableSelection: false, isSensitiveData: true, - defaultValue: undefined, clearOnHide: false, hidden: false, - errors: {required: 'Lastname'}, description: 'A description', tooltip: 'A tooltip', - hideLabel: false, // Advanced tab conditional: { show: undefined, diff --git a/test-d/formio/components/columns.test-d.ts b/test-d/formio/components/columns.test-d.ts index 28a9745..7295be4 100644 --- a/test-d/formio/components/columns.test-d.ts +++ b/test-d/formio/components/columns.test-d.ts @@ -1,6 +1,7 @@ import {expectAssignable, expectNotAssignable} from 'tsd'; -import {Column, ColumnsComponentSchema} from '../../../lib'; +import {ColumnsComponentSchema} from '../../../dist'; +import {Column} from '../../../dist/components/columns'; // Minimal schema expectAssignable({ diff --git a/test-d/formio/components/content.test-d.ts b/test-d/formio/components/content.test-d.ts index 1bed32c..deef294 100644 --- a/test-d/formio/components/content.test-d.ts +++ b/test-d/formio/components/content.test-d.ts @@ -1,6 +1,6 @@ import {expectAssignable, expectNotAssignable} from 'tsd'; -import {ContentComponentSchema} from '../../../lib'; +import {ContentComponentSchema} from '../../../dist'; // Minimal schema expectAssignable({ @@ -16,7 +16,6 @@ expectAssignable({ type: 'content', // Display tab html: 'inhoud', - label: 'Content', key: 'content', hidden: false, showInEmail: false, diff --git a/test-d/formio/components/cosign-v1.test-d.ts b/test-d/formio/components/cosign-v1.test-d.ts index e856ce0..6870f19 100644 --- a/test-d/formio/components/cosign-v1.test-d.ts +++ b/test-d/formio/components/cosign-v1.test-d.ts @@ -1,6 +1,6 @@ import {expectAssignable, expectNotAssignable} from 'tsd'; -import {CosignV1ComponentSchema} from '../../../lib/'; +import {CosignV1ComponentSchema} from '../../../dist/'; // minimal CoSign component schema expectAssignable({ diff --git a/test-d/formio/components/cosign-v2.test-d.ts b/test-d/formio/components/cosign-v2.test-d.ts index b6b9427..bbd0439 100644 --- a/test-d/formio/components/cosign-v2.test-d.ts +++ b/test-d/formio/components/cosign-v2.test-d.ts @@ -1,12 +1,11 @@ import {expectAssignable, expectNotAssignable} from 'tsd'; -import {CosignV2ComponentSchema} from '../../../lib/'; +import {CosignV2ComponentSchema} from '../../../dist/'; // minimal cosign component schema expectAssignable({ id: 'yejak', type: 'cosign', - validateOn: 'blur', key: 'someCoSign', label: 'Some cosign', }); @@ -15,7 +14,6 @@ expectAssignable({ expectAssignable({ id: 'yejak', type: 'cosign', - validateOn: 'blur', // basic tab in builder form label: 'Some cosign', key: 'someCoSign', diff --git a/test-d/formio/components/currency.test-d.ts b/test-d/formio/components/currency.test-d.ts index ff890a1..019198e 100644 --- a/test-d/formio/components/currency.test-d.ts +++ b/test-d/formio/components/currency.test-d.ts @@ -1,6 +1,6 @@ import {expectAssignable, expectNotAssignable} from 'tsd'; -import {CurrencyComponentSchema} from '../../../lib/'; +import {CurrencyComponentSchema} from '../../../dist/'; // minimal currency component schema expectAssignable({ diff --git a/test-d/formio/components/customerProfile.test-d.ts b/test-d/formio/components/customerProfile.test-d.ts index 1eefb41..a709b1e 100644 --- a/test-d/formio/components/customerProfile.test-d.ts +++ b/test-d/formio/components/customerProfile.test-d.ts @@ -1,6 +1,6 @@ import {expectAssignable} from 'tsd'; -import {CustomerProfileComponentSchema} from '../../../lib/'; +import {CustomerProfileComponentSchema} from '../../../dist/'; // minimal customer profile component schema expectAssignable({ diff --git a/test-d/formio/components/date.test-d.ts b/test-d/formio/components/date.test-d.ts index 0298a44..625a768 100644 --- a/test-d/formio/components/date.test-d.ts +++ b/test-d/formio/components/date.test-d.ts @@ -1,6 +1,6 @@ import {expectAssignable, expectNotAssignable} from 'tsd'; -import {DateComponentSchema} from '../../../lib'; +import {DateComponentSchema} from '../../../dist'; // minimal date component schema expectAssignable({ @@ -30,13 +30,6 @@ expectAssignable({ }, }, datePicker: { - showWeeks: true, - startingDay: 0, - initDate: '', - minMode: 'day', - maxMode: 'year', - yearRows: 4, - yearColumns: 5, minDate: '2023-06-06', maxDate: null, }, @@ -100,13 +93,6 @@ expectAssignable({ }, // dynamically set/mutated by the backend after processing openForms.minDate|maxDate datePicker: { - showWeeks: true, - startingDay: 0, - initDate: '', - minMode: 'day', - maxMode: 'year', - yearRows: 4, - yearColumns: 5, minDate: null, maxDate: null, }, @@ -134,9 +120,6 @@ expectAssignable({ }, }, }, - customOptions: { - allowInvalidPreload: true, - }, }); // invalid, multiple true and non-array default value diff --git a/test-d/formio/components/datetime.test-d.ts b/test-d/formio/components/datetime.test-d.ts index 92d3cb2..65e9da5 100644 --- a/test-d/formio/components/datetime.test-d.ts +++ b/test-d/formio/components/datetime.test-d.ts @@ -1,6 +1,6 @@ import {expectAssignable, expectNotAssignable} from 'tsd'; -import {DateTimeComponentSchema} from '../../../lib'; +import {DateTimeComponentSchema} from '../../../dist'; // minimal date component schema expectAssignable({ @@ -30,13 +30,6 @@ expectAssignable({ }, }, datePicker: { - showWeeks: true, - startingDay: 0, - initDate: '', - minMode: 'day', - maxMode: 'year', - yearRows: 4, - yearColumns: 5, minDate: '2023-06-06T12:00Z', maxDate: null, }, @@ -100,13 +93,6 @@ expectAssignable({ }, // dynamically set/mutated by the backend after processing openForms.minDate|maxDate datePicker: { - showWeeks: true, - startingDay: 0, - initDate: '', - minMode: 'day', - maxMode: 'year', - yearRows: 4, - yearColumns: 5, minDate: null, maxDate: null, }, @@ -134,9 +120,6 @@ expectAssignable({ }, }, }, - customOptions: { - allowInvalidPreload: true, - }, }); // invalid, multiple true and non-array default value diff --git a/test-d/formio/components/editgrid.test-d.ts b/test-d/formio/components/editgrid.test-d.ts index 3d80c5b..1bd2fa5 100644 --- a/test-d/formio/components/editgrid.test-d.ts +++ b/test-d/formio/components/editgrid.test-d.ts @@ -1,6 +1,6 @@ import {expectAssignable, expectNotAssignable} from 'tsd'; -import {EditGridComponentSchema} from '../../../lib/'; +import {EditGridComponentSchema} from '../../../dist/'; // minimal textfield component schema expectAssignable({ diff --git a/test-d/formio/components/email.test-d.ts b/test-d/formio/components/email.test-d.ts index 128c214..da1ee1f 100644 --- a/test-d/formio/components/email.test-d.ts +++ b/test-d/formio/components/email.test-d.ts @@ -1,6 +1,6 @@ import {expectAssignable, expectNotAssignable} from 'tsd'; -import {EmailComponentSchema} from '../../../lib'; +import {EmailComponentSchema} from '../../../dist'; // minimal email component schema expectAssignable({ @@ -8,7 +8,6 @@ expectAssignable({ type: 'email', key: 'someEmail', label: 'Some email', - validateOn: 'blur', }); // with additional, email-component specific properties @@ -17,7 +16,6 @@ expectAssignable({ type: 'email', key: 'someEmail', label: 'Some email', - validateOn: 'blur', autocomplete: 'email', confirmationRecipient: false, }); @@ -28,7 +26,6 @@ expectAssignable({ type: 'email', key: 'someEmail', label: 'Some email', - validateOn: 'blur', multiple: false, defaultValue: '', }); @@ -39,7 +36,6 @@ expectAssignable({ type: 'email', key: 'someEmail', label: 'Some email', - validateOn: 'blur', multiple: true, defaultValue: [''], }); @@ -88,19 +84,15 @@ expectAssignable({ requireVerification: true, }, // fixed but not editable - validateOn: 'blur', }); -// validateOn not `blur` expectNotAssignable({ id: 'yejak', type: 'email', key: 'someEmail', label: 'Some email', - validateOn: 'change', }); -// missing validateOn expectNotAssignable({ id: 'yejak', type: 'email', @@ -114,7 +106,6 @@ expectNotAssignable({ type: 'email', key: 'someEmail', label: 'Some email', - validateOn: 'blur', multiple: true, defaultValue: '', }); @@ -125,7 +116,6 @@ expectNotAssignable({ type: 'email', key: 'someEmail', label: 'Some email', - validateOn: 'blur', multiple: false, defaultValue: [''], }); @@ -136,7 +126,6 @@ expectNotAssignable({ type: 'email', key: 'someEmail', label: 'Some email', - validateOn: 'blur', multiple: true, defaultValue: [0], }); diff --git a/test-d/formio/components/fieldset.test-d.ts b/test-d/formio/components/fieldset.test-d.ts index dafe0eb..865250a 100644 --- a/test-d/formio/components/fieldset.test-d.ts +++ b/test-d/formio/components/fieldset.test-d.ts @@ -1,6 +1,6 @@ import {expectAssignable} from 'tsd'; -import {FieldsetComponentSchema} from '../../../lib'; +import {FieldsetComponentSchema} from '../../../dist'; // Minimal schema expectAssignable({ diff --git a/test-d/formio/components/file.test-d.ts b/test-d/formio/components/file.test-d.ts index 301a2c3..4920dfb 100644 --- a/test-d/formio/components/file.test-d.ts +++ b/test-d/formio/components/file.test-d.ts @@ -1,24 +1,6 @@ import {expectAssignable, expectNotAssignable} from 'tsd'; -import {FileComponentSchema, FileUploadData} from '../../../lib'; - -// Grabbed from test env file upload, URLs obfuscated. -const anUpload: FileUploadData = { - url: 'http://localhost:8000/api/v2/submissions/files/54cc40ed-f1c4-4206-ba76-76d376ba4c3a', - data: { - url: 'http://localhost:8000/api/v2/submissions/files/54cc40ed-f1c4-4206-ba76-76d376ba4c3a', - form: '', - name: 'maykin_logo.png', - size: 8725, - baseUrl: 'http://localhost:8000/api/v2/', - project: '', - }, - name: 'maykin_logo-e0568045-45f6-46d1-909a-8895c5ee061e.png', - size: 8725, - type: 'image/png', - storage: 'url', - originalName: 'maykin_logo.png', -}; +import {FileComponentSchema} from '../../../dist'; // minimal file component schema expectAssignable({ @@ -26,10 +8,6 @@ expectAssignable({ type: 'file', key: 'someFile', label: 'Attachment', - webcam: false, - options: {withCredentials: true}, - storage: 'url', - url: '', file: { name: '', type: [], @@ -38,73 +16,6 @@ expectAssignable({ filePattern: '*', }); -// Behaviour of single vs. multiple file uploads - -const explicitSingleUpload: FileComponentSchema = { - id: 'yejak', - type: 'file', - key: 'someFile', - label: 'Attachment', - webcam: false, - options: {withCredentials: true}, - storage: 'url', - url: '', - file: { - name: '', - type: [], - allowedTypesLabels: [], - }, - filePattern: '*', - multiple: false, -}; -type ExplicitSingleUploadValue = (typeof explicitSingleUpload)['defaultValue']; -expectAssignable([]); -expectAssignable([anUpload]); -expectNotAssignable([anUpload, anUpload]); - -const explicitMultipleUpload: FileComponentSchema = { - id: 'yejak', - type: 'file', - key: 'someFile', - label: 'Attachment', - webcam: false, - options: {withCredentials: true}, - storage: 'url', - url: '', - file: { - name: '', - type: [], - allowedTypesLabels: [], - }, - filePattern: '*', - multiple: true, -}; -type ExplicitMultipleUploadValue = (typeof explicitMultipleUpload)['defaultValue']; -expectAssignable([]); -expectAssignable([anUpload]); -expectAssignable([anUpload, anUpload]); - -const implicitSingleUpload: FileComponentSchema = { - id: 'yejak', - type: 'file', - key: 'someFile', - label: 'Attachment', - webcam: false, - options: {withCredentials: true}, - storage: 'url', - url: '', - file: { - name: '', - type: [], - allowedTypesLabels: [], - }, - filePattern: '*', -}; -type ImplicitSingleUploadValue = (typeof implicitSingleUpload)['defaultValue']; -expectAssignable([]); -expectAssignable([anUpload]); -expectNotAssignable([anUpload, anUpload]); - // Form builder assignability checks // with additional, file-component specific properties @@ -114,10 +25,6 @@ expectAssignable({ key: 'someInput', label: 'Some input', // builder sets empty URL, backend dynamically makes this non-empty - webcam: false, - options: {withCredentials: true}, - storage: 'url', - url: '', file: { // vanilla name: 'prefix_{{ fileName }}', @@ -153,10 +60,6 @@ expectAssignable({ expectAssignable({ id: 'yejak', type: 'file', - webcam: false, - options: {withCredentials: true}, - storage: 'url', - url: '', // basic tab in builder form key: 'someFile', label: 'Attachment', @@ -232,10 +135,6 @@ expectNotAssignable({ type: 'content', key: 'someFile', label: 'Attachment', - webcam: false, - options: {withCredentials: true}, - storage: 'url', - url: '', file: { name: '', type: [], @@ -250,10 +149,7 @@ expectNotAssignable({ type: 'file', key: 'someFile', label: 'Attachment', - webcam: false, - options: {withCredentials: true}, storage: 's3', // we only support url - url: '', file: { name: '', type: [], @@ -268,10 +164,6 @@ expectNotAssignable({ type: 'file' as const, key: 'someFile', label: 'Attachment', - webcam: false as const, - options: {withCredentials: true} as const, - storage: 'url' as const, - url: '' as const, file: { name: '', type: ['image/png'], diff --git a/test-d/formio/components/iban.test-d.ts b/test-d/formio/components/iban.test-d.ts index 4a854b9..654fbe6 100644 --- a/test-d/formio/components/iban.test-d.ts +++ b/test-d/formio/components/iban.test-d.ts @@ -1,6 +1,6 @@ import {expectAssignable, expectNotAssignable} from 'tsd'; -import {IbanComponentSchema} from '../../../lib'; +import {IbanComponentSchema} from '../../../dist'; // minimal iban component schema expectAssignable({ @@ -8,17 +8,14 @@ expectAssignable({ type: 'iban', key: 'someIban', label: 'Some IBAN', - validateOn: 'blur', }); - // multiple false and appropriate default value type expectAssignable({ id: 'yejak', type: 'iban', key: 'someIban', label: 'Some IBAN', - validateOn: 'blur', multiple: false, defaultValue: '', }); @@ -29,7 +26,6 @@ expectAssignable({ type: 'iban', key: 'someIban', label: 'Some IBAN', - validateOn: 'blur', multiple: true, defaultValue: [''], }); @@ -74,25 +70,6 @@ expectAssignable({ nl: {label: 'foo'}, }, }, - // fixed but not editable - validateOn: 'blur', -}); - -// validateOn not `blur` -expectNotAssignable({ - id: 'yejak', - type: 'iban', - key: 'someIban', - label: 'Some IBAN', - validateOn: 'change', -}); - -// missing validateOn -expectNotAssignable({ - id: 'yejak', - type: 'iban', - key: 'someIban', - label: 'Some IBAN', }); // invalid, multiple true and non-array default value @@ -101,7 +78,6 @@ expectNotAssignable({ type: 'iban', key: 'someIban', label: 'Some IBAN', - validateOn: 'blur', multiple: true, defaultValue: '', }); @@ -112,7 +88,6 @@ expectNotAssignable({ type: 'iban', key: 'someIban', label: 'Some IBAN', - validateOn: 'blur', multiple: false, defaultValue: [''], }); @@ -123,7 +98,6 @@ expectNotAssignable({ type: 'iban', key: 'someIban', label: 'Some IBAN', - validateOn: 'blur', multiple: true, defaultValue: [0], }); @@ -133,6 +107,5 @@ expectNotAssignable({ type: 'iban', key: 'someIban', label: 'Some IBAN', - validateOn: 'blur', placeholder: '', } as const); diff --git a/test-d/formio/components/licenseplate.test-d.ts b/test-d/formio/components/licenseplate.test-d.ts index d2934f6..fd9dd06 100644 --- a/test-d/formio/components/licenseplate.test-d.ts +++ b/test-d/formio/components/licenseplate.test-d.ts @@ -1,6 +1,6 @@ import {expectAssignable, expectNotAssignable} from 'tsd'; -import {LicensePlateComponentSchema} from '../../../lib/'; +import {LicensePlateComponentSchema} from '../../../dist/'; // minimal postcode component schema expectAssignable({ @@ -11,7 +11,6 @@ expectAssignable({ validate: { pattern: '^[a-zA-Z0-9]{1,3}\\-[a-zA-Z0-9]{1,3}\\-[a-zA-Z0-9]{1,3}$', }, - validateOn: 'blur', }); // multiple false and appropriate default value type @@ -23,7 +22,6 @@ expectAssignable({ validate: { pattern: '^[a-zA-Z0-9]{1,3}\\-[a-zA-Z0-9]{1,3}\\-[a-zA-Z0-9]{1,3}$', }, - validateOn: 'blur', multiple: false, defaultValue: 'AA-123-AA', }); @@ -37,7 +35,6 @@ expectAssignable({ validate: { pattern: '^[a-zA-Z0-9]{1,3}\\-[a-zA-Z0-9]{1,3}\\-[a-zA-Z0-9]{1,3}$', }, - validateOn: 'blur', multiple: true, defaultValue: ['AA-123-AA'], }); @@ -46,7 +43,6 @@ expectAssignable({ expectAssignable({ id: 'yejak', type: 'licenseplate', - validateOn: 'blur', // basic tab in builder form label: 'Some input', key: 'someInput', @@ -60,7 +56,6 @@ expectAssignable({ clearOnHide: true, isSensitiveData: true, defaultValue: '', - disabled: false, // advanced tab in builder form conditional: { show: undefined, @@ -107,7 +102,6 @@ expectNotAssignable({ validate: { pattern: '^[a-zA-Z0-9]{1,3}\\-[a-zA-Z0-9]{1,3}\\-[a-zA-Z0-9]{1,3}$', }, - validateOn: 'blur', } as const); // using unsupported properties @@ -119,7 +113,6 @@ expectNotAssignable({ validate: { pattern: '^[a-zA-Z0-9]{1,3}\\-[a-zA-Z0-9]{1,3}\\-[a-zA-Z0-9]{1,3}$', }, - validateOn: 'blur', placeholder: 'no placeholder', } as const); @@ -133,7 +126,6 @@ expectNotAssignable({ pattern: '^[a-zA-Z0-9]{1,3}\\-[a-zA-Z0-9]{1,3}\\-[a-zA-Z0-9]{1,3}$', maxLength: 7, }, - validateOn: 'blur', } as const); // invalid, multiple true and non-array default value @@ -145,7 +137,6 @@ expectNotAssignable({ validate: { pattern: '^[a-zA-Z0-9]{1,3}\\-[a-zA-Z0-9]{1,3}\\-[a-zA-Z0-9]{1,3}$', }, - validateOn: 'blur', multiple: true, defaultValue: '', } as const); @@ -159,7 +150,6 @@ expectNotAssignable({ validate: { pattern: '^[a-zA-Z0-9]{1,3}\\-[a-zA-Z0-9]{1,3}\\-[a-zA-Z0-9]{1,3}$', }, - validateOn: 'blur', multiple: false, defaultValue: [''], } as const); @@ -173,7 +163,6 @@ expectNotAssignable({ validate: { pattern: '^[a-zA-Z0-9]{1,3}\\-[a-zA-Z0-9]{1,3}\\-[a-zA-Z0-9]{1,3}$', }, - validateOn: 'blur', multiple: true, defaultValue: [123], } as const); diff --git a/test-d/formio/components/map.test-d.ts b/test-d/formio/components/map.test-d.ts index 0afc4a3..4f4d582 100644 --- a/test-d/formio/components/map.test-d.ts +++ b/test-d/formio/components/map.test-d.ts @@ -1,6 +1,6 @@ import {expectAssignable, expectNotAssignable} from 'tsd'; -import {MapComponentSchema} from '../../../lib/'; +import {MapComponentSchema} from '../../../dist/'; // minimal map component schema expectAssignable({ @@ -22,9 +22,9 @@ expectAssignable({ lng: 4.88969, }, useConfigDefaultMapSettings: false, - defaultValue: null, tileLayerIdentifier: 'some-wmts-layer', - tileLayerUrl: "https://service.pdok.nl/hwh/luchtfotorgb/wmts/v1_0/Actueel_orthoHR/EPSG:28992/{z}/{x}/{y}.png", + tileLayerUrl: + 'https://service.pdok.nl/hwh/luchtfotorgb/wmts/v1_0/Actueel_orthoHR/EPSG:28992/{z}/{x}/{y}.png', interactions: { polygon: true, polyline: false, @@ -32,20 +32,19 @@ expectAssignable({ }, overlays: [ { - uuid: "623d703f-3d75-4720-bb9b-13c5fd783fcb", - url: "https://service.pdok.nl/lv/bag/wms/v2_0", - type: "wms", - label: "BAG pand and verblijfsobject layer", - layers: ["pand", "verblijfsobject"] - } - ] + uuid: '623d703f-3d75-4720-bb9b-13c5fd783fcb', + url: 'https://service.pdok.nl/lv/bag/wms/v2_0', + type: 'wms', + label: 'BAG pand and verblijfsobject layer', + layers: ['pand', 'verblijfsobject'], + }, + ], }); // full, correct schema expectAssignable({ id: 'yejak', type: 'map', - defaultValue: null, // basic tab in builder form label: 'Some map', key: 'someMap', @@ -64,7 +63,8 @@ expectAssignable({ }, useConfigDefaultMapSettings: false, tileLayerIdentifier: 'some-wmts-layer', - tileLayerUrl: "https://service.pdok.nl/hwh/luchtfotorgb/wmts/v1_0/Actueel_orthoHR/EPSG:28992/{z}/{x}/{y}.png", + tileLayerUrl: + 'https://service.pdok.nl/hwh/luchtfotorgb/wmts/v1_0/Actueel_orthoHR/EPSG:28992/{z}/{x}/{y}.png', interactions: { polygon: true, polyline: false, @@ -72,12 +72,12 @@ expectAssignable({ }, overlays: [ { - uuid: "623d703f-3d75-4720-bb9b-13c5fd783fcb", - url: "https://service.pdok.nl/lv/bag/wms/v2_0", - type: "wms", - label: "BAG pand and verblijfsobject layer", - layers: ["pand", "verblijfsobject"] - } + uuid: '623d703f-3d75-4720-bb9b-13c5fd783fcb', + url: 'https://service.pdok.nl/lv/bag/wms/v2_0', + type: 'wms', + label: 'BAG pand and verblijfsobject layer', + layers: ['pand', 'verblijfsobject'], + }, ], // advanced tab in builder form conditional: { diff --git a/test-d/formio/components/npFamilyMembers.test-d copy.ts b/test-d/formio/components/npFamilyMembers.test-d copy.ts index 8e63061..7a45c1c 100644 --- a/test-d/formio/components/npFamilyMembers.test-d copy.ts +++ b/test-d/formio/components/npFamilyMembers.test-d copy.ts @@ -1,6 +1,6 @@ import {expectAssignable, expectNotAssignable} from 'tsd'; -import {NpFamilyMembersComponentSchema} from '../../../lib/'; +import {NpFamilyMembersComponentSchema} from '../../../dist/'; // minimal npFamilyMembers component schema expectAssignable({ diff --git a/test-d/formio/components/number.test-d.ts b/test-d/formio/components/number.test-d.ts index ff88f9e..04b094e 100644 --- a/test-d/formio/components/number.test-d.ts +++ b/test-d/formio/components/number.test-d.ts @@ -1,6 +1,6 @@ import {expectAssignable, expectNotAssignable} from 'tsd'; -import {NumberComponentSchema} from '../../../lib/'; +import {NumberComponentSchema} from '../../../dist/'; // minimal number component schema expectAssignable({ diff --git a/test-d/formio/components/partners.test-d.ts b/test-d/formio/components/partners.test-d.ts index 9c55a76..db53973 100644 --- a/test-d/formio/components/partners.test-d.ts +++ b/test-d/formio/components/partners.test-d.ts @@ -1,6 +1,6 @@ import {expectAssignable, expectNotAssignable} from 'tsd'; -import {PartnersComponentSchema} from '../../../lib'; +import {PartnersComponentSchema} from '../../../dist'; // minimal partners component schema expectAssignable({ @@ -18,13 +18,10 @@ expectAssignable({ key: 'partners', label: 'Partners', isSensitiveData: true, - defaultValue: undefined, clearOnHide: false, hidden: false, - errors: {required: 'Lastname'}, description: 'A description', tooltip: 'A tooltip', - hideLabel: false, // Advanced tab conditional: { show: undefined, diff --git a/test-d/formio/components/phonenumber.test-d.ts b/test-d/formio/components/phonenumber.test-d.ts index 2952f85..63088ef 100644 --- a/test-d/formio/components/phonenumber.test-d.ts +++ b/test-d/formio/components/phonenumber.test-d.ts @@ -1,6 +1,6 @@ import {expectAssignable, expectNotAssignable} from 'tsd'; -import {PhoneNumberComponentSchema} from '../../../lib/'; +import {PhoneNumberComponentSchema} from '../../../dist/'; // minimal textfield component schema expectAssignable({ @@ -8,7 +8,6 @@ expectAssignable({ type: 'phoneNumber', key: 'someInput', label: 'Some input', - inputMask: null, }); // with additional, phonenumber-component specific properties @@ -17,8 +16,7 @@ expectAssignable({ type: 'phoneNumber', key: 'someInput', label: 'Some input', - inputMask: null, - placeholder: 'tel', + autocomplete: 'tel', }); // multiple false and appropriate default value type @@ -27,7 +25,6 @@ expectAssignable({ type: 'phoneNumber', key: 'someInput', label: 'Some input', - inputMask: null, multiple: false, defaultValue: '', }); @@ -37,7 +34,6 @@ expectAssignable({ type: 'phoneNumber', key: 'someInput', label: 'Some input', - inputMask: null, multiple: true, defaultValue: [''], }); @@ -46,7 +42,6 @@ expectAssignable({ expectAssignable({ id: 'yejak', type: 'phoneNumber', - inputMask: null, // basic tab in builder form label: 'Some input', key: 'someInput', @@ -105,7 +100,6 @@ expectNotAssignable({ type: 'textfield', key: 'someInput', label: 'Some input', - inputMask: null, } as const); // using unsupported properties @@ -114,7 +108,6 @@ expectNotAssignable({ type: 'phoneNumber', key: 'someInput', label: 'Some input', - inputMask: null, showCharCount: true, } as const); @@ -124,7 +117,6 @@ expectNotAssignable({ type: 'phoneNumber', key: 'someInput', label: 'Some input', - inputMask: null, validate: { maxLength: 100, }, @@ -136,7 +128,6 @@ expectNotAssignable({ type: 'phoneNumber', key: 'someInput', label: 'Some input', - inputMask: null, multiple: true, defaultValue: '', } as const); @@ -147,7 +138,6 @@ expectNotAssignable({ type: 'phoneNumber', key: 'someInput', label: 'Some input', - inputMask: null, multiple: false, defaultValue: [''], } as const); @@ -158,7 +148,6 @@ expectNotAssignable({ type: 'phoneNumber', key: 'someInput', label: 'Some input', - inputMask: null, multiple: true, defaultValue: [123], } as const); diff --git a/test-d/formio/components/postcode.test-d.ts b/test-d/formio/components/postcode.test-d.ts index ea021dd..65b16e3 100644 --- a/test-d/formio/components/postcode.test-d.ts +++ b/test-d/formio/components/postcode.test-d.ts @@ -1,6 +1,6 @@ import {expectAssignable, expectNotAssignable} from 'tsd'; -import {PostcodeComponentSchema} from '../../../lib/'; +import {PostcodeComponentSchema} from '../../../dist/'; // minimal postcode component schema expectAssignable({ @@ -8,25 +8,9 @@ expectAssignable({ type: 'postcode', key: 'someInput', label: 'Some input', - inputMask: '9999 AA', validate: { pattern: '^[1-9][0-9]{3} ?(?!sa|sd|ss|SA|SD|SS)[a-zA-Z]{2}$', }, - validateOn: 'blur', -}); - -// with additional, phonenumber-component specific properties -expectAssignable({ - id: 'yejak', - type: 'postcode', - key: 'someInput', - label: 'Some input', - inputMask: '9999 AA', - validate: { - pattern: '^[1-9][0-9]{3} ?(?!sa|sd|ss|SA|SD|SS)[a-zA-Z]{2}$', - }, - validateOn: 'blur', - autocomplete: 'postal-code', }); // multiple false and appropriate default value type @@ -35,11 +19,9 @@ expectAssignable({ type: 'postcode', key: 'someInput', label: 'Some input', - inputMask: '9999 AA', validate: { pattern: '^[1-9][0-9]{3} ?(?!sa|sd|ss|SA|SD|SS)[a-zA-Z]{2}$', }, - validateOn: 'blur', multiple: false, defaultValue: '1015 CJ', }); @@ -50,11 +32,9 @@ expectAssignable({ type: 'postcode', key: 'someInput', label: 'Some input', - inputMask: '9999 AA', validate: { pattern: '^[1-9][0-9]{3} ?(?!sa|sd|ss|SA|SD|SS)[a-zA-Z]{2}$', }, - validateOn: 'blur', multiple: true, defaultValue: ['1015 CJ'], }); @@ -63,8 +43,6 @@ expectAssignable({ expectAssignable({ id: 'yejak', type: 'postcode', - inputMask: '9999 AA', - validateOn: 'blur', // basic tab in builder form label: 'Some input', key: 'someInput', @@ -122,11 +100,9 @@ expectNotAssignable({ type: 'textfield', // TODO: in the future this may become a specialized textfield alias? key: 'someInput', label: 'Some input', - inputMask: '9999 AA', validate: { pattern: '^[1-9][0-9]{3} ?(?!sa|sd|ss|SA|SD|SS)[a-zA-Z]{2}$', }, - validateOn: 'blur', } as const); // using unsupported properties @@ -135,11 +111,9 @@ expectNotAssignable({ type: 'postcode', key: 'someInput', label: 'Some input', - inputMask: '9999 AA', validate: { pattern: '^[1-9][0-9]{3} ?(?!sa|sd|ss|SA|SD|SS)[a-zA-Z]{2}$', }, - validateOn: 'blur', placeholder: 'no placeholder', } as const); @@ -149,12 +123,10 @@ expectNotAssignable({ type: 'postcode', key: 'someInput', label: 'Some input', - inputMask: '9999 AA', validate: { pattern: '^[1-9][0-9]{3} ?(?!sa|sd|ss|SA|SD|SS)[a-zA-Z]{2}$', maxLength: 7, }, - validateOn: 'blur', } as const); // invalid, multiple true and non-array default value @@ -163,11 +135,9 @@ expectNotAssignable({ type: 'postcode', key: 'someInput', label: 'Some input', - inputMask: '9999 AA', validate: { pattern: '^[1-9][0-9]{3} ?(?!sa|sd|ss|SA|SD|SS)[a-zA-Z]{2}$', }, - validateOn: 'blur', multiple: true, defaultValue: '', } as const); @@ -178,11 +148,9 @@ expectNotAssignable({ type: 'postcode', key: 'someInput', label: 'Some input', - inputMask: '9999 AA', validate: { pattern: '^[1-9][0-9]{3} ?(?!sa|sd|ss|SA|SD|SS)[a-zA-Z]{2}$', }, - validateOn: 'blur', multiple: false, defaultValue: [''], } as const); @@ -193,11 +161,9 @@ expectNotAssignable({ type: 'postcode', key: 'someInput', label: 'Some input', - inputMask: '9999 AA', validate: { pattern: '^[1-9][0-9]{3} ?(?!sa|sd|ss|SA|SD|SS)[a-zA-Z]{2}$', }, - validateOn: 'blur', multiple: true, defaultValue: [123], } as const); diff --git a/test-d/formio/components/productPrice.test-d.ts b/test-d/formio/components/productPrice.test-d.ts deleted file mode 100644 index 6b8f7a3..0000000 --- a/test-d/formio/components/productPrice.test-d.ts +++ /dev/null @@ -1,82 +0,0 @@ -import {expectAssignable, expectNotAssignable} from 'tsd'; - -import {ProductPriceComponentSchema} from '../../../lib/'; - -// minimal productPrice component schema -expectAssignable({ - id: '123', - type: 'productPrice', - key: 'aProductPrice', - label: 'A Product Price', -} as const); - -// different component type -expectNotAssignable({ - type: 'textfield', -} as const); - -// using unsupported properties -expectNotAssignable({ - id: '123', - type: 'productPrice', - key: 'aProductPrice', - label: 'A Product Price', - hideLabel: true, -} as const); - -// No defaultValue allowed -expectNotAssignable({ - id: '123', - type: 'productPrice', - key: 'aProductPrice', - label: 'A Product Price', - defaultValue: 1, -}); - -// full, correct schema -expectAssignable({ - id: '8aosjaw', - type: 'productPrice', - // basic tab in builder form - key: 'aProductPrice', - label: 'A Product Price', - description: 'Sample description', - tooltip: 'A tooltip', - showInSummary: true, - showInEmail: false, - showInPDF: true, - // multiple: false, - hidden: false, - clearOnHide: true, - isSensitiveData: false, - // advanced tab in builder form - conditional: { - show: undefined, - when: undefined, - eq: undefined, - }, - // validation tab in builder form - validate: { - required: false, - plugins: undefined, - }, - translatedErrors: { - nl: { - required: 'Je moet een waarde opgeven!!!', - }, - }, - errors: { - // translatedErrors is converted into errors by the backend - required: 'Je moet een waarde opgeven!!!', - }, - // registration tab in builder form - registration: { - attribute: '', - }, - // translations tab in builder form - openForms: { - translations: { - nl: {tooltip: 'bar'}, - }, - }, -}); diff --git a/test-d/formio/components/radio.test-d.ts b/test-d/formio/components/radio.test-d.ts index 19685fb..5c3b9c9 100644 --- a/test-d/formio/components/radio.test-d.ts +++ b/test-d/formio/components/radio.test-d.ts @@ -1,6 +1,6 @@ import {expectAssignable, expectNotAssignable} from 'tsd'; -import {RadioComponentSchema} from '../../../lib'; +import {RadioComponentSchema} from '../../../dist'; // minimal component schema, manual: expectAssignable({ @@ -17,7 +17,7 @@ expectAssignable({ { value: 'dummy', label: 'dummy', - } + }, ], }); @@ -33,6 +33,7 @@ expectAssignable({ itemsExpression: {var: 'dummy'}, translations: {}, }, + values: [], }); // values translations @@ -57,11 +58,11 @@ expectAssignable({ }, nl: { label: 'dummy_nl', - } - } - } - } - ] + }, + }, + }, + }, + ], }); // full, correct schema @@ -103,10 +104,9 @@ expectAssignable({ nl: {label: 'foo'}, }, dataSrc: 'variable', - itemsExpression: 'dummy', + itemsExpression: {var: 'foo'}, }, - // fixed but not editable - validateOn: 'blur', + values: [], }); // Missing openForms @@ -115,6 +115,7 @@ expectNotAssignable({ type: 'radio', key: 'aRadio', label: 'A radio', + values: [], }); // multiple not allowed @@ -126,9 +127,10 @@ expectNotAssignable({ multiple: false, openForms: { dataSrc: 'variable', - itemsExpression: 'dummy', + itemsExpression: {var: 'foo'}, translations: {}, }, + values: [], }); // defaultValue not allowed @@ -140,9 +142,10 @@ expectNotAssignable({ defaultValue: [{dummy: true}], openForms: { dataSrc: 'variable', - itemsExpression: 'dummy', + itemsExpression: {var: 'foo'}, translations: {}, }, + values: [], }); // manual without values @@ -167,9 +170,10 @@ expectNotAssignable({ dataSrc: 'variable', translations: {}, }, + values: [], }); -// manual with both itemsExpression and values +// manual with itemsExpression expectNotAssignable({ id: 'yejak', type: 'radio', @@ -177,7 +181,7 @@ expectNotAssignable({ label: 'A radio', openForms: { dataSrc: 'manual', - itemsExpression: 'dummy', + itemsExpression: {var: 'foo'}, translations: {}, }, values: [ @@ -191,9 +195,9 @@ expectNotAssignable({ }, nl: { label: 'dummy_nl', - } - } - } - } - ] + }, + }, + }, + }, + ], }); diff --git a/test-d/formio/components/select.test-d.ts b/test-d/formio/components/select.test-d.ts index 94d01ab..93a3e6b 100644 --- a/test-d/formio/components/select.test-d.ts +++ b/test-d/formio/components/select.test-d.ts @@ -1,13 +1,11 @@ import {expectAssignable, expectNotAssignable} from 'tsd'; -import {SelectComponentSchema} from '../../../lib'; +import {SelectComponentSchema} from '../../../dist'; // minimal component schema, manual: expectAssignable({ id: 'yejak', type: 'select', - dataSrc: 'values', - dataType: 'string', key: 'someSelect', label: 'Some select', openForms: { @@ -28,74 +26,68 @@ expectAssignable({ expectAssignable({ id: 'yejak', type: 'select', - dataSrc: 'values', - dataType: 'string', key: 'someSelect', label: 'Some select', openForms: { dataSrc: 'variable', - itemsExpression: 'dummy', + itemsExpression: {var: 'foo'}, translations: {}, }, + data: {values: []}, }); // minimal component schema, multiple false: expectAssignable({ id: 'yejak', type: 'select', - dataSrc: 'values', - dataType: 'string', key: 'someSelect', label: 'Some select', multiple: false, defaultValue: 'dummy', openForms: { dataSrc: 'variable', - itemsExpression: 'dummy', + itemsExpression: {var: 'foo'}, translations: {}, }, + data: {values: []}, }); // minimal component schema, multiple true: expectAssignable({ id: 'yejak', type: 'select', - dataSrc: 'values', - dataType: 'string', key: 'someSelect', label: 'Some select', multiple: true, defaultValue: ['dummy'], openForms: { dataSrc: 'variable', - itemsExpression: 'dummy', + itemsExpression: {var: 'foo'}, translations: {}, }, + data: {values: []}, }); // minimal component schema, multiple true and empty defaults: expectAssignable({ id: 'yejak', type: 'select', - dataSrc: 'values', - dataType: 'string', key: 'someSelect', label: 'Some select', multiple: true, defaultValue: [], openForms: { dataSrc: 'variable', - itemsExpression: 'dummy', + itemsExpression: {var: 'foo'}, translations: {}, }, + data: {values: []}, }); // values translations expectAssignable({ id: 'yejak', type: 'select', - dataSrc: 'values', - dataType: 'string', key: 'someSelect', label: 'Some select', defaultValue: 'dummy', @@ -127,8 +119,6 @@ expectAssignable({ expectAssignable({ id: 'yejak', type: 'select', - dataSrc: 'values', - dataType: 'string', // basic tab label: 'Some select', key: 'someSelect', @@ -164,58 +154,56 @@ expectAssignable({ nl: {label: 'foo'}, }, dataSrc: 'variable', - itemsExpression: 'dummy', + itemsExpression: {var: 'foo'}, }, - // fixed but not editable - validateOn: 'blur', + data: {values: []}, }); // Missing openForms expectNotAssignable({ id: 'yejak', type: 'select', - dataSrc: 'values', key: 'someSelect', label: 'Some select', + data: {values: []}, }); // multiple true, wrong default value expectNotAssignable({ id: 'yejak', type: 'select', - dataSrc: 'values', key: 'someSelect', label: 'Some select', multiple: true, defaultValue: 'dummy', openForms: { dataSrc: 'variable', - itemsExpression: 'dummy', + itemsExpression: {var: 'foo'}, translations: {}, }, + data: {values: []}, }); // multiple false, wrong default value expectNotAssignable({ id: 'yejak', type: 'select', - dataSrc: 'values', key: 'someSelect', label: 'Some select', multiple: false, defaultValue: ['dummy'], openForms: { dataSrc: 'variable', - itemsExpression: 'dummy', + itemsExpression: {var: 'foo'}, translations: {}, }, + data: {values: []}, }); // manual without values expectNotAssignable({ id: 'yejak', type: 'select', - dataSrc: 'values', key: 'someSelect', label: 'Some select', openForms: { @@ -229,11 +217,11 @@ expectNotAssignable({ expectNotAssignable({ id: 'yejak', type: 'select', - dataSrc: 'values', key: 'someSelect', label: 'Some select', openForms: { dataSrc: 'variable', translations: {}, }, + data: {values: []}, }); diff --git a/test-d/formio/components/selectboxes.test-d.ts b/test-d/formio/components/selectboxes.test-d.ts index c19611a..ffb78ce 100644 --- a/test-d/formio/components/selectboxes.test-d.ts +++ b/test-d/formio/components/selectboxes.test-d.ts @@ -1,6 +1,6 @@ import {expectAssignable, expectNotAssignable} from 'tsd'; -import {SelectboxesComponentSchema} from '../../../lib'; +import {SelectboxesComponentSchema} from '../../../dist'; // minimal component schema, manual: expectAssignable({ @@ -30,9 +30,10 @@ expectAssignable({ defaultValue: {}, openForms: { dataSrc: 'variable', - itemsExpression: 'dummy', + itemsExpression: {var: 'foo'}, translations: {}, }, + values: [], }); // values translations @@ -105,10 +106,9 @@ expectAssignable({ nl: {label: 'foo'}, }, dataSrc: 'variable', - itemsExpression: 'dummy', + itemsExpression: {var: 'foo'}, }, - // fixed but not editable - validateOn: 'blur', + values: [], }); // Missing openForms @@ -117,6 +117,7 @@ expectNotAssignable({ type: 'selectboxes', key: 'someSelectboxes', label: 'Some selectboxes', + values: [], }); // multiple not allowed @@ -125,12 +126,13 @@ expectNotAssignable({ type: 'selectboxes', key: 'someSelectboxes', label: 'Some selectboxes', - multiple: 'dummy', + multiple: true, openForms: { dataSrc: 'variable', - itemsExpression: 'dummy', + itemsExpression: {var: 'foo'}, translations: {}, }, + values: [], }); // defaultValue not allowed @@ -142,9 +144,10 @@ expectNotAssignable({ defaultValue: [{dummy: true}], openForms: { dataSrc: 'variable', - itemsExpression: 'dummy', + itemsExpression: {var: 'foo'}, translations: {}, }, + values: [], }); // manual without values @@ -169,4 +172,5 @@ expectNotAssignable({ dataSrc: 'variable', translations: {}, }, + values: [], }); diff --git a/test-d/formio/components/signature.test-d.ts b/test-d/formio/components/signature.test-d.ts index 457b35a..854e1d1 100644 --- a/test-d/formio/components/signature.test-d.ts +++ b/test-d/formio/components/signature.test-d.ts @@ -1,6 +1,6 @@ import {expectAssignable, expectNotAssignable} from 'tsd'; -import {SignatureComponentSchema} from '../../../lib/'; +import {SignatureComponentSchema} from '../../../dist/'; // minimal signature component schema expectAssignable({ @@ -16,7 +16,6 @@ expectAssignable({ type: 'signature', key: 'someSignature', label: 'Some signature', - defaultValue: 'data:image/png;base64,dGhlIGdhbWU=', footer: 'Please do not draw inappropriate images', }); @@ -35,7 +34,6 @@ expectAssignable({ hidden: false, clearOnHide: true, isSensitiveData: false, - defaultValue: '', // advanced tab in builder form conditional: { show: undefined, @@ -85,15 +83,6 @@ expectNotAssignable({ hideLabel: true, }); -// bad value format -expectNotAssignable({ - id: 'yejak', - type: 'signature' as const, - key: 'someSignature', - label: 'Some signature', - defaultValue: 'random string', -}); - // multiple is not supported expectNotAssignable({ id: 'yejak', @@ -101,5 +90,4 @@ expectNotAssignable({ key: 'someSignature', label: 'Some signature', multiple: true, - defaultValue: [], }); diff --git a/test-d/formio/components/softRequiredErrors.test-d.ts b/test-d/formio/components/softRequiredErrors.test-d.ts index 570a7c9..d052831 100644 --- a/test-d/formio/components/softRequiredErrors.test-d.ts +++ b/test-d/formio/components/softRequiredErrors.test-d.ts @@ -1,13 +1,12 @@ import {expectAssignable} from 'tsd'; -import {SoftRequiredErrorsComponentSchema} from '../../../lib'; +import {SoftRequiredErrorsComponentSchema} from '../../../dist'; // Minimal schema expectAssignable({ type: 'softRequiredErrors', id: 'iitral8', key: 'someKey', - label: 'Ignored', html: '
Will need to be properly {{ field_errors }} structured.
', }); @@ -16,7 +15,6 @@ expectAssignable({ type: 'softRequiredErrors', id: 'iitral8', key: 'someKey', - label: 'Ignored', html: '
Will need to be properly {{ field_errors }} structured.
', openForms: { translations: { diff --git a/test-d/formio/components/textarea.test-d.ts b/test-d/formio/components/textarea.test-d.ts index 34f74e3..d68e6f4 100644 --- a/test-d/formio/components/textarea.test-d.ts +++ b/test-d/formio/components/textarea.test-d.ts @@ -1,6 +1,6 @@ import {expectAssignable, expectNotAssignable} from 'tsd'; -import {TextareaComponentSchema} from '../../../lib/'; +import {TextareaComponentSchema} from '../../../dist/'; // minimal textarea component schema expectAssignable({ @@ -83,10 +83,6 @@ expectAssignable({ required: 'Je moet een waarde opgeven!!!', maxLength: 'Een maximale lengte.', }, - // registration tab in builder form - registration: { - attribute: '', - }, // translations tab in builder form openForms: { translations: { diff --git a/test-d/formio/components/textfield.test-d.ts b/test-d/formio/components/textfield.test-d.ts index 1e15662..6a2cf33 100644 --- a/test-d/formio/components/textfield.test-d.ts +++ b/test-d/formio/components/textfield.test-d.ts @@ -1,6 +1,6 @@ import {expectAssignable, expectNotAssignable} from 'tsd'; -import {TextFieldComponentSchema} from '../../../lib/'; +import {TextFieldComponentSchema} from '../../../dist/'; // minimal textfield component schema expectAssignable({ diff --git a/test-d/formio/components/time.test-d.ts b/test-d/formio/components/time.test-d.ts index 77cbc7a..3ffd037 100644 --- a/test-d/formio/components/time.test-d.ts +++ b/test-d/formio/components/time.test-d.ts @@ -1,6 +1,6 @@ import {expectAssignable, expectNotAssignable} from 'tsd'; -import {TimeComponentSchema} from '../../../lib'; +import {TimeComponentSchema} from '../../../dist'; // minimal time component schema expectAssignable({ @@ -8,9 +8,6 @@ expectAssignable({ type: 'time', key: 'someTime', label: 'Some time', - inputType: 'text', - format: 'HH:mm', - validateOn: 'blur', }); // with translated error messages - the multiple messages is special here @@ -19,9 +16,6 @@ expectAssignable({ type: 'time', key: 'someTime', label: 'Some time', - inputType: 'text', - format: 'HH:mm', - validateOn: 'blur', translatedErrors: { nl: { required: '', @@ -41,9 +35,6 @@ expectAssignable({ type: 'time', key: 'someTime', label: 'Some time', - inputType: 'text', - format: 'HH:mm', - validateOn: 'blur', multiple: false, defaultValue: '09:47', }); @@ -54,9 +45,6 @@ expectAssignable({ type: 'time', key: 'someTime', label: 'Some time', - inputType: 'text', - format: 'HH:mm', - validateOn: 'blur', multiple: true, defaultValue: ['12:15'], }); @@ -65,9 +53,6 @@ expectAssignable({ expectAssignable({ id: 'ezftxdl', type: 'time', - inputType: 'text', - format: 'HH:mm', - validateOn: 'blur', // basic tab label: 'Some time', key: 'someTime', @@ -127,9 +112,6 @@ expectNotAssignable({ type: 'time', key: 'someTime', label: 'Some time', - inputType: 'text', - format: 'HH:mm', - validateOn: 'blur', multiple: true, defaultValue: '', } as const); @@ -140,9 +122,6 @@ expectNotAssignable({ type: 'time', key: 'someTime', label: 'Some time', - inputType: 'text', - format: 'HH:mm', - validateOn: 'blur', multiple: false, defaultValue: [''], } as const); @@ -153,9 +132,6 @@ expectNotAssignable({ type: 'time', key: 'someTime', label: 'Some time', - inputType: 'text', - format: 'HH:mm', - validateOn: 'blur', multiple: true, defaultValue: [new Date()], } as const); diff --git a/test-d/formio/validation.test-d.ts b/test-d/formio/validation.test-d.ts deleted file mode 100644 index 871fcb4..0000000 --- a/test-d/formio/validation.test-d.ts +++ /dev/null @@ -1,64 +0,0 @@ -import {expectAssignable, expectNotAssignable} from 'tsd'; - -import {HasValidation} from '../../lib/'; - -type OnlyRequired = HasValidation<'required'>; - -// Valid uses - -expectAssignable({}); -expectAssignable({ - validate: { - required: undefined, - }, -}); -expectAssignable({ - validate: { - required: true, - }, -}); -expectAssignable({ - validate: { - required: false, - }, -}); - -expectAssignable({ - translatedErrors: { - nl: { - required: 'Required error message', - }, - }, -}); -expectAssignable({ - errors: { - required: 'Required error message', - }, -}); - -// Invalid uses - -expectNotAssignable({ - validate: { - min: 123, - }, -}); -expectNotAssignable({ - errors: { - min: 'nope', - }, -}); -expectNotAssignable({ - translatedErrors: { - de: { - required: 'Required error message', - }, - }, -}); -expectNotAssignable({ - translatedErrors: { - nl: { - maxLength: 'Oi mate', - }, - }, -}); diff --git a/tsconfig.json b/tsconfig.json index 272cc77..8234d5e 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -1,7 +1,7 @@ { "compilerOptions": { "baseUrl": "src", - "outDir": "lib", + "outDir": "dist", "module": "esnext", "target": "es2017", "declaration": true, @@ -18,5 +18,5 @@ "noErrorTruncation": true }, "include": ["src"], - "exclude": ["node_modules", "lib"] + "exclude": ["node_modules", "dist"] } diff --git a/typedoc.json b/typedoc.json index a9ab959..96a9714 100644 --- a/typedoc.json +++ b/typedoc.json @@ -1,9 +1,7 @@ { "$schema": "https://typedoc.org/schema.json", "entryPoints": [ - "src/index.ts", - "src/formio/i18n.ts", - "src/formio/validation.ts", + "src/**/*.ts", ], "groupOrder": [ "Form.io components",