@abgov/jsonforms-components 2.75.3 → 2.76.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 CHANGED
@@ -20640,6 +20640,24 @@ var GoAErrorControl = withJsonFormsControlProps(ErrorControl);
20640
20640
 
20641
20641
  // Allow empty values so incomplete fields are not treated as format errors.
20642
20642
  const optionalFormat = pattern => input => !input || pattern.test(input);
20643
+ const optionalSinFormat = input => {
20644
+ if (!input) {
20645
+ return true;
20646
+ }
20647
+ if (!DEFAULT_PATTERNS.sin.pattern.test(input)) {
20648
+ return false;
20649
+ }
20650
+ return validateSinWithLuhn(input);
20651
+ };
20652
+ const isValidSinWhenComplete = data => {
20653
+ if (typeof data !== 'string' || data.length === 0) {
20654
+ return true;
20655
+ }
20656
+ if (!DEFAULT_PATTERNS.sin.pattern.test(data)) {
20657
+ return true;
20658
+ }
20659
+ return validateSinWithLuhn(data);
20660
+ };
20643
20661
  const createDefaultAjv = (...schemas) => {
20644
20662
  const ajv = new Ajv({
20645
20663
  allErrors: true,
@@ -20654,7 +20672,7 @@ const createDefaultAjv = (...schemas) => {
20654
20672
  addFormats(ajv);
20655
20673
  ajv.addFormat('time', /^([01]\d|2[0-3]):[0-5]\d(:[0-5]\d)?$/);
20656
20674
  Object.entries(DEFAULT_PATTERNS).forEach(([format, config]) => {
20657
- ajv.addFormat(format, optionalFormat(config.pattern));
20675
+ ajv.addFormat(format, format === 'sin' ? optionalSinFormat : optionalFormat(config.pattern));
20658
20676
  });
20659
20677
  ajv.addFormat('phone', PHONE_REGEX);
20660
20678
  ajv.addFormat('computed', /^[a-zA-Z0-9._-]+$/);
@@ -20676,14 +20694,10 @@ const createDefaultAjv = (...schemas) => {
20676
20694
  type: 'string',
20677
20695
  schemaType: 'boolean',
20678
20696
  validate: (shouldValidate, data) => {
20679
- if (!shouldValidate) return true;
20680
- if (typeof data !== 'string' || data.length === 0) {
20681
- return true;
20682
- }
20683
- if (!/^\d{3} \d{3} \d{3}$/.test(data)) {
20697
+ if (shouldValidate === false) {
20684
20698
  return true;
20685
20699
  }
20686
- return validateSinWithLuhn(data);
20700
+ return isValidSinWhenComplete(data);
20687
20701
  },
20688
20702
  error: {
20689
20703
  message: invalidSin
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@abgov/jsonforms-components",
3
- "version": "2.75.3",
3
+ "version": "2.76.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",
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "schemaVersion": "1.0.0",
3
- "generatedAt": "2026-09-10T20:48:43.882Z",
4
- "sourceCommit": "5a1d458e5df0177e45371e7770719fd29fb0b773",
3
+ "generatedAt": "2026-09-11T14:27:30.190Z",
4
+ "sourceCommit": "485a48a50395d09849d740a77ea76cbe502ba424",
5
5
  "sourcePath": "libs/jsonforms-components/src/index.ts",
6
6
  "rendererCount": 33,
7
7
  "renderers": [