@opengeoweb/warnings 9.33.0 → 9.34.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 +4638 -7171
- package/package.json +1 -1
- package/src/lib/aviation-api/api.d.ts +7 -0
- package/src/lib/components/FilterList/ExpandableFilterChip.d.ts +3 -3
- package/src/lib/components/FilterList/FilterList.d.ts +2 -2
- package/src/lib/components/FilterList/filter-hooks.d.ts +9 -3
- package/src/lib/components/FilterList/filter-hooks.spec.d.ts +1 -0
- package/src/lib/components/FilterList/filter-utils.d.ts +7 -1
- package/src/lib/components/PublicWarningList/NewWarningButton/NewWarningButton.d.ts +7 -0
- package/src/lib/components/PublicWarningList/NewWarningButton/NewWarningButton.stories.d.ts +13 -0
- package/src/lib/components/PublicWarningList/WarningListHeaderContent.d.ts +11 -0
- package/src/lib/components/PublicWarningList/WarningListHeaderContent.spec.d.ts +1 -0
- package/src/lib/components/PublicWarningsFormDialog/PublicWarningsFormDialog.d.ts +1 -0
- package/src/lib/utils/warningUtils.d.ts +2 -2
package/package.json
CHANGED
|
@@ -1,7 +1,14 @@
|
|
|
1
1
|
import { Credentials } from '@opengeoweb/authentication';
|
|
2
2
|
import { AirmetConfig, AirmetFromBackend, SigmetConfig, SigmetFromBackend } from '@opengeoweb/api';
|
|
3
|
+
import { AviationProduct } from '@opengeoweb/sigmet-airmet';
|
|
3
4
|
export declare const getAirmetList: (auth: Credentials) => Promise<AirmetFromBackend[]>;
|
|
4
5
|
export declare const getSigmetList: (auth: Credentials) => Promise<SigmetFromBackend[]>;
|
|
5
6
|
export declare const getlocalProductConfig: <T extends SigmetConfig | AirmetConfig>(configUrl: string) => Promise<T>;
|
|
6
7
|
export declare const getAirmetConfig: (auth: Credentials) => Promise<AirmetConfig>;
|
|
7
8
|
export declare const getSigmetConfig: (auth: Credentials) => Promise<SigmetConfig>;
|
|
9
|
+
export declare const getAirmetTAC: (auth: Credentials, product: AviationProduct) => Promise<{
|
|
10
|
+
data: string;
|
|
11
|
+
}>;
|
|
12
|
+
export declare const getSigmetTAC: (auth: Credentials, product: AviationProduct) => Promise<{
|
|
13
|
+
data: string;
|
|
14
|
+
}>;
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
|
-
import {
|
|
3
|
-
type IdType = keyof
|
|
2
|
+
import { PickedFilterState, UpdateFilter } from './filter-hooks';
|
|
3
|
+
type IdType = keyof PickedFilterState;
|
|
4
4
|
interface Props {
|
|
5
5
|
id: IdType;
|
|
6
|
-
options:
|
|
6
|
+
options: PickedFilterState[IdType];
|
|
7
7
|
updateFilter: UpdateFilter;
|
|
8
8
|
}
|
|
9
9
|
declare const ExpandableFilterChip: React.FC<Props>;
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import { FC } from 'react';
|
|
2
2
|
import { WarningListFilter } from '../../store/publicWarnings/types';
|
|
3
|
-
import {
|
|
3
|
+
import { PickedFilterState, UpdateFilter } from './filter-hooks';
|
|
4
4
|
interface FilterListProps {
|
|
5
5
|
filters?: WarningListFilter[];
|
|
6
6
|
onClickAll?: (isChecked: boolean) => void;
|
|
7
7
|
isAllSelected?: boolean;
|
|
8
|
-
filterState:
|
|
8
|
+
filterState: PickedFilterState;
|
|
9
9
|
updateFilter: UpdateFilter;
|
|
10
10
|
}
|
|
11
11
|
declare const FilterList: FC<FilterListProps>;
|
|
@@ -1,16 +1,22 @@
|
|
|
1
1
|
import { PublicWarning } from '../../store/publicWarningForm/types';
|
|
2
2
|
import { defaultDomainFilter, defaultLevelFilter, defaultPhenomenonFilter } from './filter-utils';
|
|
3
|
-
export interface
|
|
4
|
-
domain: typeof defaultDomainFilter
|
|
3
|
+
export interface PickedFilterState {
|
|
4
|
+
domain: Partial<typeof defaultDomainFilter>;
|
|
5
5
|
phenomenon: Partial<typeof defaultPhenomenonFilter>;
|
|
6
|
+
level: Partial<typeof defaultLevelFilter>;
|
|
7
|
+
}
|
|
8
|
+
interface FilterState extends PickedFilterState {
|
|
9
|
+
domain: typeof defaultDomainFilter;
|
|
10
|
+
phenomenon: typeof defaultPhenomenonFilter;
|
|
6
11
|
level: typeof defaultLevelFilter;
|
|
7
12
|
}
|
|
8
13
|
export type FilterKeyType = keyof FilterState;
|
|
9
14
|
export type OptionKey<T extends FilterKeyType> = keyof FilterState[T];
|
|
10
15
|
export type UpdateFilter = <T extends FilterKeyType>(filterKey: T | 'ALL', optionKey: OptionKey<T> | 'ALL', value: boolean, only?: boolean) => void;
|
|
11
16
|
export declare const useWarningFilters: (warnings: PublicWarning[]) => {
|
|
12
|
-
filterState:
|
|
17
|
+
filterState: PickedFilterState;
|
|
13
18
|
allSelected: boolean;
|
|
14
19
|
updateFilter: UpdateFilter;
|
|
15
20
|
byFilterState: (warning: PublicWarning) => boolean;
|
|
16
21
|
};
|
|
22
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -6,7 +6,9 @@ export declare enum Domain {
|
|
|
6
6
|
export declare enum Level {
|
|
7
7
|
extreme = "extreme",
|
|
8
8
|
moderate = "moderate",
|
|
9
|
-
severe = "severe"
|
|
9
|
+
severe = "severe",
|
|
10
|
+
airmet = "AIR",
|
|
11
|
+
sigmet = "SIG"
|
|
10
12
|
}
|
|
11
13
|
export declare enum Phenomenon {
|
|
12
14
|
wind = "wind",
|
|
@@ -19,6 +21,7 @@ export declare enum Phenomenon {
|
|
|
19
21
|
coastalEvent = "coastalEvent"
|
|
20
22
|
}
|
|
21
23
|
export declare const defaultDomainFilter: Record<Domain, boolean>;
|
|
24
|
+
export declare const domainLevels: Record<Domain, Level[]>;
|
|
22
25
|
export declare const defaultLevelFilter: Record<Level | 'unspecified', boolean>;
|
|
23
26
|
export declare const defaultPhenomenonFilter: Record<Phenomenon | 'unspecified', boolean>;
|
|
24
27
|
type OptionsType = Partial<Record<Domain | Level | Phenomenon, boolean>>;
|
|
@@ -29,4 +32,7 @@ interface OptionsMetadata {
|
|
|
29
32
|
allSelected: boolean;
|
|
30
33
|
}
|
|
31
34
|
export declare const useSelectedOptions: (options: OptionsType) => OptionsMetadata;
|
|
35
|
+
export declare const updateState: <T extends string>(state: Record<T, boolean>, optionKey: T | 'ALL', value: boolean, only?: boolean) => Record<T, boolean>;
|
|
36
|
+
/** Make sure our value is in the filter */
|
|
37
|
+
export declare const getValue: <T>(values: Record<string, T>, value: string) => T | 'unspecified';
|
|
32
38
|
export {};
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
declare const _default: {
|
|
3
|
+
title: string;
|
|
4
|
+
};
|
|
5
|
+
export default _default;
|
|
6
|
+
export declare const NewWarningButtonLight: {
|
|
7
|
+
(): React.ReactElement;
|
|
8
|
+
tags: string[];
|
|
9
|
+
};
|
|
10
|
+
export declare const NewWarningButtonDark: {
|
|
11
|
+
(): React.ReactElement;
|
|
12
|
+
tags: string[];
|
|
13
|
+
};
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { Grid2Props } from '@mui/material';
|
|
3
|
+
declare const WarningListHeaderContent: React.FC<Grid2Props & {
|
|
4
|
+
title: string;
|
|
5
|
+
width?: number;
|
|
6
|
+
onClick?: () => void;
|
|
7
|
+
isSorted?: boolean;
|
|
8
|
+
sortDirection?: 'asc' | 'desc';
|
|
9
|
+
sortable?: boolean;
|
|
10
|
+
}>;
|
|
11
|
+
export default WarningListHeaderContent;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { RefObject } from 'react';
|
|
2
2
|
import { PublicWarning, PublicWarningStatus } from '../store/publicWarningForm/types';
|
|
3
|
-
import {
|
|
3
|
+
import { PickedFilterState, OptionKey } from '../components/FilterList/filter-hooks';
|
|
4
4
|
interface OverflowCheckResult {
|
|
5
5
|
ref: RefObject<HTMLDivElement>;
|
|
6
6
|
isOverflowing: boolean;
|
|
@@ -10,5 +10,5 @@ export declare const getWarningWithoutIdStatusEditor: (warning: PublicWarning) =
|
|
|
10
10
|
export declare const getWarningWithLinkedToId: (warning: PublicWarning) => PublicWarning;
|
|
11
11
|
export declare const getWarningWithProposalId: (warning: PublicWarning) => PublicWarning;
|
|
12
12
|
export default function useOverflowCheck(text: string): OverflowCheckResult;
|
|
13
|
-
export declare const getTranslationKey: (optionId: OptionKey<keyof
|
|
13
|
+
export declare const getTranslationKey: (optionId: OptionKey<keyof PickedFilterState>, id: string) => string;
|
|
14
14
|
export {};
|