@chobantonov/jsonforms-extended-spec 0.2.0 → 0.4.0

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.
Files changed (50) hide show
  1. package/conformance/authoring.json +511 -0
  2. package/conformance/behavior.json +2373 -4
  3. package/conformance/config-consumption.json +13 -2
  4. package/docs/audit.md +17 -2
  5. package/docs/conditional-fields.md +133 -6
  6. package/docs/external-resources-proposal.md +8 -2
  7. package/docs/implementation-guide.md +129 -90
  8. package/docs/implementation-pitfalls.md +393 -1
  9. package/docs/implementation-web-typescript.md +2 -5
  10. package/docs/renderer-and-demo.md +47 -34
  11. package/docs/spec.md +235 -14
  12. package/docs/todo.md +72 -18
  13. package/examples/README.md +8 -2
  14. package/examples/additional-errors/README.md +7 -0
  15. package/examples/additional-properties/README.md +15 -0
  16. package/examples/catalog.json +16 -1
  17. package/examples/color-control/README.md +4 -1
  18. package/examples/conditional-fields/README.md +21 -3
  19. package/examples/conditional-fields/translations.json +4 -2
  20. package/examples/conditional-fields/uischema.json +67 -7
  21. package/examples/conditional-template-slots/README.md +14 -0
  22. package/examples/conditional-template-slots/config.json +7 -0
  23. package/examples/conditional-template-slots/data.json +5 -0
  24. package/examples/conditional-template-slots/schema.json +37 -0
  25. package/examples/conditional-template-slots/translations.json +16 -0
  26. package/examples/conditional-template-slots/uischema.json +22 -0
  27. package/examples/index.js +4 -3
  28. package/examples/kitchen-sink/README.md +93 -4
  29. package/examples/kitchen-sink/config.json +7 -0
  30. package/examples/kitchen-sink/data.json +14 -2
  31. package/examples/kitchen-sink/invalid-data.json +13 -1
  32. package/examples/kitchen-sink/schema.json +100 -1
  33. package/examples/kitchen-sink/translations.json +80 -2
  34. package/examples/kitchen-sink/uischema.json +239 -4
  35. package/examples/label-interpolation/README.md +58 -1
  36. package/examples/label-interpolation/config.json +8 -2
  37. package/examples/label-interpolation/translations.json +8 -4
  38. package/examples/label-interpolation/uischema.json +31 -8
  39. package/package.json +1 -1
  40. package/schemas/README.md +8 -3
  41. package/schemas/jsonforms-config.schema.json +1 -1
  42. package/schemas/jsonforms-extended-config.schema.json +5 -0
  43. package/schemas/jsonforms-extended-uischema.schema.json +11 -2
  44. package/schemas/jsonforms-uischema.schema.json +14 -1
  45. package/typescript/README.md +8 -2
  46. package/typescript/lib/authoring/forSchema.d.ts +10 -1
  47. package/typescript/src/authoring/forSchema.ts +10 -1
  48. package/typescript/test/schemaContract.test.ts +12 -0
  49. package/typescript/test/typedAuthoring.test.ts +12 -1
  50. package/typescript/test/typedAuthoringCoverage.test.ts +33 -0
@@ -668,11 +668,23 @@
668
668
  "input": {
669
669
  "groupLabel": "Contact",
670
670
  "header": [
671
- { "type": "Button", "label": "Help" },
672
- { "type": "Label", "text": "Verified", "i18n": "contact.heading" },
673
- { "type": "Label", "text": "Supporting text" }
671
+ {
672
+ "type": "Button",
673
+ "label": "Help"
674
+ },
675
+ {
676
+ "type": "Label",
677
+ "text": "Verified",
678
+ "i18n": "contact.heading"
679
+ },
680
+ {
681
+ "type": "Label",
682
+ "text": "Supporting text"
683
+ }
674
684
  ],
675
- "catalog": { "contact.heading.text": "Потвърдено" },
685
+ "catalog": {
686
+ "contact.heading.text": "Потвърдено"
687
+ },
676
688
  "locale": "bg"
677
689
  },
678
690
  "expected": {
@@ -727,5 +739,2362 @@
727
739
  "typedValueExcludesAdornments": true,
728
740
  "passwordRevealDoesNotChangeData": true
729
741
  }
