@abgov/jsonforms-components 2.55.1 → 2.55.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 CHANGED
@@ -3055,6 +3055,17 @@ const sinTitle = 'Social insurance number';
3055
3055
  const invalidSin = 'Social insurance number is invalid';
3056
3056
  const DEFAULT_MAX_ITEMS = 50;
3057
3057
  const REQUIRED_PROPERTY_ERROR = 'is a required property';
3058
+ const ADDRESS_LOOKUP_LABELS = {
3059
+ addressLine1: 'Address line 1',
3060
+ addressLine2: 'Address line 2',
3061
+ municipality: 'City',
3062
+ postalCode: 'Postal code',
3063
+ subdivisionCode: 'Province',
3064
+ country: 'Country'
3065
+ };
3066
+ const getAddressLookupFieldLabel = fieldName => {
3067
+ return ADDRESS_LOOKUP_LABELS[fieldName] || fieldName;
3068
+ };
3058
3069
 
3059
3070
  /**
3060
3071
  * Sets the first word to be capitalized so that it is sentence cased.
@@ -3246,23 +3257,6 @@ const convertToReadableFormat = input => {
3246
3257
  }
3247
3258
  return input.replace(/([a-z])([A-Z])/g, '$1 $2').split(' ').map(word => word.charAt(0).toUpperCase() + word.slice(1).toLowerCase()).join(' ');
3248
3259
  };
3249
- /**
3250
- * Converts a input to sentence case (eg: incomeThresholdExample or IncomeThresholdExample)
3251
- * to 'Income threshold example' with the first letter in the sentence capitalized.
3252
- *
3253
- * @param input - The camelCase or PascalCase string (e.g., "incomeThresholdExample").
3254
- * @returns A formatted string with spaces and capitalization (e.g., "Income threshold example").
3255
- */
3256
- const convertToSentenceCase = input => {
3257
- if (!input) {
3258
- return input;
3259
- }
3260
- const convertedInput = convertToReadableFormat(input);
3261
- if (!convertedInput) return convertedInput;
3262
- const firstWord = convertedInput.split(' ').splice(0, 1);
3263
- const newWords = convertedInput.split(' ').splice(1).map(word => word.charAt(0).toLowerCase() + word.slice(1).toLowerCase()).join(' ');
3264
- return firstWord.concat(newWords).join(' ');
3265
- };
3266
3260
 
3267
3261
  var $$y = _export;
3268
3262
  var call$e = functionCall;
@@ -3593,11 +3587,9 @@ const Visible = styled.div(_t2$6 || (_t2$6 = _$a`
3593
3587
  width: 100%;
3594
3588
  `), p => p.visible ? 'block' : 'none');
3595
3589
 
3596
- const ADD_REGISTER_DATA_ACTION = 'jsonforms/register/data/add';
3597
- const ADD_NO_ANONYMOUS_ACTION = 'jsonforms/register/no_anonymous';
3598
- const ADD_DATALIST_ACTION = 'jsonforms/register/add_datalist_action';
3599
- const ADD_USER_ACTION = 'jsonforms/register/add_user_action';
3600
- const ADD_REGISTER_DATA_ERROR = 'jsonforms/register/add_register_data_error';
3590
+ var uncurryThis$l = functionUncurryThis;
3591
+
3592
+ var arraySlice$4 = uncurryThis$l([].slice);
3601
3593
 
3602
3594
  var classof$5 = classofRaw$2;
3603
3595
 
@@ -3608,8 +3600,150 @@ var isArray$5 = Array.isArray || function isArray(argument) {
3608
3600
  return classof$5(argument) === 'Array';
3609
3601
  };
3610
3602
 
3611
- var DESCRIPTORS$a = descriptors;
3603
+ var uncurryThis$k = functionUncurryThis;
3612
3604
  var isArray$4 = isArray$5;
