@abgov/jsonforms-components 2.58.3 → 2.58.5
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 +19 -16
- package/package.json +1 -1
- package/renderer-catalog.json +3 -2
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, createDefaultValue, Paths, Resolve, toDataPath, schemaTypeIs, formatIs, getAjv, schemaMatches,
|
|
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
|
|
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:
|
|
8201
|
-
|
|
8202
|
-
|
|
8203
|
-
|
|
8204
|
-
|
|
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,
|
|
@@ -8315,7 +8322,7 @@ const BooleanRadioComponent = ({
|
|
|
8315
8322
|
const BooleanRadioControl = props => jsx(GoAInputBaseControl, Object.assign({}, props, {
|
|
8316
8323
|
input: BooleanRadioComponent
|
|
8317
8324
|
}));
|
|
8318
|
-
const GoABooleanRadioControlTester = rankWith(3, and(isBooleanControl, optionIs('radio', true)));
|
|
8325
|
+
const GoABooleanRadioControlTester = rankWith(3, and(isBooleanControl, or(optionIs('format', 'radio'), optionIs('radio', true))));
|
|
8319
8326
|
const GoABooleanRadioControl = withJsonFormsControlProps(BooleanRadioControl);
|
|
8320
8327
|
|
|
8321
8328
|
let _$9 = t => t,
|
|
@@ -12386,10 +12393,6 @@ const PrimitiveArrayControl = props => {
|
|
|
12386
12393
|
onClick: () => addItem(),
|
|
12387
12394
|
children: ["Add ", prettyLabel]
|
|
12388
12395
|
})
|
|
12389
|
-
}), jsx("pre", {
|
|
12390
|
-
children: JSON.stringify(schema.items, null, 2)
|
|
12391
|
-
}), jsx("pre", {
|
|
12392
|
-
children: JSON.stringify(itemUiSchema, null, 2)
|
|
12393
12396
|
}), items.length === 0 && jsxs("p", {
|
|
12394
12397
|
style: {
|
|
12395
12398
|
opacity: 0.7
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@abgov/jsonforms-components",
|
|
3
|
-
"version": "2.58.
|
|
3
|
+
"version": "2.58.5",
|
|
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-04-
|
|
4
|
-
"sourceCommit": "
|
|
3
|
+
"generatedAt": "2026-04-06T21:13:45.668Z",
|
|
4
|
+
"sourceCommit": "1ac0db7f550de834aef3d196b5b103d2a7ad540d",
|
|
5
5
|
"sourcePath": "libs/jsonforms-components/src/index.ts",
|
|
6
6
|
"rendererCount": 33,
|
|
7
7
|
"renderers": [
|
|
@@ -375,6 +375,7 @@
|
|
|
375
375
|
"type": "Control",
|
|
376
376
|
"options": {
|
|
377
377
|
"required": {
|
|
378
|
+
"format": "radio",
|
|
378
379
|
"radio": true
|
|
379
380
|
},
|
|
380
381
|
"optional": {}
|