@opengeoweb/taf 2.5.0 → 2.8.0
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.d.ts +1 -0
- package/index.esm.js +293 -202
- package/index.umd.js +337 -241
- package/lib/components/ComponentsLookUp/ComponentsLookUp.d.ts +34 -0
- package/lib/components/ComponentsLookUp/ComponentsLookUp.spec.d.ts +1 -0
- package/lib/components/ComponentsLookUp/index.d.ts +1 -0
- package/lib/components/Providers/Providers.d.ts +16 -0
- package/lib/components/Providers/index.d.ts +1 -0
- package/lib/components/TafForm/TafForm.d.ts +0 -1
- package/lib/components/TafForm/utils.d.ts +17 -2
- package/lib/components/TafLayout/LocationTabs/LocationTabs.stories.d.ts +2 -2
- package/lib/components/TafLayout/TacOverview/ExportButton.d.ts +1 -1
- package/lib/components/TafLayout/TafPanel/TafPanel.d.ts +1 -2
- package/lib/components/TafLayout/utils.d.ts +0 -15
- package/lib/components/TafModule/TafModule.d.ts +2 -1
- package/lib/components/TafModule/TafModuleProvider.d.ts +14 -4
- package/lib/components/TafWrapper/TafWrapper.d.ts +2 -4
- package/lib/utils/fakeApi.d.ts +1 -1
- package/package.json +7 -7
- package/lib/utils/testUtils.d.ts +0 -25
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import { ApiUrls, Credentials } from '@opengeoweb/api';
|
|
3
|
+
export declare const tafScreenPreset: {
|
|
4
|
+
id: string;
|
|
5
|
+
title: string;
|
|
6
|
+
views: {
|
|
7
|
+
byId: {
|
|
8
|
+
taf: {
|
|
9
|
+
title: string;
|
|
10
|
+
componentType: string;
|
|
11
|
+
initialProps: {};
|
|
12
|
+
};
|
|
13
|
+
};
|
|
14
|
+
allIds: string[];
|
|
15
|
+
};
|
|
16
|
+
syncGroups: any[];
|
|
17
|
+
mosaicNode: string;
|
|
18
|
+
};
|
|
19
|
+
declare type TafComponentType = 'TafModule';
|
|
20
|
+
export interface ComponentsLookUpPayload {
|
|
21
|
+
componentType: TafComponentType;
|
|
22
|
+
id: string;
|
|
23
|
+
title?: string;
|
|
24
|
+
initialProps: Record<string, never>;
|
|
25
|
+
}
|
|
26
|
+
declare type ApiModuleProps = {
|
|
27
|
+
config: ApiUrls;
|
|
28
|
+
auth: Credentials;
|
|
29
|
+
onSetAuth: (credentias: Credentials) => void;
|
|
30
|
+
onPreventCloseView?: (shouldPreventClose: boolean) => void;
|
|
31
|
+
};
|
|
32
|
+
export declare const TafApiWrapper: React.FC<ApiModuleProps>;
|
|
33
|
+
export declare const componentsLookUp: (payload: ComponentsLookUpPayload, { config, auth, onSetAuth }: ApiModuleProps, ConnectedModuleWrapper?: any) => React.ReactElement;
|
|
34
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './ComponentsLookUp';
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import { UseFormOptions } from 'react-hook-form';
|
|
3
|
+
import { Theme } from '@mui/material';
|
|
4
|
+
export interface TafThemeApiProviderProps {
|
|
5
|
+
createApiFunc?: any;
|
|
6
|
+
children: React.ReactNode;
|
|
7
|
+
theme?: Theme;
|
|
8
|
+
}
|
|
9
|
+
export declare const TafThemeApiProvider: React.FC<TafThemeApiProviderProps>;
|
|
10
|
+
interface TafThemeFormProviderProps {
|
|
11
|
+
children: React.ReactNode;
|
|
12
|
+
options?: UseFormOptions;
|
|
13
|
+
theme?: Theme;
|
|
14
|
+
}
|
|
15
|
+
export declare const TafThemeFormProvider: React.FC<TafThemeFormProviderProps>;
|
|
16
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './Providers';
|
|
@@ -6,7 +6,6 @@ export interface TafFormProps {
|
|
|
6
6
|
setIsDisabled?: (isDisabled: boolean) => void;
|
|
7
7
|
tafFromBackend: TafFromBackend;
|
|
8
8
|
onFormAction?: (action: TafActions, formValues?: BaseTaf) => Promise<boolean>;
|
|
9
|
-
onFormDirty?: (isFormDirty: boolean) => void;
|
|
10
9
|
isIssuesPaneOpen?: boolean;
|
|
11
10
|
setIsIssuesPaneOpen?: (isOpen: boolean, position?: IssuesPanePosition) => void;
|
|
12
11
|
}
|
|
@@ -1,6 +1,21 @@
|
|
|
1
1
|
import Sortable from 'sortablejs';
|
|
2
2
|
import { BaseForecast, BaseForecastFormData, ChangeGroup, ChangeGroupFormData, Taf, TafActions, TafFormData, TafStatus } from '../../types';
|
|
3
3
|
import { FieldNames } from './TafFormRow/types';
|
|
4
|
+
export declare const emptyBaseForecast: {
|
|
5
|
+
wind: string;
|
|
6
|
+
visibility: string;
|
|
7
|
+
weather: {
|
|
8
|
+
weather1: string;
|
|
9
|
+
weather2: string;
|
|
10
|
+
weather3: string;
|
|
11
|
+
};
|
|
12
|
+
cloud: {
|
|
13
|
+
cloud1: string;
|
|
14
|
+
cloud2: string;
|
|
15
|
+
cloud3: string;
|
|
16
|
+
cloud4: string;
|
|
17
|
+
};
|
|
18
|
+
};
|
|
4
19
|
export declare const formatIssueTime: (issueDate: string) => string;
|
|
5
20
|
declare type BaseForecastOrChangeGroupFormData<T extends BaseForecast | ChangeGroup> = T extends ChangeGroup ? ChangeGroupFormData : BaseForecastFormData;
|
|
6
21
|
export declare function formatFormValues<T extends BaseForecast | ChangeGroup>(row: T): BaseForecastOrChangeGroupFormData<T>;
|
|
@@ -14,9 +29,9 @@ export declare const TAC_NOT_AVAILABLE = "No TAC available";
|
|
|
14
29
|
export declare const TAC_RETRIEVING_DATA = "Retrieving TAC";
|
|
15
30
|
export declare const TAC_FAILED = "Failed to retrieve TAC";
|
|
16
31
|
export declare const tacHasError: (tac: string) => boolean;
|
|
17
|
-
export declare const useTACGenerator: (taf: Taf, requestTAC: (postTaf: unknown) => Promise<{
|
|
32
|
+
export declare const useTACGenerator: (taf: Taf, requestTAC: (postTaf: unknown, abortSignal?: AbortSignal) => Promise<{
|
|
18
33
|
data: string;
|
|
19
|
-
}
|
|
34
|
+
}>) => [string, (tafToPost: any) => void, (newTAC: string) => void];
|
|
20
35
|
export declare type SortableField = {
|
|
21
36
|
id: string;
|
|
22
37
|
chosen: boolean;
|
|
@@ -3,11 +3,11 @@ declare const _default: {
|
|
|
3
3
|
title: string;
|
|
4
4
|
};
|
|
5
5
|
export default _default;
|
|
6
|
-
export declare const
|
|
6
|
+
export declare const LocationTabsLightTheme: {
|
|
7
7
|
(): React.ReactElement;
|
|
8
8
|
storyName: string;
|
|
9
9
|
};
|
|
10
|
-
export declare const
|
|
10
|
+
export declare const LocationTabsDarkTheme: {
|
|
11
11
|
(): React.ReactElement;
|
|
12
12
|
storyName: string;
|
|
13
13
|
};
|
|
@@ -15,14 +15,13 @@ interface TafPanelProps {
|
|
|
15
15
|
index: number;
|
|
16
16
|
isLoading?: boolean;
|
|
17
17
|
postTaf?: (taf: TafFromFrontEnd) => Promise<void>;
|
|
18
|
-
onFormDirty?: (isFormDirty: boolean) => void;
|
|
19
18
|
isIssuesPaneOpen?: boolean;
|
|
20
19
|
setIsIssuesPaneOpen?: (isOpen: boolean, position?: IssuesPanePosition) => void;
|
|
21
20
|
isFormDisabled?: boolean;
|
|
22
21
|
setIsFormDisabled?: (isDisabled: boolean) => void;
|
|
23
22
|
error?: TafError;
|
|
24
23
|
}
|
|
25
|
-
export declare const usePostTafRequest: (request: (params?: unknown) => Promise<void>, errorParser?: (error: AxiosError, params: TafFromFrontEnd) => TafError) => {
|
|
24
|
+
export declare const usePostTafRequest: (request: (params?: unknown) => Promise<void>, errorParser?: (error: AxiosError | Error, params: TafFromFrontEnd) => TafError) => {
|
|
26
25
|
isLoading: boolean;
|
|
27
26
|
error: TafError;
|
|
28
27
|
setError: (newError: AxiosError) => void;
|
|
@@ -16,19 +16,4 @@ export declare const muiTabA11yProps: (index: number) => {
|
|
|
16
16
|
id: string;
|
|
17
17
|
'aria-controls': string;
|
|
18
18
|
};
|
|
19
|
-
export declare const emptyBaseForecast: {
|
|
20
|
-
wind: string;
|
|
21
|
-
visibility: string;
|
|
22
|
-
weather: {
|
|
23
|
-
weather1: string;
|
|
24
|
-
weather2: string;
|
|
25
|
-
weather3: string;
|
|
26
|
-
};
|
|
27
|
-
cloud: {
|
|
28
|
-
cloud1: string;
|
|
29
|
-
cloud2: string;
|
|
30
|
-
cloud3: string;
|
|
31
|
-
cloud4: string;
|
|
32
|
-
};
|
|
33
|
-
};
|
|
34
19
|
export declare const prepareTafExportValues: (tafToCopy: Taf, currentTaf: TafFormData) => TafFormData;
|
|
@@ -1,22 +1,32 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
|
-
import { BaseTaf, TafActions } from '../../types';
|
|
2
|
+
import { BaseTaf, Taf, TafActions } from '../../types';
|
|
3
3
|
declare type ValidateFormPromise = () => Promise<void | BaseTaf>;
|
|
4
|
+
interface TafModuleMethods {
|
|
5
|
+
onPreventCloseView?: (shouldPreventClose: boolean) => void;
|
|
6
|
+
}
|
|
4
7
|
interface TafModuleContextState {
|
|
5
8
|
onValidateForm: ValidateFormPromise;
|
|
6
9
|
registerValidateForm: (promiseToRegister: ValidateFormPromise) => void;
|
|
7
10
|
tafAction: TafActions;
|
|
8
11
|
setTafAction: (action: TafActions) => void;
|
|
12
|
+
TAC: string;
|
|
13
|
+
updateTAC: (taf: Taf) => void;
|
|
14
|
+
setTAC: (tac: string) => void;
|
|
15
|
+
isFormDirty: boolean;
|
|
16
|
+
setIsFormDirty: (isDirty: boolean) => void;
|
|
9
17
|
}
|
|
10
18
|
declare const TafModuleContext: React.Context<{
|
|
11
19
|
onValidateForm: any;
|
|
12
20
|
registerValidateForm: any;
|
|
13
21
|
tafAction: any;
|
|
14
22
|
setTafAction: any;
|
|
23
|
+
isFormDirty: any;
|
|
24
|
+
setIsFormDirty: any;
|
|
15
25
|
}>;
|
|
16
26
|
export declare const useTafModuleContext: () => Partial<TafModuleContextState>;
|
|
17
|
-
export declare const useTafModuleState: () => TafModuleContextState;
|
|
18
|
-
interface TafModuleProviderProps {
|
|
19
|
-
children
|
|
27
|
+
export declare const useTafModuleState: ({ onPreventCloseView, }: TafModuleMethods) => TafModuleContextState;
|
|
28
|
+
export interface TafModuleProviderProps extends TafModuleMethods {
|
|
29
|
+
children?: React.ReactNode;
|
|
20
30
|
}
|
|
21
31
|
export declare const TafModuleProvider: React.FC<TafModuleProviderProps>;
|
|
22
32
|
export default TafModuleContext;
|
|
@@ -1,6 +1,4 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
}
|
|
5
|
-
declare const TafWrapper: React.FC<TafWrapperProps>;
|
|
2
|
+
import { TafModuleProviderProps } from '../TafModule/TafModuleProvider';
|
|
3
|
+
declare const TafWrapper: React.FC<TafModuleProviderProps>;
|
|
6
4
|
export default TafWrapper;
|
package/lib/utils/fakeApi.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
export declare const fakeTafTac = "TAF EHAM 0812/0918 20020G35KT 0500 SN BKN040\nBECMG 0814/0816 0700 BKN001=";
|
|
2
2
|
export declare const fakeAxiosInstance: {
|
|
3
3
|
get: (_url: any, _params?: any) => Promise<void>;
|
|
4
|
-
post: (_url: any, _params?: any) => Promise<void>;
|
|
4
|
+
post: (_url: any, _params?: any, _signal?: any) => Promise<void>;
|
|
5
5
|
};
|
|
6
6
|
export declare const createApi: () => any;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@opengeoweb/taf",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.8.0",
|
|
4
4
|
"description": "GeoWeb TAF library for the opengeoweb project",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"repository": {
|
|
@@ -14,22 +14,22 @@
|
|
|
14
14
|
"peerDependencies": {
|
|
15
15
|
"react": "^17.0.2",
|
|
16
16
|
"@mui/material": "^5.2.8",
|
|
17
|
-
"
|
|
18
|
-
"
|
|
19
|
-
"@opengeoweb/
|
|
17
|
+
"@opengeoweb/api": "2.8.0",
|
|
18
|
+
"axios": "^0.25.0",
|
|
19
|
+
"@opengeoweb/shared": "2.8.0",
|
|
20
|
+
"@opengeoweb/theme": "2.8.0",
|
|
20
21
|
"@mui/styles": "^5.2.3",
|
|
21
22
|
"@mui/icons-material": "^5.2.5",
|
|
22
23
|
"react-draggable": "^4.4.3",
|
|
23
24
|
"re-resizable": "^6.9.0",
|
|
24
25
|
"lodash": "^4.17.20",
|
|
25
|
-
"@opengeoweb/form-fields": "2.
|
|
26
|
+
"@opengeoweb/form-fields": "2.8.0",
|
|
27
|
+
"react-hook-form": "^6.12.1",
|
|
26
28
|
"moment": "^2.29.0",
|
|
27
29
|
"moment-timezone": "^0.5.31",
|
|
28
30
|
"@mui/lab": "^5.0.0-alpha.64",
|
|
29
|
-
"axios": "^0.25.0",
|
|
30
31
|
"react-dom": "^17.0.2",
|
|
31
32
|
"react-sortablejs": "^6.0.0",
|
|
32
|
-
"@opengeoweb/api": "2.5.0",
|
|
33
33
|
"sortablejs": "^1.14.0"
|
|
34
34
|
}
|
|
35
35
|
}
|
package/lib/utils/testUtils.d.ts
DELETED
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
import * as React from 'react';
|
|
2
|
-
import { UseFormOptions } from 'react-hook-form';
|
|
3
|
-
import { Theme } from '@mui/material';
|
|
4
|
-
interface WrapperProps {
|
|
5
|
-
children: React.ReactNode;
|
|
6
|
-
theme?: Theme;
|
|
7
|
-
}
|
|
8
|
-
export interface TestWrapperProps extends WrapperProps {
|
|
9
|
-
createApiFunc?: () => void;
|
|
10
|
-
}
|
|
11
|
-
export declare const TestWrapper: React.FC<TestWrapperProps>;
|
|
12
|
-
interface ApiTestWrapperProps extends WrapperProps {
|
|
13
|
-
postTaf?: unknown;
|
|
14
|
-
getTafList?: unknown;
|
|
15
|
-
getTAC?: unknown;
|
|
16
|
-
}
|
|
17
|
-
export declare const ApiTestWrapper: React.FC<ApiTestWrapperProps>;
|
|
18
|
-
interface TestFormWrapperProps {
|
|
19
|
-
children: React.ReactNode;
|
|
20
|
-
options?: UseFormOptions;
|
|
21
|
-
theme?: Theme;
|
|
22
|
-
}
|
|
23
|
-
export declare const TestFormWrapper: React.FC<TestFormWrapperProps>;
|
|
24
|
-
export declare const StoryWrapper: React.FC<WrapperProps>;
|
|
25
|
-
export {};
|