@opengeoweb/shared 19.2.0 → 19.4.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/dist/index.esm.js +42 -2
- package/dist/src/lib/components/LegendToggleButton/LegendToggleButton.d.ts +12 -0
- package/dist/src/lib/components/LegendToggleButton/index.d.ts +1 -0
- package/dist/src/lib/components/index.d.ts +1 -0
- package/dist/src/lib/types/types.d.ts +2 -0
- package/dist/src/lib/utils/referenceTimeUtils/referenceTimeUtils.d.ts +1 -0
- package/package.json +2 -2
package/dist/index.esm.js
CHANGED
|
@@ -5,7 +5,7 @@ import { initReactI18next, useTranslation } from 'react-i18next';
|
|
|
5
5
|
import React, { useRef, useEffect, useState, Component } from 'react';
|
|
6
6
|
import Draggable from 'react-draggable';
|
|
7
7
|
import { Resizable } from 're-resizable';
|
|
8
|
-
import { Resize, BORDER_RADIUS, Options, Close, ChevronLeft, Exclamation, Success, Info, ChevronRight, GeoWebLogo, HamburgerMenu, Admin, useThemeContext, ThemeTypes, ArrowLeft, ArrowRight, KeyOption, ArrowUp, ArrowDown, KeyCommand, ChevronDown, Search, Clear, Cached, Filter as Filter$1 } from '@opengeoweb/theme';
|
|
8
|
+
import { Resize, BORDER_RADIUS, Options, Close, ChevronLeft, Exclamation, Success, Info, ChevronRight, GeoWebLogo, HamburgerMenu, Admin, useThemeContext, ThemeTypes, ArrowLeft, ArrowRight, KeyOption, ArrowUp, ArrowDown, KeyCommand, ChevronDown, Search, Clear, Cached, Filter as Filter$1, Menu as Menu$1 } from '@opengeoweb/theme';
|
|
9
9
|
import { throttle, isEqual, merge, escapeRegExp, debounce } from 'lodash';
|
|
10
10
|
import { add as add$1, startOfDay, addMinutes, addHours, format, differenceInDays as differenceInDays$1, differenceInHours as differenceInHours$1, differenceInMinutes as differenceInMinutes$1, differenceInMonths as differenceInMonths$1, differenceInSeconds as differenceInSeconds$1, differenceInYears as differenceInYears$1, fromUnixTime, getHours as getHours$1, isAfter as isAfter$1, isBefore as isBefore$1, isEqual as isEqual$1, isValid as isValid$1, parseISO, roundToNearestMinutes as roundToNearestMinutes$1, set as set$1, setSeconds as setSeconds$1, parse, sub as sub$1, getUnixTime, getDay, getDayOfYear, getMonth, getWeek, getYear, isWithinInterval } from 'date-fns';
|
|
11
11
|
import { fi as fi$1, nl as nl$1, nb, enGB } from 'date-fns/locale';
|
|
@@ -5240,6 +5240,38 @@ var FilterOption = function FilterOption(_ref) {
|
|
|
5240
5240
|
});
|
|
5241
5241
|
};
|
|
5242
5242
|
|
|
5243
|
+
var LegendToggleButton = function LegendToggleButton(_ref) {
|
|
5244
|
+
var isLegendVisible = _ref.isLegendVisible,
|
|
5245
|
+
onToggle = _ref.onToggle,
|
|
5246
|
+
showTooltipText = _ref.showTooltipText,
|
|
5247
|
+
hideTooltipText = _ref.hideTooltipText,
|
|
5248
|
+
legendLabel = _ref.legendLabel,
|
|
5249
|
+
sx = _ref.sx;
|
|
5250
|
+
return jsx(CustomTooltip, {
|
|
5251
|
+
title: isLegendVisible ? hideTooltipText : showTooltipText,
|
|
5252
|
+
children: jsxs(CustomToggleButton, {
|
|
5253
|
+
"aria-label": isLegendVisible ? hideTooltipText : showTooltipText,
|
|
5254
|
+
onClick: onToggle,
|
|
5255
|
+
selected: isLegendVisible,
|
|
5256
|
+
size: "small",
|
|
5257
|
+
sx: [{
|
|
5258
|
+
height: '10px !important',
|
|
5259
|
+
'& span': {
|
|
5260
|
+
fontSize: '9pt',
|
|
5261
|
+
whiteSpace: 'nowrap',
|
|
5262
|
+
textOverflow: 'ellipsis',
|
|
5263
|
+
overflow: 'hidden'
|
|
5264
|
+
}
|
|
5265
|
+
}].concat(Array.isArray(sx) ? sx : [sx]),
|
|
5266
|
+
variant: "tool",
|
|
5267
|
+
children: [jsx(Menu$1, {}), jsx("span", {
|
|
5268
|
+
className: "longText",
|
|
5269
|
+
children: legendLabel
|
|
5270
|
+
})]
|
|
5271
|
+
})
|
|
5272
|
+
});
|
|
5273
|
+
};
|
|
5274
|
+
|
|
5243
5275
|
var _excluded = ["isDark", "children", "sx"];
|
|
5244
5276
|
var StorybookDocsWrapper = function StorybookDocsWrapper(_ref) {
|
|
5245
5277
|
var _ref$isDark = _ref.isDark,
|
|
@@ -6213,6 +6245,13 @@ var resolveReferenceTimeInstance = function resolveReferenceTimeInstance(instanc
|
|
|
6213
6245
|
}
|
|
6214
6246
|
return (_getValidInstancesNew = getValidInstancesNewestFirst(instances)[offset]) != null ? _getValidInstancesNew : null;
|
|
6215
6247
|
};
|
|
6248
|
+
var extendCollectionInstances = function extendCollectionInstances(instances, selectedInstanceId) {
|
|
6249
|
+
return instances.findIndex(function (instance) {
|
|
6250
|
+
return instance.id === selectedInstanceId;
|
|
6251
|
+
}) === -1 && selectedInstanceId && !isRelativeReferenceTime(selectedInstanceId) ? [].concat(instances, [{
|
|
6252
|
+
id: selectedInstanceId
|
|
6253
|
+
}]) : instances;
|
|
6254
|
+
};
|
|
6216
6255
|
|
|
6217
6256
|
/* *
|
|
6218
6257
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
@@ -6236,6 +6275,7 @@ var index = /*#__PURE__*/Object.freeze({
|
|
|
6236
6275
|
__proto__: null,
|
|
6237
6276
|
DEFAULT_MAX_RELATIVE_REFERENCE_TIME_OPTIONS: DEFAULT_MAX_RELATIVE_REFERENCE_TIME_OPTIONS,
|
|
6238
6277
|
buildRelativeReferenceTimeOptions: buildRelativeReferenceTimeOptions,
|
|
6278
|
+
extendCollectionInstances: extendCollectionInstances,
|
|
6239
6279
|
formatRelativeReferenceTimeLabel: formatRelativeReferenceTimeLabel,
|
|
6240
6280
|
getValidInstancesNewestFirst: getValidInstancesNewestFirst,
|
|
6241
6281
|
isRelativeReferenceTime: isRelativeReferenceTime,
|
|
@@ -6487,4 +6527,4 @@ var SystemScope = {
|
|
|
6487
6527
|
plugin: 'plugin'
|
|
6488
6528
|
};
|
|
6489
6529
|
|
|
6490
|
-
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, DraggableComponent$1 as Draggable, ErrorBoundary, Filter, FilterChip, FilterOption, LastUpdateTime, 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, index$1 as dateUtils, defaultDelay, getAxiosErrorMessage, getAxiosWarningMessage, getErrorMessage, getInitials, getLastUpdateTitle, getPosition, getWarningMessage, isAuthError, isAxiosAuthError, isAxiosError, loadAllTranslations, pollingIntervalTimeout, index as referenceTimeUtils, renderCounter, safelyInitI18nForTestsAndStories, sessionStorageProvider, sharedTranslations, showPrompt, sliderHeaderStyle, tooltipContainerStyles, useConfirmationDialog, useControlledTooltip, useDebounce, useDialogActions, useIsMounted, useMakeSureContainerStaysInsideWindow, usePoller, usePreventBrowserClose, usePrevious, useResizeObserver, useScrollingInIsolation, useUserMenu, useWheelStopPropagation };
|
|
6530
|
+
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, DraggableComponent$1 as Draggable, ErrorBoundary, Filter, FilterChip, FilterOption, LastUpdateTime, LegendToggleButton, 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, index$1 as dateUtils, defaultDelay, getAxiosErrorMessage, getAxiosWarningMessage, getErrorMessage, getInitials, getLastUpdateTitle, getPosition, getWarningMessage, isAuthError, isAxiosAuthError, isAxiosError, loadAllTranslations, pollingIntervalTimeout, index as referenceTimeUtils, renderCounter, safelyInitI18nForTestsAndStories, sessionStorageProvider, sharedTranslations, showPrompt, sliderHeaderStyle, tooltipContainerStyles, useConfirmationDialog, useControlledTooltip, useDebounce, useDialogActions, useIsMounted, useMakeSureContainerStaysInsideWindow, usePoller, usePreventBrowserClose, usePrevious, useResizeObserver, useScrollingInIsolation, useUserMenu, useWheelStopPropagation };
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import type { SxProps, Theme } from '@mui/material';
|
|
2
|
+
import React from 'react';
|
|
3
|
+
export interface LegendToggleButtonProps {
|
|
4
|
+
isLegendVisible: boolean;
|
|
5
|
+
onToggle: () => void;
|
|
6
|
+
showTooltipText: string;
|
|
7
|
+
hideTooltipText: string;
|
|
8
|
+
legendLabel: string;
|
|
9
|
+
/** Container-query responsive styles — pass the container-specific breakpoint rules here */
|
|
10
|
+
sx?: SxProps<Theme>;
|
|
11
|
+
}
|
|
12
|
+
export declare const LegendToggleButton: ({ isLegendVisible, onToggle, showTooltipText, hideTooltipText, legendLabel, sx, }: LegendToggleButtonProps) => React.ReactElement;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './LegendToggleButton';
|
|
@@ -45,6 +45,7 @@ export interface ConfigType {
|
|
|
45
45
|
GW_DATA_EXPLORER_BUTTON_ON_MAP?: boolean;
|
|
46
46
|
GW_HIDE_SIGMET_MENU?: boolean;
|
|
47
47
|
GW_HIDE_AIRMET_MENU?: boolean;
|
|
48
|
+
GW_FEATURE_WARNINGS_EVENT?: boolean;
|
|
48
49
|
GW_LANGUAGE?: string;
|
|
49
50
|
GW_EXTERNAL_APPLICATIONS_MENU_LINKS?: string;
|
|
50
51
|
GW_PLUGIN_BACKEND_URL?: string;
|
|
@@ -56,6 +57,7 @@ export interface SoundingsCollection {
|
|
|
56
57
|
id: string;
|
|
57
58
|
url: string;
|
|
58
59
|
description: string;
|
|
60
|
+
instanceId?: string;
|
|
59
61
|
parameterMappings?: Record<string, string>;
|
|
60
62
|
windSpeedUnit?: string;
|
|
61
63
|
prefetchAllTimesteps?: boolean;
|
|
@@ -18,3 +18,4 @@ export declare const buildRelativeReferenceTimeOptions: (instances: EDRInstance[
|
|
|
18
18
|
* not a relative token or when no instance exists at that offset.
|
|
19
19
|
*/
|
|
20
20
|
export declare const resolveReferenceTimeInstance: (instances: EDRInstance[], referenceTime?: string) => EDRInstance | null;
|
|
21
|
+
export declare const extendCollectionInstances: (instances: EDRInstance[], selectedInstanceId: string | undefined) => EDRInstance[];
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@opengeoweb/shared",
|
|
3
|
-
"version": "19.
|
|
3
|
+
"version": "19.4.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": {
|
|
@@ -24,7 +24,7 @@
|
|
|
24
24
|
"react-draggable": "^4.4.6",
|
|
25
25
|
"re-resizable": "^6.9.11",
|
|
26
26
|
"lodash": "^4.18.1",
|
|
27
|
-
"axios": "^1.
|
|
27
|
+
"axios": "^1.18.0",
|
|
28
28
|
"date-fns": "^4.1.0",
|
|
29
29
|
"react-i18next": "^15.1.1",
|
|
30
30
|
"i18next": "^25.0.1",
|