742
+ },
743
+ {
744
+ "id": "adapter-operation-policy",
745
+ "section": "14",
746
+ "input": {
747
+ "button": {
748
+ "action": "save",
749
+ "paramsOmitted": true,
750
+ "handlerPending": true
751
+ },
752
+ "script": {
753
+ "body": "return this.params",
754
+ "allowScriptEvaluation": false
755
+ },
756
+ "delete": {
757
+ "catalogId": "agGrid",
758
+ "confirmation": "always",
759
+ "selectedRows": [
760
+ {
761
+ "name": "one"
762
+ },
763
+ {
764
+ "name": "two"
765
+ }
766
+ ]
767
+ }
768
+ },
769
+ "expected": {
770
+ "buttonParams": {},
771
+ "buttonBusyUntilHandlerSettles": true,
772
+ "duplicateActivationDoesNotRepeatAction": true,
773
+ "stringScriptNotExecuted": true,
774
+ "scriptDisabledDiagnostic": true,
775
+ "batchDeletePromptsOnce": true,
776
+ "cancelPreservesRows": true,
777
+ "acceptDeletesOnlySelectedRows": true
778
+ }
779
+ },
780
+ {
781
+ "id": "primitive-presence-presentation",
782
+ "section": "18.20, 19",
783
+ "input": {
784
+ "switchValues": [
785
+ {
786
+ "present": false
787
+ },
788
+ {
789
+ "present": true,
790
+ "value": null
791
+ },
792
+ {
793
+ "present": true,
794
+ "value": false
795
+ },
796
+ {
797
+ "present": true,
798
+ "value": "false"
799
+ }
800
+ ],
801
+ "nullValues": [
802
+ {
803
+ "present": false
804
+ },
805
+ {
806
+ "present": true,
807
+ "value": null
808
+ },
809
+ {
810
+ "present": true,
811
+ "value": "legacy"
812
+ }
813
+ ]
814
+ },
815
+ "expected": {
816
+ "switchStates": [
817
+ "off-with-localized-unset-description",
818
+ "off-with-localized-unset-description",
819
+ "off-without-unset-description",
820
+ "off-with-localized-invalid-description"
821
+ ],
822
+ "nullStates": [
823
+ "not-set",
824
+ "set",
825
+ "invalid"
826
+ ],
827
+ "mountDoesNotWriteData": true,
828
+ "externalReplacementRefreshesStatus": true,
829
+ "sameSemanticsInCells": true
830
+ }
831
+ },
832
+ {
833
+ "id": "styling-named-values",
834
+ "section": "9.4a",
835
+ "input": {
836
+ "uischema": {
837
+ "type": "Label",
838
+ "text": "{member} selected {plan}; {member} confirmed.",
839
+ "options": {
840
+ "interpolate": true,
841
+ "textParams": {
842
+ "member": "Morgan",
843
+ "plan": "Studio"
844
+ }
845
+ }
846
+ },
847
+ "config": {
848
+ "jsonformsExtended": {
849
+ "markup": {
850
+ "textParamSpans": true
851
+ }
852
+ }
853
+ },
854
+ "platform": "HTML"
855
+ },
856
+ "expected": {
857
+ "text": "Morgan selected Studio; Morgan confirmed.",
858
+ "parameterSpans": [
859
+ "member",
860
+ "plan",
861
+ "member"
862
+ ],
863
+ "sameTextAndAccessibilityAsDisabled": true
864
+ }
865
+ },
866
+ {
867
+ "id": "styling-switch-off",
868
+ "section": "9.4a",
869
+ "input": {
870
+ "uischema": {
871
+ "type": "Label",
872
+ "text": "{member} selected {plan}; {member} confirmed.",
873
+ "options": {
874
+ "interpolate": true,
875
+ "textParams": {
876
+ "member": "Morgan",
877
+ "plan": "Studio"
878
+ }
879
+ }
880
+ },
881
+ "settings": [
882
+ {},
883
+ {
884
+ "jsonformsExtended": {
885
+ "markup": {
886
+ "textParamSpans": false
887
+ }
888
+ }
889
+ }
890
+ ],
891
+ "platform": "HTML"
892
+ },
893
+ "expected": {
894
+ "parameterSpans": [],
895
+ "markerTracking": false,
896
+ "additionalMarkdownParse": false
897
+ }
898
+ },
899
+ {
900
+ "id": "styling-eligibility",
901
+ "section": "9.4a",
902
+ "input": {
903
+ "text": "{count} {active} {empty} {optional} {count + 1} {locale} {{count}}",
904
+ "params": {
905
+ "count": 0,
906
+ "active": false,
907
+ "empty": "",
908
+ "optional": null
909
+ },
910
+ "textParamSpans": true,
911
+ "interpolate": true,
912
+ "locale": "en"
913
+ },
914
+ "expected": {
915
+ "parameterSpans": [
916
+ "count",
917
+ "active"
918
+ ],
919
+ "spanTexts": [
920
+ "0",
921
+ "false"
922
+ ],
923
+ "absentDataDiagnostic": false,
924
+ "sameOutputAfterUnwrappingAsDisabled": true,
925
+ "unknownVariableDiagnostics": [
926
+ "locale"
927
+ ]
928
+ }
929
+ },
930
+ {
931
+ "id": "styling-interpolation-off",
932
+ "section": "9.4a",
933
+ "input": {
934
+ "uischema": {
935
+ "type": "Label",
936
+ "text": "{member} selected {plan}; {member} confirmed.",
937
+ "options": {
938
+ "interpolate": false,
939
+ "textParams": {
940
+ "member": "Morgan",
941
+ "plan": "Studio"
942
+ }
943
+ }
944
+ },
945
+ "textParamSpans": true
946
+ },
947
+ "expected": {
948
+ "parameterSpans": [],
949
+ "text": "{member} selected {plan}; {member} confirmed."
950
+ }
951
+ },
952
+ {
953
+ "id": "styling-translation-order",
954
+ "section": "9.4a",
955
+ "input": {
956
+ "params": {
957
+ "member": "Morgan",
958
+ "plan": "Studio"
959
+ },
960
+ "messages": [
961
+ "{member}: {plan}",
962
+ "{plan}: {member}"
963
+ ],
964
+ "interpolate": true,
965
+ "textParamSpans": true
966
+ },
967
+ "expected": {
968
+ "parameterSpanOrders": [
969
+ [
970
+ "member",
971
+ "plan"
972
+ ],
973
+ [
974
+ "plan",
975
+ "member"
976
+ ]
977
+ ],
978
+ "namesDerivedFromDataPaths": false
979
+ }
980
+ },
981
+ {
982
+ "id": "styling-markdown-equivalence",
983
+ "section": "9.4a",
984
+ "input": {
985
+ "profiles": [
986
+ "basic",
987
+ "extended"
988
+ ],
989
+ "interpolate": true,
990
+ "textParamSpans": [
991
+ false,
992
+ true
993
+ ],
994
+ "params": {
995
+ "member": "(Morgan)",
996
+ "literal": "*[guide](javascript:alert(1))*",
997
+ "plan": "Studio",
998
+ "lines": "First\nSecond",
999
+ "private": "Member"
1000
+ },
1001
+ "templates": [
1002
+ "**{member}**",
1003
+ "word**{member}**word",
1004
+ "{member}{plan}",
1005
+ "`{member}`",
1006
+ "{lines}",
1007
+ "{private}",
1008
+ "{literal}",
1009
+ "# {member}",
1010
+ "- {member}\n- {plan}",
1011
+ "> {member}",
1012
+ "| Member |\n| --- |\n| {member} |",
1013
+ "```\n{member}\n```"
1014
+ ]
1015
+ },
1016
+ "expected": {
1017
+ "afterUnwrappingGeneratedSpans": "Same rendered tree, text and attributes as the disabled result for every template/profile.",
1018
+ "strongSpanWhenSafe": "**{member}** contains the member span inside strong.",
1019
+ "literalCreatesLink": false,
1020
+ "originalPrivateUseCharactersPreserved": true,
1021
+ "fallback": "Use unmarked Label output when equivalence cannot be guaranteed.",
1022
+ "internalMarkersVisible": false
1023
+ }
1024
+ },
1025
+ {
1026
+ "id": "styling-markdown-urls",
1027
+ "section": "9.4a",
1028
+ "input": {
1029
+ "text": "[{member}]({url})",
1030
+ "params": {
1031
+ "member": "Morgan"
1032
+ },
1033
+ "urlValues": [
1034
+ "https://example.com/membership_a?q=1",
1035
+ "javascript:alert(1)"
1036
+ ],
1037
+ "interpolate": true,
1038
+ "markup": "markdown",
1039
+ "textParamSpans": true,
1040
+ "urlPolicy": "Default §12 policy"
1041
+ },
1042
+ "expected": {
1043
+ "safeHref": "https://example.com/membership_a?q=1",
1044
+ "unsafeHrefRefused": true,
1045
+ "spansInAttributes": false,
1046
+ "urlPolicyReceivesSameUrlAsDisabled": true,
1047
+ "sameOutputAfterUnwrappingAsDisabled": true
1048
+ }
1049
+ },
1050
+ {
1051
+ "id": "styling-part-normalization",
1052
+ "section": "5.7",
1053
+ "input": {
1054
+ "uncheckedParts": [
1055
+ " summary \"]x summary\tprominent 7notes ",
1056
+ [
1057
+ "summary"
1058
+ ],
1059
+ "",
1060
+ " \t\n",
1061
+ "bad.name 7notes"
1062
+ ]
1063
+ },
1064
+ "expected": {
1065
+ "normalizedParts": [
1066
+ "summary prominent",
1067
+ null,
1068
+ null,
1069
+ null,
1070
+ null
1071
+ ],
1072
+ "emitAttributeForNull": false,
1073
+ "inferredFromI18nNameScopeOrType": false,
1074
+ "addsRoleAriaOrBehavior": false
1075
+ }
1076
+ },
1077
+ {
1078
+ "id": "styling-part-placement",
1079
+ "section": "5.7",
1080
+ "input": {
1081
+ "platform": "HTML",
1082
+ "elements": [
1083
+ "Label",
1084
+ "Control",
1085
+ "Button",
1086
+ "nested layout",
1087
+ "registered custom element"
1088
+ ],
1089
+ "part": "summary prominent",
1090
+ "contexts": [
1091
+ "layout slot",
1092
+ "root without slot",
1093
+ "Group region without slot",
1094
+ "Category dispatch without slot"
1095
+ ],
1096
+ "hiddenChildHasPart": true
1097
+ },
1098
+ "expected": {
1099
+ "attribute": "data-part=\"summary prominent\"",
1100
+ "placementByContext": [
1101
+ "existing parent layout slot",
1102
+ null,
1103
+ null,
1104
+ null
1105
+ ],
1106
+ "tokenSelectors": [
1107
+ "[data-part~=\"summary\"]",
1108
+ "[data-part~=\"prominent\"]"
1109
+ ],
1110
+ "nestedLayoutMarkerOnItsOwnParentSlot": true,
1111
+ "additionalLayoutSpaceForHiddenChild": false,
1112
+ "builtInStyles": false
1113
+ }
1114
+ },
1115
+ {
1116
+ "id": "styling-canvas-noop",
1117
+ "section": "5.7",
1118
+ "input": {
1119
+ "platform": "Non-HTML canvas",
1120
+ "capability": "Documented no-op for both hooks",
1121
+ "uischema": {
1122
+ "type": "Label",
1123
+ "text": "{member} selected {plan}; {member} confirmed.",
1124
+ "options": {
1125
+ "interpolate": true,
1126
+ "textParams": {
1127
+ "member": "Morgan",
1128
+ "plan": "Studio"
1129
+ }
1130
+ }
1131
+ },
1132
+ "part": "summary",
1133
+ "textParamSpans": true
1134
+ },
1135
+ "expected": {
1136
+ "sameContentAccessibilityInteractionAndDataAsWithoutHooks": true,
1137
+ "domRequired": false,
1138
+ "stylingCallbackRequired": false,
1139
+ "reportsImplementedHtmlMarkers": false
1140
+ }
1141
+ },
1142
+ {
1143
+ "id": "styling-label-override-precedence",
1144
+ "section": "9.4a",
1145
+ "input": {
1146
+ "platform": "HTML",
1147
+ "text": "Membership: {plan}",
1148
+ "params": {
1149
+ "plan": "Studio"
1150
+ },
1151
+ "cases": [
1152
+ {
1153
+ "config": {},
1154
+ "options": {
1155
+ "interpolate": true
1156
+ },
1157
+ "expectedEffectiveValue": false
1158
+ },
1159
+ {
1160
+ "config": {},
1161
+ "options": {
1162
+ "interpolate": true,
1163
+ "textParamSpans": false
1164
+ },
1165
+ "expectedEffectiveValue": false
1166
+ },
1167
+ {
1168
+ "config": {},
1169
+ "options": {
1170
+ "interpolate": true,
1171
+ "textParamSpans": true
1172
+ },
1173
+ "expectedEffectiveValue": true
1174
+ },
1175
+ {
1176
+ "config": {
1177
+ "jsonformsExtended": {
1178
+ "markup": {
1179
+ "textParamSpans": false
1180
+ }
1181
+ }
1182
+ },
1183
+ "options": {
1184
+ "interpolate": true
1185
+ },
1186
+ "expectedEffectiveValue": false
1187
+ },
1188
+ {
1189
+ "config": {
1190
+ "jsonformsExtended": {
1191
+ "markup": {
1192
+ "textParamSpans": false
1193
+ }
1194
+ }
1195
+ },
1196
+ "options": {
1197
+ "interpolate": true,
1198
+ "textParamSpans": false
1199
+ },
1200
+ "expectedEffectiveValue": false
1201
+ },
1202
+ {
1203
+ "config": {
1204
+ "jsonformsExtended": {
1205
+ "markup": {
1206
+ "textParamSpans": false
1207
+ }
1208
+ }
1209
+ },
1210
+ "options": {
1211
+ "interpolate": true,
1212
+ "textParamSpans": true
1213
+ },
1214
+ "expectedEffectiveValue": true
1215
+ },
1216
+ {
1217
+ "config": {
1218
+ "jsonformsExtended": {
1219
+ "markup": {
1220
+ "textParamSpans": true
1221
+ }
1222
+ }
1223
+ },
1224
+ "options": {
1225
+ "interpolate": true
1226
+ },
1227
+ "expectedEffectiveValue": true
1228
+ },
1229
+ {
1230
+ "config": {
1231
+ "jsonformsExtended": {
1232
+ "markup": {
1233
+ "textParamSpans": true
1234
+ }
1235
+ }
1236
+ },
1237
+ "options": {
1238
+ "interpolate": true,
1239
+ "textParamSpans": false
1240
+ },
1241
+ "expectedEffectiveValue": false
1242
+ },
1243
+ {
1244
+ "config": {
1245
+ "jsonformsExtended": {
1246
+ "markup": {
1247
+ "textParamSpans": true
1248
+ }
1249
+ }
1250
+ },
1251
+ "options": {
1252
+ "interpolate": true,
1253
+ "textParamSpans": true
1254
+ },
1255
+ "expectedEffectiveValue": true
1256
+ }
1257
+ ]
1258
+ },
1259
+ "expected": {
1260
+ "resolution": "Label option, then host default, then false.",
1261
+ "parameterSpanNamesWhenEffectiveTrue": [
1262
+ "plan"
1263
+ ],
1264
+ "parameterSpansWhenEffectiveFalse": [],
1265
+ "markerTrackingWhenEffectiveFalse": false,
1266
+ "additionalMarkdownParseWhenEffectiveFalse": false,
1267
+ "sameTextAndAccessibilityInEveryCase": true,
1268
+ "hostFalseIsPermissionGate": false
1269
+ }
1270
+ },
1271
+ {
1272
+ "id": "styling-label-override-updates",
1273
+ "section": "9.4a",
1274
+ "input": {
1275
+ "platform": "HTML",
1276
+ "text": "Membership: {plan}",
1277
+ "params": {
1278
+ "plan": "Studio"
1279
+ },
1280
+ "interpolate": true,
1281
+ "steps": [
1282
+ {
1283
+ "hostDefault": false
1284
+ },
1285
+ {
1286
+ "localOverride": true
1287
+ },
1288
+ {
1289
+ "hostDefault": true
1290
+ },
1291
+ {
1292
+ "localOverride": false
1293
+ },
1294
+ {
1295
+ "removeLocalOverride": true
1296
+ },
1297
+ {
1298
+ "hostDefault": false
1299
+ }
1300
+ ],
1301
+ "parentLayoutOptions": {
1302
+ "textParamSpans": true
1303
+ }
1304
+ },
1305
+ "expected": {
1306
+ "effectiveValues": [
1307
+ false,
1308
+ true,
1309
+ true,
1310
+ false,
1311
+ true,
1312
+ false
1313
+ ],
1314
+ "parentLayoutOptionCascades": false,
1315
+ "unchangedTextFormattingUrlPolicyAccessibilityAndData": true,
1316
+ "spanRemovalDoesNotRemoveSubstitutionText": true
1317
+ }
1318
+ },
1319
+ {
1320
+ "id": "conditional-layout-business",
1321
+ "section": "Conditional fields",
1322
+ "input": {
1323
+ "schema": {
1324
+ "type": "object",
1325
+ "properties": {
1326
+ "customerType": {
1327
+ "type": "string",
1328
+ "enum": [
1329
+ "personal",
1330
+ "business"
1331
+ ]
1332
+ },
1333
+ "name": {
1334
+ "type": "string"
1335
+ },
1336
+ "purchaseOrder": {
1337
+ "type": "string"
1338
+ }
1339
+ },
1340
+ "if": {
1341
+ "properties": {
1342
+ "customerType": {
1343
+ "const": "business"
1344
+ }
1345
+ },
1346
+ "required": [
1347
+ "customerType"
1348
+ ]
1349
+ },
1350
+ "then": {
1351
+ "properties": {
1352
+ "vatNumber": {
1353
+ "type": "string",
1354
+ "minLength": 3
1355
+ }
1356
+ },
1357
+ "required": [
1358
+ "vatNumber",
1359
+ "name"
1360
+ ]
1361
+ },
1362
+ "else": {
1363
+ "properties": {
1364
+ "nickname": {
1365
+ "type": "string"
1366
+ }
1367
+ }
1368
+ },
1369
+ "dependencies": {
1370
+ "purchaseOrder": {
1371
+ "properties": {
1372
+ "billingAddress": {
1373
+ "type": "string"
1374
+ }
1375
+ },
1376
+ "required": [
1377
+ "billingAddress"
1378
+ ]
1379
+ }
1380
+ }
1381
+ },
1382
+ "uischema": {
1383
+ "type": "VerticalLayout",
1384
+ "options": {
1385
+ "conditionalFields": true
1386
+ },
1387
+ "elements": [
1388
+ {
1389
+ "type": "Control",
1390
+ "scope": "#/properties/customerType"
1391
+ },
1392
+ {
1393
+ "type": "Control",
1394
+ "scope": "#/properties/name"
1395
+ },
1396
+ {
1397
+ "type": "Control",
1398
+ "scope": "#/properties/purchaseOrder"
1399
+ },
1400
+ {
1401
+ "type": "Control",
1402
+ "scope": "#/properties/vatNumber"
1403
+ },
1404
+ {
1405
+ "type": "Control",
1406
+ "scope": "#/properties/nickname"
1407
+ }
1408
+ ]
1409
+ },
1410
+ "data": {
1411
+ "customerType": "business",
1412
+ "name": "Ada",
1413
+ "vatNumber": "VAT123",
1414
+ "nickname": "A"
1415
+ }
1416
+ },
1417
+ "expected": {
1418
+ "visibleProperties": [
1419
+ "customerType",
1420
+ "name",
1421
+ "purchaseOrder",
1422
+ "vatNumber"
1423
+ ],
1424
+ "requiredProperties": [
1425
+ "vatNumber",
1426
+ "name"
1427
+ ],
1428
+ "dataUnchanged": true,
1429
+ "originalSchemaValidation": true
1430
+ }
1431
+ },
1432
+ {
1433
+ "id": "conditional-layout-personal",
1434
+ "section": "Conditional fields",
1435
+ "input": {
1436
+ "schema": {
1437
+ "type": "object",
1438
+ "properties": {
1439
+ "customerType": {
1440
+ "type": "string",
1441
+ "enum": [
1442
+ "personal",
1443
+ "business"
1444
+ ]
1445
+ },
1446
+ "name": {
1447
+ "type": "string"
1448
+ },
1449
+ "purchaseOrder": {
1450
+ "type": "string"
1451
+ }
1452
+ },
1453
+ "if": {
1454
+ "properties": {
1455
+ "customerType": {
1456
+ "const": "business"
1457
+ }
1458
+ },
1459
+ "required": [
1460
+ "customerType"
1461
+ ]
1462
+ },
1463
+ "then": {
1464
+ "properties": {
1465
+ "vatNumber": {
1466
+ "type": "string",
1467
+ "minLength": 3
1468
+ }
1469
+ },
1470
+ "required": [
1471
+ "vatNumber",
1472
+ "name"
1473
+ ]
1474
+ },
1475
+ "else": {
1476
+ "properties": {
1477
+ "nickname": {
1478
+ "type": "string"
1479
+ }
1480
+ }
1481
+ },
1482
+ "dependencies": {
1483
+ "purchaseOrder": {
1484
+ "properties": {
1485
+ "billingAddress": {
1486
+ "type": "string"
1487
+ }
1488
+ },
1489
+ "required": [
1490
+ "billingAddress"
1491
+ ]
1492
+ }
1493
+ }
1494
+ },
1495
+ "uischema": {
1496
+ "type": "VerticalLayout",
1497
+ "options": {
1498
+ "conditionalFields": true
1499
+ },
1500
+ "elements": [
1501
+ {
1502
+ "type": "Control",
1503
+ "scope": "#/properties/customerType"
1504
+ },
1505
+ {
1506
+ "type": "Control",
1507
+ "scope": "#/properties/name"
1508
+ },
1509
+ {
1510
+ "type": "Control",
1511
+ "scope": "#/properties/purchaseOrder"
1512
+ },
1513
+ {
1514
+ "type": "Control",
1515
+ "scope": "#/properties/vatNumber"
1516
+ },
1517
+ {
1518
+ "type": "Control",
1519
+ "scope": "#/properties/nickname"
1520
+ }
1521
+ ]
1522
+ },
1523
+ "data": {
1524
+ "customerType": "personal",
1525
+ "name": "Ada",
1526
+ "vatNumber": "VAT123",
1527
+ "nickname": "A"
1528
+ }
1529
+ },
1530
+ "expected": {
1531
+ "visibleProperties": [
1532
+ "customerType",
1533
+ "name",
1534
+ "purchaseOrder",
1535
+ "nickname"
1536
+ ],
1537
+ "requiredProperties": [],
1538
+ "dataUnchanged": true,
1539
+ "originalSchemaValidation": true
1540
+ }
1541
+ },
1542
+ {
1543
+ "id": "conditional-layout-local-opt-out",
1544
+ "section": "Conditional fields",
1545
+ "input": {
1546
+ "entryType": "Group",
1547
+ "local": false,
1548
+ "global": true,
1549
+ "nestedLayouts": [
1550
+ "VerticalLayout",
1551
+ "HorizontalLayout"
1552
+ ],
1553
+ "uischema": {
1554
+ "type": "Group",
1555
+ "options": {
1556
+ "conditionalFields": false
1557
+ },
1558
+ "elements": [
1559
+ {
1560
+ "type": "VerticalLayout",
1561
+ "options": {
1562
+ "conditionalFields": true
1563
+ },
1564
+ "elements": [
1565
+ {
1566
+ "type": "HorizontalLayout",
1567
+ "options": {
1568
+ "conditionalFields": true
1569
+ },
1570
+ "elements": []
1571
+ }
1572
+ ]
1573
+ }
1574
+ ]
1575
+ }
1576
+ },
1577
+ "expected": {
1578
+ "projectionEnabled": false,
1579
+ "nestedLayoutsCannotReactivate": true
1580
+ }
1581
+ },
1582
+ {
1583
+ "id": "conditional-layout-object-boundaries",
1584
+ "section": "Conditional fields",
1585
+ "input": {
1586
+ "rootKind": "personal",
1587
+ "nestedKind": "business",
1588
+ "arrayItemKinds": [
1589
+ "business",
1590
+ "personal"
1591
+ ],
1592
+ "validationMode": "NoValidation",
1593
+ "independentForms": {
1594
+ "outer": {
1595
+ "dataPath": "",
1596
+ "local": false,
1597
+ "global": true
1598
+ },
1599
+ "embeddedInner": {
1600
+ "dataPath": "",
1601
+ "local": true,
1602
+ "global": false
1603
+ }
1604
+ }
1605
+ },
1606
+ "expected": {
1607
+ "evaluateEachObjectIndependently": true,
1608
+ "requiredMarkersFollowEachObject": true,
1609
+ "noDataMutation": true,
1610
+ "independentHostFormsAtSameRootPath": true,
1611
+ "outerProjectionEnabled": false,
1612
+ "embeddedInnerProjectionEnabled": true,
1613
+ "resetInheritanceAtHostFormBoundary": true
1614
+ }
1615
+ },
1616
+ {
1617
+ "id": "conditional-layout-placement",
1618
+ "section": "Conditional fields",
1619
+ "input": {
1620
+ "layouts": [
1621
+ "VerticalLayout",
1622
+ "HorizontalLayout",
1623
+ "Group",
1624
+ "Categorization"
1625
+ ],
1626
+ "categoryVariants": [
1627
+ "tabs",
1628
+ "stepper",
1629
+ "accordion"
1630
+ ],
1631
+ "baseFieldRequiredInThen": true,
1632
+ "retainedInactiveValues": true
1633
+ },
1634
+ "expected": {
1635
+ "preserveAuthoredOrderAndContainers": true,
1636
+ "baseFieldAlwaysVisible": true,
1637
+ "asteriskFollowsActiveRequiredUnion": true,
1638
+ "insertUnplacedBranchFields": false,
1639
+ "uiRulesStillApply": true,
1640
+ "preserveEmptyContainers": true,
1641
+ "preserveExistingSlotsForEmptiedPlainLayouts": true
1642
+ }
1643
+ },
1644
+ {
1645
+ "id": "interpolation-explicit-locale",
1646
+ "section": "9.1, 9.4a",
1647
+ "input": {
1648
+ "uischema": {
1649
+ "type": "Label",
1650
+ "text": "{language} / {locale}",
1651
+ "options": {
1652
+ "interpolate": true,
1653
+ "textParamSpans": true,
1654
+ "textParams": {
1655
+ "language": "{locale}",
1656
+ "locale": "{locale}"
1657
+ }
1658
+ }
1659
+ },
1660
+ "config": {
1661
+ "jsonformsExtended": {
1662
+ "dynamicValues": {
1663
+ "enabled": false
1664
+ }
1665
+ }
1666
+ },
1667
+ "hostLocaleSequence": [
1668
+ "en",
1669
+ "bg"
1670
+ ],
1671
+ "platform": "HTML"
1672
+ },
1673
+ "expected": {
1674
+ "textSequence": [
1675
+ "en / en",
1676
+ "bg / bg"
1677
+ ],
1678
+ "parameterSpans": [
1679
+ "language",
1680
+ "locale"
1681
+ ],
1682
+ "unknownVariableDiagnostics": [],
1683
+ "parameterSelfReference": false,
1684
+ "dataNamespacesEnabled": false
1685
+ }
1686
+ },
1687
+ {
1688
+ "id": "interpolation-undeclared-locale",
1689
+ "section": "9.1, 9.5",
1690
+ "input": {
1691
+ "uischema": {
1692
+ "type": "Label",
1693
+ "text": "Language: {locale}",
1694
+ "options": {
1695
+ "interpolate": true
1696
+ }
1697
+ },
1698
+ "hostLocale": "en",
1699
+ "textParamSpans": [
1700
+ false,
1701
+ true
1702
+ ]
1703
+ },
1704
+ "expected": {
1705
+ "text": "Language: ",
1706
+ "unknownVariableDiagnostics": [
1707
+ "locale"
1708
+ ],
1709
+ "parameterSpans": [],
1710
+ "sameDiagnosticsWithMarkersOnAndOff": true
1711
+ }
1712
+ },
1713
+ {
1714
+ "id": "styling-invalid-local-default",
1715
+ "section": "9.4a",
1716
+ "input": {
1717
+ "uncheckedLocalValues": [
1718
+ "yes",
1719
+ 0,
1720
+ null,
1721
+ {},
1722
+ []
1723
+ ],
1724
+ "hostDefaults": [
1725
+ true,
1726
+ false
1727
+ ],
1728
+ "uischema": {
1729
+ "type": "Label",
1730
+ "text": "{member}",
1731
+ "options": {
1732
+ "interpolate": true,
1733
+ "textParams": {
1734
+ "member": "Morgan"
1735
+ }
1736
+ }
1737
+ },
1738
+ "platform": "HTML"
1739
+ },
1740
+ "expected": {
1741
+ "authoringValid": false,
1742
+ "effectiveValueForEachInvalidLocal": "host default",
1743
+ "parameterSpansWhenHostTrue": [
1744
+ "member"
1745
+ ],
1746
+ "parameterSpansWhenHostFalse": [],
1747
+ "truthinessCoercion": false
1748
+ }
1749
+ },
1750
+ {
1751
+ "id": "conditional-layout-nested-opt-out-ignored",
1752
+ "section": "Conditional fields",
1753
+ "input": {
1754
+ "global": false,
1755
+ "uischema": {
1756
+ "type": "Group",
1757
+ "options": {
1758
+ "conditionalFields": true
1759
+ },
1760
+ "elements": [
1761
+ {
1762
+ "type": "VerticalLayout",
1763
+ "options": {
1764
+ "conditionalFields": false
1765
+ },
1766
+ "elements": []
1767
+ }
1768
+ ]
1769
+ }
1770
+ },
1771
+ "expected": {
1772
+ "projectionEnabled": true,
1773
+ "descendantOptionIgnored": true,
1774
+ "projectOnceAtOwner": true
1775
+ }
1776
+ },
1777
+ {
1778
+ "id": "conditional-layout-whole-value-editor",
1779
+ "section": "Conditional fields",
1780
+ "input": {
1781
+ "schema": {
1782
+ "type": "object",
1783
+ "properties": {
1784
+ "kind": {
1785
+ "type": "string"
1786
+ },
1787
+ "name": {
1788
+ "type": "string"
1789
+ }
1790
+ },
1791
+ "if": {
1792
+ "properties": {
1793
+ "kind": {
1794
+ "const": "business"
1795
+ }
1796
+ },
1797
+ "required": [
1798
+ "kind"
1799
+ ]
1800
+ },
1801
+ "then": {
1802
+ "properties": {
1803
+ "vat": {
1804
+ "type": "string"
1805
+ }
1806
+ },
1807
+ "required": [
1808
+ "vat"
1809
+ ]
1810
+ },
1811
+ "else": {
1812
+ "properties": {
1813
+ "nickname": {
1814
+ "type": "string"
1815
+ }
1816
+ }
1817
+ }
1818
+ },
1819
+ "data": {
1820
+ "kind": "personal",
1821
+ "nickname": "M",
1822
+ "vat": "retained"
1823
+ },
1824
+ "uischema": {
1825
+ "type": "VerticalLayout",
1826
+ "options": {
1827
+ "conditionalFields": true
1828
+ },
1829
+ "elements": [
1830
+ {
1831
+ "type": "Control",
1832
+ "scope": "#/properties/nickname"
1833
+ },
1834
+ {
1835
+ "type": "Control",
1836
+ "scope": "#/properties/vat"
1837
+ },
1838
+ {
1839
+ "type": "Control",
1840
+ "scope": "#",
1841
+ "options": {
1842
+ "format": "code"
1843
+ }
1844
+ }
1845
+ ]
1846
+ },
1847
+ "additionalEditorRoles": [
1848
+ "custom whole-value editor",
1849
+ "same-object field editor",
1850
+ "same-object field editor with local false"
1851
+ ]
1852
+ },
1853
+ "expected": {
1854
+ "visibleFieldScopes": [
1855
+ "#/properties/nickname"
1856
+ ],
1857
+ "wholeValueControlRetained": true,
1858
+ "wholeValueEditorSchema": "original authored schema with if/then/else and original reference context",
1859
+ "customWholeValueEditorSchema": "original authored schema",
1860
+ "sameObjectFieldEditorMayReuseProjection": true,
1861
+ "sameObjectFieldEditorLocalFalseSchema": "original authored schema",
1862
+ "originalSchemaValidation": true,
1863
+ "dataUnchanged": true
1864
+ }
1865
+ },
1866
+ {
1867
+ "id": "conditional-layout-regions",
1868
+ "section": "Conditional fields",
1869
+ "input": {
1870
+ "schema": {
1871
+ "type": "object",
1872
+ "properties": {
1873
+ "kind": {
1874
+ "type": "string"
1875
+ },
1876
+ "name": {
1877
+ "type": "string"
1878
+ }
1879
+ },
1880
+ "if": {
1881
+ "properties": {
1882
+ "kind": {
1883
+ "const": "business"
1884
+ }
1885
+ },
1886
+ "required": [
1887
+ "kind"
1888
+ ]
1889
+ },
1890
+ "then": {
1891
+ "properties": {
1892
+ "vat": {
1893
+ "type": "string"
1894
+ }
1895
+ },
1896
+ "required": [
1897
+ "vat"
1898
+ ]
1899
+ },
1900
+ "else": {
1901
+ "properties": {
1902
+ "nickname": {
1903
+ "type": "string"
1904
+ }
1905
+ }
1906
+ }
1907
+ },
1908
+ "data": {
1909
+ "kind": "personal",
1910
+ "nickname": "M",
1911
+ "vat": "retained"
1912
+ },
1913
+ "uischema": {
1914
+ "type": "Group",
1915
+ "options": {
1916
+ "conditionalFields": true
1917
+ },
1918
+ "header": [
1919
+ {
1920
+ "type": "Label",
1921
+ "text": "Customer"
1922
+ },
1923
+ {
1924
+ "type": "Control",
1925
+ "scope": "#/properties/vat"
1926
+ },
1927
+ {
1928
+ "type": "Control",
1929
+ "scope": "#/properties/nickname"
1930
+ }
1931
+ ],
1932
+ "footer": [
1933
+ {
1934
+ "type": "VerticalLayout",
1935
+ "options": {
1936
+ "conditionalFields": false
1937
+ },
1938
+ "elements": [
1939
+ {
1940
+ "type": "Control",
1941
+ "scope": "#/properties/vat"
1942
+ },
1943
+ {
1944
+ "type": "Control",
1945
+ "scope": "#/properties/nickname"
1946
+ }
1947
+ ]
1948
+ }
1949
+ ],
1950
+ "cover": {
1951
+ "type": "Control",
1952
+ "scope": "#/properties/vat"
1953
+ },
1954
+ "elements": [
1955
+ {
1956
+ "type": "Control",
1957
+ "scope": "#/properties/nickname"
1958
+ }
1959
+ ]
1960
+ }
1961
+ },
1962
+ "expected": {
1963
+ "headerElements": [
1964
+ {
1965
+ "type": "Label",
1966
+ "text": "Customer"
1967
+ },
1968
+ {
1969
+ "type": "Control",
1970
+ "scope": "#/properties/nickname"
1971
+ }
1972
+ ],
1973
+ "footerFieldScopes": [
1974
+ "#/properties/nickname"
1975
+ ],
1976
+ "coverOmitted": true,
1977
+ "regionLayoutLocalFalseIgnored": true,
1978
+ "groupRetained": true,
1979
+ "originalSchemaValidation": true,
1980
+ "dataUnchanged": true
1981
+ }
1982
+ },
1983
+ {
1984
+ "id": "conditional-layout-ignored-options",
1985
+ "section": "Conditional fields",
1986
+ "input": {
1987
+ "global": false,
1988
+ "uischema": {
1989
+ "type": "Categorization",
1990
+ "options": {
1991
+ "conditionalFields": false
1992
+ },
1993
+ "elements": [
1994
+ {
1995
+ "type": "Category",
1996
+ "label": "Customer",
1997
+ "options": {
1998
+ "conditionalFields": true
1999
+ },
2000
+ "elements": [
2001
+ {
2002
+ "type": "Label",
2003
+ "text": "Customer",
2004
+ "options": {
2005
+ "conditionalFields": true
2006
+ }
2007
+ },
2008
+ {
2009
+ "type": "Button",
2010
+ "label": "Continue",
2011
+ "options": {
2012
+ "conditionalFields": true
2013
+ }
2014
+ }
2015
+ ]
2016
+ }
2017
+ ]
2018
+ }
2019
+ },
2020
+ "expected": {
2021
+ "projectionEnabled": false,
2022
+ "categoryOptionIgnored": true,
2023
+ "labelOptionIgnored": true,
2024
+ "buttonOptionIgnored": true,
2025
+ "noNewProjectionOwner": true
2026
+ }
2027
+ },
2028
+ {
2029
+ "id": "conditional-layout-empty-container-slot",
2030
+ "section": "Conditional fields, 5.7",
2031
+ "input": {
2032
+ "schema": {
2033
+ "type": "object",
2034
+ "properties": {
2035
+ "kind": {
2036
+ "type": "string"
2037
+ },
2038
+ "name": {
2039
+ "type": "string"
2040
+ }
2041
+ },
2042
+ "if": {
2043
+ "properties": {
2044
+ "kind": {
2045
+ "const": "business"
2046
+ }
2047
+ },
2048
+ "required": [
2049
+ "kind"
2050
+ ]
2051
+ },
2052
+ "then": {
2053
+ "properties": {
2054
+ "vat": {
2055
+ "type": "string"
2056
+ }
2057
+ },
2058
+ "required": [
2059
+ "vat"
2060
+ ]
2061
+ },
2062
+ "else": {
2063
+ "properties": {
2064
+ "nickname": {
2065
+ "type": "string"
2066
+ }
2067
+ }
2068
+ }
2069
+ },
2070
+ "data": {
2071
+ "kind": "personal"
2072
+ },
2073
+ "uischema": {
2074
+ "type": "VerticalLayout",
2075
+ "options": {
2076
+ "conditionalFields": true
2077
+ },
2078
+ "elements": [
2079
+ {
2080
+ "type": "HorizontalLayout",
2081
+ "options": {
2082
+ "part": "branch-area"
2083
+ },
2084
+ "elements": [
2085
+ {
2086
+ "type": "Control",
2087
+ "scope": "#/properties/vat"
2088
+ }
2089
+ ]
2090
+ }
2091
+ ]
2092
+ },
2093
+ "platform": "HTML with styling hooks"
2094
+ },
2095
+ "expected": {
2096
+ "nestedLayoutRetained": true,
2097
+ "nestedLayoutChildCount": 0,
2098
+ "existingParentSlotRetained": true,
2099
+ "slotDataPart": "branch-area",
2100
+ "extraWrapperRequired": false,
2101
+ "minimumSizeRequired": false,
2102
+ "fixedGapRequired": false,
2103
+ "ordinaryHideRuleCanStillHideContainer": true
2104
+ }
2105
+ },
2106
+ {
2107
+ "id": "conditional-layout-editor-continuity",
2108
+ "section": "Conditional fields",
2109
+ "input": {
2110
+ "placements": [
2111
+ "VerticalLayout",
2112
+ "HorizontalLayout",
2113
+ "Group header",
2114
+ "Group footer",
2115
+ "splitter panes"
2116
+ ],
2117
+ "authoredBindings": [
2118
+ "branch-only field",
2119
+ "retained field",
2120
+ "second occurrence of retained field"
2121
+ ],
2122
+ "operations": [
2123
+ "focus retained field",
2124
+ "start an uncommitted edit",
2125
+ "deactivate earlier branch-only field",
2126
+ "wait for normal commit",
2127
+ "reactivate earlier field"
2128
+ ],
2129
+ "sameFormInstance": true
2130
+ },
2131
+ "expected": {
2132
+ "retainedFocusPreserved": true,
2133
+ "retainedDraftPreserved": true,
2134
+ "pendingWriteCommittedToOriginalField": true,
2135
+ "duplicateOccurrencesRemainIndependent": true,
2136
+ "splitterSizingDoesNotResetRetainedEditors": true,
2137
+ "inactiveDataRetained": true
2138
+ }
2139
+ },
2140
+ {
2141
+ "id": "conditional-layout-static-work",
2142
+ "section": "Conditional fields",
2143
+ "input": {
2144
+ "schemaLifecycle": "immutable identity until replacement",
2145
+ "operations": [
2146
+ "repeat nonconditional discovery",
2147
+ "edit ordinary value without changing active branches",
2148
+ "switch branches with identical property names but different constraints and requiredness",
2149
+ "disable projection",
2150
+ "replace schema identity"
2151
+ ],
2152
+ "additionalCases": [
2153
+ "cyclic allOf discovery",
2154
+ "independent forms",
2155
+ "different array items",
2156
+ "dynamic scope resolution before filtering"
2157
+ ]
2158
+ },
2159
+ "expected": {
2160
+ "repeatDiscoveryAvoidsAnotherImmutableTraversal": true,
2161
+ "unchangedPresentationAvoidsFullRebuild": true,
2162
+ "currentBranchRequirednessAndConstraintsApplied": true,
2163
+ "disabledPredicateEvaluations": 0,
2164
+ "disabledContentFiltering": false,
2165
+ "ownershipBookkeepingPermitted": true,
2166
+ "schemaReplacementInvalidatesDiscovery": true,
2167
+ "validatorMutationIsolationPreserved": true,
2168
+ "noLatencyBenchmarkClaim": true
2169
+ }
2170
+ },
2171
+ {
2172
+ "id": "conditional-layout-discovery-reference",
2173
+ "section": "Conditional fields",
2174
+ "input": {
2175
+ "schema": {
2176
+ "type": "object",
2177
+ "properties": {
2178
+ "kind": {
2179
+ "type": "string"
2180
+ },
2181
+ "name": {
2182
+ "type": "string"
2183
+ }
2184
+ },
2185
+ "definitions": {
2186
+ "Branch": {
2187
+ "if": {
2188
+ "properties": {
2189
+ "kind": {
2190
+ "const": "business"
2191
+ }
2192
+ },
2193
+ "required": [
2194
+ "kind"
2195
+ ]
2196
+ },
2197
+ "then": {
2198
+ "properties": {
2199
+ "vat": {
2200
+ "type": "string"
2201
+ }
2202
+ },
2203
+ "required": [
2204
+ "name",
2205
+ "vat"
2206
+ ]
2207
+ },
2208
+ "else": {
2209
+ "properties": {
2210
+ "nickname": {
2211
+ "type": "string"
2212
+ }
2213
+ }
2214
+ }
2215
+ }
2216
+ },
2217
+ "allOf": [
2218
+ {
2219
+ "$ref": "#/definitions/Branch"
2220
+ }
2221
+ ]
2222
+ },
2223
+ "uischema": {
2224
+ "type": "VerticalLayout",
2225
+ "options": {
2226
+ "conditionalFields": true
2227
+ },
2228
+ "elements": [
2229
+ {
2230
+ "type": "Control",
2231
+ "scope": "#/properties/name"
2232
+ },
2233
+ {
2234
+ "type": "Control",
2235
+ "scope": "#/properties/vat"
2236
+ },
2237
+ {
2238
+ "type": "Control",
2239
+ "scope": "#/properties/nickname"
2240
+ }
2241
+ ]
2242
+ },
2243
+ "data": {
2244
+ "kind": "business",
2245
+ "name": "Ada",
2246
+ "vat": "BG1",
2247
+ "nickname": "kept"
2248
+ },
2249
+ "operations": [
2250
+ "replace kind with personal",
2251
+ "opt out locally while kind is business"
2252
+ ]
2253
+ },
2254
+ "expected": {
2255
+ "businessVisibleFields": [
2256
+ "name",
2257
+ "vat"
2258
+ ],
2259
+ "businessRequiredFields": [
2260
+ "name",
2261
+ "vat"
2262
+ ],
2263
+ "personalVisibleFields": [
2264
+ "name",
2265
+ "nickname"
2266
+ ],
2267
+ "personalRequiredFields": [],
2268
+ "originalSchemaValidationPreserved": true,
2269
+ "inactiveDataRetained": true
2270
+ }
2271
+ },
2272
+ {
2273
+ "id": "conditional-layout-discovery-allOf",
2274
+ "section": "Conditional fields",
2275
+ "input": {
2276
+ "schema": {
2277
+ "type": "object",
2278
+ "properties": {
2279
+ "kind": {
2280
+ "type": "string"
2281
+ },
2282
+ "name": {
2283
+ "type": "string"
2284
+ }
2285
+ },
2286
+ "allOf": [
2287
+ {
2288
+ "properties": {
2289
+ "vat": {
2290
+ "type": "string"
2291
+ }
2292
+ },
2293
+ "required": [
2294
+ "name",
2295
+ "vat"
2296
+ ]
2297
+ }
2298
+ ]
2299
+ },
2300
+ "uischema": {
2301
+ "type": "VerticalLayout",
2302
+ "options": {
2303
+ "conditionalFields": true
2304
+ },
2305
+ "elements": [
2306
+ {
2307
+ "type": "Control",
2308
+ "scope": "#/properties/name"
2309
+ },
2310
+ {
2311
+ "type": "Control",
2312
+ "scope": "#/properties/vat"
2313
+ },
2314
+ {
2315
+ "type": "Control",
2316
+ "scope": "#/properties/nickname"
2317
+ }
2318
+ ]
2319
+ },
2320
+ "data": {
2321
+ "kind": "business",
2322
+ "name": "Ada",
2323
+ "vat": "BG1",
2324
+ "nickname": "kept"
2325
+ },
2326
+ "operations": [
2327
+ "replace kind with personal",
2328
+ "opt out locally while kind is business"
2329
+ ]
2330
+ },
2331
+ "expected": {
2332
+ "businessVisibleFields": [
2333
+ "name",
2334
+ "vat"
2335
+ ],
2336
+ "businessRequiredFields": [
2337
+ "name",
2338
+ "vat"
2339
+ ],
2340
+ "personalVisibleFields": [
2341
+ "name",
2342
+ "vat"
2343
+ ],
2344
+ "personalRequiredFields": [
2345
+ "name",
2346
+ "vat"
2347
+ ],
2348
+ "originalSchemaValidationPreserved": true,
2349
+ "inactiveDataRetained": true
2350
+ }
2351
+ },
2352
+ {
2353
+ "id": "conditional-layout-discovery-nullable",
2354
+ "section": "Conditional fields",
2355
+ "input": {
2356
+ "schema": {
2357
+ "type": [
2358
+ "object",
2359
+ "null"
2360
+ ],
2361
+ "properties": {
2362
+ "kind": {
2363
+ "type": "string"
2364
+ },
2365
+ "name": {
2366
+ "type": "string"
2367
+ }
2368
+ },
2369
+ "if": {
2370
+ "properties": {
2371
+ "kind": {
2372
+ "const": "business"
2373
+ }
2374
+ },
2375
+ "required": [
2376
+ "kind"
2377
+ ]
2378
+ },
2379
+ "then": {
2380
+ "properties": {
2381
+ "vat": {
2382
+ "type": "string"
2383
+ }
2384
+ },
2385
+ "required": [
2386
+ "name",
2387
+ "vat"
2388
+ ]
2389
+ },
2390
+ "else": {
2391
+ "properties": {
2392
+ "nickname": {
2393
+ "type": "string"
2394
+ }
2395
+ }
2396
+ }
2397
+ },
2398
+ "uischema": {
2399
+ "type": "VerticalLayout",
2400
+ "options": {
2401
+ "conditionalFields": true
2402
+ },
2403
+ "elements": [
2404
+ {
2405
+ "type": "Control",
2406
+ "scope": "#/properties/name"
2407
+ },
2408
+ {
2409
+ "type": "Control",
2410
+ "scope": "#/properties/vat"
2411
+ },
2412
+ {
2413
+ "type": "Control",
2414
+ "scope": "#/properties/nickname"
2415
+ }
2416
+ ]
2417
+ },
2418
+ "data": {
2419
+ "kind": "business",
2420
+ "name": "Ada",
2421
+ "vat": "BG1",
2422
+ "nickname": "kept"
2423
+ },
2424
+ "operations": [
2425
+ "replace kind with personal",
2426
+ "opt out locally while kind is business",
2427
+ "replace data with null, then restore object data"
2428
+ ]
2429
+ },
2430
+ "expected": {
2431
+ "businessVisibleFields": [
2432
+ "name",
2433
+ "vat"
2434
+ ],
2435
+ "businessRequiredFields": [
2436
+ "name",
2437
+ "vat"
2438
+ ],
2439
+ "personalVisibleFields": [
2440
+ "name",
2441
+ "nickname"
2442
+ ],
2443
+ "personalRequiredFields": [],
2444
+ "originalSchemaValidationPreserved": true,
2445
+ "inactiveDataRetained": true,
2446
+ "nullRemainsNull": true,
2447
+ "doesNotInitializeObject": true
2448
+ }
2449
+ },
2450
+ {
2451
+ "id": "conditional-discovery-reference-context",
2452
+ "section": "Conditional fields",
2453
+ "input": {
2454
+ "schema": {
2455
+ "$ref": "#/definitions/Branch"
2456
+ },
2457
+ "roots": [
2458
+ {
2459
+ "definitions": {
2460
+ "Branch": {
2461
+ "if": {
2462
+ "properties": {
2463
+ "kind": {
2464
+ "const": "business"
2465
+ }
2466
+ },
2467
+ "required": [
2468
+ "kind"
2469
+ ]
2470
+ },
2471
+ "then": {
2472
+ "properties": {
2473
+ "vat": {
2474
+ "type": "string"
2475
+ }
2476
+ },
2477
+ "required": [
2478
+ "name",
2479
+ "vat"
2480
+ ]
2481
+ },
2482
+ "else": {
2483
+ "properties": {
2484
+ "nickname": {
2485
+ "type": "string"
2486
+ }
2487
+ }
2488
+ }
2489
+ }
2490
+ }
2491
+ },
2492
+ {
2493
+ "definitions": {
2494
+ "Branch": {
2495
+ "type": "string"
2496
+ }
2497
+ }
2498
+ }
2499
+ ],
2500
+ "additionalCases": [
2501
+ "cyclic allOf without conditions",
2502
+ "missing reference",
2503
+ "allOf containing minProperties only"
2504
+ ]
2505
+ },
2506
+ "expected": {
2507
+ "discoveryByRoot": [
2508
+ true,
2509
+ false
2510
+ ],
2511
+ "completedSearchCachedPerSchemaAndRoot": true,
2512
+ "cycleTerminates": true,
2513
+ "missingReferenceReportedWithoutLosingBaseFields": true,
2514
+ "constraintOnlyAllOfDoesNotActivateFieldProjection": true
2515
+ }
2516
+ },
2517
+ {
2518
+ "id": "conditional-template-positional",
2519
+ "section": "13.5 / Conditional fields",
2520
+ "input": {
2521
+ "schema": {
2522
+ "type": "object",
2523
+ "properties": {
2524
+ "kind": {
2525
+ "type": "string",
2526
+ "enum": [
2527
+ "personal",
2528
+ "business"
2529
+ ]
2530
+ },
2531
+ "notes": {
2532
+ "type": "string"
2533
+ }
2534
+ },
2535
+ "if": {
2536
+ "properties": {
2537
+ "kind": {
2538
+ "const": "business"
2539
+ }
2540
+ },
2541
+ "required": [
2542
+ "kind"
2543
+ ]
2544
+ },
2545
+ "then": {
2546
+ "properties": {
2547
+ "vatNumber": {
2548
+ "type": "string",
2549
+ "minLength": 3
2550
+ }
2551
+ },
2552
+ "required": [
2553
+ "vatNumber",
2554
+ "notes"
2555
+ ]
2556
+ }
2557
+ },
2558
+ "uischema": {
2559
+ "type": "TemplateLayout",
2560
+ "lang": "ractive",
2561
+ "options": {
2562
+ "conditionalFields": true
2563
+ },
2564
+ "template": "<section><div data-kind>{{>0}}</div><div data-vat>{{>1}}</div><div data-notes>{{>2}}</div></section>",
2565
+ "elements": [
2566
+ {
2567
+ "type": "Control",
2568
+ "scope": "#/properties/kind"
2569
+ },
2570
+ {
2571
+ "type": "Control",
2572
+ "scope": "#/properties/vatNumber"
2573
+ },
2574
+ {
2575
+ "type": "Control",
2576
+ "scope": "#/properties/notes"
2577
+ }
2578
+ ]
2579
+ },
2580
+ "data": {
2581
+ "kind": "personal",
2582
+ "vatNumber": "BG123",
2583
+ "notes": "Retained notes"
2584
+ },
2585
+ "operations": [
2586
+ "personal to business to personal",
2587
+ "render at root and object Control detail",
2588
+ "render the ordered children view",
2589
+ "repeat a known slot reference"
2590
+ ]
2591
+ },
2592
+ "expected": {
2593
+ "knownSlotCount": 3,
2594
+ "personalSlotContent": [
2595
+ "kind",
2596
+ null,
2597
+ "notes"
2598
+ ],
2599
+ "businessSlotContent": [
2600
+ "kind",
2601
+ "vatNumber",
2602
+ "notes"
2603
+ ],
2604
+ "noNumericAliases": true,
2605
+ "knownInactiveMountsControl": false,
2606
+ "knownInactiveActivatesFallback": false,
2607
+ "knownInactiveEmitsUnknownSlot": false,
2608
+ "retainedEditorIdentityAndFocus": true,
2609
+ "retainedTextSelection": true,
2610
+ "originalValidationAndInactiveDataPreserved": true,
2611
+ "inactiveSlotContributesSectionBinding": false
2612
+ }
2613
+ },
2614
+ {
2615
+ "id": "conditional-template-named",
2616
+ "section": "13.5 / Conditional fields",
2617
+ "input": {
2618
+ "schema": {
2619
+ "type": "object",
2620
+ "properties": {
2621
+ "kind": {
2622
+ "type": "string",
2623
+ "enum": [
2624
+ "personal",
2625
+ "business"
2626
+ ]
2627
+ },
2628
+ "notes": {
2629
+ "type": "string"
2630
+ }
2631
+ },
2632
+ "if": {
2633
+ "properties": {
2634
+ "kind": {
2635
+ "const": "business"
2636
+ }
2637
+ },
2638
+ "required": [
2639
+ "kind"
2640
+ ]
2641
+ },
2642
+ "then": {
2643
+ "properties": {
2644
+ "vatNumber": {
2645
+ "type": "string",
2646
+ "minLength": 3
2647
+ }
2648
+ },
2649
+ "required": [
2650
+ "vatNumber",
2651
+ "notes"
2652
+ ]
2653
+ }
2654
+ },
2655
+ "uischema": {
2656
+ "type": "TemplateLayout",
2657
+ "lang": "ractive",
2658
+ "options": {
2659
+ "conditionalFields": true
2660
+ },
2661
+ "template": "<section><div data-kind>{{>kind}}</div><div data-vat>{{>vatNumber}}</div><div data-notes>{{>notes}}</div></section>",
2662
+ "elements": [
2663
+ {
2664
+ "type": "Control",
2665
+ "scope": "#/properties/kind",
2666
+ "name": "kind"
2667
+ },
2668
+ {
2669
+ "type": "Control",
2670
+ "scope": "#/properties/vatNumber",
2671
+ "name": "vatNumber"
2672
+ },
2673
+ {
2674
+ "type": "Control",
2675
+ "scope": "#/properties/notes",
2676
+ "name": "notes"
2677
+ }
2678
+ ]
2679
+ },
2680
+ "data": {
2681
+ "kind": "personal",
2682
+ "vatNumber": "BG123",
2683
+ "notes": "Retained notes"
2684
+ },
2685
+ "operations": [
2686
+ "personal to business to personal",
2687
+ "render at root and object Control detail",
2688
+ "render the ordered children view",
2689
+ "repeat a known slot reference"
2690
+ ]
2691
+ },
2692
+ "expected": {
2693
+ "knownSlotCount": 3,
2694
+ "personalSlotContent": [
2695
+ "kind",
2696
+ null,
2697
+ "notes"
2698
+ ],
2699
+ "businessSlotContent": [
2700
+ "kind",
2701
+ "vatNumber",
2702
+ "notes"
2703
+ ],
2704
+ "noNumericAliases": true,
2705
+ "knownInactiveMountsControl": false,
2706
+ "knownInactiveActivatesFallback": false,
2707
+ "knownInactiveEmitsUnknownSlot": false,
2708
+ "retainedEditorIdentityAndFocus": true,
2709
+ "retainedTextSelection": true,
2710
+ "originalValidationAndInactiveDataPreserved": true,
2711
+ "inactiveSlotContributesSectionBinding": false
2712
+ }
2713
+ },
2714
+ {
2715
+ "id": "conditional-template-explicit-numeric",
2716
+ "section": "13.5 / Conditional fields",
2717
+ "input": {
2718
+ "schema": {
2719
+ "type": "object",
2720
+ "properties": {
2721
+ "kind": {
2722
+ "type": "string",
2723
+ "enum": [
2724
+ "personal",
2725
+ "business"
2726
+ ]
2727
+ },
2728
+ "notes": {
2729
+ "type": "string"
2730
+ }
2731
+ },
2732
+ "if": {
2733
+ "properties": {
2734
+ "kind": {
2735
+ "const": "business"
2736
+ }
2737
+ },
2738
+ "required": [
2739
+ "kind"
2740
+ ]
2741
+ },
2742
+ "then": {
2743
+ "properties": {
2744
+ "vatNumber": {
2745
+ "type": "string",
2746
+ "minLength": 3
2747
+ }
2748
+ },
2749
+ "required": [
2750
+ "vatNumber",
2751
+ "notes"
2752
+ ]
2753
+ }
2754
+ },
2755
+ "uischema": {
2756
+ "type": "TemplateLayout",
2757
+ "lang": "ractive",
2758
+ "options": {
2759
+ "conditionalFields": true
2760
+ },
2761
+ "template": "<section><div data-kind>{{>0}}</div><div data-vat>{{>1}}</div><div data-notes>{{>2}}</div></section>",
2762
+ "elements": [
2763
+ {
2764
+ "type": "Control",
2765
+ "scope": "#/properties/kind",
2766
+ "name": "0"
2767
+ },
2768
+ {
2769
+ "type": "Control",
2770
+ "scope": "#/properties/vatNumber",
2771
+ "name": "1"
2772
+ },
2773
+ {
2774
+ "type": "Control",
2775
+ "scope": "#/properties/notes",
2776
+ "name": "2"
2777
+ }
2778
+ ]
2779
+ },
2780
+ "data": {
2781
+ "kind": "personal",
2782
+ "vatNumber": "BG123",
2783
+ "notes": "Retained notes"
2784
+ },
2785
+ "operations": [
2786
+ "personal to business to personal",
2787
+ "render at root and object Control detail",
2788
+ "render the ordered children view",
2789
+ "repeat a known slot reference"
2790
+ ]
2791
+ },
2792
+ "expected": {
2793
+ "knownSlotCount": 3,
2794
+ "personalSlotContent": [
2795
+ "kind",
2796
+ null,
2797
+ "notes"
2798
+ ],
2799
+ "businessSlotContent": [
2800
+ "kind",
2801
+ "vatNumber",
2802
+ "notes"
2803
+ ],
2804
+ "noNumericAliases": true,
2805
+ "knownInactiveMountsControl": false,
2806
+ "knownInactiveActivatesFallback": false,
2807
+ "knownInactiveEmitsUnknownSlot": false,
2808
+ "retainedEditorIdentityAndFocus": true,
2809
+ "retainedTextSelection": true,
2810
+ "originalValidationAndInactiveDataPreserved": true,
2811
+ "inactiveSlotContributesSectionBinding": false
2812
+ }
2813
+ },
2814
+ {
2815
+ "id": "conditional-template-missing-name",
2816
+ "section": "13.5 / Conditional fields",
2817
+ "input": {
2818
+ "knownNames": [
2819
+ "vatNumber",
2820
+ "notes"
2821
+ ],
2822
+ "inactiveNames": [
2823
+ "vatNumber"
2824
+ ],
2825
+ "references": [
2826
+ "vatNumber",
2827
+ "notes",
2828
+ "typo"
2829
+ ],
2830
+ "syntaxVariants": [
2831
+ "partial",
2832
+ "native Slot",
2833
+ "supported JSX expression",
2834
+ "supported JSX component"
2835
+ ]
2836
+ },
2837
+ "expected": {
2838
+ "vatNumber": "empty without fallback or unknown-slot diagnostic",
2839
+ "notes": "delegated field renderer",
2840
+ "typo": "normal profile unknown-name diagnostic/fallback",
2841
+ "undefinedComponentGloballyIgnored": false,
2842
+ "unsupportedSyntaxStillDiagnosed": true
2843
+ }
2844
+ },
2845
+ {
2846
+ "id": "conditional-template-ownership",
2847
+ "section": "Conditional fields",
2848
+ "input": {
2849
+ "entryTypes": [
2850
+ "TemplateLayout",
2851
+ "Template",
2852
+ "Slot"
2853
+ ],
2854
+ "global": true,
2855
+ "cases": [
2856
+ "root local true",
2857
+ "root local false",
2858
+ "descendant true below disabled owner",
2859
+ "registered layout resolved after projection",
2860
+ "nested object reuses a schema at a distinct data path"
2861
+ ]
2862
+ },
2863
+ "expected": {
2864
+ "rootTemplateCanOwnProjection": true,
2865
+ "entryLocalFalseWins": true,
2866
+ "descendantCannotOverrideOwner": true,
2867
+ "registeredLayoutInheritsProjection": true,
2868
+ "registeredInactiveOverrideDoesNotUseSlotFallback": true,
2869
+ "noNewObjectDataBinding": true,
2870
+ "schemaIdentityDoesNotMergeObjectBoundaries": true
2871
+ }
2872
+ },
2873
+ {
2874
+ "id": "native-input-original-text",
2875
+ "section": "Scalar controls and temporal editing",
2876
+ "input": {
2877
+ "cases": [
2878
+ "integer 1.9",
2879
+ "integer 9007199254740993",
2880
+ "integer 1e3",
2881
+ "maxLength:1 supplementary character",
2882
+ "IME intermediate text",
2883
+ "masked February 31",
2884
+ "unpadded months 2–9"
2885
+ ],
2886
+ "boundaries": [
2887
+ "control",
2888
+ "cell",
2889
+ "native picker"
2890
+ ]
2891
+ },
2892
+ "expected": {
2893
+ "fractionNeverTruncated": true,
2894
+ "unsafeDigitsNeverRoundedIntoCommit": true,
2895
+ "exponentNeverParsedAsPrefix": true,
2896
+ "lengthCountsCodePoints": true,
2897
+ "compositionNotPrematurelyCommitted": true,
2898
+ "impossibleDateNotNormalized": true,
2899
+ "validMonthDigitsRetained": true
2900
+ }
2901
+ },
2902
+ {
2903
+ "id": "pending-validity-without-data-change",
2904
+ "section": "Pending edits and validation",
2905
+ "input": {
2906
+ "cases": [
2907
+ "invalid local duration draft",
2908
+ "pending file read",
2909
+ "owner error publication",
2910
+ "command without blur",
2911
+ "clear during read",
2912
+ "nested independent form"
2913
+ ]
2914
+ },
2915
+ "expected": {
2916
+ "hostNotifiedWithoutDataEdit": true,
2917
+ "unresolvedDraftBlocksConsumption": true,
2918
+ "commandReadsFlushedCurrentData": true,
2919
+ "clearInvalidatesRead": true,
2920
+ "hostErrorsPreserved": true,
2921
+ "independentFormDoesNotInheritPending": true
2922
+ }
2923
+ },
2924
+ {
2925
+ "id": "template-lookup-ownership",
2926
+ "section": "Template and Slot",
2927
+ "input": {
2928
+ "cases": [
2929
+ "duplicate registry name",
2930
+ "duplicate caller child name",
2931
+ "literal constructor slot",
2932
+ "unfilled structural slot",
2933
+ "same-form same-path recursive expansion",
2934
+ "independent nested form reuse"
2935
+ ]
2936
+ },
2937
+ "expected": {
2938
+ "firstRegistryWins": true,
2939
+ "laterCallerChildWins": true,
2940
+ "duplicatesDiagnosed": true,
2941
+ "namesUseOwnKeys": true,
2942
+ "unfilledSlotCanUseFallback": true,
2943
+ "sameBoundaryRecursionTerminates": true,
2944
+ "independentFormReuseAllowed": true
2945
+ }
2946
+ },
2947
+ {
2948
+ "id": "literal-tree-selected-editor",
2949
+ "section": "Mixed tree editing",
2950
+ "input": {
2951
+ "keys": [
2952
+ "a.b",
2953
+ "",
2954
+ " renamed.key ",
2955
+ "constructor"
2956
+ ],
2957
+ "neighbor": {
2958
+ "a": {
2959
+ "b": "distinct value"
2960
+ }
2961
+ },
2962
+ "actions": [
2963
+ "select literal member",
2964
+ "edit selected detail",
2965
+ "rename with punctuation and spaces"
2966
+ ]
2967
+ },
2968
+ "expected": {
2969
+ "selectedValueUsesLiteralSegments": true,
2970
+ "nestedNeighborUnchanged": true,
2971
+ "emptySegmentNotDropped": true,
2972
+ "acceptedRenameNotTrimmed": true,
2973
+ "isolatedEditorRetainsConfiguration": true,
2974
+ "localReferenceContextPreserved": true,
2975
+ "schemaLookupUsesOwnProperties": true,
2976
+ "labelDoesNotInventRenamePermission": true
2977
+ }
2978
+ },
2979
+ {
2980
+ "id": "queued-edit-permission-change",
2981
+ "section": "Readonly and pending edits",
2982
+ "input": {
2983
+ "separateReadonlyFromDisabled": true,
2984
+ "actions": [
2985
+ "type without blur",
2986
+ "make readonly before debounce delivery",
2987
+ "wait for delivery or consume data"
2988
+ ]
2989
+ },
2990
+ "expected": {
2991
+ "notYetCommittedEditCancelled": true,
2992
+ "alreadyCommittedEditNotRolledBack": true,
2993
+ "noWriteThroughOldPermissions": true,
2994
+ "pendingStateCleared": true,
2995
+ "readonlyPresentationCapabilityDeclared": true
2996
+ }
2997
+ },
2998
+ {
2999
+ "id": "conditional-group-empty-region-identity",
3000
+ "section": "Conditional fields",
3001
+ "input": {
3002
+ "regions": [
3003
+ "header",
3004
+ "footer",
3005
+ "cover"
3006
+ ],
3007
+ "collapsible": [
3008
+ false,
3009
+ true
3010
+ ],
3011
+ "actions": [
3012
+ "focus a body editor and select text",
3013
+ "deactivate the last region field",
3014
+ "reactivate that field"
3015
+ ]
3016
+ },
3017
+ "expected": {
3018
+ "inactiveRegionControlsOmitted": true,
3019
+ "sameBodyEditorInstance": true,
3020
+ "focusSelectionAndDraftPreserved": true,
3021
+ "authoredSchemaUnchanged": true
3022
+ }
3023
+ },
3024
+ {
3025
+ "id": "conditional-projection-diagnostic-ownership",
3026
+ "section": "Conditional fields",
3027
+ "input": {
3028
+ "entryPoints": [
3029
+ "object Control",
3030
+ "object-context layout"
3031
+ ],
3032
+ "nestedSameObjectControl": true,
3033
+ "conditionCannotCompile": true,
3034
+ "independentObjectPaths": [
3035
+ "left",
3036
+ "right"
3037
+ ]
3038
+ },
3039
+ "expected": {
3040
+ "oneReportPerOwningProjection": true,
3041
+ "reuseDoesNotRepeatVisibleMessagesOrCallbacks": true,
3042
+ "independentPathsRetainSeparateFailures": true
3043
+ }
3044
+ },
3045
+ {
3046
+ "id": "core-readonly-compatibility-alias",
3047
+ "section": "15.1",
3048
+ "input": {
3049
+ "integration": "JSON Forms core",
3050
+ "cases": [
3051
+ {
3052
+ "config": {
3053
+ "readOnly": true
3054
+ },
3055
+ "options": {},
3056
+ "readonly": true
3057
+ },
3058
+ {
3059
+ "config": {},
3060
+ "options": {
3061
+ "readOnly": true
3062
+ },
3063
+ "readonly": true
3064
+ },
3065
+ {
3066
+ "config": {},
3067
+ "options": {
3068
+ "readonly": false,
3069
+ "readOnly": true
3070
+ },
3071
+ "readonly": false
3072
+ },
3073
+ {
3074
+ "config": {
3075
+ "readonly": false,
3076
+ "readOnly": true
3077
+ },
3078
+ "options": {},
3079
+ "readonly": false
3080
+ },
3081
+ {
3082
+ "config": {
3083
+ "readonly": true
3084
+ },
3085
+ "options": {
3086
+ "readOnly": false
3087
+ },
3088
+ "readonly": false
3089
+ }
3090
+ ]
3091
+ },
3092
+ "expected": {
3093
+ "coreAliasNotStripped": true,
3094
+ "canonicalBooleanWinsWithinSource": true,
3095
+ "sourcePrecedenceUnchanged": true,
3096
+ "schemaKeywordRemainsReadOnly": true,
3097
+ "otherIntegrationsDeclareAliasCapability": true
3098
+ }
730
3099
  }
731
3100
  ]