@abgov/jsonforms-components 1.10.0 → 1.10.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/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@abgov/jsonforms-components",
|
|
3
|
-
"version": "1.10.
|
|
3
|
+
"version": "1.10.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",
|
|
@@ -10,14 +10,19 @@ interface FileManagement {
|
|
|
10
10
|
downloadFile?: (file: File) => void;
|
|
11
11
|
deleteFile?: (file: File) => void;
|
|
12
12
|
}
|
|
13
|
+
interface SubmitManagement {
|
|
14
|
+
submitForm?: (any: any) => void;
|
|
15
|
+
}
|
|
13
16
|
type Props = {
|
|
14
17
|
children?: React.ReactNode;
|
|
15
18
|
fileManagement?: FileManagement;
|
|
19
|
+
submit?: SubmitManagement;
|
|
16
20
|
data?: any;
|
|
17
21
|
};
|
|
18
22
|
export declare const JsonFormContext: React.Context<{
|
|
19
23
|
data: Map<string, () => Record<string, any> | string[]>;
|
|
20
24
|
functions: Map<string, () => (file: File, propertyId: string) => void>;
|
|
25
|
+
submitFunction: Map<string, () => (data: any) => void>;
|
|
21
26
|
}>;
|
|
22
27
|
export declare function ContextProvider(props: Props): JSX.Element | null;
|
|
23
28
|
/**
|
|
@@ -3,9 +3,9 @@ import { StatePropsOfLayout } from '@jsonforms/core';
|
|
|
3
3
|
import { TranslateProps } from '@jsonforms/react';
|
|
4
4
|
import { AjvProps } from '@jsonforms/material-renderers';
|
|
5
5
|
export interface CategorizationStepperLayoutRendererProps extends StatePropsOfLayout, AjvProps, TranslateProps {
|
|
6
|
-
data:
|
|
6
|
+
data: unknown;
|
|
7
7
|
}
|
|
8
|
-
export declare const FormStepper: (
|
|
8
|
+
export declare const FormStepper: (props: CategorizationStepperLayoutRendererProps) => JSX.Element;
|
|
9
9
|
export declare const flattenObject: (obj: Record<string, string>) => Record<string, string>;
|
|
10
10
|
export declare const FormStepperControl: (props: CategorizationStepperLayoutRendererProps & import("@jsonforms/core").OwnPropsOfLayout) => React.JSX.Element;
|
|
11
11
|
export default FormStepper;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { Categorization, Category, JsonFormsCellRendererRegistryEntry, JsonFormsRendererRegistryEntry, JsonSchema } from '@jsonforms/core';
|
|
2
|
+
export type CategorizationElement = Category | Categorization;
|
|
3
|
+
export interface StepProps {
|
|
4
|
+
category: CategorizationElement;
|
|
5
|
+
categoryIndex: number;
|
|
6
|
+
step: number;
|
|
7
|
+
schema: JsonSchema;
|
|
8
|
+
enabled: boolean;
|
|
9
|
+
visible: boolean;
|
|
10
|
+
path: string;
|
|
11
|
+
disabledCategoryMap: boolean[];
|
|
12
|
+
renderers: JsonFormsRendererRegistryEntry[] | undefined;
|
|
13
|
+
cells: JsonFormsCellRendererRegistryEntry[] | undefined;
|
|
14
|
+
}
|
|
15
|
+
export declare const RenderStepElements: (props: StepProps) => JSX.Element;
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import { GoAFormStepStatusType } from '@abgov/react-components-new';
|
|
3
|
+
export type StepInputStatus = {
|
|
4
|
+
id: string;
|
|
5
|
+
value: unknown;
|
|
6
|
+
required: boolean;
|
|
7
|
+
type: string | string[] | undefined;
|
|
8
|
+
step: number;
|
|
9
|
+
};
|
|
10
|
+
export interface StatusTable {
|
|
11
|
+
[key: string]: StepInputStatus;
|
|
12
|
+
}
|
|
13
|
+
export declare const StepperContext: import("react").Context<{
|
|
14
|
+
updateStatus: (status: StepInputStatus) => void;
|
|
15
|
+
isInitialized: (_: string) => boolean;
|
|
16
|
+
stepId: number;
|
|
17
|
+
}>;
|
|
18
|
+
export declare const getCompletionStatus: (table: StatusTable, step: number) => GoAFormStepStatusType | undefined;
|
|
19
|
+
export declare const logRequiredFields: (table: StatusTable, step: number) => void;
|