@abgov/jsonforms-components 2.58.4 → 2.58.6

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
@@ -6,7 +6,7 @@ import Ajv from 'ajv';
6
6
  import styled from 'styled-components';
7
7
  import axios from 'axios';
8
8
  import get$1 from 'lodash/get';
9
- import { isVisible, isEnabled, deriveLabelForUISchemaElement, rankWith, isStringControl, and, optionIs, isDateControl, isNumberControl, isIntegerControl, isDateTimeControl, isTimeControl, uiTypeIs, isControl as isControl$1, isEnumControl, isBooleanControl, or, createDefaultValue, Paths, Resolve, toDataPath, schemaTypeIs, formatIs, getAjv, schemaMatches, isObjectArrayControl, isPrimitiveArrayControl, composePaths, hasType, isCategorization, isLayout } from '@jsonforms/core';
9
+ import { isVisible, isEnabled, deriveLabelForUISchemaElement, rankWith, isStringControl, and, optionIs, isDateControl, isNumberControl, isIntegerControl, isDateTimeControl, isTimeControl, uiTypeIs, isControl as isControl$1, isEnumControl, or, isOneOfEnumControl, isBooleanControl, createDefaultValue, Paths, Resolve, toDataPath, schemaTypeIs, formatIs, getAjv, schemaMatches, isObjectArrayControl, isPrimitiveArrayControl, composePaths, hasType, isCategorization, isLayout } from '@jsonforms/core';
10
10
  import * as _$c from 'lodash';
11
11
  import ___default, { isObject as isObject$i, isEmpty as isEmpty$1 } from 'lodash';
12
12
  import { useJsonForms, withJsonFormsControlProps, withJsonFormsEnumProps, withTranslateProps, JsonFormsDispatch, withJsonFormsAllOfProps, withJsonFormsArrayLayoutProps, withJsonFormsLayoutProps, withJsonFormsCellProps } from '@jsonforms/react';
@@ -8186,7 +8186,17 @@ const RadioGroup = props => {
8186
8186
  isVisited,
8187
8187
  errors
8188
8188
  } = props;
8189
- const enumData = (schema == null ? void 0 : schema.enum) || [];
8189
+ const oneOF = (schema == null ? void 0 : schema.oneOf) || [];
8190
+ const items = (oneOF == null ? void 0 : oneOF.length) > 0 ? oneOF.map(item => {
8191
+ var _item$title;
8192
+ return {
8193
+ value: String(item.const),
8194
+ label: (_item$title = item.title) != null ? _item$title : String(item.const)
8195
+ };
8196
+ }) : ((schema == null ? void 0 : schema.enum) || []).map(value => ({
8197
+ value: String(value),
8198
+ label: String(value)
8199
+ }));
8190
8200
  const appliedUiSchemaOptions = merge({}, config, props.uischema.options, options);
8191
8201
  return jsx(GoabRadioGroup, Object.assign({
8192
8202
  error: isVisited && errors.length > 0,
@@ -8197,14 +8207,11 @@ const RadioGroup = props => {
8197
8207
  }, appliedUiSchemaOptions, {
8198
8208
  onChange: detail => handleChange(path, detail.value)
8199
8209
  }, uischema == null || (_uischema$options = uischema.options) == null ? void 0 : _uischema$options.componentProps, {
8200
- children: enumData.map((enumValue, index) => {
8201
- return jsx(GoabRadioItem, Object.assign({
8202
- name: enumValue,
8203
- value: `${enumValue}`
8204
- }, appliedUiSchemaOptions, {
8205
- label: enumValue
8206
- }), `list-item-${enumValue}-${index}`);
8207
- })
8210
+ children: items.map((item, index) => jsx(GoabRadioItem, {
8211
+ name: item.value,
8212
+ value: item.value,
8213
+ label: item.label
8214
+ }, `list-item-${item.value}-${index}`))
8208
8215
  }));
8209
8216
  };
8210
8217
  const EnumRadioControl = props => {
@@ -8213,7 +8220,7 @@ const EnumRadioControl = props => {
8213
8220
  }));
8214
8221
  };
8215
8222
  const GoAEnumRadioGroupControl = withJsonFormsEnumProps(withTranslateProps(EnumRadioControl), true);
8216
- const GoARadioGroupControlTester = rankWith(20, and(isEnumControl, optionIs('format', 'radio')));
8223
+ const GoARadioGroupControlTester = rankWith(20, and(or(isEnumControl, isOneOfEnumControl), optionIs('format', 'radio')));
8217
8224
 
8218
8225
  const BooleanComponent = ({
8219
8226
  data,
@@ -10041,6 +10048,12 @@ const GoAInputBaseTableReview = props => {
10041
10048
  }
10042
10049
  }
10043
10050
  }
10051
+ if (!activeError && typeof errors === 'string' && errors.trim() !== '') {
10052
+ activeError = errors;
10053
+ }
10054
+ if (activeError && /\sis required$/i.test(activeError)) {
10055
+ activeError = `${labelToUpdate} is required`;
10056
+ }
10044
10057
  if (required && isNilOrEmptyValue(data, true) && !activeError) {
10045
10058
  activeError = `${labelToUpdate} is required`;
10046
10059
  }
@@ -12386,10 +12399,6 @@ const PrimitiveArrayControl = props => {
12386
12399
  onClick: () => addItem(),
12387
12400
  children: ["Add ", prettyLabel]
12388
12401
  })
12389
- }), jsx("pre", {
12390
- children: JSON.stringify(schema.items, null, 2)
12391
- }), jsx("pre", {
12392
- children: JSON.stringify(itemUiSchema, null, 2)
12393
12402
  }), items.length === 0 && jsxs("p", {
12394
12403
  style: {
12395
12404
  opacity: 0.7
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@abgov/jsonforms-components",
3
- "version": "2.58.4",
3
+ "version": "2.58.6",
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-04-06T15:59:11.776Z",
4
- "sourceCommit": "9a6e59e4af0b3b0d94b6f490f509009439cd97d8",
3
+ "generatedAt": "2026-04-07T18:06:10.408Z",
4
+ "sourceCommit": "b82179eeb9f3786b5b9681123ea064e4e8f6797b",
5
5
  "sourcePath": "libs/jsonforms-components/src/index.ts",
6
6
  "rendererCount": 33,
7
7
  "renderers": [