@abgov/jsonforms-components 1.16.11 → 1.17.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": "1.16.11",
3
+ "version": "1.17.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/src/index.d.ts CHANGED
@@ -1,6 +1,7 @@
1
1
  import { JsonFormsCellRendererRegistryEntry, JsonFormsRendererRegistryEntry } from '@jsonforms/core';
2
2
  export * from './lib/Context';
3
3
  export * from './lib/common';
4
+ export * from './lib/Context/register';
4
5
  export declare const GoABaseRenderers: JsonFormsRendererRegistryEntry[];
5
6
  export declare const GoARenderers: JsonFormsRendererRegistryEntry[];
6
7
  export declare const GoACells: JsonFormsCellRendererRegistryEntry[];
@@ -8,8 +8,6 @@ export interface enumerators {
8
8
  functions: Map<string, () => (file: File, propertyId: string) => void | undefined>;
9
9
  submitFunction: Map<string, () => (id: string) => void | undefined>;
10
10
  addFormContextData: (key: string, data: Record<string, unknown> | unknown[]) => void;
11
- addDataByOptions: (key: string, url: string, location: string[] | string, type: string, values?: string[] | string) => string[];
12
- addDataByUrl: (key: string, url: string, processDataFunction: (data: object) => string[], token?: string) => void;
13
11
  getFormContextData: (key: string) => Record<string, any>;
14
12
  getAllFormContextData: () => AllData;
15
13
  isFormSubmitted: boolean;
@@ -40,8 +38,6 @@ export declare class ContextProviderClass {
40
38
  functions: Map<string, () => ((file: File, propertyId: string) => void) | undefined>;
41
39
  submitFunction: Map<string, () => ((data: any) => void) | undefined>;
42
40
  addFormContextData: (key: string, data: Record<string, unknown> | unknown[]) => void;
43
- addDataByOptions: (key: string, url: string, location: string[] | string, type: string, values?: string[] | string) => void;
44
- addDataByUrl: (key: string, url: string, processDataFunction: (data: object) => string[], token?: string) => void;
45
41
  getFormContextData: (key: string) => Record<string, any> | undefined;
46
42
  getAllFormContextData: () => AllData;
47
43
  isFormSubmitted?: boolean;
@@ -52,7 +48,6 @@ export declare class ContextProviderClass {
52
48
  setup: (props: Props) => import("react/jsx-runtime").JSX.Element | null;
53
49
  getContextProvider: () => import("react/jsx-runtime").JSX.Element;
54
50
  getAxiosInterceptorConfig: (axios: AxiosStatic) => [number, AxiosStatic];
55
- addDataByOptions: (key: string, url: string, location: string[] | string, type: string, values?: string[] | string) => void;
56
51
  /**
57
52
  * Grabs data stored under a given key
58
53
  *
@@ -0,0 +1,22 @@
1
+ import { Dispatch } from 'react';
2
+ export declare const ADD_REGISTER_DATA_ACTION = "jsonforms/register/data/add";
3
+ export interface RegisterConfig {
4
+ urn?: string;
5
+ url?: string;
6
+ name?: string;
7
+ env?: string;
8
+ token?: string;
9
+ responsePrefixPath?: string;
10
+ objectPathInArray?: string;
11
+ }
12
+ export interface RegisterConfigData extends RegisterConfig {
13
+ data?: string[];
14
+ }
15
+ export type RegisterData = RegisterConfigData[];
16
+ type AddDataAction = {
17
+ type: string;
18
+ payload: RegisterConfigData;
19
+ };
20
+ export type RegisterActions = AddDataAction;
21
+ export type JsonFormRegisterDispatch = Dispatch<RegisterActions>;
22
+ export {};
@@ -0,0 +1,3 @@
1
+ export * from './actions';
2
+ export * from './reducer';
3
+ export * from './registerContext';
@@ -0,0 +1,2 @@
1
+ import { RegisterActions, RegisterData } from './actions';
2
+ export declare function registerReducer(registerData: RegisterData, action: RegisterActions): RegisterData;
@@ -0,0 +1,15 @@
1
+ import { ReactNode } from 'react';
2
+ import { RegisterConfig, RegisterData, JsonFormRegisterDispatch } from './actions';
3
+ interface JsonFormsRegisterContextProps {
4
+ registerDispatch: JsonFormRegisterDispatch;
5
+ fetchRegisterByUrl: (registerConfig: RegisterConfig) => Promise<void>;
6
+ selectRegisterDataByUrl: (url: string) => string[];
7
+ isProvided: boolean;
8
+ }
9
+ export declare const JsonFormsRegisterContext: import("react").Context<JsonFormsRegisterContextProps | undefined>;
10
+ interface JsonFormsRegisterProviderProps {
11
+ children: ReactNode;
12
+ defaultRegisters: RegisterConfig[] | RegisterData | undefined;
13
+ }
14
+ export declare const JsonFormRegisterProvider: ({ children, defaultRegisters, }: JsonFormsRegisterProviderProps) => JSX.Element | ReactNode;
15
+ export {};
@@ -0,0 +1,2 @@
1
+ import { RegisterConfig } from './actions';
2
+ export declare const fetchRegister: (props: RegisterConfig) => Promise<any[] | undefined>;
@@ -1,2 +1,9 @@
1
- export declare const resolveLabelFromScope: (scope: string) => string | null;
2
- export declare const getFormFieldValue: (scope: string, data: object) => any;
1
+ import { LabelDescription } from '@jsonforms/core';
2
+ type jsonformsLabel = string | boolean | LabelDescription | undefined;
3
+ export declare const labelToString: (label: jsonformsLabel, scope: string) => string;
4
+ export interface InputValue {
5
+ type: 'primitive' | 'object';
6
+ value?: string[][];
7
+ }
8
+ export declare const getFormFieldValue: (scope: string, data: unknown) => InputValue;
9
+ export {};
@@ -0,0 +1,6 @@
1
+ import { ControlElement } from '@jsonforms/core';
2
+ export interface FileElement extends File {
3
+ filename: string;
4
+ propertyId: string;
5
+ }
6
+ export declare const renderReviewControl: (data: unknown, element: ControlElement, requiredFields: string[], index: number, fileList: Record<string, any>, downloadFile: (file: File, propertyId: string) => void) => JSX.Element | null;
@@ -0,0 +1,2 @@
1
+ import { ControlElement } from '@jsonforms/core';
2
+ export declare const renderReviewListWithDetail: (element: ControlElement, data: any, field: string, index: number, requiredFields: string[]) => JSX.Element;
@@ -4,9 +4,9 @@ import { TranslateProps } from '@jsonforms/react';
4
4
  import { WithInputProps } from './type';
5
5
  import { WithOptionLabel } from '../../util';
6
6
  import { EnumCellProps, WithClassname } from '@jsonforms/core';
7
- type EnumSelectProp = EnumCellProps & WithClassname & TranslateProps & WithInputProps;
8
- export declare const EnumSelect: (props: EnumSelectProp) => JSX.Element;
9
- export declare const numControl: (props: ControlProps & OwnPropsOfEnum & WithOptionLabel & TranslateProps) => import("react/jsx-runtime").JSX.Element;
7
+ type EnumSelectProps = EnumCellProps & WithClassname & TranslateProps & WithInputProps & ControlProps;
8
+ export declare const EnumSelect: (props: EnumSelectProps) => JSX.Element;
9
+ export declare const enumControl: (props: ControlProps & OwnPropsOfEnum & WithOptionLabel & TranslateProps) => import("react/jsx-runtime").JSX.Element;
10
10
  export declare const GoAEnumControlTester: RankedTester;
11
11
  export declare const GoAEnumControl: React.ComponentType<import("@jsonforms/core").OwnPropsOfControl & OwnPropsOfEnum>;
12
12
  export {};
@@ -7,7 +7,6 @@ export * from './InputIntegerControl';
7
7
  export * from './InputDateTimeControl';
8
8
  export * from './InputTimeControl';
9
9
  export * from './InputEnum';
10
- export * from './InputEnumAutoComplete';
11
10
  export * from './InputEnumRadios';
12
11
  export * from './InputBooleanControl';
13
12
  export * from './InputBooleanRadioControl';
@@ -1,10 +0,0 @@
1
- /// <reference types="react" />
2
- import { OwnPropsOfEnum, RankedTester } from '@jsonforms/core';
3
- import { TranslateProps } from '@jsonforms/react';
4
- import { WithInputProps } from './type';
5
- import { EnumCellProps, WithClassname } from '@jsonforms/core';
6
- type EnumSelectAutoCompleteProp = EnumCellProps & WithClassname & TranslateProps & WithInputProps;
7
- export declare const EnumSelectAutoComplete: (props: EnumSelectAutoCompleteProp) => JSX.Element;
8
- export declare const GoAEnumControlAutoCompleteTester: RankedTester;
9
- export declare const GoAEnumAutoCompleteControl: import("react").ComponentType<import("@jsonforms/core").OwnPropsOfControl & OwnPropsOfEnum>;
10
- export {};