@abgov/jsonforms-components 2.60.14 → 2.60.15
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 +95 -42
- package/package.json +1 -1
- package/renderer-catalog.json +2 -2
package/index.esm.js
CHANGED
|
@@ -8888,7 +8888,7 @@ styled.div(_t18$1 || (_t18$1 = _$8`
|
|
|
8888
8888
|
padding: 0 1.5rem 0 0;
|
|
8889
8889
|
border: 1px solid #dcdcdc;
|
|
8890
8890
|
`));
|
|
8891
|
-
|
|
8891
|
+
styled.th(_t19$1 || (_t19$1 = _$8`
|
|
8892
8892
|
background-color: var(--goa-color-greyscale-100) !important;
|
|
8893
8893
|
vertical-align: top;
|
|
8894
8894
|
`));
|
|
@@ -9376,7 +9376,13 @@ const SummaryDisplay = ({
|
|
|
9376
9376
|
paddingTop: 'var(--goa-space-xs)',
|
|
9377
9377
|
paddingBottom: 'var(--goa-space-xs)'
|
|
9378
9378
|
},
|
|
9379
|
-
children:
|
|
9379
|
+
children: typeof pair.value === 'boolean' ? pair.value ? 'Yes' : 'No' : pair.value !== null && typeof pair.value === 'object' ? (() => {
|
|
9380
|
+
const v = pair.value;
|
|
9381
|
+
if (('day' in v || 'date' in v) && 'month' in v && 'year' in v) {
|
|
9382
|
+
return `${v.year}-${v.month}-${'day' in v ? v.day : v.date}`;
|
|
9383
|
+
}
|
|
9384
|
+
return Object.values(v).filter(x => x !== undefined && x !== null && x !== '').join(' ');
|
|
9385
|
+
})() : String(pair.value)
|
|
9380
9386
|
})]
|
|
9381
9387
|
}, `${pair.label}-${index}`))
|
|
9382
9388
|
})
|
|
@@ -11853,14 +11859,19 @@ const renderCellColumn = ({
|
|
|
11853
11859
|
const path = `/${rowPath}/${index}/${element}/${index === 0 ? index : index - 1}`;
|
|
11854
11860
|
const nestedErrors = errors == null ? void 0 : errors.filter(e => e.instancePath.includes(path));
|
|
11855
11861
|
/* istanbul ignore next */
|
|
11856
|
-
if (typeof data === '
|
|
11862
|
+
if (typeof data === 'boolean') {
|
|
11863
|
+
return data ? 'Yes' : 'No';
|
|
11864
|
+
} else if (typeof data === 'number') {
|
|
11865
|
+
return String(data);
|
|
11866
|
+
} else if (typeof data === 'string') {
|
|
11857
11867
|
return data;
|
|
11858
11868
|
} else if (typeof data === 'object' || Array.isArray(data)) {
|
|
11859
11869
|
const result = Object.keys(data);
|
|
11860
11870
|
if (!isRequired && nestedErrors.length === 0) {
|
|
11861
|
-
if ('year' in data && 'month' in data && 'day' in data) {
|
|
11871
|
+
if ('year' in data && 'month' in data && ('day' in data || 'date' in data)) {
|
|
11862
11872
|
const dateObj = data;
|
|
11863
|
-
|
|
11873
|
+
const dayValue = 'day' in dateObj ? dateObj.day : dateObj.date;
|
|
11874
|
+
return `${dateObj.year}-${dateObj.month}-${dayValue}`;
|
|
11864
11875
|
}
|
|
11865
11876
|
return jsx("pre", {
|
|
11866
11877
|
children: JSON.stringify(data, null, 2)
|
|
@@ -12010,41 +12021,103 @@ const NonEmptyCellComponent = /*#__PURE__*/React.memo(function NonEmptyCellCompo
|
|
|
12010
12021
|
return err.instancePath.includes(rowPath);
|
|
12011
12022
|
})) == null ? void 0 : _errors$filter.length) > 0 : false;
|
|
12012
12023
|
return jsxs(NonEmptyCellStyle, {
|
|
12013
|
-
children: [uischema == null || (_uischema$elements = uischema.elements) == null ? void 0 : _uischema$elements.map(element => {
|
|
12024
|
+
children: [!isInReview && (uischema == null || (_uischema$elements = uischema.elements) == null ? void 0 : _uischema$elements.map(element => {
|
|
12014
12025
|
return jsx(JsonFormsDispatch, {
|
|
12015
12026
|
"data-testid": `jsonforms-object-list-defined-elements-dispatch`,
|
|
12016
12027
|
schema: schema,
|
|
12017
12028
|
uischema: element,
|
|
12018
12029
|
path: rowPath,
|
|
12019
12030
|
enabled: enabled,
|
|
12020
|
-
renderers:
|
|
12031
|
+
renderers: renderers,
|
|
12021
12032
|
cells: cells
|
|
12022
12033
|
}, rowPath);
|
|
12023
|
-
}), properties && Object.keys(properties).length > 0 && jsxs(Fragment, {
|
|
12024
|
-
children: [jsx(
|
|
12034
|
+
})), properties && Object.keys(properties).length > 0 && jsxs(Fragment, {
|
|
12035
|
+
children: [isInReview ? jsx("div", {
|
|
12036
|
+
style: {
|
|
12037
|
+
padding: '0.75rem 0'
|
|
12038
|
+
},
|
|
12039
|
+
children: range(count || 0).map(i => {
|
|
12040
|
+
const rowData = data && data[i];
|
|
12041
|
+
if (!rowData) return null;
|
|
12042
|
+
const hasAnyValue = Object.keys(tableKeys).some(key => {
|
|
12043
|
+
const value = rowData[key];
|
|
12044
|
+
return value !== undefined && value !== null && value !== '';
|
|
12045
|
+
});
|
|
12046
|
+
const hasRowErrors = (errors || []).some(e => e.instancePath.includes(`/${props.rowPath.replace(/\./g, '/')}/${i}`));
|
|
12047
|
+
if (!hasAnyValue && !hasRowErrors) return null;
|
|
12048
|
+
return jsx("div", {
|
|
12049
|
+
style: {
|
|
12050
|
+
marginBottom: '1.5rem'
|
|
12051
|
+
},
|
|
12052
|
+
children: Object.entries(tableKeys).map(([key, label]) => {
|
|
12053
|
+
var _required$includes, _properties$key;
|
|
12054
|
+
const value = rowData[key];
|
|
12055
|
+
const isRequiredField = (_required$includes = required == null ? void 0 : required.includes(key)) != null ? _required$includes : false;
|
|
12056
|
+
const fieldPath = `/${props.rowPath.replace(/\./g, '/')}/${i}/${key}`;
|
|
12057
|
+
const rowPathMatch = `/${props.rowPath.replace(/\./g, '/')}/${i}`;
|
|
12058
|
+
const fieldError = (errors || []).find(e => {
|
|
12059
|
+
var _msg$match;
|
|
12060
|
+
const msg = e.message || '';
|
|
12061
|
+
const requiredProperty = (_msg$match = msg.match(/'([^']+)'/)) == null ? void 0 : _msg$match[1];
|
|
12062
|
+
return e.instancePath === fieldPath || e.instancePath === rowPathMatch && msg.includes(key) || e.instancePath === rowPathMatch && requiredProperty === key;
|
|
12063
|
+
});
|
|
12064
|
+
const isEmptyValue = value === undefined || value === null || value === '';
|
|
12065
|
+
if (isEmptyValue && !isRequiredField && !fieldError) return null;
|
|
12066
|
+
let reviewError = '';
|
|
12067
|
+
if (fieldError) {
|
|
12068
|
+
const raw = fieldError.message || '';
|
|
12069
|
+
reviewError = raw.includes('required') ? `${capitalizeFirstLetter(key.replace(/[_-]/g, ' '))} is required` : raw;
|
|
12070
|
+
} else if (isRequiredField && isEmptyValue) {
|
|
12071
|
+
reviewError = `${capitalizeFirstLetter(key.replace(/[_-]/g, ' '))} is required`;
|
|
12072
|
+
}
|
|
12073
|
+
return jsxs("div", {
|
|
12074
|
+
style: {
|
|
12075
|
+
display: 'flex',
|
|
12076
|
+
marginBottom: '0.5rem',
|
|
12077
|
+
alignItems: 'center'
|
|
12078
|
+
},
|
|
12079
|
+
children: [jsxs("strong", {
|
|
12080
|
+
style: {
|
|
12081
|
+
width: '50%',
|
|
12082
|
+
flexShrink: 0
|
|
12083
|
+
},
|
|
12084
|
+
children: [(properties == null || (_properties$key = properties[key]) == null ? void 0 : _properties$key.title) || (label !== key ? label : key.replace(/([A-Z])/g, ' $1').replace(/[_-]/g, ' ').replace(/^./, c => c.toUpperCase())), isRequiredField && jsx(RequiredSpan, {
|
|
12085
|
+
children: " (required)"
|
|
12086
|
+
}), " :"]
|
|
12087
|
+
}), jsx("span", {
|
|
12088
|
+
style: {
|
|
12089
|
+
marginLeft: '1rem'
|
|
12090
|
+
},
|
|
12091
|
+
"data-testid": `#/properties/${key}-input-${i}-review`,
|
|
12092
|
+
children: renderCellColumn({
|
|
12093
|
+
data: isEmptyValue ? undefined : value,
|
|
12094
|
+
error: reviewError,
|
|
12095
|
+
isRequired: isRequiredField,
|
|
12096
|
+
errors: errors !== undefined ? errors : [],
|
|
12097
|
+
element: key,
|
|
12098
|
+
rowPath,
|
|
12099
|
+
index: i
|
|
12100
|
+
})
|
|
12101
|
+
})]
|
|
12102
|
+
}, key);
|
|
12103
|
+
})
|
|
12104
|
+
}, i);
|
|
12105
|
+
})
|
|
12106
|
+
}) : jsx(FixTableHeaderAlignment, {
|
|
12025
12107
|
children: jsxs(GoabTable, {
|
|
12026
12108
|
width: "100%",
|
|
12027
12109
|
children: [jsx("thead", {
|
|
12028
12110
|
children: jsxs("tr", {
|
|
12029
12111
|
children: [Object.entries(tableKeys).map(([value, index]) => {
|
|
12030
12112
|
const currentProperty = properties[value];
|
|
12031
|
-
|
|
12032
|
-
return jsx("th", {
|
|
12033
|
-
children: jsxs("p", {
|
|
12034
|
-
children: [(currentProperty == null ? void 0 : currentProperty.title) || index, (required == null ? void 0 : required.includes(value)) && jsx(RequiredSpan, {
|
|
12035
|
-
children: "(required)"
|
|
12036
|
-
})]
|
|
12037
|
-
})
|
|
12038
|
-
}, index);
|
|
12039
|
-
}
|
|
12040
|
-
return jsx(TableTHHeader, {
|
|
12113
|
+
return jsx("th", {
|
|
12041
12114
|
children: jsxs("p", {
|
|
12042
|
-
children: [
|
|
12043
|
-
children:
|
|
12115
|
+
children: [(currentProperty == null ? void 0 : currentProperty.title) || index, (required == null ? void 0 : required.includes(value)) && jsx(RequiredSpan, {
|
|
12116
|
+
children: "(required)"
|
|
12044
12117
|
})]
|
|
12045
12118
|
})
|
|
12046
12119
|
}, index);
|
|
12047
|
-
}),
|
|
12120
|
+
}), jsx("th", {
|
|
12048
12121
|
children: jsx("p", {
|
|
12049
12122
|
children: "Actions"
|
|
12050
12123
|
})
|
|
@@ -12092,26 +12165,6 @@ const NonEmptyCellComponent = /*#__PURE__*/React.memo(function NonEmptyCellCompo
|
|
|
12092
12165
|
if (error != null && (_error$message = error.message) != null && _error$message.includes('must NOT have fewer') && required.find(r => r === schemaName) && (isEmptyBoolean(schema, currentData) || isEmptyNumber(schema, currentData))) {
|
|
12093
12166
|
humanMessage = `${capitalizeFirstLetter(schemaName)} is required`;
|
|
12094
12167
|
}
|
|
12095
|
-
if (isInReview === true) {
|
|
12096
|
-
var _required$includes;
|
|
12097
|
-
return jsx("td", {
|
|
12098
|
-
children: jsx("div", {
|
|
12099
|
-
"data-testid": `#/properties/${schemaName}-input-${i}-review`,
|
|
12100
|
-
style: {
|
|
12101
|
-
display: 'block'
|
|
12102
|
-
},
|
|
12103
|
-
children: renderCellColumn({
|
|
12104
|
-
data: currentData !== '' && currentData !== null && currentData !== undefined ? currentData : undefined,
|
|
12105
|
-
error: humanMessage,
|
|
12106
|
-
isRequired: (_required$includes = required == null ? void 0 : required.includes(element)) != null ? _required$includes : false,
|
|
12107
|
-
errors: errors !== undefined ? errors : [],
|
|
12108
|
-
element,
|
|
12109
|
-
rowPath,
|
|
12110
|
-
index: i
|
|
12111
|
-
})
|
|
12112
|
-
})
|
|
12113
|
-
}, ix);
|
|
12114
|
-
}
|
|
12115
12168
|
return jsx("td", {
|
|
12116
12169
|
children: jsx(GoabFormItem, {
|
|
12117
12170
|
error: humanMessage != null ? humanMessage : '',
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@abgov/jsonforms-components",
|
|
3
|
-
"version": "2.60.
|
|
3
|
+
"version": "2.60.15",
|
|
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-27T19:55:39.353Z",
|
|
4
|
+
"sourceCommit": "c9005bf394764ce1ad7e3af2c39bff2c9b90f254",
|
|
5
5
|
"sourcePath": "libs/jsonforms-components/src/index.ts",
|
|
6
6
|
"rendererCount": 33,
|
|
7
7
|
"renderers": [
|