@defra/forms-model 3.0.580 → 3.0.581
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/__stubs__/components.js +46 -0
- package/dist/module/__stubs__/components.js.map +1 -1
- package/dist/module/components/component-types.js +1 -1
- package/dist/module/components/component-types.js.map +1 -1
- package/dist/module/form/form-editor/__stubs__/preview.js +27 -1
- package/dist/module/form/form-editor/__stubs__/preview.js.map +1 -1
- package/dist/module/form/form-editor/index.js +1 -1
- 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/easting-northing.js +42 -0
- package/dist/module/form/form-editor/preview/easting-northing.js.map +1 -0
- package/dist/module/form/form-editor/preview/helpers.js +26 -5
- package/dist/module/form/form-editor/preview/helpers.js.map +1 -1
- package/dist/module/form/form-editor/preview/index.js +4 -0
- package/dist/module/form/form-editor/preview/index.js.map +1 -1
- package/dist/module/form/form-editor/preview/lat-long.js +42 -0
- package/dist/module/form/form-editor/preview/lat-long.js.map +1 -0
- package/dist/module/form/form-editor/preview/location-helpers.js +44 -0
- package/dist/module/form/form-editor/preview/location-helpers.js.map +1 -0
- package/dist/module/form/form-editor/preview/location-question-base.js +62 -0
- package/dist/module/form/form-editor/preview/location-question-base.js.map +1 -0
- package/dist/module/form/form-editor/preview/national-grid.js +46 -0
- package/dist/module/form/form-editor/preview/national-grid.js.map +1 -0
- package/dist/module/form/form-editor/preview/os-grid-ref.js +46 -0
- package/dist/module/form/form-editor/preview/os-grid-ref.js.map +1 -0
- package/dist/module/form/form-editor/preview/types.js.map +1 -1
- package/dist/types/__stubs__/components.d.ts +5 -1
- package/dist/types/__stubs__/components.d.ts.map +1 -1
- package/dist/types/form/form-editor/__stubs__/preview.d.ts +18 -0
- package/dist/types/form/form-editor/__stubs__/preview.d.ts.map +1 -1
- package/dist/types/form/form-editor/index.d.ts.map +1 -1
- package/dist/types/form/form-editor/macros/types.d.ts +50 -0
- package/dist/types/form/form-editor/macros/types.d.ts.map +1 -1
- package/dist/types/form/form-editor/preview/easting-northing.d.ts +17 -0
- package/dist/types/form/form-editor/preview/easting-northing.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 +4 -0
- package/dist/types/form/form-editor/preview/lat-long.d.ts +17 -0
- package/dist/types/form/form-editor/preview/lat-long.d.ts.map +1 -0
- package/dist/types/form/form-editor/preview/location-helpers.d.ts +23 -0
- package/dist/types/form/form-editor/preview/location-helpers.d.ts.map +1 -0
- package/dist/types/form/form-editor/preview/location-question-base.d.ts +43 -0
- package/dist/types/form/form-editor/preview/location-question-base.d.ts.map +1 -0
- package/dist/types/form/form-editor/preview/national-grid.d.ts +17 -0
- package/dist/types/form/form-editor/preview/national-grid.d.ts.map +1 -0
- package/dist/types/form/form-editor/preview/os-grid-ref.d.ts +17 -0
- package/dist/types/form/form-editor/preview/os-grid-ref.d.ts.map +1 -0
- package/dist/types/form/form-editor/preview/types.d.ts +21 -2
- package/dist/types/form/form-editor/preview/types.d.ts.map +1 -1
- package/package.json +1 -1
- package/src/__stubs__/components.ts +62 -0
- package/src/components/component-types.ts +1 -1
- package/src/form/form-editor/__stubs__/preview.js +24 -1
- package/src/form/form-editor/index.ts +1 -0
- package/src/form/form-editor/macros/types.ts +54 -0
- package/src/form/form-editor/preview/easting-northing.js +55 -0
- package/src/form/form-editor/preview/helpers.js +40 -5
- package/src/form/form-editor/preview/index.js +4 -0
- package/src/form/form-editor/preview/lat-long.js +55 -0
- package/src/form/form-editor/preview/location-helpers.js +49 -0
- package/src/form/form-editor/preview/location-question-base.js +65 -0
- package/src/form/form-editor/preview/national-grid.js +56 -0
- package/src/form/form-editor/preview/os-grid-ref.js +56 -0
- package/src/form/form-editor/preview/types.ts +24 -2
|
@@ -62,6 +62,56 @@ export interface DeclarationModel extends QuestionBaseModel {
|
|
|
62
62
|
classes?: string;
|
|
63
63
|
};
|
|
64
64
|
}
|
|
65
|
+
export interface EastingNorthingModel extends QuestionBaseModel {
|
|
66
|
+
fieldset?: {
|
|
67
|
+
legend: {
|
|
68
|
+
text: string;
|
|
69
|
+
classes: string;
|
|
70
|
+
};
|
|
71
|
+
};
|
|
72
|
+
easting?: {
|
|
73
|
+
classes?: string;
|
|
74
|
+
};
|
|
75
|
+
northing?: {
|
|
76
|
+
classes?: string;
|
|
77
|
+
};
|
|
78
|
+
instructionText?: string;
|
|
79
|
+
details?: {
|
|
80
|
+
classes?: string;
|
|
81
|
+
};
|
|
82
|
+
}
|
|
83
|
+
export interface OsGridRefModel extends QuestionBaseModel {
|
|
84
|
+
inputClasses?: string;
|
|
85
|
+
instructionText?: string;
|
|
86
|
+
details?: {
|
|
87
|
+
classes?: string;
|
|
88
|
+
};
|
|
89
|
+
}
|
|
90
|
+
export interface NationalGridModel extends QuestionBaseModel {
|
|
91
|
+
inputClasses?: string;
|
|
92
|
+
instructionText?: string;
|
|
93
|
+
details?: {
|
|
94
|
+
classes?: string;
|
|
95
|
+
};
|
|
96
|
+
}
|
|
97
|
+
export interface LatLongModel extends QuestionBaseModel {
|
|
98
|
+
fieldset?: {
|
|
99
|
+
legend: {
|
|
100
|
+
text: string;
|
|
101
|
+
classes: string;
|
|
102
|
+
};
|
|
103
|
+
};
|
|
104
|
+
latitude?: {
|
|
105
|
+
classes?: string;
|
|
106
|
+
};
|
|
107
|
+
longitude?: {
|
|
108
|
+
classes?: string;
|
|
109
|
+
};
|
|
110
|
+
instructionText?: string;
|
|
111
|
+
details?: {
|
|
112
|
+
classes?: string;
|
|
113
|
+
};
|
|
114
|
+
}
|
|
65
115
|
export interface AppPreviewPanelMacro extends AppPreviewPanelTabsMacro {
|
|
66
116
|
model: QuestionBaseModel;
|
|
67
117
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../../src/form/form-editor/macros/types.ts"],"names":[],"mappings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AAQ,wBAAwB;IACpE,KAAK,EAAE,iBAAiB,CAAA;CACzB;AAED,MAAM,WAAW,oBAAoB;IACnC,KAAK,EAAE,iBAAiB,CAAA;IACxB,YAAY,EAAE,aAAa,CAAA;CAC5B;AAED,MAAM,WAAW,qBAAqB;IACpC,QAAQ,CAAC,SAAS,EAAE;QAClB,IAAI,EAAE,MAAM,CAAA;QACZ,OAAO,EAAE,MAAM,CAAA;KAChB,CAAA;IACD,QAAQ,CAAC,QAAQ,EAAE;QACjB,IAAI,EAAE,MAAM,CAAA;QACZ,OAAO,EAAE,MAAM,CAAA;KAChB,CAAA;IACD,QAAQ,CAAC,UAAU,EAAE,oBAAoB,EAAE,CAAA;IAC3C,QAAQ,CAAC,YAAY,CAAC,EAAE;QACtB,IAAI,EAAE,MAAM,CAAA;QACZ,OAAO,EAAE,MAAM,CAAA;KAChB,CAAA;CACF;AAED,MAAM,WAAW,oBAAoB;IACnC,IAAI,EAAE,MAAM,CAAA;IACZ,IAAI,EAAE,MAAM,CAAA;IACZ,kBAAkB,EAAE,MAAM,CAAA;CAC3B;AAED,MAAM,WAAW,UAAU;IACzB,GAAG,EAAE;QAAE,IAAI,EAAE,MAAM,CAAA;KAAE,CAAA;IACrB,KAAK,EAAE;QAAE,IAAI,EAAE,MAAM,CAAA;KAAE,CAAA;IACvB,OAAO,EAAE;QACP,KAAK,EAAE,oBAAoB,EAAE,CAAA;KAC9B,CAAA;CACF"}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @implements {QuestionElements}
|
|
3
|
+
*/
|
|
4
|
+
export class EastingNorthingComponentPreviewElements extends LocationQuestionComponentPreviewElements implements QuestionElements {
|
|
5
|
+
}
|
|
6
|
+
export class EastingNorthingQuestion extends LocationQuestion {
|
|
7
|
+
/**
|
|
8
|
+
* @protected
|
|
9
|
+
* @returns {EastingNorthingModel}
|
|
10
|
+
*/
|
|
11
|
+
protected _renderInput(): EastingNorthingModel;
|
|
12
|
+
}
|
|
13
|
+
import type { QuestionElements } from '../../../form/form-editor/preview/types.js';
|
|
14
|
+
import { LocationQuestionComponentPreviewElements } from '../../../form/form-editor/preview/location-question-base.js';
|
|
15
|
+
import { LocationQuestion } from '../../../form/form-editor/preview/location-question-base.js';
|
|
16
|
+
import type { EastingNorthingModel } from '../../../form/form-editor/macros/types.js';
|
|
17
|
+
//# sourceMappingURL=easting-northing.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"easting-northing.d.ts","sourceRoot":"","sources":["../../../../../src/form/form-editor/preview/easting-northing.js"],"names":[],"mappings":"AAWA;;GAEG;AACH;CAAwG;AAExG;IAYE;;;OAGG;IACH,0BAFa,oBAAoB,CAiBhC;CACF;sCAG0F,yCAAyC;yDA3C7H,0DAA0D;iCAA1D,0DAA0D;0CA4CxB,wCAAwC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"helpers.d.ts","sourceRoot":"","sources":["../../../../../src/form/form-editor/preview/helpers.js"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"helpers.d.ts","sourceRoot":"","sources":["../../../../../src/form/form-editor/preview/helpers.js"],"names":[],"mappings":"AA8IA;;;;GAIG;AACH,gEAJW,gBAAgB,cAChB,cAAc,GACZ,CAAC,SAAS,EAAE,YAAY,KAAK,QAAQ,CAmCjD;sCAGsD,yCAAyC;oCAG7D,qCAAqC;kCACgO,2BAA2B;8BAHtS,4CAA4C"}
|
|
@@ -3,12 +3,16 @@ export * from "../../../form/form-editor/preview/checkbox.js";
|
|
|
3
3
|
export * from "../../../form/form-editor/preview/checkbox-sortable.js";
|
|
4
4
|
export * from "../../../form/form-editor/preview/date-input.js";
|
|
5
5
|
export * from "../../../form/form-editor/preview/declaration.js";
|
|
6
|
+
export * from "../../../form/form-editor/preview/easting-northing.js";
|
|
6
7
|
export * from "../../../form/form-editor/preview/email-address.js";
|
|
8
|
+
export * from "../../../form/form-editor/preview/lat-long.js";
|
|
7
9
|
export * from "../../../form/form-editor/preview/list.js";
|
|
8
10
|
export * from "../../../form/form-editor/preview/list-sortable.js";
|
|
9
11
|
export * from "../../../form/form-editor/preview/markdown.js";
|
|
10
12
|
export * from "../../../form/form-editor/preview/month-year.js";
|
|
13
|
+
export * from "../../../form/form-editor/preview/national-grid.js";
|
|
11
14
|
export * from "../../../form/form-editor/preview/number-only.js";
|
|
15
|
+
export * from "../../../form/form-editor/preview/os-grid-ref.js";
|
|
12
16
|
export * from "../../../form/form-editor/preview/phone-number.js";
|
|
13
17
|
export * from "../../../form/form-editor/preview/question.js";
|
|
14
18
|
export * from "../../../form/form-editor/preview/radio.js";
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @implements {QuestionElements}
|
|
3
|
+
*/
|
|
4
|
+
export class LatLongComponentPreviewElements extends LocationQuestionComponentPreviewElements implements QuestionElements {
|
|
5
|
+
}
|
|
6
|
+
export class LatLongQuestion extends LocationQuestion {
|
|
7
|
+
/**
|
|
8
|
+
* @protected
|
|
9
|
+
* @returns {LatLongModel}
|
|
10
|
+
*/
|
|
11
|
+
protected _renderInput(): LatLongModel;
|
|
12
|
+
}
|
|
13
|
+
import type { QuestionElements } from '../../../form/form-editor/preview/types.js';
|
|
14
|
+
import { LocationQuestionComponentPreviewElements } from '../../../form/form-editor/preview/location-question-base.js';
|
|
15
|
+
import { LocationQuestion } from '../../../form/form-editor/preview/location-question-base.js';
|
|
16
|
+
import type { LatLongModel } from '../../../form/form-editor/macros/types.js';
|
|
17
|
+
//# sourceMappingURL=lat-long.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"lat-long.d.ts","sourceRoot":"","sources":["../../../../../src/form/form-editor/preview/lat-long.js"],"names":[],"mappings":"AAWA;;GAEG;AACH;CAAgG;AAEhG;IAYE;;;OAGG;IACH,0BAFa,YAAY,CAiBxB;CACF;sCAG0F,yCAAyC;yDA3C7H,0DAA0D;iCAA1D,0DAA0D;kCA4ChC,wCAAwC"}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Creates the standard location field model with common properties
|
|
3
|
+
* @param {QuestionBaseModel} baseModel - The base model from super._renderInput()
|
|
4
|
+
* @param {LocationElements} htmlElements - The HTML elements containing values
|
|
5
|
+
* @param {string | null} highlight - The currently highlighted element
|
|
6
|
+
* @param {string} instructionText - The instruction text to display
|
|
7
|
+
* @param {string} titleText - The title text including optional suffix
|
|
8
|
+
* @returns {LocationFieldModel}
|
|
9
|
+
*/
|
|
10
|
+
export function createLocationFieldModel(baseModel: QuestionBaseModel, htmlElements: LocationElements, highlight: string | null, instructionText: string, titleText: string): LocationFieldModel;
|
|
11
|
+
/**
|
|
12
|
+
* Creates field classes with highlight if needed
|
|
13
|
+
* @param {string} fieldName - The name of the field
|
|
14
|
+
* @param {string | null} highlight - The currently highlighted element
|
|
15
|
+
* @returns {{classes: string}}
|
|
16
|
+
*/
|
|
17
|
+
export function createFieldClasses(fieldName: string, highlight: string | null): {
|
|
18
|
+
classes: string;
|
|
19
|
+
};
|
|
20
|
+
import type { QuestionBaseModel } from '../../../form/form-editor/preview/types.js';
|
|
21
|
+
import type { LocationElements } from '../../../form/form-editor/preview/types.js';
|
|
22
|
+
import type { LocationFieldModel } from '../../../form/form-editor/preview/types.js';
|
|
23
|
+
//# sourceMappingURL=location-helpers.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"location-helpers.d.ts","sourceRoot":"","sources":["../../../../../src/form/form-editor/preview/location-helpers.js"],"names":[],"mappings":"AAEA;;;;;;;;GAQG;AACH,oDAPW,iBAAiB,gBACjB,gBAAgB,aAChB,MAAM,GAAG,IAAI,mBACb,MAAM,aACN,MAAM,GACJ,kBAAkB,CAuB9B;AAED;;;;;GAKG;AACH,8CAJW,MAAM,aACN,MAAM,GAAG,IAAI,GACX;IAAC,OAAO,EAAE,MAAM,CAAA;CAAC,CAM7B;uCAG2E,yCAAyC;sCAAzC,yCAAyC;wCAAzC,yCAAyC"}
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Base class for location question component preview elements with instruction text support
|
|
3
|
+
* @implements {QuestionElements}
|
|
4
|
+
*/
|
|
5
|
+
export class LocationQuestionComponentPreviewElements extends QuestionComponentElements implements QuestionElements {
|
|
6
|
+
/**
|
|
7
|
+
* @param {any} component - Component with options.instructionText
|
|
8
|
+
*/
|
|
9
|
+
constructor(component: any);
|
|
10
|
+
_instructionText: any;
|
|
11
|
+
/**
|
|
12
|
+
* @protected
|
|
13
|
+
* @returns {LocationSettings}
|
|
14
|
+
*/
|
|
15
|
+
protected _getValues(): LocationSettings;
|
|
16
|
+
}
|
|
17
|
+
/**
|
|
18
|
+
* Base class for location questions with instruction text support
|
|
19
|
+
*/
|
|
20
|
+
export class LocationQuestion extends Question {
|
|
21
|
+
/**
|
|
22
|
+
* @param {LocationElements} htmlElements
|
|
23
|
+
* @param {QuestionRenderer} questionRenderer
|
|
24
|
+
*/
|
|
25
|
+
constructor(htmlElements: LocationElements, questionRenderer: QuestionRenderer);
|
|
26
|
+
/**
|
|
27
|
+
* @type {string}
|
|
28
|
+
* @protected
|
|
29
|
+
*/
|
|
30
|
+
protected _instructionText: string;
|
|
31
|
+
/**
|
|
32
|
+
* @param {string} val
|
|
33
|
+
*/
|
|
34
|
+
set instructionText(val: string);
|
|
35
|
+
get instructionText(): string;
|
|
36
|
+
}
|
|
37
|
+
import type { QuestionElements } from '../../../form/form-editor/preview/types.js';
|
|
38
|
+
import { QuestionComponentElements } from '../../../form/form-editor/preview/question.js';
|
|
39
|
+
import type { LocationSettings } from '../../../form/form-editor/preview/types.js';
|
|
40
|
+
import { Question } from '../../../form/form-editor/preview/question.js';
|
|
41
|
+
import type { LocationElements } from '../../../form/form-editor/preview/types.js';
|
|
42
|
+
import type { QuestionRenderer } from '../../../form/form-editor/preview/types.js';
|
|
43
|
+
//# sourceMappingURL=location-question-base.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"location-question-base.d.ts","sourceRoot":"","sources":["../../../../../src/form/form-editor/preview/location-question-base.js"],"names":[],"mappings":"AAKA;;;GAGG;AACH;IACE;;OAEG;IACH,uBAFW,GAAG,EAKb;IADC,sBAA+D;IAGjE;;;OAGG;IACH,wBAFa,gBAAgB,CAO5B;CACF;AAED;;GAEG;AACH;IAOE;;;OAGG;IACH,0BAHW,gBAAgB,oBAChB,gBAAgB,EAK1B;IAbD;;;OAGG;IACH,4BAHU,MAAM,CAGK;IAerB;;OAEG;IACH,yBAFW,MAAM,EAKhB;IAVD,uBAKW,MAAM,CAHhB;CASF;sCAG0F,yCAAyC;0CA5D7H,4CAA4C;sCA4DwC,yCAAyC;yBA5D7H,4CAA4C;sCA4DwC,yCAAyC;sCAAzC,yCAAyC"}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @implements {QuestionElements}
|
|
3
|
+
*/
|
|
4
|
+
export class NationalGridComponentPreviewElements extends LocationQuestionComponentPreviewElements implements QuestionElements {
|
|
5
|
+
}
|
|
6
|
+
export class NationalGridQuestion extends LocationQuestion {
|
|
7
|
+
/**
|
|
8
|
+
* @protected
|
|
9
|
+
* @returns {NationalGridModel}
|
|
10
|
+
*/
|
|
11
|
+
protected _renderInput(): NationalGridModel;
|
|
12
|
+
}
|
|
13
|
+
import type { QuestionElements } from '../../../form/form-editor/preview/types.js';
|
|
14
|
+
import { LocationQuestionComponentPreviewElements } from '../../../form/form-editor/preview/location-question-base.js';
|
|
15
|
+
import { LocationQuestion } from '../../../form/form-editor/preview/location-question-base.js';
|
|
16
|
+
import type { NationalGridModel } from '../../../form/form-editor/macros/types.js';
|
|
17
|
+
//# sourceMappingURL=national-grid.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"national-grid.d.ts","sourceRoot":"","sources":["../../../../../src/form/form-editor/preview/national-grid.js"],"names":[],"mappings":"AASA;;GAEG;AACH;CAAqG;AAErG;IAYE;;;OAGG;IACH,0BAFa,iBAAiB,CAoB7B;CACF;sCAG0F,yCAAyC;yDA9C7H,0DAA0D;iCAA1D,0DAA0D;uCA+C3B,wCAAwC"}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @implements {QuestionElements}
|
|
3
|
+
*/
|
|
4
|
+
export class OsGridRefComponentPreviewElements extends LocationQuestionComponentPreviewElements implements QuestionElements {
|
|
5
|
+
}
|
|
6
|
+
export class OsGridRefQuestion extends LocationQuestion {
|
|
7
|
+
/**
|
|
8
|
+
* @protected
|
|
9
|
+
* @returns {OsGridRefModel}
|
|
10
|
+
*/
|
|
11
|
+
protected _renderInput(): OsGridRefModel;
|
|
12
|
+
}
|
|
13
|
+
import type { QuestionElements } from '../../../form/form-editor/preview/types.js';
|
|
14
|
+
import { LocationQuestionComponentPreviewElements } from '../../../form/form-editor/preview/location-question-base.js';
|
|
15
|
+
import { LocationQuestion } from '../../../form/form-editor/preview/location-question-base.js';
|
|
16
|
+
import type { OsGridRefModel } from '../../../form/form-editor/macros/types.js';
|
|
17
|
+
//# sourceMappingURL=os-grid-ref.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"os-grid-ref.d.ts","sourceRoot":"","sources":["../../../../../src/form/form-editor/preview/os-grid-ref.js"],"names":[],"mappings":"AASA;;GAEG;AACH;CAAkG;AAElG;IAYE;;;OAGG;IACH,0BAFa,cAAc,CAoB1B;CACF;sCAG0F,yCAAyC;yDA9C7H,0DAA0D;iCAA1D,0DAA0D;oCA+C9B,wCAAwC"}
|
|
@@ -32,8 +32,8 @@ export interface GovukFieldset {
|
|
|
32
32
|
legend: DefaultComponent;
|
|
33
33
|
}
|
|
34
34
|
export type ListenerRow = [
|
|
35
|
-
HTMLInputElement | null,
|
|
36
|
-
(target: HTMLInputElement, e: Event) => void,
|
|
35
|
+
HTMLInputElement | HTMLTextAreaElement | null,
|
|
36
|
+
(target: HTMLInputElement | HTMLTextAreaElement, e: Event) => void,
|
|
37
37
|
keyof HTMLElementEventMap
|
|
38
38
|
];
|
|
39
39
|
export interface DomElementsBase {
|
|
@@ -67,6 +67,25 @@ export interface UkAddressElements extends DomElementsBase {
|
|
|
67
67
|
export interface NumberElements extends DomElementsBase {
|
|
68
68
|
readonly values: NumberSettings;
|
|
69
69
|
}
|
|
70
|
+
export interface LocationSettings extends BaseSettings {
|
|
71
|
+
instructionText: string;
|
|
72
|
+
}
|
|
73
|
+
export interface LocationElements extends DomElementsBase {
|
|
74
|
+
readonly values: LocationSettings;
|
|
75
|
+
}
|
|
76
|
+
export interface LocationFieldModel extends QuestionBaseModel {
|
|
77
|
+
userClasses: string;
|
|
78
|
+
fieldset: {
|
|
79
|
+
legend: {
|
|
80
|
+
text: string;
|
|
81
|
+
classes: string;
|
|
82
|
+
};
|
|
83
|
+
};
|
|
84
|
+
instructionText: string;
|
|
85
|
+
details: {
|
|
86
|
+
classes: string;
|
|
87
|
+
};
|
|
88
|
+
}
|
|
70
89
|
export interface RenderBase {
|
|
71
90
|
render(questionTemplate: string, renderContext: RenderContext): void;
|
|
72
91
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../../src/form/form-editor/preview/types.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,KAAK,qBAAqB,EAC1B,KAAK,iBAAiB,EACvB,MAAM,wCAAwC,CAAA;AAC/C,OAAO,EAAE,KAAK,oBAAoB,EAAE,MAAM,gDAAgD,CAAA;AAC1F,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;AACvF,OAAO,EAAE,KAA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AQ,EAAE,MAAM,CAAA;CACjB;AAED,MAAM,WAAW,oBAAqB,SAAQ,uBAAuB;IACnE,UAAU,EAAE,OAAO,CAAA;IACnB,cAAc,EAAE,MAAM,GAAG,SAAS,CAAA;IAClC,WAAW,EAAE,OAAO,CAAA;CACrB;AAED,MAAM,WAAW,mBAAoB,SAAQ,uBAAuB;IAClE,WAAW,EAAE,OAAO,CAAA;CACrB;AAED,MAAM,MAAM,eAAe,GACvB,iBAAiB,GACjB,oBAAoB,GACpB,oBAAoB,GACpB,kBAAkB,GAClB,mBAAmB,GACnB,QAAQ,GACR,qBAAqB,GACrB,sBAAsB,GACtB,mBAAmB,GACnB,iBAAiB,GACjB,oBAAoB,CAAA"}
|
package/package.json
CHANGED
|
@@ -5,15 +5,19 @@ import {
|
|
|
5
5
|
type DatePartsFieldComponent,
|
|
6
6
|
type DeclarationFieldComponent,
|
|
7
7
|
type DetailsComponent,
|
|
8
|
+
type EastingNorthingFieldComponent,
|
|
8
9
|
type EmailAddressFieldComponent,
|
|
9
10
|
type FileUploadFieldComponent,
|
|
10
11
|
type HtmlComponent,
|
|
11
12
|
type InsetTextComponent,
|
|
13
|
+
type LatLongFieldComponent,
|
|
12
14
|
type ListComponent,
|
|
13
15
|
type MarkdownComponent,
|
|
14
16
|
type MonthYearFieldComponent,
|
|
15
17
|
type MultilineTextFieldComponent,
|
|
18
|
+
type NationalGridFieldNumberFieldComponent,
|
|
16
19
|
type NumberFieldComponent,
|
|
20
|
+
type OsGridRefFieldComponent,
|
|
17
21
|
type RadiosFieldComponent,
|
|
18
22
|
type SelectFieldComponent,
|
|
19
23
|
type TelephoneNumberFieldComponent,
|
|
@@ -369,3 +373,61 @@ export function buildRadiosComponent(
|
|
|
369
373
|
type: ComponentType.RadiosField
|
|
370
374
|
}
|
|
371
375
|
}
|
|
376
|
+
|
|
377
|
+
export function buildEastingNorthingFieldComponent(
|
|
378
|
+
partialComponent: Partial<EastingNorthingFieldComponent> = {}
|
|
379
|
+
): EastingNorthingFieldComponent {
|
|
380
|
+
return {
|
|
381
|
+
id: '1a2b3c4d-5e6f-7g8h-9i0j-1k2l3m4n5o6p',
|
|
382
|
+
name: 'EastingNorthingField',
|
|
383
|
+
title: 'Easting and northing',
|
|
384
|
+
hint: 'For example, Easting: 248741, Northing: 63688',
|
|
385
|
+
options: {},
|
|
386
|
+
schema: {},
|
|
387
|
+
...partialComponent,
|
|
388
|
+
type: ComponentType.EastingNorthingField
|
|
389
|
+
}
|
|
390
|
+
}
|
|
391
|
+
|
|
392
|
+
export function buildLatLongFieldComponent(
|
|
393
|
+
partialComponent: Partial<LatLongFieldComponent> = {}
|
|
394
|
+
): LatLongFieldComponent {
|
|
395
|
+
return {
|
|
396
|
+
id: '2b3c4d5e-6f7g-8h9i-0j1k-2l3m4n5o6p7q',
|
|
397
|
+
name: 'LatLongField',
|
|
398
|
+
title: 'Latitude and longitude',
|
|
399
|
+
hint: 'For example, Latitude: 51.5074, Longitude: -0.1278',
|
|
400
|
+
options: {},
|
|
401
|
+
schema: {},
|
|
402
|
+
...partialComponent,
|
|
403
|
+
type: ComponentType.LatLongField
|
|
404
|
+
}
|
|
405
|
+
}
|
|
406
|
+
|
|
407
|
+
export function buildNationalGridFieldNumberFieldComponent(
|
|
408
|
+
partialComponent: Partial<NationalGridFieldNumberFieldComponent> = {}
|
|
409
|
+
): NationalGridFieldNumberFieldComponent {
|
|
410
|
+
return {
|
|
411
|
+
id: '3c4d5e6f-7g8h-9i0j-1k2l-3m4n5o6p7q8r',
|
|
412
|
+
name: 'NationalGridFieldNumberField',
|
|
413
|
+
title: 'National Grid field number',
|
|
414
|
+
hint: 'A National Grid field number is made up of 2 letters and 8 numbers, for example, SO04188589',
|
|
415
|
+
options: {},
|
|
416
|
+
...partialComponent,
|
|
417
|
+
type: ComponentType.NationalGridFieldNumberField
|
|
418
|
+
}
|
|
419
|
+
}
|
|
420
|
+
|
|
421
|
+
export function buildOsGridRefFieldComponent(
|
|
422
|
+
partialComponent: Partial<OsGridRefFieldComponent> = {}
|
|
423
|
+
): OsGridRefFieldComponent {
|
|
424
|
+
return {
|
|
425
|
+
id: '4d5e6f7g-8h9i-0j1k-2l3m-4n5o6p7q8r9s',
|
|
426
|
+
name: 'OsGridRefField',
|
|
427
|
+
title: 'Ordnance Survey (OS) grid reference',
|
|
428
|
+
hint: 'An OS grid reference number is made up of 2 letters followed by 6 numbers, for example, TQ123456',
|
|
429
|
+
options: {},
|
|
430
|
+
...partialComponent,
|
|
431
|
+
type: ComponentType.OsGridRefField
|
|
432
|
+
}
|
|
433
|
+
}
|
|
@@ -163,7 +163,7 @@ export const ComponentTypes: readonly ComponentDef[] = Object.freeze([
|
|
|
163
163
|
name: 'OsGridRefField',
|
|
164
164
|
title: 'Ordnance Survey (OS) grid reference',
|
|
165
165
|
type: ComponentType.OsGridRefField,
|
|
166
|
-
hint: 'An OS grid reference number is made up of 2 letters followed by
|
|
166
|
+
hint: 'An OS grid reference number is made up of 2 letters followed by 6 numbers, for example, TQ123456',
|
|
167
167
|
options: {}
|
|
168
168
|
},
|
|
169
169
|
{
|
|
@@ -213,6 +213,29 @@ export class DeclarationPreviewElements extends QuestionPreviewElements {
|
|
|
213
213
|
}
|
|
214
214
|
}
|
|
215
215
|
|
|
216
|
+
/**
|
|
217
|
+
* @implements {LocationElements}
|
|
218
|
+
*/
|
|
219
|
+
export class LocationPreviewElements extends QuestionPreviewElements {
|
|
220
|
+
/**
|
|
221
|
+
* @param {BaseSettings & {instructionText?: string}} elements
|
|
222
|
+
*/
|
|
223
|
+
constructor({ instructionText, ...elements }) {
|
|
224
|
+
super(elements)
|
|
225
|
+
this._instructionText = instructionText ?? ''
|
|
226
|
+
}
|
|
227
|
+
|
|
228
|
+
/**
|
|
229
|
+
* @returns {LocationSettings}
|
|
230
|
+
*/
|
|
231
|
+
get values() {
|
|
232
|
+
return {
|
|
233
|
+
...super.values,
|
|
234
|
+
instructionText: this._instructionText
|
|
235
|
+
}
|
|
236
|
+
}
|
|
237
|
+
}
|
|
238
|
+
|
|
216
239
|
/**
|
|
217
240
|
* @implements {PageOverviewElements}
|
|
218
241
|
*/
|
|
@@ -429,5 +452,5 @@ export class NumberPreviewElements {
|
|
|
429
452
|
/**
|
|
430
453
|
* @import { ListElement } from '~/src/form/form-editor/types.js'
|
|
431
454
|
* @import { PagePreviewPanelMacro } from '~/src/form/form-editor/macros/types.js'
|
|
432
|
-
* @import { BaseSettings, ListElements, NumberSettings, RenderContext, QuestionBaseModel, QuestionRenderer, AutocompleteElements, PageOverviewElements, PageRenderer, UkAddressElements, UkAddressSettings, DeclarationElements, DeclarationSettings } from '~/src/form/form-editor/preview/types.js'
|
|
455
|
+
* @import { BaseSettings, ListElements, NumberSettings, RenderContext, QuestionBaseModel, QuestionRenderer, AutocompleteElements, PageOverviewElements, PageRenderer, UkAddressElements, UkAddressSettings, DeclarationElements, DeclarationSettings, LocationElements, LocationSettings } from '~/src/form/form-editor/preview/types.js'
|
|
433
456
|
*/
|
|
@@ -100,6 +100,7 @@ export const listSubSchema = Joi.string()
|
|
|
100
100
|
export const locationSubSchema = Joi.string()
|
|
101
101
|
.required()
|
|
102
102
|
.valid(
|
|
103
|
+
ComponentType.UkAddressField,
|
|
103
104
|
ComponentType.EastingNorthingField,
|
|
104
105
|
ComponentType.OsGridRefField,
|
|
105
106
|
ComponentType.NationalGridFieldNumberField,
|
|
@@ -67,6 +67,60 @@ export interface DeclarationModel extends QuestionBaseModel {
|
|
|
67
67
|
}
|
|
68
68
|
}
|
|
69
69
|
|
|
70
|
+
export interface EastingNorthingModel extends QuestionBaseModel {
|
|
71
|
+
fieldset?: {
|
|
72
|
+
legend: {
|
|
73
|
+
text: string
|
|
74
|
+
classes: string
|
|
75
|
+
}
|
|
76
|
+
}
|
|
77
|
+
easting?: {
|
|
78
|
+
classes?: string
|
|
79
|
+
}
|
|
80
|
+
northing?: {
|
|
81
|
+
classes?: string
|
|
82
|
+
}
|
|
83
|
+
instructionText?: string
|
|
84
|
+
details?: {
|
|
85
|
+
classes?: string
|
|
86
|
+
}
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
export interface OsGridRefModel extends QuestionBaseModel {
|
|
90
|
+
inputClasses?: string
|
|
91
|
+
instructionText?: string
|
|
92
|
+
details?: {
|
|
93
|
+
classes?: string
|
|
94
|
+
}
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
export interface NationalGridModel extends QuestionBaseModel {
|
|
98
|
+
inputClasses?: string
|
|
99
|
+
instructionText?: string
|
|
100
|
+
details?: {
|
|
101
|
+
classes?: string
|
|
102
|
+
}
|
|
103
|
+
}
|
|
104
|
+
|
|
105
|
+
export interface LatLongModel extends QuestionBaseModel {
|
|
106
|
+
fieldset?: {
|
|
107
|
+
legend: {
|
|
108
|
+
text: string
|
|
109
|
+
classes: string
|
|
110
|
+
}
|
|
111
|
+
}
|
|
112
|
+
latitude?: {
|
|
113
|
+
classes?: string
|
|
114
|
+
}
|
|
115
|
+
longitude?: {
|
|
116
|
+
classes?: string
|
|
117
|
+
}
|
|
118
|
+
instructionText?: string
|
|
119
|
+
details?: {
|
|
120
|
+
classes?: string
|
|
121
|
+
}
|
|
122
|
+
}
|
|
123
|
+
|
|
70
124
|
export interface AppPreviewPanelMacro extends AppPreviewPanelTabsMacro {
|
|
71
125
|
model: QuestionBaseModel
|
|
72
126
|
}
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
import { ComponentType } from '~/src/components/enums.js'
|
|
2
|
+
import {
|
|
3
|
+
createFieldClasses,
|
|
4
|
+
createLocationFieldModel
|
|
5
|
+
} from '~/src/form/form-editor/preview/location-helpers.js'
|
|
6
|
+
import {
|
|
7
|
+
LocationQuestion,
|
|
8
|
+
LocationQuestionComponentPreviewElements
|
|
9
|
+
} from '~/src/form/form-editor/preview/location-question-base.js'
|
|
10
|
+
import { PreviewComponent } from '~/src/form/form-editor/preview/preview.js'
|
|
11
|
+
|
|
12
|
+
/**
|
|
13
|
+
* @implements {QuestionElements}
|
|
14
|
+
*/
|
|
15
|
+
export class EastingNorthingComponentPreviewElements extends LocationQuestionComponentPreviewElements {}
|
|
16
|
+
|
|
17
|
+
export class EastingNorthingQuestion extends LocationQuestion {
|
|
18
|
+
/**
|
|
19
|
+
* @type {ComponentType}
|
|
20
|
+
*/
|
|
21
|
+
componentType = ComponentType.EastingNorthingField
|
|
22
|
+
/**
|
|
23
|
+
* @type {string}
|
|
24
|
+
* @protected
|
|
25
|
+
*/
|
|
26
|
+
_questionTemplate = PreviewComponent.PATH + 'eastingnorthingfield.njk'
|
|
27
|
+
_fieldName = 'EastingNorthingField'
|
|
28
|
+
|
|
29
|
+
/**
|
|
30
|
+
* @protected
|
|
31
|
+
* @returns {EastingNorthingModel}
|
|
32
|
+
*/
|
|
33
|
+
_renderInput() {
|
|
34
|
+
const baseModel = super._renderInput()
|
|
35
|
+
const locationModel = createLocationFieldModel(
|
|
36
|
+
baseModel,
|
|
37
|
+
/** @type {LocationElements} */ (this._htmlElements),
|
|
38
|
+
this._highlight,
|
|
39
|
+
this._instructionText,
|
|
40
|
+
this.titleText
|
|
41
|
+
)
|
|
42
|
+
|
|
43
|
+
return {
|
|
44
|
+
...locationModel,
|
|
45
|
+
easting: createFieldClasses('easting', this._highlight),
|
|
46
|
+
northing: createFieldClasses('northing', this._highlight)
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
/**
|
|
52
|
+
* @import { LocationSettings, LocationElements, QuestionElements, QuestionRenderer } from '~/src/form/form-editor/preview/types.js'
|
|
53
|
+
* @import { EastingNorthingModel } from '~/src/form/form-editor/macros/types.js'
|
|
54
|
+
* @import { EastingNorthingFieldComponent } from '~/src/components/types.js'
|
|
55
|
+
*/
|