@planning-inspectorate/dynamic-forms 3.15.6 → 3.16.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.
- package/.gitattributes +3 -0
- package/.prettierrc +1 -0
- package/README.md +11 -3
- package/package.json +6 -4
- package/{types/src → src}/components/address/question.d.ts +14 -2
- package/src/components/address/question.d.ts.map +1 -0
- package/src/components/address/question.js +1 -2
- package/{types/src → src}/components/boolean/question.d.ts +2 -2
- package/src/components/boolean/question.d.ts.map +1 -0
- package/src/components/boolean/question.js +1 -1
- package/src/components/checkbox/question.d.ts +29 -0
- package/src/components/checkbox/question.d.ts.map +1 -0
- package/src/components/checkbox/question.js +1 -5
- package/{types/src → src}/components/date/question.d.ts +10 -2
- package/src/components/date/question.d.ts.map +1 -0
- package/src/components/date/question.js +1 -2
- package/{types/src → src}/components/date-period/question.d.ts +16 -4
- package/src/components/date-period/question.d.ts.map +1 -0
- package/src/components/date-period/question.js +1 -2
- package/{types/src → src}/components/date-time/question.d.ts +10 -2
- package/src/components/date-time/question.d.ts.map +1 -0
- package/src/components/date-time/question.js +1 -2
- package/src/components/email/question.d.ts +23 -0
- package/src/components/email/question.d.ts.map +1 -0
- package/src/components/email/question.js +1 -9
- package/src/components/manage-list/manage-list-actions.d.ts.map +1 -0
- package/src/components/manage-list/manage-list-section.d.ts.map +1 -0
- package/{types/src → src}/components/manage-list/question.d.ts +10 -3
- package/src/components/manage-list/question.d.ts.map +1 -0
- package/src/components/manage-list/question.js +4 -1
- package/{types/src → src}/components/manage-list/utils.d.ts +3 -3
- package/src/components/manage-list/utils.d.ts.map +1 -0
- package/src/components/manage-list/utils.js +2 -2
- package/src/components/multi-field-input/question.d.ts +52 -0
- package/src/components/multi-field-input/question.d.ts.map +1 -0
- package/src/components/multi-field-input/question.js +5 -13
- package/{types/src → src}/components/number-entry/question.d.ts +7 -3
- package/src/components/number-entry/question.d.ts.map +1 -0
- package/src/components/number-entry/question.js +2 -2
- package/src/components/radio/question.d.ts +19 -0
- package/src/components/radio/question.d.ts.map +1 -0
- package/src/components/radio/question.js +1 -5
- package/{types/src → src}/components/select/question.d.ts +7 -3
- package/src/components/select/question.d.ts.map +1 -0
- package/src/components/select/question.js +2 -2
- package/src/components/single-line-input/question.d.ts +20 -0
- package/src/components/single-line-input/question.d.ts.map +1 -0
- package/src/components/single-line-input/question.js +1 -1
- package/{types/src → src}/components/text-entry/question.d.ts +7 -3
- package/src/components/text-entry/question.d.ts.map +1 -0
- package/src/components/text-entry/question.js +1 -1
- package/{types/src → src}/components/text-entry-redact/question.d.ts +12 -9
- package/src/components/text-entry-redact/question.d.ts.map +1 -0
- package/src/components/text-entry-redact/question.js +4 -1
- package/{types/src → src}/components/unit-option-entry/question.d.ts +12 -8
- package/src/components/unit-option-entry/question.d.ts.map +1 -0
- package/src/components/unit-option-entry/question.js +5 -6
- package/src/components/utils/component-types.d.ts.map +1 -0
- package/src/components/utils/persisted-number-answer.d.ts.map +1 -0
- package/src/components/utils/question-has-answer.d.ts.map +1 -0
- package/src/components/utils/question-utils.d.ts.map +1 -0
- package/{types/src → src}/controller.d.ts +2 -7
- package/src/controller.d.ts.map +1 -0
- package/src/controller.js +3 -10
- package/{types/src → src}/index.d.ts +4 -3
- package/src/index.d.ts.map +1 -0
- package/src/index.js +6 -4
- package/src/journey/journey-response.d.ts +28 -0
- package/src/journey/journey-response.d.ts.map +1 -0
- package/src/journey/journey-response.js +4 -8
- package/{types/src → src}/journey/journey.d.ts +8 -8
- package/src/journey/journey.d.ts.map +1 -0
- package/src/journey/journey.js +6 -6
- package/src/lib/address-utils.d.ts.map +1 -0
- package/src/lib/address.d.ts.map +1 -0
- package/src/lib/date-utils.d.ts.map +1 -0
- package/src/lib/session-answer-store.d.ts.map +1 -0
- package/src/lib/utils.d.ts.map +1 -0
- package/src/lib/uuid.d.ts.map +1 -0
- package/src/middleware/build-get-journey.d.ts.map +1 -0
- package/src/middleware/redirect-to-unanswered-question.d.ts +12 -0
- package/src/middleware/redirect-to-unanswered-question.d.ts.map +1 -0
- package/src/middleware/redirect-to-unanswered-question.js +1 -1
- package/src/questions/create-questions.d.ts +18 -0
- package/src/questions/create-questions.d.ts.map +1 -0
- package/src/questions/create-questions.js +3 -3
- package/{types/src → src}/questions/options-question.d.ts +7 -7
- package/src/questions/options-question.d.ts.map +1 -0
- package/src/questions/options-question.js +4 -4
- package/{types/src → src}/questions/question.d.ts +33 -79
- package/src/questions/question.d.ts.map +1 -0
- package/src/questions/question.js +19 -51
- package/src/questions/questions.d.ts +3 -0
- package/src/questions/questions.d.ts.map +1 -0
- package/src/questions/questions.js +1 -1
- package/{types/src → src}/section.d.ts +16 -15
- package/src/section.d.ts.map +1 -0
- package/src/section.js +12 -14
- package/src/validator/address-validator.d.ts.map +1 -0
- package/src/validator/base-validator.d.ts.map +1 -0
- package/src/validator/conditional-required-validator.d.ts.map +1 -0
- package/src/validator/confirmation-checkbox-validator.d.ts.map +1 -0
- package/src/validator/coordinates-validator.d.ts.map +1 -0
- package/src/validator/cross-question-validator.d.ts.map +1 -0
- package/src/validator/date-period-validator.d.ts.map +1 -0
- package/src/validator/date-time-validator.d.ts.map +1 -0
- package/src/validator/date-validator.d.ts.map +1 -0
- package/src/validator/document-upload-validator.d.ts.map +1 -0
- package/src/validator/email-validator.d.ts.map +1 -0
- package/{types/src → src}/validator/multi-field-input-validator.d.ts +3 -3
- package/src/validator/multi-field-input-validator.d.ts.map +1 -0
- package/src/validator/multi-field-input-validator.js +3 -3
- package/{types/src → src}/validator/numeric-validator.d.ts +2 -2
- package/src/validator/numeric-validator.d.ts.map +1 -0
- package/src/validator/numeric-validator.js +2 -2
- package/src/validator/required-validator.d.ts.map +1 -0
- package/src/validator/same-answer-validator.d.ts.map +1 -0
- package/{types/src → src}/validator/string-validator.d.ts +3 -3
- package/src/validator/string-validator.d.ts.map +1 -0
- package/src/validator/string-validator.js +3 -3
- package/src/validator/unit-option-entry-validator.d.ts.map +1 -0
- package/src/validator/valid-option-validator.d.ts.map +1 -0
- package/src/validator/validation-error-handler.d.ts.map +1 -0
- package/src/validator/validator.d.ts.map +1 -0
- package/test/questions.js +1 -1
- package/test/secondary-actions.test.js +1 -1
- package/tsconfig.json +11 -4
- package/{types/src/questions → typedefs}/question-props.d.ts +28 -26
- package/{src/questions → typedefs}/question-types.d.ts +44 -16
- package/{src → typedefs}/section-types.d.ts +1 -1
- package/typedefs/section-types.js +1 -0
- package/move-types.js +0 -12
- package/src/questions/question-props.d.ts +0 -295
- package/types/commitlint.config.d.ts +0 -7
- package/types/commitlint.config.d.ts.map +0 -1
- package/types/eslint.config.d.ts +0 -97
- package/types/eslint.config.d.ts.map +0 -1
- package/types/move-types.d.ts +0 -2
- package/types/move-types.d.ts.map +0 -1
- package/types/src/components/address/question.d.ts.map +0 -1
- package/types/src/components/boolean/question.d.ts.map +0 -1
- package/types/src/components/checkbox/question.d.ts +0 -33
- package/types/src/components/checkbox/question.d.ts.map +0 -1
- package/types/src/components/date/question.d.ts.map +0 -1
- package/types/src/components/date-period/question.d.ts.map +0 -1
- package/types/src/components/date-time/question.d.ts.map +0 -1
- package/types/src/components/email/question.d.ts +0 -35
- package/types/src/components/email/question.d.ts.map +0 -1
- package/types/src/components/manage-list/manage-list-actions.d.ts.map +0 -1
- package/types/src/components/manage-list/manage-list-section.d.ts.map +0 -1
- package/types/src/components/manage-list/question.d.ts.map +0 -1
- package/types/src/components/manage-list/utils.d.ts.map +0 -1
- package/types/src/components/multi-field-input/question.d.ts +0 -64
- package/types/src/components/multi-field-input/question.d.ts.map +0 -1
- package/types/src/components/number-entry/question.d.ts.map +0 -1
- package/types/src/components/radio/question.d.ts +0 -23
- package/types/src/components/radio/question.d.ts.map +0 -1
- package/types/src/components/select/question.d.ts.map +0 -1
- package/types/src/components/single-line-input/question.d.ts +0 -16
- package/types/src/components/single-line-input/question.d.ts.map +0 -1
- package/types/src/components/text-entry/question.d.ts.map +0 -1
- package/types/src/components/text-entry-redact/question.d.ts.map +0 -1
- package/types/src/components/unit-option-entry/question.d.ts.map +0 -1
- package/types/src/components/utils/component-types.d.ts.map +0 -1
- package/types/src/components/utils/persisted-number-answer.d.ts.map +0 -1
- package/types/src/components/utils/question-has-answer.d.ts.map +0 -1
- package/types/src/components/utils/question-utils.d.ts.map +0 -1
- package/types/src/controller.d.ts.map +0 -1
- package/types/src/index.d.ts.map +0 -1
- package/types/src/journey/journey-response.d.ts +0 -32
- package/types/src/journey/journey-response.d.ts.map +0 -1
- package/types/src/journey/journey-types.d.ts +0 -28
- package/types/src/journey/journey-types.d.ts.map +0 -1
- package/types/src/journey/journey.d.ts.map +0 -1
- package/types/src/lib/address-utils.d.ts.map +0 -1
- package/types/src/lib/address.d.ts.map +0 -1
- package/types/src/lib/date-utils.d.ts.map +0 -1
- package/types/src/lib/session-answer-store.d.ts.map +0 -1
- package/types/src/lib/utils.d.ts.map +0 -1
- package/types/src/lib/uuid.d.ts.map +0 -1
- package/types/src/middleware/build-get-journey.d.ts.map +0 -1
- package/types/src/middleware/redirect-to-unanswered-question.d.ts +0 -12
- package/types/src/middleware/redirect-to-unanswered-question.d.ts.map +0 -1
- package/types/src/questions/create-questions.d.ts +0 -18
- package/types/src/questions/create-questions.d.ts.map +0 -1
- package/types/src/questions/options-question.d.ts.map +0 -1
- package/types/src/questions/question-props.d.ts.map +0 -1
- package/types/src/questions/question-types.d.ts +0 -86
- package/types/src/questions/question-types.d.ts.map +0 -1
- package/types/src/questions/question.d.ts.map +0 -1
- package/types/src/questions/questions.d.ts +0 -3
- package/types/src/questions/questions.d.ts.map +0 -1
- package/types/src/section.d.ts.map +0 -1
- package/types/src/validator/address-validator.d.ts.map +0 -1
- package/types/src/validator/base-validator.d.ts.map +0 -1
- package/types/src/validator/conditional-required-validator.d.ts.map +0 -1
- package/types/src/validator/confirmation-checkbox-validator.d.ts.map +0 -1
- package/types/src/validator/coordinates-validator.d.ts.map +0 -1
- package/types/src/validator/cross-question-validator.d.ts.map +0 -1
- package/types/src/validator/date-period-validator.d.ts.map +0 -1
- package/types/src/validator/date-time-validator.d.ts.map +0 -1
- package/types/src/validator/date-validator.d.ts.map +0 -1
- package/types/src/validator/document-upload-validator.d.ts.map +0 -1
- package/types/src/validator/email-validator.d.ts.map +0 -1
- package/types/src/validator/multi-field-input-validator.d.ts.map +0 -1
- package/types/src/validator/numeric-validator.d.ts.map +0 -1
- package/types/src/validator/required-validator.d.ts.map +0 -1
- package/types/src/validator/same-answer-validator.d.ts.map +0 -1
- package/types/src/validator/string-validator.d.ts.map +0 -1
- package/types/src/validator/unit-option-entry-validator.d.ts.map +0 -1
- package/types/src/validator/valid-option-validator.d.ts.map +0 -1
- package/types/src/validator/validation-error-handler.d.ts.map +0 -1
- package/types/src/validator/validator.d.ts.map +0 -1
- /package/{types/src → src}/components/manage-list/manage-list-actions.d.ts +0 -0
- /package/{types/src → src}/components/manage-list/manage-list-section.d.ts +0 -0
- /package/{types/src → src}/components/utils/component-types.d.ts +0 -0
- /package/{types/src → src}/components/utils/persisted-number-answer.d.ts +0 -0
- /package/{types/src → src}/components/utils/question-has-answer.d.ts +0 -0
- /package/{types/src → src}/components/utils/question-utils.d.ts +0 -0
- /package/{types/src → src}/lib/address-utils.d.ts +0 -0
- /package/{types/src → src}/lib/address.d.ts +0 -0
- /package/{types/src → src}/lib/date-utils.d.ts +0 -0
- /package/{types/src → src}/lib/session-answer-store.d.ts +0 -0
- /package/{types/src → src}/lib/utils.d.ts +0 -0
- /package/{types/src → src}/lib/uuid.d.ts +0 -0
- /package/{types/src → src}/middleware/build-get-journey.d.ts +0 -0
- /package/{types/src → src}/validator/address-validator.d.ts +0 -0
- /package/{types/src → src}/validator/base-validator.d.ts +0 -0
- /package/{types/src → src}/validator/conditional-required-validator.d.ts +0 -0
- /package/{types/src → src}/validator/confirmation-checkbox-validator.d.ts +0 -0
- /package/{types/src → src}/validator/coordinates-validator.d.ts +0 -0
- /package/{types/src → src}/validator/cross-question-validator.d.ts +0 -0
- /package/{types/src → src}/validator/date-period-validator.d.ts +0 -0
- /package/{types/src → src}/validator/date-time-validator.d.ts +0 -0
- /package/{types/src → src}/validator/date-validator.d.ts +0 -0
- /package/{types/src → src}/validator/document-upload-validator.d.ts +0 -0
- /package/{types/src → src}/validator/email-validator.d.ts +0 -0
- /package/{types/src → src}/validator/required-validator.d.ts +0 -0
- /package/{types/src → src}/validator/same-answer-validator.d.ts +0 -0
- /package/{types/src → src}/validator/unit-option-entry-validator.d.ts +0 -0
- /package/{types/src → src}/validator/valid-option-validator.d.ts +0 -0
- /package/{types/src → src}/validator/validation-error-handler.d.ts +0 -0
- /package/{types/src → src}/validator/validator.d.ts +0 -0
- /package/{src/journey → typedefs}/journey-types.d.ts +0 -0
- /package/{src/journey → typedefs}/journey-types.js +0 -0
- /package/{src/questions → typedefs}/question-props.js +0 -0
- /package/{src/questions → typedefs}/question-types.js +0 -0
|
@@ -1,16 +1,20 @@
|
|
|
1
1
|
export class NumberEntryQuestion extends Question {
|
|
2
2
|
/**
|
|
3
|
-
* @param {import('
|
|
3
|
+
* @param {import('#typedefs/question-props.d.ts').NumberEntryQuestionParams} params
|
|
4
4
|
*/
|
|
5
|
-
constructor({ label, suffix, ...parentParams }: import("
|
|
5
|
+
constructor({ label, suffix, ...parentParams }: import("#typedefs/question-props.d.ts").NumberEntryQuestionParams);
|
|
6
6
|
suffix: string | undefined;
|
|
7
7
|
label: string | undefined;
|
|
8
8
|
answerForViewModel(answers: any): string | number;
|
|
9
|
+
/**
|
|
10
|
+
* @param {import('#question').QuestionViewModel} viewModel
|
|
11
|
+
*/
|
|
12
|
+
addCustomDataToViewModel(viewModel: import("#question").QuestionViewModel): void;
|
|
9
13
|
/**
|
|
10
14
|
* returns the formatted answers values to be used to build task list elements
|
|
11
15
|
* @param {unknown} answer
|
|
12
16
|
* @param {import('#journey').Journey} journey
|
|
13
|
-
* @param {
|
|
17
|
+
* @param {string} sectionSegment
|
|
14
18
|
* @returns {Array<{
|
|
15
19
|
* key: string;
|
|
16
20
|
* value: string | Object;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"question.d.ts","sourceRoot":"","sources":["question.js"],"names":[],"mappings":"AAGA;IACC;;OAEG;IACH,gDAFW,OAAO,+BAA+B,EAAE,yBAAyB,EAU3E;IAFA,2BAAoB;IACpB,0BAAkB;IAGnB,kDAEC;IAED;;OAEG;IACH,oCAFW,OAAO,WAAW,EAAE,iBAAiB,QAK/C;IAED;;;;;;;;;;;;;;OAcG;IACH,uCAXW,MAAM,WADN,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"}
|
|
@@ -3,7 +3,7 @@ import { getPersistedNumberAnswer } from '../utils/persisted-number-answer.js';
|
|
|
3
3
|
|
|
4
4
|
export class NumberEntryQuestion extends Question {
|
|
5
5
|
/**
|
|
6
|
-
* @param {import('
|
|
6
|
+
* @param {import('#typedefs/question-props.d.ts').NumberEntryQuestionParams} params
|
|
7
7
|
*/
|
|
8
8
|
constructor({ label, suffix, ...parentParams }) {
|
|
9
9
|
super({
|
|
@@ -31,7 +31,7 @@ export class NumberEntryQuestion extends Question {
|
|
|
31
31
|
* returns the formatted answers values to be used to build task list elements
|
|
32
32
|
* @param {unknown} answer
|
|
33
33
|
* @param {import('#journey').Journey} journey
|
|
34
|
-
* @param {
|
|
34
|
+
* @param {string} sectionSegment
|
|
35
35
|
* @returns {Array<{
|
|
36
36
|
* key: string;
|
|
37
37
|
* value: string | Object;
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
export class RadioQuestion extends OptionsQuestion {
|
|
2
|
+
/**
|
|
3
|
+
* @param {import('#typedefs/question-props.d.ts').RadioQuestionParams} params
|
|
4
|
+
*/
|
|
5
|
+
constructor({ title, question, fieldName, viewFolder, url, hint, pageTitle, description, label, html, legend, options, validators, actionLink, editable, viewData }: import("#typedefs/question-props.d.ts").RadioQuestionParams);
|
|
6
|
+
label: string | undefined;
|
|
7
|
+
legend: string | undefined;
|
|
8
|
+
/**
|
|
9
|
+
* @param {import('#question').QuestionViewModel} viewModel
|
|
10
|
+
*/
|
|
11
|
+
addCustomDataToViewModel(viewModel: import("#question").QuestionViewModel): void;
|
|
12
|
+
/**
|
|
13
|
+
* returns the formatted answers values to be used to build task list elements
|
|
14
|
+
*/
|
|
15
|
+
formatAnswerForSummary(sectionSegment: any, journey: any, answer: any): import("../../index.js").SummaryRow[];
|
|
16
|
+
}
|
|
17
|
+
export default RadioQuestion;
|
|
18
|
+
import OptionsQuestion from '../../questions/options-question.js';
|
|
19
|
+
//# sourceMappingURL=question.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"question.d.ts","sourceRoot":"","sources":["question.js"],"names":[],"mappings":"AAEA;IACC;;OAEG;IACH,qKAFW,OAAO,+BAA+B,EAAE,mBAAmB,EAuCrE;IAFA,0BAAkB;IAClB,2BAAoB;IAGrB;;OAEG;IACH,oCAFW,OAAO,WAAW,EAAE,iBAAiB,QAK/C;IAED;;OAEG;IACH,8GAcC;CACD;;4BAvE2B,qCAAqC"}
|
|
@@ -2,7 +2,7 @@ import OptionsQuestion from '../../questions/options-question.js';
|
|
|
2
2
|
|
|
3
3
|
export class RadioQuestion extends OptionsQuestion {
|
|
4
4
|
/**
|
|
5
|
-
* @param {import('
|
|
5
|
+
* @param {import('#typedefs/question-props.d.ts').RadioQuestionParams} params
|
|
6
6
|
*/
|
|
7
7
|
constructor({
|
|
8
8
|
title,
|
|
@@ -53,10 +53,6 @@ export class RadioQuestion extends OptionsQuestion {
|
|
|
53
53
|
|
|
54
54
|
/**
|
|
55
55
|
* returns the formatted answers values to be used to build task list elements
|
|
56
|
-
* @param {unknown} answer
|
|
57
|
-
* @param {Journey} journey
|
|
58
|
-
* @param {String} sectionSegment
|
|
59
|
-
* @returns {Array<{ key: string; value: string | Object; action?: ActionView | ActionView[] | undefined; }>}
|
|
60
56
|
*/
|
|
61
57
|
formatAnswerForSummary(sectionSegment, journey, answer) {
|
|
62
58
|
if (answer?.conditional) {
|
|
@@ -1,17 +1,21 @@
|
|
|
1
1
|
export class SelectQuestion extends OptionsQuestion {
|
|
2
2
|
/**
|
|
3
|
-
* @param {import('
|
|
3
|
+
* @param {import('#typedefs/question-props.d.ts').SelectQuestionParams} params
|
|
4
4
|
*/
|
|
5
|
-
constructor({ title, question, fieldName, viewFolder, url, hint, pageTitle, description, label, html, legend, disableAccessibleAutocomplete, options, validators, viewData }: import("
|
|
5
|
+
constructor({ title, question, fieldName, viewFolder, url, hint, pageTitle, description, label, html, legend, disableAccessibleAutocomplete, options, validators, viewData }: import("#typedefs/question-props.d.ts").SelectQuestionParams);
|
|
6
6
|
label: string | undefined;
|
|
7
7
|
legend: string | undefined;
|
|
8
|
+
/**
|
|
9
|
+
* @param {import('#question').QuestionViewModel} viewModel
|
|
10
|
+
*/
|
|
11
|
+
addCustomDataToViewModel(viewModel: import("#question").QuestionViewModel): void;
|
|
8
12
|
/**
|
|
9
13
|
* returns the formatted answers values to be used to build task list elements
|
|
10
14
|
* note: only supports a single answer
|
|
11
15
|
*
|
|
12
16
|
* @param {unknown} answer
|
|
13
17
|
* @param {Journey} journey
|
|
14
|
-
* @param {
|
|
18
|
+
* @param {string} sectionSegment
|
|
15
19
|
* @returns {Array.<Object>}
|
|
16
20
|
*/
|
|
17
21
|
formatAnswerForSummary(sectionSegment: string, journey: Journey, answer: unknown): Array<Object>;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"question.d.ts","sourceRoot":"","sources":["question.js"],"names":[],"mappings":"AAEA;IAEC;;OAEG;IACH,8KAFW,OAAO,+BAA+B,EAAE,oBAAoB,EAqCtE;IAHA,0BAAkB;IAClB,2BAAoB;IAIrB;;OAEG;IACH,oCAFW,OAAO,WAAW,EAAE,iBAAiB,QAM/C;IAED;;;;;;;;OAQG;IACH,uCAHW,MAAM,WADN,OAAO,UADP,OAAO,GAGL,KAAK,CAAE,MAAM,CAAC,CAS1B;;CACD;;4BAtE2B,qCAAqC"}
|
|
@@ -3,7 +3,7 @@ import OptionsQuestion from '../../questions/options-question.js';
|
|
|
3
3
|
export class SelectQuestion extends OptionsQuestion {
|
|
4
4
|
#disableAccessibleAutocomplete;
|
|
5
5
|
/**
|
|
6
|
-
* @param {import('
|
|
6
|
+
* @param {import('#typedefs/question-props.d.ts').SelectQuestionParams} params
|
|
7
7
|
*/
|
|
8
8
|
constructor({
|
|
9
9
|
title,
|
|
@@ -57,7 +57,7 @@ export class SelectQuestion extends OptionsQuestion {
|
|
|
57
57
|
*
|
|
58
58
|
* @param {unknown} answer
|
|
59
59
|
* @param {Journey} journey
|
|
60
|
-
* @param {
|
|
60
|
+
* @param {string} sectionSegment
|
|
61
61
|
* @returns {Array.<Object>}
|
|
62
62
|
*/
|
|
63
63
|
formatAnswerForSummary(sectionSegment, journey, answer) {
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @class
|
|
3
|
+
*/
|
|
4
|
+
export class SingleLineInputQuestion extends Question {
|
|
5
|
+
/**
|
|
6
|
+
* @param {import('#typedefs/question-props.d.ts').SingleLineInputQuestionParams} params
|
|
7
|
+
*/
|
|
8
|
+
constructor(params: import("#typedefs/question-props.d.ts").SingleLineInputQuestionParams);
|
|
9
|
+
/** @type {Record<string, string>} */
|
|
10
|
+
inputAttributes: Record<string, string>;
|
|
11
|
+
label: string | undefined;
|
|
12
|
+
classes: string;
|
|
13
|
+
/**
|
|
14
|
+
* @param {import('#question').QuestionViewModel} viewModel
|
|
15
|
+
*/
|
|
16
|
+
addCustomDataToViewModel(viewModel: import("#question").QuestionViewModel): void;
|
|
17
|
+
}
|
|
18
|
+
export default SingleLineInputQuestion;
|
|
19
|
+
import { Question } from '#question';
|
|
20
|
+
//# sourceMappingURL=question.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"question.d.ts","sourceRoot":"","sources":["question.js"],"names":[],"mappings":"AAEA;;GAEG;AACH;IAIC;;OAEG;IACH,oBAFW,OAAO,+BAA+B,EAAE,6BAA6B,EAW/E;IAfD,qCAAqC;IACrC,iBADW,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CACjB;IAWf,0BAAyB;IAEzB,gBAAmC;IAGpC;;OAEG;IACH,oCAFW,OAAO,WAAW,EAAE,iBAAiB,QAU/C;CACD;;yBAnCwB,WAAW"}
|
|
@@ -8,7 +8,7 @@ export class SingleLineInputQuestion extends Question {
|
|
|
8
8
|
inputAttributes;
|
|
9
9
|
|
|
10
10
|
/**
|
|
11
|
-
* @param {import('
|
|
11
|
+
* @param {import('#typedefs/question-props.d.ts').SingleLineInputQuestionParams} params
|
|
12
12
|
*/
|
|
13
13
|
constructor(params) {
|
|
14
14
|
super({
|
|
@@ -16,11 +16,15 @@
|
|
|
16
16
|
*/
|
|
17
17
|
export class TextEntryQuestion extends Question {
|
|
18
18
|
/**
|
|
19
|
-
* @param {import('
|
|
19
|
+
* @param {import('#typedefs/question-props.d.ts').TextEntryQuestionParams} params
|
|
20
20
|
*/
|
|
21
|
-
constructor({ textEntryCheckbox, label, ...parentParams }: import("
|
|
22
|
-
textEntryCheckbox: import("
|
|
21
|
+
constructor({ textEntryCheckbox, label, ...parentParams }: import("#typedefs/question-props.d.ts").TextEntryQuestionParams);
|
|
22
|
+
textEntryCheckbox: import("#typedefs/question-props.d.ts").TextEntryCheckbox | undefined;
|
|
23
23
|
label: string | undefined;
|
|
24
|
+
/**
|
|
25
|
+
* @param {import('#question').QuestionViewModel} viewModel
|
|
26
|
+
*/
|
|
27
|
+
addCustomDataToViewModel(viewModel: import("#question").QuestionViewModel): void;
|
|
24
28
|
}
|
|
25
29
|
export default TextEntryQuestion;
|
|
26
30
|
export type TextEntryCheckbox = {
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"question.d.ts","sourceRoot":"","sources":["question.js"],"names":[],"mappings":"AACA;;;;;GAKG;AAEH;;;;;;GAMG;AAEH;;GAEG;AACH;IACC;;OAEG;IACH,2DAFW,OAAO,+BAA+B,EAAE,uBAAuB,EAUzE;IAFA,yFAA0C;IAC1C,0BAAkB;IAGnB;;OAEG;IACH,oCAFW,OAAO,WAAW,EAAE,iBAAiB,QAK/C;CACD;;;YA9Ba,MAAM;UACN,MAAM;UACN,MAAM;;;yBAZK,WAAW"}
|
|
@@ -19,7 +19,7 @@ import { Question } from '#question';
|
|
|
19
19
|
*/
|
|
20
20
|
export class TextEntryQuestion extends Question {
|
|
21
21
|
/**
|
|
22
|
-
* @param {import('
|
|
22
|
+
* @param {import('#typedefs/question-props.d.ts').TextEntryQuestionParams} params
|
|
23
23
|
*/
|
|
24
24
|
constructor({ textEntryCheckbox, label, ...parentParams }) {
|
|
25
25
|
super({
|
|
@@ -5,23 +5,26 @@ export const TRUNCATED_MAX_LENGTH: 500;
|
|
|
5
5
|
*/
|
|
6
6
|
export class TextEntryRedactQuestion extends Question {
|
|
7
7
|
/**
|
|
8
|
-
* @param {import('
|
|
8
|
+
* @param {import('#typedefs/question-props.d.ts').TextEntryRedactQuestionParams} params
|
|
9
9
|
*/
|
|
10
|
-
constructor({ textEntryCheckbox, label, onlyShowRedactedValueForSummary, useRedactedFieldNameForSave, showSuggestionsUi, summaryText, shouldTruncateSummary, ...parentParams }: import("
|
|
11
|
-
textEntryCheckbox: import("
|
|
10
|
+
constructor({ textEntryCheckbox, label, onlyShowRedactedValueForSummary, useRedactedFieldNameForSave, showSuggestionsUi, summaryText, shouldTruncateSummary, ...parentParams }: import("#typedefs/question-props.d.ts").TextEntryRedactQuestionParams);
|
|
11
|
+
textEntryCheckbox: import("#typedefs/question-props.d.ts").TextEntryCheckbox | undefined;
|
|
12
12
|
label: string | undefined;
|
|
13
13
|
onlyShowRedactedValueForSummary: boolean | undefined;
|
|
14
14
|
useRedactedFieldNameForSave: boolean | undefined;
|
|
15
15
|
showSuggestionsUi: boolean | undefined;
|
|
16
16
|
summaryText: string | undefined;
|
|
17
17
|
shouldTruncateSummary: boolean | undefined;
|
|
18
|
-
prepQuestionForRendering(section: any, journey: any, customViewData: any, payload: any, options: any): import("
|
|
18
|
+
prepQuestionForRendering(section: any, journey: any, customViewData: any, payload: any, options: any): import("../../index.js").QuestionViewModel<import("../../index.js").BaseQuestionViewData>;
|
|
19
19
|
answerForViewModel(answers: any): string;
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
20
|
+
/**
|
|
21
|
+
* @param {import('#question').QuestionViewModel} viewModel
|
|
22
|
+
*/
|
|
23
|
+
addCustomDataToViewModel(viewModel: import("#question").QuestionViewModel): void;
|
|
24
|
+
/**
|
|
25
|
+
* returns the formatted answers values to be used to build task list elements
|
|
26
|
+
*/
|
|
27
|
+
formatAnswerForSummary(sectionSegment: any, journey: any, answer: any, capitals?: boolean): import("../../index.js").SummaryRow[];
|
|
25
28
|
}
|
|
26
29
|
export default TextEntryRedactQuestion;
|
|
27
30
|
import { Question } from '#question';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"question.d.ts","sourceRoot":"","sources":["question.js"],"names":[],"mappings":"AAGA,+BAAgC,QAAG,CAAC;AACpC,mCAAoC,GAAG,CAAC;AAExC;;GAEG;AACH;IACC;;OAEG;IACH,gLAFW,OAAO,+BAA+B,EAAE,6BAA6B,EAwB/E;IAPA,yFAA0C;IAC1C,0BAAkB;IAClB,qDAAsE;IACtE,iDAA8D;IAC9D,uCAA0C;IAC1C,gCAA8B;IAC9B,2CAAkD;IAkBnD,iMAOC;IAED,yCAEC;IAED;;OAEG;IACH,oCAFW,OAAO,WAAW,EAAE,iBAAiB,QAO/C;IAED;;OAEG;IACH,kIAuBC;CACD;;yBAtGwB,WAAW"}
|
|
@@ -9,7 +9,7 @@ export const TRUNCATED_MAX_LENGTH = 500;
|
|
|
9
9
|
*/
|
|
10
10
|
export class TextEntryRedactQuestion extends Question {
|
|
11
11
|
/**
|
|
12
|
-
* @param {import('
|
|
12
|
+
* @param {import('#typedefs/question-props.d.ts').TextEntryRedactQuestionParams} params
|
|
13
13
|
*/
|
|
14
14
|
constructor({
|
|
15
15
|
textEntryCheckbox,
|
|
@@ -73,6 +73,9 @@ export class TextEntryRedactQuestion extends Question {
|
|
|
73
73
|
viewModel.showSuggestionsUi = this.showSuggestionsUi;
|
|
74
74
|
}
|
|
75
75
|
|
|
76
|
+
/**
|
|
77
|
+
* returns the formatted answers values to be used to build task list elements
|
|
78
|
+
*/
|
|
76
79
|
formatAnswerForSummary(sectionSegment, journey, answer, capitals = true) {
|
|
77
80
|
const redacted = journey.response.answers[this.fieldName + 'Redacted'];
|
|
78
81
|
let toShow;
|
|
@@ -24,10 +24,10 @@
|
|
|
24
24
|
*/
|
|
25
25
|
export class UnitOptionEntryQuestion extends Question {
|
|
26
26
|
/**
|
|
27
|
-
* @param {import('
|
|
27
|
+
* @param {import('#typedefs/question-props.d.ts').UnitOptionEntryQuestionParams} params
|
|
28
28
|
* @param {Record<string, Function>} [methodOverrides]
|
|
29
29
|
*/
|
|
30
|
-
constructor({ conditionalFieldName, options, label, ...parentParams }: import("
|
|
30
|
+
constructor({ conditionalFieldName, options, label, ...parentParams }: import("#typedefs/question-props.d.ts").UnitOptionEntryQuestionParams, methodOverrides?: Record<string, Function>);
|
|
31
31
|
/** @type {Array<UnitOption>} */
|
|
32
32
|
options: Array<UnitOption>;
|
|
33
33
|
conditionalFieldName: string;
|
|
@@ -35,19 +35,19 @@ export class UnitOptionEntryQuestion extends Question {
|
|
|
35
35
|
optionJoinString: string;
|
|
36
36
|
/**
|
|
37
37
|
* gets the view model for this question
|
|
38
|
-
* @param {import('../../section').Section} section - the current section
|
|
38
|
+
* @param {import('../../section.js').Section} section - the current section
|
|
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('#question-types').PrepQuestionForRenderingOptions} options
|
|
43
|
-
* @returns {import('
|
|
44
|
-
* question: import('
|
|
42
|
+
* @param {import('#typedefs/question-types.d.ts').PrepQuestionForRenderingOptions} options
|
|
43
|
+
* @returns {import('#typedefs/question-types.d.ts').QuestionViewModel & {
|
|
44
|
+
* question: import('#typedefs/question-types.d.ts').QuestionViewModel['question'] & {
|
|
45
45
|
* options:UnitOption[]
|
|
46
46
|
* }
|
|
47
47
|
* }}
|
|
48
48
|
*/
|
|
49
|
-
prepQuestionForRendering(section:
|
|
50
|
-
question: import("
|
|
49
|
+
prepQuestionForRendering(section: import("../../section.js").Section, journey: import("#journey").Journey, customViewData?: Record<string, unknown>, payload?: Record<string, unknown>, options: import("#typedefs/question-types.d.ts").PrepQuestionForRenderingOptions): import("#typedefs/question-types.d.ts").QuestionViewModel & {
|
|
50
|
+
question: import("#typedefs/question-types.d.ts").QuestionViewModel["question"] & {
|
|
51
51
|
options: UnitOption[];
|
|
52
52
|
};
|
|
53
53
|
};
|
|
@@ -59,6 +59,10 @@ export class UnitOptionEntryQuestion extends Question {
|
|
|
59
59
|
*/ getDataToSave(req: import("express").Request, journeyResponse: JourneyResponse): Promise<{
|
|
60
60
|
answers: Record<string, unknown>;
|
|
61
61
|
}>;
|
|
62
|
+
/**
|
|
63
|
+
* returns the formatted answers values to be used to build task list elements
|
|
64
|
+
*/
|
|
65
|
+
formatAnswerForSummary(sectionSegment: any, journey: any, answer: any): import("#typedefs/question-types.d.ts").SummaryRow[];
|
|
62
66
|
}
|
|
63
67
|
export default UnitOptionEntryQuestion;
|
|
64
68
|
/**
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"question.d.ts","sourceRoot":"","sources":["question.js"],"names":[],"mappings":"AAOA;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AAEH;IAIC;;;OAGG;IACH,uEAHW,OAAO,+BAA+B,EAAE,6BAA6B,oBACrE,MAAM,CAAC,MAAM,WAAW,EAkBlC;IAvBD,gCAAgC;IAChC,SADW,KAAK,CAAC,UAAU,CAAC,CACpB;IAkBP,6BAAgD;IAEhD,0BAAkB;IAClB,yBAA+C;IAGhD;;;;;;;;;;;;OAYG;IACH,kCAXW,OAAO,kBAAkB,EAAE,OAAO,WAClC,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,GAAG;QACpE,QAAQ,EAAE,OAAO,+BAA+B,EAAE,iBAAiB,CAAC,UAAU,CAAC,GAAG;YAChF,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;IAED;;OAEG;IACH,6HAaC;CACD;;;;;;;;;;yBAnKY;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"}
|
|
@@ -35,7 +35,7 @@ export class UnitOptionEntryQuestion extends Question {
|
|
|
35
35
|
options;
|
|
36
36
|
|
|
37
37
|
/**
|
|
38
|
-
* @param {import('
|
|
38
|
+
* @param {import('#typedefs/question-props.d.ts').UnitOptionEntryQuestionParams} params
|
|
39
39
|
* @param {Record<string, Function>} [methodOverrides]
|
|
40
40
|
*/
|
|
41
41
|
constructor({ conditionalFieldName, options, label, ...parentParams }, methodOverrides) {
|
|
@@ -58,13 +58,13 @@ export class UnitOptionEntryQuestion extends Question {
|
|
|
58
58
|
|
|
59
59
|
/**
|
|
60
60
|
* gets the view model for this question
|
|
61
|
-
* @param {import('../../section').Section} section - the current section
|
|
61
|
+
* @param {import('../../section.js').Section} section - the current section
|
|
62
62
|
* @param {import('#journey').Journey} journey - the journey we are in
|
|
63
63
|
* @param {Record<string, unknown>} [customViewData] additional data to send to view
|
|
64
64
|
* @param {Record<string, unknown>} [payload]
|
|
65
|
-
* @param {import('#question-types').PrepQuestionForRenderingOptions} options
|
|
66
|
-
* @returns {import('
|
|
67
|
-
* question: import('
|
|
65
|
+
* @param {import('#typedefs/question-types.d.ts').PrepQuestionForRenderingOptions} options
|
|
66
|
+
* @returns {import('#typedefs/question-types.d.ts').QuestionViewModel & {
|
|
67
|
+
* question: import('#typedefs/question-types.d.ts').QuestionViewModel['question'] & {
|
|
68
68
|
* options:UnitOption[]
|
|
69
69
|
* }
|
|
70
70
|
* }}
|
|
@@ -160,7 +160,6 @@ export class UnitOptionEntryQuestion extends Question {
|
|
|
160
160
|
|
|
161
161
|
/**
|
|
162
162
|
* returns the formatted answers values to be used to build task list elements
|
|
163
|
-
* @type {Question['formatAnswerForSummary']}
|
|
164
163
|
*/
|
|
165
164
|
formatAnswerForSummary(sectionSegment, journey, answer) {
|
|
166
165
|
if (answer == null) return super.formatAnswerForSummary(sectionSegment, journey, answer);
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"component-types.d.ts","sourceRoot":"","sources":["component-types.js"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;GAiBG"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"persisted-number-answer.d.ts","sourceRoot":"","sources":["persisted-number-answer.js"],"names":[],"mappings":"AAGO,iDAFI,MAAM,mBAYhB"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"question-has-answer.d.ts","sourceRoot":"","sources":["question-has-answer.js"],"names":[],"mappings":"AAOO,8CAHI,OAAO,mCAAmC,EAAE,eAAe,GACzD;IAAC,GAAG,EAAE,eAAe,CAAC;IAAC,EAAE,EAAE,eAAe,CAAA;CAAC,CAOtD;AAYK,gDAJI,OAAO,6BAA6B,EAAE,QAAQ,iBAC9C,OAAO,GACL,OAAO,kBAAkB,EAAE,iBAAiB,CAIxD;AAUM,4CALI,OAAO,mCAAmC,EAAE,eAAe,YAC3D,OAAO,6BAA6B,EAAE,QAAQ,GAAC;IAAC,gBAAgB,EAAE,MAAM,CAAA;CAAC,iBACzE,OAAO,GACL,OAAO,CAgBnB;AAUM,sDALI,OAAO,mCAAmC,EAAE,eAAe,YAC3D,GAAG,gBACH,CAAC,IAAI,EAAE,GAAG,KAAK,OAAO,GACpB,OAAO,CAWnB;AASM,+CANI,OAAO,mCAAmC,EAAE,eAAe,qBAC3D,iBAAiB,0BAEzB;IAA8B,iBAAiB,EAAvC,KAAK,GAAG,IAAI;CACpB,GAAU,OAAO,CAUnB;AAOM,0DAJI,OAAO,mCAAmC,EAAE,eAAe,YAC3D,OAAO,6BAA6B,EAAE,QAAQ,GAC5C,OAAO,CAMnB;AAOM,0DAJI,OAAO,mCAAmC,EAAE,eAAe,YAC3D,OAAO,6BAA6B,EAAE,QAAQ,GAC5C,OAAO,CAMnB;gCA5Ga,CAAC,GAAG,EAAE,OAAO,CAAC,EAAE;8BAChB,CAAC,iBAAiB,EAAE,iBAAiB,KAAK,OAAO"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"question-utils.d.ts","sourceRoot":"","sources":["question-utils.js"],"names":[],"mappings":"AAAA,yFAEC;AAED,oFAGC;AAED;;;GAGG;AACH,mDAHW,OAAO,GACL,WAAW,IAAI;IAAC,IAAI,EAAE,MAAM,CAAA;CAAC,CAIzC"}
|
|
@@ -33,7 +33,7 @@ export function question(req: import("express-serve-static-core").Request<import
|
|
|
33
33
|
export function buildSave(saveData: SaveDataFn, redirectToTaskListOnSuccess?: boolean): import("express").Handler;
|
|
34
34
|
export type Journey = import("./journey/journey.js").Journey;
|
|
35
35
|
export type Question = import("./questions/question.js").Question;
|
|
36
|
-
export type Section =
|
|
36
|
+
export type Section = import("./section.js").Section;
|
|
37
37
|
export type SectionView = {
|
|
38
38
|
heading: string;
|
|
39
39
|
status: string;
|
|
@@ -51,14 +51,9 @@ export type RowView = {
|
|
|
51
51
|
html: string;
|
|
52
52
|
};
|
|
53
53
|
actions?: {
|
|
54
|
-
items: ActionView[];
|
|
54
|
+
items: import("#typedefs/question-types.d.ts").ActionView[];
|
|
55
55
|
} | undefined;
|
|
56
56
|
};
|
|
57
|
-
export type ActionView = {
|
|
58
|
-
href: string;
|
|
59
|
-
text: string;
|
|
60
|
-
visuallyHiddenText?: string | undefined;
|
|
61
|
-
};
|
|
62
57
|
export type SaveParams = {
|
|
63
58
|
req: import("express").Request;
|
|
64
59
|
res: import("express").Response;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"controller.d.ts","sourceRoot":"","sources":["controller.js"],"names":[],"mappings":"AA+DA;;;GAGG;AACH,qCAHW,MAAM,GACJ,OAAO,SAAS,EAAE,OAAO,CAIrC;AAED;;;;;GAKG;AACH,0BALW,OAAO,SAAS,EAAE,OAAO,OACzB,OAAO,SAAS,EAAE,QAAQ,eAC1B,MAAM,YACN,MAAM,iBA8DhB;;AAmDD;;;;;;;;;;GAUG;AAEH;;GAEG;AAEH;;;;GAIG;AACH,oCAJW,UAAU,gCACV,OAAO,GACL,OAAO,SAAS,EAAE,OAAO,CAsFrC;sBA7RY,OAAO,sBAAsB,EAAE,OAAO;uBACtC,OAAO,yBAAyB,EAAE,QAAQ;sBAC1C,OAAO,cAAc,EAAE,OAAO;;aAK7B,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,OAAO,+BAA+B,EAAE,UAAU,EAAE;;;;SAqK7D,OAAO,SAAS,EAAE,OAAO;SACzB,OAAO,SAAS,EAAE,QAAQ;eAC1B,MAAM;iBACN,MAAM;sBACN,OAAO;;;;;;;yBAOR,CAAC,MAAM,EAAE,UAAU,KAAK,OAAO,CAAC,IAAI,CAAC"}
|
package/src/controller.js
CHANGED
|
@@ -8,7 +8,7 @@ import { toArray } from '#src/lib/utils.js';
|
|
|
8
8
|
/**
|
|
9
9
|
* @typedef {import('./journey/journey.js').Journey} Journey
|
|
10
10
|
* @typedef {import('./questions/question.js').Question} Question
|
|
11
|
-
* @typedef {import('./section').Section} Section
|
|
11
|
+
* @typedef {import('./section.js').Section} Section
|
|
12
12
|
*/
|
|
13
13
|
|
|
14
14
|
/**
|
|
@@ -23,14 +23,7 @@ import { toArray } from '#src/lib/utils.js';
|
|
|
23
23
|
* @typedef {Object} RowView
|
|
24
24
|
* @property {{ text: string }} key
|
|
25
25
|
* @property {{ text: string } | { html: string }} value
|
|
26
|
-
* @property {{ items: ActionView[] }} [actions]
|
|
27
|
-
*/
|
|
28
|
-
|
|
29
|
-
/**
|
|
30
|
-
* @typedef {Object} ActionView
|
|
31
|
-
* @property {string} href
|
|
32
|
-
* @property {string} text
|
|
33
|
-
* @property {string} [visuallyHiddenText]
|
|
26
|
+
* @property {{ items: import('#typedefs/question-types.d.ts').ActionView[] }} [actions]
|
|
34
27
|
*/
|
|
35
28
|
|
|
36
29
|
/**
|
|
@@ -53,7 +46,7 @@ function buildSectionViewModel(name, status = '') {
|
|
|
53
46
|
* build a view model for a row in the journey overview
|
|
54
47
|
* @param {string} key
|
|
55
48
|
* @param {string} value
|
|
56
|
-
* @param {ActionView|ActionView[]} [action]
|
|
49
|
+
* @param {import('#typedefs/question-types.d.ts').ActionView|import('#typedefs/question-types.d.ts').ActionView[]} [action]
|
|
57
50
|
* @returns {RowView} a representation of a row
|
|
58
51
|
*/
|
|
59
52
|
function buildSectionRowViewModel(key, value, action) {
|
|
@@ -1,3 +1,7 @@
|
|
|
1
|
+
export * from "../typedefs/journey-types.js";
|
|
2
|
+
export * from "../typedefs/question-props.js";
|
|
3
|
+
export * from "../typedefs/question-types.js";
|
|
4
|
+
export * from "../typedefs/section-types.js";
|
|
1
5
|
export * from "./components/address/question.js";
|
|
2
6
|
export * from "./components/boolean/question.js";
|
|
3
7
|
export * from "./components/checkbox/question.js";
|
|
@@ -19,7 +23,6 @@ export * from "./components/utils/question-has-answer.js";
|
|
|
19
23
|
export * from "./components/utils/question-utils.js";
|
|
20
24
|
export * from "./components/utils/component-types.js";
|
|
21
25
|
export * from "./controller.js";
|
|
22
|
-
export * from "./journey/journey-types.js";
|
|
23
26
|
export * from "./lib/address.js";
|
|
24
27
|
export * from "./lib/address-utils.js";
|
|
25
28
|
export * from "./lib/date-utils.js";
|
|
@@ -28,8 +31,6 @@ export * from "./lib/utils.js";
|
|
|
28
31
|
export * from "./middleware/build-get-journey.js";
|
|
29
32
|
export * from "./middleware/redirect-to-unanswered-question.js";
|
|
30
33
|
export * from "./questions/options-question.js";
|
|
31
|
-
export * from "./questions/question-props.js";
|
|
32
|
-
export * from "./questions/question-types.js";
|
|
33
34
|
export * from "./validator/address-validator.js";
|
|
34
35
|
export * from "./validator/base-validator.js";
|
|
35
36
|
export * from "./validator/conditional-required-validator.js";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["index.js"],"names":[],"mappings":""}
|
package/src/index.js
CHANGED
|
@@ -1,3 +1,9 @@
|
|
|
1
|
+
// Type declaration files
|
|
2
|
+
export * from '../typedefs/journey-types.js';
|
|
3
|
+
export * from '../typedefs/question-props.js';
|
|
4
|
+
export * from '../typedefs/question-types.js';
|
|
5
|
+
export * from '../typedefs/section-types.js';
|
|
6
|
+
|
|
1
7
|
// Components
|
|
2
8
|
export * from './components/address/question.js';
|
|
3
9
|
export * from './components/boolean/question.js';
|
|
@@ -29,7 +35,6 @@ export * from './controller.js';
|
|
|
29
35
|
// Journey
|
|
30
36
|
export { Journey } from './journey/journey.js';
|
|
31
37
|
export { JourneyResponse } from './journey/journey-response.js';
|
|
32
|
-
export * from './journey/journey-types.js';
|
|
33
38
|
|
|
34
39
|
// lib
|
|
35
40
|
export * from './lib/address.js';
|
|
@@ -48,9 +53,6 @@ export { createQuestions } from './questions/create-questions.js';
|
|
|
48
53
|
export * from './questions/options-question.js';
|
|
49
54
|
export { questionClasses } from './questions/questions.js';
|
|
50
55
|
|
|
51
|
-
export * from './questions/question-props.js';
|
|
52
|
-
export * from './questions/question-types.js';
|
|
53
|
-
|
|
54
56
|
// Section
|
|
55
57
|
export { Section } from './section.js';
|
|
56
58
|
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Defines a response to a journey, a set of Answers to the questions
|
|
3
|
+
* @class
|
|
4
|
+
*/
|
|
5
|
+
export class JourneyResponse {
|
|
6
|
+
/**
|
|
7
|
+
* creates an instance of a JourneyResponse
|
|
8
|
+
* @param {string} journeyId
|
|
9
|
+
* @param {string} referenceId
|
|
10
|
+
* @param {import('#typedefs/journey-types.d.ts').JourneyAnswers | null} answers
|
|
11
|
+
* @param {string} [lpaCode]
|
|
12
|
+
*/
|
|
13
|
+
constructor(journeyId: string, referenceId: string, answers: import("#typedefs/journey-types.d.ts").JourneyAnswers | null, lpaCode?: string);
|
|
14
|
+
/**
|
|
15
|
+
* @type {string} - reference id used in the url for the journey e.g. appeal id - provides a unique lookup for responses in combination with formId
|
|
16
|
+
*/
|
|
17
|
+
referenceId: string;
|
|
18
|
+
/**
|
|
19
|
+
* @type {string} - a reference to the journey type e.g. has-questionnaire - provides a unique lookup for responses in combination with referenceId
|
|
20
|
+
*/
|
|
21
|
+
journeyId: string;
|
|
22
|
+
/**
|
|
23
|
+
* @type {import('#typedefs/journey-types.d.ts').JourneyAnswers} - answers to the journey
|
|
24
|
+
*/
|
|
25
|
+
answers: import("#typedefs/journey-types.d.ts").JourneyAnswers;
|
|
26
|
+
LPACode: string | undefined;
|
|
27
|
+
}
|
|
28
|
+
//# sourceMappingURL=journey-response.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"journey-response.d.ts","sourceRoot":"","sources":["journey-response.js"],"names":[],"mappings":"AAAA;;;GAGG;AACH;IAgBC;;;;;;OAMG;IACH,uBALW,MAAM,eACN,MAAM,WACN,OAAO,8BAA8B,EAAE,cAAc,GAAG,IAAI,YAC5D,MAAM,EAWhB;IA/BD;;OAEG;IACH,aAFU,MAAM,CAEJ;IAEZ;;OAEG;IACH,WAFU,MAAM,CAEN;IAEV;;OAEG;IACH,SAFU,OAAO,8BAA8B,EAAE,cAAc,CAEvD;IAiBP,4BAAsB;CAEvB"}
|
|
@@ -1,7 +1,3 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @typedef {import('./journey-factory').JourneyType} JourneyType
|
|
3
|
-
*/
|
|
4
|
-
|
|
5
1
|
/**
|
|
6
2
|
* Defines a response to a journey, a set of Answers to the questions
|
|
7
3
|
* @class
|
|
@@ -13,20 +9,20 @@ export class JourneyResponse {
|
|
|
13
9
|
referenceId;
|
|
14
10
|
|
|
15
11
|
/**
|
|
16
|
-
* @type {
|
|
12
|
+
* @type {string} - a reference to the journey type e.g. has-questionnaire - provides a unique lookup for responses in combination with referenceId
|
|
17
13
|
*/
|
|
18
14
|
journeyId;
|
|
19
15
|
|
|
20
16
|
/**
|
|
21
|
-
* @type {import('
|
|
17
|
+
* @type {import('#typedefs/journey-types.d.ts').JourneyAnswers} - answers to the journey
|
|
22
18
|
*/
|
|
23
19
|
answers;
|
|
24
20
|
|
|
25
21
|
/**
|
|
26
22
|
* creates an instance of a JourneyResponse
|
|
27
|
-
* @param {
|
|
23
|
+
* @param {string} journeyId
|
|
28
24
|
* @param {string} referenceId
|
|
29
|
-
* @param {import('
|
|
25
|
+
* @param {import('#typedefs/journey-types.d.ts').JourneyAnswers | null} answers
|
|
30
26
|
* @param {string} [lpaCode]
|
|
31
27
|
*/
|
|
32
28
|
constructor(journeyId, referenceId, answers, lpaCode) {
|
|
@@ -62,20 +62,20 @@ export class Journey {
|
|
|
62
62
|
getSection(sectionSegment: string): import("../section.js").Section | undefined;
|
|
63
63
|
/**
|
|
64
64
|
* gets a question from the object's sections based on a section + question names
|
|
65
|
-
* @param {import('
|
|
65
|
+
* @param {import('#typedefs/journey-types.d.ts').RouteParams} params
|
|
66
66
|
* @returns {import('../questions/question.js').Question | undefined} question found by lookup
|
|
67
67
|
*/
|
|
68
|
-
getQuestionByParams(params: import("
|
|
68
|
+
getQuestionByParams(params: import("#typedefs/journey-types.d.ts").RouteParams): import("../questions/question.js").Question | undefined;
|
|
69
69
|
/**
|
|
70
70
|
* Get the back link for the journey - e.g. the previous question
|
|
71
71
|
*
|
|
72
72
|
* @param {Object} options
|
|
73
|
-
* @param {import('
|
|
73
|
+
* @param {import('#typedefs/journey-types.d.ts').RouteParams} options.params
|
|
74
74
|
* @param {import('#src/components/manage-list/question.js')} [options.manageListQuestion]
|
|
75
75
|
* @returns {string|null} url for the next question, or null if unmatched
|
|
76
76
|
*/
|
|
77
77
|
getBackLink({ params, manageListQuestion }: {
|
|
78
|
-
params: import("
|
|
78
|
+
params: import("#typedefs/journey-types.d.ts").RouteParams;
|
|
79
79
|
manageListQuestion?: typeof import("#src/components/manage-list/question.js") | undefined;
|
|
80
80
|
}): string | null;
|
|
81
81
|
/**
|
|
@@ -83,21 +83,21 @@ export class Journey {
|
|
|
83
83
|
* Used after question post/saving
|
|
84
84
|
*
|
|
85
85
|
* @param {import('express').Response} res
|
|
86
|
-
* @param {import('
|
|
86
|
+
* @param {import('#typedefs/journey-types.d.ts').RouteParams} params
|
|
87
87
|
* @param {import('#src/components/manage-list/question.js')} [manageListQuestion]
|
|
88
88
|
* @returns {void}
|
|
89
89
|
*/
|
|
90
|
-
redirectToNextQuestion(res: import("express").Response, params: import("
|
|
90
|
+
redirectToNextQuestion(res: import("express").Response, params: import("#typedefs/journey-types.d.ts").RouteParams, manageListQuestion?: typeof import("#src/components/manage-list/question.js")): void;
|
|
91
91
|
/**
|
|
92
92
|
* Get url for the next question in the journey
|
|
93
93
|
*
|
|
94
|
-
* @param {import('
|
|
94
|
+
* @param {import('#typedefs/journey-types.d.ts').RouteParams} params
|
|
95
95
|
* @param {Object} options
|
|
96
96
|
* @param {boolean} [options.reverse] - if passed in this will get the previous question
|
|
97
97
|
* @param {import('#src/components/manage-list/question.js')} [options.manageListQuestion]
|
|
98
98
|
* @returns {string|null} url for the next question, or null if unmatched
|
|
99
99
|
*/
|
|
100
|
-
getNextQuestionUrl(params: import("
|
|
100
|
+
getNextQuestionUrl(params: import("#typedefs/journey-types.d.ts").RouteParams, { reverse, manageListQuestion }?: {
|
|
101
101
|
reverse?: boolean | undefined;
|
|
102
102
|
manageListQuestion?: typeof import("#src/components/manage-list/question.js") | undefined;
|
|
103
103
|
}): string | null;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"journey.d.ts","sourceRoot":"","sources":["journey.js"],"names":[],"mappings":"AAQA;;;GAGG;AACH;IAwBC;;;;;;;;;;;;;;OAcG;IACH,qLAZG;QAAwB,SAAS,EAAzB,MAAM;QACyE,WAAW,EAA1F,CAAC,QAAQ,EAAE,OAAO,uBAAuB,EAAE,eAAe,KAAK,MAAM;QACpD,WAAW;QAC6B,QAAQ,EAAjE,OAAO,uBAAuB,EAAE,eAAe;QAC/B,eAAe,EAA/B,MAAM;QACU,gBAAgB,EAAhC,MAAM;QACW,uBAAuB;QACxB,YAAY,EAA5B,MAAM;QACY,eAAe;QACU,QAAQ,EAAnD,OAAO,eAAe,EAAE,OAAO,EAAE;QAChB,eAAe;KAC1C,EAoDA;IAzFD,8EAA8E;IAC9E,WADW,MAAM,CACP;IACV,6FAA6F;IAC7F,UADW,KAAK,CAAE,OAAO,eAAe,EAAE,OAAO,CAAC,CACpC;IACd,mHAAmH;IACnH,UADW,OAAO,uBAAuB,EAAE,eAAe,CACjD;IACT,wFAAwF;IACxF,SADW,MAAM,CACJ;IACb,sJAAsJ;IACtJ,aADW,CAAC,eAAe,EAAE,OAAO,uBAAuB,EAAE,eAAe,KAAK,MAAM,CAChE;IACvB,kEAAkE;IAClE,aADW,MAAM,CACA;IACjB,uEAAuE;IACvE,iBADW,MAAM,CACI;IACrB,qFAAqF;IACrF,kBADW,MAAM,CACK;IACtB,4GAA4G;IAC5G,yBADW,MAAM,CACY;IAC7B,qFAAqF;IACrF,iBADW,OAAO,CACM;IACxB,2DAA2D;IAC3D,cADU,MAAM,CACH;IAmEZ,+BAA8C;IA2C/C;;;;OAIG;IACH,2BAHW,MAAM,GACJ,OAAO,eAAe,EAAE,OAAO,GAAG,SAAS,CAMvD;IA8BD;;;;OAIG;IACH,4BAHW,OAAO,8BAA8B,EAAE,WAAW,GAChD,OAAO,0BAA0B,EAAE,QAAQ,GAAG,SAAS,CAiBnE;IAED;;;;;;;OAOG;IACH,4CAJG;QAAoE,MAAM,EAAlE,OAAO,8BAA8B,EAAE,WAAW;QACU,kBAAkB;KACtF,GAAU,MAAM,GAAC,IAAI,CAWvB;IAED;;;;;;;;OAQG;IACH,4BALW,OAAO,SAAS,EAAE,QAAQ,UAC1B,OAAO,8BAA8B,EAAE,WAAW,kFAEhD,IAAI,CAKhB;IAED;;;;;;;;OAQG;IACH,2BANW,OAAO,8BAA8B,EAAE,WAAW,oCAE1D;QAA0B,OAAO;QACmC,kBAAkB;KACtF,GAAU,MAAM,GAAC,IAAI,CAyEvB;IAED;;;;;OAKG;IACH,wBAAyB,gBAJd,MAI4B,EAAE,iBAH9B,MAG6C,KAF3C,MAAM,CAqBjB;IAEF;;;;OAIG;IACH,sCAAuC,iBAH5B,MAG2C,KAFzC,MAAM,CAIjB;IAEF;;;;;;OAMG;IACH,0BAA2B,gBALhB,MAK8B,EAAE,iBAJhC,MAI+C,EAAE,UAHjD,MAGyD,KAFvD,MAAM,CAuBjB;IAEF;;;OAGG;IACH,cAFa,OAAO,CAInB;IAED;;OAEG;IACH,6BAFW,OAAO,uBAAuB,EAAE,eAAe,QAKzD;;CACD"}
|