@opengeoweb/warnings 12.9.1 → 12.11.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/README.md +6 -0
- package/index.esm.js +1931 -579
- package/package.json +17 -13
- package/src/lib/components/AreaObjectLoader/AreaObjectLoader.stories.d.ts +1 -1
- package/src/lib/components/ComponentsLookUp/ComponentsLookUp.d.ts +10 -3
- package/src/lib/components/DrawingTool/DrawingTool.stories.d.ts +1 -1
- package/src/lib/components/FilterList/ExpandableFilterChip.d.ts +0 -1
- package/src/lib/components/FilterList/filter-utils.d.ts +49 -4
- package/src/lib/components/MaritimeWarningsForm/AreaList/AreaList.d.ts +9 -0
- package/src/lib/components/MaritimeWarningsForm/AreaList/AreaList.spec.d.ts +1 -0
- package/src/lib/components/MaritimeWarningsForm/AreaList/index.d.ts +1 -0
- package/src/lib/components/MaritimeWarningsForm/AssignedAreas/AssignedAreas.d.ts +11 -0
- package/src/lib/components/MaritimeWarningsForm/MaritimeWarningsForm.d.ts +19 -0
- package/src/lib/components/MaritimeWarningsForm/MaritimeWarningsForm.spec.d.ts +2 -0
- package/src/lib/components/MaritimeWarningsForm/MaritimeWarningsForm.stories.d.ts +9 -0
- package/src/lib/components/MaritimeWarningsForm/MaritimeWarningsFormConnect.d.ts +8 -0
- package/src/lib/components/MaritimeWarningsForm/MaritimeWarningsFormConnect.spec.d.ts +1 -0
- package/src/lib/components/MaritimeWarningsForm/MaritimeWarningsFormConnect.stories.d.ts +11 -0
- package/src/lib/components/MaritimeWarningsForm/WarningList/WarningList.d.ts +15 -0
- package/src/lib/components/MaritimeWarningsForm/WarningList/WarningListDragHandle.d.ts +2 -0
- package/src/lib/components/MaritimeWarningsForm/WarningList/WarningListItem.d.ts +14 -0
- package/src/lib/components/MaritimeWarningsForm/WarningList/WarningListSelect.d.ts +19 -0
- package/src/lib/components/MaritimeWarningsForm/WarningList/WindForceSelect.d.ts +22 -0
- package/src/lib/components/MaritimeWarningsForm/areas.d.ts +2 -0
- package/src/lib/components/MaritimeWarningsForm/index.d.ts +1 -0
- package/src/lib/components/MaritimeWarningsForm/options.d.ts +5 -0
- package/src/lib/components/MaritimeWarningsForm/types.d.ts +15 -0
- package/src/lib/components/MaritimeWarningsForm/useConfirmRetractDialog.d.ts +11 -0
- package/src/lib/components/MaritimeWarningsForm/useMaritimeWarningsFormState.d.ts +53 -0
- package/src/lib/components/MaritimeWarningsForm/useMaritimeWarningsFormState.spec.d.ts +1 -0
- package/src/lib/components/MaritimeWarningsForm/utils.d.ts +2 -0
- package/src/lib/components/MaritimeWarningsForm/utils.spec.d.ts +1 -0
- package/src/lib/components/ObjectManager/ObjectManager.stories.d.ts +17 -18
- package/src/lib/components/ObjectManager/ObjectManagerConnect.stories.d.ts +1 -1
- package/src/lib/components/PublicWarningList/NewWarningButton/NewWarningButton.stories.d.ts +1 -1
- package/src/lib/components/PublicWarningList/PublicWarningListConnect.stories.d.ts +2 -2
- package/src/lib/components/PublicWarningsForm/AreaField/AreaField.stories.d.ts +2 -3
- package/src/lib/components/PublicWarningsForm/DescriptionField/DescriptionField.stories.d.ts +1 -1
- package/src/lib/components/PublicWarningsForm/PublicWarningsForm.stories.d.ts +1 -1
- package/src/lib/components/PublicWarningsFormDialog/PublicWarningsFormDialog.d.ts +3 -3
- package/src/lib/components/PublicWarningsFormDialog/PublicWarningsFormDialog.stories.d.ts +1 -1
- package/src/lib/store/publicWarningForm/types.d.ts +1 -1
- package/src/lib/utils/sig-airmet-util.d.ts +3 -3
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@opengeoweb/warnings",
|
|
3
|
-
"version": "12.
|
|
3
|
+
"version": "12.11.0",
|
|
4
4
|
"description": "GeoWeb warinings library for the opengeoweb project",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"repository": {
|
|
@@ -8,37 +8,41 @@
|
|
|
8
8
|
"url": "git@gitlab.com:opengeoweb/opengeoweb.git"
|
|
9
9
|
},
|
|
10
10
|
"dependencies": {
|
|
11
|
-
"@opengeoweb/api": "12.
|
|
12
|
-
"@opengeoweb/shared": "12.
|
|
13
|
-
"@opengeoweb/store": "12.
|
|
14
|
-
"@opengeoweb/webmap-react": "12.
|
|
11
|
+
"@opengeoweb/api": "12.11.0",
|
|
12
|
+
"@opengeoweb/shared": "12.11.0",
|
|
13
|
+
"@opengeoweb/store": "12.11.0",
|
|
14
|
+
"@opengeoweb/webmap-react": "12.11.0",
|
|
15
15
|
"@tanstack/react-query": "^5.69.2",
|
|
16
16
|
"react-redux": "^9.2.0",
|
|
17
|
-
"@opengeoweb/theme": "12.
|
|
18
|
-
"@opengeoweb/form-fields": "12.
|
|
17
|
+
"@opengeoweb/theme": "12.11.0",
|
|
18
|
+
"@opengeoweb/form-fields": "12.11.0",
|
|
19
19
|
"react-hook-form": "^7.50.1",
|
|
20
20
|
"lodash": "^4.17.21",
|
|
21
21
|
"@reduxjs/toolkit": "^2.6.1",
|
|
22
|
-
"@opengeoweb/snackbar": "12.
|
|
22
|
+
"@opengeoweb/snackbar": "12.11.0",
|
|
23
23
|
"react-window": "^1.8.10",
|
|
24
24
|
"react-virtualized-auto-sizer": "^1.0.20",
|
|
25
25
|
"axios": "^1.7.7",
|
|
26
|
-
"@opengeoweb/core": "12.
|
|
27
|
-
"@opengeoweb/webmap": "12.
|
|
28
|
-
"@opengeoweb/authentication": "12.
|
|
29
|
-
"@opengeoweb/sigmet-airmet": "12.
|
|
26
|
+
"@opengeoweb/core": "12.11.0",
|
|
27
|
+
"@opengeoweb/webmap": "12.11.0",
|
|
28
|
+
"@opengeoweb/authentication": "12.11.0",
|
|
29
|
+
"@opengeoweb/sigmet-airmet": "12.11.0",
|
|
30
30
|
"react-i18next": "^15.1.1",
|
|
31
31
|
"i18next": "^25.0.1",
|
|
32
32
|
"@mui/material": "^7.0.1",
|
|
33
33
|
"ol": "^10.4.0",
|
|
34
34
|
"msw": "^2.7.3",
|
|
35
|
-
"@types/geojson": "^7946.0.14"
|
|
35
|
+
"@types/geojson": "^7946.0.14",
|
|
36
|
+
"react-sortablejs": "^6.1.4"
|
|
36
37
|
},
|
|
37
38
|
"peerDependencies": {
|
|
38
39
|
"react": "18",
|
|
39
40
|
"@emotion/react": "*",
|
|
40
41
|
"@emotion/styled": "*"
|
|
41
42
|
},
|
|
43
|
+
"devDependencies": {
|
|
44
|
+
"eslint-plugin-storybook": "9.0.17"
|
|
45
|
+
},
|
|
42
46
|
"module": "./index.esm.js",
|
|
43
47
|
"type": "module",
|
|
44
48
|
"main": "./index.esm.js",
|
|
@@ -1,13 +1,20 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
2
|
import { ApiModule, ApiUrls } from '@opengeoweb/api';
|
|
3
|
-
|
|
3
|
+
import { PickedFilterState } from '../FilterList/filter-hooks';
|
|
4
|
+
import { MaritimeWarningsDomain } from '../MaritimeWarningsForm/types';
|
|
5
|
+
export type WarningListComponentType = 'WarningList' | 'MaritimeWarnings';
|
|
6
|
+
interface WarningsInitialProps {
|
|
7
|
+
filterState?: PickedFilterState;
|
|
8
|
+
domain?: MaritimeWarningsDomain;
|
|
9
|
+
}
|
|
4
10
|
export interface ComponentsLookUpPayload {
|
|
5
11
|
componentType: WarningListComponentType;
|
|
6
12
|
id: string;
|
|
7
13
|
title?: string;
|
|
8
|
-
initialProps:
|
|
14
|
+
initialProps: WarningsInitialProps;
|
|
9
15
|
}
|
|
10
16
|
export interface ApiModuleProps extends ApiModule {
|
|
11
17
|
config: ApiUrls;
|
|
12
18
|
}
|
|
13
|
-
export declare const componentsLookUp: (payload: ComponentsLookUpPayload) => React.ReactElement;
|
|
19
|
+
export declare const componentsLookUp: (payload: ComponentsLookUpPayload, ComponentsLookUpWrapper?: any) => React.ReactElement;
|
|
20
|
+
export {};
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { AirmetPhenomena, SigmetPhenomena } from '@opengeoweb/api';
|
|
1
2
|
import { Warning } from '../../store/publicWarningForm/types';
|
|
2
3
|
export declare enum Domain {
|
|
3
4
|
aviation = "aviation",
|
|
@@ -26,8 +27,52 @@ export declare const defaultDomainFilter: Record<Domain, boolean>;
|
|
|
26
27
|
export declare const domainLevels: Record<Domain, Level[]>;
|
|
27
28
|
export declare const defaultLevelFilter: Record<Level | 'unspecified', boolean>;
|
|
28
29
|
export declare const defaultEmptyFilter: Record<string, boolean>;
|
|
29
|
-
export declare const makeFilterFromList: <T extends string>(options: T[], value?: boolean) => Record<T |
|
|
30
|
-
|
|
30
|
+
export declare const makeFilterFromList: <T extends string>(options: T[], value?: boolean) => Record<T | "unspecified", boolean>;
|
|
31
|
+
declare const AllPhenomena: {
|
|
32
|
+
readonly wind: Phenomenon.wind;
|
|
33
|
+
readonly fog: Phenomenon.fog;
|
|
34
|
+
readonly thunderstorm: Phenomenon.thunderstorm;
|
|
35
|
+
readonly snowIce: Phenomenon.snowIce;
|
|
36
|
+
readonly rain: Phenomenon.rain;
|
|
37
|
+
readonly highTemp: Phenomenon.highTemp;
|
|
38
|
+
readonly lowTemp: Phenomenon.lowTemp;
|
|
39
|
+
readonly coastalEvent: Phenomenon.coastalEvent;
|
|
40
|
+
readonly EMBD_TS: SigmetPhenomena.EMBD_TS;
|
|
41
|
+
readonly EMBD_TSGR: SigmetPhenomena.EMBD_TSGR;
|
|
42
|
+
readonly FRQ_TS: SigmetPhenomena.FRQ_TS;
|
|
43
|
+
readonly FRQ_TSGR: SigmetPhenomena.FRQ_TSGR;
|
|
44
|
+
readonly HVY_DS: SigmetPhenomena.HVY_DS;
|
|
45
|
+
readonly HVY_SS: SigmetPhenomena.HVY_SS;
|
|
46
|
+
readonly OBSC_TS: SigmetPhenomena.OBSC_TS;
|
|
47
|
+
readonly OBSC_TSGR: SigmetPhenomena.OBSC_TSGR;
|
|
48
|
+
readonly RDOACT_CLD: SigmetPhenomena.RDOACT_CLD;
|
|
49
|
+
readonly SEV_ICE: SigmetPhenomena.SEV_ICE;
|
|
50
|
+
readonly SEV_ICE_FRZ_RN: SigmetPhenomena.SEV_ICE_FRZ_RN;
|
|
51
|
+
readonly SEV_MTW: SigmetPhenomena.SEV_MTW;
|
|
52
|
+
readonly SEV_TURB: SigmetPhenomena.SEV_TURB;
|
|
53
|
+
readonly SQL_TS: SigmetPhenomena.SQL_TS;
|
|
54
|
+
readonly SQL_TSGR: SigmetPhenomena.SQL_TSGR;
|
|
55
|
+
readonly VA_CLD: SigmetPhenomena.VA_CLD;
|
|
56
|
+
readonly SFC_VIS: AirmetPhenomena.SFC_VIS;
|
|
57
|
+
readonly SFC_WIND: AirmetPhenomena.SFC_WIND;
|
|
58
|
+
readonly OVC_CLD: AirmetPhenomena.OVC_CLD;
|
|
59
|
+
readonly BKN_CLD: AirmetPhenomena.BKN_CLD;
|
|
60
|
+
readonly ISOL_CB: AirmetPhenomena.ISOL_CB;
|
|
61
|
+
readonly OCNL_CB: AirmetPhenomena.OCNL_CB;
|
|
62
|
+
readonly FRQ_CB: AirmetPhenomena.FRQ_CB;
|
|
63
|
+
readonly ISOL_TS: AirmetPhenomena.ISOL_TS;
|
|
64
|
+
readonly OCNL_TS: AirmetPhenomena.OCNL_TS;
|
|
65
|
+
readonly ISOL_TSGR: AirmetPhenomena.ISOL_TSGR;
|
|
66
|
+
readonly OCNL_TSGR: AirmetPhenomena.OCNL_TSGR;
|
|
67
|
+
readonly ISOL_TCU: AirmetPhenomena.ISOL_TCU;
|
|
68
|
+
readonly OCNL_TCU: AirmetPhenomena.OCNL_TCU;
|
|
69
|
+
readonly FRQ_TCU: AirmetPhenomena.FRQ_TCU;
|
|
70
|
+
readonly MOD_ICE: AirmetPhenomena.MOD_ICE;
|
|
71
|
+
readonly MOD_MTW: AirmetPhenomena.MOD_MTW;
|
|
72
|
+
readonly MOD_TURB: AirmetPhenomena.MOD_TURB;
|
|
73
|
+
readonly MT_OBSC: AirmetPhenomena.MT_OBSC;
|
|
74
|
+
};
|
|
75
|
+
export declare const AllPhenomenaKeys: Record<keyof typeof AllPhenomena, keyof typeof AllPhenomena>;
|
|
31
76
|
export declare const domainPhenomena: Record<Domain, Partial<keyof typeof AllPhenomenaKeys>[]>;
|
|
32
77
|
export declare const defaultPhenomenonFilter: Record<string, boolean>;
|
|
33
78
|
export declare const initialFilters: {
|
|
@@ -45,8 +90,8 @@ interface OptionsMetadata {
|
|
|
45
90
|
allSelected: boolean;
|
|
46
91
|
}
|
|
47
92
|
export declare const getSelectedOptions: (options?: OptionsType) => OptionsMetadata;
|
|
48
|
-
export declare const updateState: <T extends string>(state: Record<T, boolean>, optionKey: T |
|
|
93
|
+
export declare const updateState: <T extends string>(state: Record<T, boolean>, optionKey: T | "ALL", value: boolean, only?: boolean) => Record<T, boolean>;
|
|
49
94
|
/** Make sure our value is in the filter */
|
|
50
|
-
export declare const getValue: <T>(values: Record<string, T>, value: string) => T |
|
|
95
|
+
export declare const getValue: <T>(values: Record<string, T>, value: string) => T | "unspecified";
|
|
51
96
|
export declare const getFiltersFromWarnings: (warnings: Warning[], filterKey: string) => string[];
|
|
52
97
|
export {};
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { Area } from '../types';
|
|
3
|
+
export interface AreaListProps {
|
|
4
|
+
areas: Area[];
|
|
5
|
+
selected: string[];
|
|
6
|
+
disabled: string[];
|
|
7
|
+
onClickItem?: (id: string) => void;
|
|
8
|
+
}
|
|
9
|
+
export declare const AreaList: React.MemoExoticComponent<({ areas, selected, disabled, onClickItem }: AreaListProps) => import("react/jsx-runtime").JSX.Element>;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './AreaList';
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { Area } from '../types';
|
|
3
|
+
export interface AssignedAreasProps {
|
|
4
|
+
assignedAreas: Area[];
|
|
5
|
+
selectedAreaIds: string[];
|
|
6
|
+
onAddClick: () => void;
|
|
7
|
+
onDeleteClick: (id: string) => void;
|
|
8
|
+
onToggleSelectArea: (id: string) => void;
|
|
9
|
+
shouldShowDistricts?: boolean;
|
|
10
|
+
}
|
|
11
|
+
export declare const AssignedAreas: React.FC<AssignedAreasProps>;
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import type { MaritimeWarningItem, Area, MaritimeWarningItemAttributes } from './types';
|
|
3
|
+
export interface MaritimeWarningsFormProps {
|
|
4
|
+
areas: Area[];
|
|
5
|
+
selectedAreaIds: string[];
|
|
6
|
+
warnings: MaritimeWarningItem[];
|
|
7
|
+
modified: boolean;
|
|
8
|
+
onToggleSelectArea: (id: string) => void;
|
|
9
|
+
onAddSelectedAreas: (id: string) => void;
|
|
10
|
+
onRemoveWarning: (id: string) => void;
|
|
11
|
+
onRemoveArea: (id: string) => void;
|
|
12
|
+
onAddWarning: () => void;
|
|
13
|
+
onChangeWarning: (id: string, newValues: Partial<MaritimeWarningItemAttributes>) => void;
|
|
14
|
+
onMoveWarning: (oldIndex: number, newIndex: number) => void;
|
|
15
|
+
onSubmit: () => void;
|
|
16
|
+
onClear: () => void;
|
|
17
|
+
shouldShowDistricts?: boolean;
|
|
18
|
+
}
|
|
19
|
+
export declare const MaritimeWarningsForm: React.FC<MaritimeWarningsFormProps>;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { StoryObj, Meta } from '@storybook/react-webpack5';
|
|
2
|
+
import { MaritimeWarningsForm } from './MaritimeWarningsForm';
|
|
3
|
+
type Story = StoryObj<typeof MaritimeWarningsForm>;
|
|
4
|
+
declare const meta: Meta<typeof MaritimeWarningsForm>;
|
|
5
|
+
export default meta;
|
|
6
|
+
export declare const LightMode: Story;
|
|
7
|
+
export declare const DarkMode: Story;
|
|
8
|
+
export declare const MaritimeWarningsFormMobileLight: Story;
|
|
9
|
+
export declare const MaritimeWarningsFormMobileDark: Story;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { MaritimeWarningsDomain } from './types';
|
|
3
|
+
export interface MaritimeWarningsFormConnectProps {
|
|
4
|
+
domain: MaritimeWarningsDomain;
|
|
5
|
+
onPreventCloseView?: (on: boolean) => void;
|
|
6
|
+
onModifyForm?: (isFormDirty: boolean) => void;
|
|
7
|
+
}
|
|
8
|
+
export declare const MaritimeWarningsFormConnect: React.FC<MaritimeWarningsFormConnectProps>;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { StoryObj, Meta } from '@storybook/react-webpack5';
|
|
2
|
+
import React from 'react';
|
|
3
|
+
import { MaritimeWarningsFormConnectProps } from './MaritimeWarningsFormConnect';
|
|
4
|
+
declare const MaritimeWarningsFormConnectDemo: React.FC<MaritimeWarningsFormConnectProps>;
|
|
5
|
+
type Story = StoryObj<typeof MaritimeWarningsFormConnectDemo>;
|
|
6
|
+
declare const meta: Meta<typeof MaritimeWarningsFormConnectDemo>;
|
|
7
|
+
export default meta;
|
|
8
|
+
export declare const LightMode: Story;
|
|
9
|
+
export declare const DarkMode: Story;
|
|
10
|
+
export declare const CoastalWatersLight: Story;
|
|
11
|
+
export declare const CoastalWatersDark: Story;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { Area, MaritimeWarningItem, MaritimeWarningItemAttributes } from '../types';
|
|
3
|
+
export interface WarningListProps {
|
|
4
|
+
warnings: MaritimeWarningItem[];
|
|
5
|
+
onAddSelectedAreas: (id: string) => void;
|
|
6
|
+
onRemoveArea: (areaId: string) => void;
|
|
7
|
+
onRemoveWarning: (id: string) => void;
|
|
8
|
+
onChangeWarning: (id: string, newValues: Partial<MaritimeWarningItemAttributes>) => void;
|
|
9
|
+
onToggleSelectArea: (areaId: string) => void;
|
|
10
|
+
onMoveWarning: (oldIndex: number, newIndex: number) => void;
|
|
11
|
+
selectedAreaIds: string[];
|
|
12
|
+
areas: Area[];
|
|
13
|
+
shouldShowDistricts?: boolean;
|
|
14
|
+
}
|
|
15
|
+
export declare const WarningList: React.FC<WarningListProps>;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { Area, MaritimeWarningItem, MaritimeWarningItemAttributes } from '../types';
|
|
3
|
+
export interface WarningListItemProps {
|
|
4
|
+
warning: MaritimeWarningItem;
|
|
5
|
+
areas: Area[];
|
|
6
|
+
selectedAreaIds: string[];
|
|
7
|
+
onAddClick: (id: string) => void;
|
|
8
|
+
onRemove: (id: string) => void;
|
|
9
|
+
onChange: (id: string, values: MaritimeWarningItemAttributes) => void;
|
|
10
|
+
onToggleSelectArea: (id: string) => void;
|
|
11
|
+
onRemoveArea: (id: string) => void;
|
|
12
|
+
shouldShowDistricts?: boolean;
|
|
13
|
+
}
|
|
14
|
+
export declare const WarningListItem: React.MemoExoticComponent<({ warning, areas, selectedAreaIds, onAddClick, onRemove, onChange, onToggleSelectArea, onRemoveArea, shouldShowDistricts, }: WarningListItemProps) => import("react/jsx-runtime").JSX.Element>;
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { SxProps } from '@mui/material';
|
|
2
|
+
import { TFunction } from 'i18next';
|
|
3
|
+
import React from 'react';
|
|
4
|
+
export interface WarningListSelectOption {
|
|
5
|
+
value: string;
|
|
6
|
+
label: string | ((t: TFunction) => string);
|
|
7
|
+
}
|
|
8
|
+
export interface WarningListSelectProps {
|
|
9
|
+
options: WarningListSelectOption[];
|
|
10
|
+
label: string;
|
|
11
|
+
value?: string;
|
|
12
|
+
onChange: (value: string) => void;
|
|
13
|
+
renderOption?: (option: WarningListSelectOption, index: number) => React.ReactNode;
|
|
14
|
+
renderValue?: (option: unknown) => React.ReactNode;
|
|
15
|
+
gridArea: string;
|
|
16
|
+
additionalStyling?: SxProps;
|
|
17
|
+
isDisabled?: boolean;
|
|
18
|
+
}
|
|
19
|
+
export declare const WarningListSelect: React.MemoExoticComponent<({ options, value, label, onChange, renderOption, renderValue, gridArea, additionalStyling, isDisabled, }: WarningListSelectProps) => import("react/jsx-runtime").JSX.Element>;
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
export declare enum WindForceLevel {
|
|
3
|
+
moderate = "moderate",
|
|
4
|
+
severe = "severe",
|
|
5
|
+
extreme = "extreme"
|
|
6
|
+
}
|
|
7
|
+
export interface ColorDefinition {
|
|
8
|
+
color: string;
|
|
9
|
+
textColor: string;
|
|
10
|
+
borderColor: string;
|
|
11
|
+
}
|
|
12
|
+
export declare const windForceStyles: Record<WindForceLevel, ColorDefinition>;
|
|
13
|
+
export interface WindForceOption {
|
|
14
|
+
level: WindForceLevel;
|
|
15
|
+
value: string;
|
|
16
|
+
}
|
|
17
|
+
export declare const WindForceSelect: React.FC<{
|
|
18
|
+
value?: string;
|
|
19
|
+
onChange: (value: string) => void;
|
|
20
|
+
gridArea: string;
|
|
21
|
+
options: WindForceOption[];
|
|
22
|
+
}>;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './MaritimeWarningsForm';
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import { WindForceOption } from './WarningList/WindForceSelect';
|
|
2
|
+
import { WarningListSelectOption } from './WarningList/WarningListSelect';
|
|
3
|
+
export declare const windDirections: WarningListSelectOption[];
|
|
4
|
+
export declare const change: WarningListSelectOption[];
|
|
5
|
+
export declare const windForce: WindForceOption[];
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
export interface Area {
|
|
2
|
+
label: string;
|
|
3
|
+
id: string;
|
|
4
|
+
}
|
|
5
|
+
export interface MaritimeWarningItemAttributes {
|
|
6
|
+
windDirectionFrom?: string;
|
|
7
|
+
windForce?: string;
|
|
8
|
+
changeType?: string;
|
|
9
|
+
windDirectionTo?: string;
|
|
10
|
+
}
|
|
11
|
+
export interface MaritimeWarningItem extends MaritimeWarningItemAttributes {
|
|
12
|
+
id: string;
|
|
13
|
+
assignedAreaIds: string[];
|
|
14
|
+
}
|
|
15
|
+
export type MaritimeWarningsDomain = 'northSeaDistricts' | 'coastalWaters';
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { Area, MaritimeWarningItem } from './types';
|
|
2
|
+
interface UseConfirmRetractDialogProps {
|
|
3
|
+
areas: Area[];
|
|
4
|
+
warnings: MaritimeWarningItem[];
|
|
5
|
+
onRemoveWarning: (id: string) => void;
|
|
6
|
+
}
|
|
7
|
+
interface UseConfirmRetractDialog {
|
|
8
|
+
onRemoveWarningWithConfirmation(id: string): Promise<void>;
|
|
9
|
+
}
|
|
10
|
+
export declare function useConfirmRetractDialog({ areas, warnings, onRemoveWarning, }: UseConfirmRetractDialogProps): UseConfirmRetractDialog;
|
|
11
|
+
export {};
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { MaritimeWarningItem, MaritimeWarningItemAttributes } from './types';
|
|
3
|
+
export declare function createWarning(): MaritimeWarningItem;
|
|
4
|
+
export declare function isPublishedWarning(warning: MaritimeWarningItem): boolean;
|
|
5
|
+
interface State {
|
|
6
|
+
selectedAreaIds: string[];
|
|
7
|
+
warnings: MaritimeWarningItem[];
|
|
8
|
+
modified: boolean;
|
|
9
|
+
}
|
|
10
|
+
export declare const initialState: State;
|
|
11
|
+
interface Initialize {
|
|
12
|
+
type: 'initialize';
|
|
13
|
+
warnings: MaritimeWarningItem[];
|
|
14
|
+
}
|
|
15
|
+
interface ToggleSelectArea {
|
|
16
|
+
type: 'toggleSelectArea';
|
|
17
|
+
id: string;
|
|
18
|
+
}
|
|
19
|
+
interface NewWarning {
|
|
20
|
+
type: 'newWarning';
|
|
21
|
+
}
|
|
22
|
+
interface AddSelectedAreasToWarning {
|
|
23
|
+
type: 'addSelectedAreasToWarning';
|
|
24
|
+
id: string;
|
|
25
|
+
}
|
|
26
|
+
interface RemoveWarning {
|
|
27
|
+
type: 'removeWarning';
|
|
28
|
+
id: string;
|
|
29
|
+
}
|
|
30
|
+
interface ChangeWarning {
|
|
31
|
+
type: 'changeWarning';
|
|
32
|
+
id: string;
|
|
33
|
+
newValues: Partial<MaritimeWarningItemAttributes>;
|
|
34
|
+
}
|
|
35
|
+
interface RemoveArea {
|
|
36
|
+
type: 'removeArea';
|
|
37
|
+
areaId: string;
|
|
38
|
+
}
|
|
39
|
+
interface ClearWarnings {
|
|
40
|
+
type: 'clearWarnings';
|
|
41
|
+
}
|
|
42
|
+
interface MoveWarning {
|
|
43
|
+
type: 'moveWarning';
|
|
44
|
+
oldIndex: number;
|
|
45
|
+
newIndex: number;
|
|
46
|
+
}
|
|
47
|
+
type Action = ToggleSelectArea | NewWarning | Initialize | AddSelectedAreasToWarning | ChangeWarning | RemoveWarning | RemoveArea | ClearWarnings | MoveWarning;
|
|
48
|
+
export declare function reducer(state: State, action: Action): State;
|
|
49
|
+
export declare function useMaritimeWarningsFormState(): [
|
|
50
|
+
State,
|
|
51
|
+
React.Dispatch<Action>
|
|
52
|
+
];
|
|
53
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -1,29 +1,28 @@
|
|
|
1
|
-
|
|
2
|
-
import type { StoryObj } from '@storybook/react';
|
|
1
|
+
import type { StoryObj } from '@storybook/react-webpack5';
|
|
3
2
|
import { ObjectManager } from './ObjectManager';
|
|
4
3
|
import { DrawingListItem } from '../../store/warningsDrawings/types';
|
|
5
4
|
declare const _default: {
|
|
6
5
|
title: string;
|
|
7
6
|
component: import("react").FC<{
|
|
8
|
-
bounds?: string
|
|
9
|
-
title?: string
|
|
7
|
+
bounds?: string;
|
|
8
|
+
title?: string;
|
|
10
9
|
onClose: () => void;
|
|
11
|
-
onMouseDown?: (
|
|
10
|
+
onMouseDown?: () => void;
|
|
12
11
|
isOpen: boolean;
|
|
13
|
-
order?: number
|
|
14
|
-
source?: import("@opengeoweb/shared").Source
|
|
15
|
-
size?: import("@opengeoweb/shared").DraggableSize
|
|
16
|
-
startPosition?: import("@opengeoweb/shared").Position
|
|
17
|
-
headerSize?: import("@opengeoweb/shared").HeaderSize
|
|
12
|
+
order?: number;
|
|
13
|
+
source?: import("@opengeoweb/shared").Source;
|
|
14
|
+
size?: import("@opengeoweb/shared").DraggableSize;
|
|
15
|
+
startPosition?: import("@opengeoweb/shared").Position;
|
|
16
|
+
headerSize?: import("@opengeoweb/shared").HeaderSize;
|
|
18
17
|
drawingListItems: DrawingListItem[];
|
|
19
|
-
onClickDrawing?: (
|
|
20
|
-
onEditDrawing?: (
|
|
21
|
-
onDeleteDrawing?: (
|
|
22
|
-
onShareObject?: (
|
|
23
|
-
onCreateNewObject?: (
|
|
24
|
-
activeDrawingId?: string
|
|
25
|
-
error?: string
|
|
26
|
-
isLoading?: boolean
|
|
18
|
+
onClickDrawing?: (drawing: DrawingListItem) => void;
|
|
19
|
+
onEditDrawing?: (drawingId: string) => void;
|
|
20
|
+
onDeleteDrawing?: (drawingId: string) => void;
|
|
21
|
+
onShareObject?: (object: DrawingListItem) => void;
|
|
22
|
+
onCreateNewObject?: () => void;
|
|
23
|
+
activeDrawingId?: string;
|
|
24
|
+
error?: string;
|
|
25
|
+
isLoading?: boolean;
|
|
27
26
|
}>;
|
|
28
27
|
tags: string[];
|
|
29
28
|
};
|
|
@@ -2,8 +2,8 @@ import React from 'react';
|
|
|
2
2
|
declare const _default: {
|
|
3
3
|
title: string;
|
|
4
4
|
component: ({ description, }: {
|
|
5
|
-
description?: string
|
|
6
|
-
}) => React.ReactElement
|
|
5
|
+
description?: string;
|
|
6
|
+
}) => React.ReactElement;
|
|
7
7
|
tags: string[];
|
|
8
8
|
};
|
|
9
9
|
export default _default;
|
|
@@ -1,5 +1,4 @@
|
|
|
1
|
-
|
|
2
|
-
import type { StoryObj } from '@storybook/react';
|
|
1
|
+
import type { StoryObj } from '@storybook/react-webpack5';
|
|
3
2
|
import { AreaField } from './AreaField';
|
|
4
3
|
declare const _default: {
|
|
5
4
|
title: string;
|
|
@@ -8,7 +7,7 @@ declare const _default: {
|
|
|
8
7
|
onViewObject: () => void;
|
|
9
8
|
onDeleteObject: () => void;
|
|
10
9
|
onAddObject: () => void;
|
|
11
|
-
isDisabled?: boolean
|
|
10
|
+
isDisabled?: boolean;
|
|
12
11
|
}>;
|
|
13
12
|
parameters: {
|
|
14
13
|
docs: {
|
|
@@ -3,9 +3,8 @@ import { Position, DraggableSize, HeaderSize } from '@opengeoweb/shared';
|
|
|
3
3
|
import { AviationProduct } from '@opengeoweb/sigmet-airmet';
|
|
4
4
|
import { uiTypes } from '@opengeoweb/store';
|
|
5
5
|
import { WarningType } from '../../store/publicWarningForm/types';
|
|
6
|
-
export
|
|
6
|
+
export interface PublicWarningsFormDialogProps {
|
|
7
7
|
bounds?: string;
|
|
8
|
-
title?: string;
|
|
9
8
|
onClose: () => void;
|
|
10
9
|
onMouseDown?: () => void;
|
|
11
10
|
isOpen: boolean;
|
|
@@ -22,4 +21,5 @@ export declare const PublicWarningsFormDialog: React.FC<{
|
|
|
22
21
|
publicWarningEditor?: string;
|
|
23
22
|
selectedAviationProduct?: AviationProduct;
|
|
24
23
|
warningType?: WarningType;
|
|
25
|
-
}
|
|
24
|
+
}
|
|
25
|
+
export declare const PublicWarningsFormDialog: React.FC<PublicWarningsFormDialogProps>;
|
|
@@ -34,7 +34,7 @@ export declare enum PublicWarningStatus {
|
|
|
34
34
|
IGNORED = "IGNORED",
|
|
35
35
|
WITHDRAWN = "WITHDRAWN"
|
|
36
36
|
}
|
|
37
|
-
export type WarningType = 'public' | 'airmet' | 'sigmet';
|
|
37
|
+
export type WarningType = 'public' | 'airmet' | 'sigmet' | 'maritimeWarningCoastal' | 'maritimeWarningNorthSea';
|
|
38
38
|
interface BaseWarning {
|
|
39
39
|
status?: PublicWarningStatus;
|
|
40
40
|
productStatus?: ProductStatus;
|
|
@@ -13,6 +13,6 @@ export declare const transformSigmetFromBackendToProductFormat: (warning: Sigmet
|
|
|
13
13
|
export declare const transformAirmetFromBackendToProductFormat: (warning: AirmetFromBackend) => AviationProduct;
|
|
14
14
|
export declare const getEmptySigmetWarning: (productConfig: ProductConfig) => AviationProduct;
|
|
15
15
|
export declare const getEmptyAirmetWarning: (productConfig: ProductConfig) => AviationProduct;
|
|
16
|
-
export declare const renewAviationProduct: <T extends
|
|
17
|
-
export declare const amendAviationProduct: <T extends
|
|
18
|
-
export declare const duplicateAviationProduct: <T extends
|
|
16
|
+
export declare const renewAviationProduct: <T extends SigmetWarning | AirmetWarning>(aviationWarning: T, productConfig: ProductConfig) => T;
|
|
17
|
+
export declare const amendAviationProduct: <T extends SigmetWarning | AirmetWarning>(aviationWarning: T, productConfig: ProductConfig) => T;
|
|
18
|
+
export declare const duplicateAviationProduct: <T extends SigmetWarning | AirmetWarning>(aviationWarning: T) => T;
|