3605
+ var isCallable$9 = isCallable$t;
3606
+ var classof$4 = classofRaw$2;
3607
+ var toString$e = toString$m;
3608
+
3609
+ var push$6 = uncurryThis$k([].push);
3610
+
3611
+ var getJsonReplacerFunction = function (replacer) {
3612
+ if (isCallable$9(replacer)) return replacer;
3613
+ if (!isArray$4(replacer)) return;
3614
+ var rawLength = replacer.length;
3615
+ var keys = [];
3616
+ for (var i = 0; i < rawLength; i++) {
3617
+ var element = replacer[i];
3618
+ if (typeof element == 'string') push$6(keys, element);
3619
+ else if (typeof element == 'number' || classof$4(element) === 'Number' || classof$4(element) === 'String') push$6(keys, toString$e(element));
3620
+ }
3621
+ var keysLength = keys.length;
3622
+ var root = true;
3623
+ return function (key, value) {
3624
+ if (root) {
3625
+ root = false;
3626
+ return value;
3627
+ }
3628
+ if (isArray$4(this)) return value;
3629
+ for (var j = 0; j < keysLength; j++) if (keys[j] === key) return value;
3630
+ };
3631
+ };
3632
+
3633
+ var $$x = _export;
3634
+ var getBuiltIn$6 = getBuiltIn$b;
3635
+ var apply$1 = functionApply;
3636
+ var call$d = functionCall;
3637
+ var uncurryThis$j = functionUncurryThis;
3638
+ var fails$c = fails$x;
3639
+ var isCallable$8 = isCallable$t;
3640
+ var isSymbol = isSymbol$3;
3641
+ var arraySlice$3 = arraySlice$4;
3642
+ var getReplacerFunction = getJsonReplacerFunction;
3643
+ var NATIVE_SYMBOL$2 = symbolConstructorDetection;
3644
+
3645
+ var $String = String;
3646
+ var $stringify = getBuiltIn$6('JSON', 'stringify');
3647
+ var exec$7 = uncurryThis$j(/./.exec);
3648
+ var charAt$4 = uncurryThis$j(''.charAt);
3649
+ var charCodeAt$1 = uncurryThis$j(''.charCodeAt);
3650
+ var replace$6 = uncurryThis$j(''.replace);
3651
+ var numberToString$1 = uncurryThis$j(1.0.toString);
3652
+
3653
+ var tester = /[\uD800-\uDFFF]/g;
3654
+ var low = /^[\uD800-\uDBFF]$/;
3655
+ var hi = /^[\uDC00-\uDFFF]$/;
3656
+
3657
+ var WRONG_SYMBOLS_CONVERSION = !NATIVE_SYMBOL$2 || fails$c(function () {
3658
+ var symbol = getBuiltIn$6('Symbol')('stringify detection');
3659
+ // MS Edge converts symbol values to JSON as {}
3660
+ return $stringify([symbol]) !== '[null]'
3661
+ // WebKit converts symbol values to JSON as null
3662
+ || $stringify({ a: symbol }) !== '{}'
3663
+ // V8 throws on boxed symbols
3664
+ || $stringify(Object(symbol)) !== '{}';
3665
+ });
3666
+
3667
+ // https://github.com/tc39/proposal-well-formed-stringify
3668
+ var ILL_FORMED_UNICODE = fails$c(function () {
3669
+ return $stringify('\uDF06\uD834') !== '"\\udf06\\ud834"'
3670
+ || $stringify('\uDEAD') !== '"\\udead"';
3671
+ });
3672
+
3673
+ var stringifyWithSymbolsFix = function (it, replacer) {
3674
+ var args = arraySlice$3(arguments);
3675
+ var $replacer = getReplacerFunction(replacer);
3676
+ if (!isCallable$8($replacer) && (it === undefined || isSymbol(it))) return; // IE8 returns string on undefined
3677
+ args[1] = function (key, value) {
3678
+ // some old implementations (like WebKit) could pass numbers as keys
3679
+ if (isCallable$8($replacer)) value = call$d($replacer, this, $String(key), value);
3680
+ if (!isSymbol(value)) return value;
3681
+ };
3682
+ return apply$1($stringify, null, args);
3683
+ };
3684
+
3685
+ var fixIllFormed = function (match, offset, string) {
3686
+ var prev = charAt$4(string, offset - 1);
3687
+ var next = charAt$4(string, offset + 1);
3688
+ if ((exec$7(low, match) && !exec$7(hi, next)) || (exec$7(hi, match) && !exec$7(low, prev))) {
3689
+ return '\\u' + numberToString$1(charCodeAt$1(match, 0), 16);
3690
+ } return match;
3691
+ };
3692
+
3693
+ if ($stringify) {
3694
+ // `JSON.stringify` method
3695
+ // https://tc39.es/ecma262/#sec-json.stringify
3696
+ $$x({ target: 'JSON', stat: true, arity: 3, forced: WRONG_SYMBOLS_CONVERSION || ILL_FORMED_UNICODE }, {
3697
+ // eslint-disable-next-line no-unused-vars -- required for `.length`
3698
+ stringify: function stringify(it, replacer, space) {
3699
+ var args = arraySlice$3(arguments);
3700
+ var result = apply$1(WRONG_SYMBOLS_CONVERSION ? stringifyWithSymbolsFix : $stringify, null, args);
3701
+ return ILL_FORMED_UNICODE && typeof result == 'string' ? replace$6(result, tester, fixIllFormed) : result;
3702
+ }
3703
+ });
3704
+ }
3705
+
3706
+ const defineFields$1 = fields => fields;
3707
+ const OPTION_DEFINITIONS = defineFields$1({
3708
+ mainTitle: {
3709
+ schema: 'Main form title'
3710
+ },
3711
+ noDataMessage: {
3712
+ schema: 'no data'
3713
+ },
3714
+ detail: {
3715
+ name: 'maxItems',
3716
+ schema: {
3717
+ maxItems: 42
3718
+ }
3719
+ },
3720
+ componentProps: {
3721
+ name: 'readOnly',
3722
+ schema: {
3723
+ readOnly: true
3724
+ }
3725
+ },
3726
+ width: {
3727
+ rootName: 'componentProps',
3728
+ name: 'width',
3729
+ schema: {
3730
+ width: '100%'
3731
+ }
3732
+ }
3733
+ });
3734
+ const predictiveOptionsMonaco = Object.entries(OPTION_DEFINITIONS).map(([key, field]) => ({
3735
+ label: `${'name' in field ? field.name : key} `,
3736
+ insertText: `${'rootName' in field ? field.rootName : key}": ${JSON.stringify(field.schema, null, 2)}`
3737
+ }));
3738
+
3739
+ const ADD_REGISTER_DATA_ACTION = 'jsonforms/register/data/add';
3740
+ const ADD_NO_ANONYMOUS_ACTION = 'jsonforms/register/no_anonymous';
3741
+ const ADD_DATALIST_ACTION = 'jsonforms/register/add_datalist_action';
3742
+ const ADD_USER_ACTION = 'jsonforms/register/add_user_action';
3743
+ const ADD_REGISTER_DATA_ERROR = 'jsonforms/register/add_register_data_error';
3744
+
3745
+ var DESCRIPTORS$a = descriptors;
3746
+ var isArray$3 = isArray$5;
3613
3747
 
3614
3748
  var $TypeError$8 = TypeError;
3615
3749
  // eslint-disable-next-line es/no-object-getownpropertydescriptor -- safe
@@ -3628,7 +3762,7 @@ var SILENT_ON_NON_WRITABLE_LENGTH_SET = DESCRIPTORS$a && !function () {
3628
3762
  }();
