@abgov/jsonforms-components 2.60.1 → 2.60.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
@@ -3713,16 +3713,11 @@ const areAllUppercase = label => {
3713
3713
  return /^[^a-z]*$/.test(label);
3714
3714
  };
3715
3715
  const getExplicitControlLabel = props => {
3716
- var _props$uischema, _props$schema, _props$uischema2;
3717
- const optionText = (_props$uischema = props.uischema) == null || (_props$uischema = _props$uischema.options) == null ? void 0 : _props$uischema.text;
3718
- if (typeof optionText === 'string' && optionText.trim()) {
3719
- return optionText.trim();
3720
- }
3721
- if (typeof ((_props$schema = props.schema) == null ? void 0 : _props$schema.title) === 'string' && props.schema.title.trim()) {
3722
- return props.schema.title.trim();
3723
- }
3724
- const uiLabel = (_props$uischema2 = props.uischema) == null ? void 0 : _props$uischema2.label;
3725
- if (typeof uiLabel === 'string' && uiLabel.trim()) {
3716
+ var _props$uischema, _props$uischema2, _props$schema;
3717
+ // uischema.label has highest priority. An explicit empty string suppresses the
3718
+ // auto-generated label (and prevents options.text from leaking into the form-item label).
3719
+ const uiLabel = (_props$uischema = props.uischema) == null ? void 0 : _props$uischema.label;
3720
+ if (typeof uiLabel === 'string') {
3726
3721
  return uiLabel.trim();
3727
3722
  }
3728
3723
  if (typeof uiLabel === 'object' && uiLabel !== null && 'text' in uiLabel) {
@@ -3731,6 +3726,13 @@ const getExplicitControlLabel = props => {
3731
3726
  return text.trim();
3732
3727
  }
3733
3728
  }
3729
+ const optionText = (_props$uischema2 = props.uischema) == null || (_props$uischema2 = _props$uischema2.options) == null ? void 0 : _props$uischema2.text;
3730
+ if (typeof optionText === 'string' && optionText.trim()) {
3731
+ return optionText.trim();
3732
+ }
3733
+ if (typeof ((_props$schema = props.schema) == null ? void 0 : _props$schema.title) === 'string' && props.schema.title.trim()) {
3734
+ return props.schema.title.trim();
3735
+ }
3734
3736
  return undefined;
3735
3737
  };
3736
3738
  const getGeneratedLabelFromScope = scope => {
@@ -3744,7 +3746,7 @@ const getGeneratedLabelFromScope = scope => {
3744
3746
  const getControlLabelText = props => {
3745
3747
  var _props$uischema3;
3746
3748
  const explicitLabel = getExplicitControlLabel(props);
3747
- if (explicitLabel) {
3749
+ if (explicitLabel !== undefined) {
3748
3750
  return explicitLabel;
3749
3751
  }
3750
3752
  if ((_props$uischema3 = props.uischema) != null && (_props$uischema3 = _props$uischema3.scope) != null && _props$uischema3.startsWith('#/')) {
@@ -8493,7 +8495,7 @@ const GoABaseInputReviewComponent = props => {
8493
8495
  if (((_uischema$options5 = uischema.options) == null ? void 0 : _uischema$options5.radio) === true) {
8494
8496
  reviewText = data ? `Yes` : `No`;
8495
8497
  } else {
8496
- reviewText = data ? `Yes (${checkboxLabel})` : `No (${checkboxLabel})`;
8498
+ reviewText = data ? checkboxLabel ? `Yes (${checkboxLabel})` : `Yes` : checkboxLabel ? `No (${checkboxLabel})` : `No`;
8497
8499
  }
8498
8500
  }
8499
8501
  if (isTime) {
@@ -9901,7 +9903,7 @@ class ListWithDetailControl extends React.Component {
9901
9903
  }
9902
9904
 
9903
9905
  const GoAInputBaseTableReview = props => {
9904
- var _uischema$options, _uischema$scope2, _jsonForms$core, _uischema$options4;
9906
+ var _uischema$options, _uischema$scope2, _jsonForms$core, _uischema$options4, _uischema$options5;
9905
9907
  const {
9906
9908
  data,
9907
9909
  uischema,
@@ -10058,9 +10060,19 @@ const GoAInputBaseTableReview = props => {
10058
10060
  if (activeError && /\sis required$/i.test(activeError)) {
10059
10061
  activeError = `${labelToUpdate} is required`;
10060
10062
  }
10063
+ // For required boolean fields (e.g. anyOf: [{enum: [true]}]), suppress the raw AJV
10064
+ // "must be equal to one of the allowed values" error and show a friendly message instead.
10065
+ if ((schema == null ? void 0 : schema.type) === 'boolean' && activeError && activeError.toLowerCase().includes('must be equal')) {
10066
+ activeError = data === false ? `${labelToUpdate} is required` : undefined;
10067
+ }
10061
10068
  if (required && isNilOrEmptyValue(data, true) && !activeError) {
10062
10069
  activeError = `${labelToUpdate} is required`;
10063
10070
  }
10071
+ // If a required checkbox is unchecked, show only the validation message in
10072
+ // review mode (not a contradictory "No (...)" value line).
10073
+ if ((schema == null ? void 0 : schema.type) === 'boolean' && data === false && activeError && /\sis required$/i.test(activeError)) {
10074
+ reviewText = '';
10075
+ }
10064
10076
  // eslint-disable-next-line
10065
10077
  const stepId = (_uischema$options4 = uischema.options) == null ? void 0 : _uischema$options4.stepId;
10066
10078
  const showInlineValue = reviewText === null || reviewText === undefined || typeof reviewText === 'string' || typeof reviewText === 'number' || /*#__PURE__*/React.isValidElement(reviewText) || Array.isArray(reviewText) && reviewText.length === 0;
@@ -10073,7 +10085,7 @@ const GoAInputBaseTableReview = props => {
10073
10085
  children: [labelToUpdate, required && jsx(RequiredTextLabel, {
10074
10086
  children: " (required)"
10075
10087
  })]
10076
- }), stepId !== undefined && jsx(GoabButton, {
10088
+ }), stepId !== undefined && !((_uischema$options5 = uischema.options) != null && (_uischema$options5 = _uischema$options5.componentProps) != null && _uischema$options5.readOnly) && jsx(GoabButton, {
10077
10089
  type: "tertiary",
10078
10090
  size: "compact",
10079
10091
  onClick: () => context == null ? void 0 : context.goToPage(stepId, uischema.scope),
@@ -10859,30 +10871,33 @@ const FullNameControlReview = props => {
10859
10871
  } = props;
10860
10872
  const requiredFields = (_props$schema$require = (_props$schema = props.schema) == null ? void 0 : _props$schema.required) != null ? _props$schema$require : [];
10861
10873
  const isMissing = value => isNilOrEmptyString(value);
10862
- const renderRow = (fieldLabel, value, fieldName, testId) => jsx("tr", {
10863
- children: jsxs(PageReviewContainer, {
10864
- colSpan: 3,
10865
- children: [jsxs(ReviewHeader, {
10866
- children: [jsx(ReviewLabel, {
10867
- children: fieldLabel
10868
- }), stepId !== undefined && jsx(GoabButton, {
10869
- type: "tertiary",
10870
- size: "compact",
10871
- onClick: () => context == null ? void 0 : context.goToPage(stepId, uischema.scope),
10872
- testId: `${fieldName}-change-btn`,
10873
- children: "Change"
10874
- })]
10875
- }), jsxs(ReviewValue, {
10876
- children: [jsx("div", {
10877
- "data-testid": testId,
10878
- children: value != null ? value : ''
10879
- }), requiredFields.includes(fieldName) && isMissing(value) && jsx(GoabFormItem, {
10880
- error: `${fieldLabel} is required`,
10881
- label: ""
10874
+ const renderRow = (fieldLabel, value, fieldName, testId) => {
10875
+ var _uischema$options;
10876
+ return jsx("tr", {
10877
+ children: jsxs(PageReviewContainer, {
10878
+ colSpan: 3,
10879
+ children: [jsxs(ReviewHeader, {
10880
+ children: [jsx(ReviewLabel, {
10881
+ children: fieldLabel
10882
+ }), stepId !== undefined && !((_uischema$options = uischema.options) != null && (_uischema$options = _uischema$options.componentProps) != null && _uischema$options.readOnly) && jsx(GoabButton, {
10883
+ type: "tertiary",
10884
+ size: "compact",
10885
+ onClick: () => context == null ? void 0 : context.goToPage(stepId, uischema.scope),
10886
+ testId: `${fieldName}-change-btn`,
10887
+ children: "Change"
10888
+ })]
10889
+ }), jsxs(ReviewValue, {
10890
+ children: [jsx("div", {
10891
+ "data-testid": testId,
10892
+ children: value != null ? value : ''
10893
+ }), requiredFields.includes(fieldName) && isMissing(value) && jsx(GoabFormItem, {
10894
+ error: `${fieldLabel} is required`,
10895
+ label: ""
10896
+ })]
10882
10897
  })]
10883
- })]
10884
- })
10885
- }, testId);
10898
+ })
10899
+ }, testId);
10900
+ };
10886
10901
  return jsxs(Fragment, {
10887
10902
  children: [renderRow('First name', data == null ? void 0 : data.firstName, 'firstName', `firstName-control-${id}`), (data == null ? void 0 : data.middleName) && renderRow('Middle name', data == null ? void 0 : data.middleName, 'middleName', `middleName-control-${id}`), renderRow('Last name', data == null ? void 0 : data.lastName, 'lastName', `lastName-control-${id}`)]
10888
10903
  });
@@ -10903,30 +10918,33 @@ const FullNameDobReviewControl = props => {
10903
10918
  const stepId = uischema == null || (_uischema$options = uischema.options) == null ? void 0 : _uischema$options.stepId;
10904
10919
  const requiredFields = (_props$schema$require = (_props$schema = props.schema) == null ? void 0 : _props$schema.required) != null ? _props$schema$require : [];
10905
10920
  const isMissing = value => isNilOrEmptyString(value);
10906
- const renderRow = (fieldLabel, value, fieldName, testId) => jsx("tr", {
10907
- children: jsxs(PageReviewContainer, {
10908
- colSpan: 3,
10909
- children: [jsxs(ReviewHeader, {
10910
- children: [jsx(ReviewLabel, {
10911
- children: fieldLabel
10912
- }), stepId !== undefined && jsx(GoabButton, {
10913
- type: "tertiary",
10914
- size: "compact",
10915
- onClick: () => context == null ? void 0 : context.goToPage(stepId, uischema.scope),
10916
- testId: `${fieldName}-change-btn`,
10917
- children: "Change"
10918
- })]
10919
- }), jsxs(ReviewValue, {
10920
- children: [jsx("div", {
10921
- "data-testid": testId,
10922
- children: value != null ? value : ''
10923
- }), requiredFields.includes(fieldName) && isMissing(value) && jsx(GoabFormItem, {
10924
- error: `${fieldLabel} is required`,
10925
- label: ""
10921
+ const renderRow = (fieldLabel, value, fieldName, testId) => {
10922
+ var _uischema$options2;
10923
+ return jsx("tr", {
10924
+ children: jsxs(PageReviewContainer, {
10925
+ colSpan: 3,
10926
+ children: [jsxs(ReviewHeader, {
10927
+ children: [jsx(ReviewLabel, {
10928
+ children: fieldLabel
10929
+ }), stepId !== undefined && !((_uischema$options2 = uischema.options) != null && (_uischema$options2 = _uischema$options2.componentProps) != null && _uischema$options2.readOnly) && jsx(GoabButton, {
10930
+ type: "tertiary",
10931
+ size: "compact",
10932
+ onClick: () => context == null ? void 0 : context.goToPage(stepId, uischema.scope),
10933
+ testId: `${fieldName}-change-btn`,
10934
+ children: "Change"
10935
+ })]
10936
+ }), jsxs(ReviewValue, {
10937
+ children: [jsx("div", {
10938
+ "data-testid": testId,
10939
+ children: value != null ? value : ''
10940
+ }), requiredFields.includes(fieldName) && isMissing(value) && jsx(GoabFormItem, {
10941
+ error: `${fieldLabel} is required`,
10942
+ label: ""
10943
+ })]
10926
10944
  })]
10927
- })]
10928
- })
10929
- }, testId);
10945
+ })
10946
+ }, testId);
10947
+ };
10930
10948
  return jsxs(Fragment, {
10931
10949
  children: [renderRow('First name', data == null ? void 0 : data.firstName, 'firstName', `firstName-control-${id}`), (data == null ? void 0 : data.middleName) && renderRow('Middle name', data == null ? void 0 : data.middleName, 'middleName', `middleName-control-${id}`), renderRow('Last name', data == null ? void 0 : data.lastName, 'lastName', `lastName-control-${id}`), renderRow('Date of birth', data == null ? void 0 : data.dateOfBirth, 'dateOfBirth', `dob-control-${id}`)]
10932
10950
  });
@@ -11285,30 +11303,33 @@ const ContractInfoControlReview = props => {
11285
11303
  } = props;
11286
11304
  const requiredFields = (_schema$required = schema == null ? void 0 : schema.required) != null ? _schema$required : [];
11287
11305
  const isMissing = value => value === undefined || value === null || value === '';
11288
- const renderRow = (fieldLabel, value, fieldName, testId) => jsx("tr", {
11289
- children: jsxs(PageReviewContainer, {
11290
- colSpan: 3,
11291
- children: [jsxs(ReviewHeader, {
11292
- children: [jsx(ReviewLabel, {
11293
- children: fieldLabel
11294
- }), stepId !== undefined && jsx(GoabButton, {
11295
- type: "tertiary",
11296
- size: "compact",
11297
- onClick: () => context == null ? void 0 : context.goToPage(stepId, uischema.scope),
11298
- testId: `${fieldName}-change-btn`,
11299
- children: "Change"
11300
- })]
11301
- }), jsxs(ReviewValue, {
11302
- children: [jsx("div", {
11303
- "data-testid": testId,
11304
- children: value != null ? value : ''
11305
- }), requiredFields.includes(fieldName) && isMissing(value) && jsx(GoabFormItem, {
11306
- error: `${fieldLabel} is required`,
11307
- label: ""
11306
+ const renderRow = (fieldLabel, value, fieldName, testId) => {
11307
+ var _uischema$options;
11308
+ return jsx("tr", {
11309
+ children: jsxs(PageReviewContainer, {
11310
+ colSpan: 3,
11311
+ children: [jsxs(ReviewHeader, {
11312
+ children: [jsx(ReviewLabel, {
11313
+ children: fieldLabel
11314
+ }), stepId !== undefined && !((_uischema$options = uischema.options) != null && (_uischema$options = _uischema$options.componentProps) != null && _uischema$options.readOnly) && jsx(GoabButton, {
11315
+ type: "tertiary",
11316
+ size: "compact",
11317
+ onClick: () => context == null ? void 0 : context.goToPage(stepId, uischema.scope),
11318
+ testId: `${fieldName}-change-btn`,
11319
+ children: "Change"
11320
+ })]
11321
+ }), jsxs(ReviewValue, {
11322
+ children: [jsx("div", {
11323
+ "data-testid": testId,
11324
+ children: value != null ? value : ''
11325
+ }), requiredFields.includes(fieldName) && isMissing(value) && jsx(GoabFormItem, {
11326
+ error: `${fieldLabel} is required`,
11327
+ label: ""
11328
+ })]
11308
11329
  })]
11309
- })]
11310
- })
11311
- }, testId);
11330
+ })
11331
+ }, testId);
11332
+ };
11312
11333
  const {
11313
11334
  options
11314
11335
  } = uischema;
@@ -12624,7 +12645,7 @@ const AddressLookUpControlReview = props => {
12624
12645
  });
12625
12646
  };
12626
12647
  const AddressLoopUpControlTableReview = props => {
12627
- var _uischema$options, _schema$properties2, _provinces$find;
12648
+ var _uischema$options, _schema$properties2, _provinces$find, _uischema$options3;
12628
12649
  const {
12629
12650
  data,
12630
12651
  schema,
@@ -12729,6 +12750,7 @@ const AddressLoopUpControlTableReview = props => {
12729
12750
  // Build the target scope for the address control
12730
12751
  const targetScope = (uischema == null ? void 0 : uischema.scope) || (path ? `#/properties/${path}` : undefined);
12731
12752
  const renderRow = (label, value, propName, showButton = false) => {
12753
+ var _uischema$options2;
12732
12754
  let error = getError(propName);
12733
12755
  const required = isRequired(propName);
12734
12756
  if (required && !value && !error) {
@@ -12743,7 +12765,7 @@ const AddressLoopUpControlTableReview = props => {
12743
12765
  children: [label, required && jsx(RequiredTextLabel, {
12744
12766
  children: " (required)"
12745
12767
  })]
12746
- }), showButton && stepId !== undefined && jsx(GoabButton, {
12768
+ }), showButton && stepId !== undefined && !((_uischema$options2 = uischema.options) != null && (_uischema$options2 = _uischema$options2.componentProps) != null && _uischema$options2.readOnly) && jsx(GoabButton, {
12747
12769
  type: "tertiary",
12748
12770
  size: "compact",
12749
12771
  onClick: () => formStepperCtx == null ? void 0 : formStepperCtx.goToPage(stepId, targetScope),
@@ -12767,7 +12789,7 @@ const AddressLoopUpControlTableReview = props => {
12767
12789
  children: jsxs(ReviewHeader, {
12768
12790
  children: [jsx(ReviewLabel, {
12769
12791
  children: `${isAlbertaAddress ? 'Alberta' : 'Canada'} postal address`
12770
- }), stepId !== undefined && jsx(GoabButton, {
12792
+ }), stepId !== undefined && !((_uischema$options3 = uischema.options) != null && (_uischema$options3 = _uischema$options3.componentProps) != null && _uischema$options3.readOnly) && jsx(GoabButton, {
12771
12793
  type: "tertiary",
12772
12794
  size: "compact",
12773
12795
  onClick: () => formStepperCtx == null ? void 0 : formStepperCtx.goToPage(stepId, targetScope),
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@abgov/jsonforms-components",
3
- "version": "2.60.1",
3
+ "version": "2.60.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",
@@ -20,7 +20,7 @@
20
20
  "pluralize": "^8.0.0"
21
21
  },
22
22
  "dependencies": {
23
- "axios": "1.13.5",
23
+ "axios": "1.15.0",
24
24
  "lodash": "^4.17.23",
25
25
  "styled-components": "^6.0.0"
26
26
  },
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "schemaVersion": "1.0.0",
3
- "generatedAt": "2026-04-10T21:10:16.242Z",
4
- "sourceCommit": "a4154355fd3fd785c475219fee548e6bb9678d58",
3
+ "generatedAt": "2026-04-15T22:47:55.536Z",
4
+ "sourceCommit": "c6ed1617cb77a6af93af89e0c715feb74b3dbf12",
5
5
  "sourcePath": "libs/jsonforms-components/src/index.ts",
6
6
  "rendererCount": 33,
7
7
  "renderers": [