@opengeoweb/shared 9.28.1 → 9.29.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 +512 -491
- package/package.json +2 -2
- package/src/index.d.ts +7 -7
- package/src/lib/components/AlertBanner/AlertBanner.d.ts +16 -16
- package/src/lib/components/AlertBanner/AlertBanner.spec.d.ts +1 -1
- package/src/lib/components/AlertBanner/AlertBanner.stories.d.ts +13 -13
- package/src/lib/components/AlertBanner/index.d.ts +1 -1
- package/src/lib/components/AlertIcon/AlertIcon.d.ts +8 -8
- package/src/lib/components/AlertIcon/index.d.ts +1 -1
- package/src/lib/components/AppHeader/AppHeader.d.ts +10 -10
- package/src/lib/components/AppHeader/AppHeader.spec.d.ts +1 -1
- package/src/lib/components/AppHeader/AppHeader.stories.d.ts +25 -25
- package/src/lib/components/AppHeader/index.d.ts +1 -1
- package/src/lib/components/AppLayout/AppLayout.d.ts +7 -7
- package/src/lib/components/AppLayout/AppLayout.spec.d.ts +1 -1
- package/src/lib/components/AppLayout/AppLayout.stories.d.ts +7 -7
- package/src/lib/components/AppLayout/index.d.ts +1 -1
- package/src/lib/components/Avatar/Avatar.d.ts +7 -7
- package/src/lib/components/Avatar/Avatar.stories.d.ts +25 -25
- package/src/lib/components/Avatar/index.d.ts +1 -1
- package/src/lib/components/CanvasComponent/CanvasComponent.d.ts +71 -71
- package/src/lib/components/CanvasComponent/CanvasComponent.spec.d.ts +1 -1
- package/src/lib/components/CanvasComponent/CanvasComponent.stories.d.ts +7 -7
- package/src/lib/components/CanvasComponent/index.d.ts +1 -1
- package/src/lib/components/ConfirmationDialog/ConfirmationDialog.d.ts +22 -22
- package/src/lib/components/ConfirmationDialog/ConfirmationDialog.spec.d.ts +1 -1
- package/src/lib/components/ConfirmationDialog/ConfirmationDialog.stories.d.ts +15 -15
- package/src/lib/components/ConfirmationDialog/ConfirmationService.d.ts +18 -18
- package/src/lib/components/ConfirmationDialog/ConfirmationService.spec.d.ts +1 -1
- package/src/lib/components/ConfirmationDialog/index.d.ts +2 -2
- package/src/lib/components/CustomAccordion/CustomAccordion.d.ts +13 -12
- package/src/lib/components/CustomAccordion/CustomAccordion.spec.d.ts +1 -1
- package/src/lib/components/CustomAccordion/CustomAccordion.stories.d.ts +13 -13
- package/src/lib/components/CustomAccordion/index.d.ts +1 -1
- package/src/lib/components/CustomDialog/CustomDialog.d.ts +10 -10
- package/src/lib/components/CustomDialog/CustomDialog.spec.d.ts +1 -1
- package/src/lib/components/CustomDialog/CustomDialog.stories.d.ts +13 -13
- package/src/lib/components/CustomDialog/index.d.ts +1 -1
- package/src/lib/components/CustomIconButton/CustomIconButton.d.ts +13 -13
- package/src/lib/components/CustomIconButton/CustomIconButton.spec.d.ts +1 -1
- package/src/lib/components/CustomIconButton/CustomIconButton.stories.d.ts +25 -25
- package/src/lib/components/CustomIconButton/index.d.ts +1 -1
- package/src/lib/components/CustomSlider/CustomSlider.d.ts +14 -14
- package/src/lib/components/CustomSlider/CustomSlider.spec.d.ts +1 -1
- package/src/lib/components/CustomSlider/CustomSlider.stories.d.ts +13 -13
- package/src/lib/components/CustomSlider/index.d.ts +1 -1
- package/src/lib/components/CustomToggleButton/CustomToggleButton.d.ts +8 -8
- package/src/lib/components/CustomToggleButton/CustomToggleButton.spec.d.ts +1 -1
- package/src/lib/components/CustomToggleButton/CustomToggleButton.stories.d.ts +13 -13
- package/src/lib/components/CustomToggleButton/index.d.ts +1 -1
- package/src/lib/components/CustomTooltip/CustomTooltip.d.ts +8 -8
- package/src/lib/components/CustomTooltip/CustomTooltip.spec.d.ts +1 -1
- package/src/lib/components/CustomTooltip/index.d.ts +1 -1
- package/src/lib/components/DraggableResizable/Draggable.d.ts +15 -15
- package/src/lib/components/DraggableResizable/Draggable.spec.d.ts +1 -1
- package/src/lib/components/DraggableResizable/Resizable.d.ts +10 -10
- package/src/lib/components/DraggableResizable/Resizable.spec.d.ts +1 -1
- package/src/lib/components/DraggableResizable/index.d.ts +3 -3
- package/src/lib/components/DraggableResizable/types.d.ts +27 -27
- package/src/lib/components/ErrorBoundary/ErrorBoundary.d.ts +31 -31
- package/src/lib/components/ErrorBoundary/ErrorBoundary.spec.d.ts +1 -1
- package/src/lib/components/ErrorBoundary/ErrorBoundary.stories.d.ts +10 -10
- package/src/lib/components/ErrorBoundary/index.d.ts +1 -1
- package/src/lib/components/Filter/Filter.d.ts +13 -13
- package/src/lib/components/Filter/Filter.spec.d.ts +1 -1
- package/src/lib/components/Filter/Filter.stories.d.ts +25 -25
- package/src/lib/components/Filter/FilterChip.d.ts +13 -13
- package/src/lib/components/Filter/FilterChip.spec.d.ts +1 -1
- package/src/lib/components/Filter/FilterList.d.ts +15 -15
- package/src/lib/components/Filter/FilterList.spec.d.ts +1 -1
- package/src/lib/components/Filter/FilterListItem.d.ts +17 -17
- package/src/lib/components/Filter/FilterListItem.spec.d.ts +1 -1
- package/src/lib/components/Filter/FilterListItem.stories.d.ts +7 -7
- package/src/lib/components/Filter/SearchField.d.ts +8 -8
- package/src/lib/components/Filter/SearchField.spec.d.ts +1 -1
- package/src/lib/components/Filter/index.d.ts +8 -8
- package/src/lib/components/LastUpdateTime/LastUpdateTime.d.ts +10 -10
- package/src/lib/components/LastUpdateTime/LastUpdateTime.spec.d.ts +1 -1
- package/src/lib/components/LastUpdateTime/LastUpdateTime.stories.d.ts +13 -13
- package/src/lib/components/LastUpdateTime/index.d.ts +1 -1
- package/src/lib/components/Providers/Providers.d.ts +14 -14
- package/src/lib/components/Providers/index.d.ts +1 -1
- package/src/lib/components/SearchField/SearchField.d.ts +9 -9
- package/src/lib/components/SearchField/SearchField.spec.d.ts +1 -1
- package/src/lib/components/SearchField/SearchFieldButtonContainer.d.ts +9 -9
- package/src/lib/components/SearchField/SearchFieldButtonContainer.spec.d.ts +1 -1
- package/src/lib/components/SearchField/index.d.ts +2 -2
- package/src/lib/components/SearchHighlight/SearchHighlight.d.ts +7 -7
- package/src/lib/components/SearchHighlight/SearchHighlight.spec.d.ts +1 -1
- package/src/lib/components/SearchHighlight/SearchHighlight.stories.d.ts +13 -13
- package/src/lib/components/SearchHighlight/index.d.ts +1 -1
- package/src/lib/components/StatusTag/StatusTag.d.ts +9 -9
- package/src/lib/components/StatusTag/StatusTag.spec.d.ts +1 -1
- package/src/lib/components/StatusTag/StatusTag.stories.d.ts +25 -25
- package/src/lib/components/StatusTag/index.d.ts +1 -1
- package/src/lib/components/SwitchButton/SwitchButton.d.ts +8 -8
- package/src/lib/components/SwitchButton/SwitchButton.spec.d.ts +1 -1
- package/src/lib/components/SwitchButton/index.d.ts +1 -1
- package/src/lib/components/ToggleMenu/ToggleMenu.d.ts +30 -30
- package/src/lib/components/ToggleMenu/ToggleMenu.spec.d.ts +1 -1
- package/src/lib/components/ToggleMenu/ToggleMenu.stories.d.ts +13 -13
- package/src/lib/components/ToggleMenu/index.d.ts +1 -1
- package/src/lib/components/ToolContainer/ToolContainer.d.ts +5 -5
- package/src/lib/components/ToolContainer/ToolContainer.spec.d.ts +1 -1
- package/src/lib/components/ToolContainer/ToolContainer.stories.d.ts +28 -28
- package/src/lib/components/ToolContainer/ToolContainerDraggable.d.ts +37 -37
- package/src/lib/components/ToolContainer/ToolContainerDraggable.spec.d.ts +1 -1
- package/src/lib/components/ToolContainer/ToolContainerDraggable.stories.d.ts +7 -7
- package/src/lib/components/ToolContainer/ToolContainerSnapShots.stories.d.ts +13 -13
- package/src/lib/components/ToolContainer/ToolFooter.d.ts +3 -3
- package/src/lib/components/ToolContainer/ToolFooter.spec.d.ts +1 -1
- package/src/lib/components/ToolContainer/ToolHeader.d.ts +4 -4
- package/src/lib/components/ToolContainer/ToolHeader.spec.d.ts +1 -1
- package/src/lib/components/ToolContainer/ToolHeader.stories.d.ts +23 -23
- package/src/lib/components/ToolContainer/index.d.ts +7 -7
- package/src/lib/components/ToolContainer/types.d.ts +20 -20
- package/src/lib/components/ToolContainer/useHandleSizeFromOutsideComponent.d.ts +15 -15
- package/src/lib/components/ToolContainer/useHandleSizeFromOutsideComponent.spec.d.ts +1 -1
- package/src/lib/components/TooltipSelect/TooltipSelect.d.ts +20 -20
- package/src/lib/components/TooltipSelect/TooltipSelect.spec.d.ts +1 -1
- package/src/lib/components/TooltipSelect/TooltipSelect.stories.d.ts +13 -13
- package/src/lib/components/TooltipSelect/index.d.ts +1 -1
- package/src/lib/components/UserMenu/CheatSheet/CheatSheet.d.ts +3 -3
- package/src/lib/components/UserMenu/CheatSheet/CheatSheet.spec.d.ts +1 -1
- package/src/lib/components/UserMenu/CheatSheet/CheatSheet.stories.d.ts +31 -31
- package/src/lib/components/UserMenu/CheatSheet/ShortcutList.d.ts +6 -6
- package/src/lib/components/UserMenu/CheatSheet/ShortcutList.spec.d.ts +1 -1
- package/src/lib/components/UserMenu/CheatSheet/ShortcutSegment.d.ts +7 -7
- package/src/lib/components/UserMenu/CheatSheet/ShortcutSegment.spec.d.ts +1 -1
- package/src/lib/components/UserMenu/UserMenu.d.ts +11 -11
- package/src/lib/components/UserMenu/UserMenu.spec.d.ts +1 -1
- package/src/lib/components/UserMenu/UserMenu.stories.d.ts +15 -15
- package/src/lib/components/UserMenu/UserMenuItemCheatSheet.d.ts +3 -3
- package/src/lib/components/UserMenu/UserMenuItemCheatSheet.spec.d.ts +1 -1
- package/src/lib/components/UserMenu/UserMenuItemTheme.d.ts +3 -3
- package/src/lib/components/UserMenu/UserMenuItemTheme.spec.d.ts +1 -1
- package/src/lib/components/UserMenu/UserMenuSentryRecording.d.ts +7 -7
- package/src/lib/components/UserMenu/index.d.ts +6 -6
- package/src/lib/components/UserMenu/useUserMenu.d.ts +7 -7
- package/src/lib/components/UserMenu/useUserMenu.spec.d.ts +1 -1
- package/src/lib/components/UserMenu/utils.d.ts +1 -1
- package/src/lib/components/WithEggs/WithEggs.d.ts +7 -7
- package/src/lib/components/WithEggs/WithEggs.spec.d.ts +1 -1
- package/src/lib/components/WithEggs/index.d.ts +1 -1
- package/src/lib/components/components.stories.d.ts +5 -5
- package/src/lib/components/index.d.ts +26 -26
- package/src/lib/hooks/index.d.ts +6 -6
- package/src/lib/hooks/useDebounce/useDebounce.d.ts +1 -1
- package/src/lib/hooks/useDebounce/useDebounce.spec.d.ts +1 -1
- package/src/lib/hooks/useIsMounted/useIsMounted.d.ts +4 -4
- package/src/lib/hooks/useIsMounted/useIsMounted.spec.d.ts +1 -1
- package/src/lib/hooks/useMakeSureContainerStaysInsideWindow/useMakeSureContainerStaysInsideWindow.d.ts +4 -4
- package/src/lib/hooks/useMakeSureContainerStaysInsideWindow/useMakeSureContainerStaysInsideWindow.spec.d.ts +1 -1
- package/src/lib/hooks/usePoller/usePoller.d.ts +3 -3
- package/src/lib/hooks/usePoller/usePoller.spec.d.ts +1 -1
- package/src/lib/hooks/usePoller/usePoller.stories.d.ts +6 -6
- package/src/lib/hooks/usePreventBrowserClose/usePreventBrowserClose.d.ts +2 -2
- package/src/lib/hooks/usePreventBrowserClose/usePreventBrowserClose.spec.d.ts +1 -1
- package/src/lib/hooks/usePreventBrowserClose/usePreventBrowserClose.stories.d.ts +6 -6
- package/src/lib/hooks/usePrevious/usePrevious.d.ts +1 -1
- package/src/lib/hooks/usePrevious/usePrevious.spec.d.ts +1 -1
- package/src/lib/hooks/usePrevious/usePrevious.stories.d.ts +6 -6
- package/src/lib/types/index.d.ts +1 -1
- package/src/lib/types/types.d.ts +107 -108
- package/src/lib/utils/axiosErrorUtils/axiosErrorUtils.d.ts +8 -8
- package/src/lib/utils/axiosErrorUtils/axiosErrorUtils.spec.d.ts +1 -1
- package/src/lib/utils/axiosErrorUtils/index.d.ts +1 -1
- package/src/lib/utils/dateUtils/dateFormats.d.ts +7 -7
- package/src/lib/utils/dateUtils/dateUtils.d.ts +343 -343
- package/src/lib/utils/dateUtils/dateUtils.spec.d.ts +1 -1
- package/src/lib/utils/dateUtils/index.d.ts +2 -2
- package/src/lib/utils/i18n.d.ts +7 -7
- package/src/lib/utils/index.d.ts +5 -5
- package/src/lib/utils/mapProjections.d.ts +75 -75
- package/src/lib/utils/reduxTestUtils/createMockStoreWithEggs.d.ts +20 -20
- package/src/lib/utils/reduxTestUtils/createMockStoreWithEggs.spec.d.ts +1 -1
- package/src/lib/utils/reduxTestUtils/index.d.ts +1 -1
- package/src/lib/utils/renderCounter.d.ts +21 -21
- package/src/lib/utils/renderCounter.spec.d.ts +1 -1
package/index.esm.js
CHANGED
|
@@ -3472,22 +3472,22 @@ $$a({ target: 'Promise', stat: true, forced: FORCED_PROMISE_CONSTRUCTOR }, {
|
|
|
3472
3472
|
}
|
|
3473
3473
|
});
|
|
3474
3474
|
|
|
3475
|
-
/* *
|
|
3476
|
-
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
3477
|
-
* you may not use this file except in compliance with the License.
|
|
3478
|
-
* You may obtain a copy of the License at
|
|
3479
|
-
*
|
|
3480
|
-
* http://www.apache.org/licenses/LICENSE-2.0
|
|
3481
|
-
*
|
|
3482
|
-
* Unless required by applicable law or agreed to in writing, software
|
|
3483
|
-
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
3484
|
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
3485
|
-
* See the License for the specific language governing permissions and
|
|
3486
|
-
* limitations under the License.
|
|
3487
|
-
*
|
|
3488
|
-
* Copyright 2021 - Koninklijk Nederlands Meteorologisch Instituut (KNMI)
|
|
3489
|
-
* Copyright 2021 - Finnish Meteorological Institute (FMI)
|
|
3490
|
-
* Copyright 2024 - The Norwegian Meteorological Institute (MET Norway)
|
|
3475
|
+
/* *
|
|
3476
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
3477
|
+
* you may not use this file except in compliance with the License.
|
|
3478
|
+
* You may obtain a copy of the License at
|
|
3479
|
+
*
|
|
3480
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
3481
|
+
*
|
|
3482
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
3483
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
3484
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
3485
|
+
* See the License for the specific language governing permissions and
|
|
3486
|
+
* limitations under the License.
|
|
3487
|
+
*
|
|
3488
|
+
* Copyright 2021 - Koninklijk Nederlands Meteorologisch Instituut (KNMI)
|
|
3489
|
+
* Copyright 2021 - Finnish Meteorological Institute (FMI)
|
|
3490
|
+
* Copyright 2024 - The Norwegian Meteorological Institute (MET Norway)
|
|
3491
3491
|
* */
|
|
3492
3492
|
const showPrompt = event => {
|
|
3493
3493
|
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
|
|
@@ -3508,22 +3508,22 @@ function usePreventBrowserClose(shouldPreventClose) {
|
|
|
3508
3508
|
}, [shouldPreventClose]);
|
|
3509
3509
|
}
|
|
3510
3510
|
|
|
3511
|
-
/* *
|
|
3512
|
-
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
3513
|
-
* you may not use this file except in compliance with the License.
|
|
3514
|
-
* You may obtain a copy of the License at
|
|
3515
|
-
*
|
|
3516
|
-
* http://www.apache.org/licenses/LICENSE-2.0
|
|
3517
|
-
*
|
|
3518
|
-
* Unless required by applicable law or agreed to in writing, software
|
|
3519
|
-
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
3520
|
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
3521
|
-
* See the License for the specific language governing permissions and
|
|
3522
|
-
* limitations under the License.
|
|
3523
|
-
*
|
|
3524
|
-
* Copyright 2023 - Koninklijk Nederlands Meteorologisch Instituut (KNMI)
|
|
3525
|
-
* Copyright 2023 - Finnish Meteorological Institute (FMI)
|
|
3526
|
-
* Copyright 2024 - The Norwegian Meteorological Institute (MET Norway)
|
|
3511
|
+
/* *
|
|
3512
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
3513
|
+
* you may not use this file except in compliance with the License.
|
|
3514
|
+
* You may obtain a copy of the License at
|
|
3515
|
+
*
|
|
3516
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
3517
|
+
*
|
|
3518
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
3519
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
3520
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
3521
|
+
* See the License for the specific language governing permissions and
|
|
3522
|
+
* limitations under the License.
|
|
3523
|
+
*
|
|
3524
|
+
* Copyright 2023 - Koninklijk Nederlands Meteorologisch Instituut (KNMI)
|
|
3525
|
+
* Copyright 2023 - Finnish Meteorological Institute (FMI)
|
|
3526
|
+
* Copyright 2024 - The Norwegian Meteorological Institute (MET Norway)
|
|
3527
3527
|
* */
|
|
3528
3528
|
const pollingIntervalTimeout = 300000;
|
|
3529
3529
|
const usePoller = (deps, callback, pollingInterval = pollingIntervalTimeout) => {
|
|
@@ -3547,22 +3547,22 @@ const usePoller = (deps, callback, pollingInterval = pollingIntervalTimeout) =>
|
|
|
3547
3547
|
return interval;
|
|
3548
3548
|
};
|
|
3549
3549
|
|
|
3550
|
-
/* *
|
|
3551
|
-
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
3552
|
-
* you may not use this file except in compliance with the License.
|
|
3553
|
-
* You may obtain a copy of the License at
|
|
3554
|
-
*
|
|
3555
|
-
* http://www.apache.org/licenses/LICENSE-2.0
|
|
3556
|
-
*
|
|
3557
|
-
* Unless required by applicable law or agreed to in writing, software
|
|
3558
|
-
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
3559
|
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
3560
|
-
* See the License for the specific language governing permissions and
|
|
3561
|
-
* limitations under the License.
|
|
3562
|
-
*
|
|
3563
|
-
* Copyright 2021 - Koninklijk Nederlands Meteorologisch Instituut (KNMI)
|
|
3564
|
-
* Copyright 2021 - Finnish Meteorological Institute (FMI)
|
|
3565
|
-
* Copyright 2024 - The Norwegian Meteorological Institute (MET Norway)
|
|
3550
|
+
/* *
|
|
3551
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
3552
|
+
* you may not use this file except in compliance with the License.
|
|
3553
|
+
* You may obtain a copy of the License at
|
|
3554
|
+
*
|
|
3555
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
3556
|
+
*
|
|
3557
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
3558
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
3559
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
3560
|
+
* See the License for the specific language governing permissions and
|
|
3561
|
+
* limitations under the License.
|
|
3562
|
+
*
|
|
3563
|
+
* Copyright 2021 - Koninklijk Nederlands Meteorologisch Instituut (KNMI)
|
|
3564
|
+
* Copyright 2021 - Finnish Meteorological Institute (FMI)
|
|
3565
|
+
* Copyright 2024 - The Norwegian Meteorological Institute (MET Norway)
|
|
3566
3566
|
* */
|
|
3567
3567
|
function usePrevious(value) {
|
|
3568
3568
|
const ref = React.useRef();
|
|
@@ -3572,22 +3572,22 @@ function usePrevious(value) {
|
|
|
3572
3572
|
return ref.current;
|
|
3573
3573
|
}
|
|
3574
3574
|
|
|
3575
|
-
/* *
|
|
3576
|
-
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
3577
|
-
* you may not use this file except in compliance with the License.
|
|
3578
|
-
* You may obtain a copy of the License at
|
|
3579
|
-
*
|
|
3580
|
-
* http://www.apache.org/licenses/LICENSE-2.0
|
|
3581
|
-
*
|
|
3582
|
-
* Unless required by applicable law or agreed to in writing, software
|
|
3583
|
-
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
3584
|
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
3585
|
-
* See the License for the specific language governing permissions and
|
|
3586
|
-
* limitations under the License.
|
|
3587
|
-
*
|
|
3588
|
-
* Copyright 2021 - Koninklijk Nederlands Meteorologisch Instituut (KNMI)
|
|
3589
|
-
* Copyright 2021 - Finnish Meteorological Institute (FMI)
|
|
3590
|
-
* Copyright 2024 - The Norwegian Meteorological Institute (MET Norway)
|
|
3575
|
+
/* *
|
|
3576
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
3577
|
+
* you may not use this file except in compliance with the License.
|
|
3578
|
+
* You may obtain a copy of the License at
|
|
3579
|
+
*
|
|
3580
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
3581
|
+
*
|
|
3582
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
3583
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
3584
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
3585
|
+
* See the License for the specific language governing permissions and
|
|
3586
|
+
* limitations under the License.
|
|
3587
|
+
*
|
|
3588
|
+
* Copyright 2021 - Koninklijk Nederlands Meteorologisch Instituut (KNMI)
|
|
3589
|
+
* Copyright 2021 - Finnish Meteorological Institute (FMI)
|
|
3590
|
+
* Copyright 2024 - The Norwegian Meteorological Institute (MET Norway)
|
|
3591
3591
|
* */
|
|
3592
3592
|
const useIsMounted = () => {
|
|
3593
3593
|
const isMounted = React.useRef(false);
|
|
@@ -3667,15 +3667,15 @@ const useMakeSureContainerStaysInsideWindow = (nodeRef, position, setPosition) =
|
|
|
3667
3667
|
}, [onResizeWindow]);
|
|
3668
3668
|
};
|
|
3669
3669
|
|
|
3670
|
-
/*
|
|
3671
|
-
Accepts a value and timeout and will debounce
|
|
3670
|
+
/*
|
|
3671
|
+
Accepts a value and timeout and will debounce
|
|
3672
3672
|
|
|
3673
|
-
@param {string} value: value of element
|
|
3674
|
-
@param {timeout} number: timer
|
|
3675
|
-
@return {value: string}
|
|
3673
|
+
@param {string} value: value of element
|
|
3674
|
+
@param {timeout} number: timer
|
|
3675
|
+
@return {value: string}
|
|
3676
3676
|
|
|
3677
|
-
@example:
|
|
3678
|
-
const debouncedName = useDebounce('testing', 2000)
|
|
3677
|
+
@example:
|
|
3678
|
+
const debouncedName = useDebounce('testing', 2000)
|
|
3679
3679
|
*/
|
|
3680
3680
|
const useDebounce = (value, timeout) => {
|
|
3681
3681
|
const [state, setState] = React.useState(value);
|
|
@@ -4615,12 +4615,12 @@ if (NOT_GENERIC || INCORRECT_NAME) {
|
|
|
4615
4615
|
}
|
|
4616
4616
|
|
|
4617
4617
|
// TODO: (Sander de Snaijer 2020-07-13) this error wrappper should get more (non-breaking?) logic when we have decided how to handle errors.
|
|
4618
|
-
/**
|
|
4619
|
-
* ErrorBoundary
|
|
4620
|
-
* Wrap this component around parts of your application. It will catch any uncaught errors and display an alert, and allows you to continue using the rest of your application.
|
|
4621
|
-
*
|
|
4622
|
-
* @example
|
|
4623
|
-
* ``` <ErrorBoundary><ExampleComponent /></ErrorBoundary> ```
|
|
4618
|
+
/**
|
|
4619
|
+
* ErrorBoundary
|
|
4620
|
+
* Wrap this component around parts of your application. It will catch any uncaught errors and display an alert, and allows you to continue using the rest of your application.
|
|
4621
|
+
*
|
|
4622
|
+
* @example
|
|
4623
|
+
* ``` <ErrorBoundary><ExampleComponent /></ErrorBoundary> ```
|
|
4624
4624
|
*/
|
|
4625
4625
|
class ErrorBoundary extends React.Component {
|
|
4626
4626
|
constructor(props) {
|
|
@@ -6250,22 +6250,22 @@ const useUserMenu = (open = false) => {
|
|
|
6250
6250
|
};
|
|
6251
6251
|
};
|
|
6252
6252
|
|
|
6253
|
-
/* *
|
|
6254
|
-
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
6255
|
-
* you may not use this file except in compliance with the License.
|
|
6256
|
-
* You may obtain a copy of the License at
|
|
6257
|
-
*
|
|
6258
|
-
* http://www.apache.org/licenses/LICENSE-2.0
|
|
6259
|
-
*
|
|
6260
|
-
* Unless required by applicable law or agreed to in writing, software
|
|
6261
|
-
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
6262
|
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
6263
|
-
* See the License for the specific language governing permissions and
|
|
6264
|
-
* limitations under the License.
|
|
6265
|
-
*
|
|
6266
|
-
* Copyright 2021 - Koninklijk Nederlands Meteorologisch Instituut (KNMI)
|
|
6267
|
-
* Copyright 2021 - Finnish Meteorological Institute (FMI)
|
|
6268
|
-
* Copyright 2024 - The Norwegian Meteorological Institute (MET Norway)
|
|
6253
|
+
/* *
|
|
6254
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
6255
|
+
* you may not use this file except in compliance with the License.
|
|
6256
|
+
* You may obtain a copy of the License at
|
|
6257
|
+
*
|
|
6258
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
6259
|
+
*
|
|
6260
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
6261
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
6262
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
6263
|
+
* See the License for the specific language governing permissions and
|
|
6264
|
+
* limitations under the License.
|
|
6265
|
+
*
|
|
6266
|
+
* Copyright 2021 - Koninklijk Nederlands Meteorologisch Instituut (KNMI)
|
|
6267
|
+
* Copyright 2021 - Finnish Meteorological Institute (FMI)
|
|
6268
|
+
* Copyright 2024 - The Norwegian Meteorological Institute (MET Norway)
|
|
6269
6269
|
* */
|
|
6270
6270
|
const getInitials = name => {
|
|
6271
6271
|
if (!name) {
|
|
@@ -6798,6 +6798,7 @@ function withEggs(eggs) {
|
|
|
6798
6798
|
const CustomAccordion = _a => {
|
|
6799
6799
|
var {
|
|
6800
6800
|
title,
|
|
6801
|
+
title2,
|
|
6801
6802
|
defaultExpanded = true,
|
|
6802
6803
|
disableGutters = true,
|
|
6803
6804
|
expandedElevation = 3,
|
|
@@ -6808,7 +6809,7 @@ const CustomAccordion = _a => {
|
|
|
6808
6809
|
children,
|
|
6809
6810
|
amountOfItems
|
|
6810
6811
|
} = _a,
|
|
6811
|
-
props = __rest(_a, ["title", "defaultExpanded", "disableGutters", "expandedElevation", "collapsedElevation", "transitionDuration", "detailsSx", "CustomExpandIcon", "children", "amountOfItems"]);
|
|
6812
|
+
props = __rest(_a, ["title", "title2", "defaultExpanded", "disableGutters", "expandedElevation", "collapsedElevation", "transitionDuration", "detailsSx", "CustomExpandIcon", "children", "amountOfItems"]);
|
|
6812
6813
|
const [expanded, setExpanded] = React.useState(defaultExpanded);
|
|
6813
6814
|
const theme = useTheme();
|
|
6814
6815
|
const iconColor = theme.palette.geowebColors.buttons.icon.default.color;
|
|
@@ -6839,22 +6840,38 @@ const CustomAccordion = _a => {
|
|
|
6839
6840
|
width: '100%'
|
|
6840
6841
|
}
|
|
6841
6842
|
}, {
|
|
6842
|
-
children: [
|
|
6843
|
+
children: [jsxs(Box, Object.assign({
|
|
6843
6844
|
sx: {
|
|
6845
|
+
width: '100%',
|
|
6844
6846
|
display: 'flex',
|
|
6845
|
-
justifyContent: '
|
|
6847
|
+
justifyContent: 'space-between'
|
|
6846
6848
|
}
|
|
6847
6849
|
}, {
|
|
6848
|
-
children:
|
|
6849
|
-
|
|
6850
|
+
children: [jsx(Box, Object.assign({
|
|
6851
|
+
sx: {
|
|
6852
|
+
display: 'flex',
|
|
6853
|
+
justifyContent: 'flex-start'
|
|
6854
|
+
}
|
|
6855
|
+
}, {
|
|
6856
|
+
children: title
|
|
6857
|
+
})), jsx(Box, Object.assign({
|
|
6858
|
+
sx: {
|
|
6859
|
+
display: 'flex',
|
|
6860
|
+
justifyContent: 'flex-end',
|
|
6861
|
+
paddingRight: '25px'
|
|
6862
|
+
}
|
|
6863
|
+
}, {
|
|
6864
|
+
children: title2
|
|
6865
|
+
}))]
|
|
6866
|
+
})), jsx(Box, Object.assign({
|
|
6850
6867
|
sx: {
|
|
6851
6868
|
display: 'flex',
|
|
6852
6869
|
justifyContent: 'flex-end',
|
|
6853
|
-
marginRight: '
|
|
6870
|
+
marginRight: '10px'
|
|
6854
6871
|
}
|
|
6855
6872
|
}, {
|
|
6856
6873
|
children: amountOfItems
|
|
6857
|
-
}))
|
|
6874
|
+
}))]
|
|
6858
6875
|
}))
|
|
6859
6876
|
})), jsx(AccordionDetails, Object.assign({
|
|
6860
6877
|
sx: detailsSx
|
|
@@ -7938,23 +7955,25 @@ const SearchField$1 = ({
|
|
|
7938
7955
|
},
|
|
7939
7956
|
autoFocus: true,
|
|
7940
7957
|
fullWidth: true,
|
|
7941
|
-
|
|
7942
|
-
|
|
7943
|
-
|
|
7944
|
-
|
|
7945
|
-
|
|
7946
|
-
|
|
7947
|
-
|
|
7948
|
-
|
|
7949
|
-
|
|
7950
|
-
|
|
7951
|
-
|
|
7952
|
-
|
|
7953
|
-
|
|
7954
|
-
|
|
7955
|
-
|
|
7956
|
-
|
|
7957
|
-
|
|
7958
|
+
slotProps: {
|
|
7959
|
+
input: {
|
|
7960
|
+
endAdornment: jsx(InputAdornment, Object.assign({
|
|
7961
|
+
position: "end"
|
|
7962
|
+
}, {
|
|
7963
|
+
children: jsx(SearchFieldButton, {
|
|
7964
|
+
setPopupIsOpen: () => {
|
|
7965
|
+
onOpenServicePopup(localSearchString);
|
|
7966
|
+
setLocalSearchString('');
|
|
7967
|
+
},
|
|
7968
|
+
localSearchString: localSearchString,
|
|
7969
|
+
onClickClear: () => {
|
|
7970
|
+
setLocalSearchString('');
|
|
7971
|
+
setSearchFilterDebounced('');
|
|
7972
|
+
setUrlIsValid(false);
|
|
7973
|
+
}
|
|
7974
|
+
})
|
|
7975
|
+
}))
|
|
7976
|
+
}
|
|
7958
7977
|
}
|
|
7959
7978
|
});
|
|
7960
7979
|
};
|
|
@@ -8478,19 +8497,21 @@ const SearchField = ({
|
|
|
8478
8497
|
handleValueChangeDebounced(e.target.value);
|
|
8479
8498
|
setLocalValue(e.target.value);
|
|
8480
8499
|
},
|
|
8481
|
-
|
|
8482
|
-
|
|
8483
|
-
|
|
8484
|
-
|
|
8485
|
-
|
|
8486
|
-
|
|
8487
|
-
|
|
8488
|
-
|
|
8489
|
-
|
|
8490
|
-
|
|
8491
|
-
|
|
8492
|
-
|
|
8493
|
-
|
|
8500
|
+
slotProps: {
|
|
8501
|
+
input: {
|
|
8502
|
+
endAdornment: jsx(InputAdornment, Object.assign({
|
|
8503
|
+
position: "end"
|
|
8504
|
+
}, {
|
|
8505
|
+
children: localValue ? jsx(ClearButton, {
|
|
8506
|
+
onClick: () => {
|
|
8507
|
+
setLocalValue('');
|
|
8508
|
+
valueChanged('');
|
|
8509
|
+
}
|
|
8510
|
+
}) : jsx(SearchButton, {
|
|
8511
|
+
label: label
|
|
8512
|
+
})
|
|
8513
|
+
}))
|
|
8514
|
+
}
|
|
8494
8515
|
}
|
|
8495
8516
|
});
|
|
8496
8517
|
};
|
|
@@ -8649,22 +8670,22 @@ const FilterListItem = ({
|
|
|
8649
8670
|
return null;
|
|
8650
8671
|
};
|
|
8651
8672
|
|
|
8652
|
-
/* *
|
|
8653
|
-
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
8654
|
-
* you may not use this file except in compliance with the License.
|
|
8655
|
-
* You may obtain a copy of the License at
|
|
8656
|
-
*
|
|
8657
|
-
* http://www.apache.org/licenses/LICENSE-2.0
|
|
8658
|
-
*
|
|
8659
|
-
* Unless required by applicable law or agreed to in writing, software
|
|
8660
|
-
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
8661
|
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
8662
|
-
* See the License for the specific language governing permissions and
|
|
8663
|
-
* limitations under the License.
|
|
8664
|
-
*
|
|
8665
|
-
* Copyright 2021 - Koninklijk Nederlands Meteorologisch Instituut (KNMI)
|
|
8666
|
-
* Copyright 2021 - Finnish Meteorological Institute (FMI)
|
|
8667
|
-
* Copyright 2024 - The Norwegian Meteorological Institute (MET Norway)
|
|
8673
|
+
/* *
|
|
8674
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
8675
|
+
* you may not use this file except in compliance with the License.
|
|
8676
|
+
* You may obtain a copy of the License at
|
|
8677
|
+
*
|
|
8678
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
8679
|
+
*
|
|
8680
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
8681
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
8682
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
8683
|
+
* See the License for the specific language governing permissions and
|
|
8684
|
+
* limitations under the License.
|
|
8685
|
+
*
|
|
8686
|
+
* Copyright 2021 - Koninklijk Nederlands Meteorologisch Instituut (KNMI)
|
|
8687
|
+
* Copyright 2021 - Finnish Meteorological Institute (FMI)
|
|
8688
|
+
* Copyright 2024 - The Norwegian Meteorological Institute (MET Norway)
|
|
8668
8689
|
* */
|
|
8669
8690
|
const DEFAULT_ERROR_MESSAGE = 'An error has occurred';
|
|
8670
8691
|
// Guard function for detecting an AxiosError (typically the kind of error returned by the backend)
|
|
@@ -8759,22 +8780,22 @@ fixRegExpWellKnownSymbolLogic('match', function (MATCH, nativeMatch, maybeCallNa
|
|
|
8759
8780
|
];
|
|
8760
8781
|
});
|
|
8761
8782
|
|
|
8762
|
-
/* *
|
|
8763
|
-
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
8764
|
-
* you may not use this file except in compliance with the License.
|
|
8765
|
-
* You may obtain a copy of the License at
|
|
8766
|
-
*
|
|
8767
|
-
* http://www.apache.org/licenses/LICENSE-2.0
|
|
8768
|
-
*
|
|
8769
|
-
* Unless required by applicable law or agreed to in writing, software
|
|
8770
|
-
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
8771
|
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
8772
|
-
* See the License for the specific language governing permissions and
|
|
8773
|
-
* limitations under the License.
|
|
8774
|
-
*
|
|
8775
|
-
* Copyright 2024 - Koninklijk Nederlands Meteorologisch Instituut (KNMI)
|
|
8776
|
-
* Copyright 2024 - Finnish Meteorological Institute (FMI)
|
|
8777
|
-
* Copyright 2024 - The Norwegian Meteorological Institute (MET Norway)
|
|
8783
|
+
/* *
|
|
8784
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
8785
|
+
* you may not use this file except in compliance with the License.
|
|
8786
|
+
* You may obtain a copy of the License at
|
|
8787
|
+
*
|
|
8788
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
8789
|
+
*
|
|
8790
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
8791
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
8792
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
8793
|
+
* See the License for the specific language governing permissions and
|
|
8794
|
+
* limitations under the License.
|
|
8795
|
+
*
|
|
8796
|
+
* Copyright 2024 - Koninklijk Nederlands Meteorologisch Instituut (KNMI)
|
|
8797
|
+
* Copyright 2024 - Finnish Meteorological Institute (FMI)
|
|
8798
|
+
* Copyright 2024 - The Norwegian Meteorological Institute (MET Norway)
|
|
8778
8799
|
* */
|
|
8779
8800
|
const DATE_FORMAT_DATEPICKER = 'dd/MM/yyyy HH:mm';
|
|
8780
8801
|
const DATE_FORMAT_UTC = "yyyy-MM-dd'T'HH:mm:ss'Z'";
|
|
@@ -8784,58 +8805,58 @@ const DATE_FORMAT_NAME_OF_DAY_MONTH = 'eee dd MMM HH:mm';
|
|
|
8784
8805
|
const DATE_FORMAT_NAME_OF_MONTH = 'dd MMM yyyy, HH:mm';
|
|
8785
8806
|
const DATE_FORMAT_NAME_OF_DAY = 'eee dd/MM/yyyy HH:mm';
|
|
8786
8807
|
|
|
8787
|
-
/**
|
|
8788
|
-
* Parsing date strings with geoweb dateUtils:
|
|
8789
|
-
*
|
|
8790
|
-
* An ISO String *with timezone* can safely be parsed directly to a date:
|
|
8791
|
-
*
|
|
8792
|
-
* date = new Date('2022-10-10T15:30:00Z')
|
|
8793
|
-
* date = new Date('2022-10-10T15:30:00+00:00')
|
|
8794
|
-
* date = new Date('2022-10-10T15:30:00+02:00')
|
|
8795
|
-
*
|
|
8796
|
-
* or using the dateUtils isoStringToDate function *with utc=false*
|
|
8797
|
-
*
|
|
8798
|
-
* date = isoStringToDate('2022-10-10T15:30:00Z', false)
|
|
8799
|
-
*
|
|
8800
|
-
* An ISO String *without a timezone* can be parsed with isoStringToDate
|
|
8801
|
-
*
|
|
8802
|
-
* date = isoStringToDate('2022-10-10T15:30:00')
|
|
8803
|
-
*
|
|
8804
|
-
* *Do not parse ISO without timezone using `new Date()` unless you correct for the local timezone*
|
|
8805
|
-
*
|
|
8806
|
-
* To parse an arbitrary date string with timezone use:
|
|
8807
|
-
*
|
|
8808
|
-
* date = stringToDate('2022.11.10, 11:15 +01:00', 'yyyy.MM.dd, HH:mm xxx', false)
|
|
8809
|
-
*
|
|
8810
|
-
* To parse an arbitrary date string without timezone use:
|
|
8811
|
-
*
|
|
8812
|
-
* date = stringToDate('2022.11.10, 11:15', 'yyyy.MM.dd, HH:mm')
|
|
8813
|
-
*
|
|
8814
|
-
*
|
|
8815
|
-
* To safely convert dates to utc strings use:
|
|
8816
|
-
*
|
|
8817
|
-
* date.toISOString()
|
|
8818
|
-
*
|
|
8819
|
-
* To get parts of UTC time use
|
|
8820
|
-
*
|
|
8821
|
-
* date.getUTCHours()
|
|
8822
|
-
* date.getUTCMins()
|
|
8823
|
-
*
|
|
8824
|
-
* To parse an arbitrary date string to a UTC string use:
|
|
8825
|
-
*
|
|
8826
|
-
* dateToString(new Date('2022-10-10T15:30:00Z'), 'HH:ss dd MMM yyyy')
|
|
8827
|
-
*
|
|
8808
|
+
/**
|
|
8809
|
+
* Parsing date strings with geoweb dateUtils:
|
|
8810
|
+
*
|
|
8811
|
+
* An ISO String *with timezone* can safely be parsed directly to a date:
|
|
8812
|
+
*
|
|
8813
|
+
* date = new Date('2022-10-10T15:30:00Z')
|
|
8814
|
+
* date = new Date('2022-10-10T15:30:00+00:00')
|
|
8815
|
+
* date = new Date('2022-10-10T15:30:00+02:00')
|
|
8816
|
+
*
|
|
8817
|
+
* or using the dateUtils isoStringToDate function *with utc=false*
|
|
8818
|
+
*
|
|
8819
|
+
* date = isoStringToDate('2022-10-10T15:30:00Z', false)
|
|
8820
|
+
*
|
|
8821
|
+
* An ISO String *without a timezone* can be parsed with isoStringToDate
|
|
8822
|
+
*
|
|
8823
|
+
* date = isoStringToDate('2022-10-10T15:30:00')
|
|
8824
|
+
*
|
|
8825
|
+
* *Do not parse ISO without timezone using `new Date()` unless you correct for the local timezone*
|
|
8826
|
+
*
|
|
8827
|
+
* To parse an arbitrary date string with timezone use:
|
|
8828
|
+
*
|
|
8829
|
+
* date = stringToDate('2022.11.10, 11:15 +01:00', 'yyyy.MM.dd, HH:mm xxx', false)
|
|
8830
|
+
*
|
|
8831
|
+
* To parse an arbitrary date string without timezone use:
|
|
8832
|
+
*
|
|
8833
|
+
* date = stringToDate('2022.11.10, 11:15', 'yyyy.MM.dd, HH:mm')
|
|
8834
|
+
*
|
|
8835
|
+
*
|
|
8836
|
+
* To safely convert dates to utc strings use:
|
|
8837
|
+
*
|
|
8838
|
+
* date.toISOString()
|
|
8839
|
+
*
|
|
8840
|
+
* To get parts of UTC time use
|
|
8841
|
+
*
|
|
8842
|
+
* date.getUTCHours()
|
|
8843
|
+
* date.getUTCMins()
|
|
8844
|
+
*
|
|
8845
|
+
* To parse an arbitrary date string to a UTC string use:
|
|
8846
|
+
*
|
|
8847
|
+
* dateToString(new Date('2022-10-10T15:30:00Z'), 'HH:ss dd MMM yyyy')
|
|
8848
|
+
*
|
|
8828
8849
|
*/
|
|
8829
|
-
/**
|
|
8830
|
-
* Parse an ISO string to a date
|
|
8831
|
-
*
|
|
8832
|
-
* Expects the following props:
|
|
8833
|
-
* @param {string} input - string containing date
|
|
8834
|
-
*
|
|
8835
|
-
* @returns {Date} Date
|
|
8836
|
-
* @example
|
|
8837
|
-
* ``` isoStringToDate("2022-5-10T20:32:00+00:00") ```
|
|
8838
|
-
* ``` isoStringToDate("2022-5-10T20:32:00:00Z", false) ```
|
|
8850
|
+
/**
|
|
8851
|
+
* Parse an ISO string to a date
|
|
8852
|
+
*
|
|
8853
|
+
* Expects the following props:
|
|
8854
|
+
* @param {string} input - string containing date
|
|
8855
|
+
*
|
|
8856
|
+
* @returns {Date} Date
|
|
8857
|
+
* @example
|
|
8858
|
+
* ``` isoStringToDate("2022-5-10T20:32:00+00:00") ```
|
|
8859
|
+
* ``` isoStringToDate("2022-5-10T20:32:00:00Z", false) ```
|
|
8839
8860
|
*/
|
|
8840
8861
|
const isoStringToDate = (input, utc = true) => {
|
|
8841
8862
|
if (!input) {
|
|
@@ -8856,20 +8877,20 @@ const isValidIsoDateString = input => {
|
|
|
8856
8877
|
}
|
|
8857
8878
|
return isoStringToDate(input) !== undefined;
|
|
8858
8879
|
};
|
|
8859
|
-
/**
|
|
8860
|
-
* Parse a string to a date
|
|
8861
|
-
*
|
|
8862
|
-
* ***NOTE: String will be parsed in local time if utc is set to false***
|
|
8863
|
-
*
|
|
8864
|
-
* Expects the following props:
|
|
8865
|
-
* @param {string} input - string containing date
|
|
8866
|
-
* @param {string} strFormat - format of the string, see: https://date-fns.org/v2.29.3/docs/parse
|
|
8867
|
-
* @param {boolean} utc [ default = true ] - boolean indicating whether to parse as UTC
|
|
8868
|
-
* @param {Date} referenceDate [ default = new Date() ] - defines values missing from the parsed dateString
|
|
8869
|
-
*
|
|
8870
|
-
* @returns {Date} Date
|
|
8871
|
-
* @example
|
|
8872
|
-
* ``` stringToDate("2022 5 10 20:32", 'yyyy M d HH:mm')) ```
|
|
8880
|
+
/**
|
|
8881
|
+
* Parse a string to a date
|
|
8882
|
+
*
|
|
8883
|
+
* ***NOTE: String will be parsed in local time if utc is set to false***
|
|
8884
|
+
*
|
|
8885
|
+
* Expects the following props:
|
|
8886
|
+
* @param {string} input - string containing date
|
|
8887
|
+
* @param {string} strFormat - format of the string, see: https://date-fns.org/v2.29.3/docs/parse
|
|
8888
|
+
* @param {boolean} utc [ default = true ] - boolean indicating whether to parse as UTC
|
|
8889
|
+
* @param {Date} referenceDate [ default = new Date() ] - defines values missing from the parsed dateString
|
|
8890
|
+
*
|
|
8891
|
+
* @returns {Date} Date
|
|
8892
|
+
* @example
|
|
8893
|
+
* ``` stringToDate("2022 5 10 20:32", 'yyyy M d HH:mm')) ```
|
|
8873
8894
|
*/
|
|
8874
8895
|
const stringToDate = (input, strFormat, utc = true, referenceDate = new Date()) => {
|
|
8875
8896
|
if (!input) {
|
|
@@ -8890,19 +8911,19 @@ const dateToIsoString = input => {
|
|
|
8890
8911
|
}
|
|
8891
8912
|
return input.toISOString();
|
|
8892
8913
|
};
|
|
8893
|
-
/**
|
|
8894
|
-
* Use this if you initialise a date without a timezone to set it to utc correctly
|
|
8895
|
-
* eg.
|
|
8896
|
-
* new Date(2022, 10, 12, 15, 30)
|
|
8897
|
-
* should be:
|
|
8898
|
-
* setUTCDate(new Date(2022, 10, 12, 15, 30))
|
|
8899
|
-
*
|
|
8900
|
-
* Expects the following props:
|
|
8901
|
-
* @param {Date} inDate - date to be set to UTC
|
|
8902
|
-
*
|
|
8903
|
-
* @returns {Date} - Date in UTC
|
|
8904
|
-
* @example
|
|
8905
|
-
* ``` setUTCDate(new Date(2022, 10, 12, 15, 30)) ```
|
|
8914
|
+
/**
|
|
8915
|
+
* Use this if you initialise a date without a timezone to set it to utc correctly
|
|
8916
|
+
* eg.
|
|
8917
|
+
* new Date(2022, 10, 12, 15, 30)
|
|
8918
|
+
* should be:
|
|
8919
|
+
* setUTCDate(new Date(2022, 10, 12, 15, 30))
|
|
8920
|
+
*
|
|
8921
|
+
* Expects the following props:
|
|
8922
|
+
* @param {Date} inDate - date to be set to UTC
|
|
8923
|
+
*
|
|
8924
|
+
* @returns {Date} - Date in UTC
|
|
8925
|
+
* @example
|
|
8926
|
+
* ``` setUTCDate(new Date(2022, 10, 12, 15, 30)) ```
|
|
8906
8927
|
*/
|
|
8907
8928
|
const setUTCDate = inDate => {
|
|
8908
8929
|
if (!inDate || !isValid(inDate)) {
|
|
@@ -8913,17 +8934,17 @@ const setUTCDate = inDate => {
|
|
|
8913
8934
|
utcDate.setUTCHours(inDate.getHours(), inDate.getMinutes(), inDate.getSeconds(), inDate.getMilliseconds());
|
|
8914
8935
|
return utcDate;
|
|
8915
8936
|
};
|
|
8916
|
-
/**
|
|
8917
|
-
* Format a date to a string
|
|
8918
|
-
*
|
|
8919
|
-
* Expects the following props:
|
|
8920
|
-
* @param {Date} inDate - date to be formatted
|
|
8921
|
-
* @param {string} strFormat - [default: "yyyy-MM-dd'T'HH:mm:ss'Z'"] format of string
|
|
8922
|
-
* @param {boolean} utc - [default: true] true to return in utc otherwise return in local timezone
|
|
8923
|
-
*
|
|
8924
|
-
* @returns {string} - formatted date string
|
|
8925
|
-
* @example
|
|
8926
|
-
* ``` dateToString(new Date(2022, 10, 12, 15, 30), 'dd MMM yyyy') ```
|
|
8937
|
+
/**
|
|
8938
|
+
* Format a date to a string
|
|
8939
|
+
*
|
|
8940
|
+
* Expects the following props:
|
|
8941
|
+
* @param {Date} inDate - date to be formatted
|
|
8942
|
+
* @param {string} strFormat - [default: "yyyy-MM-dd'T'HH:mm:ss'Z'"] format of string
|
|
8943
|
+
* @param {boolean} utc - [default: true] true to return in utc otherwise return in local timezone
|
|
8944
|
+
*
|
|
8945
|
+
* @returns {string} - formatted date string
|
|
8946
|
+
* @example
|
|
8947
|
+
* ``` dateToString(new Date(2022, 10, 12, 15, 30), 'dd MMM yyyy') ```
|
|
8927
8948
|
*/
|
|
8928
8949
|
const dateToString = (inDate, strFormat = DATE_FORMAT_UTC, utc = true) => {
|
|
8929
8950
|
if (!inDate || !isValid(inDate)) {
|
|
@@ -8932,19 +8953,19 @@ const dateToString = (inDate, strFormat = DATE_FORMAT_UTC, utc = true) => {
|
|
|
8932
8953
|
const formattedDate = utc ? format(new Date(inDate.getUTCFullYear(), inDate.getUTCMonth(), inDate.getUTCDate(), inDate.getUTCHours(), inDate.getUTCMinutes(), inDate.getUTCSeconds()), strFormat) : format(inDate, strFormat);
|
|
8933
8954
|
return formattedDate;
|
|
8934
8955
|
};
|
|
8935
|
-
/**
|
|
8936
|
-
* Find out if a date is between two other dates.
|
|
8937
|
-
*
|
|
8938
|
-
* Inclusivity parameter matches that used in momentjs where '[' indicates inclusion and '(' indicates exclusion.
|
|
8939
|
-
*
|
|
8940
|
-
* Expects the following props:
|
|
8941
|
-
* @param {Date} date - date to be tested
|
|
8942
|
-
* @param {Date} from - first date
|
|
8943
|
-
* @param {Date} to - last date
|
|
8944
|
-
* @param {string} inclusivity - [default: '()'] Must be one of : '()', '[]', '(]', '[)'
|
|
8945
|
-
*
|
|
8946
|
-
* @returns {boolen} - true if date is between, otherwise false
|
|
8947
|
-
*
|
|
8956
|
+
/**
|
|
8957
|
+
* Find out if a date is between two other dates.
|
|
8958
|
+
*
|
|
8959
|
+
* Inclusivity parameter matches that used in momentjs where '[' indicates inclusion and '(' indicates exclusion.
|
|
8960
|
+
*
|
|
8961
|
+
* Expects the following props:
|
|
8962
|
+
* @param {Date} date - date to be tested
|
|
8963
|
+
* @param {Date} from - first date
|
|
8964
|
+
* @param {Date} to - last date
|
|
8965
|
+
* @param {string} inclusivity - [default: '()'] Must be one of : '()', '[]', '(]', '[)'
|
|
8966
|
+
*
|
|
8967
|
+
* @returns {boolen} - true if date is between, otherwise false
|
|
8968
|
+
*
|
|
8948
8969
|
*/
|
|
8949
8970
|
const isBetween = (date, from, to, inclusivity = '()') => {
|
|
8950
8971
|
if (!['()', '[]', '(]', '[)'].includes(inclusivity)) {
|
|
@@ -8954,25 +8975,25 @@ const isBetween = (date, from, to, inclusivity = '()') => {
|
|
|
8954
8975
|
const isAfterEqual = inclusivity[1] === ']';
|
|
8955
8976
|
return (isBeforeEqual ? isEqual(from, date) || isBefore(from, date) : isBefore(from, date)) && (isAfterEqual ? isEqual(to, date) || isAfter(to, date) : isAfter(to, date));
|
|
8956
8977
|
};
|
|
8957
|
-
/**
|
|
8958
|
-
* Creates a new Date object with the specified date and time, or the current date and time if no arguments are provided.
|
|
8959
|
-
*
|
|
8960
|
-
* @param yearOrIsoString The year for the new Date object, or an ISO-formatted string representing the date and time.
|
|
8961
|
-
* @param month The month for the new Date object (0-11).
|
|
8962
|
-
* @param day The day for the new Date object (1-31).
|
|
8963
|
-
* @param hours The hour for the new Date object (0-23).
|
|
8964
|
-
* @param minutes The minute for the new Date object (0-59).
|
|
8965
|
-
* @param seconds The second for the new Date object (0-59).
|
|
8966
|
-
* @param milliseconds The millisecond for the new Date object (0-999).
|
|
8967
|
-
* @returns A new Date object with the specified date and time, or the current date and time if no arguments are provided.
|
|
8968
|
-
*
|
|
8969
|
-
* @example
|
|
8970
|
-
* createDate(2022, 11, 13);
|
|
8971
|
-
* // => 2022-12-13T00:00:00.000Z
|
|
8972
|
-
*
|
|
8973
|
-
* @example
|
|
8974
|
-
* createDate('2022-12-13T00:00:00.000Z');
|
|
8975
|
-
* // => 2022-12-13T00:00:00.000Z
|
|
8978
|
+
/**
|
|
8979
|
+
* Creates a new Date object with the specified date and time, or the current date and time if no arguments are provided.
|
|
8980
|
+
*
|
|
8981
|
+
* @param yearOrIsoString The year for the new Date object, or an ISO-formatted string representing the date and time.
|
|
8982
|
+
* @param month The month for the new Date object (0-11).
|
|
8983
|
+
* @param day The day for the new Date object (1-31).
|
|
8984
|
+
* @param hours The hour for the new Date object (0-23).
|
|
8985
|
+
* @param minutes The minute for the new Date object (0-59).
|
|
8986
|
+
* @param seconds The second for the new Date object (0-59).
|
|
8987
|
+
* @param milliseconds The millisecond for the new Date object (0-999).
|
|
8988
|
+
* @returns A new Date object with the specified date and time, or the current date and time if no arguments are provided.
|
|
8989
|
+
*
|
|
8990
|
+
* @example
|
|
8991
|
+
* createDate(2022, 11, 13);
|
|
8992
|
+
* // => 2022-12-13T00:00:00.000Z
|
|
8993
|
+
*
|
|
8994
|
+
* @example
|
|
8995
|
+
* createDate('2022-12-13T00:00:00.000Z');
|
|
8996
|
+
* // => 2022-12-13T00:00:00.000Z
|
|
8976
8997
|
*/
|
|
8977
8998
|
const createDate = (yearOrIsoString, month, day, hours = 0, minutes = 0, seconds = 0, milliseconds = 0) => {
|
|
8978
8999
|
if (yearOrIsoString === undefined) {
|
|
@@ -8983,121 +9004,121 @@ const createDate = (yearOrIsoString, month, day, hours = 0, minutes = 0, seconds
|
|
|
8983
9004
|
}
|
|
8984
9005
|
return new Date(yearOrIsoString, month, day, hours, minutes, seconds, milliseconds);
|
|
8985
9006
|
};
|
|
8986
|
-
/**
|
|
8987
|
-
*
|
|
8988
|
-
* @param date
|
|
8989
|
-
* @param duration
|
|
8990
|
-
* @returns {Date} the new Date
|
|
9007
|
+
/**
|
|
9008
|
+
*
|
|
9009
|
+
* @param date
|
|
9010
|
+
* @param duration
|
|
9011
|
+
* @returns {Date} the new Date
|
|
8991
9012
|
*/
|
|
8992
9013
|
const add = (date, duration) => {
|
|
8993
9014
|
return add$1(date, duration);
|
|
8994
9015
|
};
|
|
8995
|
-
/**
|
|
8996
|
-
*
|
|
8997
|
-
* @param date
|
|
8998
|
-
* @param duration
|
|
8999
|
-
* @returns {Date} the new Date
|
|
9016
|
+
/**
|
|
9017
|
+
*
|
|
9018
|
+
* @param date
|
|
9019
|
+
* @param duration
|
|
9020
|
+
* @returns {Date} the new Date
|
|
9000
9021
|
*/
|
|
9001
9022
|
const sub = (date, duration) => {
|
|
9002
9023
|
return sub$1(date, duration);
|
|
9003
9024
|
};
|
|
9004
|
-
/**
|
|
9005
|
-
* Finds the number of years between to dates
|
|
9006
|
-
*
|
|
9007
|
-
* @param dateLeft - the later date
|
|
9008
|
-
* @param dateRight - the earlier date
|
|
9009
|
-
* @returns {number} the number of minutes
|
|
9025
|
+
/**
|
|
9026
|
+
* Finds the number of years between to dates
|
|
9027
|
+
*
|
|
9028
|
+
* @param dateLeft - the later date
|
|
9029
|
+
* @param dateRight - the earlier date
|
|
9030
|
+
* @returns {number} the number of minutes
|
|
9010
9031
|
*/
|
|
9011
9032
|
const differenceInYears = (dateLeft, dateRight) => {
|
|
9012
9033
|
return differenceInYears$1(dateLeft, dateRight);
|
|
9013
9034
|
};
|
|
9014
|
-
/**
|
|
9015
|
-
* Finds the number of months between to dates
|
|
9016
|
-
*
|
|
9017
|
-
* @param dateLeft - the later date
|
|
9018
|
-
* @param dateRight - the earlier date
|
|
9019
|
-
* @returns {number} the number of minutes
|
|
9035
|
+
/**
|
|
9036
|
+
* Finds the number of months between to dates
|
|
9037
|
+
*
|
|
9038
|
+
* @param dateLeft - the later date
|
|
9039
|
+
* @param dateRight - the earlier date
|
|
9040
|
+
* @returns {number} the number of minutes
|
|
9020
9041
|
*/
|
|
9021
9042
|
const differenceInMonths = (dateLeft, dateRight) => {
|
|
9022
9043
|
return differenceInMonths$1(dateLeft, dateRight);
|
|
9023
9044
|
};
|
|
9024
|
-
/**
|
|
9025
|
-
* Finds the number of days between to dates
|
|
9026
|
-
*
|
|
9027
|
-
* @param dateLeft - the later date
|
|
9028
|
-
* @param dateRight - the earlier date
|
|
9029
|
-
* @returns {number} the number of minutes
|
|
9045
|
+
/**
|
|
9046
|
+
* Finds the number of days between to dates
|
|
9047
|
+
*
|
|
9048
|
+
* @param dateLeft - the later date
|
|
9049
|
+
* @param dateRight - the earlier date
|
|
9050
|
+
* @returns {number} the number of minutes
|
|
9030
9051
|
*/
|
|
9031
9052
|
const differenceInDays = (dateLeft, dateRight) => {
|
|
9032
9053
|
return differenceInDays$1(dateLeft, dateRight);
|
|
9033
9054
|
};
|
|
9034
|
-
/**
|
|
9035
|
-
* Finds the number of minuts between to dates
|
|
9036
|
-
*
|
|
9037
|
-
* @param dateLeft - the later date
|
|
9038
|
-
* @param dateRight - the earlier date
|
|
9039
|
-
* @returns {number} the number of minutes
|
|
9055
|
+
/**
|
|
9056
|
+
* Finds the number of minuts between to dates
|
|
9057
|
+
*
|
|
9058
|
+
* @param dateLeft - the later date
|
|
9059
|
+
* @param dateRight - the earlier date
|
|
9060
|
+
* @returns {number} the number of minutes
|
|
9040
9061
|
*/
|
|
9041
9062
|
const differenceInMinutes = (dateLeft, dateRight) => {
|
|
9042
9063
|
return differenceInMinutes$1(dateLeft, dateRight);
|
|
9043
9064
|
};
|
|
9044
|
-
/**
|
|
9045
|
-
* Finds the number of hours between to dates
|
|
9046
|
-
*
|
|
9047
|
-
* @param dateLeft - the later date
|
|
9048
|
-
* @param dateRight - the earlier date
|
|
9049
|
-
* @returns {number} the number of hours
|
|
9065
|
+
/**
|
|
9066
|
+
* Finds the number of hours between to dates
|
|
9067
|
+
*
|
|
9068
|
+
* @param dateLeft - the later date
|
|
9069
|
+
* @param dateRight - the earlier date
|
|
9070
|
+
* @returns {number} the number of hours
|
|
9050
9071
|
*/
|
|
9051
9072
|
const differenceInHours = (dateLeft, dateRight, roundingMethod) => {
|
|
9052
9073
|
return roundingMethod ? differenceInHours$1(dateLeft, dateRight, {
|
|
9053
9074
|
roundingMethod
|
|
9054
9075
|
}) : differenceInHours$1(dateLeft, dateRight);
|
|
9055
9076
|
};
|
|
9056
|
-
/**
|
|
9057
|
-
* Finds the number of seconds between to dates
|
|
9058
|
-
*
|
|
9059
|
-
* @param dateLeft - the later date
|
|
9060
|
-
* @param dateRight - the earlier date
|
|
9061
|
-
* @returns {number} the number of minutes
|
|
9077
|
+
/**
|
|
9078
|
+
* Finds the number of seconds between to dates
|
|
9079
|
+
*
|
|
9080
|
+
* @param dateLeft - the later date
|
|
9081
|
+
* @param dateRight - the earlier date
|
|
9082
|
+
* @returns {number} the number of minutes
|
|
9062
9083
|
*/
|
|
9063
9084
|
const differenceInSeconds = (dateLeft, dateRight) => {
|
|
9064
9085
|
return differenceInSeconds$1(dateLeft, dateRight);
|
|
9065
9086
|
};
|
|
9066
|
-
/**
|
|
9067
|
-
*
|
|
9068
|
-
* @param date - the date to be rounded
|
|
9069
|
-
* @param options - the options for rounding
|
|
9070
|
-
* @returns the new date
|
|
9087
|
+
/**
|
|
9088
|
+
*
|
|
9089
|
+
* @param date - the date to be rounded
|
|
9090
|
+
* @param options - the options for rounding
|
|
9091
|
+
* @returns the new date
|
|
9071
9092
|
*/
|
|
9072
9093
|
const roundToNearestMinutes = (date, options) => {
|
|
9073
9094
|
return roundToNearestMinutes$1(date, options);
|
|
9074
9095
|
};
|
|
9075
|
-
/**
|
|
9076
|
-
*
|
|
9077
|
-
* @param date - the date that should be before the other one to return true
|
|
9078
|
-
* @param dateToCompare -the date to compare with
|
|
9079
|
-
*
|
|
9080
|
-
* @returns the first date is before the second date
|
|
9096
|
+
/**
|
|
9097
|
+
*
|
|
9098
|
+
* @param date - the date that should be before the other one to return true
|
|
9099
|
+
* @param dateToCompare -the date to compare with
|
|
9100
|
+
*
|
|
9101
|
+
* @returns the first date is before the second date
|
|
9081
9102
|
*/
|
|
9082
9103
|
const isBefore = (date, dateToCompare) => {
|
|
9083
9104
|
const before = isBefore$1(date, dateToCompare);
|
|
9084
9105
|
return before;
|
|
9085
9106
|
};
|
|
9086
|
-
/**
|
|
9087
|
-
*
|
|
9088
|
-
* @param date - the date that should be after the other one to return true
|
|
9089
|
-
* @param dateToCompare -the date to compare with
|
|
9090
|
-
*
|
|
9091
|
-
* @returns the first date is after the second date
|
|
9107
|
+
/**
|
|
9108
|
+
*
|
|
9109
|
+
* @param date - the date that should be after the other one to return true
|
|
9110
|
+
* @param dateToCompare -the date to compare with
|
|
9111
|
+
*
|
|
9112
|
+
* @returns the first date is after the second date
|
|
9092
9113
|
*/
|
|
9093
9114
|
const isAfter = (date, dateToCompare) => {
|
|
9094
9115
|
return isAfter$1(date, dateToCompare);
|
|
9095
9116
|
};
|
|
9096
|
-
/**
|
|
9097
|
-
* Gracefully parsing string to a date, setting tz to UTC even if it's missing or input is invalid
|
|
9098
|
-
* Note: use getUtcFromString() to convert a string to a date with stricter returns
|
|
9099
|
-
* @param dateStr - string containing date
|
|
9100
|
-
* @returns {Date} - Date in UTC, or current date when something invalid is passed.
|
|
9117
|
+
/**
|
|
9118
|
+
* Gracefully parsing string to a date, setting tz to UTC even if it's missing or input is invalid
|
|
9119
|
+
* Note: use getUtcFromString() to convert a string to a date with stricter returns
|
|
9120
|
+
* @param dateStr - string containing date
|
|
9121
|
+
* @returns {Date} - Date in UTC, or current date when something invalid is passed.
|
|
9101
9122
|
*/
|
|
9102
9123
|
const utc = dateStr => {
|
|
9103
9124
|
if (!dateStr) {
|
|
@@ -9108,10 +9129,10 @@ const utc = dateStr => {
|
|
|
9108
9129
|
}
|
|
9109
9130
|
return isoStringToDate(dateStr) || createDate();
|
|
9110
9131
|
};
|
|
9111
|
-
/**
|
|
9112
|
-
* Parsing string to a date. Stricter check, will return undefined when dateString is invalid.
|
|
9113
|
-
* @param dateStr - string containing date
|
|
9114
|
-
* @returns {Date} - Date in UTC, undefined when not valid
|
|
9132
|
+
/**
|
|
9133
|
+
* Parsing string to a date. Stricter check, will return undefined when dateString is invalid.
|
|
9134
|
+
* @param dateStr - string containing date
|
|
9135
|
+
* @returns {Date} - Date in UTC, undefined when not valid
|
|
9115
9136
|
*/
|
|
9116
9137
|
const getUtcFromString = dateStr => {
|
|
9117
9138
|
if (!dateStr || typeof dateStr !== 'string') {
|
|
@@ -9130,26 +9151,26 @@ const getOffsetStr = dateStr => {
|
|
|
9130
9151
|
const groups = dateStr.match(offsetMatcher);
|
|
9131
9152
|
return groups ? groups[1] : null;
|
|
9132
9153
|
};
|
|
9133
|
-
/**
|
|
9134
|
-
* Check if a date object is valid
|
|
9135
|
-
* @param {Date | number} date - date to be checked
|
|
9136
|
-
* @returns {boolean} - True if valid
|
|
9154
|
+
/**
|
|
9155
|
+
* Check if a date object is valid
|
|
9156
|
+
* @param {Date | number} date - date to be checked
|
|
9157
|
+
* @returns {boolean} - True if valid
|
|
9137
9158
|
*/
|
|
9138
9159
|
const isValid = date => {
|
|
9139
9160
|
return isValid$1(date);
|
|
9140
9161
|
};
|
|
9141
|
-
/**
|
|
9142
|
-
* Get the seconds timestamp of the given date
|
|
9143
|
-
* @param {Date} date - the given date
|
|
9144
|
-
* @returns the timestamp
|
|
9162
|
+
/**
|
|
9163
|
+
* Get the seconds timestamp of the given date
|
|
9164
|
+
* @param {Date} date - the given date
|
|
9165
|
+
* @returns the timestamp
|
|
9145
9166
|
*/
|
|
9146
9167
|
const unix = date => {
|
|
9147
9168
|
return getUnixTime(date);
|
|
9148
9169
|
};
|
|
9149
|
-
/**
|
|
9150
|
-
* Return the Date object for a given timestamp
|
|
9151
|
-
* @param {number} unixTime - timestamp
|
|
9152
|
-
* @returns the timestamp
|
|
9170
|
+
/**
|
|
9171
|
+
* Return the Date object for a given timestamp
|
|
9172
|
+
* @param {number} unixTime - timestamp
|
|
9173
|
+
* @returns the timestamp
|
|
9153
9174
|
*/
|
|
9154
9175
|
const fromUnix = unixTime => {
|
|
9155
9176
|
return fromUnixTime(unixTime);
|
|
@@ -9175,30 +9196,30 @@ const parseCustomDateString = dateStr => {
|
|
|
9175
9196
|
}
|
|
9176
9197
|
return new Date(dateStr);
|
|
9177
9198
|
};
|
|
9178
|
-
/**
|
|
9179
|
-
* Returns Date in UTC
|
|
9180
|
-
* @returns {Date} - Date in UTC
|
|
9199
|
+
/**
|
|
9200
|
+
* Returns Date in UTC
|
|
9201
|
+
* @returns {Date} - Date in UTC
|
|
9181
9202
|
*/
|
|
9182
9203
|
const getNowUtc = () => {
|
|
9183
9204
|
return createDate();
|
|
9184
9205
|
};
|
|
9185
|
-
/**
|
|
9186
|
-
* Returns current time as string
|
|
9187
|
-
* @param {string} strFormat - [default: "yyyy-MM-dd'T'HH:mm:ss'Z'"] format of string
|
|
9188
|
-
* @param {boolean} utc - [default: true] true to return in utc otherwise return in local timezone
|
|
9189
|
-
*
|
|
9190
|
-
* @returns {string} - formatted date string
|
|
9206
|
+
/**
|
|
9207
|
+
* Returns current time as string
|
|
9208
|
+
* @param {string} strFormat - [default: "yyyy-MM-dd'T'HH:mm:ss'Z'"] format of string
|
|
9209
|
+
* @param {boolean} utc - [default: true] true to return in utc otherwise return in local timezone
|
|
9210
|
+
*
|
|
9211
|
+
* @returns {string} - formatted date string
|
|
9191
9212
|
*/
|
|
9192
9213
|
const getCurrentTimeAsString = (strFormat = DATE_FORMAT_UTC, utc = true) => {
|
|
9193
9214
|
return dateToString(getNowUtc(), strFormat, utc);
|
|
9194
9215
|
};
|
|
9195
|
-
/**
|
|
9196
|
-
* Set date values to a given date (by default it is assumed you are passing the new values in UTC).
|
|
9197
|
-
* Note that months start at 0!
|
|
9198
|
-
* @param date - the dater to be changed
|
|
9199
|
-
* @param values - an object with options
|
|
9200
|
-
* @param useLocalTimeZone - boolean true if you are passing the values in local timezone
|
|
9201
|
-
* @returns the new date with options set
|
|
9216
|
+
/**
|
|
9217
|
+
* Set date values to a given date (by default it is assumed you are passing the new values in UTC).
|
|
9218
|
+
* Note that months start at 0!
|
|
9219
|
+
* @param date - the dater to be changed
|
|
9220
|
+
* @param values - an object with options
|
|
9221
|
+
* @param useLocalTimeZone - boolean true if you are passing the values in local timezone
|
|
9222
|
+
* @returns the new date with options set
|
|
9202
9223
|
*/
|
|
9203
9224
|
const set = (date, values, useLocalTimeZone = false) => {
|
|
9204
9225
|
if (useLocalTimeZone) {
|
|
@@ -9228,11 +9249,11 @@ const set = (date, values, useLocalTimeZone = false) => {
|
|
|
9228
9249
|
}
|
|
9229
9250
|
return newDate;
|
|
9230
9251
|
};
|
|
9231
|
-
/**
|
|
9232
|
-
* Get hours of a passed date in UTC (or local timezone if passed false)
|
|
9233
|
-
* @param date - the date of which to extract hours
|
|
9234
|
-
* @param utc - boolean true - whether to get UTC hours
|
|
9235
|
-
* @returns the hour number
|
|
9252
|
+
/**
|
|
9253
|
+
* Get hours of a passed date in UTC (or local timezone if passed false)
|
|
9254
|
+
* @param date - the date of which to extract hours
|
|
9255
|
+
* @param utc - boolean true - whether to get UTC hours
|
|
9256
|
+
* @returns the hour number
|
|
9236
9257
|
*/
|
|
9237
9258
|
const getHours = (date, utc = true) => {
|
|
9238
9259
|
if (utc) {
|
|
@@ -9240,10 +9261,10 @@ const getHours = (date, utc = true) => {
|
|
|
9240
9261
|
}
|
|
9241
9262
|
return getHours$1(date);
|
|
9242
9263
|
};
|
|
9243
|
-
/**
|
|
9244
|
-
* Return the start of hour for the given date. The result will be in UTC.
|
|
9245
|
-
* @param date - the date of which to retrieve the start of the hour
|
|
9246
|
-
* @returns the new date
|
|
9264
|
+
/**
|
|
9265
|
+
* Return the start of hour for the given date. The result will be in UTC.
|
|
9266
|
+
* @param date - the date of which to retrieve the start of the hour
|
|
9267
|
+
* @returns the new date
|
|
9247
9268
|
*/
|
|
9248
9269
|
const startOfHourUTC = date => {
|
|
9249
9270
|
const hourNum = date.getUTCHours();
|
|
@@ -9254,10 +9275,10 @@ const startOfHourUTC = date => {
|
|
|
9254
9275
|
milliseconds: 0
|
|
9255
9276
|
});
|
|
9256
9277
|
};
|
|
9257
|
-
/**
|
|
9258
|
-
* Return the start of a day for the given date. The result will be in UTC.
|
|
9259
|
-
* @param date - the date of which to retrieve the start of day
|
|
9260
|
-
* @returns the new date
|
|
9278
|
+
/**
|
|
9279
|
+
* Return the start of a day for the given date. The result will be in UTC.
|
|
9280
|
+
* @param date - the date of which to retrieve the start of day
|
|
9281
|
+
* @returns the new date
|
|
9261
9282
|
*/
|
|
9262
9283
|
const startOfDayUTC = date => {
|
|
9263
9284
|
const dateNum = date.getUTCDate();
|
|
@@ -9269,10 +9290,10 @@ const startOfDayUTC = date => {
|
|
|
9269
9290
|
milliseconds: 0
|
|
9270
9291
|
});
|
|
9271
9292
|
};
|
|
9272
|
-
/**
|
|
9273
|
-
* Return the start of a week for the given date. The result will be in UTC.
|
|
9274
|
-
* @param date - the date of which to retrieve the start of the week
|
|
9275
|
-
* @returns the new date
|
|
9293
|
+
/**
|
|
9294
|
+
* Return the start of a week for the given date. The result will be in UTC.
|
|
9295
|
+
* @param date - the date of which to retrieve the start of the week
|
|
9296
|
+
* @returns the new date
|
|
9276
9297
|
*/
|
|
9277
9298
|
const startOfWeekUTC = date => {
|
|
9278
9299
|
const dateNum = date.getUTCDate();
|
|
@@ -9286,10 +9307,10 @@ const startOfWeekUTC = date => {
|
|
|
9286
9307
|
milliseconds: 0
|
|
9287
9308
|
});
|
|
9288
9309
|
};
|
|
9289
|
-
/**
|
|
9290
|
-
* Return the start of a month for the given date. The result will be in UTC.
|
|
9291
|
-
* @param date - the date of which to retrieve the start of the month
|
|
9292
|
-
* @returns the new date
|
|
9310
|
+
/**
|
|
9311
|
+
* Return the start of a month for the given date. The result will be in UTC.
|
|
9312
|
+
* @param date - the date of which to retrieve the start of the month
|
|
9313
|
+
* @returns the new date
|
|
9293
9314
|
*/
|
|
9294
9315
|
const startOfMonthUTC = date => {
|
|
9295
9316
|
return set(new Date(date), {
|
|
@@ -9300,10 +9321,10 @@ const startOfMonthUTC = date => {
|
|
|
9300
9321
|
milliseconds: 0
|
|
9301
9322
|
});
|
|
9302
9323
|
};
|
|
9303
|
-
/**
|
|
9304
|
-
* Return the start of a year for the given date. The result will be in UTC.
|
|
9305
|
-
* @param date - the date of which to retrieve the start of the year
|
|
9306
|
-
* @returns the new date
|
|
9324
|
+
/**
|
|
9325
|
+
* Return the start of a year for the given date. The result will be in UTC.
|
|
9326
|
+
* @param date - the date of which to retrieve the start of the year
|
|
9327
|
+
* @returns the new date
|
|
9307
9328
|
*/
|
|
9308
9329
|
const startOfYearUTC = date => {
|
|
9309
9330
|
const yearNum = date.getUTCFullYear();
|
|
@@ -9319,10 +9340,10 @@ const startOfYearUTC = date => {
|
|
|
9319
9340
|
};
|
|
9320
9341
|
// TODO - IF TODAY time is going to be used, we need to edit this to handle the time.
|
|
9321
9342
|
// - now.getTimezoneOffset(); by subtracting the timezone offset, this can be used to convert the time to similar to UTC, because startOfDay retuns values in local time with offset
|
|
9322
|
-
/**
|
|
9323
|
-
* Parse custom time format of NOW+current time | current date in UTC. The result will be in UTC.
|
|
9324
|
-
* @param timeValue - string value
|
|
9325
|
-
* @returns Time in UTC format
|
|
9343
|
+
/**
|
|
9344
|
+
* Parse custom time format of NOW+current time | current date in UTC. The result will be in UTC.
|
|
9345
|
+
* @param timeValue - string value
|
|
9346
|
+
* @returns Time in UTC format
|
|
9326
9347
|
*/
|
|
9327
9348
|
const convertNOWFormatToUTC = timeValue => {
|
|
9328
9349
|
const now = new Date();
|
|
@@ -9338,10 +9359,10 @@ const convertNOWFormatToUTC = timeValue => {
|
|
|
9338
9359
|
}
|
|
9339
9360
|
throw new Error('Invalid endTime format');
|
|
9340
9361
|
};
|
|
9341
|
-
/**
|
|
9342
|
-
* Parse custom time format of NOW+-hours and minutes || TODAY+-hours and minutes into UTC. The result will be in UTC.
|
|
9343
|
-
* @param timeValue - string value
|
|
9344
|
-
* @returns Time in UTC format
|
|
9362
|
+
/**
|
|
9363
|
+
* Parse custom time format of NOW+-hours and minutes || TODAY+-hours and minutes into UTC. The result will be in UTC.
|
|
9364
|
+
* @param timeValue - string value
|
|
9365
|
+
* @returns Time in UTC format
|
|
9345
9366
|
*/
|
|
9346
9367
|
const convertNOWandTODAYFormatsToUTC = timeValue => {
|
|
9347
9368
|
const now = new Date();
|
|
@@ -9358,22 +9379,22 @@ const convertNOWandTODAYFormatsToUTC = timeValue => {
|
|
|
9358
9379
|
throw new Error('Invalid endTime format');
|
|
9359
9380
|
};
|
|
9360
9381
|
|
|
9361
|
-
/* *
|
|
9362
|
-
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
9363
|
-
* you may not use this file except in compliance with the License.
|
|
9364
|
-
* You may obtain a copy of the License at
|
|
9365
|
-
*
|
|
9366
|
-
* http://www.apache.org/licenses/LICENSE-2.0
|
|
9367
|
-
*
|
|
9368
|
-
* Unless required by applicable law or agreed to in writing, software
|
|
9369
|
-
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
9370
|
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
9371
|
-
* See the License for the specific language governing permissions and
|
|
9372
|
-
* limitations under the License.
|
|
9373
|
-
*
|
|
9374
|
-
* Copyright 2022 - Koninklijk Nederlands Meteorologisch Instituut (KNMI)
|
|
9375
|
-
* Copyright 2022 - Finnish Meteorological Institute (FMI)
|
|
9376
|
-
* Copyright 2024 - The Norwegian Meteorological Institute (MET Norway)
|
|
9382
|
+
/* *
|
|
9383
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
9384
|
+
* you may not use this file except in compliance with the License.
|
|
9385
|
+
* You may obtain a copy of the License at
|
|
9386
|
+
*
|
|
9387
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
9388
|
+
*
|
|
9389
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
9390
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
9391
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
9392
|
+
* See the License for the specific language governing permissions and
|
|
9393
|
+
* limitations under the License.
|
|
9394
|
+
*
|
|
9395
|
+
* Copyright 2022 - Koninklijk Nederlands Meteorologisch Instituut (KNMI)
|
|
9396
|
+
* Copyright 2022 - Finnish Meteorological Institute (FMI)
|
|
9397
|
+
* Copyright 2024 - The Norwegian Meteorological Institute (MET Norway)
|
|
9377
9398
|
* */
|
|
9378
9399
|
|
|
9379
9400
|
var index = /*#__PURE__*/Object.freeze({
|
|
@@ -9432,22 +9453,22 @@ var index = /*#__PURE__*/Object.freeze({
|
|
|
9432
9453
|
utc: utc
|
|
9433
9454
|
});
|
|
9434
9455
|
|
|
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 2023 - Koninklijk Nederlands Meteorologisch Instituut (KNMI)
|
|
9449
|
-
* Copyright 2023 - Finnish Meteorological Institute (FMI)
|
|
9450
|
-
* Copyright 2024 - The Norwegian Meteorological Institute (MET Norway)
|
|
9456
|
+
/* *
|
|
9457
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
9458
|
+
* you may not use this file except in compliance with the License.
|
|
9459
|
+
* You may obtain a copy of the License at
|
|
9460
|
+
*
|
|
9461
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
9462
|
+
*
|
|
9463
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
9464
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
9465
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
9466
|
+
* See the License for the specific language governing permissions and
|
|
9467
|
+
* limitations under the License.
|
|
9468
|
+
*
|
|
9469
|
+
* Copyright 2023 - Koninklijk Nederlands Meteorologisch Instituut (KNMI)
|
|
9470
|
+
* Copyright 2023 - Finnish Meteorological Institute (FMI)
|
|
9471
|
+
* Copyright 2024 - The Norwegian Meteorological Institute (MET Norway)
|
|
9451
9472
|
* */
|
|
9452
9473
|
const createMockStoreWithEggs = mockState => {
|
|
9453
9474
|
const mockStore = configureStore();
|
|
@@ -9468,22 +9489,22 @@ const createToolkitMockStoreWithEggs = storeConfig => {
|
|
|
9468
9489
|
return store;
|
|
9469
9490
|
};
|
|
9470
9491
|
|
|
9471
|
-
/* *
|
|
9472
|
-
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
9473
|
-
* you may not use this file except in compliance with the License.
|
|
9474
|
-
* You may obtain a copy of the License at
|
|
9475
|
-
*
|
|
9476
|
-
* http://www.apache.org/licenses/LICENSE-2.0
|
|
9477
|
-
*
|
|
9478
|
-
* Unless required by applicable law or agreed to in writing, software
|
|
9479
|
-
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
9480
|
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
9481
|
-
* See the License for the specific language governing permissions and
|
|
9482
|
-
* limitations under the License.
|
|
9483
|
-
*
|
|
9484
|
-
* Copyright 2024 - Koninklijk Nederlands Meteorologisch Instituut (KNMI)
|
|
9485
|
-
* Copyright 2024 - Finnish Meteorological Institute (FMI)
|
|
9486
|
-
* Copyright 2024 - The Norwegian Meteorological Institute (MET Norway)
|
|
9492
|
+
/* *
|
|
9493
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
9494
|
+
* you may not use this file except in compliance with the License.
|
|
9495
|
+
* You may obtain a copy of the License at
|
|
9496
|
+
*
|
|
9497
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
9498
|
+
*
|
|
9499
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
9500
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
9501
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
9502
|
+
* See the License for the specific language governing permissions and
|
|
9503
|
+
* limitations under the License.
|
|
9504
|
+
*
|
|
9505
|
+
* Copyright 2024 - Koninklijk Nederlands Meteorologisch Instituut (KNMI)
|
|
9506
|
+
* Copyright 2024 - Finnish Meteorological Institute (FMI)
|
|
9507
|
+
* Copyright 2024 - The Norwegian Meteorological Institute (MET Norway)
|
|
9487
9508
|
* */
|
|
9488
9509
|
const PROJECTION = {
|
|
9489
9510
|
EPSG_3035: {
|
|
@@ -9560,34 +9581,34 @@ const PROJECTION = {
|
|
|
9560
9581
|
}
|
|
9561
9582
|
};
|
|
9562
9583
|
|
|
9563
|
-
/* *
|
|
9564
|
-
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
9565
|
-
* you may not use this file except in compliance with the License.
|
|
9566
|
-
* You may obtain a copy of the License at
|
|
9567
|
-
*
|
|
9568
|
-
* http://www.apache.org/licenses/LICENSE-2.0
|
|
9569
|
-
*
|
|
9570
|
-
* Unless required by applicable law or agreed to in writing, software
|
|
9571
|
-
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
9572
|
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
9573
|
-
* See the License for the specific language governing permissions and
|
|
9574
|
-
* limitations under the License.
|
|
9575
|
-
*
|
|
9576
|
-
* Copyright 2024 - Koninklijk Nederlands Meteorologisch Instituut (KNMI)
|
|
9577
|
-
* Copyright 2024 - Finnish Meteorological Institute (FMI)
|
|
9578
|
-
* Copyright 2024 - The Norwegian Meteorological Institute (MET Norway)
|
|
9584
|
+
/* *
|
|
9585
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
9586
|
+
* you may not use this file except in compliance with the License.
|
|
9587
|
+
* You may obtain a copy of the License at
|
|
9588
|
+
*
|
|
9589
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
9590
|
+
*
|
|
9591
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
9592
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
9593
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
9594
|
+
* See the License for the specific language governing permissions and
|
|
9595
|
+
* limitations under the License.
|
|
9596
|
+
*
|
|
9597
|
+
* Copyright 2024 - Koninklijk Nederlands Meteorologisch Instituut (KNMI)
|
|
9598
|
+
* Copyright 2024 - Finnish Meteorological Institute (FMI)
|
|
9599
|
+
* Copyright 2024 - The Norwegian Meteorological Institute (MET Norway)
|
|
9579
9600
|
* */
|
|
9580
|
-
/**
|
|
9581
|
-
* Utility function to keep track of number of renders by a react component
|
|
9582
|
-
*
|
|
9583
|
-
* Usage:
|
|
9584
|
-
* 1) reset all counters to zero by:
|
|
9585
|
-
* renderCounter.reset()
|
|
9586
|
-
* 2) in the render function of the functional component do:
|
|
9587
|
-
* renderCounter.count(<your react functional component>.name);
|
|
9588
|
-
* 3) in the test do:
|
|
9589
|
-
* expect(renderCounter.get(<your react functional component>.name)).toBe(1);
|
|
9590
|
-
*
|
|
9601
|
+
/**
|
|
9602
|
+
* Utility function to keep track of number of renders by a react component
|
|
9603
|
+
*
|
|
9604
|
+
* Usage:
|
|
9605
|
+
* 1) reset all counters to zero by:
|
|
9606
|
+
* renderCounter.reset()
|
|
9607
|
+
* 2) in the render function of the functional component do:
|
|
9608
|
+
* renderCounter.count(<your react functional component>.name);
|
|
9609
|
+
* 3) in the test do:
|
|
9610
|
+
* expect(renderCounter.get(<your react functional component>.name)).toBe(1);
|
|
9611
|
+
*
|
|
9591
9612
|
*/
|
|
9592
9613
|
class RenderCounter {
|
|
9593
9614
|
constructor() {
|