@opengeoweb/warnings 19.5.1 → 19.6.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 +95848 -695
- package/dist/src/index.d.ts +1 -0
- package/dist/src/lib/components/AreaDrawingManager/AreaDrawingManager.d.ts +4 -0
- package/dist/src/lib/components/AreaDrawingManager/AreaDrawingManagerConnect.d.ts +3 -0
- package/dist/src/lib/components/AreaDrawingManager/Drawings.d.ts +6 -0
- package/dist/src/lib/components/DrawingToolForm/DrawingToolForm.d.ts +3 -0
- package/dist/src/lib/components/DrawingToolForm/DrawingToolFormContents.d.ts +12 -1
- package/dist/src/lib/components/DrawingToolForm/drawingObjectUtils.d.ts +40 -0
- package/dist/src/lib/components/DrawingToolForm/useSelectDrawFeature.d.ts +7 -0
- package/dist/src/lib/components/FilterList/filter-hooks.d.ts +4 -1
- package/dist/src/lib/components/FilterList/filter-utils.d.ts +3 -0
- package/dist/src/lib/components/MaritimeWarningsForm/AreaList/AreaList.d.ts +1 -1
- package/dist/src/lib/components/MaritimeWarningsForm/WarningList/WarningListItem.d.ts +1 -1
- package/dist/src/lib/components/MaritimeWarningsForm/WarningList/WarningListSelect.d.ts +1 -1
- package/dist/src/lib/components/Providers/Providers.d.ts +1 -0
- package/dist/src/lib/components/PublicWarningList/PublicWarningListConnect.d.ts +1 -0
- package/dist/src/lib/components/WarningEvents/WarningEventDialog/index.d.ts +1 -0
- package/dist/src/lib/components/WarningEvents/WarningEventDialog/useCloseWarningEventDialogOnUnmount.d.ts +1 -0
- package/dist/src/lib/components/WarningEvents/WarningEventForm/DaySelector/DaySelector.d.ts +9 -0
- package/dist/src/lib/components/WarningEvents/WarningEventForm/DaySelector/daySelectorUtils.d.ts +15 -0
- package/dist/src/lib/components/WarningEvents/WarningEventForm/DaySelector/index.d.ts +2 -0
- package/dist/src/lib/components/WarningEvents/WarningEventForm/DaySelector/useDaySelection.d.ts +19 -0
- package/dist/src/lib/components/WarningEvents/WarningEventForm/WarningEventTimeline/WarningEventTimeline.d.ts +2 -0
- package/dist/src/lib/components/WarningEvents/WarningEventForm/WarningEventTimeline/WarningEventTimelineBlock.d.ts +1 -0
- package/dist/src/lib/components/WarningEvents/WarningEventForm/WarningEventTimeline/WarningEventTimelineBlockControls.d.ts +1 -0
- package/dist/src/lib/components/WarningEvents/WarningEventForm/types.d.ts +0 -2
- package/dist/src/lib/components/WarningEvents/WarningEventForm/utils.d.ts +11 -0
- package/dist/src/lib/components/WarningsTimeline/WarningBlock.d.ts +1 -1
- package/dist/src/lib/components/WarningsTimeline/WarningsTimelineLayers.d.ts +1 -1
- package/dist/src/lib/store/warningsFilters/reducer.d.ts +1 -0
- package/package.json +1 -1
package/dist/src/index.d.ts
CHANGED
|
@@ -12,3 +12,4 @@ export { WARN_NAMESPACE } from './lib/utils/i18n';
|
|
|
12
12
|
export { warningsTranslations };
|
|
13
13
|
export * as publicWarningsSelectors from './lib/store/warningsFilters/selectors';
|
|
14
14
|
export type * from './lib/store/types';
|
|
15
|
+
export { requestHandlers as warningEndpoints } from './lib/utils/fakeApi';
|
|
@@ -20,6 +20,10 @@ export declare const AreaDrawingManager: React.FC<{
|
|
|
20
20
|
onClickArea?: (area: AreaListItem) => void;
|
|
21
21
|
onHoverArea?: (area: AreaListItem) => void;
|
|
22
22
|
onHoverAreaEnd?: () => void;
|
|
23
|
+
onHoverDrawing?: (drawing: DrawingListItem) => void;
|
|
24
|
+
onHoverDrawingEnd?: () => void;
|
|
25
|
+
onHoverDrawingFeature?: (drawing: DrawingListItem, featureIndex: number) => void;
|
|
26
|
+
onHoverDrawingFeatureEnd?: (drawing: DrawingListItem) => void;
|
|
23
27
|
onEditDrawing?: (drawingId: string) => void;
|
|
24
28
|
onDeleteDrawing?: (drawingId: string) => void;
|
|
25
29
|
onShareDrawing?: (drawing: DrawingListItem) => void;
|
|
@@ -1,5 +1,8 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import type { uiTypes } from '@opengeoweb/store';
|
|
3
|
+
export declare const AREA_FILL_OPACITY = 0;
|
|
4
|
+
export declare const DRAWING_FILL_OPACITY = 0.1;
|
|
5
|
+
export declare const HOVER_HIGHLIGHT_FILL_OPACITY = 0.2;
|
|
3
6
|
export declare const AreaDrawingManagerConnect: React.FC<{
|
|
4
7
|
bounds?: string;
|
|
5
8
|
source?: uiTypes.Source;
|
|
@@ -1,5 +1,7 @@
|
|
|
1
|
+
import type { TFunction } from 'i18next';
|
|
1
2
|
import type { FC } from 'react';
|
|
2
3
|
import type { DrawingListItem } from '../../store/warningsDrawings/types';
|
|
4
|
+
export declare const getFeatureName: (feature: GeoJSON.Feature, index: number, t: TFunction) => string;
|
|
3
5
|
export declare const DEFAULT_ADD_BUTTON_HEIGHT = 80;
|
|
4
6
|
export declare const DEFAULT_AREA_DRAWING_MANAGER_TAB_HEIGHT = 40;
|
|
5
7
|
export declare const DEFAULT_AREA_DRAWING_MANAGER_MIN_SIZE: {
|
|
@@ -22,6 +24,10 @@ export declare const Drawings: FC<{
|
|
|
22
24
|
onClickEdit: (drawingId: string) => void;
|
|
23
25
|
onClickDelete: (drawingId: string) => void;
|
|
24
26
|
onClickShare: (drawing: DrawingListItem) => void;
|
|
27
|
+
onHoverDrawing: (drawing: DrawingListItem) => void;
|
|
28
|
+
onHoverDrawingEnd: () => void;
|
|
29
|
+
onHoverDrawingFeature?: (drawing: DrawingListItem, featureIndex: number) => void;
|
|
30
|
+
onHoverDrawingFeatureEnd?: (drawing: DrawingListItem) => void;
|
|
25
31
|
activeDrawing: string;
|
|
26
32
|
isLoading?: boolean;
|
|
27
33
|
dialogWidth?: number;
|
|
@@ -18,6 +18,9 @@ export interface DrawingToolFormComponentProps {
|
|
|
18
18
|
geoJSONProperties: GeoJSON.GeoJsonProperties;
|
|
19
19
|
onChangeProperties: (properties: GeoJSON.GeoJsonProperties) => void;
|
|
20
20
|
onChangeName: (name: string) => void;
|
|
21
|
+
onChangeObjectName: (featureId: string, objectName: string) => void;
|
|
22
|
+
onSelectFeature: (featureId: string) => void;
|
|
23
|
+
onDeleteFeature: (featureId: string) => void;
|
|
21
24
|
onFormDirty?: (isFormDirty: boolean) => void;
|
|
22
25
|
geoJSON: FeatureCollection<Geometry, GeoJsonProperties> | undefined;
|
|
23
26
|
}
|
|
@@ -1,10 +1,16 @@
|
|
|
1
1
|
import type { SelectChangeEvent } from '@mui/material';
|
|
2
2
|
import React from 'react';
|
|
3
|
-
import type { FieldErrors, FieldValues } from 'react-hook-form';
|
|
3
|
+
import type { FieldArrayWithId, FieldErrors, FieldValues } from 'react-hook-form';
|
|
4
4
|
import type { DrawMode } from '@opengeoweb/webmap-react';
|
|
5
|
+
import type { DrawingObject } from './drawingObjectUtils';
|
|
5
6
|
export declare const opacityOptions: number[];
|
|
7
|
+
export interface DrawingToolObjectFormValue {
|
|
8
|
+
featureId: string;
|
|
9
|
+
objectName: string;
|
|
10
|
+
}
|
|
6
11
|
export interface DrawingToolFormValues {
|
|
7
12
|
objectName: string;
|
|
13
|
+
features: DrawingToolObjectFormValue[];
|
|
8
14
|
geoJSON: GeoJSON.FeatureCollection;
|
|
9
15
|
id: string;
|
|
10
16
|
}
|
|
@@ -18,9 +24,14 @@ export interface DrawingToolFormContentsProps {
|
|
|
18
24
|
isInEditMode: boolean;
|
|
19
25
|
isDirty: boolean;
|
|
20
26
|
errors: FieldErrors<FieldValues>;
|
|
27
|
+
drawingObjects: DrawingObject[];
|
|
28
|
+
fields: FieldArrayWithId<DrawingToolFormValues, 'features', 'id'>[];
|
|
21
29
|
onChangeDrawMode: (newMode: DrawMode) => void;
|
|
22
30
|
onChangeOpacity: (event: SelectChangeEvent<unknown>) => void;
|
|
23
31
|
onBlurName: (event: React.FocusEvent<HTMLInputElement>) => void;
|
|
32
|
+
onFocusObject: (featureId: string) => void;
|
|
33
|
+
onBlurObjectName: (featureId: string, objectName: string) => void;
|
|
34
|
+
onDeleteObject: (featureId: string) => void;
|
|
24
35
|
onSubmit: () => void;
|
|
25
36
|
geoJSONProperties?: GeoJSON.GeoJsonProperties;
|
|
26
37
|
}
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
export declare const MAX_OBJECT_NAME_LENGTH = 64;
|
|
2
|
+
export interface DrawingObject {
|
|
3
|
+
featureId: string;
|
|
4
|
+
featureIndex: number;
|
|
5
|
+
objectName: string;
|
|
6
|
+
storedObjectName?: string;
|
|
7
|
+
selectionType?: string;
|
|
8
|
+
}
|
|
9
|
+
export declare const formatDefaultObjectName: (position: number) => string;
|
|
10
|
+
export declare const getDefaultObjectNamePosition: (name: string) => number | undefined;
|
|
11
|
+
/**
|
|
12
|
+
* Maps the features of a drawing to the objects shown in the form. Features
|
|
13
|
+
* without a geometry are skipped: these are placeholders for a shape which
|
|
14
|
+
* still needs to be drawn. Features without a (unique) name get a generated
|
|
15
|
+
* default name.
|
|
16
|
+
*
|
|
17
|
+
* Stored names are claimed first (round 1) so a generated default name can
|
|
18
|
+
* never steal a stored name, wherever that stored name appears in the
|
|
19
|
+
* feature array. Default names for the remaining, unclaimed features are
|
|
20
|
+
* then generated (round 2) by `getDefaultObjectName`.
|
|
21
|
+
* @param geoJSON geoJSON of the drawing
|
|
22
|
+
* @param getDefaultObjectName generates the default name for a feature
|
|
23
|
+
* @returns list of objects for the drawing
|
|
24
|
+
*/
|
|
25
|
+
export declare const getDrawingObjects: (geoJSON: GeoJSON.FeatureCollection | undefined, getDefaultObjectName: (featureId: string, takenNames: string[]) => string) => DrawingObject[];
|
|
26
|
+
/**
|
|
27
|
+
* Checks if the passed name is already used by another object
|
|
28
|
+
* @param objectName name to check
|
|
29
|
+
* @param objectNames names of all objects
|
|
30
|
+
* @param ownIndex index of the object the name belongs to
|
|
31
|
+
* @returns true when another object uses the same name
|
|
32
|
+
*/
|
|
33
|
+
export declare const isDuplicateObjectName: (objectName: string, objectNames: string[], ownIndex: number) => boolean;
|
|
34
|
+
/**
|
|
35
|
+
* Adds the object names of the form to the properties of the geoJSON features
|
|
36
|
+
* @param geoJSON geoJSON of the drawing
|
|
37
|
+
* @param objectNamesByFeatureId object name for every feature id
|
|
38
|
+
* @returns geoJSON including the object names
|
|
39
|
+
*/
|
|
40
|
+
export declare const addObjectNamesToGeoJSON: (geoJSON: GeoJSON.FeatureCollection, objectNamesByFeatureId: Record<string, string>) => GeoJSON.FeatureCollection;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Selects a single feature of a feature layer and puts it in edit mode, the same
|
|
3
|
+
* way as clicking the feature on the map does.
|
|
4
|
+
* @param layerId id of the feature layer
|
|
5
|
+
* @returns callback to select a feature by its feature id
|
|
6
|
+
*/
|
|
7
|
+
export declare const useSelectDrawFeature: (layerId?: string) => ((featureId: string) => void);
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { defaultDomainFilter, defaultPhenomenonFilter, TimeFilter } from './filter-utils';
|
|
1
|
+
import type { defaultAreaFilter, defaultDomainFilter, defaultPhenomenonFilter, TimeFilter, defaultAreaFilter as fallbackAreaFilter } from './filter-utils';
|
|
2
2
|
import { AllPhenomenaKeys, defaultEmptyFilter, defaultLevelFilter, Domain } from './filter-utils';
|
|
3
3
|
import type { Warning } from '../../store/warningsForm/types';
|
|
4
4
|
export interface PickedFilterState {
|
|
@@ -6,6 +6,7 @@ export interface PickedFilterState {
|
|
|
6
6
|
domain: Partial<typeof defaultDomainFilter>;
|
|
7
7
|
phenomenon: Partial<typeof defaultPhenomenonFilter>;
|
|
8
8
|
level: Partial<typeof defaultLevelFilter>;
|
|
9
|
+
area: Partial<typeof defaultAreaFilter>;
|
|
9
10
|
time: TimeFilter;
|
|
10
11
|
}
|
|
11
12
|
export interface FilterState extends PickedFilterState {
|
|
@@ -13,6 +14,7 @@ export interface FilterState extends PickedFilterState {
|
|
|
13
14
|
domain: typeof defaultDomainFilter;
|
|
14
15
|
phenomenon: typeof defaultPhenomenonFilter;
|
|
15
16
|
level: typeof defaultLevelFilter;
|
|
17
|
+
area: typeof fallbackAreaFilter;
|
|
16
18
|
time: TimeFilter;
|
|
17
19
|
}
|
|
18
20
|
export type FilterKeyType = keyof FilterState;
|
|
@@ -26,6 +28,7 @@ export interface FilterHookState {
|
|
|
26
28
|
filterState: PickedFilterState;
|
|
27
29
|
timeFilter: TimeFilter;
|
|
28
30
|
}
|
|
31
|
+
export declare const getWarningDomain: (warning: Warning) => Domain;
|
|
29
32
|
export declare const getPhenomenaForDomainFilter: (domainFilter: Record<Domain, boolean>) => (keyof typeof AllPhenomenaKeys)[];
|
|
30
33
|
export declare const createWarningFilterPredicate: (warnings: Warning[], savedFilterState: FilterState) => ((warning: Warning) => boolean);
|
|
31
34
|
export declare const useWarningFilters: (warnings: Warning[], onUpdateFilters: (filterState: Partial<FilterState>, systemUpdate?: boolean) => void, savedFilterState: FilterState, presetFilterState?: PickedFilterState) => FilterHookState;
|
|
@@ -27,6 +27,7 @@ export declare const defaultDomainFilter: Record<Domain, boolean>;
|
|
|
27
27
|
export declare const domainLevels: Record<Domain, Level[]>;
|
|
28
28
|
export declare const defaultLevelFilter: Record<Level | 'unspecified', boolean>;
|
|
29
29
|
export declare const defaultEmptyFilter: Record<string, boolean>;
|
|
30
|
+
export declare const defaultAreaFilter: Record<string, boolean>;
|
|
30
31
|
export declare const makeFilterFromList: <T extends string>(options: T[], value?: boolean) => Record<T | "unspecified", boolean>;
|
|
31
32
|
declare const AllPhenomena: {
|
|
32
33
|
readonly wind: Phenomenon.wind;
|
|
@@ -87,6 +88,7 @@ export declare const updateState: <T extends string>(state: Record<T, boolean>,
|
|
|
87
88
|
/** Make sure our value is in the filter */
|
|
88
89
|
export declare const getValue: <T>(values: Record<string, T>, value: string) => T | "unspecified";
|
|
89
90
|
export declare const getFiltersFromWarnings: (warnings: Warning[], filterKey: string) => string[];
|
|
91
|
+
export declare const getAreasFromWarnings: (warnings: Warning[]) => string[];
|
|
90
92
|
export declare enum TimeFilterMode {
|
|
91
93
|
all = "all",
|
|
92
94
|
today = "today",
|
|
@@ -106,6 +108,7 @@ export declare const initialFilters: {
|
|
|
106
108
|
domain: Record<Domain, boolean>;
|
|
107
109
|
phenomenon: Record<string, boolean>;
|
|
108
110
|
level: Record<"unspecified" | Level, boolean>;
|
|
111
|
+
area: Record<string, boolean>;
|
|
109
112
|
time: TimeFilter;
|
|
110
113
|
};
|
|
111
114
|
export {};
|
|
@@ -8,4 +8,4 @@ export interface AreaListProps {
|
|
|
8
8
|
onToggleSelectArea?: (id: string) => void;
|
|
9
9
|
onSelectMultipleAreas: (ids: string[]) => void;
|
|
10
10
|
}
|
|
11
|
-
export declare const AreaList: React.MemoExoticComponent<({ areas, selected, disabled, isReadOnly, onToggleSelectArea, onSelectMultipleAreas, }: AreaListProps) =>
|
|
11
|
+
export declare const AreaList: React.MemoExoticComponent<({ areas, selected, disabled, isReadOnly, onToggleSelectArea, onSelectMultipleAreas, }: AreaListProps) => React.JSX.Element>;
|
|
@@ -15,4 +15,4 @@ export interface WarningListItemProps {
|
|
|
15
15
|
maritimeConfig: MaritimeWarningsConfig;
|
|
16
16
|
domain: MaritimeWarningsDomain;
|
|
17
17
|
}
|
|
18
|
-
export declare const WarningListItem: React.MemoExoticComponent<({ warning, areas, selectedAreaIds, onAddClick, onRemove, onChange, onToggleSelectArea, onSelectMultipleAreas, onRemoveArea, isReadOnly, shouldShowDistricts, maritimeConfig, domain, }: WarningListItemProps) =>
|
|
18
|
+
export declare const WarningListItem: React.MemoExoticComponent<({ warning, areas, selectedAreaIds, onAddClick, onRemove, onChange, onToggleSelectArea, onSelectMultipleAreas, onRemoveArea, isReadOnly, shouldShowDistricts, maritimeConfig, domain, }: WarningListItemProps) => React.JSX.Element>;
|
|
@@ -18,4 +18,4 @@ export interface WarningListSelectProps {
|
|
|
18
18
|
emptyMessage?: string;
|
|
19
19
|
validationResult?: true | 'error' | 'warning';
|
|
20
20
|
}
|
|
21
|
-
export declare const WarningListSelect: React.MemoExoticComponent<({ options, value, label, onChange, renderOption, renderValue, gridArea, additionalStyling, isReadOnly, emptyMessage, validationResult, }: WarningListSelectProps) =>
|
|
21
|
+
export declare const WarningListSelect: React.MemoExoticComponent<({ options, value, label, onChange, renderOption, renderValue, gridArea, additionalStyling, isReadOnly, emptyMessage, validationResult, }: WarningListSelectProps) => React.JSX.Element>;
|
|
@@ -6,6 +6,7 @@ interface WarningsClientProviderProps {
|
|
|
6
6
|
children: React.ReactNode;
|
|
7
7
|
optionalQueryClient?: QueryClient;
|
|
8
8
|
}
|
|
9
|
+
export declare const WarningsClientProvider: React.FC<WarningsClientProviderProps>;
|
|
9
10
|
export interface WarningsThemeProviderProps extends WarningsClientProviderProps {
|
|
10
11
|
theme?: Theme;
|
|
11
12
|
}
|
|
@@ -5,5 +5,6 @@ export interface PublicWarningListConnectProps {
|
|
|
5
5
|
panelId: string;
|
|
6
6
|
presetFilterState?: PickedFilterState;
|
|
7
7
|
presetExpandedSections?: ExpandedWarningSections;
|
|
8
|
+
onPreventCloseView?: (shouldPreventClose: boolean) => void;
|
|
8
9
|
}
|
|
9
10
|
export declare const PublicWarningListConnect: React.FC<PublicWarningListConnectProps>;
|
|
@@ -5,3 +5,4 @@ export type { WarningEventDialogProps } from './WarningEventDialog';
|
|
|
5
5
|
export { WarningEventDialogConnect } from './WarningEventDialogConnect';
|
|
6
6
|
export type { WarningEventDialogConnectProps } from './WarningEventDialogConnect';
|
|
7
7
|
export { useWarningEventActions } from './utils';
|
|
8
|
+
export { useCloseWarningEventDialogOnUnmount } from './useCloseWarningEventDialogOnUnmount';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const useCloseWarningEventDialogOnUnmount: (panelId: string) => void;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import type { DayRange } from './daySelectorUtils';
|
|
3
|
+
export interface DaySelectorProps {
|
|
4
|
+
selectedDays: DayRange;
|
|
5
|
+
onChange: (range: DayRange | null) => void;
|
|
6
|
+
isDisabled?: boolean;
|
|
7
|
+
now?: Date;
|
|
8
|
+
}
|
|
9
|
+
export declare const DaySelector: React.FC<DaySelectorProps>;
|
package/dist/src/lib/components/WarningEvents/WarningEventForm/DaySelector/daySelectorUtils.d.ts
ADDED
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
export type DayRange = [number, number];
|
|
2
|
+
export declare const CHIP_SIZE = 32;
|
|
3
|
+
export declare const dayOptions: {
|
|
4
|
+
label: string;
|
|
5
|
+
value: number;
|
|
6
|
+
}[];
|
|
7
|
+
export declare const MIN_DAY: number;
|
|
8
|
+
export declare const MAX_DAY: number;
|
|
9
|
+
export declare const clampDay: (day: number) => number;
|
|
10
|
+
export declare const normaliseRange: (anchor: number, focus: number) => DayRange;
|
|
11
|
+
export declare const isSameRange: (range: DayRange, other: DayRange) => boolean;
|
|
12
|
+
export declare const isDayInRange: (day: number, range: DayRange) => boolean;
|
|
13
|
+
export declare const resolveDayFromClientX: (clientX: number, containerLeft: number, chipSize?: number) => number;
|
|
14
|
+
export declare const getNextFocus: (focus: number, key: string) => number | null;
|
|
15
|
+
export declare const getDateForDay: (day: number, now: Date) => Date;
|
package/dist/src/lib/components/WarningEvents/WarningEventForm/DaySelector/useDaySelection.d.ts
ADDED
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import type { DayRange } from './daySelectorUtils';
|
|
3
|
+
export interface UseDaySelectionParams {
|
|
4
|
+
selectedDays: DayRange;
|
|
5
|
+
onChange: (range: DayRange | null) => void;
|
|
6
|
+
isDisabled?: boolean;
|
|
7
|
+
}
|
|
8
|
+
export interface UseDaySelectionResult {
|
|
9
|
+
containerRef: React.RefObject<HTMLDivElement | null>;
|
|
10
|
+
focusedDay: number;
|
|
11
|
+
previewRange: DayRange | null;
|
|
12
|
+
onPointerDown: (day: number, event: React.PointerEvent) => void;
|
|
13
|
+
onPointerMove: (event: React.PointerEvent) => void;
|
|
14
|
+
onPointerUp: (event: React.PointerEvent) => void;
|
|
15
|
+
onPointerCancel: (event: React.PointerEvent) => void;
|
|
16
|
+
onKeyDown: (day: number, event: React.KeyboardEvent) => void;
|
|
17
|
+
onChipFocus: (day: number) => void;
|
|
18
|
+
}
|
|
19
|
+
export declare const useDaySelection: ({ selectedDays, onChange, isDisabled, }: UseDaySelectionParams) => UseDaySelectionResult;
|
|
@@ -11,6 +11,7 @@ export interface WarningEventTimelineProps {
|
|
|
11
11
|
status?: PublicWarningStatus;
|
|
12
12
|
now?: Date;
|
|
13
13
|
isCompact?: boolean;
|
|
14
|
+
isActive?: boolean;
|
|
14
15
|
editing?: TimelineEditing;
|
|
15
16
|
}
|
|
16
17
|
interface AxisIntervals {
|
|
@@ -18,4 +19,5 @@ interface AxisIntervals {
|
|
|
18
19
|
labelHours: number;
|
|
19
20
|
}
|
|
20
21
|
export declare const getAxisIntervals: (rangeDays: number) => AxisIntervals;
|
|
22
|
+
export declare const formatDayHeader: (date: Date) => string;
|
|
21
23
|
export declare const WarningEventTimeline: React.FC<WarningEventTimelineProps>;
|
|
@@ -15,6 +15,7 @@ interface WarningEventTimelineBlockProps {
|
|
|
15
15
|
level: string;
|
|
16
16
|
status?: PublicWarningStatus;
|
|
17
17
|
isCompact?: boolean;
|
|
18
|
+
isActive?: boolean;
|
|
18
19
|
editing?: TimelineEditing;
|
|
19
20
|
}
|
|
20
21
|
export declare const WarningEventTimelineBlock: React.FC<WarningEventTimelineBlockProps>;
|
|
@@ -10,6 +10,7 @@ interface WarningEventTimelineBlockControlsProps {
|
|
|
10
10
|
maxPickerDate: Date;
|
|
11
11
|
editing: TimelineEditing;
|
|
12
12
|
showEditAffordances: boolean;
|
|
13
|
+
isActive?: boolean;
|
|
13
14
|
}
|
|
14
15
|
export declare const WarningEventTimelineBlockControls: React.FC<WarningEventTimelineBlockControlsProps>;
|
|
15
16
|
export {};
|
|
@@ -4,14 +4,12 @@ export declare const warningEventTypes: {
|
|
|
4
4
|
translationKey: string;
|
|
5
5
|
key: WarningEventType;
|
|
6
6
|
defaultDayRange: [number, number];
|
|
7
|
-
minSelectableDay: number;
|
|
8
7
|
}[];
|
|
9
8
|
export declare const warningEventModes: {
|
|
10
9
|
translationKey: string;
|
|
11
10
|
key: WarningEventMode;
|
|
12
11
|
}[];
|
|
13
12
|
export declare const getDefaultDayRangeForType: (type: WarningEventType) => [number, number];
|
|
14
|
-
export declare const getMinSelectableDayForType: (type: WarningEventType) => number;
|
|
15
13
|
export declare const getDefaultWarningTimes: (type: WarningEventType, now?: Date) => {
|
|
16
14
|
validFrom: string;
|
|
17
15
|
validUntil: string;
|
|
@@ -1,11 +1,22 @@
|
|
|
1
|
+
import type { FieldValues, FormState } from 'react-hook-form';
|
|
1
2
|
import type { Area, WarningEventBody, WarningEvent } from '../../../store/warningsForm/types';
|
|
2
3
|
import { PublicWarningStatus } from '../../../store/warningsForm/types';
|
|
3
4
|
interface FormData extends WarningEvent {
|
|
4
5
|
IS_DRAFT?: boolean | string;
|
|
5
6
|
}
|
|
6
7
|
export declare const buildSubmitValues: (values: FormData) => WarningEvent;
|
|
8
|
+
export declare const sortWarningsByActivity: (warnings: WarningEventBody[]) => WarningEventBody[];
|
|
7
9
|
export declare const getFormData: (warningsEvent: WarningEvent | undefined) => FormData;
|
|
8
10
|
export declare const constructWarningWithNewStatus: (warningsEvent: WarningEvent, status: PublicWarningStatus) => WarningEventBody[];
|
|
11
|
+
export declare const isWarningActive: (formState: FormState<FieldValues>, linkedWarningId: string) => boolean;
|
|
12
|
+
export declare const hasWarningStarted: (warning: Pick<WarningEventBody, "validFrom">) => boolean;
|
|
13
|
+
export declare const isWarningFinalised: (warning: Pick<WarningEventBody, "status">) => boolean;
|
|
14
|
+
export declare const getEventStatusActions: (warnings: WarningEventBody[]) => {
|
|
15
|
+
canExpire: boolean;
|
|
16
|
+
canWithdraw: boolean;
|
|
17
|
+
hasPendingWarnings: boolean;
|
|
18
|
+
};
|
|
19
|
+
export declare const getWarningStatusesForEventAction: (warnings: WarningEventBody[], action: PublicWarningStatus.EXPIRED | PublicWarningStatus.WITHDRAWN) => (PublicWarningStatus | undefined)[];
|
|
9
20
|
export declare const doAreasOverlap: (areasA?: Area[], areasB?: Area[]) => boolean;
|
|
10
21
|
export declare const doTimeRangesOverlap: (aFrom: string, aUntil: string, bFrom: string, bUntil: string) => boolean;
|
|
11
22
|
export declare const doWarningsOverlap: (warningA: WarningEventBody, warningB: WarningEventBody) => boolean;
|
|
@@ -8,5 +8,5 @@ interface WarningBlockProps {
|
|
|
8
8
|
top: number;
|
|
9
9
|
width: number;
|
|
10
10
|
}
|
|
11
|
-
export declare const WarningBlock: React.MemoExoticComponent<({ warning, highlighted, left, onHoverWarning, top, width, }: WarningBlockProps) =>
|
|
11
|
+
export declare const WarningBlock: React.MemoExoticComponent<({ warning, highlighted, left, onHoverWarning, top, width, }: WarningBlockProps) => React.JSX.Element>;
|
|
12
12
|
export {};
|
|
@@ -28,6 +28,6 @@ interface WarningBlocksLayerProps {
|
|
|
28
28
|
warningBlocks: WarningLayout[];
|
|
29
29
|
}
|
|
30
30
|
export declare const TimelineBackground: React.FC<TimelineBackgroundProps>;
|
|
31
|
-
export declare const WarningBlocksLayer: React.MemoExoticComponent<({ warningBlocks, hoveredWarningId, onHoverWarning, }: WarningBlocksLayerProps) =>
|
|
31
|
+
export declare const WarningBlocksLayer: React.MemoExoticComponent<({ warningBlocks, hoveredWarningId, onHoverWarning, }: WarningBlocksLayerProps) => React.JSX.Element>;
|
|
32
32
|
export declare const TimelineTimeBar: React.FC<TimelineTimeBarProps>;
|
|
33
33
|
export {};
|
|
@@ -10,6 +10,7 @@ export declare const initialWarningFilterPanelState: {
|
|
|
10
10
|
domain: Record<import("../../components/FilterList/filter-utils").Domain, boolean>;
|
|
11
11
|
phenomenon: Record<string, boolean>;
|
|
12
12
|
level: Record<"unspecified" | import("../../components/FilterList/filter-utils").Level, boolean>;
|
|
13
|
+
area: Record<string, boolean>;
|
|
13
14
|
time: import("../../components/FilterList/filter-utils").TimeFilter;
|
|
14
15
|
};
|
|
15
16
|
export declare const initialState: WarningsFiltersState;
|