@abgov/jsonforms-components 2.61.2 → 2.62.1
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
|
@@ -5789,7 +5789,8 @@ let _$a = t => t,
|
|
|
5789
5789
|
_t9$2,
|
|
5790
5790
|
_t0$2,
|
|
5791
5791
|
_t1$2,
|
|
5792
|
-
_t10$2
|
|
5792
|
+
_t10$2,
|
|
5793
|
+
_t11$2;
|
|
5793
5794
|
const FormFieldWrapper$1 = styled.div(_t$b || (_t$b = _$a`
|
|
5794
5795
|
margin-bottom: var(--goa-space-l);
|
|
5795
5796
|
`));
|
|
@@ -5848,11 +5849,15 @@ const ReviewValue = styled.div(_t9$2 || (_t9$2 = _$a`
|
|
|
5848
5849
|
const CheckboxWrapper = styled.div(_t0$2 || (_t0$2 = _$a`
|
|
5849
5850
|
min-height: 28px;
|
|
5850
5851
|
`));
|
|
5851
|
-
styled.
|
|
5852
|
+
const NoneGivenText = styled.span(_t1$2 || (_t1$2 = _$a`
|
|
5853
|
+
color: var(--goa-color-greyscale-700);
|
|
5854
|
+
font-style: italic;
|
|
5855
|
+
`));
|
|
5856
|
+
styled.h4(_t10$2 || (_t10$2 = _$a`
|
|
5852
5857
|
margin: 0 0 0.25rem 0;
|
|
5853
5858
|
fontsize: larger;
|
|
5854
5859
|
`));
|
|
5855
|
-
styled.h4(
|
|
5860
|
+
styled.h4(_t11$2 || (_t11$2 = _$a`
|
|
5856
5861
|
border-bottom: 1px solid #ddd;
|
|
5857
5862
|
`));
|
|
5858
5863
|
|
|
@@ -10141,12 +10146,15 @@ const GoAInputBaseTableReview = props => {
|
|
|
10141
10146
|
}
|
|
10142
10147
|
// If a required checkbox is unchecked, show only the validation message in
|
|
10143
10148
|
// review mode (not a contradictory "No (...)" value line).
|
|
10149
|
+
let isBooleanRequiredError = false;
|
|
10144
10150
|
if ((schema == null ? void 0 : schema.type) === 'boolean' && data === false && activeError && /\sis required$/i.test(activeError)) {
|
|
10145
10151
|
reviewText = '';
|
|
10152
|
+
isBooleanRequiredError = true;
|
|
10146
10153
|
}
|
|
10147
10154
|
// eslint-disable-next-line
|
|
10148
10155
|
const stepId = (_uischema$options4 = uischema.options) == null ? void 0 : _uischema$options4.stepId;
|
|
10149
10156
|
const showInlineValue = reviewText === null || reviewText === undefined || typeof reviewText === 'string' || typeof reviewText === 'number' || /*#__PURE__*/React.isValidElement(reviewText) || Array.isArray(reviewText) && reviewText.length === 0;
|
|
10157
|
+
const isValueEmpty = !isBooleanRequiredError && (reviewText === null || reviewText === undefined || reviewText === '' || Array.isArray(reviewText) && reviewText.length === 0);
|
|
10150
10158
|
return jsx("tr", {
|
|
10151
10159
|
"data-testid": `input-base-table-${label}-row`,
|
|
10152
10160
|
children: jsxs(PageReviewContainer, {
|
|
@@ -10165,7 +10173,9 @@ const GoAInputBaseTableReview = props => {
|
|
|
10165
10173
|
}), jsxs(ReviewValue, {
|
|
10166
10174
|
children: [showInlineValue ? jsx("div", {
|
|
10167
10175
|
"data-testid": `review-value-${label}`,
|
|
10168
|
-
children:
|
|
10176
|
+
children: isValueEmpty ? jsx(NoneGivenText, {
|
|
10177
|
+
children: "(none given)"
|
|
10178
|
+
}) : reviewText != null ? reviewText : ''
|
|
10169
10179
|
}) : jsx(JsonFormsDispatch, {
|
|
10170
10180
|
"data-testid": `jsonforms-object-list-defined-elements-dispatch`,
|
|
10171
10181
|
schema: schema,
|
|
@@ -12817,7 +12827,27 @@ const PrimitiveArrayControl = props => {
|
|
|
12817
12827
|
};
|
|
12818
12828
|
const GoAPrimitiveArrayRenderer = withJsonFormsControlProps(PrimitiveArrayControl);
|
|
12819
12829
|
|
|
12830
|
+
const getDataAtPath = (data, path) => path.replace(/\[(\d+)\]/g, '.$1').split('.').reduce((acc, key) => acc && typeof acc === 'object' ? acc[key] : undefined, data);
|
|
12831
|
+
const collectFileFields = (schema, value, currentPath) => {
|
|
12832
|
+
if (!schema || value === undefined || value === null) {
|
|
12833
|
+
return [];
|
|
12834
|
+
}
|
|
12835
|
+
if (schema.type === 'string' && schema.format === 'file-urn' && typeof value === 'string' && value !== '') {
|
|
12836
|
+
return [{
|
|
12837
|
+
path: currentPath,
|
|
12838
|
+
urn: value
|
|
12839
|
+
}];
|
|
12840
|
+
}
|
|
12841
|
+
if (schema.type === 'object' && !Array.isArray(schema.properties) && schema.properties && typeof value === 'object') {
|
|
12842
|
+
return Object.entries(schema.properties).flatMap(([key, propertySchema]) => collectFileFields(propertySchema, value[key], composePaths(currentPath, key)));
|
|
12843
|
+
}
|
|
12844
|
+
if (schema.type === 'array' && Array.isArray(value) && schema.items && !Array.isArray(schema.items)) {
|
|
12845
|
+
return value.flatMap((item, index) => collectFileFields(schema.items, item, composePaths(currentPath, `${index}`)));
|
|
12846
|
+
}
|
|
12847
|
+
return [];
|
|
12848
|
+
};
|
|
12820
12849
|
const ListWithDetailsControl = props => {
|
|
12850
|
+
var _enumerators$function;
|
|
12821
12851
|
const [open, setOpen] = useState(false);
|
|
12822
12852
|
const [path, setPath] = useState();
|
|
12823
12853
|
const [name, setName] = useState();
|
|
@@ -12828,6 +12858,14 @@ const ListWithDetailsControl = props => {
|
|
|
12828
12858
|
handleChange
|
|
12829
12859
|
} = props;
|
|
12830
12860
|
const [currentTab, setCurrentTab] = useState(0);
|
|
12861
|
+
const enumerators = useContext(JsonFormContext);
|
|
12862
|
+
const {
|
|
12863
|
+
core
|
|
12864
|
+
} = useJsonForms();
|
|
12865
|
+
const deleteTriggerFunction = enumerators == null || (_enumerators$function = enumerators.functions) == null ? void 0 : _enumerators$function.get('delete-file');
|
|
12866
|
+
const deleteTrigger = deleteTriggerFunction && deleteTriggerFunction();
|
|
12867
|
+
const fileListValue = enumerators == null ? void 0 : enumerators.data.get('file-list');
|
|
12868
|
+
const fileList = fileListValue && fileListValue();
|
|
12831
12869
|
const openDeleteDialog = useCallback((p, rowIndex, name) => {
|
|
12832
12870
|
setOpen(true);
|
|
12833
12871
|
setPath(p);
|
|
@@ -12839,6 +12877,33 @@ const ListWithDetailsControl = props => {
|
|
|
12839
12877
|
const deleteConfirm = useCallback(() => {
|
|
12840
12878
|
const p = path == null ? void 0 : path.substring(0, path.lastIndexOf('.'));
|
|
12841
12879
|
if (removeItems && p) {
|
|
12880
|
+
var _props$schema;
|
|
12881
|
+
const rowValue = path ? getDataAtPath(core == null ? void 0 : core.data, path) : undefined;
|
|
12882
|
+
const itemSchema = (_props$schema = props.schema) == null ? void 0 : _props$schema.items;
|
|
12883
|
+
const fileFields = collectFileFields(itemSchema, rowValue, path != null ? path : '');
|
|
12884
|
+
if (deleteTrigger) {
|
|
12885
|
+
const allUploadedFiles = Object.values(fileList || {}).flat() || [];
|
|
12886
|
+
const fileListFields = Object.entries(fileList || {}).reduce((fields, [filePath, files]) => {
|
|
12887
|
+
if (!filePath.startsWith(`${path}.`) || !Array.isArray(files)) {
|
|
12888
|
+
return fields;
|
|
12889
|
+
}
|
|
12890
|
+
return fields.concat(files.filter(file => Boolean(file == null ? void 0 : file.urn)).map(file => ({
|
|
12891
|
+
path: filePath,
|
|
12892
|
+
urn: file.urn
|
|
12893
|
+
})));
|
|
12894
|
+
}, []);
|
|
12895
|
+
const allFileFields = [...fileFields, ...fileListFields].filter((field, index, fields) => fields.findIndex(candidate => candidate.path === field.path && candidate.urn === field.urn) === index);
|
|
12896
|
+
allFileFields.forEach(({
|
|
12897
|
+
path: fieldPath,
|
|
12898
|
+
urn
|
|
12899
|
+
}) => {
|
|
12900
|
+
var _fileList$fieldPath;
|
|
12901
|
+
const rowFile = (fileList == null || (_fileList$fieldPath = fileList[fieldPath]) == null ? void 0 : _fileList$fieldPath.find(file => (file == null ? void 0 : file.urn) === urn)) || allUploadedFiles.find(file => (file == null ? void 0 : file.urn) === urn);
|
|
12902
|
+
if (rowFile != null && rowFile.urn) {
|
|
12903
|
+
deleteTrigger(rowFile, fieldPath);
|
|
12904
|
+
}
|
|
12905
|
+
});
|
|
12906
|
+
}
|
|
12842
12907
|
if (props.data === 1) {
|
|
12843
12908
|
handleChange(p, null);
|
|
12844
12909
|
setCurrentTab(0);
|
|
@@ -12849,7 +12914,7 @@ const ListWithDetailsControl = props => {
|
|
|
12849
12914
|
}
|
|
12850
12915
|
setOpen(false);
|
|
12851
12916
|
// eslint-disable-next-line
|
|
12852
|
-
}, [
|
|
12917
|
+
}, [core == null ? void 0 : core.data, deleteTrigger, fileList, handleChange, path, props.data, props.schema, removeItems, rowData]);
|
|
12853
12918
|
return jsxs(Visible, {
|
|
12854
12919
|
visible: visible,
|
|
12855
12920
|
children: [jsx(ListWithDetailControl, Object.assign({}, props, {
|
|
@@ -13127,7 +13192,9 @@ const AddressLoopUpControlTableReview = props => {
|
|
|
13127
13192
|
children: "Change"
|
|
13128
13193
|
})]
|
|
13129
13194
|
}), jsxs(ReviewValue, {
|
|
13130
|
-
children: [value
|
|
13195
|
+
children: [!value ? jsx(NoneGivenText, {
|
|
13196
|
+
children: "(none given)"
|
|
13197
|
+
}) : value, errorMessage && jsx(GoabFormItem, {
|
|
13131
13198
|
error: errorMessage,
|
|
13132
13199
|
label: ""
|
|
13133
13200
|
})]
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@abgov/jsonforms-components",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.62.1",
|
|
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-05-
|
|
4
|
-
"sourceCommit": "
|
|
3
|
+
"generatedAt": "2026-05-06T14:39:14.587Z",
|
|
4
|
+
"sourceCommit": "842a3ebd1c86bd3f8762d17073b58fc7a3b33c58",
|
|
5
5
|
"sourcePath": "libs/jsonforms-components/src/index.ts",
|
|
6
6
|
"rendererCount": 33,
|
|
7
7
|
"renderers": [
|
|
@@ -8,5 +8,6 @@ export declare const ReviewHeader: import("styled-components/dist/types").IStyle
|
|
|
8
8
|
export declare const ReviewLabel: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components").FastOmit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, never> & Partial<Pick<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, never>>> & string;
|
|
9
9
|
export declare const ReviewValue: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components").FastOmit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, never> & Partial<Pick<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, never>>> & string;
|
|
10
10
|
export declare const CheckboxWrapper: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components").FastOmit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, never> & Partial<Pick<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, never>>> & string;
|
|
11
|
+
export declare const NoneGivenText: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components").FastOmit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLSpanElement>, HTMLSpanElement>, never> & Partial<Pick<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLSpanElement>, HTMLSpanElement>, never>>> & string;
|
|
11
12
|
export declare const H4Large: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components").FastOmit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLHeadingElement>, HTMLHeadingElement>, never> & Partial<Pick<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLHeadingElement>, HTMLHeadingElement>, never>>> & string;
|
|
12
13
|
export declare const Row: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components").FastOmit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLHeadingElement>, HTMLHeadingElement>, never> & Partial<Pick<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLHeadingElement>, HTMLHeadingElement>, never>>> & string;
|