@opengeoweb/warnings 9.32.1 → 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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@opengeoweb/warnings",
3
- "version": "9.32.1",
3
+ "version": "9.34.0",
4
4
  "description": "GeoWeb warinings library for the opengeoweb project",
5
5
  "license": "Apache-2.0",
6
6
  "repository": {
@@ -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 { FilterState, UpdateFilter } from './filter-hooks';
3
- type IdType = keyof FilterState;
2
+ import { PickedFilterState, UpdateFilter } from './filter-hooks';
3
+ type IdType = keyof PickedFilterState;
4
4
  interface Props {
5
5
  id: IdType;
6
- options: FilterState[IdType];
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 { FilterState, UpdateFilter } from './filter-hooks';
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?: FilterState;
8
+ filterState: PickedFilterState;
9
9
  updateFilter: UpdateFilter;
10
10
  }
11
11
  declare const FilterList: FC<FilterListProps>;
@@ -1,36 +1,22 @@
1
1
  import { PublicWarning } from '../../store/publicWarningForm/types';
2
- declare enum Domain {
3
- aviation = "aviation",
4
- maritime = "maritime",
5
- public = "public"
2
+ import { defaultDomainFilter, defaultLevelFilter, defaultPhenomenonFilter } from './filter-utils';
3
+ export interface PickedFilterState {
4
+ domain: Partial<typeof defaultDomainFilter>;
5
+ phenomenon: Partial<typeof defaultPhenomenonFilter>;
6
+ level: Partial<typeof defaultLevelFilter>;
6
7
  }
7
- declare enum Level {
8
- unspecified = "unspecified",
9
- extreme = "extreme",
10
- moderate = "moderate",
11
- severe = "severe"
12
- }
13
- declare const defaultDomainFilter: Record<Domain, boolean>;
14
- declare const defaultLevelFilter: Record<Level, boolean>;
15
- type OptionsType = typeof defaultDomainFilter | typeof defaultLevelFilter;
16
- export interface FilterState {
8
+ interface FilterState extends PickedFilterState {
17
9
  domain: typeof defaultDomainFilter;
10
+ phenomenon: typeof defaultPhenomenonFilter;
18
11
  level: typeof defaultLevelFilter;
19
12
  }
20
13
  export type FilterKeyType = keyof FilterState;
21
14
  export type OptionKey<T extends FilterKeyType> = keyof FilterState[T];
22
15
  export type UpdateFilter = <T extends FilterKeyType>(filterKey: T | 'ALL', optionKey: OptionKey<T> | 'ALL', value: boolean, only?: boolean) => void;
23
- export declare const useWarningFilters: () => {
24
- filterState: FilterState;
16
+ export declare const useWarningFilters: (warnings: PublicWarning[]) => {
17
+ filterState: PickedFilterState;
25
18
  allSelected: boolean;
26
19
  updateFilter: UpdateFilter;
27
20
  byFilterState: (warning: PublicWarning) => boolean;
28
21
  };
29
- interface OptionsMetadata {
30
- /** The number of selected options */
31
- noSelectedOptions: number;
32
- /** Whether or not all options are selected */
33
- allSelected: boolean;
34
- }
35
- export declare const useSelectedOptions: (options: OptionsType) => OptionsMetadata;
36
22
  export {};
@@ -0,0 +1,38 @@
1
+ export declare enum Domain {
2
+ aviation = "aviation",
3
+ maritime = "maritime",
4
+ public = "public"
5
+ }
6
+ export declare enum Level {
7
+ extreme = "extreme",
8
+ moderate = "moderate",
9
+ severe = "severe",
10
+ airmet = "AIR",
11
+ sigmet = "SIG"
12
+ }
13
+ export declare enum Phenomenon {
14
+ wind = "wind",
15
+ fog = "fog",
16
+ thunderstorm = "thunderstorm",
17
+ snowIce = "snowIce",
18
+ rain = "rain",
19
+ highTemp = "highTemp",
20
+ lowTemp = "lowTemp",
21
+ coastalEvent = "coastalEvent"
22
+ }
23
+ export declare const defaultDomainFilter: Record<Domain, boolean>;
24
+ export declare const domainLevels: Record<Domain, Level[]>;
25
+ export declare const defaultLevelFilter: Record<Level | 'unspecified', boolean>;
26
+ export declare const defaultPhenomenonFilter: Record<Phenomenon | 'unspecified', boolean>;
27
+ type OptionsType = Partial<Record<Domain | Level | Phenomenon, boolean>>;
28
+ interface OptionsMetadata {
29
+ /** The number of selected options */
30
+ noSelectedOptions: number;
31
+ /** Whether or not all options are selected */
32
+ allSelected: boolean;
33
+ }
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';
38
+ export {};
@@ -0,0 +1,7 @@
1
+ import React from 'react';
2
+ interface NewWarningButtonProps {
3
+ onCreateWarning: () => void;
4
+ isDefaultOpen?: boolean;
5
+ }
6
+ export declare const NewWarningButton: React.FC<NewWarningButtonProps>;
7
+ 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;
@@ -20,4 +20,5 @@ export declare const PublicWarningsFormDialog: React.FC<{
20
20
  shouldHideFormMode?: boolean;
21
21
  publicWarningEditor?: string;
22
22
  selectedAviationProduct?: AviationProduct;
23
+ warningType?: string;
23
24
  }>;
@@ -1,5 +1,6 @@
1
1
  import { RefObject } from 'react';
2
2
  import { PublicWarning, PublicWarningStatus } from '../store/publicWarningForm/types';
3
+ import { PickedFilterState, OptionKey } from '../components/FilterList/filter-hooks';
3
4
  interface OverflowCheckResult {
4
5
  ref: RefObject<HTMLDivElement>;
5
6
  isOverflowing: boolean;
@@ -9,4 +10,5 @@ export declare const getWarningWithoutIdStatusEditor: (warning: PublicWarning) =
9
10
  export declare const getWarningWithLinkedToId: (warning: PublicWarning) => PublicWarning;
10
11
  export declare const getWarningWithProposalId: (warning: PublicWarning) => PublicWarning;
11
12
  export default function useOverflowCheck(text: string): OverflowCheckResult;
13
+ export declare const getTranslationKey: (optionId: OptionKey<keyof PickedFilterState>, id: string) => string;
12
14
  export {};