@opengeoweb/shared 9.25.2 → 9.26.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 CHANGED
@@ -3487,6 +3487,7 @@ $$a({ target: 'Promise', stat: true, forced: FORCED_PROMISE_CONSTRUCTOR }, {
3487
3487
  *
3488
3488
  * Copyright 2021 - Koninklijk Nederlands Meteorologisch Instituut (KNMI)
3489
3489
  * Copyright 2021 - Finnish Meteorological Institute (FMI)
3490
+ * Copyright 2024 - The Norwegian Meteorological Institute (MET Norway)
3490
3491
  * */
3491
3492
  const showPrompt = event => {
3492
3493
  // eslint-disable-next-line @typescript-eslint/ban-ts-comment
@@ -3522,6 +3523,7 @@ function usePreventBrowserClose(shouldPreventClose) {
3522
3523
  *
3523
3524
  * Copyright 2023 - Koninklijk Nederlands Meteorologisch Instituut (KNMI)
3524
3525
  * Copyright 2023 - Finnish Meteorological Institute (FMI)
3526
+ * Copyright 2024 - The Norwegian Meteorological Institute (MET Norway)
3525
3527
  * */
3526
3528
  const pollingIntervalTimeout = 300000;
3527
3529
  const usePoller = (deps, callback, pollingInterval = pollingIntervalTimeout) => {
@@ -3560,6 +3562,7 @@ const usePoller = (deps, callback, pollingInterval = pollingIntervalTimeout) =>
3560
3562
  *
3561
3563
  * Copyright 2021 - Koninklijk Nederlands Meteorologisch Instituut (KNMI)
3562
3564
  * Copyright 2021 - Finnish Meteorological Institute (FMI)
3565
+ * Copyright 2024 - The Norwegian Meteorological Institute (MET Norway)
3563
3566
  * */
3564
3567
  function usePrevious(value) {
3565
3568
  const ref = React.useRef();
@@ -3584,6 +3587,7 @@ function usePrevious(value) {
3584
3587
  *
3585
3588
  * Copyright 2021 - Koninklijk Nederlands Meteorologisch Instituut (KNMI)
3586
3589
  * Copyright 2021 - Finnish Meteorological Institute (FMI)
3590
+ * Copyright 2024 - The Norwegian Meteorological Institute (MET Norway)
3587
3591
  * */
3588
3592
  const useIsMounted = () => {
3589
3593
  const isMounted = React.useRef(false);
@@ -6261,6 +6265,7 @@ const useUserMenu = (open = false) => {
6261
6265
  *
6262
6266
  * Copyright 2021 - Koninklijk Nederlands Meteorologisch Instituut (KNMI)
6263
6267
  * Copyright 2021 - Finnish Meteorological Institute (FMI)
6268
+ * Copyright 2024 - The Norwegian Meteorological Institute (MET Norway)
6264
6269
  * */
6265
6270
  const getInitials = name => {
6266
6271
  if (!name) {
@@ -8487,10 +8492,24 @@ const Filter = /*#__PURE__*/React.forwardRef((_a, ref) => {
8487
8492
  }));
8488
8493
  });
8489
8494
 
8495
+ const FilterLabel = ({
8496
+ name
8497
+ }) => jsx(Typography, Object.assign({
8498
+ variant: "body2",
8499
+ sx: {
8500
+ fontSize: '16px',
8501
+ textOverflow: 'ellipsis',
8502
+ whiteSpace: 'nowrap',
8503
+ overflow: 'hidden'
8504
+ }
8505
+ }, {
8506
+ children: name
8507
+ }));
8490
8508
  const FilterListItem = ({
8491
8509
  filter,
8492
8510
  toggleFilter: _toggleFilter = () => {},
8493
- enableOnlyOneFilter: _enableOnlyOneFilter = () => {}
8511
+ enableOnlyOneFilter: _enableOnlyOneFilter = () => {},
8512
+ children
8494
8513
  }) => {
8495
8514
  const {
8496
8515
  t
@@ -8567,17 +8586,9 @@ const FilterListItem = ({
8567
8586
  }
8568
8587
  }
8569
8588
  })
8570
- })), jsx(Typography, Object.assign({
8571
- variant: "body2",
8572
- sx: {
8573
- fontSize: '16px',
8574
- textOverflow: 'ellipsis',
8575
- whiteSpace: 'nowrap',
8576
- overflow: 'hidden'
8577
- }
8578
- }, {
8579
- children: name
8580
- })), isHovering ? jsx(ListItemSecondaryAction, {
8589
+ })), children || jsx(FilterLabel, {
8590
+ name: name
8591
+ }), isHovering ? jsx(ListItemSecondaryAction, {
8581
8592
  children: jsx(CustomIconButton, Object.assign({
8582
8593
  "aria-label": `Only ${filter.name}`,
8583
8594
  style: {
@@ -8619,6 +8630,7 @@ const FilterListItem = ({
8619
8630
  *
8620
8631
  * Copyright 2021 - Koninklijk Nederlands Meteorologisch Instituut (KNMI)
8621
8632
  * Copyright 2021 - Finnish Meteorological Institute (FMI)
8633
+ * Copyright 2024 - The Norwegian Meteorological Institute (MET Norway)
8622
8634
  * */
8623
8635
  const DEFAULT_ERROR_MESSAGE = 'An error has occurred';
8624
8636
  // Guard function for detecting an AxiosError (typically the kind of error returned by the backend)
@@ -8728,6 +8740,7 @@ fixRegExpWellKnownSymbolLogic('match', function (MATCH, nativeMatch, maybeCallNa
8728
8740
  *
8729
8741
  * Copyright 2024 - Koninklijk Nederlands Meteorologisch Instituut (KNMI)
8730
8742
  * Copyright 2024 - Finnish Meteorological Institute (FMI)
8743
+ * Copyright 2024 - The Norwegian Meteorological Institute (MET Norway)
8731
8744
  * */
8732
8745
  const DATE_FORMAT_DATEPICKER = 'dd/MM/yyyy HH:mm';
8733
8746
  const DATE_FORMAT_UTC = "yyyy-MM-dd'T'HH:mm:ss'Z'";
@@ -9066,13 +9079,13 @@ const getUtcFromString = dateStr => {
9066
9079
  }
9067
9080
  return isoStringToDate(dateStr);
9068
9081
  };
9069
- const hasOffset = input => {
9070
- return !!getOffsetStr(input);
9082
+ const hasOffset = dateStr => {
9083
+ return !!getOffsetStr(dateStr);
9071
9084
  };
9072
- const getOffsetStr = input => {
9073
- const isoDatePattern = /(\d{4}-\d{2}-\d{2})T(\d{2}:\d{2}:\d{2})(\.\d+)?([+-]\d{2}:?\d{2}|Z)$/;
9074
- const groups = input.match(isoDatePattern);
9075
- return groups ? groups[4] : null;
9085
+ const getOffsetStr = dateStr => {
9086
+ const offsetMatcher = /T.*([+-]\d{2}(:?\d{2})?|Z)$/;
9087
+ const groups = dateStr.match(offsetMatcher);
9088
+ return groups ? groups[1] : null;
9076
9089
  };
9077
9090
  /**
9078
9091
  * Check if a date object is valid
@@ -9317,6 +9330,7 @@ const convertNOWandTODAYFormatsToUTC = timeValue => {
9317
9330
  *
9318
9331
  * Copyright 2022 - Koninklijk Nederlands Meteorologisch Instituut (KNMI)
9319
9332
  * Copyright 2022 - Finnish Meteorological Institute (FMI)
9333
+ * Copyright 2024 - The Norwegian Meteorological Institute (MET Norway)
9320
9334
  * */
9321
9335
 
9322
9336
  var index = /*#__PURE__*/Object.freeze({
@@ -9389,6 +9403,7 @@ var index = /*#__PURE__*/Object.freeze({
9389
9403
  *
9390
9404
  * Copyright 2023 - Koninklijk Nederlands Meteorologisch Instituut (KNMI)
9391
9405
  * Copyright 2023 - Finnish Meteorological Institute (FMI)
9406
+ * Copyright 2024 - The Norwegian Meteorological Institute (MET Norway)
9392
9407
  * */
9393
9408
  const createMockStoreWithEggs = mockState => {
9394
9409
  const mockStore = configureStore();
@@ -9432,6 +9447,99 @@ const createToolkitMockStoreWithEggs = storeConfig => {
9432
9447
  *
9433
9448
  * Copyright 2024 - Koninklijk Nederlands Meteorologisch Instituut (KNMI)
9434
9449
  * Copyright 2024 - Finnish Meteorological Institute (FMI)
9450
+ * Copyright 2024 - The Norwegian Meteorological Institute (MET Norway)
9451
+ * */
9452
+ const PROJECTION = {
9453
+ EPSG_3035: {
9454
+ name: 'ETRS89-extended / LAEA Europe',
9455
+ value: 'EPSG:3035'
9456
+ },
9457
+ EPSG_3067: {
9458
+ name: 'ETRS89 / TM35FIN(E,N) -- Finland',
9459
+ value: 'EPSG:3067'
9460
+ },
9461
+ EPSG_3411: {
9462
+ name: 'Sea Ice Polar Stereographic North',
9463
+ value: 'EPSG:3411'
9464
+ },
9465
+ EPSG_3412: {
9466
+ name: 'Sea Ice Polar Stereographic South',
9467
+ value: 'EPSG:3412'
9468
+ },
9469
+ EPSG_3575: {
9470
+ name: 'Northern Hemisphere North Pole',
9471
+ value: 'EPSG:3575'
9472
+ },
9473
+ EPSG_3785: {
9474
+ name: 'Pseudo-Mercator',
9475
+ value: 'EPSG:3785'
9476
+ },
9477
+ EPSG_3857: {
9478
+ name: 'Europe Mercator',
9479
+ value: 'EPSG:3857'
9480
+ },
9481
+ EPSG_4258: {
9482
+ name: 'ETRS89',
9483
+ value: 'EPSG:4258'
9484
+ },
9485
+ EPSG_4269: {
9486
+ name: 'NAD83 (long/lat)',
9487
+ value: 'EPSG:4269'
9488
+ },
9489
+ EPSG_4325: {
9490
+ name: 'Guam Map Grid',
9491
+ value: 'EPSG:4325'
9492
+ },
9493
+ EPSG_4326: {
9494
+ name: 'WGS 84 - WGS84 - World Geodetic System',
9495
+ value: 'EPSG:4326'
9496
+ },
9497
+ EPSG_7399: {
9498
+ name: 'WISCRS Vilas County (ftUS)',
9499
+ value: 'EPSG:7399'
9500
+ },
9501
+ EPSG_25832: {
9502
+ name: 'ETRS89 / UTM zone 32N',
9503
+ value: 'EPSG:25832'
9504
+ },
9505
+ EPSG_28992: {
9506
+ name: 'The Netherlands (28992)',
9507
+ value: 'EPSG:28992'
9508
+ },
9509
+ EPSG_32661: {
9510
+ name: 'Europe Polar Stereographic',
9511
+ value: 'EPSG:32661'
9512
+ },
9513
+ EPSG_54030: {
9514
+ name: 'Europe Robinson',
9515
+ value: 'EPSG:54030'
9516
+ },
9517
+ EPSG_900913: {
9518
+ name: 'Google Maps Global Mercator',
9519
+ value: 'EPSG:900913'
9520
+ },
9521
+ EPSG_102100: {
9522
+ name: 'WGS 84 / Pseudo-Mercator',
9523
+ value: 'EPSG:102100'
9524
+ }
9525
+ };
9526
+
9527
+ /* *
9528
+ * Licensed under the Apache License, Version 2.0 (the "License");
9529
+ * you may not use this file except in compliance with the License.
9530
+ * You may obtain a copy of the License at
9531
+ *
9532
+ * http://www.apache.org/licenses/LICENSE-2.0
9533
+ *
9534
+ * Unless required by applicable law or agreed to in writing, software
9535
+ * distributed under the License is distributed on an "AS IS" BASIS,
9536
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
9537
+ * See the License for the specific language governing permissions and
9538
+ * limitations under the License.
9539
+ *
9540
+ * Copyright 2024 - Koninklijk Nederlands Meteorologisch Instituut (KNMI)
9541
+ * Copyright 2024 - Finnish Meteorological Institute (FMI)
9542
+ * Copyright 2024 - The Norwegian Meteorological Institute (MET Norway)
9435
9543
  * */
9436
9544
  /**
9437
9545
  * Utility function to keep track of number of renders by a react component
@@ -9465,4 +9573,4 @@ class RenderCounter {
9465
9573
  }
9466
9574
  const renderCounter = new RenderCounter();
9467
9575
 
9468
- export { AlertBanner, AlertIcon, AppHeader, AppLayout, Avatar, CanvasComponent, ConfirmationDialog, ConfirmationServiceProvider, CustomAccordion, CustomDialog, CustomIconButton, CustomSlider, CustomToggleButton, CustomTooltip, DEBOUNCE_TIMEOUT, DEFAULT_ERROR_MESSAGE, DEFAULT_FILTER_HEIGHT, DraggableComponent$1 as Draggable, ErrorBoundary, Filter, FilterChip, FilterListItem, LastUpdateTime, ResizeComponent as Resizable, SHARED_NAMESPACE, SearchField$1 as SearchField, SearchFieldButton, SearchHighlight, StatusTag, SwitchButton, ToggleMenu, ToolContainer, DraggableComponent as ToolContainerDraggable, ToolFooter, ToolHeader, TooltipSelect, UserMenu, UserMenuItemCheatSheet, UserMenuItemSentryRecording, MenuItemTheme as UserMenuItemTheme, adjustPosition, calculateDialogSizeAndPosition, calculateStartSize, createMockStoreWithEggs, createMockStoreWithEggsAndMiddleware, createToolkitMockStoreWithEggs, index as dateUtils, defaultDelay, getAxiosErrorMessage, getAxiosWarningMessage, getErrorMessage, getInitials, getLastUpdateTitle, getPosition, getWarningMessage, isAxiosAuthError, isAxiosError, pollingIntervalTimeout, renderCounter, sharedTranslations, showPrompt, sliderHeaderStyle, tooltipContainerStyles, useConfirmationDialog, useControlledTooltip, useDebounce, useDialogActions, useIsMounted, useMakeSureContainerStaysInsideWindow, usePoller, usePreventBrowserClose, usePrevious, useUserMenu, withEggs };
9576
+ export { AlertBanner, AlertIcon, AppHeader, AppLayout, Avatar, CanvasComponent, ConfirmationDialog, ConfirmationServiceProvider, CustomAccordion, CustomDialog, CustomIconButton, CustomSlider, CustomToggleButton, CustomTooltip, DEBOUNCE_TIMEOUT, DEFAULT_ERROR_MESSAGE, DEFAULT_FILTER_HEIGHT, DraggableComponent$1 as Draggable, ErrorBoundary, Filter, FilterChip, FilterLabel, FilterListItem, LastUpdateTime, PROJECTION, ResizeComponent as Resizable, SHARED_NAMESPACE, SearchField$1 as SearchField, SearchFieldButton, SearchHighlight, StatusTag, SwitchButton, ToggleMenu, ToolContainer, DraggableComponent as ToolContainerDraggable, ToolFooter, ToolHeader, TooltipSelect, UserMenu, UserMenuItemCheatSheet, UserMenuItemSentryRecording, MenuItemTheme as UserMenuItemTheme, adjustPosition, calculateDialogSizeAndPosition, calculateStartSize, createMockStoreWithEggs, createMockStoreWithEggsAndMiddleware, createToolkitMockStoreWithEggs, index as dateUtils, defaultDelay, getAxiosErrorMessage, getAxiosWarningMessage, getErrorMessage, getInitials, getLastUpdateTitle, getPosition, getWarningMessage, isAxiosAuthError, isAxiosError, pollingIntervalTimeout, renderCounter, sharedTranslations, showPrompt, sliderHeaderStyle, tooltipContainerStyles, useConfirmationDialog, useControlledTooltip, useDebounce, useDialogActions, useIsMounted, useMakeSureContainerStaysInsideWindow, usePoller, usePreventBrowserClose, usePrevious, useUserMenu, withEggs };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@opengeoweb/shared",
3
- "version": "9.25.2",
3
+ "version": "9.26.0",
4
4
  "description": "GeoWeb shared library with shared components and utils for the opengeoweb project",
5
5
  "license": "Apache-2.0",
6
6
  "repository": {
@@ -9,5 +9,9 @@ export interface FilterListItemProps {
9
9
  filter: Filter;
10
10
  toggleFilter?: (filterIds: string[]) => void;
11
11
  enableOnlyOneFilter?: (filterId: string) => void;
12
+ children?: React.ReactNode;
12
13
  }
14
+ export declare const FilterLabel: React.FC<{
15
+ name: string;
16
+ }>;
13
17
  export declare const FilterListItem: React.FC<FilterListItemProps>;
@@ -1,7 +1,7 @@
1
1
  export { default as Filter } from './Filter';
2
2
  export { DEFAULT_FILTER_HEIGHT } from './Filter';
3
3
  export type { ListFilter } from './FilterList';
4
- export { FilterListItem } from './FilterListItem';
4
+ export { FilterListItem, FilterLabel } from './FilterListItem';
5
5
  export type { Filter as FilterListItemFilter, FilterListItemProps, } from './FilterListItem';
6
6
  export { default as FilterChip } from './FilterChip';
7
7
  export type { FilterChipProps } from './FilterChip';
@@ -44,3 +44,63 @@ export interface TimeSeriesService {
44
44
  }
45
45
  export type ServiceInterface = 'EDR' | 'OGC';
46
46
  export type TimeseriesServiceScope = 'user' | 'system';
47
+ export interface PlotPreset {
48
+ connectedMap?: string;
49
+ mapId: string;
50
+ plots: Plot[];
51
+ parameters: PlotParameter[];
52
+ }
53
+ export interface Plot {
54
+ title: string;
55
+ plotId: string;
56
+ enabled?: boolean;
57
+ parameters?: PlotParameter[];
58
+ }
59
+ export interface PlotParameter {
60
+ id?: string;
61
+ plotId: string;
62
+ unit?: string;
63
+ propertyName: string;
64
+ plotType: PlotType | 'area';
65
+ enabled?: boolean;
66
+ color?: string;
67
+ opacity?: number;
68
+ serviceId: string;
69
+ collectionId: string;
70
+ instanceId?: string;
71
+ instances?: EDRInstance[];
72
+ }
73
+ export type PlotType = 'bar' | 'line' | 'scatter';
74
+ export interface EDRInstance {
75
+ id: string;
76
+ data_queries?: {
77
+ position?: {
78
+ link: {
79
+ variables: {
80
+ output_formats: string[];
81
+ };
82
+ };
83
+ };
84
+ locations?: {
85
+ link: {
86
+ variables: {
87
+ output_formats: string[];
88
+ };
89
+ };
90
+ };
91
+ instances?: {
92
+ link: string;
93
+ };
94
+ };
95
+ extent?: {
96
+ temporal?: {
97
+ interval: string[][];
98
+ crs: string;
99
+ values: string[];
100
+ };
101
+ spatial: {
102
+ crs: string;
103
+ bbox: [number, number, number, number];
104
+ };
105
+ };
106
+ }
@@ -1,4 +1,5 @@
1
1
  export * from './axiosErrorUtils';
2
2
  export * as dateUtils from './dateUtils';
3
3
  export * from './reduxTestUtils';
4
+ export * from './mapProjections';
4
5
  export { renderCounter } from './renderCounter';
@@ -0,0 +1,75 @@
1
+ export declare const PROJECTION: {
2
+ readonly EPSG_3035: {
3
+ readonly name: "ETRS89-extended / LAEA Europe";
4
+ readonly value: "EPSG:3035";
5
+ };
6
+ readonly EPSG_3067: {
7
+ readonly name: "ETRS89 / TM35FIN(E,N) -- Finland";
8
+ readonly value: "EPSG:3067";
9
+ };
10
+ readonly EPSG_3411: {
11
+ readonly name: "Sea Ice Polar Stereographic North";
12
+ readonly value: "EPSG:3411";
13
+ };
14
+ readonly EPSG_3412: {
15
+ readonly name: "Sea Ice Polar Stereographic South";
16
+ readonly value: "EPSG:3412";
17
+ };
18
+ readonly EPSG_3575: {
19
+ readonly name: "Northern Hemisphere North Pole";
20
+ readonly value: "EPSG:3575";
21
+ };
22
+ readonly EPSG_3785: {
23
+ readonly name: "Pseudo-Mercator";
24
+ readonly value: "EPSG:3785";
25
+ };
26
+ readonly EPSG_3857: {
27
+ readonly name: "Europe Mercator";
28
+ readonly value: "EPSG:3857";
29
+ };
30
+ readonly EPSG_4258: {
31
+ readonly name: "ETRS89";
32
+ readonly value: "EPSG:4258";
33
+ };
34
+ readonly EPSG_4269: {
35
+ readonly name: "NAD83 (long/lat)";
36
+ readonly value: "EPSG:4269";
37
+ };
38
+ readonly EPSG_4325: {
39
+ readonly name: "Guam Map Grid";
40
+ readonly value: "EPSG:4325";
41
+ };
42
+ readonly EPSG_4326: {
43
+ readonly name: "WGS 84 - WGS84 - World Geodetic System";
44
+ readonly value: "EPSG:4326";
45
+ };
46
+ readonly EPSG_7399: {
47
+ readonly name: "WISCRS Vilas County (ftUS)";
48
+ readonly value: "EPSG:7399";
49
+ };
50
+ readonly EPSG_25832: {
51
+ readonly name: "ETRS89 / UTM zone 32N";
52
+ readonly value: "EPSG:25832";
53
+ };
54
+ readonly EPSG_28992: {
55
+ readonly name: "The Netherlands (28992)";
56
+ readonly value: "EPSG:28992";
57
+ };
58
+ readonly EPSG_32661: {
59
+ readonly name: "Europe Polar Stereographic";
60
+ readonly value: "EPSG:32661";
61
+ };
62
+ readonly EPSG_54030: {
63
+ readonly name: "Europe Robinson";
64
+ readonly value: "EPSG:54030";
65
+ };
66
+ readonly EPSG_900913: {
67
+ readonly name: "Google Maps Global Mercator";
68
+ readonly value: "EPSG:900913";
69
+ };
70
+ readonly EPSG_102100: {
71
+ readonly name: "WGS 84 / Pseudo-Mercator";
72
+ readonly value: "EPSG:102100";
73
+ };
74
+ };
75
+ export type EPSGCode = (typeof PROJECTION)[keyof typeof PROJECTION]['value'];