@opengeoweb/taf 2.1.4 → 2.3.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.esm.js +376 -257
- package/index.umd.js +397 -272
- package/lib/components/TafForm/TafForm.d.ts +2 -1
- package/lib/components/TafForm/TafFormButtons/TafFormOptionsButton.d.ts +11 -0
- package/lib/components/TafForm/TafFormButtons/TafFormOptionsButton.spec.d.ts +1 -0
- package/lib/components/TafForm/TafFormRow/types.d.ts +3 -2
- package/lib/components/TafForm/TafFormWrapper.stories.d.ts +20 -0
- package/lib/components/TafForm/utils.d.ts +4 -2
- package/lib/components/TafLayout/LocationTabs/LocationTabs.d.ts +10 -0
- package/lib/components/TafLayout/LocationTabs/LocationTabs.spec.d.ts +1 -0
- package/lib/components/TafLayout/LocationTabs/LocationTabs.stories.d.ts +13 -0
- package/lib/components/TafLayout/LocationTabs/index.d.ts +1 -0
- package/lib/components/TafLayout/StatusIcon.d.ts +8 -0
- package/lib/components/TafLayout/StatusIcon.spec.d.ts +1 -0
- package/lib/components/TafLayout/TabPanel/TabPanel.d.ts +8 -0
- package/lib/components/TafLayout/TabPanel/TabPanel.spec.d.ts +1 -0
- package/lib/components/TafLayout/TabPanel/index.d.ts +1 -0
- package/lib/components/TafLayout/TacOverview/TacContainer.d.ts +9 -0
- package/lib/components/TafLayout/TacOverview/TacContainer.spec.d.ts +1 -0
- package/lib/components/TafLayout/TacOverview/TacOverview.d.ts +9 -0
- package/lib/components/TafLayout/TacOverview/TacOverview.spec.d.ts +1 -0
- package/lib/components/TafLayout/TacOverview/TacOverview.stories.d.ts +13 -0
- package/lib/components/TafLayout/TacOverview/index.d.ts +1 -0
- package/lib/components/TafLayout/TafHeader.d.ts +6 -0
- package/lib/components/TafLayout/TafHeader.spec.d.ts +1 -0
- package/lib/components/TafLayout/TafLayout.d.ts +7 -0
- package/lib/components/TafLayout/TafLayout.stories.d.ts +7 -0
- package/lib/components/TafLayout/TopTabs/TopTabs.d.ts +11 -0
- package/lib/components/TafLayout/TopTabs/TopTabs.spec.d.ts +1 -0
- package/lib/components/TafLayout/TopTabs/TopTabs.stories.d.ts +13 -0
- package/lib/components/TafLayout/TopTabs/index.d.ts +1 -0
- package/lib/components/TafLayout/utils.d.ts +18 -0
- package/lib/components/TafLayout/utils.spec.d.ts +1 -0
- package/lib/components/TafList/TafListAccordion.d.ts +1 -1
- package/lib/components/TafList/TafListButtons.d.ts +2 -1
- package/lib/types.d.ts +15 -0
- package/lib/utils/testUtils.d.ts +8 -0
- package/package.json +5 -5
- package/lib/components/TafForm/TafForm.styles.d.ts +0 -1
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import { BaseTaf, TafActions } from '../../types';
|
|
2
|
+
import { BaseTaf, TafActions, TafFromBackend } from '../../types';
|
|
3
3
|
export declare const emptyChangegroup: {
|
|
4
4
|
valid: string;
|
|
5
5
|
wind: string;
|
|
@@ -22,6 +22,7 @@ export interface TafFormProps {
|
|
|
22
22
|
isDisabled: boolean;
|
|
23
23
|
tafAction?: TafActions;
|
|
24
24
|
staticTAC?: string;
|
|
25
|
+
tafFromBackend: TafFromBackend;
|
|
25
26
|
onFormAction?: (action: TafActions, formValues?: BaseTaf) => void;
|
|
26
27
|
}
|
|
27
28
|
declare const TafForm: React.FC<TafFormProps>;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
interface TafFormOptionsButtonProps {
|
|
3
|
+
isChangeGroup: boolean;
|
|
4
|
+
addChangeGroupBelow: () => void;
|
|
5
|
+
addChangeGroupAbove: () => void;
|
|
6
|
+
removeChangeGroup: () => void;
|
|
7
|
+
clearRow: () => void;
|
|
8
|
+
index: number;
|
|
9
|
+
}
|
|
10
|
+
declare const TafFormOptionsButton: React.FC<TafFormOptionsButtonProps>;
|
|
11
|
+
export default TafFormOptionsButton;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -5,9 +5,10 @@ export interface TafFormRowProps extends GridProps {
|
|
|
5
5
|
isChangeGroup?: boolean;
|
|
6
6
|
disabled?: boolean;
|
|
7
7
|
index?: number;
|
|
8
|
-
lastRow?: boolean;
|
|
9
8
|
onRemoveChangeGroup?: (index: number) => void;
|
|
10
|
-
|
|
9
|
+
onAddChangeGroupBelow?: (index: number) => void;
|
|
10
|
+
onAddChangeGroupAbove?: (index: number) => void;
|
|
11
|
+
onClearRow?: (index: number) => void;
|
|
11
12
|
field?: Partial<ArrayField>;
|
|
12
13
|
dragHandle?: React.ReactElement;
|
|
13
14
|
}
|
|
@@ -7,19 +7,39 @@ export declare const NewTafForm: {
|
|
|
7
7
|
(): React.ReactElement;
|
|
8
8
|
storyName: string;
|
|
9
9
|
};
|
|
10
|
+
export declare const NewTafFormDark: {
|
|
11
|
+
(): React.ReactElement;
|
|
12
|
+
storyName: string;
|
|
13
|
+
};
|
|
10
14
|
export declare const EditTafForm: {
|
|
11
15
|
(): React.ReactElement;
|
|
12
16
|
storyName: string;
|
|
13
17
|
};
|
|
18
|
+
export declare const EditTafFormDark: {
|
|
19
|
+
(): React.ReactElement;
|
|
20
|
+
storyName: string;
|
|
21
|
+
};
|
|
14
22
|
export declare const ViewTafForm: {
|
|
15
23
|
(): React.ReactElement;
|
|
16
24
|
storyName: string;
|
|
17
25
|
};
|
|
26
|
+
export declare const ViewTafFormDark: {
|
|
27
|
+
(): React.ReactElement;
|
|
28
|
+
storyName: string;
|
|
29
|
+
};
|
|
18
30
|
export declare const EditTafFormWithMultipleSameStartDates: {
|
|
19
31
|
(): React.ReactElement;
|
|
20
32
|
storyName: string;
|
|
21
33
|
};
|
|
34
|
+
export declare const EditTafFormWithMultipleSameStartDatesDark: {
|
|
35
|
+
(): React.ReactElement;
|
|
36
|
+
storyName: string;
|
|
37
|
+
};
|
|
22
38
|
export declare const EditTafFormWithFMOverlap: {
|
|
23
39
|
(): React.ReactElement;
|
|
24
40
|
storyName: string;
|
|
25
41
|
};
|
|
42
|
+
export declare const EditTafFormWithFMOverlapDark: {
|
|
43
|
+
(): React.ReactElement;
|
|
44
|
+
storyName: string;
|
|
45
|
+
};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import Sortable from 'sortablejs';
|
|
2
|
-
import { BaseForecast, BaseForecastFormData, ChangeGroup, ChangeGroupFormData, Taf, TafActions, TafFormData } from '../../types';
|
|
2
|
+
import { BaseForecast, BaseForecastFormData, ChangeGroup, ChangeGroupFormData, Taf, TafActions, TafFormData, TafStatus } from '../../types';
|
|
3
3
|
import { FieldNames } from './TafFormRow/types';
|
|
4
4
|
export declare const formatIssueTime: (issueDate: string) => string;
|
|
5
5
|
declare type BaseForecastOrChangeGroupFormData<T extends BaseForecast | ChangeGroup> = T extends ChangeGroup ? ChangeGroupFormData : BaseForecastFormData;
|
|
@@ -25,6 +25,8 @@ export declare const useDragOrder: (trigger: (name?: string | string[]) => Promi
|
|
|
25
25
|
activeDraggingIndex: number;
|
|
26
26
|
};
|
|
27
27
|
export declare const getConfirmationDialogTitle: (action: TafActions) => string;
|
|
28
|
-
export declare const
|
|
28
|
+
export declare const isTafAmendedCorrectedChanged: (isFormDirty: boolean, originalTaf: Taf, currentTaf: Taf) => boolean;
|
|
29
|
+
export declare const getConfirmationDialogContent: (action: TafActions, isFormDirty: () => boolean) => string;
|
|
29
30
|
export declare const getConfirmationDialogButtonLabel: (action: TafActions) => string;
|
|
31
|
+
export declare const getTafStatusLabel: (status: TafStatus) => string;
|
|
30
32
|
export {};
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import { TafFromBackend, TimeSlot } from '../../../types';
|
|
3
|
+
interface LocationTabsProps {
|
|
4
|
+
tafList: TafFromBackend[];
|
|
5
|
+
timeSlot: TimeSlot;
|
|
6
|
+
activeIndex?: number;
|
|
7
|
+
onChangeTab?: (newTabIndex: number) => void;
|
|
8
|
+
}
|
|
9
|
+
declare const LocationTabs: React.FC<LocationTabsProps>;
|
|
10
|
+
export default LocationTabs;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
declare const _default: {
|
|
3
|
+
title: string;
|
|
4
|
+
};
|
|
5
|
+
export default _default;
|
|
6
|
+
export declare const TafLayoutLightTheme: {
|
|
7
|
+
(): React.ReactElement;
|
|
8
|
+
storyName: string;
|
|
9
|
+
};
|
|
10
|
+
export declare const TafLayoutDarkTheme: {
|
|
11
|
+
(): React.ReactElement;
|
|
12
|
+
storyName: string;
|
|
13
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default as LocationTabs } from './LocationTabs';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default as TabPanel } from './TabPanel';
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { TafStatus, TimeSlot } from '../../../types';
|
|
3
|
+
interface TacContainerProps {
|
|
4
|
+
timeSlot: TimeSlot;
|
|
5
|
+
status: TafStatus;
|
|
6
|
+
location: string;
|
|
7
|
+
}
|
|
8
|
+
declare const TacContainer: React.FC<TacContainerProps>;
|
|
9
|
+
export default TacContainer;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { TafFromBackend } from '../../../types';
|
|
3
|
+
interface TacOverviewProps {
|
|
4
|
+
upcomingTafs: TafFromBackend[];
|
|
5
|
+
currentTafs: TafFromBackend[];
|
|
6
|
+
expiredTafs: TafFromBackend[];
|
|
7
|
+
}
|
|
8
|
+
declare const TacOverview: React.FC<TacOverviewProps>;
|
|
9
|
+
export default TacOverview;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
declare const _default: {
|
|
3
|
+
title: string;
|
|
4
|
+
};
|
|
5
|
+
export default _default;
|
|
6
|
+
export declare const TacOverviewLightTheme: {
|
|
7
|
+
(): React.ReactElement;
|
|
8
|
+
storyName: string;
|
|
9
|
+
};
|
|
10
|
+
export declare const TacOverviewDarkTheme: {
|
|
11
|
+
(): React.ReactElement;
|
|
12
|
+
storyName: string;
|
|
13
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default as TacOverview } from './TacOverview';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { Moment } from 'moment';
|
|
2
|
+
import React from 'react';
|
|
3
|
+
import { TafFromBackend, TimeSlot } from '../../../types';
|
|
4
|
+
interface TopTabsProps {
|
|
5
|
+
timeSlot: TimeSlot;
|
|
6
|
+
tafFromBackend: TafFromBackend;
|
|
7
|
+
onChangeTimeSlot?: (timeSlot: TimeSlot) => void;
|
|
8
|
+
}
|
|
9
|
+
export declare const formatBaseTime: (time: Moment) => string;
|
|
10
|
+
declare const TopTabs: React.FC<TopTabsProps>;
|
|
11
|
+
export default TopTabs;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
declare const _default: {
|
|
3
|
+
title: string;
|
|
4
|
+
};
|
|
5
|
+
export default _default;
|
|
6
|
+
export declare const TopTabsLightTheme: {
|
|
7
|
+
(): React.ReactElement;
|
|
8
|
+
storyName: string;
|
|
9
|
+
};
|
|
10
|
+
export declare const TopTabsDarkTheme: {
|
|
11
|
+
(): React.ReactElement;
|
|
12
|
+
storyName: string;
|
|
13
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default as TopTabs } from './TopTabs';
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { Moment } from 'moment';
|
|
2
|
+
import { TafConfigLocation, TafConfigLocations, TafFromBackend, TafStatus, TimeSlot } from '../../types';
|
|
3
|
+
export declare const getLocationSetting: (location: string, locationSettings?: TafConfigLocations) => TafConfigLocation;
|
|
4
|
+
export declare const sortTafsOnLocation: (tafList: TafFromBackend[], locationOrder?: string[]) => TafFromBackend[];
|
|
5
|
+
export declare const getBaseTime: (baseTime: string, location: string) => {
|
|
6
|
+
currentBaseTime: Moment;
|
|
7
|
+
nextBaseTime: Moment;
|
|
8
|
+
};
|
|
9
|
+
export declare const getTafTimeSlot: (baseTime: string, location: string, status: TafStatus) => TimeSlot;
|
|
10
|
+
export declare const sortTafTimeSlots: (tafList: TafFromBackend[]) => {
|
|
11
|
+
current: TafFromBackend[];
|
|
12
|
+
upcoming: TafFromBackend[];
|
|
13
|
+
expired: TafFromBackend[];
|
|
14
|
+
};
|
|
15
|
+
export declare const muiTabA11yProps: (index: number) => {
|
|
16
|
+
id: string;
|
|
17
|
+
'aria-controls': string;
|
|
18
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -5,7 +5,7 @@ interface TafListAccordionProps {
|
|
|
5
5
|
tafListItem: TafFromBackend;
|
|
6
6
|
listType: ListState;
|
|
7
7
|
errorCancelTaf?: string[];
|
|
8
|
-
onClickTafActionButton: (
|
|
8
|
+
onClickTafActionButton: (action: TafActions, tafUuid: string) => void;
|
|
9
9
|
}
|
|
10
10
|
declare const TafListAccordion: React.FC<TafListAccordionProps>;
|
|
11
11
|
export default TafListAccordion;
|
|
@@ -3,7 +3,8 @@ import { TafActions, TafCanbe } from '../../types';
|
|
|
3
3
|
interface TafListButtonsProps {
|
|
4
4
|
uuid: string;
|
|
5
5
|
canBe: TafCanbe[];
|
|
6
|
-
onClickTafActionButton: (
|
|
6
|
+
onClickTafActionButton: (action: TafActions, tafUuid: string) => void;
|
|
7
|
+
testId?: string;
|
|
7
8
|
}
|
|
8
9
|
declare const TafListButtons: React.FC<TafListButtonsProps>;
|
|
9
10
|
export default TafListButtons;
|
package/lib/types.d.ts
CHANGED
|
@@ -127,3 +127,18 @@ export interface TafFromFrontEnd {
|
|
|
127
127
|
taf: Taf;
|
|
128
128
|
changeStatusTo: TafStatus;
|
|
129
129
|
}
|
|
130
|
+
/**
|
|
131
|
+
* TAF (json) settings (libs/taf/src/lib/utils/tafConfig.json)
|
|
132
|
+
*/
|
|
133
|
+
export declare type TafConfigLocation = {
|
|
134
|
+
validity_duration: number;
|
|
135
|
+
activity_period: number;
|
|
136
|
+
label: string;
|
|
137
|
+
};
|
|
138
|
+
export declare type TafConfigLocations = Record<string, TafConfigLocation>;
|
|
139
|
+
export interface TafConfig {
|
|
140
|
+
location_indicator_mwo: string;
|
|
141
|
+
locations: TafConfigLocations;
|
|
142
|
+
locationOrder: string[];
|
|
143
|
+
}
|
|
144
|
+
export declare type TimeSlot = 'UPCOMING' | 'ACTIVE' | 'EXPIRED';
|
package/lib/utils/testUtils.d.ts
CHANGED
|
@@ -1,11 +1,13 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
2
|
import { UseFormOptions } from 'react-hook-form';
|
|
3
|
+
import { Theme } from '@mui/material';
|
|
3
4
|
export declare const getActiveStartEndValidSlot: () => {
|
|
4
5
|
start: string;
|
|
5
6
|
end: string;
|
|
6
7
|
};
|
|
7
8
|
interface WrapperProps {
|
|
8
9
|
children: React.ReactNode;
|
|
10
|
+
theme?: Theme;
|
|
9
11
|
}
|
|
10
12
|
interface TestWrapperProps extends WrapperProps {
|
|
11
13
|
createApiFunc?: () => void;
|
|
@@ -14,7 +16,13 @@ export declare const TestWrapper: React.FC<TestWrapperProps>;
|
|
|
14
16
|
interface TestFormWrapperProps {
|
|
15
17
|
children: React.ReactNode;
|
|
16
18
|
options?: UseFormOptions;
|
|
19
|
+
theme?: Theme;
|
|
17
20
|
}
|
|
18
21
|
export declare const TestFormWrapper: React.FC<TestFormWrapperProps>;
|
|
19
22
|
export declare const StoryWrapper: React.FC<WrapperProps>;
|
|
23
|
+
interface ThemeWrapperProps {
|
|
24
|
+
theme?: Theme;
|
|
25
|
+
children: React.ReactNode;
|
|
26
|
+
}
|
|
27
|
+
export declare const StoryWrapperWithTheme: React.FC<ThemeWrapperProps>;
|
|
20
28
|
export {};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@opengeoweb/taf",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.3.0",
|
|
4
4
|
"description": "GeoWeb TAF library for the opengeoweb project",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"repository": {
|
|
@@ -14,21 +14,21 @@
|
|
|
14
14
|
"peerDependencies": {
|
|
15
15
|
"react": "^17.0.2",
|
|
16
16
|
"@mui/material": "^5.2.8",
|
|
17
|
-
"@opengeoweb/theme": "2.
|
|
17
|
+
"@opengeoweb/theme": "2.3.0",
|
|
18
18
|
"@mui/styles": "^5.2.3",
|
|
19
19
|
"@mui/icons-material": "^5.2.5",
|
|
20
20
|
"react-hook-form": "^6.12.1",
|
|
21
|
-
"@opengeoweb/shared": "2.
|
|
21
|
+
"@opengeoweb/shared": "2.3.0",
|
|
22
22
|
"react-draggable": "^4.4.3",
|
|
23
23
|
"re-resizable": "^6.9.0",
|
|
24
24
|
"lodash": "^4.17.20",
|
|
25
|
-
"@opengeoweb/form-fields": "2.
|
|
25
|
+
"@opengeoweb/form-fields": "2.3.0",
|
|
26
26
|
"moment": "^2.29.0",
|
|
27
27
|
"moment-timezone": "^0.5.31",
|
|
28
28
|
"@mui/lab": "^5.0.0-alpha.64",
|
|
29
29
|
"axios": "^0.25.0",
|
|
30
30
|
"react-sortablejs": "^6.0.0",
|
|
31
|
-
"@opengeoweb/api": "2.
|
|
31
|
+
"@opengeoweb/api": "2.3.0",
|
|
32
32
|
"sortablejs": "^1.14.0"
|
|
33
33
|
}
|
|
34
34
|
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export declare const useStyles: (props?: any) => import("@mui/styles/withStyles").ClassNameMap<"textFieldGridItem" | "textFieldRoot" | "textFieldInput" | "textFieldLabel" | "textFieldLabelShrink" | "formRow" | "tacTitle" | "tacText" | "tacLine" | "addButton" | "lifecycleButtons" | "actionButton" | "lastButton" | "backdrop" | "emptyButtonContainer">;
|