@defra/forms-model 3.0.686 → 3.0.687
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/components/types.js.map +1 -1
- package/dist/module/form/form-definition/index.js +6 -0
- package/dist/module/form/form-definition/index.js.map +1 -1
- package/dist/module/form/form-editor/index.js +2 -0
- package/dist/module/form/form-editor/index.js.map +1 -1
- package/dist/module/form/form-editor/types.js.map +1 -1
- package/dist/types/components/types.d.ts +7 -0
- package/dist/types/components/types.d.ts.map +1 -1
- package/dist/types/form/form-definition/index.d.ts.map +1 -1
- package/dist/types/form/form-editor/index.d.ts +2 -0
- package/dist/types/form/form-editor/index.d.ts.map +1 -1
- package/dist/types/form/form-editor/types.d.ts +5 -1
- package/dist/types/form/form-editor/types.d.ts.map +1 -1
- package/package.json +1 -1
- package/schemas/component-schema-v2.json +13 -0
- package/schemas/component-schema.json +13 -0
- package/schemas/form-definition-schema.json +39 -0
- package/schemas/form-definition-v2-schema.json +65 -0
- package/schemas/list-schema-v2.json +26 -0
- package/schemas/list-schema.json +26 -0
- package/schemas/page-schema-v2.json +39 -0
- package/schemas/page-schema.json +13 -0
- package/src/components/types.ts +8 -0
- package/src/form/form-definition/index.ts +19 -0
- package/src/form/form-editor/index.ts +6 -0
- package/src/form/form-editor/types.ts +6 -0
|
@@ -297,6 +297,19 @@
|
|
|
297
297
|
},
|
|
298
298
|
"title": "Geometry Types"
|
|
299
299
|
},
|
|
300
|
+
"mapLayers": {
|
|
301
|
+
"type": "object",
|
|
302
|
+
"description": "Supported map layers",
|
|
303
|
+
"properties": {
|
|
304
|
+
"sssi": {
|
|
305
|
+
"type": "boolean",
|
|
306
|
+
"description": "Sites of Special Scientific Interest layer",
|
|
307
|
+
"title": "Sssi"
|
|
308
|
+
}
|
|
309
|
+
},
|
|
310
|
+
"additionalProperties": false,
|
|
311
|
+
"title": "Map Layers"
|
|
312
|
+
},
|
|
300
313
|
"format": {
|
|
301
314
|
"type": "string",
|
|
302
315
|
"description": "Format for telephone number - for TelephoneNumberField only",
|
|
@@ -1119,6 +1132,19 @@
|
|
|
1119
1132
|
},
|
|
1120
1133
|
"title": "Geometry Types"
|
|
1121
1134
|
},
|
|
1135
|
+
"mapLayers": {
|
|
1136
|
+
"type": "object",
|
|
1137
|
+
"description": "Supported map layers",
|
|
1138
|
+
"properties": {
|
|
1139
|
+
"sssi": {
|
|
1140
|
+
"type": "boolean",
|
|
1141
|
+
"description": "Sites of Special Scientific Interest layer",
|
|
1142
|
+
"title": "Sssi"
|
|
1143
|
+
}
|
|
1144
|
+
},
|
|
1145
|
+
"additionalProperties": false,
|
|
1146
|
+
"title": "Map Layers"
|
|
1147
|
+
},
|
|
1122
1148
|
"format": {
|
|
1123
1149
|
"type": "string",
|
|
1124
1150
|
"description": "Format for telephone number - for TelephoneNumberField only",
|
|
@@ -1484,6 +1510,19 @@
|
|
|
1484
1510
|
},
|
|
1485
1511
|
"title": "Geometry Types"
|
|
1486
1512
|
},
|
|
1513
|
+
"mapLayers": {
|
|
1514
|
+
"type": "object",
|
|
1515
|
+
"description": "Supported map layers",
|
|
1516
|
+
"properties": {
|
|
1517
|
+
"sssi": {
|
|
1518
|
+
"type": "boolean",
|
|
1519
|
+
"description": "Sites of Special Scientific Interest layer",
|
|
1520
|
+
"title": "Sssi"
|
|
1521
|
+
}
|
|
1522
|
+
},
|
|
1523
|
+
"additionalProperties": false,
|
|
1524
|
+
"title": "Map Layers"
|
|
1525
|
+
},
|
|
1487
1526
|
"format": {
|
|
1488
1527
|
"type": "string",
|
|
1489
1528
|
"description": "Format for telephone number - for TelephoneNumberField only",
|
|
@@ -575,6 +575,19 @@
|
|
|
575
575
|
},
|
|
576
576
|
"title": "Geometry Types"
|
|
577
577
|
},
|
|
578
|
+
"mapLayers": {
|
|
579
|
+
"type": "object",
|
|
580
|
+
"description": "Supported map layers",
|
|
581
|
+
"properties": {
|
|
582
|
+
"sssi": {
|
|
583
|
+
"type": "boolean",
|
|
584
|
+
"description": "Sites of Special Scientific Interest layer",
|
|
585
|
+
"title": "Sssi"
|
|
586
|
+
}
|
|
587
|
+
},
|
|
588
|
+
"additionalProperties": false,
|
|
589
|
+
"title": "Map Layers"
|
|
590
|
+
},
|
|
578
591
|
"format": {
|
|
579
592
|
"type": "string",
|
|
580
593
|
"description": "Format for telephone number - for TelephoneNumberField only",
|
|
@@ -870,6 +883,19 @@
|
|
|
870
883
|
},
|
|
871
884
|
"title": "Geometry Types"
|
|
872
885
|
},
|
|
886
|
+
"mapLayers": {
|
|
887
|
+
"type": "object",
|
|
888
|
+
"description": "Supported map layers",
|
|
889
|
+
"properties": {
|
|
890
|
+
"sssi": {
|
|
891
|
+
"type": "boolean",
|
|
892
|
+
"description": "Sites of Special Scientific Interest layer",
|
|
893
|
+
"title": "Sssi"
|
|
894
|
+
}
|
|
895
|
+
},
|
|
896
|
+
"additionalProperties": false,
|
|
897
|
+
"title": "Map Layers"
|
|
898
|
+
},
|
|
873
899
|
"format": {
|
|
874
900
|
"type": "string",
|
|
875
901
|
"description": "Format for telephone number - for TelephoneNumberField only",
|
|
@@ -1249,6 +1275,19 @@
|
|
|
1249
1275
|
},
|
|
1250
1276
|
"title": "Geometry Types"
|
|
1251
1277
|
},
|
|
1278
|
+
"mapLayers": {
|
|
1279
|
+
"type": "object",
|
|
1280
|
+
"description": "Supported map layers",
|
|
1281
|
+
"properties": {
|
|
1282
|
+
"sssi": {
|
|
1283
|
+
"type": "boolean",
|
|
1284
|
+
"description": "Sites of Special Scientific Interest layer",
|
|
1285
|
+
"title": "Sssi"
|
|
1286
|
+
}
|
|
1287
|
+
},
|
|
1288
|
+
"additionalProperties": false,
|
|
1289
|
+
"title": "Map Layers"
|
|
1290
|
+
},
|
|
1252
1291
|
"format": {
|
|
1253
1292
|
"type": "string",
|
|
1254
1293
|
"description": "Format for telephone number - for TelephoneNumberField only",
|
|
@@ -1653,6 +1692,19 @@
|
|
|
1653
1692
|
},
|
|
1654
1693
|
"title": "Geometry Types"
|
|
1655
1694
|
},
|
|
1695
|
+
"mapLayers": {
|
|
1696
|
+
"type": "object",
|
|
1697
|
+
"description": "Supported map layers",
|
|
1698
|
+
"properties": {
|
|
1699
|
+
"sssi": {
|
|
1700
|
+
"type": "boolean",
|
|
1701
|
+
"description": "Sites of Special Scientific Interest layer",
|
|
1702
|
+
"title": "Sssi"
|
|
1703
|
+
}
|
|
1704
|
+
},
|
|
1705
|
+
"additionalProperties": false,
|
|
1706
|
+
"title": "Map Layers"
|
|
1707
|
+
},
|
|
1656
1708
|
"format": {
|
|
1657
1709
|
"type": "string",
|
|
1658
1710
|
"description": "Format for telephone number - for TelephoneNumberField only",
|
|
@@ -2018,6 +2070,19 @@
|
|
|
2018
2070
|
},
|
|
2019
2071
|
"title": "Geometry Types"
|
|
2020
2072
|
},
|
|
2073
|
+
"mapLayers": {
|
|
2074
|
+
"type": "object",
|
|
2075
|
+
"description": "Supported map layers",
|
|
2076
|
+
"properties": {
|
|
2077
|
+
"sssi": {
|
|
2078
|
+
"type": "boolean",
|
|
2079
|
+
"description": "Sites of Special Scientific Interest layer",
|
|
2080
|
+
"title": "Sssi"
|
|
2081
|
+
}
|
|
2082
|
+
},
|
|
2083
|
+
"additionalProperties": false,
|
|
2084
|
+
"title": "Map Layers"
|
|
2085
|
+
},
|
|
2021
2086
|
"format": {
|
|
2022
2087
|
"type": "string",
|
|
2023
2088
|
"description": "Format for telephone number - for TelephoneNumberField only",
|
|
@@ -273,6 +273,19 @@
|
|
|
273
273
|
},
|
|
274
274
|
"title": "Geometry Types"
|
|
275
275
|
},
|
|
276
|
+
"mapLayers": {
|
|
277
|
+
"type": "object",
|
|
278
|
+
"description": "Supported map layers",
|
|
279
|
+
"properties": {
|
|
280
|
+
"sssi": {
|
|
281
|
+
"type": "boolean",
|
|
282
|
+
"description": "Sites of Special Scientific Interest layer",
|
|
283
|
+
"title": "Sssi"
|
|
284
|
+
}
|
|
285
|
+
},
|
|
286
|
+
"additionalProperties": false,
|
|
287
|
+
"title": "Map Layers"
|
|
288
|
+
},
|
|
276
289
|
"format": {
|
|
277
290
|
"type": "string",
|
|
278
291
|
"description": "Format for telephone number - for TelephoneNumberField only",
|
|
@@ -638,6 +651,19 @@
|
|
|
638
651
|
},
|
|
639
652
|
"title": "Geometry Types"
|
|
640
653
|
},
|
|
654
|
+
"mapLayers": {
|
|
655
|
+
"type": "object",
|
|
656
|
+
"description": "Supported map layers",
|
|
657
|
+
"properties": {
|
|
658
|
+
"sssi": {
|
|
659
|
+
"type": "boolean",
|
|
660
|
+
"description": "Sites of Special Scientific Interest layer",
|
|
661
|
+
"title": "Sssi"
|
|
662
|
+
}
|
|
663
|
+
},
|
|
664
|
+
"additionalProperties": false,
|
|
665
|
+
"title": "Map Layers"
|
|
666
|
+
},
|
|
641
667
|
"format": {
|
|
642
668
|
"type": "string",
|
|
643
669
|
"description": "Format for telephone number - for TelephoneNumberField only",
|
package/schemas/list-schema.json
CHANGED
|
@@ -279,6 +279,19 @@
|
|
|
279
279
|
},
|
|
280
280
|
"title": "Geometry Types"
|
|
281
281
|
},
|
|
282
|
+
"mapLayers": {
|
|
283
|
+
"type": "object",
|
|
284
|
+
"description": "Supported map layers",
|
|
285
|
+
"properties": {
|
|
286
|
+
"sssi": {
|
|
287
|
+
"type": "boolean",
|
|
288
|
+
"description": "Sites of Special Scientific Interest layer",
|
|
289
|
+
"title": "Sssi"
|
|
290
|
+
}
|
|
291
|
+
},
|
|
292
|
+
"additionalProperties": false,
|
|
293
|
+
"title": "Map Layers"
|
|
294
|
+
},
|
|
282
295
|
"format": {
|
|
283
296
|
"type": "string",
|
|
284
297
|
"description": "Format for telephone number - for TelephoneNumberField only",
|
|
@@ -644,6 +657,19 @@
|
|
|
644
657
|
},
|
|
645
658
|
"title": "Geometry Types"
|
|
646
659
|
},
|
|
660
|
+
"mapLayers": {
|
|
661
|
+
"type": "object",
|
|
662
|
+
"description": "Supported map layers",
|
|
663
|
+
"properties": {
|
|
664
|
+
"sssi": {
|
|
665
|
+
"type": "boolean",
|
|
666
|
+
"description": "Sites of Special Scientific Interest layer",
|
|
667
|
+
"title": "Sssi"
|
|
668
|
+
}
|
|
669
|
+
},
|
|
670
|
+
"additionalProperties": false,
|
|
671
|
+
"title": "Map Layers"
|
|
672
|
+
},
|
|
647
673
|
"format": {
|
|
648
674
|
"type": "string",
|
|
649
675
|
"description": "Format for telephone number - for TelephoneNumberField only",
|
|
@@ -385,6 +385,19 @@
|
|
|
385
385
|
},
|
|
386
386
|
"title": "Geometry Types"
|
|
387
387
|
},
|
|
388
|
+
"mapLayers": {
|
|
389
|
+
"type": "object",
|
|
390
|
+
"description": "Supported map layers",
|
|
391
|
+
"properties": {
|
|
392
|
+
"sssi": {
|
|
393
|
+
"type": "boolean",
|
|
394
|
+
"description": "Sites of Special Scientific Interest layer",
|
|
395
|
+
"title": "Sssi"
|
|
396
|
+
}
|
|
397
|
+
},
|
|
398
|
+
"additionalProperties": false,
|
|
399
|
+
"title": "Map Layers"
|
|
400
|
+
},
|
|
388
401
|
"format": {
|
|
389
402
|
"type": "string",
|
|
390
403
|
"description": "Format for telephone number - for TelephoneNumberField only",
|
|
@@ -680,6 +693,19 @@
|
|
|
680
693
|
},
|
|
681
694
|
"title": "Geometry Types"
|
|
682
695
|
},
|
|
696
|
+
"mapLayers": {
|
|
697
|
+
"type": "object",
|
|
698
|
+
"description": "Supported map layers",
|
|
699
|
+
"properties": {
|
|
700
|
+
"sssi": {
|
|
701
|
+
"type": "boolean",
|
|
702
|
+
"description": "Sites of Special Scientific Interest layer",
|
|
703
|
+
"title": "Sssi"
|
|
704
|
+
}
|
|
705
|
+
},
|
|
706
|
+
"additionalProperties": false,
|
|
707
|
+
"title": "Map Layers"
|
|
708
|
+
},
|
|
683
709
|
"format": {
|
|
684
710
|
"type": "string",
|
|
685
711
|
"description": "Format for telephone number - for TelephoneNumberField only",
|
|
@@ -1059,6 +1085,19 @@
|
|
|
1059
1085
|
},
|
|
1060
1086
|
"title": "Geometry Types"
|
|
1061
1087
|
},
|
|
1088
|
+
"mapLayers": {
|
|
1089
|
+
"type": "object",
|
|
1090
|
+
"description": "Supported map layers",
|
|
1091
|
+
"properties": {
|
|
1092
|
+
"sssi": {
|
|
1093
|
+
"type": "boolean",
|
|
1094
|
+
"description": "Sites of Special Scientific Interest layer",
|
|
1095
|
+
"title": "Sssi"
|
|
1096
|
+
}
|
|
1097
|
+
},
|
|
1098
|
+
"additionalProperties": false,
|
|
1099
|
+
"title": "Map Layers"
|
|
1100
|
+
},
|
|
1062
1101
|
"format": {
|
|
1063
1102
|
"type": "string",
|
|
1064
1103
|
"description": "Format for telephone number - for TelephoneNumberField only",
|
package/schemas/page-schema.json
CHANGED
|
@@ -248,6 +248,19 @@
|
|
|
248
248
|
},
|
|
249
249
|
"title": "Geometry Types"
|
|
250
250
|
},
|
|
251
|
+
"mapLayers": {
|
|
252
|
+
"type": "object",
|
|
253
|
+
"description": "Supported map layers",
|
|
254
|
+
"properties": {
|
|
255
|
+
"sssi": {
|
|
256
|
+
"type": "boolean",
|
|
257
|
+
"description": "Sites of Special Scientific Interest layer",
|
|
258
|
+
"title": "Sssi"
|
|
259
|
+
}
|
|
260
|
+
},
|
|
261
|
+
"additionalProperties": false,
|
|
262
|
+
"title": "Map Layers"
|
|
263
|
+
},
|
|
251
264
|
"format": {
|
|
252
265
|
"type": "string",
|
|
253
266
|
"description": "Format for telephone number - for TelephoneNumberField only",
|
package/src/components/types.ts
CHANGED
|
@@ -188,12 +188,17 @@ export interface UkAddressFieldComponent extends FormFieldBase {
|
|
|
188
188
|
}
|
|
189
189
|
}
|
|
190
190
|
|
|
191
|
+
export interface MapLayerOptions {
|
|
192
|
+
sssi?: boolean
|
|
193
|
+
}
|
|
194
|
+
|
|
191
195
|
// Precise Location Fields
|
|
192
196
|
export interface EastingNorthingFieldComponent extends FormFieldBase {
|
|
193
197
|
type: ComponentType.EastingNorthingField
|
|
194
198
|
options: FormFieldBase['options'] & {
|
|
195
199
|
condition?: string
|
|
196
200
|
customValidationMessage?: string
|
|
201
|
+
mapLayers?: MapLayerOptions
|
|
197
202
|
}
|
|
198
203
|
schema?: {
|
|
199
204
|
easting?: {
|
|
@@ -212,6 +217,7 @@ export interface OsGridRefFieldComponent extends FormFieldBase {
|
|
|
212
217
|
options: FormFieldBase['options'] & {
|
|
213
218
|
condition?: string
|
|
214
219
|
customValidationMessage?: string
|
|
220
|
+
mapLayers?: MapLayerOptions
|
|
215
221
|
}
|
|
216
222
|
}
|
|
217
223
|
|
|
@@ -228,6 +234,7 @@ export interface LatLongFieldComponent extends FormFieldBase {
|
|
|
228
234
|
options: FormFieldBase['options'] & {
|
|
229
235
|
condition?: string
|
|
230
236
|
customValidationMessage?: string
|
|
237
|
+
mapLayers?: MapLayerOptions
|
|
231
238
|
}
|
|
232
239
|
schema?: {
|
|
233
240
|
latitude?: {
|
|
@@ -290,6 +297,7 @@ export interface GeospatialFieldComponent extends FormFieldBase {
|
|
|
290
297
|
condition?: string
|
|
291
298
|
countries?: GeospatialFieldOptionsCountry[]
|
|
292
299
|
geometryTypes?: GeospatialFieldGeometryTypesEnum[]
|
|
300
|
+
mapLayers?: MapLayerOptions
|
|
293
301
|
}
|
|
294
302
|
schema?: {
|
|
295
303
|
max?: number
|
|
@@ -680,6 +680,25 @@ export const componentSchema = Joi.object<ComponentDef>()
|
|
|
680
680
|
'Geometry types for geospatial data - for GeospatialField only'
|
|
681
681
|
)
|
|
682
682
|
}).description('Geometry types - for GeospatialField only'),
|
|
683
|
+
mapLayers: Joi.when('type', {
|
|
684
|
+
is: Joi.string()
|
|
685
|
+
.trim()
|
|
686
|
+
.valid(
|
|
687
|
+
ComponentType.GeospatialField,
|
|
688
|
+
ComponentType.EastingNorthingField,
|
|
689
|
+
ComponentType.LatLongField,
|
|
690
|
+
ComponentType.OsGridRefField
|
|
691
|
+
)
|
|
692
|
+
.required(),
|
|
693
|
+
then: Joi.object()
|
|
694
|
+
.keys({
|
|
695
|
+
sssi: Joi.boolean()
|
|
696
|
+
.optional()
|
|
697
|
+
.description('Sites of Special Scientific Interest layer')
|
|
698
|
+
})
|
|
699
|
+
.optional()
|
|
700
|
+
.description('Supported map layers')
|
|
701
|
+
}).description('Map layers'),
|
|
683
702
|
format: Joi.when('type', {
|
|
684
703
|
is: Joi.string()
|
|
685
704
|
.trim()
|
|
@@ -471,6 +471,11 @@ export const countriesSchema = Joi.array()
|
|
|
471
471
|
.single()
|
|
472
472
|
.description('The country to be included in a geospatial field')
|
|
473
473
|
|
|
474
|
+
export const mapLayersSchema = Joi.array()
|
|
475
|
+
.items(Joi.string().valid('sssi'))
|
|
476
|
+
.single()
|
|
477
|
+
.description('The map layers to be displayed')
|
|
478
|
+
|
|
474
479
|
export const exactFeaturesSchema = Joi.number()
|
|
475
480
|
.empty('')
|
|
476
481
|
.integer()
|
|
@@ -693,6 +698,7 @@ export const questionDetailsFullSchema = {
|
|
|
693
698
|
maxChecksSchema,
|
|
694
699
|
exactChecksSchema,
|
|
695
700
|
countriesSchema,
|
|
701
|
+
mapLayersSchema,
|
|
696
702
|
minFeaturesSchema,
|
|
697
703
|
maxFeaturesSchema,
|
|
698
704
|
exactFeaturesSchema,
|
|
@@ -423,6 +423,11 @@ export interface FormEditor {
|
|
|
423
423
|
*/
|
|
424
424
|
geometryTypes?: GeospatialFieldGeometryTypesEnum[]
|
|
425
425
|
|
|
426
|
+
/**
|
|
427
|
+
* The layers to include for map-based geospatial questions
|
|
428
|
+
*/
|
|
429
|
+
mapLayers?: string[]
|
|
430
|
+
|
|
426
431
|
/**
|
|
427
432
|
* The format restriction for telephone number questions
|
|
428
433
|
*/
|
|
@@ -519,6 +524,7 @@ export type FormEditorInputQuestion = Pick<
|
|
|
519
524
|
| 'minFeatures'
|
|
520
525
|
| 'maxFeatures'
|
|
521
526
|
| 'telephoneNumberFormat'
|
|
527
|
+
| 'mapLayers'
|
|
522
528
|
>
|
|
523
529
|
|
|
524
530
|
export type FormEditorInputPageSettings = Pick<
|