@opengeoweb/shared 15.3.0 → 17.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 +947 -406
- package/package.json +3 -3
- package/src/index.d.ts +0 -7
- package/src/lib/components/AlertBanner/AlertBanner.d.ts +0 -16
- package/src/lib/components/AlertBanner/AlertBanner.spec.d.ts +0 -1
- package/src/lib/components/AlertBanner/AlertBanner.stories.d.ts +0 -8
- package/src/lib/components/AlertBanner/index.d.ts +0 -1
- package/src/lib/components/AlertIcon/AlertIcon.d.ts +0 -8
- package/src/lib/components/AlertIcon/index.d.ts +0 -1
- package/src/lib/components/AppHeader/AppHeader.d.ts +0 -10
- package/src/lib/components/AppHeader/AppHeader.spec.d.ts +0 -1
- package/src/lib/components/AppHeader/AppHeader.stories.d.ts +0 -8
- package/src/lib/components/AppHeader/index.d.ts +0 -1
- package/src/lib/components/AppLayout/AppLayout.d.ts +0 -7
- package/src/lib/components/AppLayout/AppLayout.spec.d.ts +0 -1
- package/src/lib/components/AppLayout/AppLayout.stories.d.ts +0 -8
- package/src/lib/components/AppLayout/index.d.ts +0 -1
- package/src/lib/components/Avatar/Avatar.d.ts +0 -8
- package/src/lib/components/Avatar/Avatar.stories.d.ts +0 -8
- package/src/lib/components/Avatar/index.d.ts +0 -1
- package/src/lib/components/CanvasComponent/CanvasComponent.d.ts +0 -71
- package/src/lib/components/CanvasComponent/CanvasComponent.spec.d.ts +0 -1
- package/src/lib/components/CanvasComponent/CanvasComponent.stories.d.ts +0 -8
- package/src/lib/components/CanvasComponent/index.d.ts +0 -1
- package/src/lib/components/ConfirmationDialog/ConfirmationButtons.d.ts +0 -12
- package/src/lib/components/ConfirmationDialog/ConfirmationButtons.spec.d.ts +0 -1
- package/src/lib/components/ConfirmationDialog/ConfirmationButtons.stories.d.ts +0 -9
- package/src/lib/components/ConfirmationDialog/ConfirmationDialog.d.ts +0 -22
- package/src/lib/components/ConfirmationDialog/ConfirmationDialog.spec.d.ts +0 -1
- package/src/lib/components/ConfirmationDialog/ConfirmationDialog.stories.d.ts +0 -21
- package/src/lib/components/ConfirmationDialog/ConfirmationService.d.ts +0 -18
- package/src/lib/components/ConfirmationDialog/ConfirmationService.spec.d.ts +0 -1
- package/src/lib/components/ConfirmationDialog/index.d.ts +0 -3
- package/src/lib/components/CustomAccordion/CustomAccordion.d.ts +0 -13
- package/src/lib/components/CustomAccordion/CustomAccordion.spec.d.ts +0 -1
- package/src/lib/components/CustomAccordion/CustomAccordion.stories.d.ts +0 -8
- package/src/lib/components/CustomAccordion/index.d.ts +0 -1
- package/src/lib/components/CustomDialog/CustomDialog.d.ts +0 -18
- package/src/lib/components/CustomDialog/CustomDialog.spec.d.ts +0 -1
- package/src/lib/components/CustomDialog/CustomDialog.stories.d.ts +0 -22
- package/src/lib/components/CustomDialog/CustomDialogHeader.d.ts +0 -13
- package/src/lib/components/CustomDialog/CustomDialogHeader.spec.d.ts +0 -1
- package/src/lib/components/CustomDialog/CustomDialogHeader.stories.d.ts +0 -11
- package/src/lib/components/CustomDialog/index.d.ts +0 -2
- package/src/lib/components/CustomDialog/types.d.ts +0 -1
- package/src/lib/components/CustomIconButton/CustomIconButton.d.ts +0 -15
- package/src/lib/components/CustomIconButton/CustomIconButton.spec.d.ts +0 -1
- package/src/lib/components/CustomIconButton/CustomIconButton.stories.d.ts +0 -8
- package/src/lib/components/CustomIconButton/index.d.ts +0 -1
- package/src/lib/components/CustomSlider/CustomSlider.d.ts +0 -14
- package/src/lib/components/CustomSlider/CustomSlider.spec.d.ts +0 -1
- package/src/lib/components/CustomSlider/CustomSlider.stories.d.ts +0 -8
- package/src/lib/components/CustomSlider/index.d.ts +0 -1
- package/src/lib/components/CustomToggleButton/CustomToggleButton.d.ts +0 -8
- package/src/lib/components/CustomToggleButton/CustomToggleButton.spec.d.ts +0 -1
- package/src/lib/components/CustomToggleButton/CustomToggleButton.stories.d.ts +0 -8
- package/src/lib/components/CustomToggleButton/index.d.ts +0 -1
- package/src/lib/components/CustomTooltip/CustomTooltip.d.ts +0 -5
- package/src/lib/components/CustomTooltip/CustomTooltip.spec.d.ts +0 -1
- package/src/lib/components/CustomTooltip/index.d.ts +0 -1
- package/src/lib/components/DraggableResizable/Draggable.d.ts +0 -16
- package/src/lib/components/DraggableResizable/Draggable.spec.d.ts +0 -1
- package/src/lib/components/DraggableResizable/Resizable.d.ts +0 -10
- package/src/lib/components/DraggableResizable/Resizable.spec.d.ts +0 -1
- package/src/lib/components/DraggableResizable/index.d.ts +0 -3
- package/src/lib/components/DraggableResizable/types.d.ts +0 -27
- package/src/lib/components/ErrorBoundary/ErrorBoundary.d.ts +0 -31
- package/src/lib/components/ErrorBoundary/ErrorBoundary.spec.d.ts +0 -1
- package/src/lib/components/ErrorBoundary/ErrorBoundary.stories.d.ts +0 -8
- package/src/lib/components/ErrorBoundary/index.d.ts +0 -1
- package/src/lib/components/Filter/Filter.d.ts +0 -18
- package/src/lib/components/Filter/Filter.spec.d.ts +0 -1
- package/src/lib/components/Filter/Filter.stories.d.ts +0 -8
- package/src/lib/components/Filter/FilterChip.d.ts +0 -14
- package/src/lib/components/Filter/FilterChip.spec.d.ts +0 -1
- package/src/lib/components/Filter/FilterList.d.ts +0 -19
- package/src/lib/components/Filter/FilterList.spec.d.ts +0 -1
- package/src/lib/components/Filter/FilterOption.d.ts +0 -12
- package/src/lib/components/Filter/FilterToggleButton.d.ts +0 -6
- package/src/lib/components/Filter/SearchField.d.ts +0 -8
- package/src/lib/components/Filter/SearchField.spec.d.ts +0 -1
- package/src/lib/components/Filter/index.d.ts +0 -7
- package/src/lib/components/LastUpdateTime/LastUpdateTime.d.ts +0 -14
- package/src/lib/components/LastUpdateTime/LastUpdateTime.spec.d.ts +0 -1
- package/src/lib/components/LastUpdateTime/LastUpdateTime.stories.d.ts +0 -8
- package/src/lib/components/LastUpdateTime/index.d.ts +0 -1
- package/src/lib/components/Providers/Providers.d.ts +0 -18
- package/src/lib/components/Providers/index.d.ts +0 -1
- package/src/lib/components/SearchField/SearchField.d.ts +0 -10
- package/src/lib/components/SearchField/SearchField.spec.d.ts +0 -1
- package/src/lib/components/SearchField/SearchFieldButtonContainer.d.ts +0 -9
- package/src/lib/components/SearchField/SearchFieldButtonContainer.spec.d.ts +0 -1
- package/src/lib/components/SearchField/index.d.ts +0 -2
- package/src/lib/components/SearchHighlight/SearchHighlight.d.ts +0 -7
- package/src/lib/components/SearchHighlight/SearchHighlight.spec.d.ts +0 -1
- package/src/lib/components/SearchHighlight/SearchHighlight.stories.d.ts +0 -8
- package/src/lib/components/SearchHighlight/index.d.ts +0 -1
- package/src/lib/components/StatusTag/StatusTag.d.ts +0 -17
- package/src/lib/components/StatusTag/StatusTag.spec.d.ts +0 -1
- package/src/lib/components/StatusTag/StatusTag.stories.d.ts +0 -8
- package/src/lib/components/StatusTag/index.d.ts +0 -1
- package/src/lib/components/Storybook/StorybookDocsWrapper.d.ts +0 -6
- package/src/lib/components/Storybook/index.d.ts +0 -1
- package/src/lib/components/SwitchButton/SwitchButton.d.ts +0 -8
- package/src/lib/components/SwitchButton/SwitchButton.spec.d.ts +0 -1
- package/src/lib/components/SwitchButton/index.d.ts +0 -1
- package/src/lib/components/ToggleMenu/ToggleMenu.d.ts +0 -30
- package/src/lib/components/ToggleMenu/ToggleMenu.spec.d.ts +0 -1
- package/src/lib/components/ToggleMenu/ToggleMenu.stories.d.ts +0 -8
- package/src/lib/components/ToggleMenu/index.d.ts +0 -1
- package/src/lib/components/ToolContainer/ToolContainer.d.ts +0 -5
- package/src/lib/components/ToolContainer/ToolContainer.spec.d.ts +0 -1
- package/src/lib/components/ToolContainer/ToolContainer.stories.d.ts +0 -16
- package/src/lib/components/ToolContainer/ToolContainerDraggable.d.ts +0 -39
- package/src/lib/components/ToolContainer/ToolContainerDraggable.spec.d.ts +0 -1
- package/src/lib/components/ToolContainer/ToolContainerDraggable.stories.d.ts +0 -13
- package/src/lib/components/ToolContainer/ToolContainerSnapShots.stories.d.ts +0 -13
- package/src/lib/components/ToolContainer/ToolFooter.d.ts +0 -3
- package/src/lib/components/ToolContainer/ToolFooter.spec.d.ts +0 -1
- package/src/lib/components/ToolContainer/ToolHeader.d.ts +0 -4
- package/src/lib/components/ToolContainer/ToolHeader.spec.d.ts +0 -1
- package/src/lib/components/ToolContainer/ToolHeader.stories.d.ts +0 -8
- package/src/lib/components/ToolContainer/index.d.ts +0 -7
- package/src/lib/components/ToolContainer/types.d.ts +0 -19
- package/src/lib/components/ToolContainer/useHandleSizeFromOutsideComponent.d.ts +0 -15
- package/src/lib/components/ToolContainer/useHandleSizeFromOutsideComponent.spec.d.ts +0 -1
- package/src/lib/components/TooltipSelect/TooltipSelect.d.ts +0 -23
- package/src/lib/components/TooltipSelect/TooltipSelect.spec.d.ts +0 -1
- package/src/lib/components/TooltipSelect/TooltipSelect.stories.d.ts +0 -10
- package/src/lib/components/TooltipSelect/index.d.ts +0 -1
- package/src/lib/components/UserMenu/CheatSheet/CheatSheet.d.ts +0 -3
- package/src/lib/components/UserMenu/CheatSheet/CheatSheet.spec.d.ts +0 -1
- package/src/lib/components/UserMenu/CheatSheet/CheatSheet.stories.d.ts +0 -10
- package/src/lib/components/UserMenu/CheatSheet/ShortcutList.d.ts +0 -6
- package/src/lib/components/UserMenu/CheatSheet/ShortcutList.spec.d.ts +0 -1
- package/src/lib/components/UserMenu/CheatSheet/ShortcutSegment.d.ts +0 -7
- package/src/lib/components/UserMenu/CheatSheet/ShortcutSegment.spec.d.ts +0 -1
- package/src/lib/components/UserMenu/UserMenu.d.ts +0 -11
- package/src/lib/components/UserMenu/UserMenu.spec.d.ts +0 -1
- package/src/lib/components/UserMenu/UserMenu.stories.d.ts +0 -10
- package/src/lib/components/UserMenu/UserMenuItemCheatSheet.d.ts +0 -3
- package/src/lib/components/UserMenu/UserMenuItemCheatSheet.spec.d.ts +0 -1
- package/src/lib/components/UserMenu/UserMenuItemTheme.d.ts +0 -6
- package/src/lib/components/UserMenu/UserMenuItemTheme.spec.d.ts +0 -1
- package/src/lib/components/UserMenu/index.d.ts +0 -5
- package/src/lib/components/UserMenu/useUserMenu.d.ts +0 -7
- package/src/lib/components/UserMenu/useUserMenu.spec.d.ts +0 -1
- package/src/lib/components/UserMenu/utils.d.ts +0 -1
- package/src/lib/components/index.d.ts +0 -26
- package/src/lib/hooks/index.d.ts +0 -9
- package/src/lib/hooks/useDebounce/useDebounce.d.ts +0 -1
- package/src/lib/hooks/useDebounce/useDebounce.spec.d.ts +0 -1
- package/src/lib/hooks/useIsMounted/useIsMounted.d.ts +0 -4
- package/src/lib/hooks/useIsMounted/useIsMounted.spec.d.ts +0 -1
- package/src/lib/hooks/useMakeSureContainerStaysInsideWindow/useMakeSureContainerStaysInsideWindow.d.ts +0 -4
- package/src/lib/hooks/useMakeSureContainerStaysInsideWindow/useMakeSureContainerStaysInsideWindow.spec.d.ts +0 -1
- package/src/lib/hooks/usePoller/usePoller.d.ts +0 -3
- package/src/lib/hooks/usePoller/usePoller.spec.d.ts +0 -1
- package/src/lib/hooks/usePoller/usePoller.stories.d.ts +0 -6
- package/src/lib/hooks/usePreventBrowserClose/usePreventBrowserClose.d.ts +0 -2
- package/src/lib/hooks/usePreventBrowserClose/usePreventBrowserClose.spec.d.ts +0 -1
- package/src/lib/hooks/usePreventBrowserClose/usePreventBrowserClose.stories.d.ts +0 -6
- package/src/lib/hooks/usePrevious/usePrevious.d.ts +0 -1
- package/src/lib/hooks/usePrevious/usePrevious.spec.d.ts +0 -1
- package/src/lib/hooks/usePrevious/usePrevious.stories.d.ts +0 -6
- package/src/lib/hooks/useResizeObserver/useResizeObserver.d.ts +0 -2
- package/src/lib/hooks/useResizeObserver/useResizeObserver.spec.d.ts +0 -1
- package/src/lib/hooks/useScrollingInIsolation/useScrollingInIsolation.d.ts +0 -11
- package/src/lib/hooks/useScrollingInIsolation/useScrollingInIsolation.spec.d.ts +0 -1
- package/src/lib/hooks/useWheelStopPropagation/useWheelStopPropagation.d.ts +0 -2
- package/src/lib/hooks/useWheelStopPropagation/useWheelStopPropagation.spec.d.ts +0 -1
- package/src/lib/types/crss-types.d.ts +0 -26
- package/src/lib/types/edr-coverage-types.d.ts +0 -98
- package/src/lib/types/index.d.ts +0 -2
- package/src/lib/types/types.d.ts +0 -190
- package/src/lib/utils/axiosErrorUtils/axiosErrorUtils.d.ts +0 -9
- package/src/lib/utils/axiosErrorUtils/axiosErrorUtils.spec.d.ts +0 -1
- package/src/lib/utils/axiosErrorUtils/index.d.ts +0 -1
- package/src/lib/utils/dateUtils/dateFormats.d.ts +0 -8
- package/src/lib/utils/dateUtils/dateUtils.d.ts +0 -372
- package/src/lib/utils/dateUtils/dateUtils.spec.d.ts +0 -1
- package/src/lib/utils/dateUtils/index.d.ts +0 -2
- package/src/lib/utils/i18n.d.ts +0 -14
- package/src/lib/utils/i18n.spec.d.ts +0 -1
- package/src/lib/utils/index.d.ts +0 -6
- package/src/lib/utils/mapProjections.d.ts +0 -79
- package/src/lib/utils/renderCounter.d.ts +0 -21
- package/src/lib/utils/renderCounter.spec.d.ts +0 -1
- package/src/lib/utils/sessionStorage.d.ts +0 -28
- package/src/lib/utils/sessionStorage.spec.d.ts +0 -1
|
@@ -1,372 +0,0 @@
|
|
|
1
|
-
import type { Duration, NearestMinutes, Locale } from 'date-fns';
|
|
2
|
-
import { parseISO, isEqual, startOfDay, isWithinInterval, getDayOfYear, getDay, getMonth, getYear, getWeek } from 'date-fns';
|
|
3
|
-
export interface DateValues {
|
|
4
|
-
year?: number;
|
|
5
|
-
month?: number;
|
|
6
|
-
date?: number;
|
|
7
|
-
hours?: number;
|
|
8
|
-
minutes?: number;
|
|
9
|
-
seconds?: number;
|
|
10
|
-
milliseconds?: number;
|
|
11
|
-
}
|
|
12
|
-
export declare const getDateFnsLocale: (locale?: string) => Locale;
|
|
13
|
-
/**
|
|
14
|
-
* Parsing date strings with geoweb dateUtils:
|
|
15
|
-
*
|
|
16
|
-
* An ISO String *with timezone* can safely be parsed directly to a date:
|
|
17
|
-
*
|
|
18
|
-
* date = new Date('2022-10-10T15:30:00Z')
|
|
19
|
-
* date = new Date('2022-10-10T15:30:00+00:00')
|
|
20
|
-
* date = new Date('2022-10-10T15:30:00+02:00')
|
|
21
|
-
*
|
|
22
|
-
* or using the dateUtils isoStringToDate function *with utc=false*
|
|
23
|
-
*
|
|
24
|
-
* date = isoStringToDate('2022-10-10T15:30:00Z', false)
|
|
25
|
-
*
|
|
26
|
-
* An ISO String *without a timezone* can be parsed with isoStringToDate
|
|
27
|
-
*
|
|
28
|
-
* date = isoStringToDate('2022-10-10T15:30:00')
|
|
29
|
-
*
|
|
30
|
-
* *Do not parse ISO without timezone using `new Date()` unless you correct for the local timezone*
|
|
31
|
-
*
|
|
32
|
-
* To parse an arbitrary date string with timezone use:
|
|
33
|
-
*
|
|
34
|
-
* date = stringToDate('2022.11.10, 11:15 +01:00', 'yyyy.MM.dd, HH:mm xxx', false)
|
|
35
|
-
*
|
|
36
|
-
* To parse an arbitrary date string without timezone use:
|
|
37
|
-
*
|
|
38
|
-
* date = stringToDate('2022.11.10, 11:15', 'yyyy.MM.dd, HH:mm')
|
|
39
|
-
*
|
|
40
|
-
*
|
|
41
|
-
* To safely convert dates to utc strings use:
|
|
42
|
-
*
|
|
43
|
-
* date.toISOString()
|
|
44
|
-
*
|
|
45
|
-
* To get parts of UTC time use
|
|
46
|
-
*
|
|
47
|
-
* date.getUTCHours()
|
|
48
|
-
* date.getUTCMins()
|
|
49
|
-
*
|
|
50
|
-
* To parse an arbitrary date string to a UTC string use:
|
|
51
|
-
*
|
|
52
|
-
* dateToString(new Date('2022-10-10T15:30:00Z'), 'HH:ss dd MMM yyyy')
|
|
53
|
-
*
|
|
54
|
-
*/
|
|
55
|
-
/**
|
|
56
|
-
* Parse an ISO string to a date
|
|
57
|
-
*
|
|
58
|
-
* Expects the following props:
|
|
59
|
-
* @param {string} input - string containing date
|
|
60
|
-
*
|
|
61
|
-
* @returns {Date} Date
|
|
62
|
-
* @example
|
|
63
|
-
* ``` isoStringToDate("2022-5-10T20:32:00+00:00") ```
|
|
64
|
-
* ``` isoStringToDate("2022-5-10T20:32:00:00Z", false) ```
|
|
65
|
-
*/
|
|
66
|
-
export declare const isoStringToDate: (input: string, utc?: boolean) => Date | undefined;
|
|
67
|
-
export declare const isValidIsoDateString: (input: string) => boolean;
|
|
68
|
-
/**
|
|
69
|
-
* Parse a string to a date
|
|
70
|
-
*
|
|
71
|
-
* ***NOTE: String will be parsed in local time if utc is set to false***
|
|
72
|
-
*
|
|
73
|
-
* Expects the following props:
|
|
74
|
-
* @param {string} input - string containing date
|
|
75
|
-
* @param {string} strFormat - format of the string, see: https://date-fns.org/v2.29.3/docs/parse
|
|
76
|
-
* @param {boolean} utc [ default = true ] - boolean indicating whether to parse as UTC
|
|
77
|
-
* @param {Date} referenceDate [ default = new Date() ] - defines values missing from the parsed dateString
|
|
78
|
-
*
|
|
79
|
-
* @returns {Date} Date
|
|
80
|
-
* @example
|
|
81
|
-
* ``` stringToDate("2022 5 10 20:32", 'yyyy M d HH:mm')) ```
|
|
82
|
-
*/
|
|
83
|
-
export declare const stringToDate: (input: string | undefined, strFormat: string, utc?: boolean, referenceDate?: Date | number) => Date | undefined;
|
|
84
|
-
export declare const dateToIsoString: (input: Date | undefined) => string | undefined;
|
|
85
|
-
/**
|
|
86
|
-
* Use this if you initialise a date without a timezone to set it to utc correctly
|
|
87
|
-
* eg.
|
|
88
|
-
* new Date(2022, 10, 12, 15, 30)
|
|
89
|
-
* should be:
|
|
90
|
-
* setUTCDate(new Date(2022, 10, 12, 15, 30))
|
|
91
|
-
*
|
|
92
|
-
* Expects the following props:
|
|
93
|
-
* @param {Date} inDate - date to be set to UTC
|
|
94
|
-
*
|
|
95
|
-
* @returns {Date} - Date in UTC
|
|
96
|
-
* @example
|
|
97
|
-
* ``` setUTCDate(new Date(2022, 10, 12, 15, 30)) ```
|
|
98
|
-
*/
|
|
99
|
-
export declare const setUTCDate: (inDate: Date | undefined) => Date | undefined;
|
|
100
|
-
/**
|
|
101
|
-
* Format a date to a string
|
|
102
|
-
*
|
|
103
|
-
* Expects the following props:
|
|
104
|
-
* @param {Date} inDate - date to be formatted
|
|
105
|
-
* @param {string} strFormat - [default: "yyyy-MM-dd'T'HH:mm:ss'Z'"] format of string
|
|
106
|
-
* @param {boolean} utc - [default: true] true to return in utc otherwise return in local timezone
|
|
107
|
-
*
|
|
108
|
-
* @returns {string} - formatted date string
|
|
109
|
-
* @example
|
|
110
|
-
* ``` dateToString(new Date(2022, 10, 12, 15, 30), 'dd MMM yyyy') ```
|
|
111
|
-
*/
|
|
112
|
-
export declare const dateToString: (inDate: Date | undefined, strFormat?: string, utc?: boolean, locale?: string) => string | undefined;
|
|
113
|
-
/**
|
|
114
|
-
* Find out if a date is between two other dates.
|
|
115
|
-
*
|
|
116
|
-
* Inclusivity parameter matches that used in momentjs where '[' indicates inclusion and '(' indicates exclusion.
|
|
117
|
-
*
|
|
118
|
-
* Expects the following props:
|
|
119
|
-
* @param {Date} date - date to be tested
|
|
120
|
-
* @param {Date} from - first date
|
|
121
|
-
* @param {Date} to - last date
|
|
122
|
-
* @param {string} inclusivity - [default: '()'] Must be one of : '()', '[]', '(]', '[)'
|
|
123
|
-
*
|
|
124
|
-
* @returns {boolen} - true if date is between, otherwise false
|
|
125
|
-
*
|
|
126
|
-
*/
|
|
127
|
-
export declare const isBetween: (date: Date, from: Date, to: Date, inclusivity?: string) => boolean;
|
|
128
|
-
/**
|
|
129
|
-
* Creates a new Date object with the specified date and time, or the current date and time if no arguments are provided.
|
|
130
|
-
*
|
|
131
|
-
* @param yearOrIsoString The year for the new Date object, or an ISO-formatted string representing the date and time.
|
|
132
|
-
* @param month The month for the new Date object (0-11).
|
|
133
|
-
* @param day The day for the new Date object (1-31).
|
|
134
|
-
* @param hours The hour for the new Date object (0-23).
|
|
135
|
-
* @param minutes The minute for the new Date object (0-59).
|
|
136
|
-
* @param seconds The second for the new Date object (0-59).
|
|
137
|
-
* @param milliseconds The millisecond for the new Date object (0-999).
|
|
138
|
-
* @returns A new Date object with the specified date and time, or the current date and time if no arguments are provided.
|
|
139
|
-
*
|
|
140
|
-
* @example
|
|
141
|
-
* createDate(2022, 11, 13);
|
|
142
|
-
* // => 2022-12-13T00:00:00.000Z
|
|
143
|
-
*
|
|
144
|
-
* @example
|
|
145
|
-
* createDate('2022-12-13T00:00:00.000Z');
|
|
146
|
-
* // => 2022-12-13T00:00:00.000Z
|
|
147
|
-
*/
|
|
148
|
-
export declare const createDate: (yearOrIsoString?: number | string, month?: number, day?: number, hours?: number, minutes?: number, seconds?: number, milliseconds?: number) => Date;
|
|
149
|
-
/**
|
|
150
|
-
*
|
|
151
|
-
* @param date
|
|
152
|
-
* @param duration
|
|
153
|
-
* @returns {Date} the new Date
|
|
154
|
-
*/
|
|
155
|
-
export declare const add: (date: Date | number, duration: Duration) => Date;
|
|
156
|
-
/**
|
|
157
|
-
*
|
|
158
|
-
* @param date
|
|
159
|
-
* @param duration
|
|
160
|
-
* @returns {Date} the new Date
|
|
161
|
-
*/
|
|
162
|
-
export declare const sub: (date: Date | number, duration: Duration) => Date;
|
|
163
|
-
/**
|
|
164
|
-
* Finds the number of years between to dates
|
|
165
|
-
*
|
|
166
|
-
* @param dateLeft - the later date
|
|
167
|
-
* @param dateRight - the earlier date
|
|
168
|
-
* @returns {number} the number of minutes
|
|
169
|
-
*/
|
|
170
|
-
export declare const differenceInYears: (dateLeft: Date | number, dateRight: Date | number) => number;
|
|
171
|
-
/**
|
|
172
|
-
* Finds the number of months between to dates
|
|
173
|
-
*
|
|
174
|
-
* @param dateLeft - the later date
|
|
175
|
-
* @param dateRight - the earlier date
|
|
176
|
-
* @returns {number} the number of minutes
|
|
177
|
-
*/
|
|
178
|
-
export declare const differenceInMonths: (dateLeft: Date | number | string, dateRight: Date | number | string) => number;
|
|
179
|
-
/**
|
|
180
|
-
* Finds the number of days between to dates
|
|
181
|
-
*
|
|
182
|
-
* @param dateLeft - the later date
|
|
183
|
-
* @param dateRight - the earlier date
|
|
184
|
-
* @returns {number} the number of minutes
|
|
185
|
-
*/
|
|
186
|
-
export declare const differenceInDays: (dateLeft: Date | number | string, dateRight: Date | number | string) => number;
|
|
187
|
-
/**
|
|
188
|
-
* Finds the number of minuts between to dates
|
|
189
|
-
*
|
|
190
|
-
* @param dateLeft - the later date
|
|
191
|
-
* @param dateRight - the earlier date
|
|
192
|
-
* @returns {number} the number of minutes
|
|
193
|
-
*/
|
|
194
|
-
export declare const differenceInMinutes: (dateLeft: Date | number, dateRight: Date | number) => number;
|
|
195
|
-
/**
|
|
196
|
-
* Finds the number of hours between to dates
|
|
197
|
-
*
|
|
198
|
-
* @param dateLeft - the later date
|
|
199
|
-
* @param dateRight - the earlier date
|
|
200
|
-
* @returns {number} the number of hours
|
|
201
|
-
*/
|
|
202
|
-
export declare const differenceInHours: (dateLeft: Date | number, dateRight: Date | number, roundingMethod?: "ceil" | "floor" | "round" | "trunc") => number;
|
|
203
|
-
/**
|
|
204
|
-
* Finds the number of seconds between to dates
|
|
205
|
-
*
|
|
206
|
-
* @param dateLeft - the later date
|
|
207
|
-
* @param dateRight - the earlier date
|
|
208
|
-
* @returns {number} the number of minutes
|
|
209
|
-
*/
|
|
210
|
-
export declare const differenceInSeconds: (dateLeft: Date | number, dateRight: Date | number) => number;
|
|
211
|
-
/**
|
|
212
|
-
*
|
|
213
|
-
* @param date - the date to be rounded
|
|
214
|
-
* @param options - the options for rounding
|
|
215
|
-
* @returns the new date
|
|
216
|
-
*/
|
|
217
|
-
export declare const roundToNearestMinutes: (date: Date | number, options: {
|
|
218
|
-
nearestTo: NearestMinutes;
|
|
219
|
-
}) => Date;
|
|
220
|
-
/**
|
|
221
|
-
*
|
|
222
|
-
* @param date - the date that should be before the other one to return true
|
|
223
|
-
* @param dateToCompare -the date to compare with
|
|
224
|
-
*
|
|
225
|
-
* @returns the first date is before the second date
|
|
226
|
-
*/
|
|
227
|
-
export declare const isBefore: (date: Date | number, dateToCompare: Date | number) => boolean;
|
|
228
|
-
/**
|
|
229
|
-
*
|
|
230
|
-
* @param date - the date that should be after the other one to return true
|
|
231
|
-
* @param dateToCompare -the date to compare with
|
|
232
|
-
*
|
|
233
|
-
* @returns the first date is after the second date
|
|
234
|
-
*/
|
|
235
|
-
export declare const isAfter: (date: Date | number, dateToCompare: Date | number) => boolean;
|
|
236
|
-
/**
|
|
237
|
-
* Gracefully parsing string to a date, setting tz to UTC even if it's missing or input is invalid
|
|
238
|
-
* Note: use getUtcFromString() to convert a string to a date with stricter returns
|
|
239
|
-
* @param dateStr - string containing date
|
|
240
|
-
* @returns {Date} - Date in UTC, or current date when something invalid is passed.
|
|
241
|
-
*/
|
|
242
|
-
export declare const utc: (dateStr?: string) => Date;
|
|
243
|
-
/**
|
|
244
|
-
* Parsing string to a date. Stricter check, will return undefined when dateString is invalid.
|
|
245
|
-
* @param dateStr - string containing date
|
|
246
|
-
* @returns {Date} - Date in UTC, undefined when not valid
|
|
247
|
-
*/
|
|
248
|
-
export declare const getUtcFromString: (dateStr: string | undefined | null) => Date | undefined;
|
|
249
|
-
/**
|
|
250
|
-
* Check if a date object is valid
|
|
251
|
-
* @param {Date | number} date - date to be checked
|
|
252
|
-
* @returns {boolean} - True if valid
|
|
253
|
-
*/
|
|
254
|
-
export declare const isValid: (date: Date | number) => boolean;
|
|
255
|
-
/**
|
|
256
|
-
* Get the seconds timestamp of the given date
|
|
257
|
-
* @param {Date} date - the given date
|
|
258
|
-
* @returns the timestamp
|
|
259
|
-
*/
|
|
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;
|
|
267
|
-
/**
|
|
268
|
-
* Return the Date object for a given timestamp
|
|
269
|
-
* @param {number} unixTime - timestamp
|
|
270
|
-
* @returns the timestamp
|
|
271
|
-
*/
|
|
272
|
-
export declare const fromUnix: (unixTime: number) => Date;
|
|
273
|
-
export declare const parseCustomDateString: (dateStr: string) => Date;
|
|
274
|
-
/**
|
|
275
|
-
* Returns Date in UTC
|
|
276
|
-
* @returns {Date} - Date in UTC
|
|
277
|
-
*/
|
|
278
|
-
export declare const getNowUtc: () => Date;
|
|
279
|
-
/**
|
|
280
|
-
* Returns current time as string
|
|
281
|
-
* @param {string} strFormat - [default: "yyyy-MM-dd'T'HH:mm:ss'Z'"] format of string
|
|
282
|
-
* @param {boolean} utc - [default: true] true to return in utc otherwise return in local timezone
|
|
283
|
-
*
|
|
284
|
-
* @returns {string} - formatted date string
|
|
285
|
-
*/
|
|
286
|
-
export declare const getCurrentTimeAsString: (strFormat?: string, utc?: boolean) => string;
|
|
287
|
-
/**
|
|
288
|
-
* Set date values to a given date (by default it is assumed you are passing the new values in UTC).
|
|
289
|
-
* Note that months start at 0!
|
|
290
|
-
* @param date - the dater to be changed
|
|
291
|
-
* @param values - an object with options
|
|
292
|
-
* @param useLocalTimeZone - boolean true if you are passing the values in local timezone
|
|
293
|
-
* @returns the new date with options set
|
|
294
|
-
*/
|
|
295
|
-
export declare const set: (date: Date, values: DateValues, useLocalTimeZone?: boolean) => Date;
|
|
296
|
-
/**
|
|
297
|
-
* Get hours of a passed date in UTC (or local timezone if passed false)
|
|
298
|
-
* @param date - the date of which to extract hours
|
|
299
|
-
* @param utc - boolean true - whether to get UTC hours
|
|
300
|
-
* @returns the hour number
|
|
301
|
-
*/
|
|
302
|
-
export declare const getHours: (date: Date, utc?: boolean) => number;
|
|
303
|
-
/**
|
|
304
|
-
* Return the start of hour for the given date. The result will be in UTC.
|
|
305
|
-
* @param date - the date of which to retrieve the start of the hour
|
|
306
|
-
* @returns the new date
|
|
307
|
-
*/
|
|
308
|
-
export declare const startOfHourUTC: (date: Date) => Date;
|
|
309
|
-
/**
|
|
310
|
-
* Return the start of a day for the given date. The result will be in UTC.
|
|
311
|
-
* @param date - the date of which to retrieve the start of day
|
|
312
|
-
* @returns the new date
|
|
313
|
-
*/
|
|
314
|
-
export declare const startOfDayUTC: (date: Date) => Date;
|
|
315
|
-
/**
|
|
316
|
-
* Return the start of a week for the given date. The result will be in UTC.
|
|
317
|
-
* @param date - the date of which to retrieve the start of the week
|
|
318
|
-
* @returns the new date
|
|
319
|
-
*/
|
|
320
|
-
export declare const startOfWeekUTC: (date: Date) => Date;
|
|
321
|
-
/**
|
|
322
|
-
* Return the start of a month for the given date. The result will be in UTC.
|
|
323
|
-
* @param date - the date of which to retrieve the start of the month
|
|
324
|
-
* @returns the new date
|
|
325
|
-
*/
|
|
326
|
-
export declare const startOfMonthUTC: (date: Date) => Date;
|
|
327
|
-
/**
|
|
328
|
-
* Return the start of a year for the given date. The result will be in UTC.
|
|
329
|
-
* @param date - the date of which to retrieve the start of the year
|
|
330
|
-
* @returns the new date
|
|
331
|
-
*/
|
|
332
|
-
export declare const startOfYearUTC: (date: Date) => Date;
|
|
333
|
-
/**
|
|
334
|
-
* Parse custom time format of NOW+current time | current date in UTC. The result will be in UTC.
|
|
335
|
-
* @param timeValue - string value
|
|
336
|
-
* @returns Time in UTC format
|
|
337
|
-
*/
|
|
338
|
-
export declare const convertNOWFormatToUTC: (timeValue: string) => string;
|
|
339
|
-
/**
|
|
340
|
-
* Parse custom time format of NOW+-hours and minutes || TODAY+-hours and minutes into UTC. The result will be in UTC.
|
|
341
|
-
* @param timeValue - string value
|
|
342
|
-
* @returns Time in UTC format
|
|
343
|
-
*/
|
|
344
|
-
export declare const convertNOWandTODAYFormatsToUTC: (timeValue: string) => string;
|
|
345
|
-
/**
|
|
346
|
-
* @name setSeconds
|
|
347
|
-
* @category Second Helpers
|
|
348
|
-
* @summary Set the seconds to the given date.
|
|
349
|
-
*
|
|
350
|
-
* @description
|
|
351
|
-
* Set the seconds to the given date.
|
|
352
|
-
*
|
|
353
|
-
* @typeParam DateType - The `Date` type, the function operates on. Gets inferred from passed arguments. Allows to use extensions like [`UTCDate`](https://github.com/date-fns/utc).
|
|
354
|
-
*
|
|
355
|
-
* @param date - The date to be changed
|
|
356
|
-
* @param seconds - The seconds of the new date
|
|
357
|
-
*
|
|
358
|
-
* @returns The new date with the seconds set
|
|
359
|
-
*
|
|
360
|
-
* @example
|
|
361
|
-
* // Set 45 seconds to 1 September 2014 11:30:40:
|
|
362
|
-
* const result = setSeconds(new Date(2014, 8, 1, 11, 30, 40), 45)
|
|
363
|
-
* //=> Mon Sep 01 2014 11:30:45
|
|
364
|
-
*/
|
|
365
|
-
export declare const setSeconds: (date: Date, seconds: number) => Date;
|
|
366
|
-
/**
|
|
367
|
-
* Compares two dates if values are the same
|
|
368
|
-
* @param {Date} date - first date
|
|
369
|
-
* @param {Date} date - second date
|
|
370
|
-
* @returns {boolean} - True if dates are equal
|
|
371
|
-
*/
|
|
372
|
-
export { isEqual, startOfDay, parseISO, isWithinInterval, getDayOfYear, getDay, getMonth, getYear, getWeek, };
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
package/src/lib/utils/i18n.d.ts
DELETED
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
import i18n from 'i18next';
|
|
2
|
-
import type { UseTranslationResponse } from 'react-i18next';
|
|
3
|
-
export declare const SHARED_NAMESPACE = "shared";
|
|
4
|
-
type GeoWebLanguage = 'en' | 'fi' | 'no' | 'nl';
|
|
5
|
-
interface TranslationToLoad {
|
|
6
|
-
ns: string;
|
|
7
|
-
translations: Record<GeoWebLanguage, Record<string, string>>;
|
|
8
|
-
}
|
|
9
|
-
export declare const loadAllTranslations: (i18nInstance: typeof i18n, translationsToLoad: TranslationToLoad[]) => void;
|
|
10
|
-
export declare const safelyInitI18nForTestsAndStories: (i18nInstance: typeof i18n, namespace: string, translationsToLoad: TranslationToLoad[], initLanguage?: string) => void;
|
|
11
|
-
export declare const initSharedI18n: () => void;
|
|
12
|
-
export declare const translateInTestsAndStories: (key: string, params?: Record<string, string | number> | undefined) => string;
|
|
13
|
-
export declare const useSharedTranslation: () => UseTranslationResponse<typeof SHARED_NAMESPACE, typeof i18n>;
|
|
14
|
-
export { i18n };
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
package/src/lib/utils/index.d.ts
DELETED
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
export * from './axiosErrorUtils';
|
|
2
|
-
export * as dateUtils from './dateUtils';
|
|
3
|
-
export * from './mapProjections';
|
|
4
|
-
export { renderCounter } from './renderCounter';
|
|
5
|
-
export { SessionStorageKey, sessionStorageProvider } from './sessionStorage';
|
|
6
|
-
export type { SessionStorageProvider } from './sessionStorage';
|
|
@@ -1,79 +0,0 @@
|
|
|
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_5041: {
|
|
47
|
-
readonly name: "Europe Polar Stereographic (EPSG:5041)";
|
|
48
|
-
readonly value: "EPSG:5041";
|
|
49
|
-
};
|
|
50
|
-
readonly EPSG_7399: {
|
|
51
|
-
readonly name: "WISCRS Vilas County (ftUS)";
|
|
52
|
-
readonly value: "EPSG:7399";
|
|
53
|
-
};
|
|
54
|
-
readonly EPSG_25832: {
|
|
55
|
-
readonly name: "ETRS89 / UTM zone 32N";
|
|
56
|
-
readonly value: "EPSG:25832";
|
|
57
|
-
};
|
|
58
|
-
readonly EPSG_28992: {
|
|
59
|
-
readonly name: "The Netherlands (28992)";
|
|
60
|
-
readonly value: "EPSG:28992";
|
|
61
|
-
};
|
|
62
|
-
readonly EPSG_32661: {
|
|
63
|
-
readonly name: "Europe Polar Stereographic";
|
|
64
|
-
readonly value: "EPSG:32661";
|
|
65
|
-
};
|
|
66
|
-
readonly EPSG_54030: {
|
|
67
|
-
readonly name: "Europe Robinson";
|
|
68
|
-
readonly value: "EPSG:54030";
|
|
69
|
-
};
|
|
70
|
-
readonly EPSG_900913: {
|
|
71
|
-
readonly name: "Google Maps Global Mercator";
|
|
72
|
-
readonly value: "EPSG:900913";
|
|
73
|
-
};
|
|
74
|
-
readonly EPSG_102100: {
|
|
75
|
-
readonly name: "WGS 84 / Pseudo-Mercator";
|
|
76
|
-
readonly value: "EPSG:102100";
|
|
77
|
-
};
|
|
78
|
-
};
|
|
79
|
-
export type EPSGCode = (typeof PROJECTION)[keyof typeof PROJECTION]['value'];
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Utility function to keep track of number of renders by a react component
|
|
3
|
-
*
|
|
4
|
-
* Usage:
|
|
5
|
-
* 1) reset all counters to zero by:
|
|
6
|
-
* renderCounter.reset()
|
|
7
|
-
* 2) in the render function of the functional component do:
|
|
8
|
-
* renderCounter.count(<your react functional component>.name);
|
|
9
|
-
* 3) in the test do:
|
|
10
|
-
* expect(renderCounter.get(<your react functional component>.name)).toBe(1);
|
|
11
|
-
*
|
|
12
|
-
*/
|
|
13
|
-
declare class RenderCounter {
|
|
14
|
-
private numRenders;
|
|
15
|
-
constructor();
|
|
16
|
-
reset(): void;
|
|
17
|
-
count(id: string): void;
|
|
18
|
-
get(id: string): number;
|
|
19
|
-
}
|
|
20
|
-
export declare const renderCounter: RenderCounter;
|
|
21
|
-
export {};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
|
@@ -1,28 +0,0 @@
|
|
|
1
|
-
import type { ConfigType } from '../types';
|
|
2
|
-
export interface SessionStorageProvider {
|
|
3
|
-
setConfig: (value: ConfigType) => void;
|
|
4
|
-
getConfig: () => ConfigType;
|
|
5
|
-
setOauthState: (value: string) => void;
|
|
6
|
-
getOauthState: () => string;
|
|
7
|
-
removeOauthState: () => void;
|
|
8
|
-
setOauthCodeVerifier: (value: string) => void;
|
|
9
|
-
getOauthCodeVerifier: () => string;
|
|
10
|
-
removeOauthCodeVerifier: () => void;
|
|
11
|
-
setOauthCodeChallenge: (value: string) => void;
|
|
12
|
-
getOauthCodeChallenge: () => string;
|
|
13
|
-
removeOauthCodeChallenge: () => void;
|
|
14
|
-
setHasAuthenticated: (value: string) => void;
|
|
15
|
-
getHasAuthenticated: () => string;
|
|
16
|
-
removeHasAuthenticated: () => void;
|
|
17
|
-
getCallbackUrl: () => string;
|
|
18
|
-
setCallbackUrl: (value: string) => void;
|
|
19
|
-
}
|
|
20
|
-
export declare enum SessionStorageKey {
|
|
21
|
-
CONFIG = "config",
|
|
22
|
-
OAUTH_STATE = "oauth_state",
|
|
23
|
-
OAUTH_CODE_VERIFIER = "code_verifier",
|
|
24
|
-
OAUTH_CODE_CHALLENGE = "code_challenge",
|
|
25
|
-
HAS_AUTHENTICATED = "has_authenticated",
|
|
26
|
-
CALLBACK_URL = "callback_url"
|
|
27
|
-
}
|
|
28
|
-
export declare const sessionStorageProvider: SessionStorageProvider;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|