@opengeoweb/shared 9.25.3 → 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
@@ -8492,10 +8492,24 @@ const Filter = /*#__PURE__*/React.forwardRef((_a, ref) => {
8492
8492
  }));
8493
8493
  });
8494
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
+ }));
8495
8508
  const FilterListItem = ({
8496
8509
  filter,
8497
8510
  toggleFilter: _toggleFilter = () => {},
8498
- enableOnlyOneFilter: _enableOnlyOneFilter = () => {}
8511
+ enableOnlyOneFilter: _enableOnlyOneFilter = () => {},
8512
+ children
8499
8513
  }) => {
8500
8514
  const {
8501
8515
  t
@@ -8572,17 +8586,9 @@ const FilterListItem = ({
8572
8586
  }
8573
8587
  }
8574
8588
  })
8575
- })), jsx(Typography, Object.assign({
8576
- variant: "body2",
8577
- sx: {
8578
- fontSize: '16px',
8579
- textOverflow: 'ellipsis',
8580
- whiteSpace: 'nowrap',
8581
- overflow: 'hidden'
8582
- }
8583
- }, {
8584
- children: name
8585
- })), isHovering ? jsx(ListItemSecondaryAction, {
8589
+ })), children || jsx(FilterLabel, {
8590
+ name: name
8591
+ }), isHovering ? jsx(ListItemSecondaryAction, {
8586
8592
  children: jsx(CustomIconButton, Object.assign({
8587
8593
  "aria-label": `Only ${filter.name}`,
8588
8594
  style: {
@@ -9073,13 +9079,13 @@ const getUtcFromString = dateStr => {
9073
9079
  }
9074
9080
  return isoStringToDate(dateStr);
9075
9081
  };
9076
- const hasOffset = input => {
9077
- return !!getOffsetStr(input);
9082
+ const hasOffset = dateStr => {
9083
+ return !!getOffsetStr(dateStr);
9078
9084
  };
9079
- const getOffsetStr = input => {
9080
- const isoDatePattern = /(\d{4}-\d{2}-\d{2})T(\d{2}:\d{2}:\d{2})(\.\d+)?([+-]\d{2}:?\d{2}|Z)$/;
9081
- const groups = input.match(isoDatePattern);
9082
- 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;
9083
9089
  };
9084
9090
  /**
9085
9091
  * Check if a date object is valid
@@ -9426,6 +9432,98 @@ const createToolkitMockStoreWithEggs = storeConfig => {
9426
9432
  return store;
9427
9433
  };
9428
9434
 
9435
+ /* *
9436
+ * Licensed under the Apache License, Version 2.0 (the "License");
9437
+ * you may not use this file except in compliance with the License.
9438
+ * You may obtain a copy of the License at
9439
+ *
9440
+ * http://www.apache.org/licenses/LICENSE-2.0
9441
+ *
9442
+ * Unless required by applicable law or agreed to in writing, software
9443
+ * distributed under the License is distributed on an "AS IS" BASIS,
9444
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
9445
+ * See the License for the specific language governing permissions and
9446
+ * limitations under the License.
9447
+ *
9448
+ * Copyright 2024 - Koninklijk Nederlands Meteorologisch Instituut (KNMI)
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
+
9429
9527
  /* *
9430
9528
  * Licensed under the Apache License, Version 2.0 (the "License");
9431
9529
  * you may not use this file except in compliance with the License.
@@ -9475,4 +9573,4 @@ class RenderCounter {
9475
9573
  }
9476
9574
  const renderCounter = new RenderCounter();
9477
9575
 
9478
- 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.3",
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'];