@planning-inspectorate/dynamic-forms 3.15.1 → 3.15.2

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 (51) hide show
  1. package/package.json +1 -1
  2. package/src/components/address/question.js +1 -1
  3. package/src/components/boolean/question.js +1 -14
  4. package/src/components/checkbox/question.js +1 -10
  5. package/src/components/date/question.js +3 -4
  6. package/src/components/date-period/question.js +12 -10
  7. package/src/components/date-time/question.js +3 -5
  8. package/src/components/email/question.js +1 -5
  9. package/src/components/manage-list/question.js +1 -1
  10. package/src/components/multi-field-input/question.js +3 -3
  11. package/src/components/number-entry/question.js +3 -5
  12. package/src/components/radio/question.js +1 -17
  13. package/src/components/select/question.js +1 -16
  14. package/src/components/single-line-input/question.js +1 -4
  15. package/src/components/text-entry/question.js +3 -5
  16. package/src/components/text-entry-redact/question.js +3 -10
  17. package/src/components/unit-option-entry/question.js +3 -6
  18. package/src/questions/question-props.d.ts +131 -28
  19. package/types/src/components/address/question.d.ts +2 -2
  20. package/types/src/components/address/question.d.ts.map +1 -1
  21. package/types/src/components/boolean/question.d.ts +3 -30
  22. package/types/src/components/boolean/question.d.ts.map +1 -1
  23. package/types/src/components/checkbox/question.d.ts +2 -21
  24. package/types/src/components/checkbox/question.d.ts.map +1 -1
  25. package/types/src/components/date/question.d.ts +3 -4
  26. package/types/src/components/date/question.d.ts.map +1 -1
  27. package/types/src/components/date-period/question.d.ts +11 -15
  28. package/types/src/components/date-period/question.d.ts.map +1 -1
  29. package/types/src/components/date-time/question.d.ts +4 -6
  30. package/types/src/components/date-time/question.d.ts.map +1 -1
  31. package/types/src/components/email/question.d.ts +4 -0
  32. package/types/src/components/email/question.d.ts.map +1 -1
  33. package/types/src/components/manage-list/question.d.ts +2 -2
  34. package/types/src/components/manage-list/question.d.ts.map +1 -1
  35. package/types/src/components/multi-field-input/question.d.ts +5 -5
  36. package/types/src/components/multi-field-input/question.d.ts.map +1 -1
  37. package/types/src/components/number-entry/question.d.ts +4 -6
  38. package/types/src/components/number-entry/question.d.ts.map +1 -1
  39. package/types/src/components/radio/question.d.ts +2 -37
  40. package/types/src/components/radio/question.d.ts.map +1 -1
  41. package/types/src/components/select/question.d.ts +2 -35
  42. package/types/src/components/select/question.d.ts.map +1 -1
  43. package/types/src/components/single-line-input/question.d.ts +4 -7
  44. package/types/src/components/single-line-input/question.d.ts.map +1 -1
  45. package/types/src/components/text-entry/question.d.ts +4 -6
  46. package/types/src/components/text-entry/question.d.ts.map +1 -1
  47. package/types/src/components/text-entry-redact/question.d.ts +9 -16
  48. package/types/src/components/text-entry-redact/question.d.ts.map +1 -1
  49. package/types/src/components/unit-option-entry/question.d.ts +7 -2
  50. package/types/src/components/unit-option-entry/question.d.ts.map +1 -1
  51. package/types/src/questions/question-props.d.ts +131 -28
@@ -3,11 +3,10 @@
3
3
  */
