@opengeoweb/sigmet-airmet 4.15.0 → 4.16.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 CHANGED
@@ -3011,12 +3011,22 @@ var SurfaceVisibility = function SurfaceVisibility(_ref) {
3011
3011
  * Copyright 2021 - Koninklijk Nederlands Meteorologisch Instituut (KNMI)
3012
3012
  * Copyright 2021 - Finnish Meteorological Institute (FMI)
3013
3013
  * */
3014
- var invalidSurfaceWindDirectionStepsMessage = 'Direction must be rounded to the nearest 10 deg.';
3015
- var validateSurfaceWindDirection = function validateSurfaceWindDirection(value) {
3016
- if (isEmpty(value)) return true; // Parse to integer to check for steps
3014
+ var DEFAULT_ROUNDING_SURFACE_WIND_DIRECTION = 10;
3015
+ var invalidSurfaceWindDirectionStepsMessage = function invalidSurfaceWindDirectionStepsMessage() {
3016
+ var value = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : DEFAULT_ROUNDING_SURFACE_WIND_DIRECTION;
3017
+ return "Direction must be rounded to the nearest ".concat(value, " deg.");
3018
+ };
3019
+
3020
+ var _validateSurfaceWindDirection = function validateSurfaceWindDirection(value, productConfig, selectedFIR) {
3021
+ if (isEmpty(value)) return true;
3022
+
3023
+ var _getActiveFIRArea = getActiveFIRArea(selectedFIR, productConfig),
3024
+ _getActiveFIRArea$win = _getActiveFIRArea.wind_direction_rounding,
3025
+ wind_direction_rounding = _getActiveFIRArea$win === void 0 ? DEFAULT_ROUNDING_SURFACE_WIND_DIRECTION : _getActiveFIRArea$win; // Parse to integer to check for steps
3026
+
3017
3027
 
3018
3028
  var intVisibility = parseInt(value, 10);
3019
- return intVisibility % 10 === 0 || invalidSurfaceWindDirectionStepsMessage;
3029
+ return intVisibility % wind_direction_rounding === 0 || invalidSurfaceWindDirectionStepsMessage(wind_direction_rounding);
3020
3030
  };
3021
3031
 
3022
3032
  var SurfaceWind = function SurfaceWind(_ref) {
@@ -3074,7 +3084,9 @@ var SurfaceWind = function SurfaceWind(_ref) {
3074
3084
  },
3075
3085
  validate: {
3076
3086
  isRequired: isRequired,
3077
- validateSurfaceWindDirection: validateSurfaceWindDirection
3087
+ validateSurfaceWindDirection: function validateSurfaceWindDirection(value) {
3088
+ return _validateSurfaceWindDirection(value, productConfig, selectedFIR);
3089
+ }
3078
3090
  }
3079
3091
  },
3080
3092
  disabled: isDisabled,
@@ -5584,6 +5596,7 @@ var fir_areas = {
5584
5596
  cloud_level_rounding_ft: 100,
5585
5597
  cloud_level_rounding_m_below: 30,
5586
5598
  cloud_level_rounding_m_above: 300,
5599
+ wind_direction_rounding: 10,
5587
5600
  wind_speed_min: {
5588
5601
  KT: 31,
5589
5602
  MPS: 0
@@ -7781,6 +7794,9 @@ var properties = {
7781
7794
  cloud_level_rounding_m_above: {
7782
7795
  type: "number"
7783
7796
  },
7797
+ wind_direction_rounding: {
7798
+ type: "number"
7799
+ },
7784
7800
  wind_speed_max: {
7785
7801
  type: "object",
7786
7802
  additionalProperties: {
package/index.umd.js CHANGED
@@ -2956,12 +2956,24 @@
2956
2956
  * Copyright 2021 - Koninklijk Nederlands Meteorologisch Instituut (KNMI)
2957
2957
  * Copyright 2021 - Finnish Meteorological Institute (FMI)
2958
2958
  * */
2959
- var invalidSurfaceWindDirectionStepsMessage = 'Direction must be rounded to the nearest 10 deg.';
2960
- var validateSurfaceWindDirection = function validateSurfaceWindDirection(value) {
2961
- if (formFields.isEmpty(value)) return true; // Parse to integer to check for steps
2959
+ var DEFAULT_ROUNDING_SURFACE_WIND_DIRECTION = 10;
2960
+ var invalidSurfaceWindDirectionStepsMessage = function invalidSurfaceWindDirectionStepsMessage(value) {
2961
+ if (value === void 0) {
2962
+ value = DEFAULT_ROUNDING_SURFACE_WIND_DIRECTION;
2963
+ }
2964
+
2965
+ return "Direction must be rounded to the nearest " + value + " deg.";
2966
+ };
2967
+
2968
+ var _validateSurfaceWindDirection = function validateSurfaceWindDirection(value, productConfig, selectedFIR) {
2969
+ if (formFields.isEmpty(value)) return true;
2970
+ var // eslint-disable-next-line @typescript-eslint/naming-convention
2971
+ _a = getActiveFIRArea(selectedFIR, productConfig).wind_direction_rounding,
2972
+ // eslint-disable-next-line @typescript-eslint/naming-convention
2973
+ wind_direction_rounding = _a === void 0 ? DEFAULT_ROUNDING_SURFACE_WIND_DIRECTION : _a; // Parse to integer to check for steps
2962
2974
 
2963
2975
  var intVisibility = parseInt(value, 10);
2964
- return intVisibility % 10 === 0 || invalidSurfaceWindDirectionStepsMessage;
2976
+ return intVisibility % wind_direction_rounding === 0 || invalidSurfaceWindDirectionStepsMessage(wind_direction_rounding);
2965
2977
  };
2966
2978
 
2967
2979
  var SurfaceWind = function SurfaceWind(_a) {
@@ -3017,7 +3029,9 @@
3017
3029
  },
3018
3030
  validate: {
3019
3031
  isRequired: isRequired,
3020
- validateSurfaceWindDirection: validateSurfaceWindDirection
3032
+ validateSurfaceWindDirection: function validateSurfaceWindDirection(value) {
3033
+ return _validateSurfaceWindDirection(value, productConfig, selectedFIR);
3034
+ }
3021
3035
  }
3022
3036
  },
3023
3037
  disabled: isDisabled,
@@ -5503,6 +5517,7 @@
5503
5517
  cloud_level_rounding_ft: 100,
5504
5518
  cloud_level_rounding_m_below: 30,
5505
5519
  cloud_level_rounding_m_above: 300,
5520
+ wind_direction_rounding: 10,
5506
5521
  wind_speed_min: {
5507
5522
  KT: 31,
5508
5523
  MPS: 0
@@ -7700,6 +7715,9 @@
7700
7715
  cloud_level_rounding_m_above: {
7701
7716
  type: "number"
7702
7717
  },
7718
+ wind_direction_rounding: {
7719
+ type: "number"
7720
+ },
7703
7721
  wind_speed_max: {
7704
7722
  type: "object",
7705
7723
  additionalProperties: {
@@ -1,6 +1,7 @@
1
1
  import React from 'react';
2
- import { ConfigurableFormFieldProps } from '../../../types';
3
- export declare const invalidSurfaceWindDirectionStepsMessage = "Direction must be rounded to the nearest 10 deg.";
4
- export declare const validateSurfaceWindDirection: (value: string) => boolean | string;
2
+ import { ConfigurableFormFieldProps, ProductConfig } from '../../../types';
3
+ export declare const DEFAULT_ROUNDING_SURFACE_WIND_DIRECTION = 10;
4
+ export declare const invalidSurfaceWindDirectionStepsMessage: (value?: number) => string;
5
+ export declare const validateSurfaceWindDirection: (value: string, productConfig: ProductConfig, selectedFIR: string) => boolean | string;
5
6
  declare const SurfaceWind: React.FC<ConfigurableFormFieldProps>;
6
7
  export default SurfaceWind;
package/lib/types.d.ts CHANGED
@@ -396,6 +396,7 @@ export interface FIRConfigAirmet extends FIRArea {
396
396
  cloud_level_rounding_ft?: number;
397
397
  cloud_level_rounding_m_below?: number;
398
398
  cloud_level_rounding_m_above?: number;
399
+ wind_direction_rounding?: number;
399
400
  wind_speed_max?: SurfaceWindMinMaxType;
400
401
  wind_speed_min?: SurfaceWindMinMaxType;
401
402
  visibility_max?: number;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@opengeoweb/sigmet-airmet",
3
- "version": "4.15.0",
3
+ "version": "4.16.0",
4
4
  "description": "GeoWeb Sigmet/Airmet library for the opengeoweb project",
5
5
  "license": "Apache-2.0",
6
6
  "repository": {
@@ -14,32 +14,33 @@
14
14
  "react": "^18.2.0",
15
15
  "react-redux": "^8.0.4",
16
16
  "@mui/material": "^5.10.8",
17
- "@opengeoweb/shared": "4.15.0",
18
- "@opengeoweb/theme": "4.15.0",
17
+ "@opengeoweb/shared": "4.16.0",
18
+ "@opengeoweb/theme": "4.16.0",
19
19
  "react-draggable": "^4.4.5",
20
20
  "re-resizable": "^6.9.0",
21
21
  "@redux-eggs/core": "^2.2.0",
22
22
  "lodash": "^4.17.20",
23
23
  "axios": "^0.25.0",
24
24
  "date-fns": "^2.29.3",
25
- "@opengeoweb/core": "4.15.0",
25
+ "@opengeoweb/core": "4.16.0",
26
26
  "moment": "^2.29.0",
27
- "@opengeoweb/webmap": "4.15.0",
27
+ "@opengeoweb/webmap": "4.16.0",
28
28
  "throttle-debounce": "^3.0.1",
29
29
  "proj4": "^2.6.2",
30
- "@opengeoweb/api": "4.15.0",
30
+ "@opengeoweb/api": "4.16.0",
31
31
  "react-intl": "^5.17.5",
32
32
  "react-sortablejs": "^6.1.4",
33
33
  "sortablejs": "^1.15.0",
34
34
  "immer": "^9.0.15",
35
35
  "react-window": "^1.8.7",
36
- "@opengeoweb/form-fields": "4.15.0",
36
+ "@opengeoweb/form-fields": "4.16.0",
37
37
  "react-hook-form": "^7.41.5",
38
38
  "moment-timezone": "^0.5.31",
39
39
  "@mui/x-date-pickers": "^5.0.4",
40
40
  "@reduxjs/toolkit": "^1.8.3",
41
41
  "lodash.clonedeep": "^4.5.0",
42
42
  "@turf/turf": "^5.1.6",
43
+ "react-router-dom": "^6.4.2",
43
44
  "@mui/system": "^5.10.8",
44
45
  "redux-saga": "^1.2.1",
45
46
  "@redux-eggs/redux-toolkit": "^2.2.0",