@defra/forms-model 3.0.450 → 3.0.451

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.
@@ -2,6 +2,8 @@ export * from "./date-input.js";
2
2
  export * from "./email-address.js";
3
3
  export * from "./list.js";
4
4
  export * from "./list-sortable.js";
5
+ export * from "./month-year.js";
6
+ export * from "./number-only.js";
5
7
  export * from "./phone-number.js";
6
8
  export * from "./question.js";
7
9
  export * from "./radio.js";
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","names":[],"sources":["../../../../../src/form/form-editor/preview/index.js"],"sourcesContent":["export * from '~/src/form/form-editor/preview/date-input.js'\nexport * from '~/src/form/form-editor/preview/email-address.js'\nexport * from '~/src/form/form-editor/preview/list.js'\nexport * from '~/src/form/form-editor/preview/list-sortable.js'\nexport * from '~/src/form/form-editor/preview/phone-number.js'\nexport * from '~/src/form/form-editor/preview/question.js'\nexport * from '~/src/form/form-editor/preview/radio.js'\nexport * from '~/src/form/form-editor/preview/radio-sortable.js'\nexport * from '~/src/form/form-editor/preview/short-answer.js'\nexport * from '~/src/form/form-editor/preview/long-answer.js'\nexport * from '~/src/form/form-editor/preview/uk-address.js'\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA","ignoreList":[]}
1
+ {"version":3,"file":"index.js","names":[],"sources":["../../../../../src/form/form-editor/preview/index.js"],"sourcesContent":["export * from '~/src/form/form-editor/preview/date-input.js'\nexport * from '~/src/form/form-editor/preview/email-address.js'\nexport * from '~/src/form/form-editor/preview/list.js'\nexport * from '~/src/form/form-editor/preview/list-sortable.js'\nexport * from '~/src/form/form-editor/preview/month-year.js'\nexport * from '~/src/form/form-editor/preview/number-only.js'\nexport * from '~/src/form/form-editor/preview/phone-number.js'\nexport * from '~/src/form/form-editor/preview/question.js'\nexport * from '~/src/form/form-editor/preview/radio.js'\nexport * from '~/src/form/form-editor/preview/radio-sortable.js'\nexport * from '~/src/form/form-editor/preview/short-answer.js'\nexport * from '~/src/form/form-editor/preview/long-answer.js'\nexport * from '~/src/form/form-editor/preview/uk-address.js'\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA","ignoreList":[]}
@@ -0,0 +1,24 @@
1
+ import { Question } from "./question.js";
2
+ export class MonthYearQuestion extends Question {
3
+ /**
4
+ * @type {string}
5
+ * @protected
6
+ */
7
+ _questionTemplate = 'monthyearfield.njk';
8
+ get renderInput() {
9
+ return {
10
+ id: 'monthYear',
11
+ name: 'monthYearField',
12
+ fieldset: this.fieldSet,
13
+ hint: this.hint,
14
+ items: [{
15
+ name: 'month',
16
+ classes: 'govuk-input--width-2'
17
+ }, {
18
+ name: 'year',
19
+ classes: 'govuk-input--width-4'
20
+ }]
21
+ };
22
+ }
23
+ }
24
+ //# sourceMappingURL=month-year.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"month-year.js","names":["Question","MonthYearQuestion","_questionTemplate","renderInput","id","name","fieldset","fieldSet","hint","items","classes"],"sources":["../../../../../src/form/form-editor/preview/month-year.js"],"sourcesContent":["import { Question } from '~/src/form/form-editor/preview/question.js'\n\nexport class MonthYearQuestion extends Question {\n /**\n * @type {string}\n * @protected\n */\n _questionTemplate = 'monthyearfield.njk'\n\n get renderInput() {\n return {\n id: 'monthYear',\n name: 'monthYearField',\n fieldset: this.fieldSet,\n hint: this.hint,\n items: [\n { name: 'month', classes: 'govuk-input--width-2' },\n { name: 'year', classes: 'govuk-input--width-4' }\n ]\n }\n }\n}\n"],"mappings":"AAAA,SAASA,QAAQ;AAEjB,OAAO,MAAMC,iBAAiB,SAASD,QAAQ,CAAC;EAC9C;AACF;AACA;AACA;EACEE,iBAAiB,GAAG,oBAAoB;EAExC,IAAIC,WAAWA,CAAA,EAAG;IAChB,OAAO;MACLC,EAAE,EAAE,WAAW;MACfC,IAAI,EAAE,gBAAgB;MACtBC,QAAQ,EAAE,IAAI,CAACC,QAAQ;MACvBC,IAAI,EAAE,IAAI,CAACA,IAAI;MACfC,KAAK,EAAE,CACL;QAAEJ,IAAI,EAAE,OAAO;QAAEK,OAAO,EAAE;MAAuB,CAAC,EAClD;QAAEL,IAAI,EAAE,MAAM;QAAEK,OAAO,EAAE;MAAuB,CAAC;IAErD,CAAC;EACH;AACF","ignoreList":[]}
@@ -0,0 +1,20 @@
1
+ import { Question } from "./question.js";
2
+ export class NumberOnlyQuestion extends Question {
3
+ /**
4
+ * @type {QuestionBaseModel}
5
+ */
6
+ get renderInput() {
7
+ return {
8
+ id: this._fieldName,
9
+ name: this._fieldName,
10
+ label: this.label,
11
+ hint: this.hint,
12
+ type: 'number'
13
+ };
14
+ }
15
+ }
16
+
17
+ /**
18
+ * @import { QuestionBaseModel } from '~/src/form/form-editor/preview/types.js'
19
+ */
20
+ //# sourceMappingURL=number-only.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"number-only.js","names":["Question","NumberOnlyQuestion","renderInput","id","_fieldName","name","label","hint","type"],"sources":["../../../../../src/form/form-editor/preview/number-only.js"],"sourcesContent":["import { Question } from '~/src/form/form-editor/preview/question.js'\n\nexport class NumberOnlyQuestion extends Question {\n /**\n * @type {QuestionBaseModel}\n */\n get renderInput() {\n return {\n id: this._fieldName,\n name: this._fieldName,\n label: this.label,\n hint: this.hint,\n type: 'number'\n }\n }\n}\n\n/**\n * @import { QuestionBaseModel } from '~/src/form/form-editor/preview/types.js'\n */\n"],"mappings":"AAAA,SAASA,QAAQ;AAEjB,OAAO,MAAMC,kBAAkB,SAASD,QAAQ,CAAC;EAC/C;AACF;AACA;EACE,IAAIE,WAAWA,CAAA,EAAG;IAChB,OAAO;MACLC,EAAE,EAAE,IAAI,CAACC,UAAU;MACnBC,IAAI,EAAE,IAAI,CAACD,UAAU;MACrBE,KAAK,EAAE,IAAI,CAACA,KAAK;MACjBC,IAAI,EAAE,IAAI,CAACA,IAAI;MACfC,IAAI,EAAE;IACR,CAAC;EACH;AACF;;AAEA;AACA;AACA","ignoreList":[]}
@@ -1 +1 @@
1
- {"version":3,"file":"types.js","names":[],"sources":["../../../../../src/form/form-editor/preview/types.ts"],"sourcesContent":["import { type DateInputQuestion } from '~/src/form/form-editor/preview/date-input.js'\nimport { type EmailAddressQuestion } from '~/src/form/form-editor/preview/email-address.js'\nimport { type ListSortableQuestion } from '~/src/form/form-editor/preview/list-sortable.js'\nimport { type LongAnswerQuestion } from '~/src/form/form-editor/preview/long-answer.js'\nimport { type PhoneNumberQuestion } from '~/src/form/form-editor/preview/phone-number.js'\nimport { type Question } from '~/src/form/form-editor/preview/question.js'\nimport { type RadioSortableQuestion } from '~/src/form/form-editor/preview/radio-sortable.js'\nimport { type ShortAnswerQuestion } from '~/src/form/form-editor/preview/short-answer.js'\nimport { type UkAddressQuestion } from '~/src/form/form-editor/preview/uk-address.js'\nimport {\n type ListElement,\n type ListItemReadonly\n} from '~/src/form/form-editor/types.js'\n\nexport interface BaseSettings {\n question: string\n hintText: string\n optional: boolean\n shortDesc: string\n items: ListElement[]\n}\n\nexport interface DefaultComponent {\n id?: string\n text: string\n classes: string\n}\n\nexport interface GovukFieldset {\n legend: DefaultComponent\n}\n\nexport interface QuestionBaseModel {\n id?: string\n name?: string\n label?: DefaultComponent\n hint?: DefaultComponent\n fieldset?: GovukFieldset\n readonly items?: ListItemReadonly[]\n text?: string\n formGroup?: { afterInputs: { html: string } }\n}\n\nexport type ListenerRow = [\n HTMLInputElement | null,\n (target: HTMLInputElement, e: Event) => void,\n keyof HTMLElementEventMap\n]\n\nexport interface QuestionElements {\n readonly values: BaseSettings\n setPreviewHTML(value: string): void\n}\n\nexport interface RenderContext {\n model: QuestionBaseModel\n}\n\nexport interface HTMLBuilder {\n buildHTML(questionTemplate: string, renderContext: RenderContext): string\n}\n\nexport interface QuestionRenderer {\n render(questionTemplate: string, questionBaseModel: QuestionBaseModel): void\n}\n\nexport interface ListElements extends QuestionElements {\n afterInputsHTML: string\n}\n\nexport type PreviewQuestion =\n | DateInputQuestion\n | EmailAddressQuestion\n | ListSortableQuestion\n | LongAnswerQuestion\n | PhoneNumberQuestion\n | Question\n | RadioSortableQuestion\n | ShortAnswerQuestion\n | UkAddressQuestion\n"],"mappings":"","ignoreList":[]}
1
+ {"version":3,"file":"types.js","names":[],"sources":["../../../../../src/form/form-editor/preview/types.ts"],"sourcesContent":["import { type DateInputQuestion } from '~/src/form/form-editor/preview/date-input.js'\nimport { type EmailAddressQuestion } from '~/src/form/form-editor/preview/email-address.js'\nimport { type ListSortableQuestion } from '~/src/form/form-editor/preview/list-sortable.js'\nimport { type LongAnswerQuestion } from '~/src/form/form-editor/preview/long-answer.js'\nimport { type PhoneNumberQuestion } from '~/src/form/form-editor/preview/phone-number.js'\nimport { type Question } from '~/src/form/form-editor/preview/question.js'\nimport { type RadioSortableQuestion } from '~/src/form/form-editor/preview/radio-sortable.js'\nimport { type ShortAnswerQuestion } from '~/src/form/form-editor/preview/short-answer.js'\nimport { type UkAddressQuestion } from '~/src/form/form-editor/preview/uk-address.js'\nimport {\n type DateItem,\n type ListElement,\n type ListItemReadonly\n} from '~/src/form/form-editor/types.js'\n\nexport interface BaseSettings {\n question: string\n hintText: string\n optional: boolean\n shortDesc: string\n items: ListElement[]\n}\n\nexport interface DefaultComponent {\n id?: string\n text: string\n classes: string\n}\n\nexport interface GovukFieldset {\n legend: DefaultComponent\n}\n\nexport interface QuestionBaseModel {\n id?: string\n name?: string\n label?: DefaultComponent\n hint?: DefaultComponent\n fieldset?: GovukFieldset\n readonly items?: ListItemReadonly[] | DateItem[]\n text?: string\n formGroup?: { afterInputs: { html: string } }\n type?: 'text' | 'number'\n}\n\nexport type ListenerRow = [\n HTMLInputElement | null,\n (target: HTMLInputElement, e: Event) => void,\n keyof HTMLElementEventMap\n]\n\nexport interface QuestionElements {\n readonly values: BaseSettings\n setPreviewHTML(value: string): void\n}\n\nexport interface RenderContext {\n model: QuestionBaseModel\n}\n\nexport interface HTMLBuilder {\n buildHTML(questionTemplate: string, renderContext: RenderContext): string\n}\n\nexport interface QuestionRenderer {\n render(questionTemplate: string, questionBaseModel: QuestionBaseModel): void\n}\n\nexport interface ListElements extends QuestionElements {\n afterInputsHTML: string\n}\n\nexport type PreviewQuestion =\n | DateInputQuestion\n | EmailAddressQuestion\n | ListSortableQuestion\n | LongAnswerQuestion\n | PhoneNumberQuestion\n | Question\n | RadioSortableQuestion\n | ShortAnswerQuestion\n | UkAddressQuestion\n"],"mappings":"","ignoreList":[]}
@@ -1 +1 @@
1
- {"version":3,"file":"types.js","names":[],"sources":["../../../../src/form/form-editor/types.ts"],"sourcesContent":["import { type ComponentType } from '~/src/components/enums.js'\nimport { type ComponentDef } from '~/src/components/types.js'\nimport { type Item } from '~/src/index.js'\n\n/**\n * Interface for `FormEditor` Joi schema\n */\nexport interface FormEditor {\n /**\n * The type of the page\n */\n pageType: string\n\n /**\n * The type of the question\n */\n questionType: string | undefined\n\n /**\n * The sub-type of written answer\n */\n writtenAnswerSub: string\n\n /**\n * The sub-type of date\n */\n dateSub: string\n\n /**\n * The sub-type of lists\n */\n listSub: string\n\n /**\n * The name of the question (unique id)\n */\n name: string\n\n /**\n * The text of the question\n */\n question: string\n\n /**\n * The hint text of the question\n */\n hintText: string\n\n /**\n * Denotes if the question is optional\n */\n questionOptional: string\n\n /**\n * The short description of the question\n */\n shortDescription: string\n\n /**\n * The value of checkbox to reveal heading and guidance section\n */\n pageHeadingAndGuidance: string\n\n /**\n * The page heading\n */\n pageHeading: string\n\n /**\n * The page guidance text\n */\n guidanceText: string\n\n /**\n * The value of checkbox to reveal repeater section\n */\n repeater: string\n\n /**\n * The maximum number of repeater items\n */\n minItems: number\n\n /**\n * The minimum number of repeater items\n */\n maxItems: number\n\n /**\n * The repeater question set name\n */\n questionSetName: string\n\n /**\n * The value of radio to reveal declaration text field\n */\n needDeclaration: string\n\n /**\n * The check answers declaration text\n */\n declarationText: string\n\n /**\n * The min length a field can have\n */\n minLength: string\n\n /**\n * The max length a field can have\n */\n maxLength: string\n\n /**\n * The regex value of a field\n */\n regex: string\n\n /**\n * The number of rows of a textarea\n */\n rows: string\n\n /**\n * The classes to be applied to a field\n */\n classes: string\n\n /**\n * The prefix to be applied to a field\n */\n prefix: string\n\n /**\n * The suffix to be applied to a field\n */\n suffix: string\n\n /**\n * The decimal precision of a number field\n */\n precision: string\n\n /**\n * The lowest number allowed in a field\n */\n min: string\n\n /**\n * The highest number allowed in a field\n */\n max: string\n\n /**\n * The maximum days in the future to allow for a date\n */\n maxFuture: string\n\n /**\n * The maximum days in the past to allow for a date\n */\n maxPast: string\n\n /**\n * The exact number of files to upload\n */\n exactFiles: string\n\n /**\n * The minimum number of files to upload\n */\n minFiles: string\n\n /**\n * The maximum number of files to upload\n */\n maxFiles: string\n\n /**\n * The type of files for upload\n */\n fileTypes: string[]\n\n /**\n * The types of document files for upload\n */\n documentTypes: string[]\n\n /**\n * The types of image files for upload\n */\n imageTypes: string[]\n\n /**\n * The types of tabular data files for upload\n */\n tabularDataTypes: string[]\n\n /**\n * The action required from within a sub-section\n */\n enhancedAction: string\n\n /**\n * Placeholder for inserted section to handle adding/editing radios or checkboxes\n */\n radiosOrCheckboxes: string\n\n /**\n * The unique id of the radio item\n */\n radioId: string\n\n /**\n * The display text of the radio item\n */\n radioText?: string\n\n /**\n * The hint of the radio item\n */\n radioHint?: string\n\n /**\n * The value of the radio item\n */\n radioValue?: string\n\n /**\n * The list name to be applied to a field (if applicable)\n */\n list: string\n\n /**\n * List items in JSON format, such as for radios ro checkboxes\n */\n listItemsData: string\n\n /**\n * An array of options for autocomplete\n */\n autoCompleteOptions: Item[]\n\n /**\n * Set to 'true' is Javascript is enabled\n */\n jsEnabled: string\n}\n\nexport type FormEditorInputPage = Pick<\n FormEditor,\n 'pageType' | 'questionType' | 'writtenAnswerSub' | 'dateSub' | 'listSub'\n>\n\nexport type FormEditorInputCheckAnswersSettings = Pick<\n FormEditor,\n 'needDeclaration' | 'declarationText'\n>\n\nexport type FormEditorInputQuestion = Pick<\n FormEditor,\n | 'questionType'\n | 'name'\n | 'question'\n | 'shortDescription'\n | 'hintText'\n | 'questionOptional'\n | 'minLength'\n | 'maxLength'\n | 'regex'\n | 'rows'\n | 'classes'\n | 'prefix'\n | 'suffix'\n | 'precision'\n | 'min'\n | 'max'\n | 'maxFuture'\n | 'maxPast'\n | 'exactFiles'\n | 'minFiles'\n | 'maxFiles'\n | 'fileTypes'\n | 'documentTypes'\n | 'imageTypes'\n | 'tabularDataTypes'\n | 'autoCompleteOptions'\n | 'enhancedAction'\n | 'radioId'\n | 'radioText'\n | 'radioHint'\n | 'radioValue'\n | 'list'\n | 'listItemsData'\n | 'jsEnabled'\n>\n\nexport type FormEditorInputPageSettings = Pick<\n FormEditor,\n | 'pageHeadingAndGuidance'\n | 'pageHeading'\n | 'guidanceText'\n | 'repeater'\n | 'minItems'\n | 'maxItems'\n | 'questionSetName'\n>\n\nexport type FormEditorInputGuidancePage = Pick<\n FormEditor,\n 'pageHeading' | 'guidanceText'\n>\n\nexport type FormEditorInputQuestionDetails = Pick<\n FormEditorInputQuestion,\n | 'question'\n | 'hintText'\n | 'shortDescription'\n | 'questionOptional'\n | 'questionType'\n | 'fileTypes'\n | 'documentTypes'\n | 'imageTypes'\n | 'tabularDataTypes'\n | 'autoCompleteOptions'\n | 'enhancedAction'\n | 'radioId'\n | 'radioText'\n | 'radioHint'\n | 'radioValue'\n | 'listItemsData'\n | 'jsEnabled'\n>\n\nexport interface ListItem {\n id?: string\n text?: string\n hint?: {\n text: string\n }\n value?: string\n}\n\nexport interface ListLabel {\n text: string\n classes: string\n}\n\nexport interface ListElement extends ListItem {\n readonly id: string\n text: string\n value: string\n label: ListLabel\n}\n\nexport interface ReadonlyHint {\n readonly text: string\n}\n\nexport interface ListItemReadonly extends ListElement {\n readonly text: string\n readonly hint?: ReadonlyHint\n readonly value: string\n readonly label: ListLabel\n}\n\nexport interface QuestionSessionState {\n questionType?: ComponentType\n questionDetails?: Partial<ComponentDef>\n editRow?: {\n radioId?: string\n radioText?: string\n radioHint?: string\n radioValue?: string\n expanded?: boolean\n }\n listItems?: ListItem[]\n isReordering?: boolean\n lastMovedId?: string\n lastMoveDirection?: string\n}\n\nexport interface GovukFieldItem {\n text?: string\n value?: string\n checked?: boolean\n}\n\nexport interface GovukField {\n id?: string\n name?: string\n idPrefix?: string\n fieldset?: {\n legend?: { text?: string; isPageHeading?: boolean; classes?: string }\n }\n value?: string | boolean | number | string[] | Item[]\n classes?: string\n label?: {\n text?: string\n html?: string\n classes?: string\n isPageHeading?: boolean\n }\n hint?: { text?: string; html?: string; classes?: string }\n items?: GovukFieldItem[]\n rows?: number\n type?: string\n customTemplate?: string\n}\n\nexport type GovukFieldQuestionOptional = Omit<GovukField, 'name' | 'items'> & {\n name: 'questionOptional'\n items: [\n {\n text?: string\n value?: string\n checked: boolean\n }\n ]\n}\n\nexport type GovukStringField = Omit<GovukField, 'value'> & { value: string }\n\nexport interface FormEditorGovukField {\n question?: GovukField\n hintText?: GovukField\n questionOptional?: GovukField\n shortDescription?: GovukField\n fileTypes?: GovukField\n documentTypes?: GovukField\n imageTypes?: GovukField\n tabularDataTypes?: GovukField\n radiosOrCheckboxes?: GovukField\n autoCompleteOptions?: GovukField\n errorMessage?: { text: string }\n}\n\nexport type FormEditorGovukFieldBase = Omit<\n FormEditorGovukField,\n 'errorMessage'\n>\n\nexport type FormEditorGovukFieldBaseKeys = keyof FormEditorGovukFieldBase\n\nexport interface FormEditorCheckbox {\n text?: string\n hint?: {\n text?: string\n }\n value?: string\n divider?: {\n text?: string\n hint?: string\n value?: string\n }\n}\n"],"mappings":"","ignoreList":[]}
1
+ {"version":3,"file":"types.js","names":[],"sources":["../../../../src/form/form-editor/types.ts"],"sourcesContent":["import { type ComponentType } from '~/src/components/enums.js'\nimport { type ComponentDef } from '~/src/components/types.js'\nimport { type Item } from '~/src/index.js'\n\n/**\n * Interface for `FormEditor` Joi schema\n */\nexport interface FormEditor {\n /**\n * The type of the page\n */\n pageType: string\n\n /**\n * The type of the question\n */\n questionType: string | undefined\n\n /**\n * The sub-type of written answer\n */\n writtenAnswerSub: string\n\n /**\n * The sub-type of date\n */\n dateSub: string\n\n /**\n * The sub-type of lists\n */\n listSub: string\n\n /**\n * The name of the question (unique id)\n */\n name: string\n\n /**\n * The text of the question\n */\n question: string\n\n /**\n * The hint text of the question\n */\n hintText: string\n\n /**\n * Denotes if the question is optional\n */\n questionOptional: string\n\n /**\n * The short description of the question\n */\n shortDescription: string\n\n /**\n * The value of checkbox to reveal heading and guidance section\n */\n pageHeadingAndGuidance: string\n\n /**\n * The page heading\n */\n pageHeading: string\n\n /**\n * The page guidance text\n */\n guidanceText: string\n\n /**\n * The value of checkbox to reveal repeater section\n */\n repeater: string\n\n /**\n * The maximum number of repeater items\n */\n minItems: number\n\n /**\n * The minimum number of repeater items\n */\n maxItems: number\n\n /**\n * The repeater question set name\n */\n questionSetName: string\n\n /**\n * The value of radio to reveal declaration text field\n */\n needDeclaration: string\n\n /**\n * The check answers declaration text\n */\n declarationText: string\n\n /**\n * The min length a field can have\n */\n minLength: string\n\n /**\n * The max length a field can have\n */\n maxLength: string\n\n /**\n * The regex value of a field\n */\n regex: string\n\n /**\n * The number of rows of a textarea\n */\n rows: string\n\n /**\n * The classes to be applied to a field\n */\n classes: string\n\n /**\n * The prefix to be applied to a field\n */\n prefix: string\n\n /**\n * The suffix to be applied to a field\n */\n suffix: string\n\n /**\n * The decimal precision of a number field\n */\n precision: string\n\n /**\n * The lowest number allowed in a field\n */\n min: string\n\n /**\n * The highest number allowed in a field\n */\n max: string\n\n /**\n * The maximum days in the future to allow for a date\n */\n maxFuture: string\n\n /**\n * The maximum days in the past to allow for a date\n */\n maxPast: string\n\n /**\n * The exact number of files to upload\n */\n exactFiles: string\n\n /**\n * The minimum number of files to upload\n */\n minFiles: string\n\n /**\n * The maximum number of files to upload\n */\n maxFiles: string\n\n /**\n * The type of files for upload\n */\n fileTypes: string[]\n\n /**\n * The types of document files for upload\n */\n documentTypes: string[]\n\n /**\n * The types of image files for upload\n */\n imageTypes: string[]\n\n /**\n * The types of tabular data files for upload\n */\n tabularDataTypes: string[]\n\n /**\n * The action required from within a sub-section\n */\n enhancedAction: string\n\n /**\n * Placeholder for inserted section to handle adding/editing radios or checkboxes\n */\n radiosOrCheckboxes: string\n\n /**\n * The unique id of the radio item\n */\n radioId: string\n\n /**\n * The display text of the radio item\n */\n radioText?: string\n\n /**\n * The hint of the radio item\n */\n radioHint?: string\n\n /**\n * The value of the radio item\n */\n radioValue?: string\n\n /**\n * The list name to be applied to a field (if applicable)\n */\n list: string\n\n /**\n * List items in JSON format, such as for radios ro checkboxes\n */\n listItemsData: string\n\n /**\n * An array of options for autocomplete\n */\n autoCompleteOptions: Item[]\n\n /**\n * Set to 'true' is Javascript is enabled\n */\n jsEnabled: string\n}\n\nexport type FormEditorInputPage = Pick<\n FormEditor,\n 'pageType' | 'questionType' | 'writtenAnswerSub' | 'dateSub' | 'listSub'\n>\n\nexport type FormEditorInputCheckAnswersSettings = Pick<\n FormEditor,\n 'needDeclaration' | 'declarationText'\n>\n\nexport type FormEditorInputQuestion = Pick<\n FormEditor,\n | 'questionType'\n | 'name'\n | 'question'\n | 'shortDescription'\n | 'hintText'\n | 'questionOptional'\n | 'minLength'\n | 'maxLength'\n | 'regex'\n | 'rows'\n | 'classes'\n | 'prefix'\n | 'suffix'\n | 'precision'\n | 'min'\n | 'max'\n | 'maxFuture'\n | 'maxPast'\n | 'exactFiles'\n | 'minFiles'\n | 'maxFiles'\n | 'fileTypes'\n | 'documentTypes'\n | 'imageTypes'\n | 'tabularDataTypes'\n | 'autoCompleteOptions'\n | 'enhancedAction'\n | 'radioId'\n | 'radioText'\n | 'radioHint'\n | 'radioValue'\n | 'list'\n | 'listItemsData'\n | 'jsEnabled'\n>\n\nexport type FormEditorInputPageSettings = Pick<\n FormEditor,\n | 'pageHeadingAndGuidance'\n | 'pageHeading'\n | 'guidanceText'\n | 'repeater'\n | 'minItems'\n | 'maxItems'\n | 'questionSetName'\n>\n\nexport type FormEditorInputGuidancePage = Pick<\n FormEditor,\n 'pageHeading' | 'guidanceText'\n>\n\nexport type FormEditorInputQuestionDetails = Pick<\n FormEditorInputQuestion,\n | 'question'\n | 'hintText'\n | 'shortDescription'\n | 'questionOptional'\n | 'questionType'\n | 'fileTypes'\n | 'documentTypes'\n | 'imageTypes'\n | 'tabularDataTypes'\n | 'autoCompleteOptions'\n | 'enhancedAction'\n | 'radioId'\n | 'radioText'\n | 'radioHint'\n | 'radioValue'\n | 'listItemsData'\n | 'jsEnabled'\n>\n\nexport interface ListItem {\n id?: string\n text?: string\n hint?: {\n text: string\n }\n value?: string\n}\n\nexport interface ListLabel {\n text: string\n classes: string\n}\n\nexport interface ListElement extends ListItem {\n readonly id: string\n text: string\n value: string\n label: ListLabel\n}\n\nexport interface ReadonlyHint {\n readonly text: string\n}\n\nexport interface ListItemReadonly extends ListElement {\n readonly text: string\n readonly hint?: ReadonlyHint\n readonly value: string\n readonly label: ListLabel\n}\n\nexport interface DateItem {\n name: string\n classes: string\n}\n\nexport interface QuestionSessionState {\n questionType?: ComponentType\n questionDetails?: Partial<ComponentDef>\n editRow?: {\n radioId?: string\n radioText?: string\n radioHint?: string\n radioValue?: string\n expanded?: boolean\n }\n listItems?: ListItem[]\n isReordering?: boolean\n lastMovedId?: string\n lastMoveDirection?: string\n}\n\nexport interface GovukFieldItem {\n text?: string\n value?: string\n checked?: boolean\n}\n\nexport interface GovukField {\n id?: string\n name?: string\n idPrefix?: string\n fieldset?: {\n legend?: { text?: string; isPageHeading?: boolean; classes?: string }\n }\n value?: string | boolean | number | string[] | Item[]\n classes?: string\n label?: {\n text?: string\n html?: string\n classes?: string\n isPageHeading?: boolean\n }\n hint?: { text?: string; html?: string; classes?: string }\n items?: GovukFieldItem[]\n rows?: number\n type?: string\n customTemplate?: string\n}\n\nexport type GovukFieldQuestionOptional = Omit<GovukField, 'name' | 'items'> & {\n name: 'questionOptional'\n items: [\n {\n text?: string\n value?: string\n checked: boolean\n }\n ]\n}\n\nexport type GovukStringField = Omit<GovukField, 'value'> & { value: string }\n\nexport interface FormEditorGovukField {\n question?: GovukField\n hintText?: GovukField\n questionOptional?: GovukField\n shortDescription?: GovukField\n fileTypes?: GovukField\n documentTypes?: GovukField\n imageTypes?: GovukField\n tabularDataTypes?: GovukField\n radiosOrCheckboxes?: GovukField\n autoCompleteOptions?: GovukField\n errorMessage?: { text: string }\n}\n\nexport type FormEditorGovukFieldBase = Omit<\n FormEditorGovukField,\n 'errorMessage'\n>\n\nexport type FormEditorGovukFieldBaseKeys = keyof FormEditorGovukFieldBase\n\nexport interface FormEditorCheckbox {\n text?: string\n hint?: {\n text?: string\n }\n value?: string\n divider?: {\n text?: string\n hint?: string\n value?: string\n }\n}\n"],"mappings":"","ignoreList":[]}
@@ -2,6 +2,8 @@ export * from "../../../form/form-editor/preview/date-input.js";
2
2
  export * from "../../../form/form-editor/preview/email-address.js";
3
3
  export * from "../../../form/form-editor/preview/list.js";
4
4
  export * from "../../../form/form-editor/preview/list-sortable.js";
5
+ export * from "../../../form/form-editor/preview/month-year.js";
6
+ export * from "../../../form/form-editor/preview/number-only.js";
5
7
  export * from "../../../form/form-editor/preview/phone-number.js";
6
8
  export * from "../../../form/form-editor/preview/question.js";
7
9
  export * from "../../../form/form-editor/preview/radio.js";
@@ -0,0 +1,14 @@
1
+ export class MonthYearQuestion extends Question {
2
+ get renderInput(): {
3
+ id: string;
4
+ name: string;
5
+ fieldset: import("./types.js").GovukFieldset;
6
+ hint: import("./types.js").DefaultComponent;
7
+ items: {
8
+ name: string;
9
+ classes: string;
10
+ }[];
11
+ };
12
+ }
13
+ import { Question } from '../../../form/form-editor/preview/question.js';
14
+ //# sourceMappingURL=month-year.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"month-year.d.ts","sourceRoot":"","sources":["../../../../../src/form/form-editor/preview/month-year.js"],"names":[],"mappings":"AAEA;IAOE;;;;;;;;;MAWC;CACF;yBArBwB,4CAA4C"}
@@ -0,0 +1,4 @@
1
+ export class NumberOnlyQuestion extends Question {
2
+ }
3
+ import { Question } from '../../../form/form-editor/preview/question.js';
4
+ //# sourceMappingURL=number-only.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"number-only.d.ts","sourceRoot":"","sources":["../../../../../src/form/form-editor/preview/number-only.js"],"names":[],"mappings":"AAEA;CAaC;yBAfwB,4CAA4C"}
@@ -7,7 +7,7 @@ import { type Question } from '../../../form/form-editor/preview/question.js';
7
7
  import { type RadioSortableQuestion } from '../../../form/form-editor/preview/radio-sortable.js';
8
8
  import { type ShortAnswerQuestion } from '../../../form/form-editor/preview/short-answer.js';
9
9
  import { type UkAddressQuestion } from '../../../form/form-editor/preview/uk-address.js';
10
- import { type ListElement, type ListItemReadonly } from '../../../form/form-editor/types.js';
10
+ import { type DateItem, type ListElement, type ListItemReadonly } from '../../../form/form-editor/types.js';
11
11
  export interface BaseSettings {
12
12
  question: string;
13
13
  hintText: string;
@@ -29,13 +29,14 @@ export interface QuestionBaseModel {
29
29
  label?: DefaultComponent;
30
30
  hint?: DefaultComponent;
31
31
  fieldset?: GovukFieldset;
32
- readonly items?: ListItemReadonly[];
32
+ readonly items?: ListItemReadonly[] | DateItem[];
33
33
  text?: string;
34
34
  formGroup?: {
35
35
  afterInputs: {
36
36
  html: string;
37
37
  };
38
38
  };
39
+ type?: 'text' | 'number';
39
40
  }
40
41
  export type ListenerRow = [
41
42
  HTMLInputElement | null,
@@ -1 +1 @@
1
- {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../../src/form/form-editor/preview/types.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,iBAAiB,EAAE,MAAM,8CAA8C,CAAA;AACrF,OAAO,EAAE,KAAK,oBAAoB,EAAE,MAAM,iDAAiD,CAAA;AAC3F,OAAO,EAAE,KAAK,oBAAoB,EAAE,MAAM,iDAAiD,CAAA;AAC3F,OAAO,EAAE,KAAK,kBAAkB,EAAE,MAAM,+CAA+C,CAAA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AAA;AAED,MAAM,WAAW,gBAAgB;IAC/B,QAAQ,CAAC,MAAM,EAAE,YAAY,CAAA;IAC7B,cAAc,CAAC,KAAK,EAAE,MAAM,GAAG,IAAI,CAAA;CACpC;AAED,MAAM,WAAW,aAAa;IAC5B,KAAK,EAAE,iBAAiB,CAAA;CACzB;AAED,MAAM,WAAW,WAAW;IAC1B,SAAS,CAAC,gBAAgB,EAAE,MAAM,EAAE,aAAa,EAAE,aAAa,GAAG,MAAM,CAAA;CAC1E;AAED,MAAM,WAAW,gBAAgB;IAC/B,MAAM,CAAC,gBAAgB,EAAE,MAAM,EAAE,iBAAiB,EAAE,iBAAiB,GAAG,IAAI,CAAA;CAC7E;AAED,MAAM,WAAW,YAAa,SAAQ,gBAAgB;IACpD,eAAe,EAAE,MAAM,CAAA;CACxB;AAED,MAAM,MAAM,eAAe,GACvB,iBAAiB,GACjB,oBAAoB,GACpB,oBAAoB,GACpB,kBAAkB,GAClB,mBAAmB,GACnB,QAAQ,GACR,qBAAqB,GACrB,mBAAmB,GACnB,iBAAiB,CAAA"}
@@ -231,6 +231,10 @@ export interface ListItemReadonly extends ListElement {
231
231
  readonly value: string;
232
232
  readonly label: ListLabel;
233
233
  }
234
+ export interface DateItem {
235
+ name: string;
236
+ classes: string;
237
+ }
234
238
  export interface QuestionSessionState {
235
239
  questionType?: ComponentType;
236
240
  questionDetails?: Partial<ComponentDef>;
@@ -1 +1 @@
1
- {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../src/form/form-editor/types.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,aAAa,EAAE,MAAM,2BAA2B,CAAA;AAC9D,OAAO,EAAE,KAAK,YAAY,EAAE,MAAM,2BAA2B,CAAA;AAC7D,OAAO,EAAE,KAAK,IAAI,EAAE,MAAM,gBAAgB,CAAA;AAE1C;;GAEG;AACH,MAAM,WAAW,UAAU;IACzB;;OAEG;IACH,QAAQ,EAAE,MAAM,CAAA;IAEhB;;OAEG;IACH,YA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AC,EAAE,UAAU,CAAA;IAC7B,kBAAkB,CAAC,EAAE,UAAU,CAAA;IAC/B,mBAAmB,CAAC,EAAE,UAAU,CAAA;IAChC,YAAY,CAAC,EAAE;QAAE,IAAI,EAAE,MAAM,CAAA;KAAE,CAAA;CAChC;AAED,MAAM,MAAM,wBAAwB,GAAG,IAAI,CACzC,oBAAoB,EACpB,cAAc,CACf,CAAA;AAED,MAAM,MAAM,4BAA4B,GAAG,MAAM,wBAAwB,CAAA;AAEzE,MAAM,WAAW,kBAAkB;IACjC,IAAI,CAAC,EAAE,MAAM,CAAA;IACb,IAAI,CAAC,EAAE;QACL,IAAI,CAAC,EAAE,MAAM,CAAA;KACd,CAAA;IACD,KAAK,CAAC,EAAE,MAAM,CAAA;IACd,OAAO,CAAC,EAAE;QACR,IAAI,CAAC,EAAE,MAAM,CAAA;QACb,IAAI,CAAC,EAAE,MAAM,CAAA;QACb,KAAK,CAAC,EAAE,MAAM,CAAA;KACf,CAAA;CACF"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@defra/forms-model",
3
- "version": "3.0.450",
3
+ "version": "3.0.451",
4
4
  "description": "A hapi plugin providing the model for Defra forms",
5
5
  "homepage": "https://github.com/DEFRA/forms-designer/tree/main/model#readme",
6
6
  "repository": {
@@ -2,6 +2,8 @@ export * from '~/src/form/form-editor/preview/date-input.js'
2
2
  export * from '~/src/form/form-editor/preview/email-address.js'
3
3
  export * from '~/src/form/form-editor/preview/list.js'
4
4
  export * from '~/src/form/form-editor/preview/list-sortable.js'
5
+ export * from '~/src/form/form-editor/preview/month-year.js'
6
+ export * from '~/src/form/form-editor/preview/number-only.js'
5
7
  export * from '~/src/form/form-editor/preview/phone-number.js'
6
8
  export * from '~/src/form/form-editor/preview/question.js'
7
9
  export * from '~/src/form/form-editor/preview/radio.js'
@@ -0,0 +1,22 @@
1
+ import { Question } from '~/src/form/form-editor/preview/question.js'
2
+
3
+ export class MonthYearQuestion extends Question {
4
+ /**
5
+ * @type {string}
6
+ * @protected
7
+ */
8
+ _questionTemplate = 'monthyearfield.njk'
9
+
10
+ get renderInput() {
11
+ return {
12
+ id: 'monthYear',
13
+ name: 'monthYearField',
14
+ fieldset: this.fieldSet,
15
+ hint: this.hint,
16
+ items: [
17
+ { name: 'month', classes: 'govuk-input--width-2' },
18
+ { name: 'year', classes: 'govuk-input--width-4' }
19
+ ]
20
+ }
21
+ }
22
+ }
@@ -0,0 +1,20 @@
1
+ import { Question } from '~/src/form/form-editor/preview/question.js'
2
+
3
+ export class NumberOnlyQuestion extends Question {
4
+ /**
5
+ * @type {QuestionBaseModel}
6
+ */
7
+ get renderInput() {
8
+ return {
9
+ id: this._fieldName,
10
+ name: this._fieldName,
11
+ label: this.label,
12
+ hint: this.hint,
13
+ type: 'number'
14
+ }
15
+ }
16
+ }
17
+
18
+ /**
19
+ * @import { QuestionBaseModel } from '~/src/form/form-editor/preview/types.js'
20
+ */
@@ -8,6 +8,7 @@ import { type RadioSortableQuestion } from '~/src/form/form-editor/preview/radio
8
8
  import { type ShortAnswerQuestion } from '~/src/form/form-editor/preview/short-answer.js'
9
9
  import { type UkAddressQuestion } from '~/src/form/form-editor/preview/uk-address.js'
10
10
  import {
11
+ type DateItem,
11
12
  type ListElement,
12
13
  type ListItemReadonly
13
14
  } from '~/src/form/form-editor/types.js'
@@ -36,9 +37,10 @@ export interface QuestionBaseModel {
36
37
  label?: DefaultComponent
37
38
  hint?: DefaultComponent
38
39
  fieldset?: GovukFieldset
39
- readonly items?: ListItemReadonly[]
40
+ readonly items?: ListItemReadonly[] | DateItem[]
40
41
  text?: string
41
42
  formGroup?: { afterInputs: { html: string } }
43
+ type?: 'text' | 'number'
42
44
  }
43
45
 
44
46
  export type ListenerRow = [
@@ -364,6 +364,11 @@ export interface ListItemReadonly extends ListElement {
364
364
  readonly label: ListLabel
365
365
  }
366
366
 
367
+ export interface DateItem {
368
+ name: string
369
+ classes: string
370
+ }
371
+
367
372
  export interface QuestionSessionState {
368
373
  questionType?: ComponentType
369
374
  questionDetails?: Partial<ComponentDef>