@opengeoweb/taf 9.21.0 → 9.23.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": "@opengeoweb/taf",
3
- "version": "9.21.0",
3
+ "version": "9.23.1",
4
4
  "description": "GeoWeb TAF library for the opengeoweb project",
5
5
  "license": "Apache-2.0",
6
6
  "repository": {
@@ -12,7 +12,7 @@
12
12
  "@redux-eggs/redux-toolkit": "^2.2.0",
13
13
  "@opengeoweb/shared": "*",
14
14
  "react-hook-form": "^7.50.1",
15
- "@mui/material": "~5.15.11",
15
+ "@mui/material": "^5.16.0",
16
16
  "@opengeoweb/theme": "*",
17
17
  "@redux-eggs/saga-extension": "^2.2.0",
18
18
  "@opengeoweb/form-fields": "*",
package/src/index.d.ts CHANGED
@@ -4,4 +4,5 @@ export * from './lib/components/TafModule';
4
4
  export { createApi } from './lib/utils/api';
5
5
  export { createApi as createFakeApi } from './lib/utils/fakeApi';
6
6
  export * from './lib/components/ComponentsLookUp';
7
+ export { TAF_NAMESPACE } from './lib/utils/i18n';
7
8
  export { tafTranslations };
@@ -1,7 +1,8 @@
1
1
  import { FieldError, FieldErrors } from 'react-hook-form';
2
+ import { TFunction } from 'i18next';
2
3
  import { CustomErrorField } from './types';
3
4
  export declare const getCustomError: (error: FieldError, isChangeGroup: boolean, rowIndex: number) => CustomErrorField;
4
- export declare const getIssuesLabel: (sumOfErrors: number) => string;
5
+ export declare const getIssuesLabel: (sumOfErrors: number, t: TFunction) => string;
5
6
  export declare const getErrorValues: (fieldErrors: FieldErrors, isChangeGroup?: boolean, rowIndex?: number) => FieldError[];
6
7
  export declare const filterDuplicateErrors: (errors: CustomErrorField[]) => CustomErrorField[];
7
8
  export declare const getErrors: (errors: FieldErrors) => CustomErrorField[];
@@ -9,9 +9,6 @@ export interface TafThemeApiProviderProps {
9
9
  theme?: Theme;
10
10
  store?: Store;
11
11
  }
12
- interface TafTranslationWrapperProps {
13
- children?: React.ReactNode;
14
- }
15
12
  export declare const TafThemeApiProvider: React.FC<TafThemeApiProviderProps>;
16
13
  interface TafThemeFormProviderProps {
17
14
  children: React.ReactNode;
@@ -19,6 +16,4 @@ interface TafThemeFormProviderProps {
19
16
  theme?: Theme;
20
17
  }
21
18
  export declare const TafThemeFormProvider: React.FC<TafThemeFormProviderProps>;
22
- export declare const TafTranslationsWrapper: React.FC<TafTranslationWrapperProps>;
23
- export declare const TafI18nProvider: React.FC<TafTranslationWrapperProps>;
24
19
  export {};
@@ -1,7 +1,6 @@
1
1
  import React from 'react';
2
2
  import { BaseTaf, Taf, TafActions, TafFromBackend, TafFromFrontEnd } from '../../types';
3
3
  import { IssuesPanePosition } from '../IssuesPane/types';
4
- export declare const getSnackbarMessage: (isChecked: boolean, location: string) => string;
5
4
  export interface TafFormProps {
6
5
  isDisabled?: boolean;
7
6
  setIsDisabled?: (isDisabled: boolean) => void;
@@ -1,4 +1,5 @@
1
1
  import Sortable from 'sortablejs';
2
+ import { TFunction } from 'i18next';
2
3
  import { BaseForecast, BaseForecastFormData, ChangeGroup, ChangeGroupFormData, TAC, Taf, TafActions, TafFormData, TafStatus } from '../../types';
3
4
  import { FieldNames } from './TafFormRow/types';
4
5
  import { IssuesPanePosition } from '../IssuesPane/types';
@@ -26,11 +27,7 @@ export declare function parseFormValues<T extends ChangeGroupFormData | BaseFore
26
27
  export declare const convertTafValuesToObject: (formData: TafFormData) => Taf;
27
28
  export declare const shouldRetrieveTAC: (product: Taf) => boolean;
28
29
  export declare const getFieldNames: (isChangeGroup: boolean, index: number) => FieldNames;
29
- export declare const TAC_MISSING_DATA = "Missing data: no TAC can be generated";
30
- export declare const TAC_NOT_AVAILABLE = "No TAC available";
31
- export declare const TAC_RETRIEVING_DATA = "Retrieving TAC";
32
- export declare const TAC_FAILED = "Failed to retrieve TAC";
33
- export declare const tacHasError: (tac: TAC) => boolean;
30
+ export declare const tacHasError: (tac: TAC, t: TFunction) => boolean;
34
31
  export declare const useTACGenerator: (taf: Taf, requestTAC: (postTaf: Taf, getJSON?: boolean, abortSignal?: AbortSignal) => Promise<{
35
32
  data: TAC;
36
33
  }>, getJSON?: boolean) => [TAC, (tafToPost: Taf) => void, (newTAC: TAC) => void];
@@ -43,10 +40,10 @@ export declare const useDragOrder: (trigger: (name?: string | string[]) => Promi
43
40
  onStartDrag: (event: Sortable.SortableEvent) => void;
44
41
  activeDraggingIndex: number | boolean;
45
42
  };
46
- export declare const getConfirmationDialogTitle: (action: TafActions) => string;
43
+ export declare const getConfirmationDialogTitle: (action: TafActions, t: TFunction) => string;
47
44
  export declare const isTafAmendedCorrectedChanged: (originalTaf: Taf, currentTaf: Taf) => boolean;
48
- export declare const getConfirmationDialogContent: (action: TafActions, isFormDirty: () => boolean) => string;
49
- export declare const getConfirmationDialogButtonLabel: (action: TafActions) => string;
45
+ export declare const getConfirmationDialogContent: (action: TafActions, isFormDirty: () => boolean, t: TFunction) => string;
46
+ export declare const getConfirmationDialogButtonLabel: (action: TafActions, t: TFunction) => string;
50
47
  export declare const emptyChangegroup: {
51
48
  valid: string;
52
49
  wind: string;
@@ -65,7 +62,7 @@ export declare const emptyChangegroup: {
65
62
  change: string;
66
63
  probability: string;
67
64
  };
68
- export declare const getTafStatusLabel: (status: TafStatus, action?: TafActions, isFormDisabled?: boolean) => string;
65
+ export declare const getTafStatusLabel: (t: TFunction, status: TafStatus, action?: TafActions, isFormDisabled?: boolean) => string;
69
66
  export declare const getMessageType: (taf: Taf, tafAction: TafActions) => string;
70
67
  export declare const getAmendedCorrectedTafTimes: (taf: Taf, tafAction: TafActions) => Taf;
71
68
  export declare const createChangeGroup: (changeGroup: ChangeGroupFormData) => ChangeGroupFormData;
@@ -1,5 +1,4 @@
1
1
  import React from 'react';
2
- export declare const TOOLTIP_TITLE = "Import TAC";
3
2
  interface ExportButtonProps {
4
3
  onClick: () => void;
5
4
  isHidden: boolean;
@@ -1,6 +1,5 @@
1
1
  import React from 'react';
2
2
  import { Taf } from '../../../types';
3
- export declare const getSnackbarMessage: (location: string, locationLabel: string) => string;
4
3
  interface TacContainerProps {
5
4
  taf: Taf;
6
5
  isActive?: boolean;
@@ -1,12 +1,12 @@
1
1
  import React from 'react';
2
+ import { TFunction } from 'i18next';
2
3
  import { TafFromBackend, TafFromFrontEnd, Taf } from '../../types';
3
- export declare const CONFIRM_DIALOG_OPTIONS: {
4
- title: string;
5
- description: string;
6
- confirmLabel: string;
4
+ export declare const getTafMessageContent: ({ location, validDateStart, messageType, }: Taf) => {
5
+ location: string;
6
+ formattedDate: string;
7
+ messageType: string;
7
8
  };
8
- export declare const getTafMessagePrefix: ({ location, validDateStart, messageType }: Taf, newStatus: string) => string;
9
- export declare const getSnackbarMessage: (tafFromFrontEnd: TafFromFrontEnd, isAutoSaved?: boolean) => string;
9
+ export declare const getSnackbarMessage: (tafFromFrontEnd: TafFromFrontEnd, isAutoSaved: boolean, t: TFunction) => string;
10
10
  interface TafLayoutProps {
11
11
  tafList: TafFromBackend[];
12
12
  onUpdateTaf: () => Promise<TafFromBackend[]>;
@@ -1,5 +1,4 @@
1
1
  import React from 'react';
2
- import { AxiosError } from 'axios';
3
2
  import { TafFromBackend, Taf, TafActions, TafStatus, TafFromFrontEnd } from '../../../types';
4
3
  import { IssuesPanePosition } from '../../IssuesPane/types';
5
4
  export declare const fromActionToStatus: (tafAction: TafActions) => TafStatus;
@@ -26,7 +25,7 @@ interface TafPanelProps {
26
25
  tafAction: TafActions;
27
26
  }
28
27
  export declare const isWarning: (error: TafError) => boolean;
29
- export declare const usePostTafRequest: (request: (params?: unknown) => Promise<void>, errorParser?: (error: AxiosError | Error, params: TafFromFrontEnd) => TafError) => {
28
+ export declare const usePostTafRequest: (request: (params?: unknown) => Promise<void>) => {
30
29
  isLoading: boolean;
31
30
  error: TafError | undefined;
32
31
  setError: (newError: TafError) => void;
@@ -1,2 +1,6 @@
1
+ import i18n from 'i18next';
2
+ import { UseTranslationResponse } from 'react-i18next';
1
3
  export declare const TAF_NAMESPACE = "taf";
2
4
  export declare const initTafI18n: () => void;
5
+ export declare const translateKeyOutsideComponents: (key: string, params?: Record<string, string | number> | undefined) => string;
6
+ export declare const useTafTranslation: () => UseTranslationResponse<typeof TAF_NAMESPACE, typeof i18n>;