@defra/forms-model 3.0.449 → 3.0.450
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/dist/module/form/form-editor/preview/index.js +1 -0
- package/dist/module/form/form-editor/preview/index.js.map +1 -1
- package/dist/module/form/form-editor/preview/long-answer.js +14 -0
- package/dist/module/form/form-editor/preview/long-answer.js.map +1 -0
- package/dist/module/form/form-editor/preview/types.js.map +1 -1
- package/dist/module/form/form-editor/preview/uk-address.js +16 -0
- package/dist/module/form/form-editor/preview/uk-address.js.map +1 -1
- package/dist/types/form/form-editor/preview/index.d.ts +1 -0
- package/dist/types/form/form-editor/preview/long-answer.d.ts +4 -0
- package/dist/types/form/form-editor/preview/long-answer.d.ts.map +1 -0
- package/dist/types/form/form-editor/preview/types.d.ts +10 -0
- package/dist/types/form/form-editor/preview/types.d.ts.map +1 -1
- package/dist/types/form/form-editor/preview/uk-address.d.ts.map +1 -1
- package/package.json +1 -1
- package/src/form/form-editor/preview/index.js +1 -0
- package/src/form/form-editor/preview/long-answer.js +14 -0
- package/src/form/form-editor/preview/types.ts +20 -0
- package/src/form/form-editor/preview/uk-address.js +16 -0
@@ -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/uk-address.js'\n"],"mappings":"AAAA;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/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":[]}
|
@@ -0,0 +1,14 @@
|
|
1
|
+
import { Question } from "./question.js";
|
2
|
+
export class LongAnswerQuestion extends Question {
|
3
|
+
/**
|
4
|
+
* @type {string}
|
5
|
+
* @protected
|
6
|
+
*/
|
7
|
+
_questionTemplate = 'textarea.njk';
|
8
|
+
/**
|
9
|
+
* @type {string}
|
10
|
+
* @protected
|
11
|
+
*/
|
12
|
+
_fieldName = 'longAnswerField';
|
13
|
+
}
|
14
|
+
//# sourceMappingURL=long-answer.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"long-answer.js","names":["Question","LongAnswerQuestion","_questionTemplate","_fieldName"],"sources":["../../../../../src/form/form-editor/preview/long-answer.js"],"sourcesContent":["import { Question } from '~/src/form/form-editor/preview/question.js'\n\nexport class LongAnswerQuestion extends Question {\n /**\n * @type {string}\n * @protected\n */\n _questionTemplate = 'textarea.njk'\n /**\n * @type {string}\n * @protected\n */\n _fieldName = 'longAnswerField'\n}\n"],"mappings":"AAAA,SAASA,QAAQ;AAEjB,OAAO,MAAMC,kBAAkB,SAASD,QAAQ,CAAC;EAC/C;AACF;AACA;AACA;EACEE,iBAAiB,GAAG,cAAc;EAClC;AACF;AACA;AACA;EACEC,UAAU,GAAG,iBAAiB;AAChC","ignoreList":[]}
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"types.js","names":[],"sources":["../../../../../src/form/form-editor/preview/types.ts"],"sourcesContent":["import {\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"],"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 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":[]}
|
@@ -2,5 +2,21 @@ import { Question } from "./question.js";
|
|
2
2
|
export class UkAddressQuestion extends Question {
|
3
3
|
_questionTemplate = 'ukaddressfield.njk';
|
4
4
|
_fieldName = 'addressField';
|
5
|
+
|
6
|
+
/**
|
7
|
+
* @type {QuestionBaseModel}
|
8
|
+
*/
|
9
|
+
get renderInput() {
|
10
|
+
return {
|
11
|
+
id: this._fieldName,
|
12
|
+
name: this._fieldName,
|
13
|
+
fieldset: this.fieldSet,
|
14
|
+
hint: this.hint
|
15
|
+
};
|
16
|
+
}
|
5
17
|
}
|
18
|
+
|
19
|
+
/**
|
20
|
+
* @import { QuestionBaseModel } from '~/src/form/form-editor/preview/types.js'
|
21
|
+
*/
|
6
22
|
//# sourceMappingURL=uk-address.js.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"uk-address.js","names":["Question","UkAddressQuestion","_questionTemplate","_fieldName"],"sources":["../../../../../src/form/form-editor/preview/uk-address.js"],"sourcesContent":["import { Question } from '~/src/form/form-editor/preview/question.js'\n\nexport class UkAddressQuestion extends Question {\n _questionTemplate = 'ukaddressfield.njk'\n _fieldName = 'addressField'\n}\n"],"mappings":"AAAA,SAASA,QAAQ;AAEjB,OAAO,MAAMC,iBAAiB,SAASD,QAAQ,CAAC;EAC9CE,iBAAiB,GAAG,oBAAoB;EACxCC,UAAU,GAAG,cAAc;
|
1
|
+
{"version":3,"file":"uk-address.js","names":["Question","UkAddressQuestion","_questionTemplate","_fieldName","renderInput","id","name","fieldset","fieldSet","hint"],"sources":["../../../../../src/form/form-editor/preview/uk-address.js"],"sourcesContent":["import { Question } from '~/src/form/form-editor/preview/question.js'\n\nexport class UkAddressQuestion extends Question {\n _questionTemplate = 'ukaddressfield.njk'\n _fieldName = 'addressField'\n\n /**\n * @type {QuestionBaseModel}\n */\n get renderInput() {\n return {\n id: this._fieldName,\n name: this._fieldName,\n fieldset: this.fieldSet,\n hint: this.hint\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,iBAAiB,SAASD,QAAQ,CAAC;EAC9CE,iBAAiB,GAAG,oBAAoB;EACxCC,UAAU,GAAG,cAAc;;EAE3B;AACF;AACA;EACE,IAAIC,WAAWA,CAAA,EAAG;IAChB,OAAO;MACLC,EAAE,EAAE,IAAI,CAACF,UAAU;MACnBG,IAAI,EAAE,IAAI,CAACH,UAAU;MACrBI,QAAQ,EAAE,IAAI,CAACC,QAAQ;MACvBC,IAAI,EAAE,IAAI,CAACA;IACb,CAAC;EACH;AACF;;AAEA;AACA;AACA","ignoreList":[]}
|
@@ -7,5 +7,6 @@ export * from "../../../form/form-editor/preview/question.js";
|
|
7
7
|
export * from "../../../form/form-editor/preview/radio.js";
|
8
8
|
export * from "../../../form/form-editor/preview/radio-sortable.js";
|
9
9
|
export * from "../../../form/form-editor/preview/short-answer.js";
|
10
|
+
export * from "../../../form/form-editor/preview/long-answer.js";
|
10
11
|
export * from "../../../form/form-editor/preview/uk-address.js";
|
11
12
|
//# sourceMappingURL=index.d.ts.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"long-answer.d.ts","sourceRoot":"","sources":["../../../../../src/form/form-editor/preview/long-answer.js"],"names":[],"mappings":"AAEA;CAWC;yBAbwB,4CAA4C"}
|
@@ -1,3 +1,12 @@
|
|
1
|
+
import { type DateInputQuestion } from '../../../form/form-editor/preview/date-input.js';
|
2
|
+
import { type EmailAddressQuestion } from '../../../form/form-editor/preview/email-address.js';
|
3
|
+
import { type ListSortableQuestion } from '../../../form/form-editor/preview/list-sortable.js';
|
4
|
+
import { type LongAnswerQuestion } from '../../../form/form-editor/preview/long-answer.js';
|
5
|
+
import { type PhoneNumberQuestion } from '../../../form/form-editor/preview/phone-number.js';
|
6
|
+
import { type Question } from '../../../form/form-editor/preview/question.js';
|
7
|
+
import { type RadioSortableQuestion } from '../../../form/form-editor/preview/radio-sortable.js';
|
8
|
+
import { type ShortAnswerQuestion } from '../../../form/form-editor/preview/short-answer.js';
|
9
|
+
import { type UkAddressQuestion } from '../../../form/form-editor/preview/uk-address.js';
|
1
10
|
import { type ListElement, type ListItemReadonly } from '../../../form/form-editor/types.js';
|
2
11
|
export interface BaseSettings {
|
3
12
|
question: string;
|
@@ -49,4 +58,5 @@ export interface QuestionRenderer {
|
|
49
58
|
export interface ListElements extends QuestionElements {
|
50
59
|
afterInputsHTML: string;
|
51
60
|
}
|
61
|
+
export type PreviewQuestion = DateInputQuestion | EmailAddressQuestion | ListSortableQuestion | LongAnswerQuestion | PhoneNumberQuestion | Question | RadioSortableQuestion | ShortAnswerQuestion | UkAddressQuestion;
|
52
62
|
//# sourceMappingURL=types.d.ts.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../../src/form/form-editor/preview/types.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,KAAK,WAAW,EAChB,KAAK,gBAAgB,EACtB,MAAM,iCAAiC,CAAA;AAExC,MAAM,WAAW,YAAY;IAC3B,QAAQ,EAAE,MAAM,CAAA;IAChB,QAAQ,EAAE,MAAM,CAAA;IAChB,QAAQ,EAAE,OAAO,CAAA;IACjB,SAAS,EAAE,MAAM,CAAA;IACjB,KAAK,EAAE,WAAW,EAAE,CAAA;CACrB;AAED,MAAM,WAAW,gBAAgB;IAC/B,EAAE,CAAC,EAAE,MAAM,CAAA;IACX,IAAI,EAAE,MAAM,CAAA;IACZ,OAAO,EAAE,MAAM,CAAA;CAChB;AAED,MAAM,WAAW,aAAa;IAC5B,MAAM,EAAE,gBAAgB,CAAA;CACzB;AAED,MAAM,WAAW,iBAAiB;IAChC,EAAE,CAAC,EAAE,MAAM,CAAA;IACX,IAAI,CAAC,EAAE,MAAM,CAAA;IACb,KAAK,CAAC,EAAE,gBAAgB,CAAA;IACxB,IAAI,CAAC,EAAE,gBAAgB,CAAA;IACvB,QAAQ,CAAC,EAAE,aAAa,CAAA;IACxB,QAAQ,CAAC,KAAK,CAAC,EAAE,gBAAgB,EAAE,CAAA;IACnC,IAAI,CAAC,EAAE,MAAM,CAAA;IACb,SAAS,CAAC,EAAE;QAAE,WAAW,EAAE;YAAE,IAAI,EAAE,MAAM,CAAA;SAAE,CAAA;KAAE,CAAA;CAC9C;AAED,MAAM,MAAM,WAAW,GAAG;IACxB,gBAAgB,GAAG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,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"}
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"uk-address.d.ts","sourceRoot":"","sources":["../../../../../src/form/form-editor/preview/uk-address.js"],"names":[],"mappings":"AAEA;
|
1
|
+
{"version":3,"file":"uk-address.d.ts","sourceRoot":"","sources":["../../../../../src/form/form-editor/preview/uk-address.js"],"names":[],"mappings":"AAEA;CAeC;yBAjBwB,4CAA4C"}
|
package/package.json
CHANGED
@@ -7,4 +7,5 @@ export * from '~/src/form/form-editor/preview/question.js'
|
|
7
7
|
export * from '~/src/form/form-editor/preview/radio.js'
|
8
8
|
export * from '~/src/form/form-editor/preview/radio-sortable.js'
|
9
9
|
export * from '~/src/form/form-editor/preview/short-answer.js'
|
10
|
+
export * from '~/src/form/form-editor/preview/long-answer.js'
|
10
11
|
export * from '~/src/form/form-editor/preview/uk-address.js'
|
@@ -0,0 +1,14 @@
|
|
1
|
+
import { Question } from '~/src/form/form-editor/preview/question.js'
|
2
|
+
|
3
|
+
export class LongAnswerQuestion extends Question {
|
4
|
+
/**
|
5
|
+
* @type {string}
|
6
|
+
* @protected
|
7
|
+
*/
|
8
|
+
_questionTemplate = 'textarea.njk'
|
9
|
+
/**
|
10
|
+
* @type {string}
|
11
|
+
* @protected
|
12
|
+
*/
|
13
|
+
_fieldName = 'longAnswerField'
|
14
|
+
}
|
@@ -1,3 +1,12 @@
|
|
1
|
+
import { type DateInputQuestion } from '~/src/form/form-editor/preview/date-input.js'
|
2
|
+
import { type EmailAddressQuestion } from '~/src/form/form-editor/preview/email-address.js'
|
3
|
+
import { type ListSortableQuestion } from '~/src/form/form-editor/preview/list-sortable.js'
|
4
|
+
import { type LongAnswerQuestion } from '~/src/form/form-editor/preview/long-answer.js'
|
5
|
+
import { type PhoneNumberQuestion } from '~/src/form/form-editor/preview/phone-number.js'
|
6
|
+
import { type Question } from '~/src/form/form-editor/preview/question.js'
|
7
|
+
import { type RadioSortableQuestion } from '~/src/form/form-editor/preview/radio-sortable.js'
|
8
|
+
import { type ShortAnswerQuestion } from '~/src/form/form-editor/preview/short-answer.js'
|
9
|
+
import { type UkAddressQuestion } from '~/src/form/form-editor/preview/uk-address.js'
|
1
10
|
import {
|
2
11
|
type ListElement,
|
3
12
|
type ListItemReadonly
|
@@ -58,3 +67,14 @@ export interface QuestionRenderer {
|
|
58
67
|
export interface ListElements extends QuestionElements {
|
59
68
|
afterInputsHTML: string
|
60
69
|
}
|
70
|
+
|
71
|
+
export type PreviewQuestion =
|
72
|
+
| DateInputQuestion
|
73
|
+
| EmailAddressQuestion
|
74
|
+
| ListSortableQuestion
|
75
|
+
| LongAnswerQuestion
|
76
|
+
| PhoneNumberQuestion
|
77
|
+
| Question
|
78
|
+
| RadioSortableQuestion
|
79
|
+
| ShortAnswerQuestion
|
80
|
+
| UkAddressQuestion
|
@@ -3,4 +3,20 @@ import { Question } from '~/src/form/form-editor/preview/question.js'
|
|
3
3
|
export class UkAddressQuestion extends Question {
|
4
4
|
_questionTemplate = 'ukaddressfield.njk'
|
5
5
|
_fieldName = 'addressField'
|
6
|
+
|
7
|
+
/**
|
8
|
+
* @type {QuestionBaseModel}
|
9
|
+
*/
|
10
|
+
get renderInput() {
|
11
|
+
return {
|
12
|
+
id: this._fieldName,
|
13
|
+
name: this._fieldName,
|
14
|
+
fieldset: this.fieldSet,
|
15
|
+
hint: this.hint
|
16
|
+
}
|
17
|
+
}
|
6
18
|
}
|
19
|
+
|
20
|
+
/**
|
21
|
+
* @import { QuestionBaseModel } from '~/src/form/form-editor/preview/types.js'
|
22
|
+
*/
|