@abgov/jsonforms-components 2.34.1 → 2.35.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 +26 -2
- package/package.json +1 -1
package/index.esm.js
CHANGED
|
@@ -10447,7 +10447,31 @@ const NonEmptyCellComponent$1 = /*#__PURE__*/React.memo(function NonEmptyCellCom
|
|
|
10447
10447
|
children: jsx(GoAFormItem, {
|
|
10448
10448
|
error: (_b = error === null || error === void 0 ? void 0 : error.message) !== null && _b !== void 0 ? _b : '',
|
|
10449
10449
|
mb: errorRow && !error && '2xl' || 'xs',
|
|
10450
|
-
children: dataObject.
|
|
10450
|
+
children: dataObject.enum ? jsxs(GoADropdown, {
|
|
10451
|
+
id: schemaName,
|
|
10452
|
+
name: schemaName,
|
|
10453
|
+
value: currentData != null ? String(currentData) : '',
|
|
10454
|
+
testId: `#/properties/${schemaName}-select-${i}`,
|
|
10455
|
+
onChange: (name, value) => {
|
|
10456
|
+
const selectedValue = Array.isArray(value) ? value[0] : value;
|
|
10457
|
+
const coerced = dataObject.type === 'number' && selectedValue !== '' ? Number(selectedValue) : selectedValue;
|
|
10458
|
+
handleChange(rowPath, {
|
|
10459
|
+
[num]: {
|
|
10460
|
+
[schemaName]: coerced
|
|
10461
|
+
}
|
|
10462
|
+
});
|
|
10463
|
+
},
|
|
10464
|
+
width: "100%",
|
|
10465
|
+
ariaLabel: schemaName,
|
|
10466
|
+
error: !!(error === null || error === void 0 ? void 0 : error.message),
|
|
10467
|
+
children: [!(required === null || required === void 0 ? void 0 : required.includes(schemaName)) && jsx(GoADropdownItem, {
|
|
10468
|
+
value: "",
|
|
10469
|
+
label: `-- Select ${convertToSentenceCase(schemaName)} --`
|
|
10470
|
+
}), dataObject.enum.map(opt => jsx(GoADropdownItem, {
|
|
10471
|
+
value: String(opt),
|
|
10472
|
+
label: String(opt)
|
|
10473
|
+
}, String(opt)))]
|
|
10474
|
+
}) : dataObject.type === 'number' || dataObject.type === 'string' && !dataObject.enum ? jsx(GoAInput, {
|
|
10451
10475
|
error: (error === null || error === void 0 ? void 0 : error.message.length) > 0,
|
|
10452
10476
|
type: dataObject.type === 'number' ? 'number' : 'text',
|
|
10453
10477
|
id: schemaName,
|
|
@@ -10468,7 +10492,7 @@ const NonEmptyCellComponent$1 = /*#__PURE__*/React.memo(function NonEmptyCellCom
|
|
|
10468
10492
|
size: "medium",
|
|
10469
10493
|
testId: "form-support-callout",
|
|
10470
10494
|
heading: "Not supported",
|
|
10471
|
-
children: "Only string and
|
|
10495
|
+
children: "Only string, number, and enum are supported inside arrays"
|
|
10472
10496
|
})
|
|
10473
10497
|
})
|
|
10474
10498
|
}, ix);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@abgov/jsonforms-components",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.35.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",
|