4
4
  export class DateQuestion extends Question {
5
5
  /**
6
- * @param {import('#question-types').QuestionParameters} params
7
- * @param {string} [params.dateFormat]
6
+ * @param {import('../../questions/question-props.d.ts').DateQuestionParams} params
8
7
  */
9
- constructor({ dateFormat, ...params }: import("#question-types").QuestionParameters);
10
- dateFormat: any;
8
+ constructor({ dateFormat, ...parentParams }: import("../../questions/question-props.d.ts").DateQuestionParams);
9
+ dateFormat: string;
11
10
  /**
12
11
  * Get the data to save from the request, returns an object of answers
13
12
  * @param {import('express').Request} req
@@ -1 +1 @@
1
- {"version":3,"file":"question.d.ts","sourceRoot":"","sources":["../../../../src/components/date/question.js"],"names":[],"mappings":"AAKA;;GAEG;AACH;IACC;;;OAGG;IACH,uCAHW,OAAO,iBAAiB,EAAE,kBAAkB,EAStD;IADA,gBAA4B;IAW7B;;;;;OAKG,CACH,mBAJW,OAAO,SAAS,EAAE,OAAO,mBACzB,OAAO,mBAAmB,EAAE,eAAe,GACzC,OAAO,CAAE,MAAM,CAAC,CAY5B;IAED;;MAwBC;CAoBD;;yBA1FwB,6BAA6B"}
1
+ {"version":3,"file":"question.d.ts","sourceRoot":"","sources":["../../../../src/components/date/question.js"],"names":[],"mappings":"AAKA;;GAEG;AACH;IACC;;OAEG;IACH,6CAFW,OAAO,qCAAqC,EAAE,kBAAkB,EAQ1E;IADA,mBAA4B;IAW7B;;;;;OAKG,CACH,mBAJW,OAAO,SAAS,EAAE,OAAO,mBACzB,OAAO,mBAAmB,EAAE,eAAe,GACzC,OAAO,CAAE,MAAM,CAAC,CAY5B;IAED;;MAwBC;CAoBD;;yBAzFwB,6BAA6B"}
@@ -4,22 +4,18 @@
4
4
  */
5
5
  export class DatePeriodQuestion extends Question {
6
6
  /**
7
- * @param {import('#question-types').QuestionParameters} params
8
- * @param {string} [params.dateFormat]
9
- * @param {{start: string, end: string}} [params.labels]
10
- * @param {string} [params.hint]
11
- * @param {string} [params.hintStart]
12
- * @param {string} [params.hintEnd]
13
- * @param {{hour: number, minute: number, second: number}} [params.startTime]
14
- * @param {{hour: number, minute: number, second: number}} [params.endTime]
7
+ * @param {import('../../questions/question-props.d.ts').DatePeriodQuestionParams} params
15
8
  */
16
- constructor({ dateFormat, hint, labels, hintStart, startTime, hintEnd, endTime, ...params }: import("#question-types").QuestionParameters);
17
- dateFormat: any;
18
- labels: any;
19
- hintStart: any;
20
- hintEnd: any;
21
- startTime: any;
22
- endTime: any;
9
+ constructor({ dateFormat, hint, labels, hintStart, startTime, hintEnd, endTime, ...parentParams }: import("../../questions/question-props.d.ts").DatePeriodQuestionParams);
10
+ dateFormat: string;
11
+ labels: {
12
+ start: string;
13
+ end: string;
14
+ };
15
+ hintStart: string | undefined;
16
+ hintEnd: string | undefined;
17
+ startTime: import("../../questions/question-props.d.ts").TimeComponents;
18
+ endTime: import("../../questions/question-props.d.ts").TimeComponents;
23
19
  /**
24
20
  * Get the data to save from the request, returns an object of answers
25
21
  * @param {import('express').Request} req
@@ -1 +1 @@
1
- {"version":3,"file":"question.d.ts","sourceRoot":"","sources":["../../../../src/components/date-period/question.js"],"names":[],"mappings":"AAOA;;;GAGG;AACH;IACC;;;;;;;;;OASG;IACH,6FATW,OAAO,iBAAiB,EAAE,kBAAkB,EAqBtD;IAPA,gBAA4B;IAC5B,YAAsD;IAEtD,eAA0B;IAC1B,aAAsB;IACtB,eAA+D;IAC/D,aAA2D;IAkB5D;;;;;OAKG,CACH,mBAJW,OAAO,SAAS,EAAE,OAAO,mBACzB,OAAO,mBAAmB,EAAE,eAAe,GACzC,OAAO,CAAE,MAAM,CAAC,CAgC5B;IAED;;MAuCC;CAyCD;;yBAxKwB,WAAW"}
1
+ {"version":3,"file":"question.d.ts","sourceRoot":"","sources":["../../../../src/components/date-period/question.js"],"names":[],"mappings":"AAOA;;;GAGG;AACH;IACC;;OAEG;IACH,mGAFW,OAAO,qCAAqC,EAAE,wBAAwB,EAuBhF;IAPA,mBAA4B;IAC5B;;;MAAsD;IAEtD,8BAA0B;IAC1B,4BAAsB;IACtB,wEAA+D;IAC/D,sEAA2D;IAkB5D;;;;;OAKG,CACH,mBAJW,OAAO,SAAS,EAAE,OAAO,mBACzB,OAAO,mBAAmB,EAAE,eAAe,GACzC,OAAO,CAAE,MAAM,CAAC,CAgC5B;IAED;;MAuCC;CAyCD;;yBA1KwB,WAAW"}
@@ -2,13 +2,11 @@ export class DateTimeQuestion extends Question {
2
2
  static AM: string;
3
3
  static PM: string;
4
4
  /**
5
- * @param {import('#question-types').QuestionParameters} params
6
- * @param {string} [params.dateFormat]
7
- * @param {string} [params.timeFormat]
5
+ * @param {import('../../questions/question-props.d.ts').DateTimeQuestionParams} params
8
6
  */
9
- constructor({ dateFormat, timeFormat, ...params }: import("#question-types").QuestionParameters);
10
- dateFormat: any;
11
- timeFormat: any;
7
+ constructor({ dateFormat, timeFormat, ...parentParams }: import("../../questions/question-props.d.ts").DateTimeQuestionParams);
8
+ dateFormat: string;
9
+ timeFormat: string;
12
10
  /**
13
11
  * Get the data to save from the request, returns an object of answers
14
12
  * @param {import('express').Request} req
@@ -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,mDAJW,OAAO,iBAAiB,EAAE,kBAAkB,EAWtD;IAFA,gBAA4B;IAC5B,gBAA4B;IAkB7B;;;;;OAKG,CACH,mBAJW,OAAO,SAAS,EAAE,OAAO,mBACzB,eAAe,GACb,OAAO,CAAE,MAAM,CAAC,CAqB5B;IAED;;MAqCC;;CAoCD;;yBA3IwB,6BAA6B"}
1
+ {"version":3,"file":"question.d.ts","sourceRoot":"","sources":["../../../../src/components/date-time/question.js"],"names":[],"mappings":"AAMA;IACC,kBAAiB;IACjB,kBAAiB;IAEjB;;OAEG;IACH,yDAFW,OAAO,qCAAqC,EAAE,sBAAsB,EAS9E;IAFA,mBAA4B;IAC5B,mBAA4B;IAkB7B;;;;;OAKG,CACH,mBAJW,OAAO,SAAS,EAAE,OAAO,mBACzB,eAAe,GACb,OAAO,CAAE,MAAM,CAAC,CAqB5B;IAED;;MAqCC;;CAoCD;;yBAzIwB,6BAA6B"}
@@ -11,6 +11,10 @@
11
11
  * @class
12
12
  */
13
13
  export class EmailQuestion extends SingleLineInputQuestion {
14
+ /**
15
+ * @param {import('../../questions/question-props.d.ts').EmailQuestionParams} params
16
+ */
17
+ constructor(params: import("../../questions/question-props.d.ts").EmailQuestionParams);
14
18
  /**
15
19
  * Override formatAnswerForSummary to prevent capitalization of email addresses
16
20
  * Email addresses should remain in their original case (typically lowercase)
@@ -1 +1 @@
1
- {"version":3,"file":"question.d.ts","sourceRoot":"","sources":["../../../../src/components/email/question.js"],"names":[],"mappings":"AAEA;;;;;;GAMG;AAEH;;;;GAIG;AACH;IA2BC;;;;;;;OAOG;IACH,uCALW,MAAM,WACN,OAAO,UAAU,EAAE,OAAO,UAC1B,MAAM,SAMhB;CACD;;gCAnDY,OAAO,WAAW,EAAE,iBAAiB;sBACrC,OAAO,UAAU,EAAE,OAAO;8BAC1B,OAAO,mBAAmB,EAAE,eAAe;;;oCALpB,kCAAkC"}
1
+ {"version":3,"file":"question.d.ts","sourceRoot":"","sources":["../../../../src/components/email/question.js"],"names":[],"mappings":"AAEA;;;;;;GAMG;AAEH;;;;GAIG;AACH;IACC;;OAEG;IACH,oBAFW,OAAO,qCAAqC,EAAE,mBAAmB,EAmB3E;IAED;;;;;;;OAOG;IACH,uCALW,MAAM,WACN,OAAO,UAAU,EAAE,OAAO,UAC1B,MAAM,SAMhB;CACD;;gCA/CY,OAAO,WAAW,EAAE,iBAAiB;sBACrC,OAAO,UAAU,EAAE,OAAO;8BAC1B,OAAO,mBAAmB,EAAE,eAAe;;;oCALpB,kCAAkC"}
@@ -7,9 +7,9 @@
7
7
  */
8
8
  export class ManageListQuestion extends Question {
9
9
  /**
10
- * @param {import('#question-types').QuestionParameters & ManageListQuestionParameters} params
10
+ * @param {import('../../questions/question-props.d.ts').ManageListQuestionParams} params
11
11
  */
12
- constructor(params: import("#question-types").QuestionParameters & ManageListQuestionParameters);
12
+ constructor(params: import("../../questions/question-props.d.ts").ManageListQuestionParams);
13
13
  get confirmationQuestionParam(): string;
14
14
  getDataToSave(req: any, journeyResponse: any): Promise<{
15
15
  answers: {
@@ -1 +1 @@
1
- {"version":3,"file":"question.d.ts","sourceRoot":"","sources":["../../../../src/components/manage-list/question.js"],"names":[],"mappings":"AAKA;;;;;;GAMG;AAEH;IAOC;;OAEG;IACH,oBAFW,OAAO,iBAAiB,EAAE,kBAAkB,GAAG,4BAA4B,EAerF;IAcD,wCAEC;IAyDD;;;;OAMC;IAED;;;;QAsBC;IAED,4EAQC;IAoCD,yDAEC;IATD,kDAKC;;CAKD;;;;;;mBArLa,MAAM;;;;;;;;;;;;;;yBAPK,WAAW"}
1
+ {"version":3,"file":"question.d.ts","sourceRoot":"","sources":["../../../../src/components/manage-list/question.js"],"names":[],"mappings":"AAKA;;;;;;GAMG;AAEH;IAOC;;OAEG;IACH,oBAFW,OAAO,qCAAqC,EAAE,wBAAwB,EAehF;IAcD,wCAEC;IAyDD;;;;OAMC;IAED;;;;QAsBC;IAED,4EAQC;IAoCD,yDAEC;IATD,kDAKC;;CAKD;;;;;;mBArLa,MAAM;;;;;;;;;;;;;;yBAPK,WAAW"}
@@ -10,10 +10,10 @@
10
10
  */
11
11
  export class MultiFieldInputQuestion extends Question {
12
12
  /**
13
- * @param {import('#src/questions/question-props.d.ts').MultiFieldInputQuestionProps} params
13
+ * @param {import('../../questions/question-props.d.ts').MultiFieldInputQuestionParams} params
14
14
  */
15
- constructor({ inputFields, ...params }: import("#src/questions/question-props.d.ts").MultiFieldInputQuestionProps);
16
- inputFields: import("#src/questions/question-props.d.ts").InputField[];
15
+ constructor({ inputFields, ...parentParams }: import("../../questions/question-props.d.ts").MultiFieldInputQuestionParams);
16
+ inputFields: import("../../questions/question-props.d.ts").InputField[];
17
17
  answerForViewModel(answers: any): {
18
18
  value: string;
19
19
  fieldName: string;
@@ -22,8 +22,8 @@ export class MultiFieldInputQuestion extends Question {
22
22
  formatPrefix?: string;
23
23
  formatTextFunction?: (text: string) => string;
24
24
  attributes?: Record<string, string>;
25
- suffix?: import("#src/questions/question-props.d.ts").Affix;
26
- prefix?: import("#src/questions/question-props.d.ts").Affix;
25
+ suffix?: import("../../questions/question-props.d.ts").Affix;
26
+ prefix?: import("../../questions/question-props.d.ts").Affix;
27
27
  hint?: string;
28
28
  classes?: string;
29
29
  }[];
@@ -1 +1 @@
1
- {"version":3,"file":"question.d.ts","sourceRoot":"","sources":["../../../../src/components/multi-field-input/question.js"],"names":[],"mappings":"AAIA;;;;;;GAMG;AAEH;;GAEG;AACH;IACC;;OAEG;IACH,wCAFW,OAAO,oCAAoC,EAAE,4BAA4B,EAanF;IAJC,uEAA8B;IAchC;;;;;;;;;;;;QAOC;IAsBD;;;;;;;;;;;;;OAaG;IACH,wDAZW,OAAO,GAEL,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,CAkBJ;;CAyBD;;gCAvHY,OAAO,WAAW,EAAE,iBAAiB;sBACrC,OAAO,UAAU,EAAE,OAAO;8BAC1B,OAAO,mBAAmB,EAAE,eAAe;;;yBAP/B,WAAW"}
1
+ {"version":3,"file":"question.d.ts","sourceRoot":"","sources":["../../../../src/components/multi-field-input/question.js"],"names":[],"mappings":"AAIA;;;;;;GAMG;AAEH;;GAEG;AACH;IACC;;OAEG;IACH,8CAFW,OAAO,qCAAqC,EAAE,6BAA6B,EAarF;IAJC,wEAA8B;IAchC;;;;;;;;;;;;QAOC;IAsBD;;;;;;;;;;;;;OAaG;IACH,wDAZW,OAAO,GAEL,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,CAkBJ;;CAyBD;;gCAvHY,OAAO,WAAW,EAAE,iBAAiB;sBACrC,OAAO,UAAU,EAAE,OAAO;8BAC1B,OAAO,mBAAmB,EAAE,eAAe;;;yBAP/B,WAAW"}
@@ -1,12 +1,10 @@
1
1
  export class NumberEntryQuestion extends Question {
2
2
  /**
3
- * @param {import('#question-types').QuestionParameters} params
4
- * @param {string} [params.suffix]
5
- * @param {string|undefined} [params.label] if defined this show as a label for the input and the question will just be a standard h1
3
+ * @param {import('../../questions/question-props.d.ts').NumberEntryQuestionParams} params
6
4
  */
7
- constructor({ label, suffix, ...params }: import("#question-types").QuestionParameters);
8
- suffix: any;
9
- label: any;
5
+ constructor({ label, suffix, ...parentParams }: import("../../questions/question-props.d.ts").NumberEntryQuestionParams);
6
+ suffix: string | undefined;
7
+ label: string | undefined;
10
8
  answerForViewModel(answers: any): string | number;
11
9
  /**
12
10
  * returns the formatted answers values to be used to build task list elements
@@ -1 +1 @@
1
- {"version":3,"file":"question.d.ts","sourceRoot":"","sources":["../../../../src/components/number-entry/question.js"],"names":[],"mappings":"AAGA;IACC;;;;OAIG;IACH,0CAJW,OAAO,iBAAiB,EAAE,kBAAkB,EAYtD;IAFA,YAAoB;IACpB,WAAkB;IAGnB,kDAEC;IAUD;;;;;;;;;;;;;;OAcG;IACH,wDAZW,OAAO,UAAU,EAAE,OAAO,UAD1B,OAAO,GAGL,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,CAIJ;CACD;;yBAjDwB,WAAW"}
1
+ {"version":3,"file":"question.d.ts","sourceRoot":"","sources":["../../../../src/components/number-entry/question.js"],"names":[],"mappings":"AAGA;IACC;;OAEG;IACH,gDAFW,OAAO,qCAAqC,EAAE,yBAAyB,EAUjF;IAFA,2BAAoB;IACpB,0BAAkB;IAGnB,kDAEC;IAUD;;;;;;;;;;;;;;OAcG;IACH,wDAZW,OAAO,UAAU,EAAE,OAAO,UAD1B,OAAO,GAGL,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,CAIJ;CACD;;yBA/CwB,WAAW"}
@@ -1,43 +1,8 @@
1
1
  export class RadioQuestion extends OptionsQuestion {
2
2
  /**
3
- * @param {Object} params
4
- * @param {string} params.title
5
- * @param {string} params.question
6
- * @param {string} params.fieldName
7
- * @param {string} [params.viewFolder]
8
- * @param {string} [params.url]
9
- * @param {string} [params.hint]
10
- * @param {string} [params.pageTitle]
11
- * @param {string} [params.description]
12
- * @param {string} [params.label]
13
- * @param {string} [params.html]
14
- * @param {string} [params.legend] - optional legend, used instead of h1
15
- * @param {Array.<import('../../questions/options-question.js').Option>} params.options
16
- * @param {Array.<import('#base-validator').BaseValidator>} [params.validators]
17
- * @param {boolean} [params.editable]
18
- * @param {Object<string, any>} [params.viewData]
19
- * @param {import('#question-types').ActionLink} [params.actionLink]
3
+ * @param {import('../../questions/question-props.d.ts').RadioQuestionParams} params
20
4
  */
21
- constructor({ title, question, fieldName, viewFolder, url, hint, pageTitle, description, label, html, legend, options, validators, actionLink, editable, viewData }: {
22
- title: string;
23
- question: string;
24
- fieldName: string;
25
- viewFolder?: string | undefined;
26
- url?: string | undefined;
27
- hint?: string | undefined;
28
- pageTitle?: string | undefined;
29
- description?: string | undefined;
30
- label?: string | undefined;
31
- html?: string | undefined;
32
- legend?: string | undefined;
33
- options: Array<import("../../questions/options-question.js").Option>;
34
- validators?: import("#base-validator").BaseValidator[] | undefined;
35
- editable?: boolean | undefined;
36
- viewData?: {
37
- [x: string]: any;
38
- } | undefined;
39
- actionLink?: import("#question-types").ActionLink | undefined;
40
- });
5
+ constructor({ title, question, fieldName, viewFolder, url, hint, pageTitle, description, label, html, legend, options, validators, actionLink, editable, viewData }: import("../../questions/question-props.d.ts").RadioQuestionParams);
41
6
  label: string | undefined;
42
7
  legend: string | undefined;
43
8
  /**
@@ -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;;;QACS,UAAU;KAAC,EAuCnE;IAFA,0BAAkB;IAClB,2BAAoB;IAWrB;;;;;;OAMG;IACH,wDAJW,OAAO,UADP,OAAO,GAGL,KAAK,CAAC;QAAE,GAAG,EAAE,MAAM,CAAC;QAAC,KAAK,EAAE,MAAM,GAAG,MAAM,CAAC;QAAC,MAAM,CAAC,EAAE,UAAU,GAAG,UAAU,EAAE,GAAG,SAAS,CAAC;KAAE,CAAC,CAgB3G;CACD;;4BA3F2B,qCAAqC"}
1
+ {"version":3,"file":"question.d.ts","sourceRoot":"","sources":["../../../../src/components/radio/question.js"],"names":[],"mappings":"AAEA;IACC;;OAEG;IACH,qKAFW,OAAO,qCAAqC,EAAE,mBAAmB,EAuC3E;IAFA,0BAAkB;IAClB,2BAAoB;IAWrB;;;;;;OAMG;IACH,wDAJW,OAAO,UADP,OAAO,GAGL,KAAK,CAAC;QAAE,GAAG,EAAE,MAAM,CAAC;QAAC,KAAK,EAAE,MAAM,GAAG,MAAM,CAAC;QAAC,MAAM,CAAC,EAAE,UAAU,GAAG,UAAU,EAAE,GAAG,SAAS,CAAC;KAAE,CAAC,CAgB3G;CACD;;4BA3E2B,qCAAqC"}
@@ -1,41 +1,8 @@
1
1
  export class SelectQuestion extends OptionsQuestion {
2
2
  /**
3
- * @param {Object} params
4
- * @param {string} params.title
5
- * @param {string} params.question
6
- * @param {string} params.fieldName
7
- * @param {string} [params.viewFolder]
8
- * @param {string} [params.url]
9
- * @param {string} [params.hint]
10
- * @param {string} [params.pageTitle]
11
- * @param {string} [params.description]
12
- * @param {string} [params.label]
13
- * @param {string} [params.html]
14
- * @param {string} [params.legend] - optional legend, used instead of h1
15
- * @param {string} [params.disableAccessibleAutocomplete]
16
- * @param {Array.<import('../../questions/options-question.js').Option>} params.options
17
- * @param {Object<string, any>} [params.viewData]
18
- * @param {Array.<import('#base-validator').BaseValidator>} [params.validators]
3
+ * @param {import('../../questions/question-props.d.ts').SelectQuestionParams} params
19
4
  */
20
- constructor({ title, question, fieldName, viewFolder, url, hint, pageTitle, description, label, html, legend, disableAccessibleAutocomplete, options, validators, viewData }: {
21
- title: string;
22
- question: string;
23
- fieldName: string;
24
- viewFolder?: string | undefined;
25
- url?: string | undefined;
26
- hint?: string | undefined;
27
- pageTitle?: string | undefined;
28
- description?: string | undefined;
29
- label?: string | undefined;
30
- html?: string | undefined;
31
- legend?: string | undefined;
32
- disableAccessibleAutocomplete?: string | undefined;
33
- options: Array<import("../../questions/options-question.js").Option>;
34
- viewData?: {
35
- [x: string]: any;
36
- } | undefined;
37
- validators?: import("#base-validator").BaseValidator[] | undefined;
38
- });
5
+ constructor({ title, question, fieldName, viewFolder, url, hint, pageTitle, description, label, html, legend, disableAccessibleAutocomplete, options, validators, viewData }: import("../../questions/question-props.d.ts").SelectQuestionParams);
39
6
  label: string | undefined;
40
7
  legend: string | undefined;
41
8
  /**
@@ -1 +1 @@
1
- {"version":3,"file":"question.d.ts","sourceRoot":"","sources":["../../../../src/components/select/question.js"],"names":[],"mappings":"AAEA;IAEC;;;;;;;;;;;;;;;;;OAiBG;IACH,8KAhBG;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;QACN,6BAA6B;QACwB,OAAO,EAA5E,KAAK,CAAE,OAAO,qCAAqC,EAAE,MAAM,CAAC;QAC/B,QAAQ;;;QACoB,UAAU;KAAC,EAqC9E;IAHA,0BAAkB;IAClB,2BAAoB;IAarB;;;;;;;;OAQG;IACH,wDAJW,OAAO,UADP,OAAO,GAGL,KAAK,CAAE,MAAM,CAAC,CAS1B;;CACD;;4BArF2B,qCAAqC"}
1
+ {"version":3,"file":"question.d.ts","sourceRoot":"","sources":["../../../../src/components/select/question.js"],"names":[],"mappings":"AAEA;IAEC;;OAEG;IACH,8KAFW,OAAO,qCAAqC,EAAE,oBAAoB,EAqC5E;IAHA,0BAAkB;IAClB,2BAAoB;IAarB;;;;;;;;OAQG;IACH,wDAJW,OAAO,UADP,OAAO,GAGL,KAAK,CAAE,MAAM,CAAC,CAS1B;;CACD;;4BAtE2B,qCAAqC"}
@@ -3,16 +3,13 @@
3
3
  */
4
4
  export class SingleLineInputQuestion extends Question {
5
5
  /**
6
- * @param {import('#question-types').QuestionParameters} params
7
- * @param {string|undefined} [params.label] if defined this show as a label for the input and the question will just be a standard h1
8
- * @param {Record<string, string>} [params.inputAttributes] html attributes to add to the input
9
- * @param {string} [params.classes] html classes to add to the input
6
+ * @param {import('../../questions/question-props.d.ts').SingleLineInputQuestionParams} params
10
7
  */
11
- constructor(params: import("#question-types").QuestionParameters);
8
+ constructor(params: import("../../questions/question-props.d.ts").SingleLineInputQuestionParams);
12
9
  /** @type {Record<string, string>} */
13
10
  inputAttributes: Record<string, string>;
14
- label: any;
15
- classes: any;
11
+ label: string | undefined;
12
+ classes: string;
16
13
  }
17
14
  export default SingleLineInputQuestion;
18
15
  import { Question } from '#question';
@@ -1 +1 @@
1
- {"version":3,"file":"question.d.ts","sourceRoot":"","sources":["../../../../src/components/single-line-input/question.js"],"names":[],"mappings":"AAEA;;GAEG;AACH;IAIC;;;;;OAKG;IACH,oBALW,OAAO,iBAAiB,EAAE,kBAAkB,EActD;IAlBD,qCAAqC;IACrC,iBADW,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CACjB;IAcf,WAAyB;IAEzB,aAAmC;CAepC;;yBAtCwB,WAAW"}
1
+ {"version":3,"file":"question.d.ts","sourceRoot":"","sources":["../../../../src/components/single-line-input/question.js"],"names":[],"mappings":"AAEA;;GAEG;AACH;IAIC;;OAEG;IACH,oBAFW,OAAO,qCAAqC,EAAE,6BAA6B,EAWrF;IAfD,qCAAqC;IACrC,iBADW,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CACjB;IAWf,0BAAyB;IAEzB,gBAAmC;CAepC;;yBAnCwB,WAAW"}
@@ -16,13 +16,11 @@
16
16
  */
17
17
  export class TextEntryQuestion extends Question {
18
18
  /**
19
- * @param {import('#question-types').QuestionParameters} params
20
- * @param {TextEntryCheckbox} [params.textEntryCheckbox]
21
- * @param {string|undefined} [params.label] if defined this show as a label for the input and the question will just be a standard h1
19
+ * @param {import('../../questions/question-props.d.ts').TextEntryQuestionParams} params
22
20
  */
23
- constructor({ textEntryCheckbox, label, ...params }: import("#question-types").QuestionParameters);
24
- textEntryCheckbox: any;
25
- label: any;
21
+ constructor({ textEntryCheckbox, label, ...parentParams }: import("../../questions/question-props.d.ts").TextEntryQuestionParams);
22
+ textEntryCheckbox: import("../../questions/question-props.d.ts").TextEntryCheckbox | undefined;
23
+ label: string | undefined;
26
24
  }
27
25
  export default TextEntryQuestion;
28
26
  export type TextEntryCheckbox = {
@@ -1 +1 @@
1
- {"version":3,"file":"question.d.ts","sourceRoot":"","sources":["../../../../src/components/text-entry/question.js"],"names":[],"mappings":"AACA;;;;;GAKG;AAEH;;;;;;GAMG;AAEH;;GAEG;AACH;IACC;;;;OAIG;IACH,qDAJW,OAAO,iBAAiB,EAAE,kBAAkB,EAYtD;IAFA,uBAA0C;IAC1C,WAAkB;CAUnB;;;YAhCa,MAAM;UACN,MAAM;UACN,MAAM;;;yBAZK,WAAW"}
1
+ {"version":3,"file":"question.d.ts","sourceRoot":"","sources":["../../../../src/components/text-entry/question.js"],"names":[],"mappings":"AACA;;;;;GAKG;AAEH;;;;;;GAMG;AAEH;;GAEG;AACH;IACC;;OAEG;IACH,2DAFW,OAAO,qCAAqC,EAAE,uBAAuB,EAU/E;IAFA,+FAA0C;IAC1C,0BAAkB;CAUnB;;;YA9Ba,MAAM;UACN,MAAM;UACN,MAAM;;;yBAZK,WAAW"}
@@ -5,23 +5,16 @@ export const TRUNCATED_MAX_LENGTH: 500;
5
5
  */
6
6
  export class TextEntryRedactQuestion extends Question {
7
7
  /**
8
- * @param {import('#question-types').QuestionParameters} params
9
- * @param {import('../text-entry/question.js').TextEntryCheckbox} [params.textEntryCheckbox]
10
- * @param {string|undefined} [params.label] if defined this show as a label for the input and the question will just be a standard h1
11
- * @param {boolean} [params.onlyShowRedactedValueForSummary] whether to only show redacted value for summary
12
- * @param {boolean} [params.useRedactedFieldNameForSave] whether to use the redacted field name when saving answers
13
- * @param {boolean} [params.showSuggestionsUi] use the suggestions UI for this question
14
- * @param {string} [params.summaryText] summaryText to use with the details component
15
- * @param {boolean} [params.shouldTruncateSummary] determines whether redacted comment is truncated in summary view
8
+ * @param {import('../../questions/question-props.d.ts').TextEntryRedactQuestionParams} params
16
9
  */
17
- constructor({ textEntryCheckbox, label, onlyShowRedactedValueForSummary, useRedactedFieldNameForSave, showSuggestionsUi, summaryText, shouldTruncateSummary, ...params }: import("#question-types").QuestionParameters);
18
- textEntryCheckbox: any;
19
- label: any;
20
- onlyShowRedactedValueForSummary: any;
21
- useRedactedFieldNameForSave: any;
22
- showSuggestionsUi: any;
23
- summaryText: any;
24
- shouldTruncateSummary: any;
10
+ constructor({ textEntryCheckbox, label, onlyShowRedactedValueForSummary, useRedactedFieldNameForSave, showSuggestionsUi, summaryText, shouldTruncateSummary, ...parentParams }: import("../../questions/question-props.d.ts").TextEntryRedactQuestionParams);
11
+ textEntryCheckbox: import("../../questions/question-props.d.ts").TextEntryCheckbox | undefined;
12
+ label: string | undefined;
13
+ onlyShowRedactedValueForSummary: boolean | undefined;
14
+ useRedactedFieldNameForSave: boolean | undefined;
15
+ showSuggestionsUi: boolean | undefined;
16
+ summaryText: string | undefined;
17
+ shouldTruncateSummary: boolean | undefined;
25
18
  prepQuestionForRendering(section: any, journey: any, customViewData: any, payload: any, options: any): import("#question").QuestionViewModel;
26
19
  answerForViewModel(answers: any): string;
27
20
  formatAnswerForSummary(sectionSegment: any, journey: any, answer: any, capitals?: boolean): {
@@ -1 +1 @@
1
- {"version":3,"file":"question.d.ts","sourceRoot":"","sources":["../../../../src/components/text-entry-redact/question.js"],"names":[],"mappings":"AAGA,+BAAgC,QAAG,CAAC;AACpC,mCAAoC,GAAG,CAAC;AAExC;;GAEG;AACH;IACC;;;;;;;;;OASG;IACH,0KATW,OAAO,iBAAiB,EAAE,kBAAkB,EA+BtD;IAPA,uBAA0C;IAC1C,WAAkB;IAClB,qCAAsE;IACtE,iCAA8D;IAC9D,uBAA0C;IAC1C,iBAA8B;IAC9B,2BAAkD;IAkBnD,6IAOC;IAED,yCAEC;IAYD;;;;QAuBC;CACD;;yBA1GwB,WAAW"}
1
+ {"version":3,"file":"question.d.ts","sourceRoot":"","sources":["../../../../src/components/text-entry-redact/question.js"],"names":[],"mappings":"AAGA,+BAAgC,QAAG,CAAC;AACpC,mCAAoC,GAAG,CAAC;AAExC;;GAEG;AACH;IACC;;OAEG;IACH,gLAFW,OAAO,qCAAqC,EAAE,6BAA6B,EAwBrF;IAPA,+FAA0C;IAC1C,0BAAkB;IAClB,qDAAsE;IACtE,iDAA8D;IAC9D,uCAA0C;IAC1C,gCAA8B;IAC9B,2CAAkD;IAkBnD,6IAOC;IAED,yCAEC;IAYD;;;;QAuBC;CACD;;yBAnGwB,WAAW"}
@@ -23,10 +23,15 @@
23
23
  *}} UnitOption
24
24
  */
25
25
  export class UnitOptionEntryQuestion extends Question {
26
+ /**
27
+ * @param {import('../../questions/question-props.d.ts').UnitOptionEntryQuestionParams} params
28
+ * @param {Record<string, Function>} [methodOverrides]
29
+ */
30
+ constructor({ conditionalFieldName, options, label, ...parentParams }: import("../../questions/question-props.d.ts").UnitOptionEntryQuestionParams, methodOverrides?: Record<string, Function>);
26
31
  /** @type {Array<UnitOption>} */
27
32
  options: Array<UnitOption>;
28
- conditionalFieldName: any;
29
- label: any;
33
+ conditionalFieldName: string;
34
+ label: string | undefined;
30
35
  optionJoinString: string;
31
36
  /**
32
37
  * gets the view model for this question
@@ -1 +1 @@
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,6BAA6B,EAAE,iBAAiB,GAAG;QAClE,QAAQ,EAAE,OAAO,6BAA6B,EAAE,iBAAiB,CAAC,UAAU,CAAC,GAAG;YAC9E,OAAO,EAAC,UAAU,EAAE,CAAA;SACrB,CAAA;KACF,CAmDH;IAED;;;;;OAKG,CACH,mBAJW,OAAO,SAAS,EAAE,OAAO,mBACzB,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;yBA5BsB,6BAA6B"}
1
+ {"version":3,"file":"question.d.ts","sourceRoot":"","sources":["../../../../src/components/unit-option-entry/question.js"],"names":[],"mappings":"AAOA;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AAEH;IAIC;;;OAGG;IACH,uEAHW,OAAO,qCAAqC,EAAE,6BAA6B,oBAC3E,MAAM,CAAC,MAAM,WAAW,EAkBlC;IAvBD,gCAAgC;IAChC,SADW,KAAK,CAAC,UAAU,CAAC,CACpB;IAkBP,6BAAgD;IAEhD,0BAAkB;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,6BAA6B,EAAE,iBAAiB,GAAG;QAClE,QAAQ,EAAE,OAAO,6BAA6B,EAAE,iBAAiB,CAAC,UAAU,CAAC,GAAG;YAC9E,OAAO,EAAC,UAAU,EAAE,CAAA;SACrB,CAAA;KACF,CAmDH;IAED;;;;;OAKG,CACH,mBAJW,OAAO,SAAS,EAAE,OAAO,mBACzB,eAAe,GACb,OAAO,CAAC;QAAE,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAA;KAAE,CAAC,CAgCzD;CAoBD;;;;;;;;;;yBApKY;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;yBA5BsB,6BAA6B"}
@@ -18,14 +18,22 @@ type QuestionTypes =
18
18
  | 'text-entry-redact'
19
19
  | 'unit-option';
20
20
 
21
- type CommonQuestionProps = Omit<QuestionParameters, 'viewFolder'> & {
21
+ /**
22
+ * Base params that question classes need to function (NO type - that's routing metadata)
23
+ */
24
+ export type CommonQuestionParams = Omit<QuestionParameters, 'viewFolder'>;
25
+
26
+ /**
27
+ * Full props including type for routing/factory layer
28
+ */
29
+ type CommonQuestionProps = CommonQuestionParams & {
22
30
  type: QuestionTypes;
23
31
  };
24
32
 
25
33
  /**
26
34
  * Generic question props type so that custom components can be used without having to define a new type for each one.
27
35
  */
28
- export type BaseQuestionProps = Omit<CommonQuestionProps, 'type'> & {
36
+ export type BaseQuestionProps = CommonQuestionParams & {
29
37
  type: string;
30
38
  };
31
39
 
@@ -96,79 +104,174 @@ interface UnitOption {
96
104
  };
97
105
  }
98
106
 
99
- type BooleanQuestionProps = CommonQuestionProps & {
100
- type: 'boolean';
107
+ /**
108
+ * Internal base params for questions with options - not exported
109
+ */
110
+ type OptionsQuestionParams = CommonQuestionParams & {
111
+ options: Option[];
112
+ };
113
+
114
+ export type BooleanQuestionParams = Omit<RadioQuestionParams, 'options'> & {
101
115
  options?: Option[];
102
116
  interfaceType?: 'checkbox' | 'radio';
103
117
  };
104
118
 
105
- type CheckboxQuestionProps = CommonQuestionProps & {
119
+ type BooleanQuestionProps = BooleanQuestionParams & {
120
+ type: 'boolean';
121
+ };
122
+
123
+ export type CheckboxQuestionParams = OptionsQuestionParams;
124
+
125
+ type CheckboxQuestionProps = CheckboxQuestionParams & {
106
126
  type: 'checkbox';
107
- options: Option[];
108
127
  };
109
128
 
110
- type DateQuestionProps = CommonQuestionProps & {
129
+ export type DateQuestionParams = CommonQuestionParams & {
130
+ dateFormat?: string;
131
+ };
132
+
133
+ type DateQuestionProps = DateQuestionParams & {
111
134
  type: 'date';
112
135
  };
113
136
 
114
- type DatePeriodQuestionProps = CommonQuestionProps & {
137
+ // Minute and second will default to 0 if not provided
138
+ interface TimeComponents {
139
+ hour: number;
140
+ minute?: number;
141
+ second?: number;
142
+ }
143
+
144
+ export type DatePeriodQuestionParams = CommonQuestionParams & {
145
+ dateFormat?: string;
146
+ labels?: { start: string; end: string };
147
+ hintStart?: string;
148
+ hintEnd?: string;
149
+ startTime?: TimeComponents;
150
+ endTime?: TimeComponents;
151
+ };
152
+
153
+ type DatePeriodQuestionProps = DatePeriodQuestionParams & {
115
154
  type: 'date-period';
116
155
  };
117
156
 
118
- type DateTimeQuestionProps = CommonQuestionProps & {
157
+ export type DateTimeQuestionParams = CommonQuestionParams & {
158
+ dateFormat?: string;
159
+ timeFormat?: string;
160
+ };
161
+
162
+ type DateTimeQuestionProps = DateTimeQuestionParams & {
119
163
  type: 'date-time';
120
164
  };
121
165
 
122
- type ManageListQuestionProps = CommonQuestionProps & {
166
+ export type ManageListQuestionParams = CommonQuestionParams & {
167
+ titleSingular?: string;
168
+ showManageListQuestions?: boolean;
169
+ showAnswersInSummary?: boolean;
170
+ confirmationQuestion?: string;
171
+ };
172
+
173
+ type ManageListQuestionProps = ManageListQuestionParams & {
123
174
  type: 'manage-list';
124
175
  };
125
176
 
126
- type EmailQuestionProps = CommonQuestionProps & {
177
+ export type EmailQuestionParams = SingleLineInputQuestionParams & {
178
+ autocomplete?: string; // autocomplete attribute value (defaults to 'email')
179
+ };
180
+
181
+ type EmailQuestionProps = EmailQuestionParams & {
127
182
  type: 'email';
128
183
  };
129
184
 
130
- export type MultiFieldInputQuestionProps = CommonQuestionProps & {
131
- type: 'multi-field-input';
185
+ export type MultiFieldInputQuestionParams = CommonQuestionParams & {
132
186
  inputFields: InputField[];
133
187
  };
134
188
 
135
- type NumberEntryQuestionProps = CommonQuestionProps & {
136
- type: 'number';
189
+ export type MultiFieldInputQuestionProps = MultiFieldInputQuestionParams & {
190
+ type: 'multi-field-input';
191
+ };
192
+
193
+ export type NumberEntryQuestionParams = CommonQuestionParams & {
137
194
  suffix?: string;
195
+ label?: string;
138
196
  };
139
197
 
140
- type RadioQuestionProps = CommonQuestionProps & {
198
+ type NumberEntryQuestionProps = NumberEntryQuestionParams & {
199
+ type: 'number';
200
+ };
201
+
202
+ export type RadioQuestionParams = OptionsQuestionParams & {
203
+ label?: string;
204
+ legend?: string;
205
+ };
206
+
207
+ type RadioQuestionProps = RadioQuestionParams & {
141
208
  type: 'radio';
142
- options: Option[];
143
209
  };
144
210
 
145
- type SelectQuestionProps = CommonQuestionProps & {
146
- type: 'select';
147
- options: Option[];
211
+ export type SelectQuestionParams = OptionsQuestionParams & {
148
212
  disableAccessibleAutocomplete?: boolean;
213
+ label?: string;
214
+ legend?: string;
215
+ };
216
+
217
+ type SelectQuestionProps = SelectQuestionParams & {
218
+ type: 'select';
149
219
  };
150
220
 
151
- type SingleLineInputQuestionProps = CommonQuestionProps & {
221
+ export type SingleLineInputQuestionParams = CommonQuestionParams & {
222
+ inputAttributes?: Record<string, string>; // HTML attributes to add to the input
223
+ label?: string; // if defined this will show as a label for the input and the question will just be a standard h1
224
+ classes?: string; // HTML classes to add to the input
225
+ };
226
+
227
+ type SingleLineInputQuestionProps = SingleLineInputQuestionParams & {
152
228
  type: 'single-line-input';
153
- inputAttributes?: Record<string, string>;
154
229
  };
155
230
 
156
- type SiteAddressQuestionProps = CommonQuestionProps & {
231
+ export type SiteAddressQuestionParams = CommonQuestionParams;
232
+
233
+ type SiteAddressQuestionProps = SiteAddressQuestionParams & {
157
234
  type: 'site-address';
158
235
  };
159
236
 
160
- type TextEntryQuestionProps = CommonQuestionProps & {
237
+ type TextEntryCheckbox = {
238
+ header: string;
239
+ text: string;
240
+ name: string;
241
+ errorMessage?: string;
242
+ };
243
+
244
+ export type TextEntryQuestionParams = CommonQuestionParams & {
245
+ textEntryCheckbox?: TextEntryCheckbox;
246
+ label?: string; // if defined this will show as a label for the input and the question will just be a standard h1
247
+ };
248
+
249
+ type TextEntryQuestionProps = TextEntryQuestionParams & {
161
250
  type: 'text-entry';
162
251
  };
163
252
 
164
- type TextEntryRedactQuestionProps = CommonQuestionProps & {
253
+ export type TextEntryRedactQuestionParams = CommonQuestionParams & {
254
+ textEntryCheckbox?: TextEntryCheckbox;
255
+ label?: string; // if defined this will show as a label for the input and the question will just be a standard h1
256
+ onlyShowRedactedValueForSummary?: boolean;
257
+ useRedactedFieldNameForSave?: boolean;
258
+ showSuggestionsUi?: boolean;
259
+ summaryText?: string; // summaryText to use with the details component
260
+ shouldTruncateSummary?: boolean; // determines whether redacted comment is truncated in summary view
261
+ };
262
+
263
+ type TextEntryRedactQuestionProps = TextEntryRedactQuestionParams & {
165
264
  type: 'text-entry-redact';
166
265
  };
167
266
 
168
- type UnitOptionEntryQuestionProps = CommonQuestionProps & {
169
- type: 'unit-option';
170
- conditionalFieldName: string;
267
+ export type UnitOptionEntryQuestionParams = CommonQuestionParams & {
268
+ conditionalFieldName: string; // will be the quantity and is captured by the conditional in the options
171
269
  options: UnitOption[];
270
+ label?: string;
271
+ };
272
+
273
+ type UnitOptionEntryQuestionProps = UnitOptionEntryQuestionParams & {
274
+ type: 'unit-option';
172
275
  };
173
276
 
174
277
  export type QuestionProps =