@abgov/jsonforms-components 2.67.0 → 2.67.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
|
@@ -6489,21 +6489,6 @@ function buildConditionalDeps(rootSchema) {
|
|
|
6489
6489
|
return out;
|
|
6490
6490
|
}
|
|
6491
6491
|
|
|
6492
|
-
function getValueAtPath(obj, path) {
|
|
6493
|
-
return path.split('.').reduce((acc, key) => acc == null ? void 0 : acc[key], obj);
|
|
6494
|
-
}
|
|
6495
|
-
function hasMeaningfulValue(val) {
|
|
6496
|
-
if (val === undefined || val === null) return false;
|
|
6497
|
-
if (typeof val === 'string') return val.trim() !== '';
|
|
6498
|
-
if (Array.isArray(val)) return val.length > 0;
|
|
6499
|
-
if (typeof val === 'object') return Object.keys(val).length > 0;
|
|
6500
|
-
return true;
|
|
6501
|
-
}
|
|
6502
|
-
function isStepStarted(normalizedScopes, data) {
|
|
6503
|
-
return normalizedScopes.some(path => {
|
|
6504
|
-
return hasMeaningfulValue(getValueAtPath(data, path));
|
|
6505
|
-
});
|
|
6506
|
-
}
|
|
6507
6492
|
function getSubSchema(schema, path) {
|
|
6508
6493
|
const parts = path.replace(/^#\//, '').split('/').filter(p => p !== 'properties') // remove 'properties' segments
|
|
6509
6494
|
.slice(0, -1);
|
|
@@ -6551,8 +6536,10 @@ function getStepStatus(opts) {
|
|
|
6551
6536
|
data,
|
|
6552
6537
|
visited
|
|
6553
6538
|
} = opts;
|
|
6539
|
+
if (!visited) {
|
|
6540
|
+
return 'NotStarted';
|
|
6541
|
+
}
|
|
6554
6542
|
const normalizedScopes = scopes.map(normalizeSchemaPath).filter(Boolean);
|
|
6555
|
-
const started = isStepStarted(normalizedScopes, data);
|
|
6556
6543
|
const incompleteInStep = getIncompletePaths(errors, scopes);
|
|
6557
6544
|
if (incompleteInStep.length > 0) {
|
|
6558
6545
|
return 'InProgress';
|
|
@@ -6563,21 +6550,27 @@ function getStepStatus(opts) {
|
|
|
6563
6550
|
}
|
|
6564
6551
|
const deps = buildConditionalDeps(schema);
|
|
6565
6552
|
const controllersInStep = normalizedScopes.filter(s => deps.has(s));
|
|
6566
|
-
if (controllersInStep.length === 0)
|
|
6553
|
+
if (controllersInStep.length === 0) {
|
|
6554
|
+
return 'Completed';
|
|
6555
|
+
}
|
|
6567
6556
|
const affected = new Set();
|
|
6568
|
-
for (const
|
|
6569
|
-
for (const
|
|
6557
|
+
for (const controller of controllersInStep) {
|
|
6558
|
+
for (const path of deps.get(controller) || []) {
|
|
6559
|
+
affected.add(path);
|
|
6560
|
+
}
|
|
6561
|
+
}
|
|
6562
|
+
if (affected.size === 0) {
|
|
6563
|
+
return 'Completed';
|
|
6570
6564
|
}
|
|
6571
|
-
if (affected.size === 0) return visited || started ? 'Completed' : 'NotStarted';
|
|
6572
6565
|
const affectedPaths = [...affected];
|
|
6573
6566
|
for (const err of errors || []) {
|
|
6574
|
-
for (const
|
|
6575
|
-
if (affectedPaths.some(
|
|
6567
|
+
for (const candidate of collectErrorCandidates(err)) {
|
|
6568
|
+
if (affectedPaths.some(path => isUnder(candidate, path))) {
|
|
6576
6569
|
return 'InProgress';
|
|
6577
6570
|
}
|
|
6578
6571
|
}
|
|
6579
6572
|
}
|
|
6580
|
-
return
|
|
6573
|
+
return 'Completed';
|
|
6581
6574
|
}
|
|
6582
6575
|
function collectErrorCandidates(e) {
|
|
6583
6576
|
var _e$params;
|
|
@@ -10101,6 +10094,43 @@ class ListWithDetailControl extends React.Component {
|
|
|
10101
10094
|
}
|
|
10102
10095
|
}
|
|
10103
10096
|
|
|
10097
|
+
const REVIEW_CHANGE_ACTION = 'jsonforms/review/change';
|
|
10098
|
+
function reviewReducer(_state, action) {
|
|
10099
|
+
if (action.type === REVIEW_CHANGE_ACTION) {
|
|
10100
|
+
return action.payload;
|
|
10101
|
+
}
|
|
10102
|
+
return null;
|
|
10103
|
+
}
|
|
10104
|
+
const ReviewRenderContext = /*#__PURE__*/createContext(undefined);
|
|
10105
|
+
const ReviewRenderProvider = ({
|
|
10106
|
+
children,
|
|
10107
|
+
onReviewChange
|
|
10108
|
+
}) => {
|
|
10109
|
+
const [reviewChange, dispatch] = useReducer(reviewReducer, null);
|
|
10110
|
+
const onChangeDispatch = useCallback((stepId, scope) => {
|
|
10111
|
+
dispatch({
|
|
10112
|
+
type: REVIEW_CHANGE_ACTION,
|
|
10113
|
+
payload: {
|
|
10114
|
+
stepId,
|
|
10115
|
+
scope
|
|
10116
|
+
}
|
|
10117
|
+
});
|
|
10118
|
+
onReviewChange == null || onReviewChange(stepId, scope);
|
|
10119
|
+
}, [onReviewChange]);
|
|
10120
|
+
const context = useMemo(() => ({
|
|
10121
|
+
isProvided: true,
|
|
10122
|
+
onChangeDispatch,
|
|
10123
|
+
reviewChange
|
|
10124
|
+
}), [onChangeDispatch, reviewChange]);
|
|
10125
|
+
return jsx(ReviewRenderContext.Provider, {
|
|
10126
|
+
value: context,
|
|
10127
|
+
children: children
|
|
10128
|
+
});
|
|
10129
|
+
};
|
|
10130
|
+
const useReviewContext = () => {
|
|
10131
|
+
return useContext(ReviewRenderContext);
|
|
10132
|
+
};
|
|
10133
|
+
|
|
10104
10134
|
const GoAInputBaseTableReview = props => {
|
|
10105
10135
|
var _uischema$options, _uischema$scope2, _jsonForms$core, _uischema$options4, _uischema$options5, _uischema$options6;
|
|
10106
10136
|
const {
|
|
@@ -10117,6 +10147,7 @@ const GoAInputBaseTableReview = props => {
|
|
|
10117
10147
|
visible
|
|
10118
10148
|
} = props;
|
|
10119
10149
|
const context = useContext(JsonFormsStepperContext);
|
|
10150
|
+
const reviewCtx = useReviewContext();
|
|
10120
10151
|
const jsonForms = useJsonForms();
|
|
10121
10152
|
const reviewLabel = typeof ((_uischema$options = uischema.options) == null ? void 0 : _uischema$options.reviewLabel) === 'string' ? uischema.options.reviewLabel : '';
|
|
10122
10153
|
const propLabel = typeof label === 'string' ? label : '';
|
|
@@ -10280,6 +10311,10 @@ const GoAInputBaseTableReview = props => {
|
|
|
10280
10311
|
}
|
|
10281
10312
|
// eslint-disable-next-line
|
|
10282
10313
|
const stepId = (_uischema$options5 = uischema.options) == null ? void 0 : _uischema$options5.stepId;
|
|
10314
|
+
function handleChangeClick() {
|
|
10315
|
+
context == null || context.goToPage(stepId, uischema.scope);
|
|
10316
|
+
reviewCtx == null || reviewCtx.onChangeDispatch(stepId, uischema.scope);
|
|
10317
|
+
}
|
|
10283
10318
|
const showInlineValue = reviewText === null || reviewText === undefined || typeof reviewText === 'string' || typeof reviewText === 'number' || /*#__PURE__*/React.isValidElement(reviewText) || Array.isArray(reviewText) && reviewText.length === 0;
|
|
10284
10319
|
const isValueEmpty = !isBooleanRequiredError && (reviewText === null || reviewText === undefined || reviewText === '' || Array.isArray(reviewText) && reviewText.length === 0);
|
|
10285
10320
|
return jsx("tr", {
|
|
@@ -10294,7 +10329,7 @@ const GoAInputBaseTableReview = props => {
|
|
|
10294
10329
|
}), stepId !== undefined && !((_uischema$options6 = uischema.options) != null && (_uischema$options6 = _uischema$options6.componentProps) != null && _uischema$options6.readOnly) && jsx(GoabButton, {
|
|
10295
10330
|
type: "tertiary",
|
|
10296
10331
|
size: "compact",
|
|
10297
|
-
onClick:
|
|
10332
|
+
onClick: handleChangeClick,
|
|
10298
10333
|
children: "Change"
|
|
10299
10334
|
})]
|
|
10300
10335
|
}), jsxs(ReviewValue, {
|
|
@@ -19249,4 +19284,4 @@ const GoARenderers = [...GoABaseRenderers, {
|
|
|
19249
19284
|
}];
|
|
19250
19285
|
const GoACells = [...InputCells];
|
|
19251
19286
|
|
|
19252
|
-
export { ADD_DATALIST_ACTION, ADD_NO_ANONYMOUS_ACTION, ADD_REGISTER_DATA_ACTION, ADD_REGISTER_DATA_ERROR, ADD_USER_ACTION, AUTO_POPULATE_SOURCES, AddressLookUpControl, AddressLookUpControlReview, AddressLookUpTester, AddressLoopUpControlTableReview, ArrayControl, ArrayControlBase, ArrayControlReview, BooleanComponent, BooleanControl, BooleanRadioComponent, BooleanRadioControl, CategorizationPagesRendererTester, CategorizationStepperRendererTester, CheckboxGroup, ContactInformationTester, ContextProviderC, ContextProviderClass, ContextProviderFactory, ContractInfoControl, ContractInfoControlReview, EnumCheckboxControl, EnumRadioControl, EnumSelect, FileUploader, FileUploaderReview, FileUploaderTester, FormPageStepper, FormPagesView, FormStepper, FormStepperControl, FormStepperPagesControl, FormStepperReviewControl, FormStepperReviewer, FormStepperView, FullNameControl, FullNameControlReview, FullNameDobControl, FullNameDobReviewControl, FullNameDobTester, FullNameReviewControl, FullNameTester, GoAArrayControlRenderer, GoAArrayControlReviewRenderer, GoAArrayControlTester, GoABaseInputReviewComponent, GoABaseRenderers, GoABaseReviewRenderers, GoABaseTableReviewRenderers, GoABooleanControl, GoABooleanControlTester, GoABooleanRadioControl, GoABooleanRadioControlTester, GoACalculationControl, GoACalculationControlTester, GoACells, GoACheckoutGroupControlTester, GoAContractInfoControlReview, GoADateControl, GoADateControlTester, GoADateInput, GoADateTimeControl, GoADateTimeControlTester, GoADateTimeInput, GoAEmailControl, GoAEmailControlTester, GoAEmailInput, GoAEnumCheckboxGroupControl, GoAEnumControl, GoAEnumControlTester, GoAEnumRadioGroupControl, GoAInputBaseControl, GoAInputBaseFullNameControlReview, GoAInputBaseFullNameDobControlReview, GoAInputBaseReviewControl, GoAInputBaseTableReview, GoAInputBaseTableReviewControl, GoAInputDateControl, GoAInputDateTimeControl, GoAInputEmailControl, GoAInputIntegerControl, GoAInputNumberControl, GoAInputText, GoAInputTextControl, GoAInputTimeControl, GoAIntegerControl, GoAIntegerControlTester, GoAListWithDetailsControlRenderer, GoAListWithDetailsTester, GoANumberControl, GoANumberControlTester, GoANumberInput, GoAPhoneNumberControl, GoAPhoneNumberWithTypeControl, GoAPrimitiveArrayRenderer, GoAPrimitiveArrayTester, GoARadioGroupControlTester, GoARenderers, GoAReviewRenderers, GoATextControl, GoATextControlTester, GoATimeControl, GoATimeControlTester, GoATimeInput, GoInputBaseReview, GoabInputBasePhoneNumberReviewControl, GoabInputBasePhoneNumberWithTypeReviewControl, GoabInputInteger, InnerGoAInputText, JsonFormContext, JsonFormRegisterProvider, JsonFormsRegisterContext, ListWithDetailsControl, MultiLineText, MultiLineTextControl, MultiLineTextControlInput, MultiLineTextControlTester, OPTION_DEFINITIONS, PHONE_REGEX, PhoneGrid, PhoneNumberControl, PhoneNumberReviewControl, PhoneNumberTester, PhoneNumberWithTypeControl, PhoneNumberWithTypeReviewControl, PhoneNumberWithTypeTester, PrimitiveArrayControl, RadioGroup, USER_FIELD_DEFINITIONS, autoPopulatePropertiesMonaco, autoPopulateValue, categoriesAreValid, createAutoPopulateMiddleware, createDefaultAjv, enumControl, errMalformedDate, fetchRegisterConfigFromOptions$1 as fetchRegisterConfigFromOptions, formatSin, getAutoPopulateControls, getAutoPopulatedData, getByJsonPointer, getCategoryScopes, hasDataInScopes, hasDataValue, isAddressLookup, isContactInformation, isFullName, isFullNameDoB, isPhoneNumberWithType, mergeAutoPopulatedData, predictiveOptionsMonaco, registerReducer, resolveRefs, toDateTimeLocalInputValue, tryResolveRefs, useRegisterUser };
|
|
19287
|
+
export { ADD_DATALIST_ACTION, ADD_NO_ANONYMOUS_ACTION, ADD_REGISTER_DATA_ACTION, ADD_REGISTER_DATA_ERROR, ADD_USER_ACTION, AUTO_POPULATE_SOURCES, AddressLookUpControl, AddressLookUpControlReview, AddressLookUpTester, AddressLoopUpControlTableReview, ArrayControl, ArrayControlBase, ArrayControlReview, BooleanComponent, BooleanControl, BooleanRadioComponent, BooleanRadioControl, CategorizationPagesRendererTester, CategorizationStepperRendererTester, CheckboxGroup, ContactInformationTester, ContextProviderC, ContextProviderClass, ContextProviderFactory, ContractInfoControl, ContractInfoControlReview, EnumCheckboxControl, EnumRadioControl, EnumSelect, FileUploader, FileUploaderReview, FileUploaderTester, FormPageStepper, FormPagesView, FormStepper, FormStepperControl, FormStepperPagesControl, FormStepperReviewControl, FormStepperReviewer, FormStepperView, FullNameControl, FullNameControlReview, FullNameDobControl, FullNameDobReviewControl, FullNameDobTester, FullNameReviewControl, FullNameTester, GoAArrayControlRenderer, GoAArrayControlReviewRenderer, GoAArrayControlTester, GoABaseInputReviewComponent, GoABaseRenderers, GoABaseReviewRenderers, GoABaseTableReviewRenderers, GoABooleanControl, GoABooleanControlTester, GoABooleanRadioControl, GoABooleanRadioControlTester, GoACalculationControl, GoACalculationControlTester, GoACells, GoACheckoutGroupControlTester, GoAContractInfoControlReview, GoADateControl, GoADateControlTester, GoADateInput, GoADateTimeControl, GoADateTimeControlTester, GoADateTimeInput, GoAEmailControl, GoAEmailControlTester, GoAEmailInput, GoAEnumCheckboxGroupControl, GoAEnumControl, GoAEnumControlTester, GoAEnumRadioGroupControl, GoAInputBaseControl, GoAInputBaseFullNameControlReview, GoAInputBaseFullNameDobControlReview, GoAInputBaseReviewControl, GoAInputBaseTableReview, GoAInputBaseTableReviewControl, GoAInputDateControl, GoAInputDateTimeControl, GoAInputEmailControl, GoAInputIntegerControl, GoAInputNumberControl, GoAInputText, GoAInputTextControl, GoAInputTimeControl, GoAIntegerControl, GoAIntegerControlTester, GoAListWithDetailsControlRenderer, GoAListWithDetailsTester, GoANumberControl, GoANumberControlTester, GoANumberInput, GoAPhoneNumberControl, GoAPhoneNumberWithTypeControl, GoAPrimitiveArrayRenderer, GoAPrimitiveArrayTester, GoARadioGroupControlTester, GoARenderers, GoAReviewRenderers, GoATextControl, GoATextControlTester, GoATimeControl, GoATimeControlTester, GoATimeInput, GoInputBaseReview, GoabInputBasePhoneNumberReviewControl, GoabInputBasePhoneNumberWithTypeReviewControl, GoabInputInteger, InnerGoAInputText, JsonFormContext, JsonFormRegisterProvider, JsonFormsRegisterContext, ListWithDetailsControl, MultiLineText, MultiLineTextControl, MultiLineTextControlInput, MultiLineTextControlTester, OPTION_DEFINITIONS, PHONE_REGEX, PhoneGrid, PhoneNumberControl, PhoneNumberReviewControl, PhoneNumberTester, PhoneNumberWithTypeControl, PhoneNumberWithTypeReviewControl, PhoneNumberWithTypeTester, PrimitiveArrayControl, REVIEW_CHANGE_ACTION, RadioGroup, ReviewRenderContext, ReviewRenderProvider, USER_FIELD_DEFINITIONS, autoPopulatePropertiesMonaco, autoPopulateValue, categoriesAreValid, createAutoPopulateMiddleware, createDefaultAjv, enumControl, errMalformedDate, fetchRegisterConfigFromOptions$1 as fetchRegisterConfigFromOptions, formatSin, getAutoPopulateControls, getAutoPopulatedData, getByJsonPointer, getCategoryScopes, hasDataInScopes, hasDataValue, isAddressLookup, isContactInformation, isFullName, isFullNameDoB, isPhoneNumberWithType, mergeAutoPopulatedData, predictiveOptionsMonaco, registerReducer, resolveRefs, toDateTimeLocalInputValue, tryResolveRefs, useRegisterUser, useReviewContext };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@abgov/jsonforms-components",
|
|
3
|
-
"version": "2.67.
|
|
3
|
+
"version": "2.67.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-06-
|
|
4
|
-
"sourceCommit": "
|
|
3
|
+
"generatedAt": "2026-06-18T16:41:22.993Z",
|
|
4
|
+
"sourceCommit": "935fd9b2672ecf9a0c6019a7163a26a91bdfc5b9",
|
|
5
5
|
"sourcePath": "libs/jsonforms-components/src/index.ts",
|
|
6
6
|
"rendererCount": 33,
|
|
7
7
|
"renderers": [
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { ReactNode } from 'react';
|
|
2
|
+
export declare const REVIEW_CHANGE_ACTION = "jsonforms/review/change";
|
|
3
|
+
export interface ReviewChangeState {
|
|
4
|
+
stepId: number | undefined;
|
|
5
|
+
scope: string;
|
|
6
|
+
}
|
|
7
|
+
export type ReviewChangeAction = {
|
|
8
|
+
type: typeof REVIEW_CHANGE_ACTION;
|
|
9
|
+
payload: ReviewChangeState;
|
|
10
|
+
};
|
|
11
|
+
interface ReviewContext {
|
|
12
|
+
isProvided: boolean;
|
|
13
|
+
onChangeDispatch: (stepId: number | undefined, scope: string) => void;
|
|
14
|
+
reviewChange: ReviewChangeState | null;
|
|
15
|
+
}
|
|
16
|
+
export declare const ReviewRenderContext: import("react").Context<ReviewContext | undefined>;
|
|
17
|
+
interface ReviewRenderProviderProps {
|
|
18
|
+
children: ReactNode;
|
|
19
|
+
onReviewChange?: (stepId: number | undefined, scope: string) => void;
|
|
20
|
+
}
|
|
21
|
+
export declare const ReviewRenderProvider: ({ children, onReviewChange }: ReviewRenderProviderProps) => JSX.Element;
|
|
22
|
+
export declare const useReviewContext: () => ReviewContext | undefined;
|
|
23
|
+
export {};
|