@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.
- package/package.json +1 -1
- package/src/components/address/question.js +1 -1
- package/src/components/boolean/question.js +1 -14
- package/src/components/checkbox/question.js +1 -10
- package/src/components/date/question.js +3 -4
- package/src/components/date-period/question.js +12 -10
- package/src/components/date-time/question.js +3 -5
- package/src/components/email/question.js +1 -5
- package/src/components/manage-list/question.js +1 -1
- package/src/components/multi-field-input/question.js +3 -3
- package/src/components/number-entry/question.js +3 -5
- package/src/components/radio/question.js +1 -17
- package/src/components/select/question.js +1 -16
- package/src/components/single-line-input/question.js +1 -4
- package/src/components/text-entry/question.js +3 -5
- package/src/components/text-entry-redact/question.js +3 -10
- package/src/components/unit-option-entry/question.js +3 -6
- package/src/questions/question-props.d.ts +131 -28
- package/types/src/components/address/question.d.ts +2 -2
- package/types/src/components/address/question.d.ts.map +1 -1
- package/types/src/components/boolean/question.d.ts +3 -30
- package/types/src/components/boolean/question.d.ts.map +1 -1
- package/types/src/components/checkbox/question.d.ts +2 -21
- package/types/src/components/checkbox/question.d.ts.map +1 -1
- package/types/src/components/date/question.d.ts +3 -4
- package/types/src/components/date/question.d.ts.map +1 -1
- package/types/src/components/date-period/question.d.ts +11 -15
- package/types/src/components/date-period/question.d.ts.map +1 -1
- package/types/src/components/date-time/question.d.ts +4 -6
- package/types/src/components/date-time/question.d.ts.map +1 -1
- package/types/src/components/email/question.d.ts +4 -0
- package/types/src/components/email/question.d.ts.map +1 -1
- package/types/src/components/manage-list/question.d.ts +2 -2
- package/types/src/components/manage-list/question.d.ts.map +1 -1
- package/types/src/components/multi-field-input/question.d.ts +5 -5
- package/types/src/components/multi-field-input/question.d.ts.map +1 -1
- package/types/src/components/number-entry/question.d.ts +4 -6
- package/types/src/components/number-entry/question.d.ts.map +1 -1
- package/types/src/components/radio/question.d.ts +2 -37
- package/types/src/components/radio/question.d.ts.map +1 -1
- package/types/src/components/select/question.d.ts +2 -35
- package/types/src/components/select/question.d.ts.map +1 -1
- package/types/src/components/single-line-input/question.d.ts +4 -7
- package/types/src/components/single-line-input/question.d.ts.map +1 -1
- package/types/src/components/text-entry/question.d.ts +4 -6
- package/types/src/components/text-entry/question.d.ts.map +1 -1
- package/types/src/components/text-entry-redact/question.d.ts +9 -16
- package/types/src/components/text-entry-redact/question.d.ts.map +1 -1
- package/types/src/components/unit-option-entry/question.d.ts +7 -2
- package/types/src/components/unit-option-entry/question.d.ts.map +1 -1
- package/types/src/questions/question-props.d.ts +131 -28
package/package.json
CHANGED
|
@@ -7,7 +7,7 @@ import AddressValidator from '../../validator/address-validator.js';
|
|
|
7
7
|
|
|
8
8
|
export class AddressQuestion extends Question {
|
|
9
9
|
/**
|
|
10
|
-
* @param {import('
|
|
10
|
+
* @param {import('../../questions/question-props.d.ts').SiteAddressQuestionParams} params
|
|
11
11
|
*/
|
|
12
12
|
constructor(params) {
|
|
13
13
|
super({
|
|
@@ -33,20 +33,7 @@ export const booleanToYesNoOrNull = (value) => {
|
|
|
33
33
|
|
|
34
34
|
export class BooleanQuestion extends RadioQuestion {
|
|
35
35
|
/**
|
|
36
|
-
* @param {
|
|
37
|
-
* @param {string} params.title
|
|
38
|
-
* @param {string} params.question
|
|
39
|
-
* @param {string} params.fieldName
|
|
40
|
-
* @param {string} [params.url]
|
|
41
|
-
* @param {string} [params.hint]
|
|
42
|
-
* @param {string} [params.pageTitle]
|
|
43
|
-
* @param {string} [params.description]
|
|
44
|
-
* @param {string} [params.html]
|
|
45
|
-
* @param {string} [params.interfaceType]
|
|
46
|
-
* @param {Array.<import('../../questions/options-question.js').Option>} [params.options]
|
|
47
|
-
* @param {Array.<import('#base-validator').BaseValidator>} [params.validators]
|
|
48
|
-
* @param {boolean} [params.editable]
|
|
49
|
-
* @param {import('#question-types').QuestionParameters['viewData']} [params.viewData]
|
|
36
|
+
* @param {import('../../questions/question-props.d.ts').BooleanQuestionParams} params
|
|
50
37
|
*/
|
|
51
38
|
constructor({
|
|
52
39
|
title,
|
|
@@ -12,16 +12,7 @@ const defaultOptionJoinString = ',';
|
|
|
12
12
|
|
|
13
13
|
export class CheckboxQuestion extends OptionsQuestion {
|
|
14
14
|
/**
|
|
15
|
-
* @param {
|
|
16
|
-
* @param {string} params.title
|
|
17
|
-
* @param {string} params.question
|
|
18
|
-
* @param {string} params.fieldName
|
|
19
|
-
* @param {string} [params.url]
|
|
20
|
-
* @param {string} [params.pageTitle]
|
|
21
|
-
* @param {string} [params.description]
|
|
22
|
-
* @param {Array.<import('../../questions/options-question.js').Option>} params.options
|
|
23
|
-
* @param {Array.<import('#base-validator').BaseValidator>} [params.validators]
|
|
24
|
-
* @param {import('#question-types').QuestionParameters['viewData']} [params.viewData]
|
|
15
|
+
* @param {import('../../questions/question-props.d.ts').CheckboxQuestionParams} params
|
|
25
16
|
*/
|
|
26
17
|
constructor({ title, question, fieldName, url, pageTitle, description, options, validators, viewData }) {
|
|
27
18
|
super({
|
|
@@ -8,12 +8,11 @@ const DEFAULT_DATE_FORMAT = 'd MMMM yyyy';
|
|
|
8
8
|
*/
|
|
9
9
|
export class DateQuestion extends Question {
|
|
10
10
|
/**
|
|
11
|
-
* @param {import('
|
|
12
|
-
* @param {string} [params.dateFormat]
|
|
11
|
+
* @param {import('../../questions/question-props.d.ts').DateQuestionParams} params
|
|
13
12
|
*/
|
|
14
|
-
constructor({ dateFormat = DEFAULT_DATE_FORMAT, ...
|
|
13
|
+
constructor({ dateFormat = DEFAULT_DATE_FORMAT, ...parentParams }) {
|
|
15
14
|
super({
|
|
16
|
-
...
|
|
15
|
+
...parentParams,
|
|
17
16
|
viewFolder: 'date'
|
|
18
17
|
});
|
|
19
18
|
this.dateFormat = dateFormat;
|
|
@@ -11,18 +11,20 @@ const DEFAULT_DATE_FORMAT = 'HH:mm d MMMM yyyy';
|
|
|
11
11
|
*/
|
|
12
12
|
export class DatePeriodQuestion extends Question {
|
|
13
13
|
/**
|
|
14
|
-
* @param {import('
|
|
15
|
-
* @param {string} [params.dateFormat]
|
|
16
|
-
* @param {{start: string, end: string}} [params.labels]
|
|
17
|
-
* @param {string} [params.hint]
|
|
18
|
-
* @param {string} [params.hintStart]
|
|
19
|
-
* @param {string} [params.hintEnd]
|
|
20
|
-
* @param {{hour: number, minute: number, second: number}} [params.startTime]
|
|
21
|
-
* @param {{hour: number, minute: number, second: number}} [params.endTime]
|
|
14
|
+
* @param {import('../../questions/question-props.d.ts').DatePeriodQuestionParams} params
|
|
22
15
|
*/
|
|
23
|
-
constructor({
|
|
16
|
+
constructor({
|
|
17
|
+
dateFormat = DEFAULT_DATE_FORMAT,
|
|
18
|
+
hint,
|
|
19
|
+
labels,
|
|
20
|
+
hintStart,
|
|
21
|
+
startTime,
|
|
22
|
+
hintEnd,
|
|
23
|
+
endTime,
|
|
24
|
+
...parentParams
|
|
25
|
+
}) {
|
|
24
26
|
super({
|
|
25
|
-
...
|
|
27
|
+
...parentParams,
|
|
26
28
|
viewFolder: 'date-period'
|
|
27
29
|
});
|
|
28
30
|
this.dateFormat = dateFormat;
|
|
@@ -9,13 +9,11 @@ export class DateTimeQuestion extends Question {
|
|
|
9
9
|
static PM = 'pm';
|
|
10
10
|
|
|
11
11
|
/**
|
|
12
|
-
* @param {import('
|
|
13
|
-
* @param {string} [params.dateFormat]
|
|
14
|
-
* @param {string} [params.timeFormat]
|
|
12
|
+
* @param {import('../../questions/question-props.d.ts').DateTimeQuestionParams} params
|
|
15
13
|
*/
|
|
16
|
-
constructor({ dateFormat = DEFAULT_DATE_FORMAT, timeFormat = DEFAULT_TIME_FORMAT, ...
|
|
14
|
+
constructor({ dateFormat = DEFAULT_DATE_FORMAT, timeFormat = DEFAULT_TIME_FORMAT, ...parentParams }) {
|
|
17
15
|
super({
|
|
18
|
-
...
|
|
16
|
+
...parentParams,
|
|
19
17
|
viewFolder: 'date-time'
|
|
20
18
|
});
|
|
21
19
|
this.dateFormat = dateFormat;
|
|
@@ -15,11 +15,7 @@ import SingleLineInputQuestion from '../single-line-input/question.js';
|
|
|
15
15
|
*/
|
|
16
16
|
export class EmailQuestion extends SingleLineInputQuestion {
|
|
17
17
|
/**
|
|
18
|
-
* @param {import('
|
|
19
|
-
* @param {string|undefined} [params.label] if defined this show as a label for the input and the question will just be a standard h1
|
|
20
|
-
* @param {Record<string, string>} [params.inputAttributes] html attributes to add to the input (will be merged with email defaults)
|
|
21
|
-
* @param {string} [params.classes] html classes to add to the input
|
|
22
|
-
* @param {string} [params.autocomplete] autocomplete attribute value (defaults to 'email')
|
|
18
|
+
* @param {import('../../questions/question-props.d.ts').EmailQuestionParams} params
|
|
23
19
|
*/
|
|
24
20
|
constructor(params) {
|
|
25
21
|
// Set default input attributes for email
|
|
@@ -19,7 +19,7 @@ export class ManageListQuestion extends Question {
|
|
|
19
19
|
#confirmationQuestionParam;
|
|
20
20
|
|
|
21
21
|
/**
|
|
22
|
-
* @param {import('
|
|
22
|
+
* @param {import('../../questions/question-props.d.ts').ManageListQuestionParams} params
|
|
23
23
|
*/
|
|
24
24
|
constructor(params) {
|
|
25
25
|
super({
|
|
@@ -15,11 +15,11 @@ import { nl2br } from '../../lib/utils.js';
|
|
|
15
15
|
*/
|
|
16
16
|
export class MultiFieldInputQuestion extends Question {
|
|
17
17
|
/**
|
|
18
|
-
* @param {import('
|
|
18
|
+
* @param {import('../../questions/question-props.d.ts').MultiFieldInputQuestionParams} params
|
|
19
19
|
*/
|
|
20
|
-
constructor({ inputFields, ...
|
|
20
|
+
constructor({ inputFields, ...parentParams }) {
|
|
21
21
|
super({
|
|
22
|
-
...
|
|
22
|
+
...parentParams,
|
|
23
23
|
viewFolder: 'multi-field-input'
|
|
24
24
|
});
|
|
25
25
|
|
|
@@ -3,13 +3,11 @@ import { getPersistedNumberAnswer } from '../utils/persisted-number-answer.js';
|
|
|
3
3
|
|
|
4
4
|
export class NumberEntryQuestion extends Question {
|
|
5
5
|
/**
|
|
6
|
-
* @param {import('
|
|
7
|
-
* @param {string} [params.suffix]
|
|
8
|
-
* @param {string|undefined} [params.label] if defined this show as a label for the input and the question will just be a standard h1
|
|
6
|
+
* @param {import('../../questions/question-props.d.ts').NumberEntryQuestionParams} params
|
|
9
7
|
*/
|
|
10
|
-
constructor({ label, suffix, ...
|
|
8
|
+
constructor({ label, suffix, ...parentParams }) {
|
|
11
9
|
super({
|
|
12
|
-
...
|
|
10
|
+
...parentParams,
|
|
13
11
|
viewFolder: 'number-entry'
|
|
14
12
|
});
|
|
15
13
|
|
|
@@ -2,23 +2,7 @@ import OptionsQuestion from '../../questions/options-question.js';
|
|
|
2
2
|
|
|
3
3
|
export class RadioQuestion extends OptionsQuestion {
|
|
4
4
|
/**
|
|
5
|
-
* @param {
|
|
6
|
-
* @param {string} params.title
|
|
7
|
-
* @param {string} params.question
|
|
8
|
-
* @param {string} params.fieldName
|
|
9
|
-
* @param {string} [params.viewFolder]
|
|
10
|
-
* @param {string} [params.url]
|
|
11
|
-
* @param {string} [params.hint]
|
|
12
|
-
* @param {string} [params.pageTitle]
|
|
13
|
-
* @param {string} [params.description]
|
|
14
|
-
* @param {string} [params.label]
|
|
15
|
-
* @param {string} [params.html]
|
|
16
|
-
* @param {string} [params.legend] - optional legend, used instead of h1
|
|
17
|
-
* @param {Array.<import('../../questions/options-question.js').Option>} params.options
|
|
18
|
-
* @param {Array.<import('#base-validator').BaseValidator>} [params.validators]
|
|
19
|
-
* @param {boolean} [params.editable]
|
|
20
|
-
* @param {Object<string, any>} [params.viewData]
|
|
21
|
-
* @param {import('#question-types').ActionLink} [params.actionLink]
|
|
5
|
+
* @param {import('../../questions/question-props.d.ts').RadioQuestionParams} params
|
|
22
6
|
*/
|
|
23
7
|
constructor({
|
|
24
8
|
title,
|
|
@@ -3,22 +3,7 @@ import OptionsQuestion from '../../questions/options-question.js';
|
|
|
3
3
|
export class SelectQuestion extends OptionsQuestion {
|
|
4
4
|
#disableAccessibleAutocomplete;
|
|
5
5
|
/**
|
|
6
|
-
* @param {
|
|
7
|
-
* @param {string} params.title
|
|
8
|
-
* @param {string} params.question
|
|
9
|
-
* @param {string} params.fieldName
|
|
10
|
-
* @param {string} [params.viewFolder]
|
|
11
|
-
* @param {string} [params.url]
|
|
12
|
-
* @param {string} [params.hint]
|
|
13
|
-
* @param {string} [params.pageTitle]
|
|
14
|
-
* @param {string} [params.description]
|
|
15
|
-
* @param {string} [params.label]
|
|
16
|
-
* @param {string} [params.html]
|
|
17
|
-
* @param {string} [params.legend] - optional legend, used instead of h1
|
|
18
|
-
* @param {string} [params.disableAccessibleAutocomplete]
|
|
19
|
-
* @param {Array.<import('../../questions/options-question.js').Option>} params.options
|
|
20
|
-
* @param {Object<string, any>} [params.viewData]
|
|
21
|
-
* @param {Array.<import('#base-validator').BaseValidator>} [params.validators]
|
|
6
|
+
* @param {import('../../questions/question-props.d.ts').SelectQuestionParams} params
|
|
22
7
|
*/
|
|
23
8
|
constructor({
|
|
24
9
|
title,
|
|
@@ -8,10 +8,7 @@ export class SingleLineInputQuestion extends Question {
|
|
|
8
8
|
inputAttributes;
|
|
9
9
|
|
|
10
10
|
/**
|
|
11
|
-
* @param {import('
|
|
12
|
-
* @param {string|undefined} [params.label] if defined this show as a label for the input and the question will just be a standard h1
|
|
13
|
-
* @param {Record<string, string>} [params.inputAttributes] html attributes to add to the input
|
|
14
|
-
* @param {string} [params.classes] html classes to add to the input
|
|
11
|
+
* @param {import('../../questions/question-props.d.ts').SingleLineInputQuestionParams} params
|
|
15
12
|
*/
|
|
16
13
|
constructor(params) {
|
|
17
14
|
super({
|
|
@@ -19,13 +19,11 @@ import { Question } from '#question';
|
|
|
19
19
|
*/
|
|
20
20
|
export class TextEntryQuestion extends Question {
|
|
21
21
|
/**
|
|
22
|
-
* @param {import('
|
|
23
|
-
* @param {TextEntryCheckbox} [params.textEntryCheckbox]
|
|
24
|
-
* @param {string|undefined} [params.label] if defined this show as a label for the input and the question will just be a standard h1
|
|
22
|
+
* @param {import('../../questions/question-props.d.ts').TextEntryQuestionParams} params
|
|
25
23
|
*/
|
|
26
|
-
constructor({ textEntryCheckbox, label, ...
|
|
24
|
+
constructor({ textEntryCheckbox, label, ...parentParams }) {
|
|
27
25
|
super({
|
|
28
|
-
...
|
|
26
|
+
...parentParams,
|
|
29
27
|
viewFolder: 'text-entry'
|
|
30
28
|
});
|
|
31
29
|
|
|
@@ -9,14 +9,7 @@ export const TRUNCATED_MAX_LENGTH = 500;
|
|
|
9
9
|
*/
|
|
10
10
|
export class TextEntryRedactQuestion extends Question {
|
|
11
11
|
/**
|
|
12
|
-
* @param {import('
|
|
13
|
-
* @param {import('../text-entry/question.js').TextEntryCheckbox} [params.textEntryCheckbox]
|
|
14
|
-
* @param {string|undefined} [params.label] if defined this show as a label for the input and the question will just be a standard h1
|
|
15
|
-
* @param {boolean} [params.onlyShowRedactedValueForSummary] whether to only show redacted value for summary
|
|
16
|
-
* @param {boolean} [params.useRedactedFieldNameForSave] whether to use the redacted field name when saving answers
|
|
17
|
-
* @param {boolean} [params.showSuggestionsUi] use the suggestions UI for this question
|
|
18
|
-
* @param {string} [params.summaryText] summaryText to use with the details component
|
|
19
|
-
* @param {boolean} [params.shouldTruncateSummary] determines whether redacted comment is truncated in summary view
|
|
12
|
+
* @param {import('../../questions/question-props.d.ts').TextEntryRedactQuestionParams} params
|
|
20
13
|
*/
|
|
21
14
|
constructor({
|
|
22
15
|
textEntryCheckbox,
|
|
@@ -26,10 +19,10 @@ export class TextEntryRedactQuestion extends Question {
|
|
|
26
19
|
showSuggestionsUi,
|
|
27
20
|
summaryText,
|
|
28
21
|
shouldTruncateSummary,
|
|
29
|
-
...
|
|
22
|
+
...parentParams
|
|
30
23
|
}) {
|
|
31
24
|
super({
|
|
32
|
-
...
|
|
25
|
+
...parentParams,
|
|
33
26
|
viewFolder: 'text-entry-redact'
|
|
34
27
|
});
|
|
35
28
|
|
|
@@ -35,16 +35,13 @@ export class UnitOptionEntryQuestion extends Question {
|
|
|
35
35
|
options;
|
|
36
36
|
|
|
37
37
|
/**
|
|
38
|
-
* @param {import('
|
|
39
|
-
* @param {string} [params.conditionalFieldName] // will be the quantity and is captured by the conditional in the options
|
|
40
|
-
* @param {string} [params.label]
|
|
41
|
-
* @param {Array.<UnitOption>} [params.options]
|
|
38
|
+
* @param {import('../../questions/question-props.d.ts').UnitOptionEntryQuestionParams} params
|
|
42
39
|
* @param {Record<string, Function>} [methodOverrides]
|
|
43
40
|
*/
|
|
44
|
-
constructor({ conditionalFieldName, options, label, ...
|
|
41
|
+
constructor({ conditionalFieldName, options, label, ...parentParams }, methodOverrides) {
|
|
45
42
|
super(
|
|
46
43
|
{
|
|
47
|
-
...
|
|
44
|
+
...parentParams,
|
|
48
45
|
viewFolder: 'unit-option-entry'
|
|
49
46
|
},
|
|
50
47
|
methodOverrides
|
|
@@ -18,14 +18,22 @@ type QuestionTypes =
|
|
|
18
18
|
| 'text-entry-redact'
|
|
19
19
|
| 'unit-option';
|
|
20
20
|
|
|
21
|
-
|
|
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 =
|
|
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
|
-
|
|
100
|
-
|
|
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
|
|
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
|
|
129
|
+
export type DateQuestionParams = CommonQuestionParams & {
|
|
130
|
+
dateFormat?: string;
|
|
131
|
+
};
|
|
132
|
+
|
|
133
|
+
type DateQuestionProps = DateQuestionParams & {
|
|
111
134
|
type: 'date';
|
|
112
135
|
};
|
|
113
136
|
|
|
114
|
-
|
|
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
|
|
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
|
|
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
|
|
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
|
|
131
|
-
type: 'multi-field-input';
|
|
185
|
+
export type MultiFieldInputQuestionParams = CommonQuestionParams & {
|
|
132
186
|
inputFields: InputField[];
|
|
133
187
|
};
|
|
134
188
|
|
|
135
|
-
type
|
|
136
|
-
type: '
|
|
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
|
|
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
|
|
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
|
|
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
|
|
231
|
+
export type SiteAddressQuestionParams = CommonQuestionParams;
|
|
232
|
+
|
|
233
|
+
type SiteAddressQuestionProps = SiteAddressQuestionParams & {
|
|
157
234
|
type: 'site-address';
|
|
158
235
|
};
|
|
159
236
|
|
|
160
|
-
type
|
|
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
|
|
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
|
|
169
|
-
|
|
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 =
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
export class AddressQuestion extends Question {
|
|
2
2
|
/**
|
|
3
|
-
* @param {import('
|
|
3
|
+
* @param {import('../../questions/question-props.d.ts').SiteAddressQuestionParams} params
|
|
4
4
|
*/
|
|
5
|
-
constructor(params: import("
|
|
5
|
+
constructor(params: import("../../questions/question-props.d.ts").SiteAddressQuestionParams);
|
|
6
6
|
requiredFields: {
|
|
7
7
|
addressLine1: boolean;
|
|
8
8
|
addressLine2: boolean;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"question.d.ts","sourceRoot":"","sources":["../../../../src/components/address/question.js"],"names":[],"mappings":"AAOA;IACC;;OAEG;IACH,oBAFW,OAAO,
|
|
1
|
+
{"version":3,"file":"question.d.ts","sourceRoot":"","sources":["../../../../src/components/address/question.js"],"names":[],"mappings":"AAOA;IACC;;OAEG;IACH,oBAFW,OAAO,qCAAqC,EAAE,yBAAyB,EAqBjF;IAXE;;;;;;kBAA8C;IAIhD;;;;;;MAMC;IAiBF;;;OAGG;IACH,4BAHW,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,GACjB,GAAC,GAAC,MAAM,CAqBpB;IAqCD;;;OAGG;IACH;;eAUC;IAuBD,kEAMC;CACD;;yBAtJwB,WAAW"}
|
|
@@ -7,37 +7,10 @@ export function booleanToYesNoValue(value: any): "yes" | "no";
|
|
|
7
7
|
export function booleanToYesNoOrNull(value: boolean | null): string | null;
|
|
8
8
|
export class BooleanQuestion extends RadioQuestion {
|
|
9
9
|
/**
|
|
10
|
-
* @param {
|
|
11
|
-
* @param {string} params.title
|
|
12
|
-
* @param {string} params.question
|
|
13
|
-
* @param {string} params.fieldName
|
|
14
|
-
* @param {string} [params.url]
|
|
15
|
-
* @param {string} [params.hint]
|
|
16
|
-
* @param {string} [params.pageTitle]
|
|
17
|
-
* @param {string} [params.description]
|
|
18
|
-
* @param {string} [params.html]
|
|
19
|
-
* @param {string} [params.interfaceType]
|
|
20
|
-
* @param {Array.<import('../../questions/options-question.js').Option>} [params.options]
|
|
21
|
-
* @param {Array.<import('#base-validator').BaseValidator>} [params.validators]
|
|
22
|
-
* @param {boolean} [params.editable]
|
|
23
|
-
* @param {import('#question-types').QuestionParameters['viewData']} [params.viewData]
|
|
10
|
+
* @param {import('../../questions/question-props.d.ts').BooleanQuestionParams} params
|
|
24
11
|
*/
|
|
25
|
-
constructor({ title, question, fieldName, url, hint, pageTitle, description, html, validators, interfaceType, options, editable, viewData }:
|
|
26
|
-
|
|
27
|
-
question: string;
|
|
28
|
-
fieldName: string;
|
|
29
|
-
url?: string | undefined;
|
|
30
|
-
hint?: string | undefined;
|
|
31
|
-
pageTitle?: string | undefined;
|
|
32
|
-
description?: string | undefined;
|
|
33
|
-
html?: string | undefined;
|
|
34
|
-
interfaceType?: string | undefined;
|
|
35
|
-
options?: import("../../questions/options-question.js").Option[] | undefined;
|
|
36
|
-
validators?: import("#base-validator").BaseValidator[] | undefined;
|
|
37
|
-
editable?: boolean | undefined;
|
|
38
|
-
viewData?: import("#question-types").QuestionParameters["viewData"];
|
|
39
|
-
});
|
|
40
|
-
interfaceType: string;
|
|
12
|
+
constructor({ title, question, fieldName, url, hint, pageTitle, description, html, validators, interfaceType, options, editable, viewData }: import("../../questions/question-props.d.ts").BooleanQuestionParams);
|
|
13
|
+
interfaceType: "checkbox" | "radio";
|
|
41
14
|
/**
|
|
42
15
|
* Get the data to save from the request, returns an object of answers
|
|
43
16
|
* @param {import('express').Request} req
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"question.d.ts","sourceRoot":"","sources":["../../../../src/components/boolean/question.js"],"names":[],"mappings":"AAEA;;;GAGG;AAMI,sCAHI,MAAM,GAAC,GAAC,GACN,OAAO,CAOnB;AAEM,8DAEN;AAMM,4CAHI,OAAO,GAAC,IAAI,GACV,MAAM,GAAC,IAAI,CAOvB;AAED;IACC
|
|
1
|
+
{"version":3,"file":"question.d.ts","sourceRoot":"","sources":["../../../../src/components/boolean/question.js"],"names":[],"mappings":"AAEA;;;GAGG;AAMI,sCAHI,MAAM,GAAC,GAAC,GACN,OAAO,CAOnB;AAEM,8DAEN;AAMM,4CAHI,OAAO,GAAC,IAAI,GACV,MAAM,GAAC,IAAI,CAOvB;AAED;IACC;;OAEG;IACH,6IAFW,OAAO,qCAAqC,EAAE,qBAAqB,EAmD7E;IADA,oCAAkC;IAGnC;;;;;OAKG,CACH,mBAJW,OAAO,SAAS,EAAE,OAAO,mBACzB,eAAe,GACb,OAAO,CAAC;QAAE,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAA;KAAE,CAAC,CAezD;CACD;;0BA5GyB,sBAAsB"}
|
|
@@ -6,28 +6,9 @@
|
|
|
6
6
|
*/
|
|
7
7
|
export class CheckboxQuestion extends OptionsQuestion {
|
|
8
8
|
/**
|
|
9
|
-
* @param {
|
|
10
|
-
* @param {string} params.title
|
|
11
|
-
* @param {string} params.question
|
|
12
|
-
* @param {string} params.fieldName
|
|
13
|
-
* @param {string} [params.url]
|
|
14
|
-
* @param {string} [params.pageTitle]
|
|
15
|
-
* @param {string} [params.description]
|
|
16
|
-
* @param {Array.<import('../../questions/options-question.js').Option>} params.options
|
|
17
|
-
* @param {Array.<import('#base-validator').BaseValidator>} [params.validators]
|
|
18
|
-
* @param {import('#question-types').QuestionParameters['viewData']} [params.viewData]
|
|
9
|
+
* @param {import('../../questions/question-props.d.ts').CheckboxQuestionParams} params
|
|
19
10
|
*/
|
|
20
|
-
constructor({ title, question, fieldName, url, pageTitle, description, options, validators, viewData }:
|
|
21
|
-
title: string;
|
|
22
|
-
question: string;
|
|
23
|
-
fieldName: string;
|
|
24
|
-
url?: string | undefined;
|
|
25
|
-
pageTitle?: string | undefined;
|
|
26
|
-
description?: string | undefined;
|
|
27
|
-
options: Array<import("../../questions/options-question.js").Option>;
|
|
28
|
-
validators?: import("#base-validator").BaseValidator[] | undefined;
|
|
29
|
-
viewData?: import("#question-types").QuestionParameters["viewData"];
|
|
30
|
-
});
|
|
11
|
+
constructor({ title, question, fieldName, url, pageTitle, description, options, validators, viewData }: import("../../questions/question-props.d.ts").CheckboxQuestionParams);
|
|
31
12
|
/**
|
|
32
13
|
* returns the formatted answers values to be used to build task list elements
|
|
33
14
|
* @param {string | ConditionalAnswerObject } answer will be a single value string, a comma-separated string representing multiple values (one of which may be a conditional) or a single ConditionalAnswerObject
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"question.d.ts","sourceRoot":"","sources":["../../../../src/components/checkbox/question.js"],"names":[],"mappings":"AAKA;;;;;GAKG;AAEH;IACC
|
|
1
|
+
{"version":3,"file":"question.d.ts","sourceRoot":"","sources":["../../../../src/components/checkbox/question.js"],"names":[],"mappings":"AAKA;;;;;GAKG;AAEH;IACC;;OAEG;IACH,wGAFW,OAAO,qCAAqC,EAAE,sBAAsB,EAiB9E;IAED;;;;;;OAMG;IACH,wDAJW,OAAO,UAAU,EAAE,OAAO,UAD1B,MAAM,GAAG,uBAAuB,GAG9B,KAAK,CAAE,MAAM,CAAC,CAuC1B;CACD;;;;;;WAtEa,MAAM;;;;iBACN,MAAM;;4BATQ,qCAAqC"}
|