@defra/forms-model 3.0.675 → 3.0.677
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 +4 -1
- package/dist/module/form/form-definition/index.js.map +1 -1
- package/dist/module/form/form-editor/index.js +3 -1
- 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 +3 -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 +133 -133
- package/dist/types/form/form-editor/index.d.ts.map +1 -1
- package/dist/types/form/form-editor/types.d.ts +9 -1
- package/dist/types/form/form-editor/types.d.ts.map +1 -1
- package/package.json +1 -1
- package/schemas/component-schema-v2.json +16 -1
- package/schemas/component-schema.json +16 -1
- package/schemas/form-definition-schema.json +48 -3
- package/schemas/form-definition-v2-schema.json +80 -5
- package/schemas/list-schema-v2.json +32 -2
- package/schemas/list-schema.json +32 -2
- package/schemas/page-schema-v2.json +48 -3
- package/schemas/page-schema.json +16 -1
- package/src/components/types.ts +3 -0
- package/src/form/form-definition/index.ts +15 -1
- package/src/form/form-editor/index.ts +6 -3
- package/src/form/form-editor/types.ts +12 -0
|
@@ -440,9 +440,14 @@
|
|
|
440
440
|
"properties": {
|
|
441
441
|
"shortDescription": {
|
|
442
442
|
"type": "string",
|
|
443
|
-
"description": "
|
|
443
|
+
"description": "Short description of the component used in the summary",
|
|
444
444
|
"title": "Short Description"
|
|
445
445
|
},
|
|
446
|
+
"errorDescription": {
|
|
447
|
+
"type": "string",
|
|
448
|
+
"description": "Description that will be displayed in error messages",
|
|
449
|
+
"title": "Error Description"
|
|
450
|
+
},
|
|
446
451
|
"hint": {
|
|
447
452
|
"type": "string",
|
|
448
453
|
"description": "Additional guidance text displayed below the component title",
|
|
@@ -473,6 +478,16 @@
|
|
|
473
478
|
"description": "Maximum days in the future allowed for date inputs",
|
|
474
479
|
"title": "Max Days In Future"
|
|
475
480
|
},
|
|
481
|
+
"earliestDate": {
|
|
482
|
+
"type": "integer",
|
|
483
|
+
"description": "Earliest date of allowed date range for date inputs",
|
|
484
|
+
"title": "Earliest Date"
|
|
485
|
+
},
|
|
486
|
+
"latestDate": {
|
|
487
|
+
"type": "integer",
|
|
488
|
+
"description": "Latest date of allowed date range for date inputs",
|
|
489
|
+
"title": "Latest Date"
|
|
490
|
+
},
|
|
476
491
|
"customValidationMessage": {
|
|
477
492
|
"type": "string",
|
|
478
493
|
"description": "Custom error message for validation failures",
|
|
@@ -720,9 +735,14 @@
|
|
|
720
735
|
"properties": {
|
|
721
736
|
"shortDescription": {
|
|
722
737
|
"type": "string",
|
|
723
|
-
"description": "
|
|
738
|
+
"description": "Short description of the component used in the summary",
|
|
724
739
|
"title": "Short Description"
|
|
725
740
|
},
|
|
741
|
+
"errorDescription": {
|
|
742
|
+
"type": "string",
|
|
743
|
+
"description": "Description that will be displayed in error messages",
|
|
744
|
+
"title": "Error Description"
|
|
745
|
+
},
|
|
726
746
|
"hint": {
|
|
727
747
|
"type": "string",
|
|
728
748
|
"description": "Additional guidance text displayed below the component title",
|
|
@@ -753,6 +773,16 @@
|
|
|
753
773
|
"description": "Maximum days in the future allowed for date inputs",
|
|
754
774
|
"title": "Max Days In Future"
|
|
755
775
|
},
|
|
776
|
+
"earliestDate": {
|
|
777
|
+
"type": "integer",
|
|
778
|
+
"description": "Earliest date of allowed date range for date inputs",
|
|
779
|
+
"title": "Earliest Date"
|
|
780
|
+
},
|
|
781
|
+
"latestDate": {
|
|
782
|
+
"type": "integer",
|
|
783
|
+
"description": "Latest date of allowed date range for date inputs",
|
|
784
|
+
"title": "Latest Date"
|
|
785
|
+
},
|
|
756
786
|
"customValidationMessage": {
|
|
757
787
|
"type": "string",
|
|
758
788
|
"description": "Custom error message for validation failures",
|
|
@@ -1026,9 +1056,14 @@
|
|
|
1026
1056
|
},
|
|
1027
1057
|
"shortDescription": {
|
|
1028
1058
|
"type": "string",
|
|
1029
|
-
"description": "
|
|
1059
|
+
"description": "Short description of the component used in the summary",
|
|
1030
1060
|
"title": "Short Description"
|
|
1031
1061
|
},
|
|
1062
|
+
"errorDescription": {
|
|
1063
|
+
"type": "string",
|
|
1064
|
+
"description": "Description that will be displayed in error messages",
|
|
1065
|
+
"title": "Error Description"
|
|
1066
|
+
},
|
|
1032
1067
|
"name": {
|
|
1033
1068
|
"type": [
|
|
1034
1069
|
"array",
|
|
@@ -1117,6 +1152,16 @@
|
|
|
1117
1152
|
"description": "Maximum days in the future allowed for date inputs",
|
|
1118
1153
|
"title": "Max Days In Future"
|
|
1119
1154
|
},
|
|
1155
|
+
"earliestDate": {
|
|
1156
|
+
"type": "integer",
|
|
1157
|
+
"description": "Earliest date of allowed date range for date inputs",
|
|
1158
|
+
"title": "Earliest Date"
|
|
1159
|
+
},
|
|
1160
|
+
"latestDate": {
|
|
1161
|
+
"type": "integer",
|
|
1162
|
+
"description": "Latest date of allowed date range for date inputs",
|
|
1163
|
+
"title": "Latest Date"
|
|
1164
|
+
},
|
|
1120
1165
|
"customValidationMessage": {
|
|
1121
1166
|
"type": "string",
|
|
1122
1167
|
"description": "Custom error message for validation failures",
|
|
@@ -1415,9 +1460,14 @@
|
|
|
1415
1460
|
},
|
|
1416
1461
|
"shortDescription": {
|
|
1417
1462
|
"type": "string",
|
|
1418
|
-
"description": "
|
|
1463
|
+
"description": "Short description of the component used in the summary",
|
|
1419
1464
|
"title": "Short Description"
|
|
1420
1465
|
},
|
|
1466
|
+
"errorDescription": {
|
|
1467
|
+
"type": "string",
|
|
1468
|
+
"description": "Description that will be displayed in error messages",
|
|
1469
|
+
"title": "Error Description"
|
|
1470
|
+
},
|
|
1421
1471
|
"name": {
|
|
1422
1472
|
"type": [
|
|
1423
1473
|
"array",
|
|
@@ -1506,6 +1556,16 @@
|
|
|
1506
1556
|
"description": "Maximum days in the future allowed for date inputs",
|
|
1507
1557
|
"title": "Max Days In Future"
|
|
1508
1558
|
},
|
|
1559
|
+
"earliestDate": {
|
|
1560
|
+
"type": "integer",
|
|
1561
|
+
"description": "Earliest date of allowed date range for date inputs",
|
|
1562
|
+
"title": "Earliest Date"
|
|
1563
|
+
},
|
|
1564
|
+
"latestDate": {
|
|
1565
|
+
"type": "integer",
|
|
1566
|
+
"description": "Latest date of allowed date range for date inputs",
|
|
1567
|
+
"title": "Latest Date"
|
|
1568
|
+
},
|
|
1509
1569
|
"customValidationMessage": {
|
|
1510
1570
|
"type": "string",
|
|
1511
1571
|
"description": "Custom error message for validation failures",
|
|
@@ -1765,9 +1825,14 @@
|
|
|
1765
1825
|
},
|
|
1766
1826
|
"shortDescription": {
|
|
1767
1827
|
"type": "string",
|
|
1768
|
-
"description": "
|
|
1828
|
+
"description": "Short description of the component used in the summary",
|
|
1769
1829
|
"title": "Short Description"
|
|
1770
1830
|
},
|
|
1831
|
+
"errorDescription": {
|
|
1832
|
+
"type": "string",
|
|
1833
|
+
"description": "Description that will be displayed in error messages",
|
|
1834
|
+
"title": "Error Description"
|
|
1835
|
+
},
|
|
1771
1836
|
"name": {
|
|
1772
1837
|
"type": [
|
|
1773
1838
|
"array",
|
|
@@ -1856,6 +1921,16 @@
|
|
|
1856
1921
|
"description": "Maximum days in the future allowed for date inputs",
|
|
1857
1922
|
"title": "Max Days In Future"
|
|
1858
1923
|
},
|
|
1924
|
+
"earliestDate": {
|
|
1925
|
+
"type": "integer",
|
|
1926
|
+
"description": "Earliest date of allowed date range for date inputs",
|
|
1927
|
+
"title": "Earliest Date"
|
|
1928
|
+
},
|
|
1929
|
+
"latestDate": {
|
|
1930
|
+
"type": "integer",
|
|
1931
|
+
"description": "Latest date of allowed date range for date inputs",
|
|
1932
|
+
"title": "Latest Date"
|
|
1933
|
+
},
|
|
1859
1934
|
"customValidationMessage": {
|
|
1860
1935
|
"type": "string",
|
|
1861
1936
|
"description": "Custom error message for validation failures",
|
|
@@ -80,9 +80,14 @@
|
|
|
80
80
|
},
|
|
81
81
|
"shortDescription": {
|
|
82
82
|
"type": "string",
|
|
83
|
-
"description": "
|
|
83
|
+
"description": "Short description of the component used in the summary",
|
|
84
84
|
"title": "Short Description"
|
|
85
85
|
},
|
|
86
|
+
"errorDescription": {
|
|
87
|
+
"type": "string",
|
|
88
|
+
"description": "Description that will be displayed in error messages",
|
|
89
|
+
"title": "Error Description"
|
|
90
|
+
},
|
|
86
91
|
"name": {
|
|
87
92
|
"type": [
|
|
88
93
|
"array",
|
|
@@ -171,6 +176,16 @@
|
|
|
171
176
|
"description": "Maximum days in the future allowed for date inputs",
|
|
172
177
|
"title": "Max Days In Future"
|
|
173
178
|
},
|
|
179
|
+
"earliestDate": {
|
|
180
|
+
"type": "integer",
|
|
181
|
+
"description": "Earliest date of allowed date range for date inputs",
|
|
182
|
+
"title": "Earliest Date"
|
|
183
|
+
},
|
|
184
|
+
"latestDate": {
|
|
185
|
+
"type": "integer",
|
|
186
|
+
"description": "Latest date of allowed date range for date inputs",
|
|
187
|
+
"title": "Latest Date"
|
|
188
|
+
},
|
|
174
189
|
"customValidationMessage": {
|
|
175
190
|
"type": "string",
|
|
176
191
|
"description": "Custom error message for validation failures",
|
|
@@ -430,9 +445,14 @@
|
|
|
430
445
|
},
|
|
431
446
|
"shortDescription": {
|
|
432
447
|
"type": "string",
|
|
433
|
-
"description": "
|
|
448
|
+
"description": "Short description of the component used in the summary",
|
|
434
449
|
"title": "Short Description"
|
|
435
450
|
},
|
|
451
|
+
"errorDescription": {
|
|
452
|
+
"type": "string",
|
|
453
|
+
"description": "Description that will be displayed in error messages",
|
|
454
|
+
"title": "Error Description"
|
|
455
|
+
},
|
|
436
456
|
"name": {
|
|
437
457
|
"type": [
|
|
438
458
|
"array",
|
|
@@ -521,6 +541,16 @@
|
|
|
521
541
|
"description": "Maximum days in the future allowed for date inputs",
|
|
522
542
|
"title": "Max Days In Future"
|
|
523
543
|
},
|
|
544
|
+
"earliestDate": {
|
|
545
|
+
"type": "integer",
|
|
546
|
+
"description": "Earliest date of allowed date range for date inputs",
|
|
547
|
+
"title": "Earliest Date"
|
|
548
|
+
},
|
|
549
|
+
"latestDate": {
|
|
550
|
+
"type": "integer",
|
|
551
|
+
"description": "Latest date of allowed date range for date inputs",
|
|
552
|
+
"title": "Latest Date"
|
|
553
|
+
},
|
|
524
554
|
"customValidationMessage": {
|
|
525
555
|
"type": "string",
|
|
526
556
|
"description": "Custom error message for validation failures",
|
package/schemas/list-schema.json
CHANGED
|
@@ -86,9 +86,14 @@
|
|
|
86
86
|
},
|
|
87
87
|
"shortDescription": {
|
|
88
88
|
"type": "string",
|
|
89
|
-
"description": "
|
|
89
|
+
"description": "Short description of the component used in the summary",
|
|
90
90
|
"title": "Short Description"
|
|
91
91
|
},
|
|
92
|
+
"errorDescription": {
|
|
93
|
+
"type": "string",
|
|
94
|
+
"description": "Description that will be displayed in error messages",
|
|
95
|
+
"title": "Error Description"
|
|
96
|
+
},
|
|
92
97
|
"name": {
|
|
93
98
|
"type": [
|
|
94
99
|
"array",
|
|
@@ -177,6 +182,16 @@
|
|
|
177
182
|
"description": "Maximum days in the future allowed for date inputs",
|
|
178
183
|
"title": "Max Days In Future"
|
|
179
184
|
},
|
|
185
|
+
"earliestDate": {
|
|
186
|
+
"type": "integer",
|
|
187
|
+
"description": "Earliest date of allowed date range for date inputs",
|
|
188
|
+
"title": "Earliest Date"
|
|
189
|
+
},
|
|
190
|
+
"latestDate": {
|
|
191
|
+
"type": "integer",
|
|
192
|
+
"description": "Latest date of allowed date range for date inputs",
|
|
193
|
+
"title": "Latest Date"
|
|
194
|
+
},
|
|
180
195
|
"customValidationMessage": {
|
|
181
196
|
"type": "string",
|
|
182
197
|
"description": "Custom error message for validation failures",
|
|
@@ -436,9 +451,14 @@
|
|
|
436
451
|
},
|
|
437
452
|
"shortDescription": {
|
|
438
453
|
"type": "string",
|
|
439
|
-
"description": "
|
|
454
|
+
"description": "Short description of the component used in the summary",
|
|
440
455
|
"title": "Short Description"
|
|
441
456
|
},
|
|
457
|
+
"errorDescription": {
|
|
458
|
+
"type": "string",
|
|
459
|
+
"description": "Description that will be displayed in error messages",
|
|
460
|
+
"title": "Error Description"
|
|
461
|
+
},
|
|
442
462
|
"name": {
|
|
443
463
|
"type": [
|
|
444
464
|
"array",
|
|
@@ -527,6 +547,16 @@
|
|
|
527
547
|
"description": "Maximum days in the future allowed for date inputs",
|
|
528
548
|
"title": "Max Days In Future"
|
|
529
549
|
},
|
|
550
|
+
"earliestDate": {
|
|
551
|
+
"type": "integer",
|
|
552
|
+
"description": "Earliest date of allowed date range for date inputs",
|
|
553
|
+
"title": "Earliest Date"
|
|
554
|
+
},
|
|
555
|
+
"latestDate": {
|
|
556
|
+
"type": "integer",
|
|
557
|
+
"description": "Latest date of allowed date range for date inputs",
|
|
558
|
+
"title": "Latest Date"
|
|
559
|
+
},
|
|
530
560
|
"customValidationMessage": {
|
|
531
561
|
"type": "string",
|
|
532
562
|
"description": "Custom error message for validation failures",
|
|
@@ -250,9 +250,14 @@
|
|
|
250
250
|
"properties": {
|
|
251
251
|
"shortDescription": {
|
|
252
252
|
"type": "string",
|
|
253
|
-
"description": "
|
|
253
|
+
"description": "Short description of the component used in the summary",
|
|
254
254
|
"title": "Short Description"
|
|
255
255
|
},
|
|
256
|
+
"errorDescription": {
|
|
257
|
+
"type": "string",
|
|
258
|
+
"description": "Description that will be displayed in error messages",
|
|
259
|
+
"title": "Error Description"
|
|
260
|
+
},
|
|
256
261
|
"hint": {
|
|
257
262
|
"type": "string",
|
|
258
263
|
"description": "Additional guidance text displayed below the component title",
|
|
@@ -283,6 +288,16 @@
|
|
|
283
288
|
"description": "Maximum days in the future allowed for date inputs",
|
|
284
289
|
"title": "Max Days In Future"
|
|
285
290
|
},
|
|
291
|
+
"earliestDate": {
|
|
292
|
+
"type": "integer",
|
|
293
|
+
"description": "Earliest date of allowed date range for date inputs",
|
|
294
|
+
"title": "Earliest Date"
|
|
295
|
+
},
|
|
296
|
+
"latestDate": {
|
|
297
|
+
"type": "integer",
|
|
298
|
+
"description": "Latest date of allowed date range for date inputs",
|
|
299
|
+
"title": "Latest Date"
|
|
300
|
+
},
|
|
286
301
|
"customValidationMessage": {
|
|
287
302
|
"type": "string",
|
|
288
303
|
"description": "Custom error message for validation failures",
|
|
@@ -530,9 +545,14 @@
|
|
|
530
545
|
"properties": {
|
|
531
546
|
"shortDescription": {
|
|
532
547
|
"type": "string",
|
|
533
|
-
"description": "
|
|
548
|
+
"description": "Short description of the component used in the summary",
|
|
534
549
|
"title": "Short Description"
|
|
535
550
|
},
|
|
551
|
+
"errorDescription": {
|
|
552
|
+
"type": "string",
|
|
553
|
+
"description": "Description that will be displayed in error messages",
|
|
554
|
+
"title": "Error Description"
|
|
555
|
+
},
|
|
536
556
|
"hint": {
|
|
537
557
|
"type": "string",
|
|
538
558
|
"description": "Additional guidance text displayed below the component title",
|
|
@@ -563,6 +583,16 @@
|
|
|
563
583
|
"description": "Maximum days in the future allowed for date inputs",
|
|
564
584
|
"title": "Max Days In Future"
|
|
565
585
|
},
|
|
586
|
+
"earliestDate": {
|
|
587
|
+
"type": "integer",
|
|
588
|
+
"description": "Earliest date of allowed date range for date inputs",
|
|
589
|
+
"title": "Earliest Date"
|
|
590
|
+
},
|
|
591
|
+
"latestDate": {
|
|
592
|
+
"type": "integer",
|
|
593
|
+
"description": "Latest date of allowed date range for date inputs",
|
|
594
|
+
"title": "Latest Date"
|
|
595
|
+
},
|
|
566
596
|
"customValidationMessage": {
|
|
567
597
|
"type": "string",
|
|
568
598
|
"description": "Custom error message for validation failures",
|
|
@@ -836,9 +866,14 @@
|
|
|
836
866
|
},
|
|
837
867
|
"shortDescription": {
|
|
838
868
|
"type": "string",
|
|
839
|
-
"description": "
|
|
869
|
+
"description": "Short description of the component used in the summary",
|
|
840
870
|
"title": "Short Description"
|
|
841
871
|
},
|
|
872
|
+
"errorDescription": {
|
|
873
|
+
"type": "string",
|
|
874
|
+
"description": "Description that will be displayed in error messages",
|
|
875
|
+
"title": "Error Description"
|
|
876
|
+
},
|
|
842
877
|
"name": {
|
|
843
878
|
"type": [
|
|
844
879
|
"array",
|
|
@@ -927,6 +962,16 @@
|
|
|
927
962
|
"description": "Maximum days in the future allowed for date inputs",
|
|
928
963
|
"title": "Max Days In Future"
|
|
929
964
|
},
|
|
965
|
+
"earliestDate": {
|
|
966
|
+
"type": "integer",
|
|
967
|
+
"description": "Earliest date of allowed date range for date inputs",
|
|
968
|
+
"title": "Earliest Date"
|
|
969
|
+
},
|
|
970
|
+
"latestDate": {
|
|
971
|
+
"type": "integer",
|
|
972
|
+
"description": "Latest date of allowed date range for date inputs",
|
|
973
|
+
"title": "Latest Date"
|
|
974
|
+
},
|
|
930
975
|
"customValidationMessage": {
|
|
931
976
|
"type": "string",
|
|
932
977
|
"description": "Custom error message for validation failures",
|
package/schemas/page-schema.json
CHANGED
|
@@ -55,9 +55,14 @@
|
|
|
55
55
|
},
|
|
56
56
|
"shortDescription": {
|
|
57
57
|
"type": "string",
|
|
58
|
-
"description": "
|
|
58
|
+
"description": "Short description of the component used in the summary",
|
|
59
59
|
"title": "Short Description"
|
|
60
60
|
},
|
|
61
|
+
"errorDescription": {
|
|
62
|
+
"type": "string",
|
|
63
|
+
"description": "Description that will be displayed in error messages",
|
|
64
|
+
"title": "Error Description"
|
|
65
|
+
},
|
|
61
66
|
"name": {
|
|
62
67
|
"type": [
|
|
63
68
|
"array",
|
|
@@ -146,6 +151,16 @@
|
|
|
146
151
|
"description": "Maximum days in the future allowed for date inputs",
|
|
147
152
|
"title": "Max Days In Future"
|
|
148
153
|
},
|
|
154
|
+
"earliestDate": {
|
|
155
|
+
"type": "integer",
|
|
156
|
+
"description": "Earliest date of allowed date range for date inputs",
|
|
157
|
+
"title": "Earliest Date"
|
|
158
|
+
},
|
|
159
|
+
"latestDate": {
|
|
160
|
+
"type": "integer",
|
|
161
|
+
"description": "Latest date of allowed date range for date inputs",
|
|
162
|
+
"title": "Latest Date"
|
|
163
|
+
},
|
|
149
164
|
"customValidationMessage": {
|
|
150
165
|
"type": "string",
|
|
151
166
|
"description": "Custom error message for validation failures",
|
package/src/components/types.ts
CHANGED
|
@@ -23,6 +23,7 @@ interface FormFieldBase {
|
|
|
23
23
|
id?: string
|
|
24
24
|
type: FormComponentsDef['type']
|
|
25
25
|
shortDescription?: string
|
|
26
|
+
errorDescription?: string
|
|
26
27
|
name: string
|
|
27
28
|
title: string
|
|
28
29
|
hint?: string
|
|
@@ -72,6 +73,8 @@ interface DateFieldBase extends FormFieldBase {
|
|
|
72
73
|
options: FormFieldBase['options'] & {
|
|
73
74
|
maxDaysInPast?: number
|
|
74
75
|
maxDaysInFuture?: number
|
|
76
|
+
earliestDate?: string
|
|
77
|
+
latestDate?: string
|
|
75
78
|
}
|
|
76
79
|
}
|
|
77
80
|
|
|
@@ -519,7 +519,11 @@ export const componentSchema = Joi.object<ComponentDef>()
|
|
|
519
519
|
shortDescription: Joi.string()
|
|
520
520
|
.custom(rtrimOnly)
|
|
521
521
|
.optional()
|
|
522
|
-
.description('
|
|
522
|
+
.description('Short description of the component used in the summary'),
|
|
523
|
+
errorDescription: Joi.string()
|
|
524
|
+
.custom(rtrimOnly)
|
|
525
|
+
.optional()
|
|
526
|
+
.description('Description that will be displayed in error messages'),
|
|
523
527
|
name: Joi.when('type', {
|
|
524
528
|
is: Joi.string().valid(
|
|
525
529
|
ComponentType.Details,
|
|
@@ -576,6 +580,16 @@ export const componentSchema = Joi.object<ComponentDef>()
|
|
|
576
580
|
maxDaysInFuture: Joi.number()
|
|
577
581
|
.empty('')
|
|
578
582
|
.description('Maximum days in the future allowed for date inputs'),
|
|
583
|
+
earliestDate: Joi.date()
|
|
584
|
+
.format('YYYY-MM-DD')
|
|
585
|
+
.raw()
|
|
586
|
+
.empty('')
|
|
587
|
+
.description('Earliest date of allowed date range for date inputs'),
|
|
588
|
+
latestDate: Joi.date()
|
|
589
|
+
.format('YYYY-MM-DD')
|
|
590
|
+
.raw()
|
|
591
|
+
.empty('')
|
|
592
|
+
.description('Latest date of allowed date range for date inputs'),
|
|
579
593
|
customValidationMessage: Joi.string()
|
|
580
594
|
.trim()
|
|
581
595
|
.allow('')
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import
|
|
1
|
+
import JoiDate from '@joi/date'
|
|
2
|
+
import JoiBase, { type ArraySchema, type GetRuleOptions } from 'joi'
|
|
2
3
|
|
|
3
4
|
import { rtrimOnly } from '~/src/common/rtrim-only.js'
|
|
4
5
|
import {
|
|
@@ -23,6 +24,8 @@ import {
|
|
|
23
24
|
} from '~/src/form/form-editor/types.js'
|
|
24
25
|
import { preventUnicodeInEmail } from '~/src/form/utils/prevent-unicode.js'
|
|
25
26
|
|
|
27
|
+
const Joi = JoiBase.extend(JoiDate) as JoiBase.Root
|
|
28
|
+
|
|
26
29
|
export const emailAddressNoUnicodeSchema = Joi.string()
|
|
27
30
|
.trim()
|
|
28
31
|
.email({ tlds: { allow: false } })
|
|
@@ -502,11 +505,11 @@ interface DSLSchema<TSchema = Record<string, unknown>[]>
|
|
|
502
505
|
keys: (keys: string[]) => DSLSchema<TSchema>
|
|
503
506
|
}
|
|
504
507
|
|
|
505
|
-
interface CustomValidator extends
|
|
508
|
+
interface CustomValidator extends JoiBase.Root {
|
|
506
509
|
dsv<TSchema>(): DSLSchema<TSchema>
|
|
507
510
|
}
|
|
508
511
|
|
|
509
|
-
export const customValidator = Joi.extend((joi:
|
|
512
|
+
export const customValidator = Joi.extend((joi: JoiBase.Root) => {
|
|
510
513
|
return {
|
|
511
514
|
type: 'dsv',
|
|
512
515
|
base: joi.array(),
|
|
@@ -202,6 +202,16 @@ export interface FormEditor {
|
|
|
202
202
|
*/
|
|
203
203
|
maxPast: string
|
|
204
204
|
|
|
205
|
+
/**
|
|
206
|
+
* The earliest date in a date range that users can enter (YYYY-MM-DD)
|
|
207
|
+
*/
|
|
208
|
+
earliestDate: string
|
|
209
|
+
|
|
210
|
+
/**
|
|
211
|
+
* The latest date in a date range that users can enter (YYYY-MM-DD)
|
|
212
|
+
*/
|
|
213
|
+
latestDate: string
|
|
214
|
+
|
|
205
215
|
/**
|
|
206
216
|
* The exact number of files to upload
|
|
207
217
|
*/
|
|
@@ -455,6 +465,8 @@ export type FormEditorInputQuestion = Pick<
|
|
|
455
465
|
| 'max'
|
|
456
466
|
| 'maxFuture'
|
|
457
467
|
| 'maxPast'
|
|
468
|
+
| 'earliestDate'
|
|
469
|
+
| 'latestDate'
|
|
458
470
|
| 'exactFiles'
|
|
459
471
|
| 'minFiles'
|
|
460
472
|
| 'maxFiles'
|