@defra/forms-model 3.0.576 → 3.0.578
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/conditions/migration.js +9 -1
- package/dist/module/conditions/migration.js.map +1 -1
- package/dist/module/form/form-editor/__stubs__/preview.js +53 -17
- package/dist/module/form/form-editor/__stubs__/preview.js.map +1 -1
- package/dist/module/form/form-editor/index.js +3 -2
- package/dist/module/form/form-editor/index.js.map +1 -1
- package/dist/module/form/form-editor/macros/types.js.map +1 -1
- package/dist/module/form/form-editor/preview/declaration.js +82 -0
- package/dist/module/form/form-editor/preview/declaration.js.map +1 -0
- package/dist/module/form/form-editor/preview/helpers.js +43 -10
- package/dist/module/form/form-editor/preview/helpers.js.map +1 -1
- 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/types.js.map +1 -1
- package/dist/module/form/form-editor/preview/uk-address.js +3 -3
- package/dist/module/form/form-editor/preview/uk-address.js.map +1 -1
- package/dist/module/form/form-editor/types.js.map +1 -1
- package/dist/types/conditions/migration.d.ts.map +1 -1
- package/dist/types/form/form-editor/__stubs__/preview.d.ts +38 -12
- package/dist/types/form/form-editor/__stubs__/preview.d.ts.map +1 -1
- package/dist/types/form/form-editor/index.d.ts +1 -0
- package/dist/types/form/form-editor/index.d.ts.map +1 -1
- package/dist/types/form/form-editor/macros/types.d.ts +6 -0
- package/dist/types/form/form-editor/macros/types.d.ts.map +1 -1
- package/dist/types/form/form-editor/preview/declaration.d.ts +42 -0
- package/dist/types/form/form-editor/preview/declaration.d.ts.map +1 -0
- package/dist/types/form/form-editor/preview/helpers.d.ts.map +1 -1
- package/dist/types/form/form-editor/preview/index.d.ts +1 -0
- package/dist/types/form/form-editor/preview/types.d.ts +12 -1
- package/dist/types/form/form-editor/preview/types.d.ts.map +1 -1
- package/dist/types/form/form-editor/preview/uk-address.d.ts +13 -0
- package/dist/types/form/form-editor/preview/uk-address.d.ts.map +1 -1
- package/dist/types/form/form-editor/types.d.ts +8 -1
- package/dist/types/form/form-editor/types.d.ts.map +1 -1
- package/package.json +1 -1
- package/schemas/form-editor-input-page-schema.json +1 -0
- package/schemas/question-type-full-schema.json +1 -0
- package/schemas/question-type-schema.json +1 -0
- package/src/conditions/migration.ts +15 -1
- package/src/form/form-editor/__stubs__/preview.js +47 -17
- package/src/form/form-editor/index.ts +3 -0
- package/src/form/form-editor/macros/types.ts +7 -0
- package/src/form/form-editor/preview/declaration.js +88 -0
- package/src/form/form-editor/preview/helpers.js +47 -16
- package/src/form/form-editor/preview/index.js +1 -0
- package/src/form/form-editor/preview/types.ts +16 -1
- package/src/form/form-editor/preview/uk-address.js +3 -3
- package/src/form/form-editor/types.ts +8 -0
|
@@ -24,7 +24,6 @@ export interface BaseSettings {
|
|
|
24
24
|
items: ListElement[]
|
|
25
25
|
content: string
|
|
26
26
|
attributes?: Record<string, string>
|
|
27
|
-
usePostcodeLookup?: boolean
|
|
28
27
|
}
|
|
29
28
|
|
|
30
29
|
export interface DefaultComponent {
|
|
@@ -64,6 +63,22 @@ export interface NumberSettings extends BaseSettings {
|
|
|
64
63
|
suffix: string
|
|
65
64
|
}
|
|
66
65
|
|
|
66
|
+
export interface DeclarationSettings extends BaseSettings {
|
|
67
|
+
declarationText: string
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
export interface DeclarationElements extends DomElementsBase {
|
|
71
|
+
readonly values: DeclarationSettings
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
export interface UkAddressSettings extends BaseSettings {
|
|
75
|
+
usePostcodeLookup?: boolean
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
export interface UkAddressElements extends DomElementsBase {
|
|
79
|
+
readonly values: UkAddressSettings
|
|
80
|
+
}
|
|
81
|
+
|
|
67
82
|
export interface NumberElements extends DomElementsBase {
|
|
68
83
|
readonly values: NumberSettings
|
|
69
84
|
}
|
|
@@ -17,7 +17,7 @@ export class UkAddressComponentPreviewElements extends QuestionComponentElements
|
|
|
17
17
|
|
|
18
18
|
/**
|
|
19
19
|
* @protected
|
|
20
|
-
* @returns {
|
|
20
|
+
* @returns {UkAddressSettings}
|
|
21
21
|
*/
|
|
22
22
|
_getValues() {
|
|
23
23
|
return {
|
|
@@ -37,7 +37,7 @@ export class UkAddressQuestion extends FieldsetQuestion {
|
|
|
37
37
|
_usePostcodeLookup = false
|
|
38
38
|
|
|
39
39
|
/**
|
|
40
|
-
* @param {
|
|
40
|
+
* @param {UkAddressElements} htmlElements
|
|
41
41
|
* @param {QuestionRenderer} questionRenderer
|
|
42
42
|
*/
|
|
43
43
|
constructor(htmlElements, questionRenderer) {
|
|
@@ -69,6 +69,6 @@ export class UkAddressQuestion extends FieldsetQuestion {
|
|
|
69
69
|
}
|
|
70
70
|
|
|
71
71
|
/**
|
|
72
|
-
* @import {
|
|
72
|
+
* @import { QuestionElements, QuestionRenderer, UkAddressElements, UkAddressSettings } from '~/src/form/form-editor/preview/types.js'
|
|
73
73
|
* @import { UkAddressFieldComponent } from '~/src/components/types.js'
|
|
74
74
|
*/
|
|
@@ -318,6 +318,7 @@ export type FormEditorInputQuestion = Pick<
|
|
|
318
318
|
| 'question'
|
|
319
319
|
| 'shortDescription'
|
|
320
320
|
| 'hintText'
|
|
321
|
+
| 'declarationText'
|
|
321
322
|
| 'questionOptional'
|
|
322
323
|
| 'minLength'
|
|
323
324
|
| 'maxLength'
|
|
@@ -518,6 +519,12 @@ export interface GovukField {
|
|
|
518
519
|
formGroup?: {
|
|
519
520
|
classes?: string
|
|
520
521
|
}
|
|
522
|
+
preContent?: {
|
|
523
|
+
path?: string
|
|
524
|
+
}
|
|
525
|
+
postContent?: {
|
|
526
|
+
path?: string
|
|
527
|
+
}
|
|
521
528
|
}
|
|
522
529
|
|
|
523
530
|
export type GovukFieldQuestionOptional = Omit<GovukField, 'name' | 'items'> & {
|
|
@@ -557,6 +564,7 @@ export interface FormEditorGovukField {
|
|
|
557
564
|
radiosOrCheckboxes?: GovukField
|
|
558
565
|
autoCompleteOptions?: GovukField
|
|
559
566
|
usePostcodeLookup?: GovukField
|
|
567
|
+
declarationText?: GovukField
|
|
560
568
|
errorMessage?: { text: string }
|
|
561
569
|
}
|
|
562
570
|
|