@abgov/jsonforms-components 2.76.1 → 2.78.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.
- package/index.esm.js +1931 -1028
- package/package.json +1 -1
- package/renderer-catalog.json +3 -405
- package/src/index.d.ts +1 -0
- package/src/lib/Controls/FormStepper/context/StepperContext.d.ts +7 -0
- package/src/lib/Controls/FormStepper/context/stateEquality.d.ts +11 -0
- package/src/lib/Controls/FormStepper/context/types.d.ts +1 -0
- package/src/lib/util/focusControl.d.ts +14 -0
- package/src/lib/util/memoizeTester.d.ts +3 -0
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@abgov/jsonforms-components",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.78.0",
|
|
4
4
|
"license": "Apache-2.0",
|
|
5
5
|
"description": "Government of Alberta - React renderers for JSON Forms based on the design system.",
|
|
6
6
|
"repository": "https://github.com/GovAlta/adsp-monorepo",
|
package/renderer-catalog.json
CHANGED
|
@@ -1,298 +1,10 @@
|
|
|
1
1
|
{
|
|
2
2
|
"schemaVersion": "1.0.0",
|
|
3
|
-
"generatedAt": "2026-09-
|
|
4
|
-
"sourceCommit": "
|
|
3
|
+
"generatedAt": "2026-09-17T22:30:05.646Z",
|
|
4
|
+
"sourceCommit": "a9558befdea513d737c1a19cfab4857ba28de5d7",
|
|
5
5
|
"sourcePath": "libs/jsonforms-components/src/index.ts",
|
|
6
|
-
"rendererCount":
|
|
6
|
+
"rendererCount": 23,
|
|
7
7
|
"renderers": [
|
|
8
|
-
{
|
|
9
|
-
"id": "address-look-up",
|
|
10
|
-
"tester": "AddressLookUpTester",
|
|
11
|
-
"kind": "control",
|
|
12
|
-
"ui": {
|
|
13
|
-
"type": "Control",
|
|
14
|
-
"options": {
|
|
15
|
-
"required": {},
|
|
16
|
-
"optional": {}
|
|
17
|
-
}
|
|
18
|
-
},
|
|
19
|
-
"match": {
|
|
20
|
-
"scope": "control",
|
|
21
|
-
"schema": {
|
|
22
|
-
"type": "object",
|
|
23
|
-
"format": null,
|
|
24
|
-
"enum": null,
|
|
25
|
-
"requiredProperties": [
|
|
26
|
-
"addressLine2",
|
|
27
|
-
"municipality",
|
|
28
|
-
"addressLine1",
|
|
29
|
-
"subdivisionCode",
|
|
30
|
-
"postalCode"
|
|
31
|
-
],
|
|
32
|
-
"exactProperties": false,
|
|
33
|
-
"arrayItemType": null
|
|
34
|
-
}
|
|
35
|
-
},
|
|
36
|
-
"rank": 4,
|
|
37
|
-
"supports": {
|
|
38
|
-
"input": true,
|
|
39
|
-
"review": true
|
|
40
|
-
},
|
|
41
|
-
"fallback": {
|
|
42
|
-
"strategy": "decompose-object",
|
|
43
|
-
"message": "No direct renderer match. Decompose object properties into primitive child controls or use known common schema refs."
|
|
44
|
-
},
|
|
45
|
-
"source": {
|
|
46
|
-
"file": "libs/jsonforms-components/src/lib/Controls/AddressLookup/AddressLookupTester.tsx"
|
|
47
|
-
},
|
|
48
|
-
"notes": [],
|
|
49
|
-
"inference": "auto"
|
|
50
|
-
},
|
|
51
|
-
{
|
|
52
|
-
"id": "categorization-pages-renderer",
|
|
53
|
-
"tester": "CategorizationPagesRendererTester",
|
|
54
|
-
"kind": "layout",
|
|
55
|
-
"ui": {
|
|
56
|
-
"type": "Categorization",
|
|
57
|
-
"options": {
|
|
58
|
-
"required": {
|
|
59
|
-
"variant": "pages"
|
|
60
|
-
},
|
|
61
|
-
"optional": {}
|
|
62
|
-
}
|
|
63
|
-
},
|
|
64
|
-
"match": {
|
|
65
|
-
"scope": "layout",
|
|
66
|
-
"schema": {
|
|
67
|
-
"type": null,
|
|
68
|
-
"format": null,
|
|
69
|
-
"enum": null,
|
|
70
|
-
"requiredProperties": [],
|
|
71
|
-
"exactProperties": null,
|
|
72
|
-
"arrayItemType": null
|
|
73
|
-
}
|
|
74
|
-
},
|
|
75
|
-
"rank": 2,
|
|
76
|
-
"supports": {
|
|
77
|
-
"input": true,
|
|
78
|
-
"review": true
|
|
79
|
-
},
|
|
80
|
-
"fallback": {
|
|
81
|
-
"strategy": "unsupported",
|
|
82
|
-
"message": "No compatible renderer match for the requested UI schema element."
|
|
83
|
-
},
|
|
84
|
-
"source": {
|
|
85
|
-
"file": "libs/jsonforms-components/src/lib/Controls/FormStepper/FormStepperTester.tsx"
|
|
86
|
-
},
|
|
87
|
-
"notes": [
|
|
88
|
-
"Requires Categorization with options.variant=pages and valid Category children."
|
|
89
|
-
],
|
|
90
|
-
"inference": "auto"
|
|
91
|
-
},
|
|
92
|
-
{
|
|
93
|
-
"id": "categorization-stepper-renderer",
|
|
94
|
-
"tester": "CategorizationStepperRendererTester",
|
|
95
|
-
"kind": "layout",
|
|
96
|
-
"ui": {
|
|
97
|
-
"type": "Categorization",
|
|
98
|
-
"options": {
|
|
99
|
-
"required": {},
|
|
100
|
-
"optional": {
|
|
101
|
-
"variant": [
|
|
102
|
-
"stepper"
|
|
103
|
-
]
|
|
104
|
-
}
|
|
105
|
-
}
|
|
106
|
-
},
|
|
107
|
-
"match": {
|
|
108
|
-
"scope": "layout",
|
|
109
|
-
"schema": {
|
|
110
|
-
"type": null,
|
|
111
|
-
"format": null,
|
|
112
|
-
"enum": null,
|
|
113
|
-
"requiredProperties": [],
|
|
114
|
-
"exactProperties": null,
|
|
115
|
-
"arrayItemType": null
|
|
116
|
-
}
|
|
117
|
-
},
|
|
118
|
-
"rank": 2,
|
|
119
|
-
"supports": {
|
|
120
|
-
"input": true,
|
|
121
|
-
"review": true
|
|
122
|
-
},
|
|
123
|
-
"fallback": {
|
|
124
|
-
"strategy": "unsupported",
|
|
125
|
-
"message": "No compatible renderer match for the requested UI schema element."
|
|
126
|
-
},
|
|
127
|
-
"source": {
|
|
128
|
-
"file": "libs/jsonforms-components/src/lib/Controls/FormStepper/FormStepperTester.tsx"
|
|
129
|
-
},
|
|
130
|
-
"notes": [
|
|
131
|
-
"Requires Categorization with valid Category children; default variant behaves as stepper."
|
|
132
|
-
],
|
|
133
|
-
"inference": "auto"
|
|
134
|
-
},
|
|
135
|
-
{
|
|
136
|
-
"id": "contact-information",
|
|
137
|
-
"tester": "ContactInformationTester",
|
|
138
|
-
"kind": "control",
|
|
139
|
-
"ui": {
|
|
140
|
-
"type": "Control",
|
|
141
|
-
"options": {
|
|
142
|
-
"required": {},
|
|
143
|
-
"optional": {}
|
|
144
|
-
}
|
|
145
|
-
},
|
|
146
|
-
"match": {
|
|
147
|
-
"scope": "control",
|
|
148
|
-
"schema": {
|
|
149
|
-
"type": "object",
|
|
150
|
-
"format": null,
|
|
151
|
-
"enum": null,
|
|
152
|
-
"requiredProperties": [
|
|
153
|
-
"email",
|
|
154
|
-
"phone",
|
|
155
|
-
"preferredContactMethod"
|
|
156
|
-
],
|
|
157
|
-
"exactProperties": false,
|
|
158
|
-
"arrayItemType": null
|
|
159
|
-
}
|
|
160
|
-
},
|
|
161
|
-
"rank": 4,
|
|
162
|
-
"supports": {
|
|
163
|
-
"input": true,
|
|
164
|
-
"review": false
|
|
165
|
-
},
|
|
166
|
-
"fallback": {
|
|
167
|
-
"strategy": "decompose-object",
|
|
168
|
-
"message": "No direct renderer match. Decompose object properties into primitive child controls or use known common schema refs."
|
|
169
|
-
},
|
|
170
|
-
"source": {
|
|
171
|
-
"file": "libs/jsonforms-components/src/lib/Controls/ContactInfo/ContractInfoTester.ts"
|
|
172
|
-
},
|
|
173
|
-
"notes": [],
|
|
174
|
-
"inference": "auto"
|
|
175
|
-
},
|
|
176
|
-
{
|
|
177
|
-
"id": "file-uploader",
|
|
178
|
-
"tester": "FileUploaderTester",
|
|
179
|
-
"kind": "control",
|
|
180
|
-
"ui": {
|
|
181
|
-
"type": "Control",
|
|
182
|
-
"options": {
|
|
183
|
-
"required": {},
|
|
184
|
-
"optional": {}
|
|
185
|
-
}
|
|
186
|
-
},
|
|
187
|
-
"match": {
|
|
188
|
-
"scope": "control",
|
|
189
|
-
"schema": {
|
|
190
|
-
"type": "string",
|
|
191
|
-
"format": "file-urn",
|
|
192
|
-
"enum": null,
|
|
193
|
-
"requiredProperties": [],
|
|
194
|
-
"exactProperties": null,
|
|
195
|
-
"arrayItemType": null
|
|
196
|
-
}
|
|
197
|
-
},
|
|
198
|
-
"rank": 3,
|
|
199
|
-
"supports": {
|
|
200
|
-
"input": true,
|
|
201
|
-
"review": true
|
|
202
|
-
},
|
|
203
|
-
"fallback": {
|
|
204
|
-
"strategy": "decompose-object",
|
|
205
|
-
"message": "No direct renderer match. Decompose object properties into primitive child controls or use known common schema refs."
|
|
206
|
-
},
|
|
207
|
-
"source": {
|
|
208
|
-
"file": "libs/jsonforms-components/src/lib/Controls/FileUploader/FileUploaderTester.tsx"
|
|
209
|
-
},
|
|
210
|
-
"notes": [],
|
|
211
|
-
"inference": "auto"
|
|
212
|
-
},
|
|
213
|
-
{
|
|
214
|
-
"id": "full-name",
|
|
215
|
-
"tester": "FullNameTester",
|
|
216
|
-
"kind": "control",
|
|
217
|
-
"ui": {
|
|
218
|
-
"type": "Control",
|
|
219
|
-
"options": {
|
|
220
|
-
"required": {},
|
|
221
|
-
"optional": {}
|
|
222
|
-
}
|
|
223
|
-
},
|
|
224
|
-
"match": {
|
|
225
|
-
"scope": "control",
|
|
226
|
-
"schema": {
|
|
227
|
-
"type": "object",
|
|
228
|
-
"format": null,
|
|
229
|
-
"enum": null,
|
|
230
|
-
"requiredProperties": [
|
|
231
|
-
"firstName",
|
|
232
|
-
"middleName",
|
|
233
|
-
"lastName"
|
|
234
|
-
],
|
|
235
|
-
"exactProperties": true,
|
|
236
|
-
"arrayItemType": null
|
|
237
|
-
}
|
|
238
|
-
},
|
|
239
|
-
"rank": 4,
|
|
240
|
-
"supports": {
|
|
241
|
-
"input": true,
|
|
242
|
-
"review": true
|
|
243
|
-
},
|
|
244
|
-
"fallback": {
|
|
245
|
-
"strategy": "decompose-object",
|
|
246
|
-
"message": "No direct renderer match. Decompose object properties into primitive child controls or use known common schema refs."
|
|
247
|
-
},
|
|
248
|
-
"source": {
|
|
249
|
-
"file": "libs/jsonforms-components/src/lib/Controls/FullName/FullNameTester.tsx"
|
|
250
|
-
},
|
|
251
|
-
"notes": [],
|
|
252
|
-
"inference": "auto"
|
|
253
|
-
},
|
|
254
|
-
{
|
|
255
|
-
"id": "full-name-dob",
|
|
256
|
-
"tester": "FullNameDobTester",
|
|
257
|
-
"kind": "control",
|
|
258
|
-
"ui": {
|
|
259
|
-
"type": "Control",
|
|
260
|
-
"options": {
|
|
261
|
-
"required": {},
|
|
262
|
-
"optional": {}
|
|
263
|
-
}
|
|
264
|
-
},
|
|
265
|
-
"match": {
|
|
266
|
-
"scope": "control",
|
|
267
|
-
"schema": {
|
|
268
|
-
"type": "object",
|
|
269
|
-
"format": null,
|
|
270
|
-
"enum": null,
|
|
271
|
-
"requiredProperties": [
|
|
272
|
-
"firstName",
|
|
273
|
-
"middleName",
|
|
274
|
-
"lastName",
|
|
275
|
-
"dateOfBirth"
|
|
276
|
-
],
|
|
277
|
-
"exactProperties": true,
|
|
278
|
-
"arrayItemType": null
|
|
279
|
-
}
|
|
280
|
-
},
|
|
281
|
-
"rank": 4,
|
|
282
|
-
"supports": {
|
|
283
|
-
"input": true,
|
|
284
|
-
"review": true
|
|
285
|
-
},
|
|
286
|
-
"fallback": {
|
|
287
|
-
"strategy": "decompose-object",
|
|
288
|
-
"message": "No direct renderer match. Decompose object properties into primitive child controls or use known common schema refs."
|
|
289
|
-
},
|
|
290
|
-
"source": {
|
|
291
|
-
"file": "libs/jsonforms-components/src/lib/Controls/FullNameDOB/FullNameDobTester.tsx"
|
|
292
|
-
},
|
|
293
|
-
"notes": [],
|
|
294
|
-
"inference": "auto"
|
|
295
|
-
},
|
|
296
8
|
{
|
|
297
9
|
"id": "goa-array-control",
|
|
298
10
|
"tester": "GoAArrayControlTester",
|
|
@@ -407,43 +119,6 @@
|
|
|
407
119
|
"notes": [],
|
|
408
120
|
"inference": "auto"
|
|
409
121
|
},
|
|
410
|
-
{
|
|
411
|
-
"id": "goa-calculation-control",
|
|
412
|
-
"tester": "GoACalculationControlTester",
|
|
413
|
-
"kind": "control",
|
|
414
|
-
"ui": {
|
|
415
|
-
"type": "Control",
|
|
416
|
-
"options": {
|
|
417
|
-
"required": {},
|
|
418
|
-
"optional": {}
|
|
419
|
-
}
|
|
420
|
-
},
|
|
421
|
-
"match": {
|
|
422
|
-
"scope": "control",
|
|
423
|
-
"schema": {
|
|
424
|
-
"type": "string",
|
|
425
|
-
"format": "computed",
|
|
426
|
-
"enum": null,
|
|
427
|
-
"requiredProperties": [],
|
|
428
|
-
"exactProperties": null,
|
|
429
|
-
"arrayItemType": null
|
|
430
|
-
}
|
|
431
|
-
},
|
|
432
|
-
"rank": 3,
|
|
433
|
-
"supports": {
|
|
434
|
-
"input": true,
|
|
435
|
-
"review": false
|
|
436
|
-
},
|
|
437
|
-
"fallback": {
|
|
438
|
-
"strategy": "decompose-object",
|
|
439
|
-
"message": "No direct renderer match. Decompose object properties into primitive child controls or use known common schema refs."
|
|
440
|
-
},
|
|
441
|
-
"source": {
|
|
442
|
-
"file": "libs/jsonforms-components/src/lib/Controls/Calculation/CalculationControl.tsx"
|
|
443
|
-
},
|
|
444
|
-
"notes": [],
|
|
445
|
-
"inference": "auto"
|
|
446
|
-
},
|
|
447
122
|
{
|
|
448
123
|
"id": "goa-callout-control",
|
|
449
124
|
"tester": "GoACalloutControlTester",
|
|
@@ -1200,83 +875,6 @@
|
|
|
1200
875
|
},
|
|
1201
876
|
"notes": [],
|
|
1202
877
|
"inference": "auto"
|
|
1203
|
-
},
|
|
1204
|
-
{
|
|
1205
|
-
"id": "phone-number",
|
|
1206
|
-
"tester": "PhoneNumberTester",
|
|
1207
|
-
"kind": "control",
|
|
1208
|
-
"ui": {
|
|
1209
|
-
"type": "Control",
|
|
1210
|
-
"options": {
|
|
1211
|
-
"required": {},
|
|
1212
|
-
"optional": {}
|
|
1213
|
-
}
|
|
1214
|
-
},
|
|
1215
|
-
"match": {
|
|
1216
|
-
"scope": "control",
|
|
1217
|
-
"schema": {
|
|
1218
|
-
"type": "string",
|
|
1219
|
-
"format": "phone",
|
|
1220
|
-
"enum": null,
|
|
1221
|
-
"requiredProperties": [],
|
|
1222
|
-
"exactProperties": null,
|
|
1223
|
-
"arrayItemType": null
|
|
1224
|
-
}
|
|
1225
|
-
},
|
|
1226
|
-
"rank": 4,
|
|
1227
|
-
"supports": {
|
|
1228
|
-
"input": true,
|
|
1229
|
-
"review": true
|
|
1230
|
-
},
|
|
1231
|
-
"fallback": {
|
|
1232
|
-
"strategy": "decompose-object",
|
|
1233
|
-
"message": "No direct renderer match. Decompose object properties into primitive child controls or use known common schema refs."
|
|
1234
|
-
},
|
|
1235
|
-
"source": {
|
|
1236
|
-
"file": "libs/jsonforms-components/src/lib/Controls/PhoneNumber/PhoneNumberTester.tsx"
|
|
1237
|
-
},
|
|
1238
|
-
"notes": [],
|
|
1239
|
-
"inference": "auto"
|
|
1240
|
-
},
|
|
1241
|
-
{
|
|
1242
|
-
"id": "phone-number-with-type",
|
|
1243
|
-
"tester": "PhoneNumberWithTypeTester",
|
|
1244
|
-
"kind": "control",
|
|
1245
|
-
"ui": {
|
|
1246
|
-
"type": "Control",
|
|
1247
|
-
"options": {
|
|
1248
|
-
"required": {},
|
|
1249
|
-
"optional": {}
|
|
1250
|
-
}
|
|
1251
|
-
},
|
|
1252
|
-
"match": {
|
|
1253
|
-
"scope": "control",
|
|
1254
|
-
"schema": {
|
|
1255
|
-
"type": "object",
|
|
1256
|
-
"format": null,
|
|
1257
|
-
"enum": null,
|
|
1258
|
-
"requiredProperties": [
|
|
1259
|
-
"number",
|
|
1260
|
-
"type"
|
|
1261
|
-
],
|
|
1262
|
-
"exactProperties": true,
|
|
1263
|
-
"arrayItemType": null
|
|
1264
|
-
}
|
|
1265
|
-
},
|
|
1266
|
-
"rank": 4,
|
|
1267
|
-
"supports": {
|
|
1268
|
-
"input": true,
|
|
1269
|
-
"review": true
|
|
1270
|
-
},
|
|
1271
|
-
"fallback": {
|
|
1272
|
-
"strategy": "decompose-object",
|
|
1273
|
-
"message": "No direct renderer match. Decompose object properties into primitive child controls or use known common schema refs."
|
|
1274
|
-
},
|
|
1275
|
-
"source": {
|
|
1276
|
-
"file": "libs/jsonforms-components/src/lib/Controls/PhoneNumber/PhoneNumberTypeTester.tsx"
|
|
1277
|
-
},
|
|
1278
|
-
"notes": [],
|
|
1279
|
-
"inference": "auto"
|
|
1280
878
|
}
|
|
1281
879
|
]
|
|
1282
880
|
}
|
package/src/index.d.ts
CHANGED
|
@@ -5,6 +5,7 @@ export * from './lib/Context/register';
|
|
|
5
5
|
export * from './lib/Controls';
|
|
6
6
|
export * from './lib/util/registerOptions';
|
|
7
7
|
export * from './lib/util/autoPopulate';
|
|
8
|
+
export * from './lib/util/memoizeTester';
|
|
8
9
|
export declare const GoABaseRenderers: JsonFormsRendererRegistryEntry[];
|
|
9
10
|
export declare const GoABaseReviewRenderers: JsonFormsRendererRegistryEntry[];
|
|
10
11
|
export declare const GoABaseTableReviewRenderers: JsonFormsRendererRegistryEntry[];
|
|
@@ -31,4 +31,11 @@ export interface JsonFormsStepperContextProps {
|
|
|
31
31
|
}
|
|
32
32
|
export declare const JsonFormsStepperContext: import("react").Context<JsonFormsStepperContextProps | undefined>;
|
|
33
33
|
export declare const JsonFormsStepperContextProvider: ({ children, StepperProps, }: JsonFormsStepperContextProviderProps) => JSX.Element;
|
|
34
|
+
/**
|
|
35
|
+
* Walks the schema for required strings that are present but empty.
|
|
36
|
+
*
|
|
37
|
+
* The walk is O(schema) and both the stepper context and the host form ask for the same
|
|
38
|
+
* data/schema pair on every change, so the most recent result is retained. Data and schema are
|
|
39
|
+
* replaced rather than mutated on a change, which makes identity a safe key.
|
|
40
|
+
*/
|
|
34
41
|
export declare const getEmptyRequiredStringErrors: (data: unknown, schema: JsonSchema) => ErrorObject[];
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { CategoriesState, CategoryState, StepperContextDataType } from './types';
|
|
2
|
+
/**
|
|
3
|
+
* Compares two categories by content.
|
|
4
|
+
*
|
|
5
|
+
* Every recompute rebuilds the category objects, so identity alone cannot tell whether anything
|
|
6
|
+
* actually changed. Comparing the fields is what lets an unchanged category keep its previous
|
|
7
|
+
* object, and in turn lets a whole unchanged state be reused.
|
|
8
|
+
*/
|
|
9
|
+
export declare const isSameCategory: (previous: CategoryState, next: CategoryState) => boolean;
|
|
10
|
+
export declare const areSameCategories: (previous: CategoriesState, next: CategoriesState) => boolean;
|
|
11
|
+
export declare const isSameStepperState: (previous: StepperContextDataType, next: StepperContextDataType) => boolean;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* jsdom implements neither of these, and scrollIntoView is missing on real elements often enough
|
|
3
|
+
* (detached nodes, test doubles) that calling it unguarded turns a scroll into a thrown error.
|
|
4
|
+
*/
|
|
5
|
+
export declare const scrollIntoView: (element: Element | null | undefined, options: ScrollIntoViewOptions) => void;
|
|
6
|
+
/**
|
|
7
|
+
* Focus a control as soon as it is focusable, retrying across frames while its shadow content is
|
|
8
|
+
* still being rendered. Returns a cleanup function that cancels any pending retry.
|
|
9
|
+
*
|
|
10
|
+
* This replaces a fixed 300ms timeout. The timeout existed to wait out a smooth scroll animation,
|
|
11
|
+
* and it made the Change button on the review summary feel broken for a third of a second even
|
|
12
|
+
* when the field was ready immediately.
|
|
13
|
+
*/
|
|
14
|
+
export declare const focusWhenReady: (element: Element) => (() => void);
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import { JsonFormsRendererRegistryEntry, RankedTester } from '@jsonforms/core';
|
|
2
|
+
export declare const memoizeTester: (tester: RankedTester) => RankedTester;
|
|
3
|
+
export declare const memoizeRendererTesters: (entries: JsonFormsRendererRegistryEntry[]) => JsonFormsRendererRegistryEntry[];
|