@planning-inspectorate/dynamic-forms 3.7.0 → 3.8.0

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.
Files changed (39) hide show
  1. package/package.json +5 -2
  2. package/src/components/date-time/question.js +1 -1
  3. package/src/components/radio/question.js +1 -1
  4. package/src/components/unit-option-entry/question.js +3 -2
  5. package/src/controller.js +2 -1
  6. package/src/index.js +3 -0
  7. package/src/lib/utils.js +10 -0
  8. package/src/lib/utils.test.js +17 -1
  9. package/src/questions/options-question.js +4 -3
  10. package/src/questions/options-question.test.js +83 -0
  11. package/src/questions/{question-props.d.ts → question-props.ts} +2 -8
  12. package/src/questions/{question-types.d.ts → question-types.ts} +4 -4
  13. package/src/questions/question.js +2 -2
  14. package/src/validator/conditional-required-validator.js +2 -1
  15. package/src/validator/unit-option-entry-validator.js +2 -1
  16. package/src/validator/valid-option-validator.js +2 -1
  17. package/tsconfig.json +1 -1
  18. package/types/src/components/date-time/question.d.ts +2 -2
  19. package/types/src/components/date-time/question.d.ts.map +1 -1
  20. package/types/src/components/radio/question.d.ts +2 -2
  21. package/types/src/components/radio/question.d.ts.map +1 -1
  22. package/types/src/components/unit-option-entry/question.d.ts +2 -2
  23. package/types/src/components/unit-option-entry/question.d.ts.map +1 -1
  24. package/types/src/controller.d.ts.map +1 -1
  25. package/types/src/index.d.ts +2 -0
  26. package/types/src/index.d.ts.map +1 -1
  27. package/types/src/lib/utils.d.ts +7 -0
  28. package/types/src/lib/utils.d.ts.map +1 -1
  29. package/types/src/questions/options-question.d.ts +2 -2
  30. package/types/src/questions/options-question.d.ts.map +1 -1
  31. package/types/src/questions/question-props.d.ts +113 -0
  32. package/types/src/questions/question-props.d.ts.map +1 -0
  33. package/types/src/questions/question-types.d.ts +49 -0
  34. package/types/src/questions/question-types.d.ts.map +1 -0
  35. package/types/src/questions/question.d.ts +4 -4
  36. package/types/src/questions/question.d.ts.map +1 -1
  37. package/types/src/validator/conditional-required-validator.d.ts.map +1 -1
  38. package/types/src/validator/unit-option-entry-validator.d.ts.map +1 -1
  39. package/types/src/validator/valid-option-validator.d.ts.map +1 -1
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@planning-inspectorate/dynamic-forms",
3
- "version": "3.7.0",
3
+ "version": "3.8.0",
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",
@@ -9,6 +9,9 @@
9
9
  "type": "git",
10
10
  "url": "git+https://github.com/Planning-Inspectorate/dynamic-forms.git"
11
11
  },
12
+ "engines": {
13
+ "node": ">=22.18.0"
14
+ },
12
15
  "scripts": {
13
16
  "commitlint": "commitlint --from=$(git rev-parse $(git cherry origin/main | head -n 1 | cut -c 3-)^1)",
14
17
  "lint": "npx eslint .",
@@ -27,7 +30,7 @@
27
30
  "nunjucks": "^3.2.4"
28
31
  },
