@abgov/jsonforms-components 2.72.0 → 2.73.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/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@abgov/jsonforms-components",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.73.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-08-
|
|
4
|
-
"sourceCommit": "
|
|
3
|
+
"generatedAt": "2026-08-27T22:10:25.781Z",
|
|
4
|
+
"sourceCommit": "8963e4fedf4c8f323ddc21c852273f0d75b2f99f",
|
|
5
5
|
"sourcePath": "libs/jsonforms-components/src/index.ts",
|
|
6
6
|
"rendererCount": 33,
|
|
7
7
|
"renderers": [
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { AxiosStatic } from 'axios';
|
|
3
|
+
import type { NavigationOutcome, NavigationTarget } from '../Controls/FormStepper/util/navigationTarget';
|
|
3
4
|
interface AllData {
|
|
4
5
|
[x: string]: any;
|
|
5
6
|
}
|
|
@@ -29,7 +30,11 @@ export interface AutoPopulatedValue {
|
|
|
29
30
|
path: string;
|
|
30
31
|
value: unknown;
|
|
31
32
|
}
|
|
32
|
-
|
|
33
|
+
export interface ExternalNavigationProps {
|
|
34
|
+
navigationTarget?: NavigationTarget;
|
|
35
|
+
onNavigationChange?: (outcome: NavigationOutcome) => void;
|
|
36
|
+
}
|
|
37
|
+
type Props = ExternalNavigationProps & {
|
|
33
38
|
children?: React.ReactNode;
|
|
34
39
|
fileManagement?: FileManagement;
|
|
35
40
|
submit?: SubmitManagement;
|
|
@@ -59,6 +64,8 @@ export declare class ContextProviderClass {
|
|
|
59
64
|
formUrl: string | null | undefined;
|
|
60
65
|
autoPopulatedData?: AutoPopulatedValue[];
|
|
61
66
|
formId?: string;
|
|
67
|
+
navigationTarget?: NavigationTarget;
|
|
68
|
+
onNavigationChange?: (outcome: NavigationOutcome) => void;
|
|
62
69
|
};
|
|
63
70
|
addFormContextData: (key: string, data: Record<string, unknown> | unknown[]) => void;
|
|
64
71
|
addDataByUrl(key: string, url: string, processDataFunction: (data: object) => string[], token?: string): Promise<void>;
|
|
@@ -2,3 +2,4 @@ export * from './FormStepperControl';
|
|
|
2
2
|
export * from './PageStepperControl';
|
|
3
3
|
export * from './FormStepperTester';
|
|
4
4
|
export * from './FormStepperReviewControl';
|
|
5
|
+
export { getExternalFormPath, getNavigationTargetFromParams, getNavigationTargets, NAVIGATION_PARAMS, type FieldInfo, type FieldTarget, type NavigationOutcome, type NavigationTarget, type NavigationTargetInfo, type PageTarget, } from './util/navigationTarget';
|
|
@@ -0,0 +1,87 @@
|
|
|
1
|
+
import { UISchemaElement } from '@jsonforms/core';
|
|
2
|
+
import { CategoriesState } from '../context/types';
|
|
3
|
+
export interface PageTarget {
|
|
4
|
+
pageId: string;
|
|
5
|
+
}
|
|
6
|
+
export interface FieldTarget {
|
|
7
|
+
pageId?: string;
|
|
8
|
+
/** JSON pointer to the property, e.g. '#/properties/employer'. */
|
|
9
|
+
scope?: string;
|
|
10
|
+
/**
|
|
11
|
+
* Authored `options.id` on the control. Resolved to that control's scope before navigating, so a
|
|
12
|
+
* field id and a scope pointer behave identically from there on — including focus, which controls
|
|
13
|
+
* key off scope.
|
|
14
|
+
*/
|
|
15
|
+
fieldId?: string;
|
|
16
|
+
instancePath?: string;
|
|
17
|
+
}
|
|
18
|
+
export type NavigationTarget = PageTarget | FieldTarget;
|
|
19
|
+
export type NavigationOutcome = {
|
|
20
|
+
status: 'navigated';
|
|
21
|
+
pageId: string;
|
|
22
|
+
} | {
|
|
23
|
+
status: 'unavailable';
|
|
24
|
+
pageId: string;
|
|
25
|
+
reason: 'hidden' | 'disabled' | 'not-yet-reachable';
|
|
26
|
+
} | {
|
|
27
|
+
status: 'unknown';
|
|
28
|
+
requested: NavigationTarget;
|
|
29
|
+
};
|
|
30
|
+
export type NavigationResolution = {
|
|
31
|
+
outcome: Extract<NavigationOutcome, {
|
|
32
|
+
status: 'navigated';
|
|
33
|
+
}>;
|
|
34
|
+
index: number;
|
|
35
|
+
scope?: string;
|
|
36
|
+
} | {
|
|
37
|
+
outcome: Extract<NavigationOutcome, {
|
|
38
|
+
status: 'unavailable';
|
|
39
|
+
}>;
|
|
40
|
+
index: number;
|
|
41
|
+
} | {
|
|
42
|
+
outcome: Extract<NavigationOutcome, {
|
|
43
|
+
status: 'unknown';
|
|
44
|
+
}>;
|
|
45
|
+
};
|
|
46
|
+
export interface FieldInfo {
|
|
47
|
+
scope: string;
|
|
48
|
+
/** Present when the control carries an authored `options.id`. */
|
|
49
|
+
id?: string;
|
|
50
|
+
}
|
|
51
|
+
export interface NavigationTargetInfo {
|
|
52
|
+
pageId: string;
|
|
53
|
+
label?: string;
|
|
54
|
+
authored: boolean;
|
|
55
|
+
index: number;
|
|
56
|
+
fields: FieldInfo[];
|
|
57
|
+
}
|
|
58
|
+
export declare const resolveNavigationTarget: (categories: CategoriesState, target: NavigationTarget) => NavigationResolution;
|
|
59
|
+
export declare const getNavigationTargets: (uischema: UISchemaElement) => NavigationTargetInfo[];
|
|
60
|
+
/**
|
|
61
|
+
* Query parameter names carried by an external navigation link. Exported so a host that has to
|
|
62
|
+
* parse or strip them by hand is not guessing at string literals.
|
|
63
|
+
*/
|
|
64
|
+
export declare const NAVIGATION_PARAMS: {
|
|
65
|
+
readonly page: "page";
|
|
66
|
+
readonly field: "field";
|
|
67
|
+
readonly fieldId: "fieldId";
|
|
68
|
+
};
|
|
69
|
+
/**
|
|
70
|
+
* Builds the link that sends a user from somewhere outside a form to a page or field inside it.
|
|
71
|
+
*
|
|
72
|
+
* Hosts get this for free rather than re-deriving the parameter names and the id-versus-scope rule
|
|
73
|
+
* for every summary or task list they build. A scope whose control carries an authored id is
|
|
74
|
+
* written as that id, which survives the underlying property being renamed.
|
|
75
|
+
*
|
|
76
|
+
* @param uischema the form's ui schema, used to resolve the step index and look up authored ids
|
|
77
|
+
* @param url the form's address in the application that hosts it
|
|
78
|
+
* @param stepId index of the page, as reported by the review renderers
|
|
79
|
+
* @param scope JSON pointer of the field being changed
|
|
80
|
+
* @returns the link, or undefined when neither a page nor a field could be addressed
|
|
81
|
+
*/
|
|
82
|
+
export declare const getExternalFormPath: (uischema: UISchemaElement, url: string, stepId?: number, scope?: string) => string | undefined;
|
|
83
|
+
/**
|
|
84
|
+
* The other half of getExternalFormPath: turns the parameters back into a target for the form to
|
|
85
|
+
* consume. The library still never reads the address bar — the host passes in what it found.
|
|
86
|
+
*/
|
|
87
|
+
export declare const getNavigationTargetFromParams: (params: URLSearchParams) => NavigationTarget | undefined;
|