@abgov/jsonforms-components 2.78.0 → 2.78.2
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
|
@@ -12753,6 +12753,20 @@ function prettify(prop) {
|
|
|
12753
12753
|
* @param names
|
|
12754
12754
|
* @returns A key value of the data attribute name and the uiSchema label value
|
|
12755
12755
|
*/
|
|
12756
|
+
// Top-level property names referenced by any control scope (e.g. "#/properties/address/properties/street" -> "address").
|
|
12757
|
+
const extractScopedProperties = (obj, names = new Set()) => {
|
|
12758
|
+
if (Array.isArray(obj)) {
|
|
12759
|
+
obj.forEach(item => extractScopedProperties(item, names));
|
|
12760
|
+
} else if (typeof obj === 'object' && obj !== null) {
|
|
12761
|
+
const typedObj = obj;
|
|
12762
|
+
const match = typeof typedObj.scope === 'string' ? typedObj.scope.match(/^#\/properties\/([^/]+)/) : null;
|
|
12763
|
+
if (match) {
|
|
12764
|
+
names.add(match[1]);
|
|
12765
|
+
}
|
|
12766
|
+
Object.values(typedObj).forEach(value => extractScopedProperties(value, names));
|
|
12767
|
+
}
|
|
12768
|
+
return names;
|
|
12769
|
+
};
|
|
12756
12770
|
const extractNames = (obj, names = {}) => {
|
|
12757
12771
|
if (Array.isArray(obj)) {
|
|
12758
12772
|
obj.forEach(item => extractNames(item, names));
|
|
@@ -14675,6 +14689,7 @@ const FullNameControlReview = props => {
|
|
|
14675
14689
|
})]
|
|
14676
14690
|
}), showChangeButtons && stepId !== undefined && !((_uischema$options = uischema.options) != null && (_uischema$options = _uischema$options.componentProps) != null && _uischema$options.readOnly) && jsx(GoabButton, {
|
|
14677
14691
|
type: "text",
|
|
14692
|
+
size: "compact",
|
|
14678
14693
|
onClick: () => reportChange(stepId, uischema.scope),
|
|
14679
14694
|
testId: `${fieldName}-change-btn`,
|
|
14680
14695
|
children: "Change"
|
|
@@ -15494,7 +15509,7 @@ const ctxToNonEmptyCellProps = (ctx, ownProps) => {
|
|
|
15494
15509
|
};
|
|
15495
15510
|
};
|
|
15496
15511
|
const NonEmptyCellComponent = /*#__PURE__*/React.memo(function NonEmptyCellComponent(props) {
|
|
15497
|
-
var _schema$properties, _uischema$options, _errors$filter, _uischema$elements;
|
|
15512
|
+
var _schema$properties, _uischema$options, _uischema$options2, _errors$filter, _uischema$elements;
|
|
15498
15513
|
const {
|
|
15499
15514
|
schema,
|
|
15500
15515
|
enabled,
|
|
@@ -15533,6 +15548,9 @@ const NonEmptyCellComponent = /*#__PURE__*/React.memo(function NonEmptyCellCompo
|
|
|
15533
15548
|
});
|
|
15534
15549
|
tableKeys = tempTableKeys;
|
|
15535
15550
|
}
|
|
15551
|
+
// Review only shows properties that have a control in the detail UI schema.
|
|
15552
|
+
const detailProperties = extractScopedProperties(uischema == null || (_uischema$options2 = uischema.options) == null ? void 0 : _uischema$options2.detail);
|
|
15553
|
+
const reviewKeys = detailProperties.size > 0 ? Object.fromEntries(Object.entries(tableKeys).filter(([key]) => detailProperties.has(key))) : tableKeys;
|
|
15536
15554
|
const hasAnyErrors = Array.isArray(errors) ? (errors == null || (_errors$filter = errors.filter(err => {
|
|
15537
15555
|
return err.instancePath.includes(rowPath);
|
|
15538
15556
|
})) == null ? void 0 : _errors$filter.length) > 0 : false;
|
|
@@ -15557,7 +15575,7 @@ const NonEmptyCellComponent = /*#__PURE__*/React.memo(function NonEmptyCellCompo
|
|
|
15557
15575
|
children: range(count || 0).map((i, key) => {
|
|
15558
15576
|
const rowData = data && data[i];
|
|
15559
15577
|
if (!rowData) return null;
|
|
15560
|
-
const hasAnyValue = Object.keys(
|
|
15578
|
+
const hasAnyValue = Object.keys(reviewKeys).some(key => {
|
|
15561
15579
|
const value = rowData[key];
|
|
15562
15580
|
return value !== undefined && value !== null && value !== '';
|
|
15563
15581
|
});
|
|
@@ -15565,7 +15583,7 @@ const NonEmptyCellComponent = /*#__PURE__*/React.memo(function NonEmptyCellCompo
|
|
|
15565
15583
|
if (!hasAnyValue && !hasRowErrors) return null;
|
|
15566
15584
|
return jsx(ReviewItemFrame, {
|
|
15567
15585
|
"data-testid": `${rowPath}.objectList-${key}`,
|
|
15568
|
-
children: Object.entries(
|
|
15586
|
+
children: Object.entries(reviewKeys).map(([key, label]) => {
|
|
15569
15587
|
var _required$includes, _properties$key;
|
|
15570
15588
|
const value = rowData[key];
|
|
15571
15589
|
const isRequiredField = (_required$includes = required == null ? void 0 : required.includes(key)) != null ? _required$includes : false;
|
|
@@ -15797,8 +15815,8 @@ const ObjectArrayList = ({
|
|
|
15797
15815
|
}) => {
|
|
15798
15816
|
const isEmptyList = count === 0;
|
|
15799
15817
|
if (isEmptyList) {
|
|
15800
|
-
var _uischema$options$noD, _uischema$
|
|
15801
|
-
const noDataMessage = (_uischema$options$noD = (_uischema$
|
|
15818
|
+
var _uischema$options$noD, _uischema$options3;
|
|
15819
|
+
const noDataMessage = (_uischema$options$noD = (_uischema$options3 = uischema.options) == null ? void 0 : _uischema$options3.noDataMessage) != null ? _uischema$options$noD : 'No data';
|
|
15802
15820
|
return jsx(EmptyList, {
|
|
15803
15821
|
noDataMessage: noDataMessage,
|
|
15804
15822
|
numColumns: getValidColumnProps(schema).length + 1,
|
|
@@ -15825,7 +15843,7 @@ const ObjectArrayList = ({
|
|
|
15825
15843
|
}, 0);
|
|
15826
15844
|
};
|
|
15827
15845
|
const ObjectArrayControl = props => {
|
|
15828
|
-
var _registers$categories, _registers$categories2, _registers$categories3, _registers$categories4, _uischema$
|
|
15846
|
+
var _registers$categories, _registers$categories2, _registers$categories3, _registers$categories4, _uischema$options6;
|
|
15829
15847
|
const [registers, dispatch] = useReducer(objectListReducer, initialState);
|
|
15830
15848
|
const [open, setOpen] = useState(false);
|
|
15831
15849
|
const [rowData, setRowData] = useState(0);
|
|
@@ -15864,8 +15882,8 @@ const ObjectArrayControl = props => {
|
|
|
15864
15882
|
};
|
|
15865
15883
|
// eslint-disable-next-line
|
|
15866
15884
|
const addItem = (path, value) => {
|
|
15867
|
-
var _uischema$
|
|
15868
|
-
const maxItems = (_uischema$
|
|
15885
|
+
var _uischema$options4, _uischema$options5;
|
|
15886
|
+
const maxItems = (_uischema$options4 = uischema.options) != null && (_uischema$options4 = _uischema$options4.detail) != null && _uischema$options4.maxItems ? (_uischema$options5 = uischema.options) == null || (_uischema$options5 = _uischema$options5.detail) == null ? void 0 : _uischema$options5.maxItems : DEFAULT_MAX_ITEMS;
|
|
15869
15887
|
if (latestCount < maxItems) {
|
|
15870
15888
|
return () => {
|
|
15871
15889
|
const currentRows = hasDataRows ? parsedData : Object.keys(latestData).sort((a, b) => Number(a) - Number(b)).map(key => latestData[key]);
|
|
@@ -15976,11 +15994,11 @@ const ObjectArrayControl = props => {
|
|
|
15976
15994
|
});
|
|
15977
15995
|
}, [parsedData, path]);
|
|
15978
15996
|
const controlElement = uischema;
|
|
15979
|
-
const listTitle = label || ((_uischema$
|
|
15997
|
+
const listTitle = label || ((_uischema$options6 = uischema.options) == null ? void 0 : _uischema$options6.title);
|
|
15980
15998
|
const isInReview = isStepperReview === true;
|
|
15981
15999
|
const isListWithDetail = controlElement.type === 'ListWithDetail';
|
|
15982
16000
|
if (isInReview) {
|
|
15983
|
-
var _uischema$
|
|
16001
|
+
var _uischema$options7, _uischema$options8;
|
|
15984
16002
|
return jsx("tr", {
|
|
15985
16003
|
children: jsxs(PageReviewContainer, {
|
|
15986
16004
|
colSpan: 3,
|
|
@@ -16012,12 +16030,12 @@ const ObjectArrayControl = props => {
|
|
|
16012
16030
|
},
|
|
16013
16031
|
children: maxItemsError
|
|
16014
16032
|
})]
|
|
16015
|
-
}), showChangeButtons && ((_uischema$
|
|
16033
|
+
}), showChangeButtons && ((_uischema$options7 = uischema.options) == null ? void 0 : _uischema$options7.stepId) !== undefined && !((_uischema$options8 = uischema.options) != null && (_uischema$options8 = _uischema$options8.componentProps) != null && _uischema$options8.readOnly) && jsx(GoabButton, {
|
|
16016
16034
|
type: "text",
|
|
16017
16035
|
size: "compact",
|
|
16018
16036
|
onClick: () => {
|
|
16019
|
-
var _uischema$
|
|
16020
|
-
return reportChange((_uischema$
|
|
16037
|
+
var _uischema$options9;
|
|
16038
|
+
return reportChange((_uischema$options9 = uischema.options) == null ? void 0 : _uischema$options9.stepId, uischema.scope);
|
|
16021
16039
|
},
|
|
16022
16040
|
children: "Change"
|
|
16023
16041
|
})]
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@abgov/jsonforms-components",
|
|
3
|
-
"version": "2.78.
|
|
3
|
+
"version": "2.78.2",
|
|
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-09-
|
|
4
|
-
"sourceCommit": "
|
|
3
|
+
"generatedAt": "2026-09-23T23:52:05.299Z",
|
|
4
|
+
"sourceCommit": "86b4cf7192c29968204656413c68bf005f174bf4",
|
|
5
5
|
"sourcePath": "libs/jsonforms-components/src/index.ts",
|
|
6
6
|
"rendererCount": 23,
|
|
7
7
|
"renderers": [
|
|
@@ -7,12 +7,6 @@ interface ContextMenuIconProps {
|
|
|
7
7
|
onClick?: () => void;
|
|
8
8
|
disabled?: boolean;
|
|
9
9
|
}
|
|
10
|
-
interface ContextMenuTextProps {
|
|
11
|
-
type?: GoabIconType;
|
|
12
|
-
testId?: string;
|
|
13
|
-
onClick?: () => void;
|
|
14
|
-
}
|
|
15
10
|
export declare const GoAContextMenuIcon: FC<ContextMenuIconProps>;
|
|
16
|
-
export declare const GoAContextMenuText: FC<ContextMenuTextProps>;
|
|
17
11
|
export declare const GoAContextMenu: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components").FastOmit<React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, never> & Partial<Pick<React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, never>>> & string;
|
|
18
12
|
export {};
|
|
@@ -9,6 +9,7 @@ export declare function prettify(prop: string): string;
|
|
|
9
9
|
* @param names
|
|
10
10
|
* @returns A key value of the data attribute name and the uiSchema label value
|
|
11
11
|
*/
|
|
12
|
+
export declare const extractScopedProperties: (obj: unknown, names?: Set<string>) => Set<string>;
|
|
12
13
|
export declare const extractNames: (obj: unknown, names?: Record<string, string>) => Record<string, string>;
|
|
13
14
|
export interface TableProps {
|
|
14
15
|
itemsSchema: Record<string, unknown>;
|