@abgov/jsonforms-components 2.66.1 → 2.66.3
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 +93 -107
- package/package.json +1 -1
- package/renderer-catalog.json +2 -2
package/index.esm.js
CHANGED
|
@@ -7244,94 +7244,6 @@ function useDebounce(value, delay) {
|
|
|
7244
7244
|
return debouncedValue;
|
|
7245
7245
|
}
|
|
7246
7246
|
|
|
7247
|
-
const defineFields = fields => fields;
|
|
7248
|
-
const autoLabel = name => `${name} (auto from user profile)`;
|
|
7249
|
-
const buildInsertText = (key, schema) => `${key}": ${JSON.stringify(schema, null, 2)}`;
|
|
7250
|
-
const getNameParts = user => {
|
|
7251
|
-
const [first = '', last = ''] = ((user == null ? void 0 : user.name) || '').split(' ');
|
|
7252
|
-
return {
|
|
7253
|
-
first,
|
|
7254
|
-
last
|
|
7255
|
-
};
|
|
7256
|
-
};
|
|
7257
|
-
const fullNameSchema = {
|
|
7258
|
-
type: 'string',
|
|
7259
|
-
minLength: 3,
|
|
7260
|
-
description: 'Please enter your full name'
|
|
7261
|
-
};
|
|
7262
|
-
const firstNameSchema = {
|
|
7263
|
-
type: 'string',
|
|
7264
|
-
minLength: 3,
|
|
7265
|
-
description: 'Please enter your first name'
|
|
7266
|
-
};
|
|
7267
|
-
const lastNameSchema = {
|
|
7268
|
-
type: 'string',
|
|
7269
|
-
minLength: 3,
|
|
7270
|
-
description: 'Please enter your last name'
|
|
7271
|
-
};
|
|
7272
|
-
const emailSchema = {
|
|
7273
|
-
type: 'string',
|
|
7274
|
-
format: 'email',
|
|
7275
|
-
maxLength: 100,
|
|
7276
|
-
pattern: '^[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\\\\.[a-zA-Z]{2,}$',
|
|
7277
|
-
description: 'Please enter a valid email address (e.g., name@example.com).',
|
|
7278
|
-
errorMessage: {
|
|
7279
|
-
pattern: '(e.g., name@example.com).',
|
|
7280
|
-
maxLength: 'Email must be less than 100 characters.'
|
|
7281
|
-
}
|
|
7282
|
-
};
|
|
7283
|
-
const USER_FIELD_DEFINITIONS = defineFields({
|
|
7284
|
-
fullName: {
|
|
7285
|
-
schema: fullNameSchema,
|
|
7286
|
-
getValue: user => user == null ? void 0 : user.name
|
|
7287
|
-
},
|
|
7288
|
-
name: {
|
|
7289
|
-
schema: fullNameSchema,
|
|
7290
|
-
getValue: user => user == null ? void 0 : user.name
|
|
7291
|
-
},
|
|
7292
|
-
firstName: {
|
|
7293
|
-
schema: firstNameSchema,
|
|
7294
|
-
getValue: user => getNameParts(user).first
|
|
7295
|
-
},
|
|
7296
|
-
givenName: {
|
|
7297
|
-
schema: firstNameSchema,
|
|
7298
|
-
getValue: user => getNameParts(user).first
|
|
7299
|
-
},
|
|
7300
|
-
lastName: {
|
|
7301
|
-
schema: lastNameSchema,
|
|
7302
|
-
getValue: user => getNameParts(user).last
|
|
7303
|
-
},
|
|
7304
|
-
familyName: {
|
|
7305
|
-
schema: lastNameSchema,
|
|
7306
|
-
getValue: user => getNameParts(user).last
|
|
7307
|
-
},
|
|
7308
|
-
surname: {
|
|
7309
|
-
schema: lastNameSchema,
|
|
7310
|
-
getValue: user => getNameParts(user).last
|
|
7311
|
-
},
|
|
7312
|
-
email: {
|
|
7313
|
-
schema: emailSchema,
|
|
7314
|
-
getValue: user => (user == null ? void 0 : user.email) || ''
|
|
7315
|
-
},
|
|
7316
|
-
emailAddress: {
|
|
7317
|
-
schema: emailSchema,
|
|
7318
|
-
getValue: user => (user == null ? void 0 : user.email) || ''
|
|
7319
|
-
},
|
|
7320
|
-
primaryEmail: {
|
|
7321
|
-
schema: emailSchema,
|
|
7322
|
-
getValue: user => (user == null ? void 0 : user.email) || ''
|
|
7323
|
-
}
|
|
7324
|
-
});
|
|
7325
|
-
const autoPopulateValue = (user, props) => {
|
|
7326
|
-
const field = USER_FIELD_DEFINITIONS[props.path];
|
|
7327
|
-
if (!field) return undefined;
|
|
7328
|
-
return field.getValue(user);
|
|
7329
|
-
};
|
|
7330
|
-
const autoPopulatePropertiesMonaco = Object.entries(USER_FIELD_DEFINITIONS).map(([key, field]) => ({
|
|
7331
|
-
label: autoLabel(key),
|
|
7332
|
-
insertText: buildInsertText(key, field.schema)
|
|
7333
|
-
}));
|
|
7334
|
-
|
|
7335
7247
|
function fetchRegisterConfigFromOptions$1(options) {
|
|
7336
7248
|
if (!(options != null && options.url) && !(options != null && options.urn)) return undefined;
|
|
7337
7249
|
const config = Object.assign({}, options);
|
|
@@ -7383,7 +7295,7 @@ const InnerGoAInputText = props => {
|
|
|
7383
7295
|
isVisited,
|
|
7384
7296
|
setIsVisited
|
|
7385
7297
|
} = props;
|
|
7386
|
-
|
|
7298
|
+
useRegisterUser();
|
|
7387
7299
|
const isSinField = schema.title === sinTitle;
|
|
7388
7300
|
const initialValue = isSinField && typeof data === 'string' ? formatSinForDisplay(data) : data;
|
|
7389
7301
|
const [manualInput, setManualInput] = useState(false);
|
|
@@ -7396,20 +7308,6 @@ const InnerGoAInputText = props => {
|
|
|
7396
7308
|
}
|
|
7397
7309
|
setLocalValue(isSinField && typeof data === 'string' ? formatSinForDisplay(data) : data);
|
|
7398
7310
|
}, [data, isSinField]);
|
|
7399
|
-
const shouldAutoPopulateValue = (autoPopulatedValue, data) => {
|
|
7400
|
-
return !!autoPopulatedValue && autoPopulatedValue !== data;
|
|
7401
|
-
};
|
|
7402
|
-
// clean-code-ignore: 2.18
|
|
7403
|
-
useEffect(() => {
|
|
7404
|
-
if (!user || data || manualInput || hasDefault) return;
|
|
7405
|
-
const autoPopulatedValue = autoPopulateValue(user, props);
|
|
7406
|
-
// clean-code-ignore: 2.18
|
|
7407
|
-
if (shouldAutoPopulateValue(autoPopulatedValue, data)) {
|
|
7408
|
-
handleChange(props.path, autoPopulatedValue);
|
|
7409
|
-
setLocalValue(autoPopulatedValue);
|
|
7410
|
-
}
|
|
7411
|
-
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
7412
|
-
}, [user]);
|
|
7413
7311
|
useEffect(() => {
|
|
7414
7312
|
if (typeof handleChange === 'function' && hasDefault && !manualInput) {
|
|
7415
7313
|
handleChange(props.path, schema.default);
|
|
@@ -8288,7 +8186,6 @@ const EnumSelect = props => {
|
|
|
8288
8186
|
value: ''
|
|
8289
8187
|
}, ...staticOptions, ...filteredDynamicOptions];
|
|
8290
8188
|
return newOptions;
|
|
8291
|
-
// eslint-disable-next-line
|
|
8292
8189
|
}, [registerData, options, valuePath, labelPath]);
|
|
8293
8190
|
const width = (uischema == null || (_uischema$options4 = uischema.options) == null || (_uischema$options4 = _uischema$options4.componentProps) == null ? void 0 : _uischema$options4.width) || '100%';
|
|
8294
8191
|
useEffect(() => {
|
|
@@ -8316,13 +8213,14 @@ const EnumSelect = props => {
|
|
|
8316
8213
|
},
|
|
8317
8214
|
width: width,
|
|
8318
8215
|
testId: `jsonforms-${path}-dropdown`,
|
|
8319
|
-
children: mergedOptions.map(item => {
|
|
8216
|
+
children: mergedOptions.map((item, index) => {
|
|
8320
8217
|
const displayLabel = item.label.trim() === '' ? '\u00A0' : item.label;
|
|
8321
8218
|
return jsx(GoabDropdownItem, {
|
|
8322
8219
|
testId: `jsonforms-${path}-dropdown-${item.label}`,
|
|
8323
8220
|
label: displayLabel,
|
|
8324
|
-
value: item.value
|
|
8325
|
-
|
|
8221
|
+
value: item.value,
|
|
8222
|
+
mountType: item.label === placeholder ? 'prepend' : 'append'
|
|
8223
|
+
}, `${item.label}-${item.value}-${index}`);
|
|
8326
8224
|
})
|
|
8327
8225
|
}, `jsonforms-${path}-dropdown`)
|
|
8328
8226
|
});
|
|
@@ -10472,6 +10370,94 @@ fixRegExpWellKnownSymbolLogic('split', function (SPLIT, nativeSplit, maybeCallNa
|
|
|
10472
10370
|
];
|
|
10473
10371
|
}, BUGGY || !SPLIT_WORKS_WITH_OVERWRITTEN_EXEC, UNSUPPORTED_Y);
|
|
10474
10372
|
|
|
10373
|
+
const defineFields = fields => fields;
|
|
10374
|
+
const autoLabel = name => `${name} (auto from user profile)`;
|
|
10375
|
+
const buildInsertText = (key, schema) => `${key}": ${JSON.stringify(schema, null, 2)}`;
|
|
10376
|
+
const getNameParts = user => {
|
|
10377
|
+
const [first = '', last = ''] = ((user == null ? void 0 : user.name) || '').split(' ');
|
|
10378
|
+
return {
|
|
10379
|
+
first,
|
|
10380
|
+
last
|
|
10381
|
+
};
|
|
10382
|
+
};
|
|
10383
|
+
const fullNameSchema = {
|
|
10384
|
+
type: 'string',
|
|
10385
|
+
minLength: 3,
|
|
10386
|
+
description: 'Please enter your full name'
|
|
10387
|
+
};
|
|
10388
|
+
const firstNameSchema = {
|
|
10389
|
+
type: 'string',
|
|
10390
|
+
minLength: 3,
|
|
10391
|
+
description: 'Please enter your first name'
|
|
10392
|
+
};
|
|
10393
|
+
const lastNameSchema = {
|
|
10394
|
+
type: 'string',
|
|
10395
|
+
minLength: 3,
|
|
10396
|
+
description: 'Please enter your last name'
|
|
10397
|
+
};
|
|
10398
|
+
const emailSchema = {
|
|
10399
|
+
type: 'string',
|
|
10400
|
+
format: 'email',
|
|
10401
|
+
maxLength: 100,
|
|
10402
|
+
pattern: '^[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\\\\.[a-zA-Z]{2,}$',
|
|
10403
|
+
description: 'Please enter a valid email address (e.g., name@example.com).',
|
|
10404
|
+
errorMessage: {
|
|
10405
|
+
pattern: '(e.g., name@example.com).',
|
|
10406
|
+
maxLength: 'Email must be less than 100 characters.'
|
|
10407
|
+
}
|
|
10408
|
+
};
|
|
10409
|
+
const USER_FIELD_DEFINITIONS = defineFields({
|
|
10410
|
+
fullName: {
|
|
10411
|
+
schema: fullNameSchema,
|
|
10412
|
+
getValue: user => user == null ? void 0 : user.name
|
|
10413
|
+
},
|
|
10414
|
+
name: {
|
|
10415
|
+
schema: fullNameSchema,
|
|
10416
|
+
getValue: user => user == null ? void 0 : user.name
|
|
10417
|
+
},
|
|
10418
|
+
firstName: {
|
|
10419
|
+
schema: firstNameSchema,
|
|
10420
|
+
getValue: user => getNameParts(user).first
|
|
10421
|
+
},
|
|
10422
|
+
givenName: {
|
|
10423
|
+
schema: firstNameSchema,
|
|
10424
|
+
getValue: user => getNameParts(user).first
|
|
10425
|
+
},
|
|
10426
|
+
lastName: {
|
|
10427
|
+
schema: lastNameSchema,
|
|
10428
|
+
getValue: user => getNameParts(user).last
|
|
10429
|
+
},
|
|
10430
|
+
familyName: {
|
|
10431
|
+
schema: lastNameSchema,
|
|
10432
|
+
getValue: user => getNameParts(user).last
|
|
10433
|
+
},
|
|
10434
|
+
surname: {
|
|
10435
|
+
schema: lastNameSchema,
|
|
10436
|
+
getValue: user => getNameParts(user).last
|
|
10437
|
+
},
|
|
10438
|
+
email: {
|
|
10439
|
+
schema: emailSchema,
|
|
10440
|
+
getValue: user => (user == null ? void 0 : user.email) || ''
|
|
10441
|
+
},
|
|
10442
|
+
emailAddress: {
|
|
10443
|
+
schema: emailSchema,
|
|
10444
|
+
getValue: user => (user == null ? void 0 : user.email) || ''
|
|
10445
|
+
},
|
|
10446
|
+
primaryEmail: {
|
|
10447
|
+
schema: emailSchema,
|
|
10448
|
+
getValue: user => (user == null ? void 0 : user.email) || ''
|
|
10449
|
+
}
|
|
10450
|
+
});
|
|
10451
|
+
const autoPopulateValue = (user, props) => {
|
|
10452
|
+
const field = USER_FIELD_DEFINITIONS[props.path];
|
|
10453
|
+
if (!field) return undefined;
|
|
10454
|
+
return field.getValue(user);
|
|
10455
|
+
};
|
|
10456
|
+
const autoPopulatePropertiesMonaco = Object.entries(USER_FIELD_DEFINITIONS).map(([key, field]) => ({
|
|
10457
|
+
label: autoLabel(key),
|
|
10458
|
+
insertText: buildInsertText(key, field.schema)
|
|
10459
|
+
}));
|
|
10460
|
+
|
|
10475
10461
|
const defaultLabel = 'Email address';
|
|
10476
10462
|
const GoAEmailInput = props => {
|
|
10477
10463
|
var _uischema$options$com, _uischema$options, _uischema$options$com2, _uischema$options2, _stepperState$categor;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@abgov/jsonforms-components",
|
|
3
|
-
"version": "2.66.
|
|
3
|
+
"version": "2.66.3",
|
|
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,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"schemaVersion": "1.0.0",
|
|
3
|
-
"generatedAt": "2026-06-
|
|
4
|
-
"sourceCommit": "
|
|
3
|
+
"generatedAt": "2026-06-12T18:22:13.360Z",
|
|
4
|
+
"sourceCommit": "0e419d8addab8bc60c47d0cf73a930746dd45b39",
|
|
5
5
|
"sourcePath": "libs/jsonforms-components/src/index.ts",
|
|
6
6
|
"rendererCount": 33,
|
|
7
7
|
"renderers": [
|