@opengeoweb/shared 20.0.0 → 20.0.1-nightly-20261003

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 CHANGED
@@ -73,6 +73,7 @@ var en = {
73
73
  "shared-filter-plugin-view-presets": "Plugins",
74
74
  "shared-filter-system-view-presets": "System presets",
75
75
  "shared-filter-shared-view-presets": "Shared presets",
76
+ "shared-filter-template-presets": "Template presets",
76
77
  "shared-filter-search": "Search",
77
78
  "shared-only": "ONLY",
78
79
  "shared-customdialog-back": "Back",
@@ -140,6 +141,7 @@ var fi = {
140
141
  "shared-filter-my-view-presets": "Omat presetit",
141
142
  "shared-filter-system-view-presets": "Järjestelmä presetit",
142
143
  "shared-filter-shared-view-presets": "ei käännetty",
144
+ "shared-filter-template-presets": "Mallipresetit",
143
145
  "shared-filter-search": "Etsi",
144
146
  "shared-only": "Pelkästään",
145
147
  "shared-customdialog-back": "PALAA TAKAISIN",
@@ -205,6 +207,7 @@ var no = {
205
207
  "shared-filter-my-view-presets": "Mine snarveier",
206
208
  "shared-filter-system-view-presets": "Felles-snarveier",
207
209
  "shared-filter-shared-view-presets": "Delte snarveier",
210
+ "shared-filter-template-presets": "Malpresets",
208
211
  "shared-filter-search": "Søk",
209
212
  "shared-only": "BARE",
210
213
  "shared-customdialog-back": "Tilbake",
@@ -270,6 +273,7 @@ var nl = {
270
273
  "shared-filter-my-view-presets": "Mijn presets",
271
274
  "shared-filter-system-view-presets": "Systeem presets",
272
275
  "shared-filter-shared-view-presets": "Gedeelde presets",
276
+ "shared-filter-template-presets": "Template presets",
273
277
  "shared-filter-search": "Zoeken",
274
278
  "shared-only": "ALLEEN",
275
279
  "shared-customdialog-back": "Terug",
@@ -833,6 +837,17 @@ var getPosition = function getPosition(menuPosition) {
833
837
  horizontal: 'center'
834
838
  }
835
839
  };
840
+ case 'top':
841
+ return {
842
+ anchorOrigin: {
843
+ vertical: 'top',
844
+ horizontal: 'center'
845
+ },
846
+ transformOrigin: {
847
+ vertical: 'bottom',
848
+ horizontal: 'center'
849
+ }
850
+ };
836
851
  // eslint-disable-next-line default-case-last
837
852
  default:
838
853
  case 'left':
@@ -867,6 +882,7 @@ var ToggleMenu = function ToggleMenu(_ref) {
867
882
  menuItems = _ref.menuItems,
868
883
  children = _ref.children,
869
884
  buttonSx = _ref.buttonSx,
885
+ renderButton = _ref.renderButton,
870
886
  _ref$tooltipTitle = _ref.tooltipTitle,
871
887
  tooltipTitle = _ref$tooltipTitle === void 0 ? '' : _ref$tooltipTitle,
872
888
  _ref$menuTitle = _ref.menuTitle,
@@ -964,7 +980,10 @@ var ToggleMenu = function ToggleMenu(_ref) {
964
980
  }
965
981
  }, [isDefaultOpen, buttonTestId]);
966
982
  return jsxs(Fragment, {
967
- children: [jsx(CustomIconButton, {
983
+ children: [renderButton ? renderButton({
984
+ onClick: handleClick,
985
+ isOpen: isOpen
986
+ }) : jsx(CustomIconButton, {
968
987
  "data-testid": buttonTestId,
969
988
  disabled: isDisabled,
970
989
  id: buttonTestId,
@@ -2240,6 +2259,32 @@ var AppHeader = function AppHeader(_ref) {
2240
2259
  });
2241
2260
  };
2242
2261
 
2262
+ /* *
2263
+ * Licensed under the Apache License, Version 2.0 (the "License");
2264
+ * you may not use this file except in compliance with the License.
2265
+ * You may obtain a copy of the License at
2266
+ *
2267
+ * http://www.apache.org/licenses/LICENSE-2.0
2268
+ *
2269
+ * Unless required by applicable law or agreed to in writing, software
2270
+ * distributed under the License is distributed on an "AS IS" BASIS,
2271
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
2272
+ * See the License for the specific language governing permissions and
2273
+ * limitations under the License.
2274
+ *
2275
+ * Copyright 2026 - Koninklijk Nederlands Meteorologisch Instituut (KNMI)
2276
+ * Copyright 2026 - Finnish Meteorological Institute (FMI)
2277
+ * Copyright 2026 - The Norwegian Meteorological Institute (MET Norway)
2278
+ * */
2279
+ var browserNavigation = {
2280
+ assign: function assign(url) {
2281
+ return window.location.assign(url);
2282
+ },
2283
+ reload: function reload() {
2284
+ return window.location.reload();
2285
+ }
2286
+ };
2287
+
2243
2288
  // TODO: (Sander de Snaijer 2020-07-13) this error wrappper should get more (non-breaking?) logic when we have decided how to handle errors.
2244
2289
  /**
2245
2290
  * ErrorBoundary
@@ -2327,7 +2372,7 @@ var ErrorBoundary = /*#__PURE__*/function (_React$Component) {
2327
2372
  info: jsxs("div", {
2328
2373
  children: [jsx("br", {}), error.toString(), jsx("br", {}), errorInfo == null ? void 0 : errorInfo.componentStack, jsx("br", {}), jsx("br", {}), jsx(Link, {
2329
2374
  onClick: function onClick() {
2330
- return window.location.reload();
2375
+ return browserNavigation.reload();
2331
2376
  },
2332
2377
  style: {
2333
2378
  cursor: 'pointer'
@@ -6569,6 +6614,8 @@ var arrowKeySteps = {
6569
6614
  var integerKeys = getAllowedKeys('numeric');
6570
6615
  var CARET_WIDTH = '24px';
6571
6616
  var SIGN_WIDTH = '1ch';
6617
+ // The unit adornment sits inside the filled input's right padding.
6618
+ var FIELD_PADDING_RIGHT = '12px';
6572
6619
  var transparentBackdrop = {
6573
6620
  slotProps: {
6574
6621
  backdrop: {
@@ -6591,6 +6638,24 @@ var styles = {
6591
6638
  marginTop: '16px'
6592
6639
  }
6593
6640
  };
6641
+ /** The field underline is the focus marker, so it spans only the focused part instead of both. */
6642
+ var partFocusUnderline = function partFocusUnderline(unitWidth) {
6643
+ return function (theme) {
6644
+ return {
6645
+ '&:after': {
6646
+ borderColor: theme.palette.geowebColors.captions.captionInformation.rgba,
6647
+ right: "calc(" + unitWidth + " + " + FIELD_PADDING_RIGHT + ")"
6648
+ },
6649
+ /* Mui-focused only follows the value input, so the unit has to claim the underline itself. */
6650
+ '&:has(.MuiSelect-select:focus):after': {
6651
+ left: 'auto',
6652
+ right: 0,
6653
+ transform: 'scaleX(1)',
6654
+ width: "calc(" + unitWidth + " + " + FIELD_PADDING_RIGHT + ")"
6655
+ }
6656
+ };
6657
+ };
6658
+ };
6594
6659
  var isClipboardShortcut = function isClipboardShortcut(event) {
6595
6660
  var isMac = window.navigator.userAgent.includes(' Mac ');
6596
6661
  var hasModifier = isMac ? event.metaKey : event.ctrlKey;
@@ -6707,6 +6772,13 @@ var NumberWithUnitField = function NumberWithUnitField(_ref) {
6707
6772
  variant: "standard",
6708
6773
  children: jsx(Select, {
6709
6774
  MenuProps: transparentBackdrop,
6775
+ /* Select escalates its own min-width rule by repeating its class, so only an inline style wins. */
6776
+ SelectDisplayProps: {
6777
+ style: {
6778
+ textAlign: 'right',
6779
+ width: unitWidth
6780
+ }
6781
+ },
6710
6782
  disableUnderline: true,
6711
6783
  disabled: disabled,
6712
6784
  inputProps: {
@@ -6718,13 +6790,6 @@ var NumberWithUnitField = function NumberWithUnitField(_ref) {
6718
6790
  unit: event.target.value
6719
6791
  });
6720
6792
  },
6721
- /* Select escalates its own min-width rule by repeating its class, so only an inline style wins. */
6722
- SelectDisplayProps: {
6723
- style: {
6724
- textAlign: 'right',
6725
- width: unitWidth
6726
- }
6727
- },
6728
6793
  value: unit,
6729
6794
  variant: "standard",
6730
6795
  children: unitOptions.map(function (option) {
@@ -6748,6 +6813,7 @@ var NumberWithUnitField = function NumberWithUnitField(_ref) {
6748
6813
  },
6749
6814
  onKeyDown: handleKeyDown,
6750
6815
  onPaste: handlePaste,
6816
+ sx: partFocusUnderline(unitWidth),
6751
6817
  value: typedValue
6752
6818
  })]
6753
6819
  });
@@ -6878,4 +6944,4 @@ var SystemScope = {
6878
6944
  plugin: 'plugin'
6879
6945
  };
6880
6946
 
6881
- export { AlertBanner, AlertIcon, AppHeader, AppLayout, Avatar, CanvasComponent, ConfirmationButtons, ConfirmationDialog, ConfirmationServiceProvider, CustomAccordion, CustomDialog, CustomDialogHeader, CustomIconButton, CustomSlider, CustomToggleButton, CustomTooltip, DEBOUNCE_TIMEOUT, DEFAULT_ERROR_MESSAGE, DEFAULT_FILTER_HEIGHT, DateTimePicker, DraggableComponent$1 as Draggable, ErrorBoundary, Filter, FilterChip, FilterOption, LastUpdateTime, LegendToggleButton, NumberWithUnitField, PROJECTION, ResizeComponent as Resizable, SHARED_NAMESPACE, SearchField$1 as SearchField, SearchFieldButton, SearchHighlight, SessionStorageKey, StatusTag, StorybookDocsWrapper, StyledSelect, SwitchButton, SystemScope, ToggleMenu, ToolContainer, DraggableComponent as ToolContainerDraggable, ToolFooter, ToolHeader, TooltipSelect, UserMenu, UserMenuItemCheatSheet, MenuItemTheme as UserMenuItemTheme, adjustPosition, calculateDialogSizeAndPosition, calculateStartSize, convertNumericInputValue, index$1 as dateUtils, defaultDelay, getAllowedKeys, getAxiosErrorMessage, getAxiosWarningMessage, getErrorMessage, getInitials, getLastUpdateTitle, getPosition, getWarningMessage, isAuthError, isAxiosAuthError, isAxiosError, isDialogFocused, isTargetInteractiveInput, linkifyText, loadAllTranslations, pickerDateToUTC, pollingIntervalTimeout, index as referenceTimeUtils, renderCounter, safelyInitI18nForTestsAndStories, sessionStorageProvider, sharedTranslations, showPrompt, sliderHeaderStyle, tooltipContainerStyles, useConfirmationDialog, useControlledTooltip, useDebounce, useDialogActions, useIsMounted, useMakeSureContainerStaysInsideWindow, usePoller, usePreventBrowserClose, usePrevious, useResizeObserver, useScrollingInIsolation, useUserMenu, useWheelStopPropagation, utcToPickerDate };
6947
+ export { AlertBanner, AlertIcon, AppHeader, AppLayout, Avatar, CanvasComponent, ConfirmationButtons, ConfirmationDialog, ConfirmationServiceProvider, CustomAccordion, CustomDialog, CustomDialogHeader, CustomIconButton, CustomSlider, CustomToggleButton, CustomTooltip, DEBOUNCE_TIMEOUT, DEFAULT_ERROR_MESSAGE, DEFAULT_FILTER_HEIGHT, DateTimePicker, DraggableComponent$1 as Draggable, ErrorBoundary, Filter, FilterChip, FilterOption, LastUpdateTime, LegendToggleButton, NumberWithUnitField, PROJECTION, ResizeComponent as Resizable, SHARED_NAMESPACE, SearchField$1 as SearchField, SearchFieldButton, SearchHighlight, SessionStorageKey, StatusTag, StorybookDocsWrapper, StyledSelect, SwitchButton, SystemScope, ToggleMenu, ToolContainer, DraggableComponent as ToolContainerDraggable, ToolFooter, ToolHeader, TooltipSelect, UserMenu, UserMenuItemCheatSheet, MenuItemTheme as UserMenuItemTheme, adjustPosition, browserNavigation, calculateDialogSizeAndPosition, calculateStartSize, convertNumericInputValue, index$1 as dateUtils, defaultDelay, getAllowedKeys, getAxiosErrorMessage, getAxiosWarningMessage, getErrorMessage, getInitials, getLastUpdateTitle, getPosition, getWarningMessage, isAuthError, isAxiosAuthError, isAxiosError, isDialogFocused, isTargetInteractiveInput, linkifyText, loadAllTranslations, pickerDateToUTC, pollingIntervalTimeout, index as referenceTimeUtils, renderCounter, safelyInitI18nForTestsAndStories, sessionStorageProvider, sharedTranslations, showPrompt, sliderHeaderStyle, tooltipContainerStyles, useConfirmationDialog, useControlledTooltip, useDebounce, useDialogActions, useIsMounted, useMakeSureContainerStaysInsideWindow, usePoller, usePreventBrowserClose, usePrevious, useResizeObserver, useScrollingInIsolation, useUserMenu, useWheelStopPropagation, utcToPickerDate };
@@ -1,7 +1,7 @@
1
1
  import type { PopoverOrigin, SxProps, Theme } from '@mui/material';
2
2
  import React from 'react';
3
3
  import type { Variant } from '../CustomIconButton';
4
- type MenuPosition = 'left' | 'right' | 'bottom';
4
+ type MenuPosition = 'left' | 'right' | 'bottom' | 'top';
5
5
  export declare const getPosition: (menuPosition: MenuPosition) => {
6
6
  anchorOrigin: PopoverOrigin;
7
7
  transformOrigin: PopoverOrigin;
@@ -14,6 +14,10 @@ export interface MenuItemType {
14
14
  isSelected?: boolean;
15
15
  controlType?: 'radio';
16
16
  }
17
+ export interface ToggleMenuButtonRenderProps {
18
+ onClick: (event: React.MouseEvent<HTMLElement>) => void;
19
+ isOpen: boolean;
20
+ }
17
21
  interface ToggleMenuProps {
18
22
  buttonTestId?: string;
19
23
  menuPosition?: MenuPosition;
@@ -23,6 +27,12 @@ interface ToggleMenuProps {
23
27
  secondaryMenuTitle?: string;
24
28
  children?: React.ReactNode;
25
29
  buttonSx?: SxProps<Theme>;
30
+ /**
31
+ * Renders a custom toggle button instead of the default CustomIconButton.
32
+ * The given onClick must be wired to the rendered button so the menu can
33
+ * anchor itself to it.
34
+ */
35
+ renderButton?: (props: ToggleMenuButtonRenderProps) => React.ReactNode;
26
36
  tooltipTitle?: string;
27
37
  variant?: Variant;
28
38
  isDefaultOpen?: boolean;
@@ -10,6 +10,7 @@ export interface ConfigType {
10
10
  GW_BE_VERSION_BASE_URL?: string;
11
11
  GW_APP_URL?: string;
12
12
  GW_INITIAL_PRESETS_FILENAME?: string;
13
+ GW_TEMPLATE_PRESETS_FILENAME?: string;
13
14
  GW_CAP_CONFIGURATION_FILENAME?: string;
14
15
  GW_DEFAULT_THEME?: ThemeTypes;
15
16
  GW_INITIAL_WORKSPACE_PRESET?: string;
@@ -115,10 +116,10 @@ export interface PlotParameter {
115
116
  collectionId: string;
116
117
  instanceId?: string;
117
118
  instances?: EDRInstance[];
118
- dimension?: {
119
+ dimensions?: {
119
120
  id: string;
120
121
  value: string;
121
- };
122
+ }[];
122
123
  }
123
124
  export type PlotType = 'bar' | 'line' | 'scatter';
124
125
  export interface EdrParameter {
@@ -0,0 +1,4 @@
1
+ export declare const browserNavigation: {
2
+ assign: (url: string) => void;
3
+ reload: () => void;
4
+ };
@@ -1,4 +1,5 @@
1
1
  export * from './axiosErrorUtils';
2
+ export { browserNavigation } from './browserNavigation';
2
3
  export * as dateUtils from './dateUtils';
3
4
  export * as referenceTimeUtils from './referenceTimeUtils';
4
5
  export * from './linkify';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@opengeoweb/shared",
3
- "version": "20.0.0",
3
+ "version": "20.0.1-nightly-20261003",
4
4
  "description": "GeoWeb shared library with shared components and utils for the opengeoweb project",
5
5
  "license": "Apache-2.0",
6
6
  "repository": {
@@ -20,11 +20,11 @@
20
20
  }
21
21
  },
22
22
  "dependencies": {
23
- "@opengeoweb/theme": "20.0.0",
23
+ "@opengeoweb/theme": "20.0.1-nightly-20261003",
24
24
  "react-draggable": "^4.4.6",
25
25
  "re-resizable": "^6.9.11",
26
26
  "lodash": "^4.18.1",
27
- "axios": "^1.18.0",
27
+ "axios": "^1.20.0",
28
28
  "date-fns": "^4.1.0",
29
29
  "react-i18next": "^15.1.1",
30
30
  "i18next": "^25.0.1",