@opengeoweb/shared 15.2.0 → 16.0.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 +93 -17
- package/package.json +2 -2
- package/src/lib/components/ToolContainer/ToolContainerDraggable.d.ts +2 -0
- package/src/lib/hooks/useDebounce/useDebounce.d.ts +1 -1
- package/src/lib/types/edr-coverage-types.d.ts +13 -1
- package/src/lib/types/types.d.ts +2 -0
- package/src/lib/utils/axiosErrorUtils/axiosErrorUtils.d.ts +1 -0
- package/src/lib/utils/dateUtils/dateUtils.d.ts +6 -0
package/index.esm.js
CHANGED
|
@@ -6,8 +6,8 @@ import React, { useRef, useEffect, useState, Component } from 'react';
|
|
|
6
6
|
import Draggable from 'react-draggable';
|
|
7
7
|
import { Resizable } from 're-resizable';
|
|
8
8
|
import { Resize, BORDER_RADIUS, Options, Close, ChevronLeft, Exclamation, Success, Info, ChevronRight, GeoWebLogo, HamburgerMenu, Admin, useThemeContext, ThemeTypes, ArrowLeft, ArrowRight, KeyOption, KeyCommand, ArrowUp, ArrowDown, ChevronDown, Search, Clear, Cached, Filter as Filter$1 } from '@opengeoweb/theme';
|
|
9
|
-
import { throttle, merge, escapeRegExp, debounce } from 'lodash';
|
|
10
|
-
import { parseISO, parse, format, isEqual, add as add$1, sub as sub$1, differenceInYears as differenceInYears$1, differenceInMonths as differenceInMonths$1, differenceInDays as differenceInDays$1, differenceInMinutes as differenceInMinutes$1, differenceInHours as differenceInHours$1, differenceInSeconds as differenceInSeconds$1, roundToNearestMinutes as roundToNearestMinutes$1, isBefore as isBefore$1, isAfter as isAfter$1, isValid as isValid$1, getUnixTime, fromUnixTime, set as set$1, getHours as getHours$1, startOfDay, addMinutes, addHours, setSeconds as setSeconds$1, getDay, getDayOfYear, getMonth, getWeek, getYear, isWithinInterval } from 'date-fns';
|
|
9
|
+
import { throttle, isEqual, merge, escapeRegExp, debounce } from 'lodash';
|
|
10
|
+
import { parseISO, parse, format, isEqual as isEqual$1, add as add$1, sub as sub$1, differenceInYears as differenceInYears$1, differenceInMonths as differenceInMonths$1, differenceInDays as differenceInDays$1, differenceInMinutes as differenceInMinutes$1, differenceInHours as differenceInHours$1, differenceInSeconds as differenceInSeconds$1, roundToNearestMinutes as roundToNearestMinutes$1, isBefore as isBefore$1, isAfter as isAfter$1, isValid as isValid$1, getUnixTime, fromUnixTime, set as set$1, getHours as getHours$1, startOfDay, addMinutes, addHours, setSeconds as setSeconds$1, 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';
|
|
12
12
|
|
|
13
13
|
var en = {
|
|
@@ -31,6 +31,7 @@ var en = {
|
|
|
31
31
|
"shared-move-selected-time": "Move backwards/forwards in selected time",
|
|
32
32
|
"shared-move-one-step": "Move 1 step backwards/forwards in selected time",
|
|
33
33
|
"shared-toggle-timeslider": "Toggle hide/show time slider",
|
|
34
|
+
"shared-toggle-syncviewer": "Toggle hide/show sync settings",
|
|
34
35
|
"shared-timeslider-scale": "Change time slider scale (visible timespan)",
|
|
35
36
|
"shared-expand-timeslider-scale": "Expand/shrink time slider scale (visible timespan)",
|
|
36
37
|
"shared-toggle-layerinformation": "Toggle hide/show layer information",
|
|
@@ -96,7 +97,8 @@ var fi = {
|
|
|
96
97
|
"shared-choose-selected-time": "Valitse valittu aika",
|
|
97
98
|
"shared-move-selected-time": "Liiku ajassa taaksepäin/eteenpäin",
|
|
98
99
|
"shared-move-one-step": "Liiku 1 askel ajassa taaksepäin/eteenpäin",
|
|
99
|
-
"shared-toggle-timeslider": "
|
|
100
|
+
"shared-toggle-timeslider": "Piilota/näytä synkronointiasetukset",
|
|
101
|
+
"shared-toggle-syncviewer": "Toggle hide/show sync settings",
|
|
100
102
|
"shared-timeslider-scale": "Muuta TimeSliderin näkyvää aikaväliä",
|
|
101
103
|
"shared-expand-timeslider-scale": "Laajenna/kutista TimeSliderin mittakaavaa (näkyvää aikaväliä)",
|
|
102
104
|
"shared-toggle-layerinformation": "Kytke karttatasojen pikanäyttö näkyville/pois näkyvistä",
|
|
@@ -161,6 +163,7 @@ var no = {
|
|
|
161
163
|
"shared-move-selected-time": "Gå bakover/fremover i valgt tid",
|
|
162
164
|
"shared-move-one-step": "Gå 1 steg bakover/fremover i valgt tid",
|
|
163
165
|
"shared-toggle-timeslider": "Vis/skjul tidslinje",
|
|
166
|
+
"shared-toggle-syncviewer": "Vis/skjul synkroniseringsinnstillinger",
|
|
164
167
|
"shared-timeslider-scale": "Endre tidsseriens skala (synlig tidsperiode)",
|
|
165
168
|
"shared-expand-timeslider-scale": "Utvid/krymp tidsseriens skala (synlig tidsperiode)",
|
|
166
169
|
"shared-toggle-layerinformation": "Vis/skjul laginformasjon",
|
|
@@ -225,6 +228,7 @@ var nl = {
|
|
|
225
228
|
"shared-move-selected-time": "Ga achteruit/vooruit in geselecteerde tijd",
|
|
226
229
|
"shared-move-one-step": "Ga 1 stap achteruit/vooruit in geselecteerde tijd",
|
|
227
230
|
"shared-toggle-timeslider": "Timeslider verbergen/tonen",
|
|
231
|
+
"shared-toggle-syncviewer": "Synchroniserings instellingen verbergen/tonen",
|
|
228
232
|
"shared-timeslider-scale": "Timeslider zichtbare periode wijzigen",
|
|
229
233
|
"shared-expand-timeslider-scale": "Timeslider zichtbare periode vergroten/verkleinen",
|
|
230
234
|
"shared-toggle-layerinformation": "Laag informatie verbergen/tonen",
|
|
@@ -724,7 +728,10 @@ var DraggableComponent$1 = function DraggableComponent(_ref) {
|
|
|
724
728
|
};
|
|
725
729
|
var onDragStop = function onDragStop(event, pos) {
|
|
726
730
|
setIsDragging == null || setIsDragging(false);
|
|
727
|
-
onStop == null || onStop(event,
|
|
731
|
+
onStop == null || onStop(event, {
|
|
732
|
+
x: pos.x,
|
|
733
|
+
y: pos.y
|
|
734
|
+
});
|
|
728
735
|
};
|
|
729
736
|
return jsx(Draggable, Object.assign({
|
|
730
737
|
bounds: bounds
|
|
@@ -1763,9 +1770,9 @@ var useMakeSureContainerStaysInsideWindow = function useMakeSureContainerStaysIn
|
|
|
1763
1770
|
/*
|
|
1764
1771
|
Accepts a value and timeout and will debounce
|
|
1765
1772
|
|
|
1766
|
-
@param {
|
|
1773
|
+
@param {S} value: value of element
|
|
1767
1774
|
@param {timeout} number: timer
|
|
1768
|
-
@return {value:
|
|
1775
|
+
@return {value: S}
|
|
1769
1776
|
|
|
1770
1777
|
@example:
|
|
1771
1778
|
const debouncedName = useDebounce('testing', 2000)
|
|
@@ -1775,14 +1782,19 @@ var useDebounce = function useDebounce(value, timeout) {
|
|
|
1775
1782
|
state = _useState[0],
|
|
1776
1783
|
setState = _useState[1];
|
|
1777
1784
|
useEffect(function () {
|
|
1785
|
+
if (timeout <= 0) {
|
|
1786
|
+
return function () {};
|
|
1787
|
+
}
|
|
1778
1788
|
var handler = setTimeout(function () {
|
|
1779
|
-
|
|
1789
|
+
if (!isEqual(value, state)) {
|
|
1790
|
+
setState(value);
|
|
1791
|
+
}
|
|
1780
1792
|
}, timeout);
|
|
1781
1793
|
return function () {
|
|
1782
1794
|
return clearTimeout(handler);
|
|
1783
1795
|
};
|
|
1784
|
-
}, [value, timeout]);
|
|
1785
|
-
return state;
|
|
1796
|
+
}, [value, timeout, state]);
|
|
1797
|
+
return timeout <= 0 ? value : state;
|
|
1786
1798
|
};
|
|
1787
1799
|
|
|
1788
1800
|
/* *
|
|
@@ -2983,7 +2995,7 @@ var useHandleSizeFromOutsideComponent = function useHandleSizeFromOutsideCompone
|
|
|
2983
2995
|
}, [isOpen, getBoundsNode]);
|
|
2984
2996
|
};
|
|
2985
2997
|
|
|
2986
|
-
var _excluded$7 = ["title", "bounds", "cancel", "headerSize", "startSize", "startPosition", "children", "isOpen", "onClose", "initialMaxHeight", "onChangeSize", "onMouseDown", "onResizeStop", "onDragEnd", "order", "source", "leftHeaderComponent", "rightHeaderComponent", "dragHandleIcon", "closeIcon", "className", "sx"];
|
|
2998
|
+
var _excluded$7 = ["title", "bounds", "cancel", "headerSize", "startSize", "startPosition", "startDraggablePosition", "children", "isOpen", "onClose", "initialMaxHeight", "onChangeSize", "onMouseDown", "onResizeStop", "onDragEnd", "order", "source", "leftHeaderComponent", "rightHeaderComponent", "dragHandleIcon", "closeIcon", "className", "sx", "resetPositionOnOpen"];
|
|
2987
2999
|
// calculate dialog size and position to 85% of screensize
|
|
2988
3000
|
var calculateDialogSizeAndPosition = function calculateDialogSizeAndPosition() {
|
|
2989
3001
|
var width = window.innerWidth * 0.85;
|
|
@@ -3050,6 +3062,11 @@ var DraggableComponent = function DraggableComponent(_ref) {
|
|
|
3050
3062
|
right: undefined,
|
|
3051
3063
|
top: undefined
|
|
3052
3064
|
} : _ref$startPosition,
|
|
3065
|
+
_ref$startDraggablePo = _ref.startDraggablePosition,
|
|
3066
|
+
startDraggablePosition = _ref$startDraggablePo === void 0 ? {
|
|
3067
|
+
x: 0,
|
|
3068
|
+
y: 0
|
|
3069
|
+
} : _ref$startDraggablePo,
|
|
3053
3070
|
children = _ref.children,
|
|
3054
3071
|
_ref$isOpen = _ref.isOpen,
|
|
3055
3072
|
isOpen = _ref$isOpen === void 0 ? true : _ref$isOpen,
|
|
@@ -3078,22 +3095,34 @@ var DraggableComponent = function DraggableComponent(_ref) {
|
|
|
3078
3095
|
className = _ref.className,
|
|
3079
3096
|
_ref$sx = _ref.sx,
|
|
3080
3097
|
sx = _ref$sx === void 0 ? {} : _ref$sx,
|
|
3098
|
+
_ref$resetPositionOnO = _ref.resetPositionOnOpen,
|
|
3099
|
+
resetPositionOnOpen = _ref$resetPositionOnO === void 0 ? false : _ref$resetPositionOnO,
|
|
3081
3100
|
props = _objectWithoutPropertiesLoose(_ref, _excluded$7);
|
|
3082
3101
|
var zIndex = (source === 'app' ? BASE_Z_INDEX : 1000) + order;
|
|
3083
3102
|
var elevation = BASE_ELEVATION + order;
|
|
3084
3103
|
var nodeRef = React.useRef(null);
|
|
3085
|
-
var _React$useState = React.useState({
|
|
3086
|
-
|
|
3087
|
-
y: 0
|
|
3104
|
+
var _React$useState = React.useState(function () {
|
|
3105
|
+
return Object.assign({}, startDraggablePosition);
|
|
3088
3106
|
}),
|
|
3089
3107
|
position = _React$useState[0],
|
|
3090
3108
|
setPosition = _React$useState[1];
|
|
3109
|
+
var wasOpenRef = React.useRef(isOpen);
|
|
3091
3110
|
var _React$useState2 = React.useState(startSize),
|
|
3092
3111
|
size = _React$useState2[0],
|
|
3093
3112
|
setSize = _React$useState2[1];
|
|
3094
3113
|
var _React$useState3 = React.useState(false),
|
|
3095
3114
|
isDragging = _React$useState3[0],
|
|
3096
3115
|
setIsDragging = _React$useState3[1];
|
|
3116
|
+
React.useLayoutEffect(function () {
|
|
3117
|
+
var isOpening = isOpen && !wasOpenRef.current;
|
|
3118
|
+
if (isOpening && resetPositionOnOpen) {
|
|
3119
|
+
setPosition({
|
|
3120
|
+
x: startDraggablePosition.x,
|
|
3121
|
+
y: startDraggablePosition.y
|
|
3122
|
+
});
|
|
3123
|
+
}
|
|
3124
|
+
wasOpenRef.current = isOpen;
|
|
3125
|
+
}, [isOpen, resetPositionOnOpen, startDraggablePosition]);
|
|
3097
3126
|
var isRightAligned = (startPosition == null ? void 0 : startPosition.right) !== null && (startPosition == null ? void 0 : startPosition.right) !== undefined;
|
|
3098
3127
|
var onStopDrag = React.useCallback(function (_event, position) {
|
|
3099
3128
|
setPosition(position);
|
|
@@ -3120,7 +3149,15 @@ var DraggableComponent = function DraggableComponent(_ref) {
|
|
|
3120
3149
|
}, [onChangeSize, position, isRightAligned]);
|
|
3121
3150
|
var onStopResize = function onStopResize(_event, direction, node, delta) {
|
|
3122
3151
|
setIsDragging(false);
|
|
3123
|
-
|
|
3152
|
+
var newPosition = calculateNewPosition(position, isRightAligned, direction, delta);
|
|
3153
|
+
setPosition(newPosition);
|
|
3154
|
+
var _node$getBoundingClie2 = node.getBoundingClientRect(),
|
|
3155
|
+
width = _node$getBoundingClie2.width,
|
|
3156
|
+
height = _node$getBoundingClie2.height;
|
|
3157
|
+
onDragEnd(newPosition, {
|
|
3158
|
+
width: width,
|
|
3159
|
+
height: height
|
|
3160
|
+
});
|
|
3124
3161
|
onResizeStop(_event, direction, node, delta);
|
|
3125
3162
|
};
|
|
3126
3163
|
var toolcontainerId = React.useRef(Date.now().toString()).current;
|
|
@@ -3384,6 +3421,12 @@ var ShortcutList = function ShortcutList(_ref) {
|
|
|
3384
3421
|
children: "h"
|
|
3385
3422
|
})]
|
|
3386
3423
|
})
|
|
3424
|
+
}, {
|
|
3425
|
+
titleKey: 'shared-toggle-syncviewer',
|
|
3426
|
+
description: jsx(ShortCutSegment, {
|
|
3427
|
+
type: "icon",
|
|
3428
|
+
children: "Y"
|
|
3429
|
+
})
|
|
3387
3430
|
}, {
|
|
3388
3431
|
titleKey: 'shared-change-timestep-or-speed',
|
|
3389
3432
|
description: jsxs(Fragment, {
|
|
@@ -5286,6 +5329,30 @@ var isAxiosAuthError = function isAxiosAuthError(error) {
|
|
|
5286
5329
|
}
|
|
5287
5330
|
return false;
|
|
5288
5331
|
};
|
|
5332
|
+
var isAuthStatusCode = function isAuthStatusCode(status) {
|
|
5333
|
+
return status === 401 || status === 403;
|
|
5334
|
+
};
|
|
5335
|
+
var isAuthError = function isAuthError(error) {
|
|
5336
|
+
if (isAxiosAuthError(error)) {
|
|
5337
|
+
return true;
|
|
5338
|
+
}
|
|
5339
|
+
var fetchLikeError = error;
|
|
5340
|
+
var cause = fetchLikeError.cause;
|
|
5341
|
+
if (typeof cause === 'number') {
|
|
5342
|
+
return isAuthStatusCode(cause);
|
|
5343
|
+
}
|
|
5344
|
+
if (cause && typeof cause === 'object') {
|
|
5345
|
+
var status = cause.status;
|
|
5346
|
+
if (typeof status === 'number' && isAuthStatusCode(status)) {
|
|
5347
|
+
return true;
|
|
5348
|
+
}
|
|
5349
|
+
var statusCode = cause.statusCode;
|
|
5350
|
+
if (typeof statusCode === 'number' && isAuthStatusCode(statusCode)) {
|
|
5351
|
+
return true;
|
|
5352
|
+
}
|
|
5353
|
+
}
|
|
5354
|
+
return error.message === '401' || error.message === '403';
|
|
5355
|
+
};
|
|
5289
5356
|
var getAxiosErrorMessage = function getAxiosErrorMessage(error) {
|
|
5290
5357
|
var data = error.response && error.response.data;
|
|
5291
5358
|
if (data && typeof data === 'string') {
|
|
@@ -5571,7 +5638,7 @@ var isBetween = function isBetween(date, from, to, inclusivity) {
|
|
|
5571
5638
|
}
|
|
5572
5639
|
var isBeforeEqual = inclusivity.startsWith('[');
|
|
5573
5640
|
var isAfterEqual = inclusivity[1] === ']';
|
|
5574
|
-
return (isBeforeEqual ? isEqual(from, date) || isBefore(from, date) : isBefore(from, date)) && (isAfterEqual ? isEqual(to, date) || isAfter(to, date) : isAfter(to, date));
|
|
5641
|
+
return (isBeforeEqual ? isEqual$1(from, date) || isBefore(from, date) : isBefore(from, date)) && (isAfterEqual ? isEqual$1(to, date) || isAfter(to, date) : isAfter(to, date));
|
|
5575
5642
|
};
|
|
5576
5643
|
/**
|
|
5577
5644
|
* Creates a new Date object with the specified date and time, or the current date and time if no arguments are provided.
|
|
@@ -5779,6 +5846,14 @@ var isValid = function isValid(date) {
|
|
|
5779
5846
|
var unix = function unix(date) {
|
|
5780
5847
|
return getUnixTime(date);
|
|
5781
5848
|
};
|
|
5849
|
+
/**
|
|
5850
|
+
* Get the seconds timestamp based on the given iso string.
|
|
5851
|
+
* @param {string} date - the given date as iso string
|
|
5852
|
+
* @returns the timestamp in seconds since the Unix Epoch on January 1st, 1970 at UTC.
|
|
5853
|
+
*/
|
|
5854
|
+
var unixFromISOString = function unixFromISOString(date) {
|
|
5855
|
+
return date ? parseISO(date).getTime() / 1000 : NaN;
|
|
5856
|
+
};
|
|
5782
5857
|
/**
|
|
5783
5858
|
* Return the Date object for a given timestamp
|
|
5784
5859
|
* @param {number} unixTime - timestamp
|
|
@@ -6080,7 +6155,7 @@ var index = /*#__PURE__*/Object.freeze({
|
|
|
6080
6155
|
isAfter: isAfter,
|
|
6081
6156
|
isBefore: isBefore,
|
|
6082
6157
|
isBetween: isBetween,
|
|
6083
|
-
isEqual: isEqual,
|
|
6158
|
+
isEqual: isEqual$1,
|
|
6084
6159
|
isValid: isValid,
|
|
6085
6160
|
isValidIsoDateString: isValidIsoDateString,
|
|
6086
6161
|
isWithinInterval: isWithinInterval,
|
|
@@ -6100,6 +6175,7 @@ var index = /*#__PURE__*/Object.freeze({
|
|
|
6100
6175
|
stringToDate: stringToDate,
|
|
6101
6176
|
sub: sub,
|
|
6102
6177
|
unix: unix,
|
|
6178
|
+
unixFromISOString: unixFromISOString,
|
|
6103
6179
|
utc: utc
|
|
6104
6180
|
});
|
|
6105
6181
|
|
|
@@ -6353,4 +6429,4 @@ var SystemScope = {
|
|
|
6353
6429
|
system: 'system'
|
|
6354
6430
|
};
|
|
6355
6431
|
|
|
6356
|
-
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 as dateUtils, defaultDelay, getAxiosErrorMessage, getAxiosWarningMessage, getErrorMessage, getInitials, getLastUpdateTitle, getPosition, getWarningMessage, isAxiosAuthError, isAxiosError, loadAllTranslations, pollingIntervalTimeout, renderCounter, safelyInitI18nForTestsAndStories, sessionStorageProvider, sharedTranslations, showPrompt, sliderHeaderStyle, tooltipContainerStyles, useConfirmationDialog, useControlledTooltip, useDebounce, useDialogActions, useIsMounted, useMakeSureContainerStaysInsideWindow, usePoller, usePreventBrowserClose, usePrevious, useResizeObserver, useScrollingInIsolation, useUserMenu, useWheelStopPropagation };
|
|
6432
|
+
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 as dateUtils, defaultDelay, getAxiosErrorMessage, getAxiosWarningMessage, getErrorMessage, getInitials, getLastUpdateTitle, getPosition, getWarningMessage, isAuthError, isAxiosAuthError, isAxiosError, loadAllTranslations, pollingIntervalTimeout, renderCounter, safelyInitI18nForTestsAndStories, sessionStorageProvider, sharedTranslations, showPrompt, sliderHeaderStyle, tooltipContainerStyles, useConfirmationDialog, useControlledTooltip, useDebounce, useDialogActions, useIsMounted, useMakeSureContainerStaysInsideWindow, usePoller, usePreventBrowserClose, usePrevious, useResizeObserver, useScrollingInIsolation, useUserMenu, useWheelStopPropagation };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@opengeoweb/shared",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "16.0.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": {
|
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
"url": "git@gitlab.com:opengeoweb/opengeoweb.git"
|
|
9
9
|
},
|
|
10
10
|
"dependencies": {
|
|
11
|
-
"@opengeoweb/theme": "
|
|
11
|
+
"@opengeoweb/theme": "16.0.0",
|
|
12
12
|
"react-draggable": "^4.4.6",
|
|
13
13
|
"re-resizable": "^6.9.11",
|
|
14
14
|
"lodash": "^4.17.21",
|
|
@@ -12,6 +12,7 @@ export declare const calculateDialogSizeAndPosition: () => {
|
|
|
12
12
|
export declare const calculateStartSize: (minSize: DraggableSize, prefSize: DraggableSize, startPosition: Position) => DraggableSize;
|
|
13
13
|
interface DraggableComponentProps extends Omit<ResizableComponentProps, 'bounds'> {
|
|
14
14
|
startPosition?: Position;
|
|
15
|
+
startDraggablePosition?: DraggablePosition;
|
|
15
16
|
onStartResize?: () => void;
|
|
16
17
|
isOpen?: boolean;
|
|
17
18
|
onClose?: () => void;
|
|
@@ -30,6 +31,7 @@ interface DraggableComponentProps extends Omit<ResizableComponentProps, 'bounds'
|
|
|
30
31
|
dragHandleIcon?: React.ReactNode;
|
|
31
32
|
closeIcon?: React.ReactNode;
|
|
32
33
|
sx?: SxProps;
|
|
34
|
+
resetPositionOnOpen?: boolean;
|
|
33
35
|
}
|
|
34
36
|
export declare const calculateNewPosition: (position: DraggablePosition, isRightAligned: boolean, handle: string, delta: NumberSize) => DraggablePosition;
|
|
35
37
|
export type Source = 'app' | 'module';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const useDebounce: (value:
|
|
1
|
+
export declare const useDebounce: <S>(value: S, timeout: number) => S;
|
|
@@ -44,7 +44,19 @@ export interface VerticalProfileDomain {
|
|
|
44
44
|
axes: VerticalProfileAxes;
|
|
45
45
|
referencing?: Referencing[];
|
|
46
46
|
}
|
|
47
|
-
|
|
47
|
+
interface GridAxes {
|
|
48
|
+
x: SingleValueAxis;
|
|
49
|
+
y: SingleValueAxis;
|
|
50
|
+
z: AxisValues;
|
|
51
|
+
t?: SingleTimeValueAxis;
|
|
52
|
+
}
|
|
53
|
+
export interface GridDomain {
|
|
54
|
+
type: 'Domain';
|
|
55
|
+
domainType: 'Grid';
|
|
56
|
+
axes: GridAxes;
|
|
57
|
+
referencing?: Referencing[];
|
|
58
|
+
}
|
|
59
|
+
export type CoverageDomain = VerticalProfileDomain | PointDomain | PointSeriesDomain | GridDomain;
|
|
48
60
|
interface NdArray {
|
|
49
61
|
type: 'NdArray';
|
|
50
62
|
dataType: 'float' | 'integer' | 'string';
|
package/src/lib/types/types.d.ts
CHANGED
|
@@ -53,6 +53,7 @@ export interface SoundingsCollection {
|
|
|
53
53
|
url: string;
|
|
54
54
|
description: string;
|
|
55
55
|
parameterMappings?: Record<string, string>;
|
|
56
|
+
windSpeedUnit?: string;
|
|
56
57
|
}
|
|
57
58
|
export type Coordinates = [number, number];
|
|
58
59
|
export interface SourceSelection {
|
|
@@ -61,6 +62,7 @@ export interface SourceSelection {
|
|
|
61
62
|
isChecked?: boolean;
|
|
62
63
|
verticalRange?: string;
|
|
63
64
|
parameterMappings?: Record<string, string>;
|
|
65
|
+
windSpeedUnit?: string;
|
|
64
66
|
name?: string;
|
|
65
67
|
}
|
|
66
68
|
export interface TimeSeriesService {
|
|
@@ -2,6 +2,7 @@ import type { AxiosError } from 'axios';
|
|
|
2
2
|
export declare const DEFAULT_ERROR_MESSAGE = "An error has occurred";
|
|
3
3
|
export declare const isAxiosError: (error: AxiosError | Error) => error is AxiosError;
|
|
4
4
|
export declare const isAxiosAuthError: (error: AxiosError | Error) => boolean;
|
|
5
|
+
export declare const isAuthError: (error: AxiosError | Error) => boolean;
|
|
5
6
|
export declare const getAxiosErrorMessage: (error: AxiosError) => string;
|
|
6
7
|
export declare const getErrorMessage: (error: Error | AxiosError) => string;
|
|
7
8
|
export declare const getAxiosWarningMessage: (error: AxiosError) => string;
|
|
@@ -258,6 +258,12 @@ export declare const isValid: (date: Date | number) => boolean;
|
|
|
258
258
|
* @returns the timestamp
|
|
259
259
|
*/
|
|
260
260
|
export declare const unix: (date: Date | number) => number;
|
|
261
|
+
/**
|
|
262
|
+
* Get the seconds timestamp based on the given iso string.
|
|
263
|
+
* @param {string} date - the given date as iso string
|
|
264
|
+
* @returns the timestamp in seconds since the Unix Epoch on January 1st, 1970 at UTC.
|
|
265
|
+
*/
|
|
266
|
+
export declare const unixFromISOString: (date: string) => number;
|
|
261
267
|
/**
|
|
262
268
|
* Return the Date object for a given timestamp
|
|
263
269
|
* @param {number} unixTime - timestamp
|