@abgov/jsonforms-components 1.33.2 → 1.34.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/index.esm.js +734 -362
- package/package.json +1 -1
- package/src/lib/Context/ContextProvider.d.ts +4 -0
- package/src/lib/Controls/AddressLookup/AddressInputs.d.ts +9 -0
- package/src/lib/Controls/AddressLookup/AddressLookUpControl.d.ts +4 -0
- package/src/lib/Controls/AddressLookup/AddressLookupTester.d.ts +2 -0
- package/src/lib/Controls/AddressLookup/index.d.ts +2 -0
- package/src/lib/Controls/AddressLookup/styled-components.d.ts +1 -0
- package/src/lib/Controls/AddressLookup/types.d.ts +16 -0
- package/src/lib/Controls/AddressLookup/utils.d.ts +4 -0
- package/src/lib/Controls/index.d.ts +1 -0
- package/src/lib/util/stringUtils.d.ts +3 -1
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@abgov/jsonforms-components",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.34.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",
|
|
@@ -11,6 +11,7 @@ export interface enumerators {
|
|
|
11
11
|
getFormContextData: (key: string) => Record<string, any>;
|
|
12
12
|
getAllFormContextData: () => AllData;
|
|
13
13
|
isFormSubmitted: boolean;
|
|
14
|
+
formUrl: string;
|
|
14
15
|
}
|
|
15
16
|
interface FileManagement {
|
|
16
17
|
fileList?: any;
|
|
@@ -27,6 +28,7 @@ type Props = {
|
|
|
27
28
|
submit?: SubmitManagement;
|
|
28
29
|
isFormSubmitted?: boolean;
|
|
29
30
|
data?: any;
|
|
31
|
+
formUrl?: string | null | undefined;
|
|
30
32
|
};
|
|
31
33
|
export declare class ContextProviderClass {
|
|
32
34
|
selfProps: Props | undefined;
|
|
@@ -41,12 +43,14 @@ export declare class ContextProviderClass {
|
|
|
41
43
|
getFormContextData: (key: string) => Record<string, any> | undefined;
|
|
42
44
|
getAllFormContextData: () => AllData;
|
|
43
45
|
isFormSubmitted?: boolean;
|
|
46
|
+
formUrl: string | null | undefined;
|
|
44
47
|
};
|
|
45
48
|
addFormContextData: (key: string, data: Record<string, unknown> | unknown[]) => void;
|
|
46
49
|
addDataByUrl(key: string, url: string, processDataFunction: (data: object) => string[], token?: string): Promise<void>;
|
|
47
50
|
constructor();
|
|
48
51
|
setup: (props: Props) => import("react/jsx-runtime").JSX.Element | null;
|
|
49
52
|
getContextProvider: () => import("react/jsx-runtime").JSX.Element;
|
|
53
|
+
getFormUrl: () => string | null | undefined;
|
|
50
54
|
getAxiosInterceptorConfig: (axios: AxiosStatic) => [number, AxiosStatic];
|
|
51
55
|
/**
|
|
52
56
|
* Grabs data stored under a given key
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { Address } from './types';
|
|
3
|
+
interface AddressInputsProps {
|
|
4
|
+
address: Address;
|
|
5
|
+
handleInputChange: (field: string, value: string) => void;
|
|
6
|
+
isAlbertaAddress?: boolean;
|
|
7
|
+
}
|
|
8
|
+
export declare const AddressInputs: React.FC<AddressInputsProps>;
|
|
9
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const AddressSearch: import("styled-components").StyledComponent<"div", any, {}, never>;
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
export interface Address {
|
|
2
|
+
addressLine1: string;
|
|
3
|
+
addressLine2: string;
|
|
4
|
+
city: string;
|
|
5
|
+
province: string;
|
|
6
|
+
postalCode: string;
|
|
7
|
+
country: string;
|
|
8
|
+
}
|
|
9
|
+
export interface Suggestion {
|
|
10
|
+
Id: string;
|
|
11
|
+
Text: string;
|
|
12
|
+
Highlight: string;
|
|
13
|
+
Cursor: number;
|
|
14
|
+
Description: string;
|
|
15
|
+
Next: string;
|
|
16
|
+
}
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import { Address, Suggestion } from './types';
|
|
2
|
+
export declare const fetchAddressSuggestions: (formUrl: string, searchTerm: string, isAlbertaAddress?: boolean) => Promise<Suggestion[]>;
|
|
3
|
+
export declare const filterAlbertaAddresses: (suggestions: Suggestion[]) => Suggestion[];
|
|
4
|
+
export declare const mapSuggestionToAddress: (suggestion: Suggestion) => Address;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { ControlProps } from '@jsonforms/core';
|
|
1
|
+
import { ControlProps, JsonSchema } from '@jsonforms/core';
|
|
2
2
|
/**
|
|
3
3
|
* Sets the first word to be capitalized so that it is sentence cased.
|
|
4
4
|
* @param words
|
|
@@ -19,6 +19,8 @@ export declare const controlScopeMatchesLabel: (scope: string, label: string) =>
|
|
|
19
19
|
* @returns
|
|
20
20
|
*/
|
|
21
21
|
export declare const getLabelText: (scope: string, label: string) => string;
|
|
22
|
+
export declare const isEmptyBoolean: (schema: JsonSchema, data: unknown) => boolean;
|
|
23
|
+
export declare const isEmptyNumber: (schema: JsonSchema, data: unknown) => boolean;
|
|
22
24
|
export declare const validateSinWithLuhn: (input: number) => boolean;
|
|
23
25
|
/**
|
|
24
26
|
* Check if a required, defined input value is valid. Returns an appropriate
|