@planning-inspectorate/dynamic-forms 3.18.0 → 3.18.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/commitlint.config.js +3 -5
- package/eslint.config.js +3 -17
- package/package.json +4 -1
- package/prettier.config.js +7 -0
- package/src/components/conditional/text.njk +1 -0
- package/src/questions/options-question.d.ts +19 -7
- package/src/questions/options-question.d.ts.map +1 -1
- package/src/questions/options-question.js +9 -7
- package/typedefs/journey-types.d.ts +1 -1
- package/typedefs/section-types.d.ts +4 -4
- package/.prettierrc +0 -12
package/commitlint.config.js
CHANGED
|
@@ -1,5 +1,3 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
ignores: [(commit) => commit.includes('dependabot')]
|
|
5
|
-
};
|
|
1
|
+
import { commitlintConfig } from '@planning-inspectorate/coding-standards';
|
|
2
|
+
|
|
3
|
+
export default commitlintConfig;
|
package/eslint.config.js
CHANGED
|
@@ -1,18 +1,4 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
3
|
-
import globals from 'globals';
|
|
1
|
+
import { eslintConfig } from '@planning-inspectorate/coding-standards';
|
|
2
|
+
import { defineConfig } from 'eslint/config';
|
|
4
3
|
|
|
5
|
-
export default
|
|
6
|
-
js.configs.recommended,
|
|
7
|
-
{
|
|
8
|
-
ignores: ['dist/**', 'node_modules/**', '**/*.min*.js', '**/static/scripts/app.js'],
|
|
9
|
-
languageOptions: {
|
|
10
|
-
ecmaVersion: 2025,
|
|
11
|
-
sourceType: 'module',
|
|
12
|
-
globals: {
|
|
13
|
-
...globals.node
|
|
14
|
-
}
|
|
15
|
-
}
|
|
16
|
-
},
|
|
17
|
-
eslintConfigPrettier
|
|
18
|
-
];
|
|
4
|
+
export default defineConfig(eslintConfig);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@planning-inspectorate/dynamic-forms",
|
|
3
|
-
"version": "3.18.
|
|
3
|
+
"version": "3.18.1",
|
|
4
4
|
"description": "This package is for building GDS forms using a configuration-based approach.",
|
|
5
5
|
"main": "./src/index.js",
|
|
6
6
|
"type": "module",
|
|
@@ -45,6 +45,7 @@
|
|
|
45
45
|
"@commitlint/cli": "^21.0.0",
|
|
46
46
|
"@commitlint/config-conventional": "^21.0.0",
|
|
47
47
|
"@eslint/js": "^10.0.1",
|
|
48
|
+
"@planning-inspectorate/coding-standards": "^1.0.0",
|
|
48
49
|
"@types/express": "^5.0.6",
|
|
49
50
|
"body-parser": "^2.2.0",
|
|
50
51
|
"conventional-changelog-conventionalcommits": "^10.2.0",
|
|
@@ -58,6 +59,8 @@
|
|
|
58
59
|
"husky": "^9.1.7",
|
|
59
60
|
"lint-staged": "^17.0.4",
|
|
60
61
|
"prettier": "^3.6.2",
|
|
62
|
+
"prettier-plugin-organize-imports": "^4.3.0",
|
|
63
|
+
"prettier-plugin-prisma": "^5.0.0",
|
|
61
64
|
"semantic-release": "^25.0.1"
|
|
62
65
|
},
|
|
63
66
|
"publishConfig": {
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
* @typedef {{
|
|
3
3
|
* text: string;
|
|
4
4
|
* value: string;
|
|
5
|
-
*
|
|
5
|
+
* hint?: object;
|
|
6
6
|
* checked?: boolean | undefined;
|
|
7
7
|
* attributes?: Record<string, string>;
|
|
8
8
|
* behaviour?: 'exclusive';
|
|
@@ -10,14 +10,16 @@
|
|
|
10
10
|
* question: string;
|
|
11
11
|
* type: string;
|
|
12
12
|
* fieldName: string;
|
|
13
|
-
*
|
|
14
|
-
*
|
|
13
|
+
* inputClasses?: string;
|
|
14
|
+
* html?: string;
|
|
15
15
|
* value?: unknown;
|
|
16
|
-
*
|
|
17
|
-
*
|
|
16
|
+
* label?: string;
|
|
17
|
+
* hint?: string
|
|
18
|
+
* prefix?: { text?: string; html?: string; classes?: string };
|
|
19
|
+
* suffix?: { text?: string; html?: string; classes?: string };
|
|
18
20
|
* };
|
|
19
|
-
*
|
|
20
|
-
*
|
|
21
|
+
* conditionalText?: {
|
|
22
|
+
* html: string;
|
|
21
23
|
* }
|
|
22
24
|
*}} Option
|
|
23
25
|
*/
|
|
@@ -63,6 +65,16 @@ export type Option = {
|
|
|
63
65
|
value?: unknown;
|
|
64
66
|
label?: string;
|
|
65
67
|
hint?: string;
|
|
68
|
+
prefix?: {
|
|
69
|
+
text?: string;
|
|
70
|
+
html?: string;
|
|
71
|
+
classes?: string;
|
|
72
|
+
};
|
|
73
|
+
suffix?: {
|
|
74
|
+
text?: string;
|
|
75
|
+
html?: string;
|
|
76
|
+
classes?: string;
|
|
77
|
+
};
|
|
66
78
|
};
|
|
67
79
|
conditionalText?: {
|
|
68
80
|
html: string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"options-question.d.ts","sourceRoot":"","sources":["options-question.js"],"names":[],"mappings":"AASA
|
|
1
|
+
{"version":3,"file":"options-question.d.ts","sourceRoot":"","sources":["options-question.js"],"names":[],"mappings":"AASA;;;;;;;;;;;;;;;;;;;;;;;;GAwBG;AAEH;;GAEG;AACH;;GAEG;AAEH;IAIC;;OAEG;IACH,oBAFW,yBAAyB,EAenC;IAnBD,4BAA4B;IAC5B,SADW,KAAK,CAAC,MAAM,CAAC,CAChB;IAiBP,yBAA+C;IAGhD;;;;;;;;OAQG;IACH,kCAPW,OAAO,UAAU,EAAE,OAAO,WAC1B,OAAO,UAAU,EAAE,OAAO,mBAC1B,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,YACvB,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,WACvB,OAAO,+BAA+B,EAAE,+BAA+B,GACrE,OAAO,+BAA+B,EAAE,iBAAiB,CAkDrE;CA2DD;;qBA1KY;IACR,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,EAAE,MAAM,CAAC;IACf,IAAI,CAAC,EAAE,MAAM,CAAC;IACb,OAAO,CAAC,EAAE,OAAO,GAAG,SAAS,CAAC;IAC9B,UAAU,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IACpC,SAAS,CAAC,EAAE,WAAW,CAAC;IACxB,WAAW,CAAC,EAAE;QACZ,QAAQ,EAAE,MAAM,CAAC;QACjB,IAAI,EAAE,MAAM,CAAC;QACb,SAAS,EAAE,MAAM,CAAC;QACnB,YAAY,CAAC,EAAE,MAAM,CAAC;QACtB,IAAI,CAAC,EAAE,MAAM,CAAC;QACb,KAAK,CAAC,EAAE,OAAO,CAAC;QACjB,KAAK,CAAC,EAAE,MAAM,CAAC;QACf,IAAI,CAAC,EAAE,MAAM,CAAA;QACb,MAAM,CAAC,EAAE;YAAE,IAAI,CAAC,EAAE,MAAM,CAAC;YAAC,IAAI,CAAC,EAAE,MAAM,CAAC;YAAC,OAAO,CAAC,EAAE,MAAM,CAAA;SAAE,CAAC;QAC5D,MAAM,CAAC,EAAE;YAAE,IAAI,CAAC,EAAE,MAAM,CAAC;YAAC,IAAI,CAAC,EAAE,MAAM,CAAC;YAAC,OAAO,CAAC,EAAE,MAAM,CAAA;SAAE,CAAC;KAC5D,CAAC;IACH,eAAe,CAAC,EAAE;QAChB,IAAI,EAAE,MAAM,CAAC;KACb,CAAA;CACH;+BAIU,OAAO,+BAA+B,EAAE,iBAAiB,GAAG;IAAE,QAAQ,EAAE;QAAE,OAAO,EAAE,MAAM,EAAE,CAAA;KAAE,CAAA;CAAE;wCAG/F,OAAO,+BAA+B,EAAE,kBAAkB,GAAG;IAAE,OAAO,EAAE,KAAK,CAAC,MAAM,CAAC,CAAA;CAAE;yBAtC3E,eAAe"}
|
|
@@ -11,7 +11,7 @@ const defaultOptionJoinString = ',';
|
|
|
11
11
|
* @typedef {{
|
|
12
12
|
* text: string;
|
|
13
13
|
* value: string;
|
|
14
|
-
*
|
|
14
|
+
* hint?: object;
|
|
15
15
|
* checked?: boolean | undefined;
|
|
16
16
|
* attributes?: Record<string, string>;
|
|
17
17
|
* behaviour?: 'exclusive';
|
|
@@ -19,14 +19,16 @@ const defaultOptionJoinString = ',';
|
|
|
19
19
|
* question: string;
|
|
20
20
|
* type: string;
|
|
21
21
|
* fieldName: string;
|
|
22
|
-
*
|
|
23
|
-
*
|
|
22
|
+
* inputClasses?: string;
|
|
23
|
+
* html?: string;
|
|
24
24
|
* value?: unknown;
|
|
25
|
-
*
|
|
26
|
-
*
|
|
25
|
+
* label?: string;
|
|
26
|
+
* hint?: string
|
|
27
|
+
* prefix?: { text?: string; html?: string; classes?: string };
|
|
28
|
+
* suffix?: { text?: string; html?: string; classes?: string };
|
|
27
29
|
* };
|
|
28
|
-
*
|
|
29
|
-
*
|
|
30
|
+
* conditionalText?: {
|
|
31
|
+
* html: string;
|
|
30
32
|
* }
|
|
31
33
|
*}} Option
|
|
32
34
|
*/
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { JourneyResponse } from '#src/journey/journey-response.js';
|
|
2
|
-
import ManageListQuestion from '#src/components/manage-list/question.js';
|
|
3
|
-
import { Question } from '#src/questions/question.js';
|
|
4
|
-
import { RouteParams } from './journey-types.d.ts';
|
|
1
|
+
import type { JourneyResponse } from '#src/journey/journey-response.js';
|
|
2
|
+
import type ManageListQuestion from '#src/components/manage-list/question.js';
|
|
3
|
+
import type { Question } from '#src/questions/question.js';
|
|
4
|
+
import type { RouteParams } from './journey-types.d.ts';
|
|
5
5
|
|
|
6
6
|
export interface GetNextQuestionParams {
|
|
7
7
|
questionFieldName: string;
|