29
32
  "imports": {
30
- "#question-types": "./src/questions/question-types.d.ts",
33
+ "#question-types": "./src/questions/question-types.ts",
31
34
  "#test/*": "./test/*",
32
35
  "#base-validator": "./src/validator/base-validator.js",
33
36
  "#journey": "./src/journey/journey.js",
@@ -9,7 +9,7 @@ export default class DateTimeQuestion extends Question {
9
9
  static PM = 'pm';
10
10
 
11
11
  /**
12
- * @param {import('@planning-inspectorate/dynamic-forms/src/questions/question-types.js').QuestionParameters} params
12
+ * @param {import('#question-types').QuestionParameters} params
13
13
  * @param {string} [params.dateFormat]
14
14
  * @param {string} [params.timeFormat]
15
15
  */
@@ -18,7 +18,7 @@ export default class RadioQuestion extends OptionsQuestion {
18
18
  * @param {Array.<import('#base-validator').BaseValidator>} [params.validators]
19
19
  * @param {boolean} [params.editable]
20
20
  * @param {Object<string, any>} [params.viewData]
21
- * @param {import('../../questions/question-types.js').ActionLink} [params.actionLink]
21
+ * @param {import('#question-types').ActionLink} [params.actionLink]
22
22
  */
23
23
  constructor({
24
24
  title,
@@ -1,6 +1,7 @@
1
1
  import nunjucks from 'nunjucks';
2
2
  import { Question } from '../../questions/question.js';
3
3
  import { conditionalIsJustHTML } from '../utils/question-utils.js';
4
+ import { toArray } from '#src/lib/utils.js';
4
5
 
5
6
  const defaultOptionJoinString = ',';
6
7
 
@@ -64,7 +65,7 @@ export default class UnitOptionEntryQuestion extends Question {
64
65
  * @param {import('#journey').Journey} journey - the journey we are in
65
66
  * @param {Record<string, unknown>} [customViewData] additional data to send to view
66
67
  * @param {Record<string, unknown>} [payload]
67
- * @param {import('#src/questions/question-types.d.ts').PrepQuestionForRenderingOptions} options
68
+ * @param {import('#question-types').PrepQuestionForRenderingOptions} options
68
69
  * @returns {import('#question').QuestionViewModel & {
69
70
  * question: import('#question').QuestionViewModel['question'] & {
70
71
  * options:UnitOption[]
@@ -132,7 +133,7 @@ export default class UnitOptionEntryQuestion extends Question {
132
133
  const answers = {};
133
134
 
134
135
  /** @type {string[]} */
135
- const fields = Array.isArray(req.body[this.fieldName]) ? req.body[this.fieldName] : [req.body[this.fieldName]];
136
+ const fields = toArray(req.body[this.fieldName]);
136
137
  const fieldValues = fields.map((x) => x.trim());
137
138
 
138
139
  const selectedOptions = this.options.filter(({ value }) => {
package/src/controller.js CHANGED
@@ -3,6 +3,7 @@ import questionUtils from './components/utils/question-utils.js';
3
3
  import { answerObjectForManageListSaving } from '#src/components/manage-list/utils.js';
4
4
  import { booleanToYesNoValue } from '#src/components/boolean/question.js';
5
5
  import { MANAGE_LIST_ACTIONS } from '#src/components/manage-list/manage-list-actions.js';
6
+ import { toArray } from '#src/lib/utils.js';
6
7
 
7
8
  /**
8
9
  * @typedef {import('./journey/journey.js').Journey} Journey
@@ -64,7 +65,7 @@ function buildSectionRowViewModel(key, value, action) {
64
65
  html: value
65
66
  },
66
67
  actions: {
67
- items: Array.isArray(action) ? action : [action]
68
+ items: toArray(action)
68
69
  }
69
70
  };
70
71
  }
package/src/index.js CHANGED
@@ -46,6 +46,9 @@ export { createQuestions } from './questions/create-questions.js';
46
46
  export * from './questions/options-question.js';
47
47
  export { questionClasses } from './questions/questions.js';
48
48
 
49
+ export * from './questions/question-props.ts';
50
+ export * from './questions/question-types.ts';
51
+
49
52
  // Section
50
53
  export { Section } from './section.js';
51
54
 
package/src/lib/utils.js CHANGED
@@ -28,3 +28,13 @@ export function trimTrailingSlash(str) {
28
28
  if (typeof str !== 'string') return str;
29
29
  return str.replace(/\/$/, '');
30
30
  }
31
+
32
+ /**
33
+ * Convert a value to an array, unless it is already
34
+ *
35
+ * @param {T|T[]} value
36
+ * @template T
37
+ */
38
+ export function toArray(value) {
39
+ return Array.isArray(value) ? value : [value];
40
+ }
@@ -1,6 +1,6 @@
1
1
  import { describe, it } from 'node:test';
2
2
  import assert from 'node:assert';
3
- import { trimTrailingSlash } from '#src/lib/utils.js';
3
+ import { toArray, trimTrailingSlash } from '#src/lib/utils.js';
4
4
 
5
5
  describe('utils', () => {
6
6
  describe('trimTrailingSlash', () => {
@@ -16,4 +16,20 @@ describe('utils', () => {
16
16
  assert.strictEqual(trimTrailingSlash(5), 5);
17
17
  });
18
18
  });
19
+ describe('toArray', () => {
20
+ it('should create an array if a value is provided', () => {
21
+ const values = [true, false, 'string', 123, null, { hello: 'world' }];
22
+ for (const value of values) {
23
+ const asArray = toArray(value);
24
+ assert.ok(Array.isArray(asArray));
25
+ assert.strictEqual(asArray.length, 1);
26
+ assert.strictEqual(asArray[0], value);
27
+ }
28
+ });
29
+ it('should leave an array as-is', () => {
30
+ const array = [1, 'string', 2];
31
+ const asArray = toArray(array);
32
+ assert.strictEqual(array, asArray);
33
+ });
34
+ });
19
35
  });
@@ -2,6 +2,7 @@ import nunjucks from 'nunjucks';
2
2
  import { Question } from './question.js';
3
3
  import ValidOptionValidator from '../validator/valid-option-validator.js';
4
4
  import { getConditionalFieldName } from '../components/utils/question-utils.js';
5
+ import { toArray } from '#src/lib/utils.js';
5
6
 
6
7
  const defaultOptionJoinString = ',';
7
8
 
@@ -62,7 +63,7 @@ export default class OptionsQuestion extends Question {
62
63
  * @param {import('#journey').Journey} journey - the journey we are in
63
64
  * @param {Record<string, unknown>} [customViewData] additional data to send to view
64
65
  * @param {Record<string, unknown>} [payload]
65
- * @param {import('#src/questions/question-types.d.ts').PrepQuestionForRenderingOptions} options
66
+ * @param {import('#question-types').PrepQuestionForRenderingOptions} options
66
67
  * @returns {import('./question').QuestionViewModel} QuestionViewModel
67
68
  */
68
69
  prepQuestionForRendering(section, journey, customViewData, payload, options) {
@@ -124,14 +125,14 @@ export default class OptionsQuestion extends Question {
124
125
  async getDataToSave(req, journeyResponse) {
125
126
  const answers = {};
126
127
 
127
- const fields = Array.isArray(req.body[this.fieldName]) ? req.body[this.fieldName] : [req.body[this.fieldName]];
128
+ const fields = req.body[this.fieldName] !== undefined ? toArray(req.body[this.fieldName]) : [];
128
129
  const fieldValues = fields.map((x) => x.trim());
129
130
 
130
131
  const selectedOptions = this.options.filter(({ value }) => {
131
132
  return fieldValues.includes(value);
132
133
  });
133
134
 
134
- if (!selectedOptions.length)
135
+ if (selectedOptions.length !== fieldValues.length)
135
136
  throw new Error(`User submitted option(s) did not correlate with valid answers to ${this.fieldName} question`);
136
137
 
137
138
  answers[this.fieldName] = fieldValues.join(this.optionJoinString);
@@ -220,4 +220,87 @@ describe('./src/dynamic-forms/question.js', () => {
220
220
  assert.strictEqual(result.hello, 'hi');
221
221
  });
222
222
  });
223
+ describe('getDataToSave', () => {
224
+ it('should return selected options in object format', async () => {
225
+ const mockReq = {
226
+ body: {
227
+ [FIELDNAME]: 'blue'
228
+ }
229
+ };
230
+ const options = [
231
+ {
232
+ text: 'Blue',
233
+ value: 'blue'
234
+ },
235
+ {
236
+ text: 'Red',
237
+ value: 'red'
238
+ }
239
+ ];
240
+ const expectedAnswer = {
241
+ answers: {
242
+ [FIELDNAME]: 'blue'
243
+ }
244
+ };
245
+
246
+ const question = getTestQuestion({ options });
247
+ const result = await question.getDataToSave(mockReq, {});
248
+ assert.deepStrictEqual(result, expectedAnswer);
249
+ });
250
+ it('if req.body field name is undefined then pass through with an empty answer', async () => {
251
+ const mockReq = {
252
+ body: {
253
+ [FIELDNAME]: undefined
254
+ }
255
+ };
256
+ const options = [
257
+ {
258
+ text: 'Blue',
259
+ value: 'blue'
260
+ },
261
+ {
262
+ text: 'Red',
263
+ value: 'red'
264
+ }
265
+ ];
266
+ const expectedAnswer = {
267
+ answers: {
268
+ [FIELDNAME]: ''
269
+ }
270
+ };
271
+
272
+ const question = getTestQuestion({ options });
273
+ const result = await question.getDataToSave(mockReq, {});
274
+ assert.deepStrictEqual(result, expectedAnswer);
275
+ });
276
+ it('if submitted options contains invalid answers then throw error', async () => {
277
+ const mockReq = {
278
+ body: {
279
+ [FIELDNAME]: ['blue', 'green']
280
+ }
281
+ };
282
+ const options = [
283
+ {
284
+ text: 'Blue',
285
+ value: 'blue'
286
+ },
287
+ {
288
+ text: 'Red',
289
+ value: 'red'
290
+ }
291
+ ];
292
+
293
+ const question = getTestQuestion({ options });
294
+ assert.rejects(
295
+ async () => question.getDataToSave(mockReq, {}),
296
+ (thrown) => {
297
+ assert.strictEqual(
298
+ thrown.message,
299
+ `User submitted option(s) did not correlate with valid answers to ${FIELDNAME} question`
300
+ );
301
+ return true;
302
+ }
303
+ );
304
+ });
305
+ });
223
306
  });
@@ -1,5 +1,4 @@
1
- import { DocType } from '@pins/common/src/document-types';
2
- import { QuestionParameters } from '#question-types';
1
+ import type { QuestionParameters } from '#question-types';
3
2
 
4
3
  type QuestionTypes =
5
4
  | 'boolean'
@@ -19,7 +18,7 @@ type QuestionTypes =
19
18
  | 'text-entry-redact'
20
19
  | 'unit-option';
21
20
 
22
- type CommonQuestionProps = QuestionParameters & {
21
+ type CommonQuestionProps = Omit<QuestionParameters, 'viewFolder'> & {
23
22
  type: QuestionTypes;
24
23
  };
25
24
 
@@ -117,11 +116,6 @@ type MultiFieldInputQuestionProps = CommonQuestionProps & {
117
116
  formatType?: 'contactDetails' | 'standard';
118
117
  };
119
118
 
120
- type MultiFileUploadQuestionProps = CommonQuestionProps & {
121
- type: 'multi-file-upload';
122
- documentType: DocType;
123
- };
124
-
125
119
  type NumberEntryQuestionProps = CommonQuestionProps & {
126
120
  type: 'number';
127
121
  suffix?: string;
@@ -1,7 +1,7 @@
1
- import { RouteParams } from '#src/journey/journey-types.d.ts';
2
- import ManageListQuestion from '#src/components/manage-list/question.js';
3
- import BaseValidator from '../validator/base-validator.js';
4
- import { JourneyResponse } from '../journey/journey-response.js';
1
+ import type { RouteParams } from '#src/journey/journey-types.d.ts';
2
+ import type ManageListQuestion from '#src/components/manage-list/question.js';
3
+ import type BaseValidator from '../validator/base-validator.js';
4
+ import type { JourneyResponse } from '../journey/journey-response.js';
5
5
 
6
6
  export interface QuestionParameters {
7
7
  title: string;
@@ -210,7 +210,7 @@ export class Question {
210
210
  * @param {Journey} journey - the journey we are in
211
211
  * @param {Record<string, unknown>} [customViewData] additional data to send to view
212
212
  * @param {unknown} [payload]
213
- * @param {import('./question-types.d.ts').PrepQuestionForRenderingOptions} [options] - required to support manage list question
213
+ * @param {import('#question-types').PrepQuestionForRenderingOptions} [options] - required to support manage list question
214
214
  * @returns {QuestionViewModel}
215
215
  */
216
216
  prepQuestionForRendering(section, journey, customViewData, payload, options) {
@@ -278,7 +278,7 @@ export class Question {
278
278
  * Get the answers object from the journey response, which may be nested in an array for manage list questions
279
279
  *
280
280
  * @param {JourneyResponse} response
281
- * @param {import('./question-types.d.ts').PrepQuestionForRenderingOptions} [options]
281
+ * @param {import('#question-types').PrepQuestionForRenderingOptions} [options]
282
282
  * @returns {Record<string, any>}
283
283
  */
284
284
  answerObjectFromJourneyResponse(response, { params, manageListQuestion } = {}) {
@@ -1,6 +1,7 @@
1
1
  import { body } from 'express-validator';
2
2
 
3
3
  import BaseValidator from './base-validator.js';
4
+ import { toArray } from '#src/lib/utils.js';
4
5
 
5
6
  /**
6
7
  * @typedef {import('../questions/question.js')} Question
@@ -52,7 +53,7 @@ export default class ConditionalRequiredValidator extends BaseValidator {
52
53
 
53
54
  isValueIncluded(questionObj, value) {
54
55
  return body(questionObj.fieldName).custom((existingValues) => {
55
- existingValues = Array.isArray(existingValues) ? existingValues : [existingValues];
56
+ existingValues = toArray(existingValues);
56
57
  return existingValues.includes(value);
57
58
  });
58
59
  }
@@ -1,6 +1,7 @@
1
1
  import { body } from 'express-validator';
2
2
 
3
3
  import BaseValidator from './base-validator.js';
4
+ import { toArray } from '#src/lib/utils.js';
4
5
 
5
6
  /**
6
7
  * @typedef {import('../questions/question.js')} Question
@@ -81,7 +82,7 @@ export default class UnitOptionEntryValidator extends BaseValidator {
81
82
 
82
83
  isValueIncluded(questionObj, value) {
83
84
  return body(questionObj.fieldName).custom((existingValues) => {
84
- existingValues = Array.isArray(existingValues) ? existingValues : [existingValues];
85
+ existingValues = toArray(existingValues);
85
86
  return existingValues.includes(value);
86
87
  });
87
88
  }
@@ -1,6 +1,7 @@
1
1
  import { body } from 'express-validator';
2
2
 
3
3
  import BaseValidator from './base-validator.js';
4
+ import { toArray } from '#src/lib/utils.js';
4
5
 
5
6
  /**
6
7
  * @typedef {import('../questions/options-question.js')} OptionsQuestion
@@ -33,7 +34,7 @@ export default class ValidOptionValidator extends BaseValidator {
33
34
  return body(questionObj.fieldName)
34
35
  .custom((value) => {
35
36
  if (!value) return true;
36
- value = Array.isArray(value) ? value : [value];
37
+ value = toArray(value);
37
38
  return value.every((element) => questionObj.options.map((option) => option.value).includes(element));
38
39
  })
39
40
  .withMessage(this.errorMessage);
package/tsconfig.json CHANGED
@@ -20,7 +20,7 @@
20
20
  "target": "esnext",
21
21
  "skipLibCheck": true,
22
22
  "paths": {
23
- "#question-types": ["./src/questions/question-types.d.ts"],
23
+ "#question-types": ["./src/questions/question-types.ts"],
24
24
  "#src/*": ["./src/*"],
25
25
  "#test/*": ["./test/*"],
26
26
  "#question": ["./src/questions/question.js"],
@@ -2,11 +2,11 @@ export default class DateTimeQuestion extends Question {
2
2
  static AM: string;
3
3
  static PM: string;
4
4
  /**
5
- * @param {import('@planning-inspectorate/dynamic-forms/src/questions/question-types.js').QuestionParameters} params
5
+ * @param {import('#question-types').QuestionParameters} params
6
6
  * @param {string} [params.dateFormat]
7
7
  * @param {string} [params.timeFormat]
8
8
  */
9
- constructor({ dateFormat, timeFormat, ...params }: any);
9
+ constructor({ dateFormat, timeFormat, ...params }: import("#question-types").QuestionParameters);
10
10
  dateFormat: any;
11
11
  timeFormat: any;
12
12
  /**
@@ -1 +1 @@
1
- {"version":3,"file":"question.d.ts","sourceRoot":"","sources":["../../../../src/components/date-time/question.js"],"names":[],"mappings":"AAMA;IACC,kBAAiB;IACjB,kBAAiB;IAEjB;;;;OAIG;IACH,wDAOC;IAFA,gBAA4B;IAC5B,gBAA4B;IAG7B;;;;;OAKG,CACH,yCAHW,eAAe,GACb,OAAO,CAAE,MAAM,CAAC,CAqB5B;IAED;;MAqCC;;CAoCD;yBA5HwB,6BAA6B"}
1
+ {"version":3,"file":"question.d.ts","sourceRoot":"","sources":["../../../../src/components/date-time/question.js"],"names":[],"mappings":"AAMA;IACC,kBAAiB;IACjB,kBAAiB;IAEjB;;;;OAIG;IACH,mDAJW,OAAO,iBAAiB,EAAE,kBAAkB,EAWtD;IAFA,gBAA4B;IAC5B,gBAA4B;IAG7B;;;;;OAKG,CACH,yCAHW,eAAe,GACb,OAAO,CAAE,MAAM,CAAC,CAqB5B;IAED;;MAqCC;;CAoCD;yBA5HwB,6BAA6B"}
@@ -16,7 +16,7 @@ export default class RadioQuestion extends OptionsQuestion {
16
16
  * @param {Array.<import('#base-validator').BaseValidator>} [params.validators]
17
17
  * @param {boolean} [params.editable]
18
18
  * @param {Object<string, any>} [params.viewData]
19
- * @param {import('../../questions/question-types.js').ActionLink} [params.actionLink]
19
+ * @param {import('#question-types').ActionLink} [params.actionLink]
20
20
  */
21
21
  constructor({ title, question, fieldName, viewFolder, url, hint, pageTitle, description, label, html, legend, options, validators, actionLink, editable, viewData }: {
22
22
  title: string;
@@ -36,7 +36,7 @@ export default class RadioQuestion extends OptionsQuestion {
36
36
  viewData?: {
37
37
  [x: string]: any;
38
38
  } | undefined;
39
- actionLink?: import("../../questions/question-types.js").ActionLink | undefined;
39
+ actionLink?: import("#question-types").ActionLink | undefined;
40
40
  });
41
41
  label: string | undefined;
42
42
  legend: string | undefined;
@@ -1 +1 @@
1
- {"version":3,"file":"question.d.ts","sourceRoot":"","sources":["../../../../src/components/radio/question.js"],"names":[],"mappings":"AAEA;IACC;;;;;;;;;;;;;;;;;;OAkBG;IACH,qKAjBG;QAAuB,KAAK,EAApB,MAAM;QACS,QAAQ,EAAvB,MAAM;QACS,SAAS,EAAxB,MAAM;QACU,UAAU;QACV,GAAG;QACH,IAAI;QACJ,SAAS;QACT,WAAW;QACX,KAAK;QACL,IAAI;QACJ,MAAM;QAC+C,OAAO,EAA5E,KAAK,CAAE,OAAO,qCAAqC,EAAE,MAAM,CAAC;QACH,UAAU;QAClD,QAAQ;QACI,QAAQ;;;QAC2B,UAAU;KAAC,EAuCrF;IAFA,0BAAkB;IAClB,2BAAoB;IAWrB;;;;;;OAMG;IACH,wDAJW,OAAO,UADP,MAAM,GAGJ,KAAK,CAAE,MAAM,CAAC,CAgB1B;CACD;4BA3F2B,qCAAqC"}
1
+ {"version":3,"file":"question.d.ts","sourceRoot":"","sources":["../../../../src/components/radio/question.js"],"names":[],"mappings":"AAEA;IACC;;;;;;;;;;;;;;;;;;OAkBG;IACH,qKAjBG;QAAuB,KAAK,EAApB,MAAM;QACS,QAAQ,EAAvB,MAAM;QACS,SAAS,EAAxB,MAAM;QACU,UAAU;QACV,GAAG;QACH,IAAI;QACJ,SAAS;QACT,WAAW;QACX,KAAK;QACL,IAAI;QACJ,MAAM;QAC+C,OAAO,EAA5E,KAAK,CAAE,OAAO,qCAAqC,EAAE,MAAM,CAAC;QACH,UAAU;QAClD,QAAQ;QACI,QAAQ;;;QACS,UAAU;KAAC,EAuCnE;IAFA,0BAAkB;IAClB,2BAAoB;IAWrB;;;;;;OAMG;IACH,wDAJW,OAAO,UADP,MAAM,GAGJ,KAAK,CAAE,MAAM,CAAC,CAgB1B;CACD;4BA3F2B,qCAAqC"}
@@ -34,14 +34,14 @@ export default class UnitOptionEntryQuestion extends Question {
34
34
  * @param {import('#journey').Journey} journey - the journey we are in
35
35
  * @param {Record<string, unknown>} [customViewData] additional data to send to view
36
36
  * @param {Record<string, unknown>} [payload]
37
- * @param {import('#src/questions/question-types.d.ts').PrepQuestionForRenderingOptions} options
37
+ * @param {import('#question-types').PrepQuestionForRenderingOptions} options
38
38
  * @returns {import('#question').QuestionViewModel & {
39
39
  * question: import('#question').QuestionViewModel['question'] & {
40
40
  * options:UnitOption[]
41
41
  * }
42
42
  * }}
43
43
  */
44
- prepQuestionForRendering(section: any, journey: import("#journey").Journey, customViewData?: Record<string, unknown>, payload?: Record<string, unknown>, options: import("#src/questions/question-types.d.ts").PrepQuestionForRenderingOptions): import("#question").QuestionViewModel & {
44
+ prepQuestionForRendering(section: any, journey: import("#journey").Journey, customViewData?: Record<string, unknown>, payload?: Record<string, unknown>, options: import("#question-types").PrepQuestionForRenderingOptions): import("#question").QuestionViewModel & {
45
45
  question: import("#question").QuestionViewModel["question"] & {
46
46
  options: UnitOption[];
47
47
  };
@@ -1 +1 @@
1
- {"version":3,"file":"question.d.ts","sourceRoot":"","sources":["../../../../src/components/unit-option-entry/question.js"],"names":[],"mappings":"AAMA;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AAEH;IACC,gCAAgC;IAChC,SADW,KAAK,CAAC,UAAU,CAAC,CACpB;IAqBP,0BAAgD;IAEhD,WAAkB;IAClB,yBAA+C;IAGhD;;;;;;;;;;;;OAYG;IACH,gDAVW,OAAO,UAAU,EAAE,OAAO,mBAC1B,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,YACvB,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,WACvB,OAAO,oCAAoC,EAAE,+BAA+B,GAC1E,OAAO,WAAW,EAAE,iBAAiB,GAAG;QAChD,QAAQ,EAAE,OAAO,WAAW,EAAE,iBAAiB,CAAC,UAAU,CAAC,GAAG;YAC5D,OAAO,EAAC,UAAU,EAAE,CAAA;SACrB,CAAA;KACF,CAmDH;IAED;;;;;OAKG,CACH,yCAHW,eAAe,GACb,OAAO,CAAC;QAAE,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAA;KAAE,CAAC,CAgCzD;CAoBD;;;;;;;;;yBAvKY;IACR,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,EAAE,MAAM,CAAC;IACZ,IAAI,CAAC,EAAE,MAAM,CAAC;IAChB,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,EAAE;QACX,SAAS,EAAE,MAAM,CAAC;QACd,MAAM,EAAE,MAAM,CAAC;QACnB,KAAK,CAAC,EAAE,OAAO,CAAC;QACZ,KAAK,CAAC,EAAE,MAAM,CAAC;QACf,IAAI,CAAC,EAAE,MAAM,CAAC;QAClB,gBAAgB,CAAC,EAAE,MAAM,CAAC;KAC3B,CAAA;CACH;yBA3BsB,6BAA6B"}
1
+ {"version":3,"file":"question.d.ts","sourceRoot":"","sources":["../../../../src/components/unit-option-entry/question.js"],"names":[],"mappings":"AAOA;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AAEH;IACC,gCAAgC;IAChC,SADW,KAAK,CAAC,UAAU,CAAC,CACpB;IAqBP,0BAAgD;IAEhD,WAAkB;IAClB,yBAA+C;IAGhD;;;;;;;;;;;;OAYG;IACH,gDAVW,OAAO,UAAU,EAAE,OAAO,mBAC1B,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,YACvB,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,WACvB,OAAO,iBAAiB,EAAE,+BAA+B,GACvD,OAAO,WAAW,EAAE,iBAAiB,GAAG;QAChD,QAAQ,EAAE,OAAO,WAAW,EAAE,iBA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CAAA;KAAE;WAChB;QAAE,IAAI,EAAE,MAAM,CAAA;KAAE,GAAG;QAAE,IAAI,EAAE,MAAM,CAAA;KAAE;;eAC1B,UAAU,EAAE;;;;UAKrB,MAAM;UACN,MAAM;;;;;;eA0KN,MAAM;iBACN,MAAM;sBACN,OAAO;;;;;;;yBAOR,CAAC,MAAM,EAAE,UAAU,KAAK,OAAO,CAAC,IAAI,CAAC"}
1
+ {"version":3,"file":"controller.d.ts","sourceRoot":"","sources":["../../src/controller.js"],"names":[],"mappings":"AAwEA;;;GAGG;AACH,qCAHW,MAAM,OAKhB;AAED;;;;;GAKG;AACH,sDAHW,MAAM,YACN,MAAM,gBA8DhB;AAED;;;;GAIG;AACH,2DA0CC;AAED;;;;;;;;;;GAUG;AAEH;;GAEG;AAEH;;;;GAIG;AACH,oCAJW,UAAU,gCACV,OAAO,OAuFjB;sBAtSY,OAAO,sBAAsB,EAAE,OAAO;uBACtC,OAAO,yBAAyB,EAAE,QAAQ;;;aAMzC,MAAM;YACN,MAAM;UAEjB;QAAiC,IAAI,EAA1B,KAAK,CAAE,OAAO,CAAC;KAC5B;;;SAIa;QAAE,IAAI,EAAE,MAAM,CAAA;KAAE;WAChB;QAAE,IAAI,EAAE,MAAM,CAAA;KAAE,GAAG;QAAE,IAAI,EAAE,MAAM,CAAA;KAAE;;eAC1B,UAAU,EAAE;;;;UAKrB,MAAM;UACN,MAAM;;;;;;eA0KN,MAAM;iBACN,MAAM;sBACN,OAAO;;;;;;;yBAOR,CAAC,MAAM,EAAE,UAAU,KAAK,OAAO,CAAC,IAAI,CAAC"}
@@ -23,6 +23,8 @@ export * from "./lib/utils.js";
23
23
  export * from "./middleware/build-get-journey.js";
24
24
  export * from "./middleware/redirect-to-unanswered-question.js";
25
25
  export * from "./questions/options-question.js";
26
+ export * from "./questions/question-props.ts";
27
+ export * from "./questions/question-types.ts";
26
28
  export * from "./validator/address-validator.js";
27
29
  export * from "./validator/base-validator.js";
28
30
  export * from "./validator/conditional-required-validator.js";
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.js"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;4BAC4B,kCAAkC;0BACpC,+BAA+B;2BAC9B,gCAAgC;4BAC/B,iCAAiC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.js"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;4BAC4B,kCAAkC;0BACpC,+BAA+B;2BAC9B,gCAAgC;4BAC/B,iCAAiC"}
@@ -16,4 +16,11 @@ export function capitalize(str: string | any): string;
16
16
  * @returns {string}
17
17
  */
18
18
  export function trimTrailingSlash(str?: string): string;
19
+ /**
20
+ * Convert a value to an array, unless it is already
21
+ *
22
+ * @param {T|T[]} value
23
+ * @template T
24
+ */
25
+ export function toArray<T>(value: T | T[]): T[];
19
26
  //# sourceMappingURL=utils.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../../src/lib/utils.js"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,8BAHW,MAAM,GACJ,MAAM,CAMlB;AAED;;;GAGG;AACH,gCAHW,MAAM,GAAC,GAAG,GACR,MAAM,CAKlB;AAED;;;;;GAKG;AACH,wCAHW,MAAM,GACJ,MAAM,CAKlB"}
1
+ {"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../../src/lib/utils.js"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,8BAHW,MAAM,GACJ,MAAM,CAMlB;AAED;;;GAGG;AACH,gCAHW,MAAM,GAAC,GAAG,GACR,MAAM,CAKlB;AAED;;;;;GAKG;AACH,wCAHW,MAAM,GACJ,MAAM,CAKlB;AAED;;;;;GAKG;AACH,wBAFa,CAAC,SADH,CAAC,GAAC,CAAC,EAAE,OAKf"}
@@ -39,10 +39,10 @@ export default class OptionsQuestion extends Question {
39
39
  * @param {import('#journey').Journey} journey - the journey we are in
40
40
  * @param {Record<string, unknown>} [customViewData] additional data to send to view
41
41
  * @param {Record<string, unknown>} [payload]
42
- * @param {import('#src/questions/question-types.d.ts').PrepQuestionForRenderingOptions} options
42
+ * @param {import('#question-types').PrepQuestionForRenderingOptions} options
43
43
  * @returns {import('./question').QuestionViewModel} QuestionViewModel
44
44
  */
45
- prepQuestionForRendering(section: import("#section").Section, journey: import("#journey").Journey, customViewData?: Record<string, unknown>, payload?: Record<string, unknown>, options: import("#src/questions/question-types.d.ts").PrepQuestionForRenderingOptions): any;
45
+ prepQuestionForRendering(section: import("#section").Section, journey: import("#journey").Journey, customViewData?: Record<string, unknown>, payload?: Record<string, unknown>, options: import("#question-types").PrepQuestionForRenderingOptions): any;
46
46
  }
47
47
  export type Option = {
48
48
  text: string;
@@ -1 +1 @@
1
- {"version":3,"file":"options-question.d.ts","sourceRoot":"","sources":["../../../src/questions/options-question.js"],"names":[],"mappings":"AAOA;;;;;;;;;;;;;;;;;;;;;;GAsBG;AAEH;;GAEG;AAEH;IAIC;;;OAGG;IACH,oBAHW,OAAO,iBAAiB,EAAE,kBAAkB,EAgBtD;IApBD,4BAA4B;IAC5B,SADW,KAAK,CAAC,MAAM,CAAC,CAChB;IAkBP,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,oCAAoC,EAAE,+BAA+B,OAmDtF;CAmCD;qBA9IY;IACR,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,EAAE,MAAM,CAAC;IACZ,IAAI,CAAC,EAAE,MAAM,CAAC;IAChB,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;QACd,YAAY,CAAC,EAAE,MAAM,CAAC;QACtB,IAAI,CAAC,EAAE,MAAM,CAAC;QAClB,KAAK,CAAC,EAAE,OAAO,CAAC;QACZ,KAAK,CAAC,EAAE,MAAM,CAAC;QACf,IAAI,CAAC,EAAE,MAAM,CAAA;KAClB,CAAC;IACA,eAAe,CAAC,EAAE;QAChB,IAAI,EAAE,MAAM,CAAC;KAChB,CAAA;CACH;+BAIU,GAAsC,GAAG;IAAE,QAAQ,EAAE;QAAE,OAAO,EAAE,MAAM,EAAE,CAAA;KAAE,CAAA;CAAE;yBA/BhE,eAAe"}
1
+ {"version":3,"file":"options-question.d.ts","sourceRoot":"","sources":["../../../src/questions/options-question.js"],"names":[],"mappings":"AAQA;;;;;;;;;;;;;;;;;;;;;;GAsBG;AAEH;;GAEG;AAEH;IAIC;;;OAGG;IACH,oBAHW,OAAO,iBAAiB,EAAE,kBAAkB,EAgBtD;IApBD,4BAA4B;IAC5B,SADW,KAAK,CAAC,MAAM,CAAC,CAChB;IAkBP,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,iBAAiB,EAAE,+BAA+B,OAmDnE;CAmCD;qBA9IY;IACR,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,EAAE,MAAM,CAAC;IACZ,IAAI,CAAC,EAAE,MAAM,CAAC;IAChB,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;QACd,YAAY,CAAC,EAAE,MAAM,CAAC;QACtB,IAAI,CAAC,EAAE,MAAM,CAAC;QAClB,KAAK,CAAC,EAAE,OAAO,CAAC;QACZ,KAAK,CAAC,EAAE,MAAM,CAAC;QACf,IAAI,CAAC,EAAE,MAAM,CAAA;KAClB,CAAC;IACA,eAAe,CAAC,EAAE;QAChB,IAAI,EAAE,MAAM,CAAC;KAChB,CAAA;CACH;+BAIU,GAAsC,GAAG;IAAE,QAAQ,EAAE;QAAE,OAAO,EAAE,MAAM,EAAE,CAAA;KAAE,CAAA;CAAE;yBAhChE,eAAe"}
@@ -0,0 +1,113 @@
1
+ import type { QuestionParameters } from '#question-types';
2
+ type QuestionTypes = 'boolean' | 'checkbox' | 'date' | 'date-period' | 'date-time' | 'email' | 'manage-list' | 'multi-field-input' | 'number' | 'radio' | 'select' | 'single-line-input' | 'site-address' | 'text-entry' | 'text-entry-redact' | 'unit-option';
3
+ type CommonQuestionProps = Omit<QuestionParameters, 'viewFolder'> & {
4
+ type: QuestionTypes;
5
+ };
6
+ type Option = {
7
+ text: string;
8
+ value: string;
9
+ hint?: object;
10
+ checked?: boolean | undefined;
11
+ attributes?: Record<string, string>;
12
+ behaviour?: 'exclusive';
13
+ conditional?: {
14
+ question: string;
15
+ type: string;
16
+ fieldName: string;
17
+ inputClasses?: string;
18
+ html?: string;
19
+ value?: unknown;
20
+ label?: string;
21
+ hint?: string;
22
+ };
23
+ conditionalText?: {
24
+ html: string;
25
+ };
26
+ } | {
27
+ divider?: string;
28
+ };
29
+ interface InputField {
30
+ fieldName: string;
31
+ label: string;
32
+ formatJoinString?: string;
33
+ hint?: string;
34
+ }
35
+ interface UnitOption {
36
+ text: string;
37
+ value: string;
38
+ hint?: object;
39
+ checked?: boolean | undefined;
40
+ attributes?: Record<string, string>;
41
+ behaviour?: 'exclusive';
42
+ conditional: {
43
+ fieldName: string;
44
+ suffix: string;
45
+ value?: unknown;
46
+ label?: string;
47
+ hint?: string;
48
+ conversionFactor?: number;
49
+ };
50
+ }
51
+ type BooleanQuestionProps = CommonQuestionProps & {
52
+ type: 'boolean';
53
+ options?: Option[];
54
+ interfaceType?: 'checkbox' | 'radio';
55
+ };
56
+ type CheckboxQuestionProps = CommonQuestionProps & {
57
+ type: 'checkbox';
58
+ options: Option[];
59
+ };
60
+ type DateQuestionProps = CommonQuestionProps & {
61
+ type: 'date';
62
+ };
63
+ type DatePeriodQuestionProps = CommonQuestionProps & {
64
+ type: 'date-period';
65
+ };
66
+ type DateTimeQuestionProps = CommonQuestionProps & {
67
+ type: 'date-time';
68
+ };
69
+ type ManageListQuestionProps = CommonQuestionProps & {
70
+ type: 'manage-list';
71
+ };
72
+ type EmailQuestionProps = CommonQuestionProps & {
73
+ type: 'email';
74
+ };
75
+ type MultiFieldInputQuestionProps = CommonQuestionProps & {
76
+ type: 'multi-field-input';
77
+ inputAttributes?: Record<string, string>;
78
+ inputFields: InputField[];
79
+ formatType?: 'contactDetails' | 'standard';
80
+ };
81
+ type NumberEntryQuestionProps = CommonQuestionProps & {
82
+ type: 'number';
83
+ suffix?: string;
84
+ };
85
+ type RadioQuestionProps = CommonQuestionProps & {
86
+ type: 'radio';
87
+ options: Option[];
88
+ };
89
+ type SelectQuestionProps = CommonQuestionProps & {
90
+ type: 'select';
91
+ options: Option[];
92
+ };
93
+ type SingleLineInputQuestionProps = CommonQuestionProps & {
94
+ type: 'single-line-input';
95
+ inputAttributes?: Record<string, string>;
96
+ };
97
+ type SiteAddressQuestionProps = CommonQuestionProps & {
98
+ type: 'site-address';
99
+ };
100
+ type TextEntryQuestionProps = CommonQuestionProps & {
101
+ type: 'text-entry';
102
+ };
103
+ type TextEntryRedactQuestionProps = CommonQuestionProps & {
104
+ type: 'text-entry-redact';
105
+ };
106
+ type UnitOptionEntryQuestionProps = CommonQuestionProps & {
107
+ type: 'unit-option';
108
+ conditionalFieldName: string;
109
+ options: UnitOption[];
110
+ };
111
+ export type QuestionProps = BooleanQuestionProps | CheckboxQuestionProps | DateQuestionProps | DatePeriodQuestionProps | DateTimeQuestionProps | ManageListQuestionProps | EmailQuestionProps | MultiFieldInputQuestionProps | NumberEntryQuestionProps | RadioQuestionProps | SelectQuestionProps | SingleLineInputQuestionProps | SiteAddressQuestionProps | TextEntryQuestionProps | TextEntryRedactQuestionProps | UnitOptionEntryQuestionProps;
112
+ export {};
113
+ //# sourceMappingURL=question-props.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"question-props.d.ts","sourceRoot":"","sources":["../../../src/questions/question-props.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,iBAAiB,CAAC;AAE1D,KAAK,aAAa,GACf,SAAS,GACT,UAAU,GACV,MAAM,GACN,aAAa,GACb,WAAW,GACX,OAAO,GACP,aAAa,GACb,mBAAmB,GACnB,QAAQ,GACR,OAAO,GACP,QAAQ,GACR,mBAAmB,GACnB,cAAc,GACd,YAAY,GACZ,mBAAmB,GACnB,aAAa,CAAC;AAEjB,KAAK,mBAAmB,GAAG,IAAI,CAAC,kBAAkB,EAAE,YAAY,CAAC,GAAG;IACnE,IAAI,EAAE,aAAa,CAAC;CACpB,CAAC;AAEF,KAAK,MAAM,GACR;IACA,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,EAAE,MAAM,CAAC;IACd,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,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;QACb,QAAQ,EAAE,MAAM,CAAC;QACjB,IAAI,EAAE,M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AC;AAEF,KAAK,wBAAwB,GAAG,mBAAmB,GAAG;IACrD,IAAI,EAAE,cAAc,CAAC;CACrB,CAAC;AAEF,KAAK,sBAAsB,GAAG,mBAAmB,GAAG;IACnD,IAAI,EAAE,YAAY,CAAC;CACnB,CAAC;AAEF,KAAK,4BAA4B,GAAG,mBAAmB,GAAG;IACzD,IAAI,EAAE,mBAAmB,CAAC;CAC1B,CAAC;AAEF,KAAK,4BAA4B,GAAG,mBAAmB,GAAG;IACzD,IAAI,EAAE,aAAa,CAAC;IACpB,oBAAoB,EAAE,MAAM,CAAC;IAC7B,OAAO,EAAE,UAAU,EAAE,CAAC;CACtB,CAAC;AAEF,MAAM,MAAM,aAAa,GACtB,oBAAoB,GACpB,qBAAqB,GACrB,iBAAiB,GACjB,uBAAuB,GACvB,qBAAqB,GACrB,uBAAuB,GACvB,kBAAkB,GAClB,4BAA4B,GAC5B,wBAAwB,GACxB,kBAAkB,GAClB,mBAAmB,GACnB,4BAA4B,GAC5B,wBAAwB,GACxB,sBAAsB,GACtB,4BAA4B,GAC5B,4BAA4B,CAAC"}
@@ -0,0 +1,49 @@
1
+ import type { RouteParams } from '#src/journey/journey-types.d.ts';
2
+ import type ManageListQuestion from '#src/components/manage-list/question.js';
3
+ import type BaseValidator from '../validator/base-validator.js';
4
+ import type { JourneyResponse } from '../journey/journey-response.js';
5
+ export interface QuestionParameters {
6
+ title: string;
7
+ question: string;
8
+ viewFolder: string;
9
+ fieldName: string;
10
+ url?: string;
11
+ pageTitle?: string;
12
+ description?: string;
13
+ validators?: BaseValidator[];
14
+ html?: string;
15
+ hint?: string;
16
+ interfaceType?: string;
17
+ shouldDisplay?: (response: JourneyResponse) => boolean;
18
+ autocomplete?: string;
19
+ editable?: boolean;
20
+ actionLink?: ActionLink;
21
+ viewData?: Record<string, any>;
22
+ }
23
+ export interface ActionLink {
24
+ text: string;
25
+ href: string;
26
+ }
27
+ export interface QuestionViewModel {
28
+ question: {
29
+ value: string | number | Record<string, any>;
30
+ question: string;
31
+ fieldName: string;
32
+ pageTitle: string;
33
+ description?: string;
34
+ html?: string;
35
+ };
36
+ layoutTemplate: string;
37
+ pageCaption: string;
38
+ continueButtonText: string;
39
+ backLink: string;
40
+ showBackToListLink: string;
41
+ listLink: string;
42
+ journeyTitle: string;
43
+ [k: string]: any;
44
+ }
45
+ export interface PrepQuestionForRenderingOptions {
46
+ params: RouteParams;
47
+ manageListQuestion?: ManageListQuestion;
48
+ }
49
+ //# sourceMappingURL=question-types.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"question-types.d.ts","sourceRoot":"","sources":["../../../src/questions/question-types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,iCAAiC,CAAC;AACnE,OAAO,KAAK,kBAAkB,MAAM,yCAAyC,CAAC;AAC9E,OAAO,KAAK,aAAa,MAAM,gCAAgC,CAAC;AAChE,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,gCAAgC,CAAC;AAEtE,MAAM,WAAW,kBAAkB;IAClC,KAAK,EAAE,MAAM,CAAC;IACd,QAAQ,EAAE,MAAM,CAAC;IACjB,UAAU,EAAE,MAAM,CAAC;IACnB,SAAS,EAAE,MAAM,CAAC;IAClB,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,UAAU,CAAC,EAAE,aAAa,EAAE,CAAC;IAC7B,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,aAAa,CAAC,EAAE,CAAC,QAAQ,EAAE,eAAe,KAAK,OAAO,CAAC;IACvD,YAAY,CAAC,EAAE,MAAM,CAAC;IAEtB,QAAQ,CAAC,EAAE,OAAO,CAAC;IAEnB,UAAU,CAAC,EAAE,UAAU,CAAC;IAExB,QAAQ,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC;CAC/B;AAED,MAAM,WAAW,UAAU;IAC1B,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,MAAM,CAAC;CACb;AAED,MAAM,WAAW,iBAAiB;IACjC,QAAQ,EAAE;QACT,KAAK,EAAE,MAAM,GAAG,MAAM,GAAG,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC;QAC7C,QAAQ,EAAE,MAAM,CAAC;QACjB,SAAS,EAAE,MAAM,CAAC;QAClB,SAAS,EAAE,MAAM,CAAC;QAClB,WAAW,CAAC,EAAE,MAAM,CAAC;QACrB,IAAI,CAAC,EAAE,MAAM,CAAC;KACd,CAAC;IACF,cAAc,EAAE,MAAM,CAAC;IACvB,WAAW,EAAE,MAAM,CAAC;IACpB,kBAAkB,EAAE,MAAM,CAAC;IAC3B,QAAQ,EAAE,MAAM,CAAC;IACjB,kBAAkB,EAAE,MAAM,CAAC;IAC3B,QAAQ,EAAE,MAAM,CAAC;IACjB,YAAY,EAAE,MAAM,CAAC;IACrB,CAAC,CAAC,EAAE,MAAM,GAAG,GAAG,CAAC;CACjB;AAED,MAAM,WAAW,+BAA+B;IAC/C,MAAM,EAAE,WAAW,CAAC;IACpB,kBAAkB,CAAC,EAAE,kBAAkB,CAAC;CACxC"}
@@ -132,10 +132,10 @@ export class Question {
132
132
  * @param {Journey} journey - the journey we are in
133
133
  * @param {Record<string, unknown>} [customViewData] additional data to send to view
134
134
  * @param {unknown} [payload]
135
- * @param {import('./question-types.d.ts').PrepQuestionForRenderingOptions} [options] - required to support manage list question
135
+ * @param {import('#question-types').PrepQuestionForRenderingOptions} [options] - required to support manage list question
136
136
  * @returns {QuestionViewModel}
137
137
  */
138
- prepQuestionForRendering(section: Section, journey: Journey, customViewData?: Record<string, unknown>, payload?: unknown, options?: import("./question-types.d.ts").PrepQuestionForRenderingOptions): QuestionViewModel;
138
+ prepQuestionForRendering(section: Section, journey: Journey, customViewData?: Record<string, unknown>, payload?: unknown, options?: import("#question-types").PrepQuestionForRenderingOptions): QuestionViewModel;
139
139
  /**
140
140
  * The answer to this question for use in the viewModel
141
141
  *
@@ -156,10 +156,10 @@ export class Question {
156
156
  * Get the answers object from the journey response, which may be nested in an array for manage list questions
157
157
  *
158
158
  * @param {JourneyResponse} response
159
- * @param {import('./question-types.d.ts').PrepQuestionForRenderingOptions} [options]
159
+ * @param {import('#question-types').PrepQuestionForRenderingOptions} [options]
160
160
  * @returns {Record<string, any>}
161
161
  */
162
- answerObjectFromJourneyResponse(response: JourneyResponse, { params, manageListQuestion }?: import("./question-types.d.ts").PrepQuestionForRenderingOptions): Record<string, any>;
162
+ answerObjectFromJourneyResponse(response: JourneyResponse, { params, manageListQuestion }?: import("#question-types").PrepQuestionForRenderingOptions): Record<string, any>;
163
163
  /**
164
164
  * renders the question
165
165
  * @param {import('express').Response} res - the express response
@@ -1 +1 @@
1
- {"version":3,"file":"question.d.ts","sourceRoot":"","sources":["../../../src/questions/question.js"],"names":[],"mappings":"AAOA;;;;;;;GAOG;AAEH;;;;;;;;GAQG;AAEH;;;;;;;;;;;GAWG;AAEH;;;GAGG;AACH;IAqDC;;;OAGG;IACH,yLAHW,OAAO,iBAAiB,EAAE,kBAAkB,oBAC5C,MAAM,CAAC,MAAM,WAAW,EAsDlC;IA5GD,6EAA6E;IAC7E,WADW,MAAM,CACP;IACV,sDAAsD;IACtD,OADW,MAAM,CACX;IACN,+DAA+D;IAC/D,UADW,MAAM,CACR;IACT,mFAAmF;IACnF,aADW,MAAM,GAAC,SAAS,CACf;IACZ,iDAAiD;IACjD,YADW,MAAM,CACN;IACX,qHAAqH;IACrH,WADW,MAAM,CACP;IACV,6FAA6F;IAC7F,UADW,OAAO,CACF;IAChB,iGAAiG;IACjG,YADW,KAAK,CAAE,MAAa,CAAC,CAChB;IAChB,2DAA2D;IAC3D,MADW,MAAM,GAAC,SAAS,CACtB;IACL,sEAAsE;IACtE,oBADW,OAAO,CACQ;IAC1B,oDAAoD;IACpD,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,kCAHW,iBAAiB,GACf,IAAI,CAShB;IAED;;;;;;;OAOG;IACH,4CAJW,OAAO,WADP,OAAO,kFAGL,iBAAiB,GAAC,SAAS,CAmBvC;IAED;;;;;;OAMG,CACH,yCAHW,eAAe,GACb,OAAO,CAAC;QAAE,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAA;KAAE,CAAC,CAczD;IAED;;;;;;OAMG,CACH,2CAHW,OAAO,WADP,OAAO,GAEL,iBAAiB,GAAG,SAAS,CAIzC;IAED;;;;;;;;;OASG;IACH,sCANW,OAAO,kBACP,MAAM,mBACN,MAAM,GACJ,IAAI,CAQhB;IAED;;;;;;;;;;;;;;OAcG;IACH,wDAZW,OAAO,UACP,MAAM,uBACJ,KAAK,CAAC;QACd,GAAG,EAAE,MAAM,CAAC;QACZ,KAAK,EAAE,MAAM,GAAG,MAAM,CAAC;QACvB,MAAM,EAAE;YACN,IAAI,EAAE,MAAM,CAAC;YACb,IAAI,EAAE,MAAM,CAAC;YACb,kBAAkB,EAAE,MAAM,CAAC;SAC5B,CAAC;KACH,CAAC,CAaJ;IAED;;;;;;OAMG;IACH,2CAJW,OAAO,UADP,MAAM,GAGJ,UAAU,GAAC,UAAU,EAAE,GAAC,SAAS,CAqB7C;IAED;;;OAGG;IACH,eAHW,OAAO,GACL,OAAO,CAInB;IAED;;OAEG;IACH,cAFa,OAAO,CASnB;IACD;;;OAGG;IACH,4BAHW,MAAM,GACJ,OAAO,CAMnB;IAED;;;;OAIG;IACH,4BAJW,eAAe,cACf,MAAM,GACJ,OAAO,CAInB;;CACD;;WA/ca,MAAM;cACN,MAAM;eACN,MAAM;eACN,MAAM;;;;gCAMP,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC;gCAdH,qBAAqB;6BAFxB,UAAU;6BAFV,UAAU;qCACF,mBAAmB;gCAExB,kBAAkB"}
1
+ {"version":3,"file":"question.d.ts","sourceRoot":"","sources":["../../../src/questions/question.js"],"names":[],"mappings":"AAOA;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kBAAkB,EAAE,MAAM,CAAC;SAC5B,CAAC;KACH,CAAC,CAaJ;IAED;;;;;;OAMG;IACH,2CAJW,OAAO,UADP,MAAM,GAGJ,UAAU,GAAC,UAAU,EAAE,GAAC,SAAS,CAqB7C;IAED;;;OAGG;IACH,eAHW,OAAO,GACL,OAAO,CAInB;IAED;;OAEG;IACH,cAFa,OAAO,CASnB;IACD;;;OAGG;IACH,4BAHW,MAAM,GACJ,OAAO,CAMnB;IAED;;;;OAIG;IACH,4BAJW,eAAe,cACf,MAAM,GACJ,OAAO,CAInB;;CACD;;WA/ca,MAAM;cACN,MAAM;eACN,MAAM;eACN,MAAM;;;;gCAMP,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC;gCAdH,qBAAqB;6BAFxB,UAAU;6BAFV,UAAU;qCACF,mBAAmB;gCAExB,kBAAkB"}
@@ -1 +1 @@
1
- {"version":3,"file":"conditional-required-validator.d.ts","sourceRoot":"","sources":["../../../src/validator/conditional-required-validator.js"],"names":[],"mappings":"AAIA;;GAEG;AAEH;;;GAGG;AACH;IAMC;;;OAGG;IACH,2BAFW,MAAM,EAQhB;IAED;;;OAGG;IACH,sBAFW,QAAQ,OAclB;IAED,+DAEC;IAED,2FAKC;CACD;;0BAxDyB,qBAAqB"}
1
+ {"version":3,"file":"conditional-required-validator.d.ts","sourceRoot":"","sources":["../../../src/validator/conditional-required-validator.js"],"names":[],"mappings":"AAKA;;GAEG;AAEH;;;GAGG;AACH;IAMC;;;OAGG;IACH,2BAFW,MAAM,EAQhB;IAED;;;OAGG;IACH,sBAFW,QAAQ,OAclB;IAED,+DAEC;IAED,2FAKC;CACD;;0BAzDyB,qBAAqB"}
@@ -1 +1 @@
1
- {"version":3,"file":"unit-option-entry-validator.d.ts","sourceRoot":"","sources":["../../../src/validator/unit-option-entry-validator.js"],"names":[],"mappings":"AAIA;;GAEG;AAEH;;;GAGG;AACH;IACC;;;;;;;;OAQG;IAEH,oEARG;QAAwB,YAAY;QACZ,IAAI;QACJ,GAAG;QACH,GAAG;QACJ,KAAK;QACJ,YAAY;KAAC,EAWvC;IALA,aAA2B;IAC3B,wBAAc;IACd,wBAAc;IACd,WAAkB;IAClB,qBAA0D;IAG3D;;;OAGG;IACH,sBAFW,QAAQ,OA4ClB;IAED,2FAKC;CACD;;0BArFyB,qBAAqB"}
1
+ {"version":3,"file":"unit-option-entry-validator.d.ts","sourceRoot":"","sources":["../../../src/validator/unit-option-entry-validator.js"],"names":[],"mappings":"AAKA;;GAEG;AAEH;;;GAGG;AACH;IACC;;;;;;;;OAQG;IAEH,oEARG;QAAwB,YAAY;QACZ,IAAI;QACJ,GAAG;QACH,GAAG;QACJ,KAAK;QACJ,YAAY;KAAC,EAWvC;IALA,aAA2B;IAC3B,wBAAc;IACd,wBAAc;IACd,WAAkB;IAClB,qBAA0D;IAG3D;;;OAGG;IACH,sBAFW,QAAQ,OA4ClB;IAED,2FAKC;CACD;;0BAtFyB,qBAAqB"}
@@ -1 +1 @@
1
- {"version":3,"file":"valid-option-validator.d.ts","sourceRoot":"","sources":["../../../src/validator/valid-option-validator.js"],"names":[],"mappings":"AAIA;;GAEG;AAEH;;;GAGG;AACH;IACC;;;OAGG;IACH,2BAFW,MAAM,EAUhB;IAED;;;OAGG;IACH,sBAFW,eAAe,+CAUzB;CACD;;0BAtCyB,qBAAqB"}
1
+ {"version":3,"file":"valid-option-validator.d.ts","sourceRoot":"","sources":["../../../src/validator/valid-option-validator.js"],"names":[],"mappings":"AAKA;;GAEG;AAEH;;;GAGG;AACH;IACC;;;OAGG;IACH,2BAFW,MAAM,EAUhB;IAED;;;OAGG;IACH,sBAFW,eAAe,+CAUzB;CACD;;0BAvCyB,qBAAqB"}