@opengeoweb/taf 4.6.1 → 4.7.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.
@@ -9,11 +9,11 @@ export declare const invalidValidityMinutesMessage = "Invalid validity period, s
9
9
  export declare const invalidValidityStartTimeMessage = "Invalid validity start time, change group validity must lie within the TAF validity period";
10
10
  export declare const invalidValidityPeriodMessage = "Invalid validity period, validity end time has to be after validity start time";
11
11
  export declare const invalidValidityEndTimeMessage = "Invalid validity end time, change group validity must lie within the TAF validity period";
12
- export declare const invalidChangeValidInterFieldMessage = "Invalid validity period, expected DDHH/DDHH for BECMG and TEMPO or DDHHmm for FM";
12
+ export declare const invalidChangeValidInterFieldMessage = "Invalid validity period, expected DDHH/DDHH for PROB, BECMG and TEMPO or DDHHmm for FM";
13
13
  export declare const invalidBECMGDurationValidInterFieldMessage = "Invalid validity period, for BECMG only validity periods with a duration of 1, 2, 3 or 4 hours are allowed";
14
14
  export declare const invalidChangeGroupOverlapsWithFM = "The valid time of a change group cannot overlap with the valid time of a following FM group. This change group should end before or at the hour of the start of the FM group";
15
15
  export declare const validateValidField: (value: string, tafStart: string, tafEnd: string) => boolean | string;
16
- export declare const validateValidChangeGroupInterField: (value: string, valueChange: string, tafStart: string, tafEnd: string) => boolean | string;
16
+ export declare const validateValidChangeGroupInterField: (value: string, valueChange: string, valueProb: string, tafStart: string, tafEnd: string) => boolean | string;
17
17
  export declare const invalidPreviousChangeGroupIsBeforeMessage = "Valid time should be after previous valid time";
18
18
  export declare const invalidPreviousChangeGroupOrderMessage: string;
19
19
  export declare const invalidPreviousChangeGroupHasSameValue = "When valid times are equal, probability/change can't have the same value as previous row value";
@@ -36,7 +36,7 @@ export declare type SortableField = {
36
36
  id: string;
37
37
  chosen: boolean;
38
38
  };