3629
3763
 
3630
3764
  var arraySetLength = SILENT_ON_NON_WRITABLE_LENGTH_SET ? function (O, length) {
3631
- if (isArray$4(O) && !getOwnPropertyDescriptor$3(O, 'length').writable) {
3765
+ if (isArray$3(O) && !getOwnPropertyDescriptor$3(O, 'length').writable) {
3632
3766
  throw new $TypeError$8('Cannot set read only .length');
3633
3767
  } return O.length = length;
3634
3768
  } : function (O, length) {
@@ -3643,14 +3777,14 @@ var doesNotExceedSafeInteger$2 = function (it) {
3643
3777
  return it;
3644
3778
  };
3645
3779
 
3646
- var $$x = _export;
3780
+ var $$w = _export;
3647
3781
  var toObject$4 = toObject$a;
3648
3782
  var lengthOfArrayLike$6 = lengthOfArrayLike$a;
3649
3783
  var setArrayLength = arraySetLength;
3650
3784
  var doesNotExceedSafeInteger$1 = doesNotExceedSafeInteger$2;
3651
- var fails$c = fails$x;
3785
+ var fails$b = fails$x;
3652
3786
 
3653
- var INCORRECT_TO_LENGTH = fails$c(function () {
3787
+ var INCORRECT_TO_LENGTH = fails$b(function () {
3654
3788
  return [].push.call({ length: 0x100000000 }, 1) !== 4294967297;
3655
3789
  });
3656
3790
 
@@ -3669,7 +3803,7 @@ var FORCED$2 = INCORRECT_TO_LENGTH || !properErrorOnNonWritableLength();
3669
3803
 
3670
3804
  // `Array.prototype.push` method
3671
3805
  // https://tc39.es/ecma262/#sec-array.prototype.push
3672
- $$x({ target: 'Array', proto: true, arity: 1, forced: FORCED$2 }, {
3806
+ $$w({ target: 'Array', proto: true, arity: 1, forced: FORCED$2 }, {
3673
3807
  // eslint-disable-next-line no-unused-vars -- required for `.length`
3674
3808
  push: function push(item) {
3675
3809
  var O = toObject$4(this);
@@ -3726,20 +3860,20 @@ function registerReducer(state, action) {
3726
3860
  return state;
3727
3861
  }
3728
3862
 
3729
- var $$w = _export;
3863
+ var $$v = _export;
3730
3864
  var $includes = arrayIncludes.includes;
3731
- var fails$b = fails$x;
3865
+ var fails$a = fails$x;
3732
3866
  var addToUnscopables$2 = addToUnscopables$5;
3733
3867
 
3734
3868
  // FF99+ bug
3735
- var BROKEN_ON_SPARSE = fails$b(function () {
3869
+ var BROKEN_ON_SPARSE = fails$a(function () {
3736
3870
  // eslint-disable-next-line es/no-array-prototype-includes -- detection
3737
3871
  return !Array(1).includes();
3738
3872
  });
3739
3873
 
3740
3874
  // `Array.prototype.includes` method
3741
3875
  // https://tc39.es/ecma262/#sec-array.prototype.includes
3742
- $$w({ target: 'Array', proto: true, forced: BROKEN_ON_SPARSE }, {
3876
+ $$v({ target: 'Array', proto: true, forced: BROKEN_ON_SPARSE }, {
3743
3877
  includes: function includes(el /* , fromIndex = 0 */) {
3744
3878
  return $includes(this, el, arguments.length > 1 ? arguments[1] : undefined);
3745
3879
  }
@@ -3748,113 +3882,6 @@ $$w({ target: 'Array', proto: true, forced: BROKEN_ON_SPARSE }, {
3748
3882
  // https://tc39.es/ecma262/#sec-array.prototype-@@unscopables
3749
3883
  addToUnscopables$2('includes');
3750
3884
 
3751
- var uncurryThis$l = functionUncurryThis;
3752
-
3753
- var arraySlice$4 = uncurryThis$l([].slice);
3754
-
3755
- var uncurryThis$k = functionUncurryThis;
3756
- var isArray$3 = isArray$5;
3757
- var isCallable$9 = isCallable$t;
3758
- var classof$4 = classofRaw$2;
3759
- var toString$e = toString$m;
3760
-
3761
- var push$6 = uncurryThis$k([].push);
3762
-
3763
- var getJsonReplacerFunction = function (replacer) {
3764
- if (isCallable$9(replacer)) return replacer;
3765
- if (!isArray$3(replacer)) return;
3766
- var rawLength = replacer.length;
3767
- var keys = [];
3768
- for (var i = 0; i < rawLength; i++) {
3769
- var element = replacer[i];
3770
- if (typeof element == 'string') push$6(keys, element);
3771
- else if (typeof element == 'number' || classof$4(element) === 'Number' || classof$4(element) === 'String') push$6(keys, toString$e(element));
3772
- }
3773
- var keysLength = keys.length;
3774
- var root = true;
3775
- return function (key, value) {
3776
- if (root) {
3777
- root = false;
3778
- return value;
3779
- }
3780
- if (isArray$3(this)) return value;
3781
- for (var j = 0; j < keysLength; j++) if (keys[j] === key) return value;
3782
- };
3783
- };
3784
-
3785
- var $$v = _export;
3786
- var getBuiltIn$6 = getBuiltIn$b;
3787
- var apply$1 = functionApply;
3788
- var call$d = functionCall;
3789
- var uncurryThis$j = functionUncurryThis;
3790
- var fails$a = fails$x;
3791
- var isCallable$8 = isCallable$t;
3792
- var isSymbol = isSymbol$3;
3793
- var arraySlice$3 = arraySlice$4;
3794
- var getReplacerFunction = getJsonReplacerFunction;
3795
- var NATIVE_SYMBOL$2 = symbolConstructorDetection;
3796
-
3797
- var $String = String;
3798
- var $stringify = getBuiltIn$6('JSON', 'stringify');
3799
- var exec$7 = uncurryThis$j(/./.exec);
3800
- var charAt$4 = uncurryThis$j(''.charAt);
3801
- var charCodeAt$1 = uncurryThis$j(''.charCodeAt);
3802
- var replace$6 = uncurryThis$j(''.replace);
3803
- var numberToString$1 = uncurryThis$j(1.0.toString);
3804
-
3805
- var tester = /[\uD800-\uDFFF]/g;
3806
- var low = /^[\uD800-\uDBFF]$/;
3807
- var hi = /^[\uDC00-\uDFFF]$/;
3808
-
3809
- var WRONG_SYMBOLS_CONVERSION = !NATIVE_SYMBOL$2 || fails$a(function () {
3810
- var symbol = getBuiltIn$6('Symbol')('stringify detection');
3811
- // MS Edge converts symbol values to JSON as {}
3812
- return $stringify([symbol]) !== '[null]'
3813
- // WebKit converts symbol values to JSON as null
3814
- || $stringify({ a: symbol }) !== '{}'
3815
- // V8 throws on boxed symbols
3816
- || $stringify(Object(symbol)) !== '{}';
3817
- });
3818
-
3819
- // https://github.com/tc39/proposal-well-formed-stringify
3820
- var ILL_FORMED_UNICODE = fails$a(function () {
3821
- return $stringify('\uDF06\uD834') !== '"\\udf06\\ud834"'
3822
- || $stringify('\uDEAD') !== '"\\udead"';
3823
- });
3824
-
3825
- var stringifyWithSymbolsFix = function (it, replacer) {
3826
- var args = arraySlice$3(arguments);
3827
- var $replacer = getReplacerFunction(replacer);
3828
- if (!isCallable$8($replacer) && (it === undefined || isSymbol(it))) return; // IE8 returns string on undefined
3829
- args[1] = function (key, value) {
3830
- // some old implementations (like WebKit) could pass numbers as keys
3831
- if (isCallable$8($replacer)) value = call$d($replacer, this, $String(key), value);
3832
- if (!isSymbol(value)) return value;
3833
- };
3834
- return apply$1($stringify, null, args);
3835
- };
3836
-
3837
- var fixIllFormed = function (match, offset, string) {
3838
- var prev = charAt$4(string, offset - 1);
3839
- var next = charAt$4(string, offset + 1);
3840
- if ((exec$7(low, match) && !exec$7(hi, next)) || (exec$7(hi, match) && !exec$7(low, prev))) {
3841
- return '\\u' + numberToString$1(charCodeAt$1(match, 0), 16);
3842
- } return match;
3843
- };
3844
-
3845
- if ($stringify) {
3846
- // `JSON.stringify` method
3847
- // https://tc39.es/ecma262/#sec-json.stringify
3848
- $$v({ target: 'JSON', stat: true, arity: 3, forced: WRONG_SYMBOLS_CONVERSION || ILL_FORMED_UNICODE }, {
3849
- // eslint-disable-next-line no-unused-vars -- required for `.length`
3850
- stringify: function stringify(it, replacer, space) {
3851
- var args = arraySlice$3(arguments);
3852
- var result = apply$1(WRONG_SYMBOLS_CONVERSION ? stringifyWithSymbolsFix : $stringify, null, args);
3853
- return ILL_FORMED_UNICODE && typeof result == 'string' ? replace$6(result, tester, fixIllFormed) : result;
3854
- }
3855
- });
3856
- }
3857
-
3858
3885
  var global$d = global$t;
3859
3886
  var classof$3 = classofRaw$2;
3860
3887
 
@@ -7176,7 +7203,7 @@ const autoPopulateValue = (user, props) => {
7176
7203
  if (!field) return undefined;
7177
7204
  return field.getValue(user);
7178
7205
  };
7179
- Object.entries(USER_FIELD_DEFINITIONS).map(([key, field]) => ({
7206
+ const autoPopulatePropertiesMonaco = Object.entries(USER_FIELD_DEFINITIONS).map(([key, field]) => ({
7180
7207
  label: autoLabel(key),
7181
7208
  insertText: buildInsertText(key, field.schema)
7182
7209
  }));
@@ -8696,6 +8723,7 @@ const SideMenuItem = styled.div(_t8$1 || (_t8$1 = _$7`
8696
8723
  `));
8697
8724
  const RowFlex = styled.div(_t9$1 || (_t9$1 = _$7`
8698
8725
  display: flex;
8726
+ margin: 1.5rem 0 1.5rem 0;
8699
8727
 
8700
8728
  align-items: flex-start;
8701
8729
  `));
@@ -8723,7 +8751,6 @@ const RowFlexMenuLeft = styled.div(_t1$1 || (_t1$1 = _$7`
8723
8751
  border: 1px solid var(--goa-color-greyscale-300);
8724
8752
  border-radius: var(--goa-border-radius-m);
8725
8753
  margin-top: var(--goa-space-xs);
8726
- background-color: var(--goa-color-greyscale-white);
8727
8754
  padding: 0;
8728
8755
  gap: 0;
8729
8756
  position: relative;
@@ -9775,14 +9802,13 @@ class ListWithDetailControl extends React.Component {
9775
9802
  // eslint-disable-next-line
9776
9803
  const listTitle = (_ref = (_ref2 = (_ref3 = (_uischema$label = uischema == null ? void 0 : uischema.label) != null ? _uischema$label : uischema == null || (_uischema$options15 = uischema.options) == null ? void 0 : _uischema$options15.title) != null ? _ref3 : getItemsTitle(schema)) != null ? _ref2 : schema == null ? void 0 : schema.title) != null ? _ref : label;
9777
9804
  const withLeftTab = uischema == null || (_uischema$options16 = uischema.options) == null || (_uischema$options16 = _uischema$options16.componentProps) == null ? void 0 : _uischema$options16.withLeftTab;
9778
- const noLeftTabBlankButton = this.state.currentListPage === 0 && data === 0;
9779
- const showMainItems = withLeftTab || this.state.currentListPage === 0;
9780
- const showSecondaryButton = withLeftTab || noLeftTabBlankButton;
9805
+ this.state.currentListPage === 0 && data === 0;
9806
+ const editMode = this.state.currentListPage !== 0 && !withLeftTab;
9781
9807
  return jsxs(Visible, {
9782
9808
  visible: visible,
9783
9809
  "data-testid": "jsonforms-object-list-wrapper",
9784
9810
  children: [jsxs(ToolBarHeader, {
9785
- children: [listTitle && showMainItems && jsx(MarginTop, {
9811
+ children: [listTitle && jsx(MarginTop, {
9786
9812
  children: jsxs(ObjectArrayTitle, {
9787
9813
  children: [listTitle, " ", jsx("span", {
9788
9814
  children: additionalProps.required && '(required)'
@@ -9794,7 +9820,7 @@ class ListWithDetailControl extends React.Component {
9794
9820
  children: this.state.maxItemsError
9795
9821
  })]
9796
9822
  })
9797
- }), showSecondaryButton && jsx(ObjectArrayToolBar, {
9823
+ }), jsx(ObjectArrayToolBar, {
9798
9824
  data: data,
9799
9825
  errors: errors,
9800
9826
  label: label,
@@ -9806,7 +9832,7 @@ class ListWithDetailControl extends React.Component {
9806
9832
  uischema: controlElement,
9807
9833
  schema: schema,
9808
9834
  rootSchema: rootSchema,
9809
- enabled: enabled,
9835
+ enabled: enabled && !editMode,
9810
9836
  setCurrentListPage: listPage => {
9811
9837
  this.setState({
9812
9838
  currentListPage: listPage
@@ -9837,33 +9863,13 @@ class ListWithDetailControl extends React.Component {
9837
9863
  currentListPage: this.state.currentListPage,
9838
9864
  listTitle: listTitle
9839
9865
  }, additionalProps))
9840
- }), !showSecondaryButton && jsx(ObjectArrayToolBar, {
9841
- data: data,
9842
- errors: errors,
9843
- label: label,
9844
- addItem: (path, value) => () => {
9845
- this.addItem(path, value);
9846
- },
9847
- numColumns: 0,
9848
- path: path,
9849
- uischema: controlElement,
9850
- schema: schema,
9851
- rootSchema: rootSchema,
9852
- enabled: enabled,
9853
- setCurrentListPage: listPage => {
9854
- this.setState({
9855
- currentListPage: listPage
9856
- });
9857
- },
9858
- currentListPage: this.state.currentListPage,
9859
- buttonType: "tertiary"
9860
9866
  })]
9861
9867
  });
9862
9868
  }
9863
9869
  }
9864
9870
 
9865
9871
  const GoAInputBaseTableReview = props => {
9866
- var _uischema$options, _jsonForms$core, _uischema$options4;
9872
+ var _uischema$options, _uischema$scope, _jsonForms$core, _uischema$options4;
9867
9873
  const {
9868
9874
  data,
9869
9875
  uischema,
@@ -9877,10 +9883,16 @@ const GoAInputBaseTableReview = props => {
9877
9883
  } = props;
9878
9884
  const context = useContext(JsonFormsStepperContext);
9879
9885
  const jsonForms = useJsonForms();
9880
- let labelToUpdate = (_uischema$options = uischema.options) != null && _uischema$options.reviewLabel ? uischema.options.reviewLabel : convertToSentenceCase(getLabelText(uischema.scope, label || ''));
9881
- if (labelToUpdate === '') {
9886
+ const reviewLabel = typeof ((_uischema$options = uischema.options) == null ? void 0 : _uischema$options.reviewLabel) === 'string' ? uischema.options.reviewLabel : '';
9887
+ const propLabel = typeof label === 'string' ? label : '';
9888
+ let labelToUpdate = '';
9889
+ if (reviewLabel.trim() !== '') {
9890
+ labelToUpdate = reviewLabel;
9891
+ } else if (propLabel.trim() !== '') {
9892
+ labelToUpdate = propLabel;
9893
+ } else if ((_uischema$scope = uischema.scope) != null && _uischema$scope.startsWith('#/')) {
9882
9894
  const scopeName = uischema.scope ? getLastSegmentFromPointer(uischema.scope) : '';
9883
- labelToUpdate = convertToSentenceCase(scopeName);
9895
+ labelToUpdate = convertToReadableFormat(scopeName);
9884
9896
  }
9885
9897
  let reviewText = data;
9886
9898
  const isBoolean = typeof data === 'boolean';
@@ -9909,7 +9921,7 @@ const GoAInputBaseTableReview = props => {
9909
9921
  checkboxLabel = uischema.options.text.trim();
9910
9922
  } else if (uischema.scope && uischema.scope.startsWith('#/')) {
9911
9923
  const fallbackLabel = getLastSegmentFromPointer(uischema.scope);
9912
- checkboxLabel = fallbackLabel.charAt(0).toUpperCase() + fallbackLabel.slice(1);
9924
+ checkboxLabel = convertToReadableFormat(fallbackLabel);
9913
9925
  }
9914
9926
  if (((_uischema$options3 = uischema.options) == null ? void 0 : _uischema$options3.radio) === true) {
9915
9927
  reviewText = data ? `Yes` : `No`;
@@ -9971,13 +9983,13 @@ const GoAInputBaseTableReview = props => {
9971
9983
  // Fallback: try to extract missing property name and create a friendly message
9972
9984
  if (matchedError.keyword === 'required' && (_matchedError$params = matchedError.params) != null && _matchedError$params.missingProperty) {
9973
9985
  const missing = matchedError.params.missingProperty;
9974
- const missingPropertyLabel = convertToSentenceCase(missing);
9986
+ const missingPropertyLabel = convertToReadableFormat(missing);
9975
9987
  activeError = `${missingPropertyLabel} is required`;
9976
9988
  } else {
9977
9989
  var _matchedError$message;
9978
9990
  const propertyMatch = (_matchedError$message = matchedError.message) == null ? void 0 : _matchedError$message.match(/'([^']+)'/);
9979
9991
  if (propertyMatch && propertyMatch[1]) {
9980
- const missingPropertyLabel = convertToSentenceCase(propertyMatch[1]);
9992
+ const missingPropertyLabel = convertToReadableFormat(propertyMatch[1]);
9981
9993
  activeError = `${missingPropertyLabel} is required`;
9982
9994
  } else {
9983
9995
  activeError = matchedError.message;
@@ -12262,9 +12274,6 @@ const AddressLoopUpControlTableReview = props => {
12262
12274
  label: 'Yukon'
12263
12275
  }];
12264
12276
  const provinceLabel = isAlbertaAddress ? 'Alberta' : ((_provinces$find = provinces.find(p => p.value === (data == null ? void 0 : data.subdivisionCode))) == null ? void 0 : _provinces$find.label) || (data == null ? void 0 : data.subdivisionCode);
12265
- function prettify(prop) {
12266
- return prop.replace(/([A-Z])/g, ' $1').replace(/[_-]/g, ' ').replace(/^./, c => c.toUpperCase());
12267
- }
12268
12277
  const getError = propName => {
12269
12278
  var _jsonForms$core;
12270
12279
  const normalizePath = p => p.replace(/\[(\d+)\]/g, '.$1').replace(/^\./, '').replace(/\//g, '.');
@@ -12303,7 +12312,7 @@ const AddressLoopUpControlTableReview = props => {
12303
12312
  if (raw != null && raw.includes('must have required property') || raw != null && raw.includes(REQUIRED_PROPERTY_ERROR)) {
12304
12313
  const propertyMatch = raw.match(/'([^']+)'/);
12305
12314
  if (propertyMatch && propertyMatch[1]) {
12306
- return prettify(propertyMatch[1]) + ' is required';
12315
+ return `${getAddressLookupFieldLabel(propertyMatch[1])} is required`;
12307
12316
  }
12308
12317
  }
12309
12318
  return raw;
@@ -12363,7 +12372,7 @@ const AddressLoopUpControlTableReview = props => {
12363
12372
  })]
12364
12373
  })
12365
12374
  })
12366
- }), renderRow('Address line 1', data == null ? void 0 : data.addressLine1, 'addressLine1', false), (data == null ? void 0 : data.addressLine2) && renderRow('Address line 2', data.addressLine2, 'addressLine2', false), renderRow('City', data == null ? void 0 : data.municipality, 'municipality', false), renderRow('Postal Code', data == null ? void 0 : data.postalCode, 'postalCode', false), renderRow('Province', provinceLabel, 'subdivisionCode', false), renderRow('Country', 'Canada', 'country', false)]
12375
+ }), renderRow(getAddressLookupFieldLabel('addressLine1'), data == null ? void 0 : data.addressLine1, 'addressLine1', false), (data == null ? void 0 : data.addressLine2) && renderRow(getAddressLookupFieldLabel('addressLine2'), data.addressLine2, 'addressLine2', false), renderRow(getAddressLookupFieldLabel('municipality'), data == null ? void 0 : data.municipality, 'municipality', false), renderRow(getAddressLookupFieldLabel('postalCode'), data == null ? void 0 : data.postalCode, 'postalCode', false), renderRow(getAddressLookupFieldLabel('subdivisionCode'), provinceLabel, 'subdivisionCode', false), renderRow(getAddressLookupFieldLabel('country'), 'Canada', 'country', false)]
12367
12376
  });
12368
12377
  };
12369
12378
 
@@ -16656,7 +16665,7 @@ const AddressLookUpControl = props => {
16656
16665
  const handleRequiredFieldBlur = name => {
16657
16666
  const err = Object.assign({}, errors);
16658
16667
  if (!(data != null && data[name]) || data[name] === '' || (data == null ? void 0 : data[name]) === undefined) {
16659
- err[name] = name === 'municipality' ? 'city is required' : `${name} is required`;
16668
+ err[name] = `${getAddressLookupFieldLabel(name)} is required`;
16660
16669
  setErrors(err);
16661
16670
  } else {
16662
16671
  delete errors[name];
@@ -16715,8 +16724,7 @@ const AddressLookUpControl = props => {
16715
16724
  try {
16716
16725
  const response = await fetchAddressSuggestions(formUrl, q, isAlbertaAddress, {
16717
16726
  signal: controller.signal
16718
- } //update util to accept signal
16719
- );
16727
+ });
16720
16728
  const filtered = filterSuggestionsWithoutAddressCount(response);
16721
16729
  const finalList = isAlbertaAddress ? filterAlbertaAddresses(filtered) : filtered;
16722
16730
  cacheRef.current.set(q, finalList);
@@ -18254,4 +18262,4 @@ const GoARenderers = [...GoABaseRenderers, {
18254
18262
  }];
18255
18263
  const GoACells = [...InputCells];
18256
18264
 
18257
- export { ADD_DATALIST_ACTION, ADD_NO_ANONYMOUS_ACTION, ADD_REGISTER_DATA_ACTION, ADD_REGISTER_DATA_ERROR, ADD_USER_ACTION, AddressLookUpControl, AddressLookUpControlReview, AddressLookUpTester, AddressLoopUpControlTableReview, ArrayControl, ArrayControlBase, ArrayControlReview, BooleanComponent, BooleanControl, BooleanRadioComponent, BooleanRadioControl, CategorizationPagesRendererTester, CategorizationStepperRendererTester, CheckboxGroup, ContextProviderC, ContextProviderClass, ContextProviderFactory, EnumCheckboxControl, EnumRadioControl, EnumSelect, FileUploader, FileUploaderReview, FileUploaderTester, FormPageStepper, FormPagesView, FormStepper, FormStepperControl, FormStepperPagesControl, FormStepperReviewControl, FormStepperReviewer, FormStepperView, FullNameControl, FullNameControlReview, FullNameDobControl, FullNameDobReviewControl, FullNameDobTester, FullNameReviewControl, FullNameTester, GoAArrayControlRenderer, GoAArrayControlReviewRenderer, GoAArrayControlTester, GoABaseInputReviewComponent, GoABaseRenderers, GoABaseReviewRenderers, GoABaseTableReviewRenderers, GoABooleanControl, GoABooleanControlTester, GoABooleanRadioControl, GoABooleanRadioControlTester, GoACalculationControl, GoACalculationControlTester, GoACells, GoACheckoutGroupControlTester, GoADateControl, GoADateControlTester, GoADateInput, GoADateTimeControl, GoADateTimeControlTester, GoADateTimeInput, GoAEmailControl, GoAEmailControlTester, GoAEmailInput, GoAEnumCheckboxGroupControl, GoAEnumControl, GoAEnumControlTester, GoAEnumRadioGroupControl, GoAInputBaseControl, GoAInputBaseFullNameControlReview, GoAInputBaseFullNameDobControlReview, GoAInputBaseReviewControl, GoAInputBaseTableReview, GoAInputBaseTableReviewControl, GoAInputDateControl, GoAInputDateTimeControl, GoAInputEmailControl, GoAInputIntegerControl, GoAInputNumberControl, GoAInputText, GoAInputTextControl, GoAInputTimeControl, GoAIntegerControl, GoAIntegerControlTester, GoAListWithDetailsControlRenderer, GoAListWithDetailsTester, GoANumberControl, GoANumberControlTester, GoANumberInput, GoAPhoneNumberControl, GoAPhoneNumberWithTypeControl, GoAPrimitiveArrayRenderer, GoAPrimitiveArrayTester, GoARadioGroupControlTester, GoARenderers, GoAReviewRenderers, GoATextControl, GoATextControlTester, GoATimeControl, GoATimeControlTester, GoATimeInput, GoInputBaseReview, GoabInputBasePhoneNumberReviewControl, GoabInputBasePhoneNumberWithTypeReviewControl, GoabInputInteger, InnerGoAInputText, JsonFormContext, JsonFormRegisterProvider, JsonFormsRegisterContext, ListWithDetailsControl, MultiLineText, MultiLineTextControl, MultiLineTextControlInput, MultiLineTextControlTester, PHONE_REGEX, PhoneGrid, PhoneNumberControl, PhoneNumberReviewControl, PhoneNumberTester, PhoneNumberWithTypeControl, PhoneNumberWithTypeReviewControl, PhoneNumberWithTypeTester, PrimitiveArrayControl, RadioGroup, categoriesAreValid, createDefaultAjv, enumControl, errMalformedDate, fetchRegisterConfigFromOptions$1 as fetchRegisterConfigFromOptions, formatSin, getByJsonPointer, getCategoryScopes, hasDataInScopes, hasDataValue, isAddressLookup, isFullName, isFullNameDoB, isPhoneNumber, isPhoneNumberWithType, registerReducer, resolveRefs, tryResolveRefs, useRegisterUser };
18265
+ export { ADD_DATALIST_ACTION, ADD_NO_ANONYMOUS_ACTION, ADD_REGISTER_DATA_ACTION, ADD_REGISTER_DATA_ERROR, ADD_USER_ACTION, AddressLookUpControl, AddressLookUpControlReview, AddressLookUpTester, AddressLoopUpControlTableReview, ArrayControl, ArrayControlBase, ArrayControlReview, BooleanComponent, BooleanControl, BooleanRadioComponent, BooleanRadioControl, CategorizationPagesRendererTester, CategorizationStepperRendererTester, CheckboxGroup, ContextProviderC, ContextProviderClass, ContextProviderFactory, EnumCheckboxControl, EnumRadioControl, EnumSelect, FileUploader, FileUploaderReview, FileUploaderTester, FormPageStepper, FormPagesView, FormStepper, FormStepperControl, FormStepperPagesControl, FormStepperReviewControl, FormStepperReviewer, FormStepperView, FullNameControl, FullNameControlReview, FullNameDobControl, FullNameDobReviewControl, FullNameDobTester, FullNameReviewControl, FullNameTester, GoAArrayControlRenderer, GoAArrayControlReviewRenderer, GoAArrayControlTester, GoABaseInputReviewComponent, GoABaseRenderers, GoABaseReviewRenderers, GoABaseTableReviewRenderers, GoABooleanControl, GoABooleanControlTester, GoABooleanRadioControl, GoABooleanRadioControlTester, GoACalculationControl, GoACalculationControlTester, GoACells, GoACheckoutGroupControlTester, GoADateControl, GoADateControlTester, GoADateInput, GoADateTimeControl, GoADateTimeControlTester, GoADateTimeInput, GoAEmailControl, GoAEmailControlTester, GoAEmailInput, GoAEnumCheckboxGroupControl, GoAEnumControl, GoAEnumControlTester, GoAEnumRadioGroupControl, GoAInputBaseControl, GoAInputBaseFullNameControlReview, GoAInputBaseFullNameDobControlReview, GoAInputBaseReviewControl, GoAInputBaseTableReview, GoAInputBaseTableReviewControl, GoAInputDateControl, GoAInputDateTimeControl, GoAInputEmailControl, GoAInputIntegerControl, GoAInputNumberControl, GoAInputText, GoAInputTextControl, GoAInputTimeControl, GoAIntegerControl, GoAIntegerControlTester, GoAListWithDetailsControlRenderer, GoAListWithDetailsTester, GoANumberControl, GoANumberControlTester, GoANumberInput, GoAPhoneNumberControl, GoAPhoneNumberWithTypeControl, GoAPrimitiveArrayRenderer, GoAPrimitiveArrayTester, GoARadioGroupControlTester, GoARenderers, GoAReviewRenderers, GoATextControl, GoATextControlTester, GoATimeControl, GoATimeControlTester, GoATimeInput, GoInputBaseReview, GoabInputBasePhoneNumberReviewControl, GoabInputBasePhoneNumberWithTypeReviewControl, GoabInputInteger, InnerGoAInputText, JsonFormContext, JsonFormRegisterProvider, JsonFormsRegisterContext, ListWithDetailsControl, MultiLineText, MultiLineTextControl, MultiLineTextControlInput, MultiLineTextControlTester, OPTION_DEFINITIONS, PHONE_REGEX, PhoneGrid, PhoneNumberControl, PhoneNumberReviewControl, PhoneNumberTester, PhoneNumberWithTypeControl, PhoneNumberWithTypeReviewControl, PhoneNumberWithTypeTester, PrimitiveArrayControl, RadioGroup, USER_FIELD_DEFINITIONS, autoPopulatePropertiesMonaco, autoPopulateValue, categoriesAreValid, createDefaultAjv, enumControl, errMalformedDate, fetchRegisterConfigFromOptions$1 as fetchRegisterConfigFromOptions, formatSin, getByJsonPointer, getCategoryScopes, hasDataInScopes, hasDataValue, isAddressLookup, isFullName, isFullNameDoB, isPhoneNumber, isPhoneNumberWithType, predictiveOptionsMonaco, registerReducer, resolveRefs, tryResolveRefs, useRegisterUser };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@abgov/jsonforms-components",
3
- "version": "2.55.1",
3
+ "version": "2.55.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",
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "schemaVersion": "1.0.0",
3
- "generatedAt": "2026-03-16T20:36:57.025Z",
4
- "sourceCommit": "e0ba3a1eada96011e94c8b3964d421fc77539775",
3
+ "generatedAt": "2026-03-18T21:44:40.834Z",
4
+ "sourceCommit": "e134fa9889e693c87ebeb45d8d8b55a69af57a75",
5
5
  "sourcePath": "libs/jsonforms-components/src/index.ts",
6
6
  "rendererCount": 32,
7
7
  "renderers": [
package/src/index.d.ts CHANGED
@@ -3,6 +3,8 @@ export * from './lib/Context';
3
3
  export * from './lib/common';
4
4
  export * from './lib/Context/register';
5
5
  export * from './lib/Controls';
6
+ export * from './lib/util/registerOptions';
7
+ export * from './lib/util/autoPopulate';
6
8
  export declare const GoABaseRenderers: JsonFormsRendererRegistryEntry[];
7
9
  export declare const GoABaseReviewRenderers: JsonFormsRendererRegistryEntry[];
8
10
  export declare const GoABaseTableReviewRenderers: JsonFormsRendererRegistryEntry[];
@@ -2,3 +2,12 @@ export declare const sinTitle = "Social insurance number";
2
2
  export declare const invalidSin = "Social insurance number is invalid";
3
3
  export declare const DEFAULT_MAX_ITEMS = 50;
4
4
  export declare const REQUIRED_PROPERTY_ERROR = "is a required property";
5
+ export declare const ADDRESS_LOOKUP_LABELS: {
6
+ readonly addressLine1: "Address line 1";
7
+ readonly addressLine2: "Address line 2";
8
+ readonly municipality: "City";
9
+ readonly postalCode: "Postal code";
10
+ readonly subdivisionCode: "Province";
11
+ readonly country: "Country";
12
+ };
13
+ export declare const getAddressLookupFieldLabel: (fieldName: string) => string;
@@ -3,3 +3,4 @@ export * from './style-component';
3
3
  export * from './type';
4
4
  export * from './stringUtils';
5
5
  export * from './dateUtils';
6
+ export * from './registerOptions';
@@ -0,0 +1,33 @@
1
+ export declare const OPTION_DEFINITIONS: {
2
+ mainTitle: {
3
+ schema: string;
4
+ };
5
+ noDataMessage: {
6
+ schema: string;
7
+ };
8
+ detail: {
9
+ name: string;
10
+ schema: {
11
+ maxItems: number;
12
+ };
13
+ };
14
+ componentProps: {
15
+ name: string;
16
+ schema: {
17
+ readOnly: boolean;
18
+ };
19
+ };
20
+ width: {
21
+ rootName: string;
22
+ name: string;
23
+ schema: {
24
+ width: string;
25
+ };
26
+ };
27
+ };
28
+ export type OptionDefinitions = typeof OPTION_DEFINITIONS;
29
+ export type OptionKey = keyof OptionDefinitions;
30
+ export declare const predictiveOptionsMonaco: {
31
+ label: string;
32
+ insertText: string;
33
+ }[];