@opengeoweb/warnings 19.3.0 → 19.5.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/dist/index.esm.js +6518 -2642
- package/dist/src/index.d.ts +1 -1
- package/dist/src/lib/api/warning-api/hooks.d.ts +24 -3
- package/dist/src/lib/components/{AreaObjectLoader/AreaObjectFilter.d.ts → AreaDrawingLoader/AreaDrawingFilter.d.ts} +2 -2
- package/dist/src/lib/components/{AreaObjectLoader/AreaObjectLoader.d.ts → AreaDrawingLoader/AreaDrawingLoader.d.ts} +3 -3
- package/dist/src/lib/components/{ObjectManager/ObjectManagerConnect.d.ts → AreaDrawingLoader/AreaDrawingLoaderConnect.d.ts} +1 -1
- package/dist/src/lib/components/{AreaObjectLoader/AreasObjects.d.ts → AreaDrawingLoader/AreasDrawings.d.ts} +4 -4
- package/dist/src/lib/components/{ObjectManager/ObjectManager.d.ts → AreaDrawingManager/AreaDrawingManager.d.ts} +3 -3
- package/dist/src/lib/components/{AreaObjectLoader/AreaObjectLoaderConnect.d.ts → AreaDrawingManager/AreaDrawingManagerConnect.d.ts} +1 -1
- package/dist/src/lib/components/{ObjectManager/ObjectManagerMapButtonConnect.d.ts → AreaDrawingManager/AreaDrawingManagerMapButtonConnect.d.ts} +1 -1
- package/dist/src/lib/components/AreaDrawingManager/ConfirmDeleteDialog.d.ts +10 -0
- package/dist/src/lib/components/{ObjectManager/Objects.d.ts → AreaDrawingManager/Drawings.d.ts} +10 -10
- package/dist/src/lib/components/AreaDrawingManager/index.d.ts +2 -0
- package/dist/src/lib/components/DrawingTool/index.d.ts +1 -1
- package/dist/src/lib/components/DrawingTool/{useObjectDrawDialogAction.d.ts → useDrawingDialogAction.d.ts} +5 -5
- package/dist/src/lib/components/DrawingToolForm/DrawingToolForm.d.ts +2 -2
- package/dist/src/lib/components/PublicWarningList/PublicWarningList.d.ts +1 -0
- package/dist/src/lib/components/PublicWarningList/WarningListItem.d.ts +1 -0
- package/dist/src/lib/components/PublicWarningList/WarningListItemMenu.d.ts +1 -1
- package/dist/src/lib/components/PublicWarningsForm/AreaField/AreaField.d.ts +4 -4
- package/dist/src/lib/components/PublicWarningsForm/PublicWarningsForm.d.ts +1 -2
- package/dist/src/lib/components/PublicWarningsFormDialog/PublicWarningsFormDialogConnect.d.ts +0 -1
- package/dist/src/lib/components/WarningEvents/WarningEventDialog/WarningEventDialogConnect.d.ts +6 -4
- package/dist/src/lib/components/WarningEvents/WarningEventDialog/WarningEventFormDialog.d.ts +38 -0
- package/dist/src/lib/components/WarningEvents/WarningEventDialog/index.d.ts +3 -0
- package/dist/src/lib/components/WarningEvents/WarningEventDialog/utils.d.ts +16 -0
- package/dist/src/lib/components/WarningEvents/WarningEventForm/CollapseToggleButton.d.ts +9 -0
- package/dist/src/lib/components/WarningEvents/WarningEventForm/WarningEventFormContent.d.ts +20 -2
- package/dist/src/lib/components/WarningEvents/WarningEventForm/WarningEventItem.d.ts +12 -2
- package/dist/src/lib/components/WarningEvents/WarningEventForm/WarningEventTimeline/WarningEventTimeline.d.ts +6 -1
- package/dist/src/lib/components/WarningEvents/WarningEventForm/WarningEventTimeline/WarningEventTimelineBlock.d.ts +9 -0
- package/dist/src/lib/components/WarningEvents/WarningEventForm/WarningEventTimeline/WarningEventTimelineBlockControls.d.ts +15 -0
- package/dist/src/lib/components/WarningEvents/WarningEventForm/WarningEventTimeline/timelineTestUtils.d.ts +4 -0
- package/dist/src/lib/components/WarningEvents/WarningEventForm/WarningEventTimeline/useBlockDrag.d.ts +26 -0
- package/dist/src/lib/components/WarningEvents/WarningEventForm/WarningEventTimeline/useModifierKeyHeld.d.ts +1 -0
- package/dist/src/lib/components/WarningEvents/WarningEventForm/WarningEventTimeline/warningEventTimelineDragUtils.d.ts +37 -0
- package/dist/src/lib/components/WarningEvents/WarningEventForm/types.d.ts +13 -2
- package/dist/src/lib/components/WarningEvents/WarningEventForm/utils.d.ts +13 -0
- package/dist/src/lib/components/WarningEvents/WarningEventForm/warningEventStoryData.d.ts +13 -1
- package/dist/src/lib/components/WarningEvents/WarningEventSummaryDialog/WarningEventSummaryDialog.d.ts +2 -0
- package/dist/src/lib/components/WarningEvents/WarningEventSummaryDialog/WarningEventSummaryForm.d.ts +5 -1
- package/dist/src/lib/components/WarningsMapView/WarningsMapView.d.ts +6 -0
- package/dist/src/lib/store/types.d.ts +2 -0
- package/dist/src/lib/store/warningsDrawings/utils.d.ts +2 -2
- package/dist/src/lib/store/warningsEventForm/index.d.ts +2 -0
- package/dist/src/lib/store/warningsEventForm/listener.d.ts +2 -0
- package/dist/src/lib/store/warningsEventForm/reducer.d.ts +37 -0
- package/dist/src/lib/store/warningsEventForm/selectors.d.ts +66 -0
- package/dist/src/lib/store/warningsFilters/reducer.d.ts +5 -0
- package/dist/src/lib/store/warningsFilters/selectors.d.ts +41 -0
- package/dist/src/lib/store/warningsFilters/types.d.ts +1 -0
- package/dist/src/lib/store/warningsForm/types.d.ts +27 -8
- package/dist/src/lib/store/warningsForm/utils.d.ts +1 -0
- package/dist/src/lib/storybookUtils/testUtils.d.ts +1 -0
- package/dist/src/lib/utils/fakeApi/index.d.ts +3 -2
- package/dist/src/lib/utils/warningUtils.d.ts +10 -1
- package/package.json +2 -1
- package/dist/src/lib/components/ObjectManager/ConfirmDeleteDialog.d.ts +0 -10
- package/dist/src/lib/components/ObjectManager/index.d.ts +0 -2
- /package/dist/src/lib/components/{ObjectManager → AreaDrawingManager}/Areas.d.ts +0 -0
package/dist/src/index.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import warningsTranslations from '../locales/warnings.json';
|
|
2
|
-
export * from './lib/components/
|
|
2
|
+
export * from './lib/components/AreaDrawingManager';
|
|
3
3
|
export * from './lib/components/DrawingTool';
|
|
4
4
|
export * from './lib/components/DrawingToolForm';
|
|
5
5
|
export * from './lib/components/PublicWarningsFormDialog';
|
|
@@ -1,15 +1,15 @@
|
|
|
1
|
-
import type { UseMutationResult, UseQueryResult } from '@tanstack/react-query';
|
|
1
|
+
import type { QueryKey, UseMutationResult, UseQueryResult } from '@tanstack/react-query';
|
|
2
2
|
import type { TimeFilter } from '../../components/FilterList/filter-utils';
|
|
3
3
|
import type { MaritimeWarningsConfig } from '../../components/MaritimeWarningsForm/types';
|
|
4
4
|
import type { DrawingFromBE, DrawingFromFE, DrawingListItem, FetchDrawingParams } from '../../store/warningsDrawings/types';
|
|
5
|
-
import type { MaritimeWarning, MaritimeWarningsType, PublicWarning } from '../../store/warningsForm/types';
|
|
5
|
+
import type { MaritimeWarning, MaritimeWarningsType, PublicWarning, WarningEvent } from '../../store/warningsForm/types';
|
|
6
6
|
/**
|
|
7
7
|
* @param disabled - Disables fetching, but still returns cached values.
|
|
8
8
|
* https://tanstack.com/query/v4/docs/framework/react/guides/disabling-queries
|
|
9
9
|
*/
|
|
10
10
|
export declare const usePublicWarnings: (disabled?: boolean, timeFilter?: TimeFilter) => UseQueryResult<(PublicWarning | MaritimeWarning)[]>;
|
|
11
11
|
type MutationReturnType<T> = UseMutationResult<Headers | null, Error, T, {
|
|
12
|
-
|
|
12
|
+
previousData: [QueryKey, PublicWarning[] | undefined][];
|
|
13
13
|
}>;
|
|
14
14
|
type DrawingMutationReturnType<T> = UseMutationResult<{
|
|
15
15
|
id: string;
|
|
@@ -55,4 +55,25 @@ interface MutateMaritimeEditorParams {
|
|
|
55
55
|
}
|
|
56
56
|
export declare const useMutateMaritimeWarningsEditor: () => MutationReturnType<MutateMaritimeEditorParams>;
|
|
57
57
|
export declare const useMaritimeWarningsConfig: (disabled?: boolean) => UseQueryResult<MaritimeWarningsConfig>;
|
|
58
|
+
export declare const useWarningEventsList: (disabled?: boolean, timeFilter?: TimeFilter) => UseQueryResult<WarningEvent[]>;
|
|
59
|
+
type EventMutationReturnType<T> = UseMutationResult<Headers | null, Error, T, {
|
|
60
|
+
previousData: [QueryKey, WarningEvent[] | undefined][];
|
|
61
|
+
}>;
|
|
62
|
+
interface UpdateWarningEventProps {
|
|
63
|
+
eventId?: string;
|
|
64
|
+
data: WarningEvent;
|
|
65
|
+
panelId?: string;
|
|
66
|
+
}
|
|
67
|
+
export declare const usePublishWarningEvent: () => EventMutationReturnType<UpdateWarningEventProps>;
|
|
68
|
+
export declare const useSaveWarningEvent: () => EventMutationReturnType<UpdateWarningEventProps>;
|
|
69
|
+
export declare const useMutateWarningEvent: (snackBarMessage: string) => EventMutationReturnType<UpdateWarningEventProps>;
|
|
70
|
+
export declare const useMutateDeleteWarningEvent: () => EventMutationReturnType<{
|
|
71
|
+
eventId: string;
|
|
72
|
+
}>;
|
|
73
|
+
interface MutateEventEditorProps {
|
|
74
|
+
eventId: string;
|
|
75
|
+
isEditor: boolean;
|
|
76
|
+
force?: boolean;
|
|
77
|
+
}
|
|
78
|
+
export declare const useMutateEventEditor: () => EventMutationReturnType<MutateEventEditorProps>;
|
|
58
79
|
export {};
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import type { ListFilter } from '@opengeoweb/shared';
|
|
3
|
-
export interface
|
|
3
|
+
export interface AreaDrawingFilterProps {
|
|
4
4
|
filters: ListFilter[];
|
|
5
5
|
onClickFilterChip?: (id: string, selected: boolean) => void;
|
|
6
6
|
searchQuery: string;
|
|
7
7
|
onSearch?: (searchQuery: string) => void;
|
|
8
8
|
}
|
|
9
|
-
export declare const
|
|
9
|
+
export declare const AreaDrawingFilter: React.ForwardRefExoticComponent<AreaDrawingFilterProps & React.RefAttributes<HTMLElement>>;
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import type { HeaderSize, Position, DraggableSize } from '@opengeoweb/shared';
|
|
3
3
|
import type { uiTypes } from '@opengeoweb/store';
|
|
4
|
-
import type {
|
|
4
|
+
import type { AreaDrawingFilterProps } from './AreaDrawingFilter';
|
|
5
5
|
import type { DrawingListItem } from '../../store/warningsDrawings/types';
|
|
6
6
|
import type { Area } from '../../store/warningsForm/types';
|
|
7
7
|
export declare const areaErrorType = "area";
|
|
8
|
-
export declare const
|
|
8
|
+
export declare const AreaDrawingLoader: React.FC<{
|
|
9
9
|
bounds?: string;
|
|
10
10
|
title?: string;
|
|
11
11
|
onClose: () => void;
|
|
@@ -25,4 +25,4 @@ export declare const AreaObjectLoader: React.FC<{
|
|
|
25
25
|
isChangeAreaDisabled?: boolean;
|
|
26
26
|
onRetryRequest?: (errorType: string) => void;
|
|
27
27
|
shouldDisableRemoveWarning?: boolean;
|
|
28
|
-
} &
|
|
28
|
+
} & AreaDrawingFilterProps>;
|
|
@@ -3,18 +3,18 @@ import type { FC } from 'react';
|
|
|
3
3
|
import React from 'react';
|
|
4
4
|
import type { DrawingListItem } from '../../store/warningsDrawings/types';
|
|
5
5
|
import type { Area } from '../../store/warningsForm/types';
|
|
6
|
-
interface
|
|
6
|
+
interface DrawingAreaList {
|
|
7
7
|
title: string;
|
|
8
8
|
items: DrawingListItem[];
|
|
9
9
|
}
|
|
10
10
|
export declare const useGetFilterHeight: (filterRef?: React.RefObject<HTMLElement>) => number;
|
|
11
11
|
export declare const getListInclHeaders: (items: DrawingListItem[], translateFn: TFunction) => {
|
|
12
|
-
|
|
13
|
-
areas:
|
|
12
|
+
drawings: DrawingAreaList;
|
|
13
|
+
areas: DrawingAreaList;
|
|
14
14
|
};
|
|
15
15
|
export declare const getLabel: (selectedAreas: Area[], isAreaSelected: boolean) => string;
|
|
16
16
|
export declare const getDisplayDate: (date: string) => string;
|
|
17
|
-
export declare const
|
|
17
|
+
export declare const AreasDrawings: FC<{
|
|
18
18
|
drawingListItems: DrawingListItem[];
|
|
19
19
|
isLoading?: boolean;
|
|
20
20
|
hasError?: boolean;
|
|
@@ -3,7 +3,7 @@ import type { HeaderSize, Position, DraggableSize } from '@opengeoweb/shared';
|
|
|
3
3
|
import type { uiTypes } from '@opengeoweb/store';
|
|
4
4
|
import type { SelectedAreaFeatureNamesByAreaId } from './Areas';
|
|
5
5
|
import type { AreaListItem, DrawingListItem } from '../../store/warningsDrawings/types';
|
|
6
|
-
export declare const
|
|
6
|
+
export declare const AreaDrawingManager: React.FC<{
|
|
7
7
|
bounds?: string;
|
|
8
8
|
title?: string;
|
|
9
9
|
onClose: () => void;
|
|
@@ -22,8 +22,8 @@ export declare const ObjectManager: React.FC<{
|
|
|
22
22
|
onHoverAreaEnd?: () => void;
|
|
23
23
|
onEditDrawing?: (drawingId: string) => void;
|
|
24
24
|
onDeleteDrawing?: (drawingId: string) => void;
|
|
25
|
-
|
|
26
|
-
|
|
25
|
+
onShareDrawing?: (drawing: DrawingListItem) => void;
|
|
26
|
+
onCreateNewDrawing?: () => void;
|
|
27
27
|
activeDrawingId?: string;
|
|
28
28
|
selectedAreaFeatureNamesByAreaId?: SelectedAreaFeatureNamesByAreaId;
|
|
29
29
|
error?: string;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import type { TFunction } from 'i18next';
|
|
2
|
+
import React from 'react';
|
|
3
|
+
export declare const getDeleteDescription: (drawingName: string, t: TFunction) => string;
|
|
4
|
+
export declare const getDeleteSucces: (drawingName: string, t: TFunction) => string;
|
|
5
|
+
export declare const ConfirmDeleteDialog: React.FC<{
|
|
6
|
+
drawingId: string;
|
|
7
|
+
drawingName: string;
|
|
8
|
+
onDeleteSucces: (drawingId: string) => void;
|
|
9
|
+
onClose: () => void;
|
|
10
|
+
}>;
|
package/dist/src/lib/components/{ObjectManager/Objects.d.ts → AreaDrawingManager/Drawings.d.ts}
RENAMED
|
@@ -1,28 +1,28 @@
|
|
|
1
1
|
import type { FC } from 'react';
|
|
2
2
|
import type { DrawingListItem } from '../../store/warningsDrawings/types';
|
|
3
3
|
export declare const DEFAULT_ADD_BUTTON_HEIGHT = 80;
|
|
4
|
-
export declare const
|
|
5
|
-
export declare const
|
|
4
|
+
export declare const DEFAULT_AREA_DRAWING_MANAGER_TAB_HEIGHT = 40;
|
|
5
|
+
export declare const DEFAULT_AREA_DRAWING_MANAGER_MIN_SIZE: {
|
|
6
6
|
width: number;
|
|
7
7
|
height: number;
|
|
8
8
|
};
|
|
9
9
|
export declare const BUTTON_AIRMET = "AIRMET";
|
|
10
10
|
export declare const BUTTON_SIGMET = "SIGMET";
|
|
11
11
|
type ListInclHeadersType = {
|
|
12
|
-
|
|
12
|
+
isDrawing: boolean;
|
|
13
13
|
index: number;
|
|
14
14
|
}[];
|
|
15
|
-
export declare const getListInclHeaders: (
|
|
15
|
+
export declare const getListInclHeaders: (drawings: DrawingListItem[]) => {
|
|
16
16
|
listInclHeaders: ListInclHeadersType;
|
|
17
17
|
headerList: string[];
|
|
18
18
|
};
|
|
19
|
-
export declare const
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
onClickEdit: (
|
|
19
|
+
export declare const Drawings: FC<{
|
|
20
|
+
drawings: DrawingListItem[];
|
|
21
|
+
onClickDrawing: (drawing: DrawingListItem) => void;
|
|
22
|
+
onClickEdit: (drawingId: string) => void;
|
|
23
23
|
onClickDelete: (drawingId: string) => void;
|
|
24
|
-
onClickShare: (
|
|
25
|
-
|
|
24
|
+
onClickShare: (drawing: DrawingListItem) => void;
|
|
25
|
+
activeDrawing: string;
|
|
26
26
|
isLoading?: boolean;
|
|
27
27
|
dialogWidth?: number;
|
|
28
28
|
}>;
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
export { default as DrawingToolMapButtonConnect } from './DrawingToolMapButtonConnect';
|
|
2
2
|
export { default as DrawingToolConnect } from './DrawingToolConnect';
|
|
3
|
-
export {
|
|
3
|
+
export { useDrawingDrawDialogAction } from './useDrawingDialogAction';
|
|
@@ -8,18 +8,18 @@ export declare const useCloseDrawDialog: ({ mapId, source, }: {
|
|
|
8
8
|
}) => {
|
|
9
9
|
closeDrawDialog: (skipConfirmationDialog?: boolean) => void;
|
|
10
10
|
};
|
|
11
|
-
export declare const
|
|
11
|
+
export declare const useCloseAreaDrawingDialog: ({ mapId, source, }: {
|
|
12
12
|
mapId: string;
|
|
13
13
|
source?: uiTypes.Source;
|
|
14
14
|
}) => {
|
|
15
|
-
|
|
15
|
+
closeAreaDrawingDialog: (shouldReset?: boolean) => void;
|
|
16
16
|
};
|
|
17
|
-
export declare const
|
|
17
|
+
export declare const useDrawingDrawDialogAction: ({ mapId, source, }: {
|
|
18
18
|
mapId: string;
|
|
19
19
|
source?: uiTypes.Source;
|
|
20
20
|
}) => {
|
|
21
21
|
openDrawDialog: (geoJSON?: GeoJSON.FeatureCollection) => void;
|
|
22
22
|
closeDrawDialog: () => void;
|
|
23
|
-
|
|
24
|
-
|
|
23
|
+
openAreaDrawingDialog: () => void;
|
|
24
|
+
closeAreaDrawingDialog: (shouldReset?: boolean) => void;
|
|
25
25
|
};
|
|
@@ -3,10 +3,10 @@ import React from 'react';
|
|
|
3
3
|
import type { DrawMode } from '@opengeoweb/webmap-react';
|
|
4
4
|
import type { DrawingToolFormValues } from './DrawingToolFormContents';
|
|
5
5
|
export declare const opacityOptions: number[];
|
|
6
|
-
export declare const
|
|
6
|
+
export declare const getDrawingName: (drawingName: string) => string;
|
|
7
7
|
export interface DrawingToolFormComponentProps {
|
|
8
8
|
onSubmitForm: (formValues: DrawingToolFormValues) => void;
|
|
9
|
-
|
|
9
|
+
drawingName?: string;
|
|
10
10
|
isLoading?: boolean;
|
|
11
11
|
dialogError?: string;
|
|
12
12
|
id?: string;
|
|
@@ -8,6 +8,7 @@ export interface PublicWarningListProps extends WarningListItemActions {
|
|
|
8
8
|
isLoading?: boolean;
|
|
9
9
|
error?: Error;
|
|
10
10
|
selectedWarningId?: string;
|
|
11
|
+
selectedEventId?: string;
|
|
11
12
|
lastUpdatedTime?: string;
|
|
12
13
|
onCreateWarning?: () => void;
|
|
13
14
|
onRefetchWarnings?: () => void;
|
|
@@ -6,6 +6,7 @@ export interface WarningListItemProps extends ListItemProps, WarningListItemActi
|
|
|
6
6
|
warning: Warning;
|
|
7
7
|
highlightedItem?: boolean;
|
|
8
8
|
activeWarningId: string;
|
|
9
|
+
activeEventId: string;
|
|
9
10
|
onHoverWarning?: (warningId?: string) => void;
|
|
10
11
|
onSelectWarning?: (warning: Warning) => void;
|
|
11
12
|
shouldDisableAviationAmendOption?: boolean;
|
|
@@ -5,7 +5,7 @@ import type { MaritimeWarning, Warning } from '../../store/warningsForm/types';
|
|
|
5
5
|
import { MaritimeWarningAction } from '../../store/warningsForm/types';
|
|
6
6
|
export interface WarningListItemActions {
|
|
7
7
|
onEditWarning?: (warning: Warning) => void;
|
|
8
|
-
onDeleteWarning?: (
|
|
8
|
+
onDeleteWarning?: (warning: Warning) => void;
|
|
9
9
|
onDeleteReviewWarning?: (warning: Warning) => void;
|
|
10
10
|
onExpireWarning?: (warning: Warning) => void;
|
|
11
11
|
onWithdrawWarning?: (warning: Warning) => void;
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
export declare const formatDate: (lastUpdatedTime: string) => string;
|
|
3
3
|
export declare const AreaField: React.FC<{
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
4
|
+
onEditDrawing: () => void;
|
|
5
|
+
onViewDrawing: () => void;
|
|
6
|
+
onDeleteDrawing: () => void;
|
|
7
|
+
onAddDrawing: () => void;
|
|
8
8
|
isDisabled?: boolean;
|
|
9
9
|
drawActions?: React.ReactNode;
|
|
10
10
|
}>;
|
|
@@ -8,7 +8,6 @@ import type { BaseDrawingListItem, DrawingListItem } from '../../store/warningsD
|
|
|
8
8
|
import type { FormError } from '../../store/warningsForm/reducer';
|
|
9
9
|
import type { Area, PublicWarningDetail, WarningType } from '../../store/warningsForm/types';
|
|
10
10
|
import { PublicWarningStatus } from '../../store/warningsForm/types';
|
|
11
|
-
export declare const useScrollTopOnError: (error: FormError) => React.RefObject<HTMLDivElement | null>;
|
|
12
11
|
export declare const getEmptyPublicWarning: () => PublicWarningDetail;
|
|
13
12
|
export declare const getFormData: (publicWarningsDetails: PublicWarningDetail | undefined, object?: DrawingListItem) => FormData;
|
|
14
13
|
interface FormData extends PublicWarningDetail {
|
|
@@ -30,7 +29,7 @@ export interface FormProps {
|
|
|
30
29
|
isReadOnly?: boolean;
|
|
31
30
|
onFormDirty?: (isFormDirty: boolean) => void;
|
|
32
31
|
isSnapshot?: boolean;
|
|
33
|
-
|
|
32
|
+
onAddDrawing?: () => void;
|
|
34
33
|
selectedAviationProduct?: AviationProduct;
|
|
35
34
|
warningType?: WarningType;
|
|
36
35
|
mode?: FormMode;
|
package/dist/src/lib/components/PublicWarningsFormDialog/PublicWarningsFormDialogConnect.d.ts
CHANGED
|
@@ -4,7 +4,6 @@ import type { ConfirmationOptions, Position } from '@opengeoweb/shared';
|
|
|
4
4
|
import { uiTypes } from '@opengeoweb/store';
|
|
5
5
|
import type { MapPreset } from '@opengeoweb/store';
|
|
6
6
|
export declare const warningFormConfirmationOptions: (t: TFunction) => ConfirmationOptions;
|
|
7
|
-
export declare const isAlreadyEdited: (publicWarningEditor: string | undefined, username: string | undefined) => boolean;
|
|
8
7
|
export declare const PublicWarningsFormDialogConnect: React.FC<{
|
|
9
8
|
bounds?: string;
|
|
10
9
|
source?: uiTypes.Source;
|
package/dist/src/lib/components/WarningEvents/WarningEventDialog/WarningEventDialogConnect.d.ts
CHANGED
|
@@ -1,11 +1,13 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import type { Position } from '@opengeoweb/shared';
|
|
3
|
-
import type { uiTypes } from '@opengeoweb/store';
|
|
4
|
-
import type { WarningEvent } from '../../../store/warningsForm/types';
|
|
2
|
+
import type { DraggableSize, Position } from '@opengeoweb/shared';
|
|
3
|
+
import type { MapPreset, uiTypes } from '@opengeoweb/store';
|
|
5
4
|
export interface WarningEventDialogConnectProps {
|
|
5
|
+
defaultMapPreset?: MapPreset;
|
|
6
6
|
bounds?: string;
|
|
7
7
|
source?: uiTypes.Source;
|
|
8
|
+
size?: DraggableSize;
|
|
8
9
|
startPosition?: Position;
|
|
9
|
-
|
|
10
|
+
startPositionSummary?: Position;
|
|
11
|
+
isDefaultCollapsed?: boolean;
|
|
10
12
|
}
|
|
11
13
|
export declare const WarningEventDialogConnect: React.FC<WarningEventDialogConnectProps>;
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import type { TFunction } from 'i18next';
|
|
2
|
+
import React from 'react';
|
|
3
|
+
import type { ConfirmationOptions, DraggableSize, Position } from '@opengeoweb/shared';
|
|
4
|
+
import type { MapPreset, uiTypes } from '@opengeoweb/store';
|
|
5
|
+
import type { FormError } from '../../../store/warningsEventForm/reducer';
|
|
6
|
+
import type { WarningEvent } from '../../../store/warningsForm/types';
|
|
7
|
+
export declare const warningFormConfirmationOptions: (t: TFunction) => ConfirmationOptions;
|
|
8
|
+
export interface WarningEventFormDialogProps {
|
|
9
|
+
defaultMapPreset?: MapPreset;
|
|
10
|
+
bounds?: string;
|
|
11
|
+
currentEventEditor?: string;
|
|
12
|
+
shouldHideFormToggleMode?: boolean;
|
|
13
|
+
selectedEvent?: WarningEvent;
|
|
14
|
+
error?: FormError;
|
|
15
|
+
isOpen: boolean;
|
|
16
|
+
isSnapshot?: boolean;
|
|
17
|
+
isReadOnly?: boolean;
|
|
18
|
+
order?: number;
|
|
19
|
+
size?: DraggableSize;
|
|
20
|
+
source?: uiTypes.Source;
|
|
21
|
+
startPosition?: Position;
|
|
22
|
+
onClose: () => void;
|
|
23
|
+
onChangeFormMode?: (isReadOnly: boolean) => void;
|
|
24
|
+
onMouseDown?: () => void;
|
|
25
|
+
onDelete?: () => void;
|
|
26
|
+
onFormDirty?: (isFormDirty: boolean) => void;
|
|
27
|
+
onSaveDraft?: (formValues: WarningEvent) => Promise<Headers | null>;
|
|
28
|
+
onPublish?: (formValues: WarningEvent) => Promise<Headers | null>;
|
|
29
|
+
isSummaryOpen: boolean;
|
|
30
|
+
summaryOrder?: number;
|
|
31
|
+
summarySource?: uiTypes.Source;
|
|
32
|
+
startPositionSummary?: Position;
|
|
33
|
+
onOpenSummary: () => void;
|
|
34
|
+
onCloseSummary: () => void;
|
|
35
|
+
onAddSummary: () => void;
|
|
36
|
+
onMouseDownSummary?: () => void;
|
|
37
|
+
}
|
|
38
|
+
export declare const WarningEventFormDialog: React.FC<WarningEventFormDialogProps>;
|
|
@@ -1,4 +1,7 @@
|
|
|
1
1
|
export { WarningEventDialog } from './WarningEventDialog';
|
|
2
|
+
export type { WarningEventFormDialogProps } from './WarningEventFormDialog';
|
|
3
|
+
export { WarningEventFormDialog } from './WarningEventFormDialog';
|
|
2
4
|
export type { WarningEventDialogProps } from './WarningEventDialog';
|
|
3
5
|
export { WarningEventDialogConnect } from './WarningEventDialogConnect';
|
|
4
6
|
export type { WarningEventDialogConnectProps } from './WarningEventDialogConnect';
|
|
7
|
+
export { useWarningEventActions } from './utils';
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import type { TFunction } from 'i18next';
|
|
2
|
+
import type { ConfirmationOptions } from '@opengeoweb/shared';
|
|
3
|
+
import type { FormAction } from '../../../store/warningsEventForm/reducer';
|
|
4
|
+
import type { EventWarningForWarningList, WarningEvent } from '../../../store/warningsForm/types';
|
|
5
|
+
import type { TimeFilter } from '../../FilterList/filter-utils';
|
|
6
|
+
import type { ConfirmDialogProps } from '../../PublicWarningList/ConfirmWarningDialog';
|
|
7
|
+
export declare const getNewEventWithLinkedToId: (event: WarningEvent) => WarningEvent;
|
|
8
|
+
export declare const warningFormConfirmationOptions: (t: TFunction) => ConfirmationOptions;
|
|
9
|
+
interface WarningEventsActions {
|
|
10
|
+
selectedEventId: string;
|
|
11
|
+
openWarningsEventDialog: (formAction?: FormAction, warning?: EventWarningForWarningList) => Promise<void>;
|
|
12
|
+
deleteWarningsEvent: (warningEventId: string, currentUser: string, setConfirmDialogOptions: React.Dispatch<React.SetStateAction<ConfirmDialogProps | undefined>>) => Promise<void>;
|
|
13
|
+
updateWarningsEvent: (warningEventId: string, currentUser: string) => Promise<void>;
|
|
14
|
+
}
|
|
15
|
+
export declare const useWarningEventActions: (panelId: string, timeFilter?: TimeFilter) => WarningEventsActions;
|
|
16
|
+
export {};
|
|
@@ -1,11 +1,29 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
+
import type { FieldErrors } from 'react-hook-form';
|
|
3
|
+
import type { MapPreset } from '@opengeoweb/store';
|
|
4
|
+
import type { FormError } from '../../../store/warningsEventForm/reducer';
|
|
2
5
|
import type { WarningEvent } from '../../../store/warningsForm/types';
|
|
6
|
+
export declare const CROSS_FIELD_VALIDATIONS: Record<string, {
|
|
7
|
+
fields: string[];
|
|
8
|
+
translationKey: string;
|
|
9
|
+
}>;
|
|
10
|
+
export declare const getCrossFieldError: (anchorField: string, errors: FieldErrors) => string | undefined;
|
|
3
11
|
export interface WarningEventFormContentProps {
|
|
12
|
+
defaultMapPreset?: MapPreset;
|
|
13
|
+
error?: FormError;
|
|
14
|
+
currentEventEditor?: string;
|
|
15
|
+
isSummaryDialogOpen?: boolean;
|
|
16
|
+
selectedEvent?: WarningEvent;
|
|
17
|
+
shouldHideFormToggleMode?: boolean;
|
|
4
18
|
isReadOnly?: boolean;
|
|
19
|
+
isSnapshot?: boolean;
|
|
20
|
+
isDefaultCollapsed?: boolean;
|
|
5
21
|
onCancel?: () => void;
|
|
22
|
+
onChangeFormMode?: (isReadOnly: boolean) => void;
|
|
6
23
|
onDelete?: () => void;
|
|
24
|
+
onFormDirty?: (isFormDirty: boolean) => void;
|
|
7
25
|
onOpenWarningSummary?: () => void;
|
|
8
|
-
|
|
9
|
-
onPublish?: (formValues: WarningEvent) =>
|
|
26
|
+
onSaveDraft?: (formValues: WarningEvent) => Promise<Headers | null>;
|
|
27
|
+
onPublish?: (formValues: WarningEvent) => Promise<Headers | null>;
|
|
10
28
|
}
|
|
11
29
|
export declare const WarningEventFormContent: React.FC<WarningEventFormContentProps>;
|
|
@@ -1,9 +1,19 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import type {
|
|
3
|
-
|
|
2
|
+
import type { MapPreset } from '@opengeoweb/store';
|
|
3
|
+
import { PublicWarningStatus } from '../../../store/warningsForm/types';
|
|
4
|
+
export declare const probablityOptions: {
|
|
5
|
+
name: string;
|
|
6
|
+
value: number;
|
|
7
|
+
}[];
|
|
4
8
|
export declare const WarningEventItem: React.FC<{
|
|
9
|
+
defaultMapPreset?: MapPreset;
|
|
5
10
|
index: number;
|
|
6
11
|
isReadOnly: boolean;
|
|
12
|
+
isSnapshot?: boolean;
|
|
13
|
+
isCompact: boolean;
|
|
14
|
+
isDeleteButtonDisabled: boolean;
|
|
15
|
+
onExpireWithdraw: (status: PublicWarningStatus, index: number) => void;
|
|
16
|
+
onToggleCompact: () => void;
|
|
7
17
|
onDeleteWarning: (index: number) => void;
|
|
8
18
|
}>;
|
|
9
19
|
export default WarningEventItem;
|
|
@@ -1,11 +1,17 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
+
import type { TimelineEditing } from './WarningEventTimelineBlock';
|
|
3
|
+
import type { PublicWarningStatus } from '../../../../store/warningsForm/types';
|
|
4
|
+
export type { TimelineEditing };
|
|
2
5
|
export interface WarningEventTimelineProps {
|
|
3
6
|
start: Date;
|
|
4
7
|
end: Date;
|
|
5
8
|
validFrom: string;
|
|
6
9
|
validUntil: string;
|
|
7
10
|
level: string;
|
|
11
|
+
status?: PublicWarningStatus;
|
|
8
12
|
now?: Date;
|
|
13
|
+
isCompact?: boolean;
|
|
14
|
+
editing?: TimelineEditing;
|
|
9
15
|
}
|
|
10
16
|
interface AxisIntervals {
|
|
11
17
|
tickHours: number;
|
|
@@ -13,4 +19,3 @@ interface AxisIntervals {
|
|
|
13
19
|
}
|
|
14
20
|
export declare const getAxisIntervals: (rangeDays: number) => AxisIntervals;
|
|
15
21
|
export declare const WarningEventTimeline: React.FC<WarningEventTimelineProps>;
|
|
16
|
-
export {};
|
|
@@ -1,4 +1,10 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
+
import { PublicWarningStatus } from '../../../../store/warningsForm/types';
|
|
3
|
+
import { WarningLevel } from '../../../PublicWarningsForm/LevelField';
|
|
4
|
+
export interface TimelineEditing {
|
|
5
|
+
onTimesChange: (validFrom: string, validUntil: string) => void;
|
|
6
|
+
onLevelChange?: (level: WarningLevel) => void;
|
|
7
|
+
}
|
|
2
8
|
interface WarningEventTimelineBlockProps {
|
|
3
9
|
start: Date;
|
|
4
10
|
end: Date;
|
|
@@ -7,6 +13,9 @@ interface WarningEventTimelineBlockProps {
|
|
|
7
13
|
validFrom: string;
|
|
8
14
|
validUntil: string;
|
|
9
15
|
level: string;
|
|
16
|
+
status?: PublicWarningStatus;
|
|
17
|
+
isCompact?: boolean;
|
|
18
|
+
editing?: TimelineEditing;
|
|
10
19
|
}
|
|
11
20
|
export declare const WarningEventTimelineBlock: React.FC<WarningEventTimelineBlockProps>;
|
|
12
21
|
export {};
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import type { TimelineEditing } from './WarningEventTimelineBlock';
|
|
3
|
+
interface WarningEventTimelineBlockControlsProps {
|
|
4
|
+
left: number;
|
|
5
|
+
width: number;
|
|
6
|
+
containerWidth: number;
|
|
7
|
+
from: Date;
|
|
8
|
+
until: Date;
|
|
9
|
+
now: Date;
|
|
10
|
+
maxPickerDate: Date;
|
|
11
|
+
editing: TimelineEditing;
|
|
12
|
+
showEditAffordances: boolean;
|
|
13
|
+
}
|
|
14
|
+
export declare const WarningEventTimelineBlockControls: React.FC<WarningEventTimelineBlockControlsProps>;
|
|
15
|
+
export {};
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import type { DragMode } from './warningEventTimelineDragUtils';
|
|
3
|
+
interface DragPreview {
|
|
4
|
+
from: Date;
|
|
5
|
+
until: Date;
|
|
6
|
+
}
|
|
7
|
+
export interface UseBlockDragParams {
|
|
8
|
+
from: Date | null;
|
|
9
|
+
until: Date | null;
|
|
10
|
+
rangeStart: Date;
|
|
11
|
+
rangeEnd: Date;
|
|
12
|
+
now: Date;
|
|
13
|
+
maxUntil: Date;
|
|
14
|
+
drawableWidth: number;
|
|
15
|
+
onTimesChange?: (validFrom: string, validUntil: string) => void;
|
|
16
|
+
}
|
|
17
|
+
export interface UseBlockDragResult {
|
|
18
|
+
dragPreview: DragPreview | null;
|
|
19
|
+
dragMode: DragMode | null;
|
|
20
|
+
beginDrag: (mode: DragMode, event: React.PointerEvent) => void;
|
|
21
|
+
onPointerMove: (event: React.PointerEvent) => void;
|
|
22
|
+
onPointerUp: (event: React.PointerEvent) => void;
|
|
23
|
+
onPointerCancel: (event: React.PointerEvent) => void;
|
|
24
|
+
}
|
|
25
|
+
export declare const useBlockDrag: ({ from, until, rangeStart, rangeEnd, now, maxUntil, drawableWidth, onTimesChange, }: UseBlockDragParams) => UseBlockDragResult;
|
|
26
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const useModifierKeyHeld: (isEnabled?: boolean) => boolean;
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
export declare const SNAP_MINUTES = 30;
|
|
2
|
+
export declare const MIN_DURATION_MINUTES = 30;
|
|
3
|
+
export declare const MIN_VISIBLE_MINUTES = 30;
|
|
4
|
+
export declare const ABSOLUTE_MAX_DAY = 7;
|
|
5
|
+
export declare const EDGE_HIT_ZONE_PX = 8;
|
|
6
|
+
export declare const EXPANDED_BLOCK_TOP = 58;
|
|
7
|
+
export declare const EXPANDED_BLOCK_HEIGHT = 56;
|
|
8
|
+
export declare const TIME_FIELD_WIDTH = 200;
|
|
9
|
+
export declare const TIME_FIELD_GAP = 8;
|
|
10
|
+
export type DragMode = 'start' | 'end' | 'move';
|
|
11
|
+
export declare const snapToInterval: (timeMs: number, intervalMs?: number) => number;
|
|
12
|
+
export declare const formatOverflowHours: (overflowMs: number) => string;
|
|
13
|
+
export declare const getEndTimeForMovedStart: (fromMs: number, untilMs: number, newFromMs: number, maxUntilMs: number) => number;
|
|
14
|
+
export interface TimeFieldPositions {
|
|
15
|
+
startLeft: number;
|
|
16
|
+
endLeft: number;
|
|
17
|
+
isStacked: boolean;
|
|
18
|
+
}
|
|
19
|
+
export declare const getTimeFieldPositions: ({ left, width, containerWidth, }: {
|
|
20
|
+
left: number;
|
|
21
|
+
width: number;
|
|
22
|
+
containerWidth: number;
|
|
23
|
+
}) => TimeFieldPositions;
|
|
24
|
+
export interface ComputeDraggedTimesParams {
|
|
25
|
+
mode: DragMode;
|
|
26
|
+
deltaMs: number;
|
|
27
|
+
fromMs: number;
|
|
28
|
+
untilMs: number;
|
|
29
|
+
rangeStartMs: number;
|
|
30
|
+
rangeEndMs: number;
|
|
31
|
+
nowMs: number;
|
|
32
|
+
maxUntilMs: number;
|
|
33
|
+
}
|
|
34
|
+
export declare const computeDraggedTimes: ({ mode, deltaMs, fromMs, untilMs, rangeStartMs, rangeEndMs, nowMs, maxUntilMs, }: ComputeDraggedTimesParams) => {
|
|
35
|
+
fromMs: number;
|
|
36
|
+
untilMs: number;
|
|
37
|
+
};
|