39
- export declare const useDragOrder: (trigger: (name?: string | string[]) => Promise<boolean>, move: (oldIndex: number, newIndex: number) => void, onFormBlur: () => void) => {
39
+ export declare const useDragOrder: (trigger: (name?: string | string[]) => Promise<boolean>, move: (oldIndex: number, newIndex: number) => void) => {
40
40
  onChangeOrder: (event: Sortable.SortableEvent) => void;
41
41
  onStartDrag: (event: Sortable.SortableEvent) => void;
42
42
  activeDraggingIndex: number;
@@ -50,22 +50,23 @@ export declare const emptyChangegroup: {
50
50
  wind: string;
51
51
  visibility: string;
52
52
  weather: {
53
- weather1: any;
54
- weather2: any;
55
- weather3: any;
53
+ weather1: string;
54
+ weather2: string;
55
+ weather3: string;
56
56
  };
57
57
  cloud: {
58
- cloud1: any;
59
- cloud2: any;
60
- cloud3: any;
61
- cloud4: any;
58
+ cloud1: string;
59
+ cloud2: string;
60
+ cloud3: string;
61
+ cloud4: string;
62
62
  };
63
- change: any;
64
- probability: any;
63
+ change: string;
64
+ probability: string;
65
65
  };
66
66
  export declare const getTafStatusLabel: (status: TafStatus) => string;
67
67
  export declare const getMessageType: (taf: Taf, tafAction: TafActions) => string;
68
68
  export declare const getAmendedCorrectedTafTimes: (taf: Taf, tafAction: TafActions) => Taf;
69
+ export declare const createChangeGroup: (changeGroup: ChangeGroupFormData) => ChangeGroupFormData;
69
70
  export declare const prepareTafValues: (_taf: Taf, tafAction: TafActions, addEmptyChangeGroup?: boolean) => TafFormData;
70
71
  export declare const getIsFormDefaultDisabled: (status: TafStatus) => boolean;
71
72
  export declare const fromStatusToAction: (tafStatus: TafStatus) => TafActions;
@@ -4,7 +4,7 @@ interface LocationTabsProps {
4
4
  tafList: TafFromBackend[];
5
5
  timeSlot: TimeSlot;
6
6
  activeIndex?: number;
7
- onChangeTab?: (newTabIndex: number) => void;
7
+ onChangeTab?: (newTabIndex: number, isFormDirty: boolean) => void;
8
8
  }
9
9
  declare const LocationTabs: React.FC<LocationTabsProps>;
10
10
  export default LocationTabs;
@@ -4,7 +4,7 @@ import { TafFromBackend, TimeSlot } from '../../../types';
4
4
  interface TopTabsProps {
5
5
  timeSlot: TimeSlot;
6
6
  tafFromBackend: TafFromBackend;
7
- onChangeTimeSlot?: (timeSlot: TimeSlot) => void;
7
+ onChangeTimeSlot?: (timeSlot: TimeSlot, isFormDirty: boolean) => void;
8
8
  }
9
9
  export declare const formatBaseTime: (time: Moment) => string;
10
10
  declare const TopTabs: React.FC<TopTabsProps>;
@@ -1,5 +1,5 @@
1
1
  import * as React from 'react';
2
- import { BaseTaf, TAC, Taf, TafActions } from '../../types';
2
+ import { BaseTaf, TafActions } from '../../types';
3
3
  declare type ValidateFormPromise = () => Promise<void | BaseTaf>;
4
4
  interface TafModuleMethods {
5
5
  onPreventCloseView?: (shouldPreventClose: boolean) => void;
@@ -9,19 +9,14 @@ interface TafModuleContextState {
9
9
  registerValidateForm: (promiseToRegister: ValidateFormPromise) => void;
10
10
  tafAction: TafActions;
11
11
  setTafAction: (action: TafActions) => void;
12
- TAC: TAC;
13
- updateTAC: (taf: Taf) => void;
14
- setTAC: (tac: TAC) => void;
15
- isFormDirty: boolean;
16
- setIsFormDirty: (isDirty: boolean) => void;
12
+ onPreventCloseView: (shouldPreventClose: boolean) => void;
17
13
  }
18
14
  declare const TafModuleContext: React.Context<{
19
15
  onValidateForm: any;
20
16
  registerValidateForm: any;
21
17
  tafAction: any;
22
18
  setTafAction: any;
23
- isFormDirty: any;
24
- setIsFormDirty: any;
19
+ onPreventCloseView: any;
25
20
  }>;
26
21
  export declare const useTafModuleContext: () => Partial<TafModuleContextState>;
27
22
  export declare const useTafModuleState: ({ onPreventCloseView, }: TafModuleMethods) => TafModuleContextState;
package/lib/types.d.ts CHANGED
@@ -141,11 +141,10 @@ export interface TafConfig {
141
141
  locationOrder: string[];
142
142
  }
143
143
  export declare type TimeSlot = 'UPCOMING' | 'ACTIVE' | 'EXPIRED';
144
- export declare type DefaultTAC = string;
145
144
  export declare type AdverseWeatherTAC = {
146
145
  tac: {
147
146
  text: string;
148
147
  type?: string;
149
148
  }[][];
150
149
  };
151
- export declare type TAC = DefaultTAC | AdverseWeatherTAC;
150
+ export declare type TAC = string | AdverseWeatherTAC;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@opengeoweb/taf",
3
- "version": "4.6.1",
3
+ "version": "4.7.1",
4
4
  "description": "GeoWeb TAF library for the opengeoweb project",
5
5
  "license": "Apache-2.0",
6
6
  "repository": {
@@ -12,26 +12,27 @@
12
12
  "typings": "./index.d.ts",
13
13
  "dependencies": {},
14
14
  "peerDependencies": {
15
- "@opengeoweb/core": "4.6.1",
15
+ "@opengeoweb/core": "4.7.1",
16
16
  "react": "^17.0.2",
17
- "@opengeoweb/theme": "4.6.1",
17
+ "@opengeoweb/theme": "4.7.1",
18
18
  "@mui/material": "^5.10.8",
19
19
  "moment": "^2.29.0",
20
20
  "react-redux": "^8.0.4",
21
- "@opengeoweb/webmap": "4.6.1",
21
+ "@opengeoweb/webmap": "4.7.1",
22
22
  "throttle-debounce": "^3.0.1",
23
23
  "proj4": "^2.6.2",
24
24
  "axios": "^0.25.0",
25
- "@opengeoweb/api": "4.6.1",
26
- "@opengeoweb/shared": "4.6.1",
25
+ "@opengeoweb/api": "4.7.1",
26
+ "@opengeoweb/shared": "4.7.1",
27
27
  "react-draggable": "^4.4.5",
28
28
  "re-resizable": "^6.9.0",
29
29
  "@redux-eggs/core": "^2.2.0",
30
- "@opengeoweb/form-fields": "4.6.1",
30
+ "@opengeoweb/form-fields": "4.7.1",
31
31
  "react-hook-form": "^6.12.1",
32
32
  "moment-timezone": "^0.5.31",
33
33
  "@mui/x-date-pickers": "^5.0.4",
34
34
  "lodash": "^4.17.20",
35
+ "date-fns": "^2.29.3",
35
36
  "react-intl": "^5.17.5",
36
37
  "react-sortablejs": "^6.1.4",
37
38
  "sortablejs": "^1.15.0",
@@ -45,7 +46,7 @@
45
46
  "@redux-eggs/redux-toolkit": "^2.2.0",
46
47
  "@redux-eggs/saga-extension": "^2.2.0",
47
48
  "react-dom": "^17.0.2",
48
- "@opengeoweb/authentication": "4.6.1",
49
+ "@opengeoweb/authentication": "4.7.1",
49
50
  "react-router-dom": "^6.4.2",
50
51
  "query-string": "^6.13.7"
51
52
  }