@opengeoweb/sigmet-airmet 8.4.0 → 9.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 +56 -42
- package/package.json +2 -27
- package/src/lib/components/ProductForms/utils.d.ts +0 -3
package/index.esm.js
CHANGED
|
@@ -4,16 +4,16 @@ import { FormControlLabel, Radio, Grid, Typography, Box as Box$2, Button, Checkb
|
|
|
4
4
|
import { useFormContext } from 'react-hook-form';
|
|
5
5
|
import { useDraftFormHelpers, ReactHookFormRadioGroup, ReactHookFormSelect, ReactHookFormNumberField, isInteger, isValidMax, isValidMin, isEmpty, ReactHookFormDateTime, isValidDate, isBefore, isBetween, hasMaxFeaturePoints, hasMulitpleIntersections, ReactHookFormHiddenInput, isMaximumOneDrawing, hasIntersectionWithFIR, isValidGeoJsonCoordinates, isXHoursBefore, isAfter, isXHoursAfter, ReactHookFormTextField, isLatitude, isNonOrBothCoordinates, isLongitude, ReactHookFormFormControl, isGeometryDirty, ReactHookFormProvider, defaultFormOptions } from '@opengeoweb/form-fields';
|
|
6
6
|
import { useApiContext, useApi, createApiInstance, createNonAuthApiInstance, createFakeApiInstance, ApiProvider } from '@opengeoweb/api';
|
|
7
|
-
import { defaultGeoJSONStyleProperties, defaultIntersectionStyleProperties, defaultPoint, defaultBox, defaultPolygon, DRAWMODE, addFeatureProperties, defaultDelete, getIcon, MapControls, MapViewLayer, useMapDrawTool } from '@opengeoweb/webmap-react';
|
|
7
|
+
import { defaultGeoJSONStyleProperties, defaultIntersectionStyleProperties, defaultPoint, defaultBox, defaultPolygon, DRAWMODE, addFeatureProperties, defaultDelete, getIcon, MapControls, MapViewLayer, useMapDrawTool, rewindGeometry } from '@opengeoweb/webmap-react';
|
|
8
8
|
import { dateUtils, ToggleMenu, CustomTooltip, useIsMounted, StatusTag, AlertBanner, ConfirmationServiceProvider, usePreventBrowserClose, useConfirmationDialog, isAxiosError, getAxiosErrorMessage, usePoller, ErrorBoundary } from '@opengeoweb/shared';
|
|
9
|
-
import { polygonToLineString, booleanClockwise, rewind } from '@turf/turf';
|
|
10
9
|
import { DrawFIRLand, ChevronLeft, Edit, Success, Clock } from '@opengeoweb/theme';
|
|
11
10
|
import { LayerType, webmapUtils } from '@opengeoweb/webmap';
|
|
12
11
|
import moment from 'moment';
|
|
13
12
|
import { debounce } from 'lodash';
|
|
14
13
|
import 'react-dom';
|
|
15
14
|
import { mapSelectors, syncGroupsActions, mapStoreActions, defaultLayers, syncConstants } from '@opengeoweb/store';
|
|
16
|
-
import { LayerManagerMapButtonConnect, LegendMapButtonConnect, MultiDimensionSelectMapButtonsConnect, MapViewConnect,
|
|
15
|
+
import { LayerManagerMapButtonConnect, LegendMapButtonConnect, MultiDimensionSelectMapButtonsConnect, MapViewConnect, LegendConnect, LayerManagerConnect } from '@opengeoweb/core';
|
|
16
|
+
import { TimeSliderConnect } from '@opengeoweb/timeslider';
|
|
17
17
|
import { jsx } from 'react/jsx-runtime';
|
|
18
18
|
|
|
19
19
|
function _iterableToArrayLimit(r, l) {
|
|
@@ -814,8 +814,6 @@ var Change = function Change(_ref) {
|
|
|
814
814
|
}))));
|
|
815
815
|
};
|
|
816
816
|
|
|
817
|
-
function n$5(n){for(var r=arguments.length,t=Array(r>1?r-1:0),e=1;e<r;e++)t[e-1]=arguments[e];if("production"!==process.env.NODE_ENV){var i=Y[n],o=i?"function"==typeof i?i.apply(null,t):i:"unknown error nr: "+n;throw Error("[Immer] "+o)}throw Error("[Immer] minified error nr: "+n+(t.length?" "+t.map((function(n){return "'"+n+"'"})).join(","):"")+". Find the full error at: https://bit.ly/3cXEKWf")}function r$5(n){return !!n&&!!n[Q]}function t$5(n){var r;return !!n&&(function(n){if(!n||"object"!=typeof n)return !1;var r=Object.getPrototypeOf(n);if(null===r)return !0;var t=Object.hasOwnProperty.call(r,"constructor")&&r.constructor;return t===Object||"function"==typeof t&&Function.toString.call(t)===Z}(n)||Array.isArray(n)||!!n[L]||!!(null===(r=n.constructor)||void 0===r?void 0:r[L])||s(n)||v$4(n))}function i(n,r,t){void 0===t&&(t=!1),0===o(n)?(t?Object.keys:nn)(n).forEach((function(e){t&&"symbol"==typeof e||r(e,n[e],n);})):n.forEach((function(t,e){return r(e,t,n)}));}function o(n){var r=n[Q];return r?r.i>3?r.i-4:r.i:Array.isArray(n)?1:s(n)?2:v$4(n)?3:0}function u$3(n,r){return 2===o(n)?n.has(r):Object.prototype.hasOwnProperty.call(n,r)}function a(n,r){return 2===o(n)?n.get(r):n[r]}function f$3(n,r,t){var e=o(n);2===e?n.set(r,t):3===e?n.add(t):n[r]=t;}function c$3(n,r){return n===r?0!==n||1/n==1/r:n!=n&&r!=r}function s(n){return X&&n instanceof Map}function v$4(n){return q$5&&n instanceof Set}function p$5(n){return n.o||n.t}function l$4(n){if(Array.isArray(n))return Array.prototype.slice.call(n);var r=rn(n);delete r[Q];for(var t=nn(r),e=0;e<t.length;e++){var i=t[e],o=r[i];!1===o.writable&&(o.writable=!0,o.configurable=!0),(o.get||o.set)&&(r[i]={configurable:!0,writable:!0,enumerable:o.enumerable,value:n[i]});}return Object.create(Object.getPrototypeOf(n),r)}function d$3(n,e){return void 0===e&&(e=!1),y$2(n)||r$5(n)||!t$5(n)||(o(n)>1&&(n.set=n.add=n.clear=n.delete=h$5),Object.freeze(n),e&&i(n,(function(n,r){return d$3(r,!0)}),!0)),n}function h$5(){n$5(2);}function y$2(n){return null==n||"object"!=typeof n||Object.isFrozen(n)}function b$3(r){var t=tn[r];return t||n$5(18,r),t}function _(){return "production"===process.env.NODE_ENV||U||n$5(0),U}function j(n,r){r&&(b$3("Patches"),n.u=[],n.s=[],n.v=r);}function g$3(n){O(n),n.p.forEach(S),n.p=null;}function O(n){n===U&&(U=n.l);}function w$3(n){return U={p:[],l:U,h:n,m:!0,_:0}}function S(n){var r=n[Q];0===r.i||1===r.i?r.j():r.g=!0;}function P(r,e){e._=e.p.length;var i=e.p[0],o=void 0!==r&&r!==i;return e.h.O||b$3("ES5").S(e,r,o),o?(i[Q].P&&(g$3(e),n$5(4)),t$5(r)&&(r=M(e,r),e.l||x$2(e,r)),e.u&&b$3("Patches").M(i[Q].t,r,e.u,e.s)):r=M(e,i,[]),g$3(e),e.u&&e.v(e.u,e.s),r!==H?r:void 0}function M(n,r,t){if(y$2(r))return r;var e=r[Q];if(!e)return i(r,(function(i,o){return A$2(n,e,r,i,o,t)}),!0),r;if(e.A!==n)return r;if(!e.P)return x$2(n,e.t,!0),e.t;if(!e.I){e.I=!0,e.A._--;var o=4===e.i||5===e.i?e.o=l$4(e.k):e.o,u=o,a=!1;3===e.i&&(u=new Set(o),o.clear(),a=!0),i(u,(function(r,i){return A$2(n,e,o,r,i,t,a)})),x$2(n,o,!1),t&&n.u&&b$3("Patches").N(e,t,n.u,n.s);}return e.o}function A$2(e,i,o,a,c,s,v){if("production"!==process.env.NODE_ENV&&c===o&&n$5(5),r$5(c)){var p=M(e,c,s&&i&&3!==i.i&&!u$3(i.R,a)?s.concat(a):void 0);if(f$3(o,a,p),!r$5(p))return;e.m=!1;}else v&&o.add(c);if(t$5(c)&&!y$2(c)){if(!e.h.D&&e._<1)return;M(e,c),i&&i.A.l||x$2(e,c);}}function x$2(n,r,t){void 0===t&&(t=!1),!n.l&&n.h.D&&n.m&&d$3(r,t);}function z$2(n,r){var t=n[Q];return (t?p$5(t):n)[r]}function I(n,r){if(r in n)for(var t=Object.getPrototypeOf(n);t;){var e=Object.getOwnPropertyDescriptor(t,r);if(e)return e;t=Object.getPrototypeOf(t);}}function k$4(n){n.P||(n.P=!0,n.l&&k$4(n.l));}function E(n){n.o||(n.o=l$4(n.t));}function N(n,r,t){var e=s(r)?b$3("MapSet").F(r,t):v$4(r)?b$3("MapSet").T(r,t):n.O?function(n,r){var t=Array.isArray(n),e={i:t?1:0,A:r?r.A:_(),P:!1,I:!1,R:{},l:r,t:n,k:null,o:null,j:null,C:!1},i=e,o=en;t&&(i=[e],o=on);var u=Proxy.revocable(i,o),a=u.revoke,f=u.proxy;return e.k=f,e.j=a,f}(r,t):b$3("ES5").J(r,t);return (t?t.A:_()).p.push(e),e}function R(e){return r$5(e)||n$5(22,e),function n(r){if(!t$5(r))return r;var e,u=r[Q],c=o(r);if(u){if(!u.P&&(u.i<4||!b$3("ES5").K(u)))return u.t;u.I=!0,e=D(r,c),u.I=!1;}else e=D(r,c);return i(e,(function(r,t){u&&a(u.t,r)===t||f$3(e,r,n(t));})),3===c?new Set(e):e}(e)}function D(n,r){switch(r){case 2:return new Map(n);case 3:return Array.from(n)}return l$4(n)}var G,U,W="undefined"!=typeof Symbol&&"symbol"==typeof Symbol("x"),X="undefined"!=typeof Map,q$5="undefined"!=typeof Set,B="undefined"!=typeof Proxy&&void 0!==Proxy.revocable&&"undefined"!=typeof Reflect,H=W?Symbol.for("immer-nothing"):((G={})["immer-nothing"]=!0,G),L=W?Symbol.for("immer-draftable"):"__$immer_draftable",Q=W?Symbol.for("immer-state"):"__$immer_state",Y={0:"Illegal state",1:"Immer drafts cannot have computed properties",2:"This object has been frozen and should not be mutated",3:function(n){return "Cannot use a proxy that has been revoked. Did you pass an object from inside an immer function to an async process? "+n},4:"An immer producer returned a new value *and* modified its draft. Either return a new value *or* modify the draft.",5:"Immer forbids circular references",6:"The first or second argument to `produce` must be a function",7:"The third argument to `produce` must be a function or undefined",8:"First argument to `createDraft` must be a plain object, an array, or an immerable object",9:"First argument to `finishDraft` must be a draft returned by `createDraft`",10:"The given draft is already finalized",11:"Object.defineProperty() cannot be used on an Immer draft",12:"Object.setPrototypeOf() cannot be used on an Immer draft",13:"Immer only supports deleting array indices",14:"Immer only supports setting array indices and the 'length' property",15:function(n){return "Cannot apply patch, path doesn't resolve: "+n},16:'Sets cannot have "replace" patches.',17:function(n){return "Unsupported patch operation: "+n},18:function(n){return "The plugin for '"+n+"' has not been loaded into Immer. To enable the plugin, import and call `enable"+n+"()` when initializing your application."},20:"Cannot use proxies if Proxy, Proxy.revocable or Reflect are not available",21:function(n){return "produce can only be called on things that are draftable: plain objects, arrays, Map, Set or classes that are marked with '[immerable]: true'. Got '"+n+"'"},22:function(n){return "'current' expects a draft, got: "+n},23:function(n){return "'original' expects a draft, got: "+n},24:"Patching reserved attributes like __proto__, prototype and constructor is not allowed"},Z=""+Object.prototype.constructor,nn="undefined"!=typeof Reflect&&Reflect.ownKeys?Reflect.ownKeys:void 0!==Object.getOwnPropertySymbols?function(n){return Object.getOwnPropertyNames(n).concat(Object.getOwnPropertySymbols(n))}:Object.getOwnPropertyNames,rn=Object.getOwnPropertyDescriptors||function(n){var r={};return nn(n).forEach((function(t){r[t]=Object.getOwnPropertyDescriptor(n,t);})),r},tn={},en={get:function(n,r){if(r===Q)return n;var e=p$5(n);if(!u$3(e,r))return function(n,r,t){var e,i=I(r,t);return i?"value"in i?i.value:null===(e=i.get)||void 0===e?void 0:e.call(n.k):void 0}(n,e,r);var i=e[r];return n.I||!t$5(i)?i:i===z$2(n.t,r)?(E(n),n.o[r]=N(n.A.h,i,n)):i},has:function(n,r){return r in p$5(n)},ownKeys:function(n){return Reflect.ownKeys(p$5(n))},set:function(n,r,t){var e=I(p$5(n),r);if(null==e?void 0:e.set)return e.set.call(n.k,t),!0;if(!n.P){var i=z$2(p$5(n),r),o=null==i?void 0:i[Q];if(o&&o.t===t)return n.o[r]=t,n.R[r]=!1,!0;if(c$3(t,i)&&(void 0!==t||u$3(n.t,r)))return !0;E(n),k$4(n);}return n.o[r]===t&&(void 0!==t||r in n.o)||Number.isNaN(t)&&Number.isNaN(n.o[r])||(n.o[r]=t,n.R[r]=!0),!0},deleteProperty:function(n,r){return void 0!==z$2(n.t,r)||r in n.t?(n.R[r]=!1,E(n),k$4(n)):delete n.R[r],n.o&&delete n.o[r],!0},getOwnPropertyDescriptor:function(n,r){var t=p$5(n),e=Reflect.getOwnPropertyDescriptor(t,r);return e?{writable:!0,configurable:1!==n.i||"length"!==r,enumerable:e.enumerable,value:t[r]}:e},defineProperty:function(){n$5(11);},getPrototypeOf:function(n){return Object.getPrototypeOf(n.t)},setPrototypeOf:function(){n$5(12);}},on={};i(en,(function(n,r){on[n]=function(){return arguments[0]=arguments[0][0],r.apply(this,arguments)};})),on.deleteProperty=function(r,t){return "production"!==process.env.NODE_ENV&&isNaN(parseInt(t))&&n$5(13),on.set.call(this,r,t,void 0)},on.set=function(r,t,e){return "production"!==process.env.NODE_ENV&&"length"!==t&&isNaN(parseInt(t))&&n$5(14),en.set.call(this,r[0],t,e,r[0])};var un=function(){function e(r){var e=this;this.O=B,this.D=!0,this.produce=function(r,i,o){if("function"==typeof r&&"function"!=typeof i){var u=i;i=r;var a=e;return function(n){var r=this;void 0===n&&(n=u);for(var t=arguments.length,e=Array(t>1?t-1:0),o=1;o<t;o++)e[o-1]=arguments[o];return a.produce(n,(function(n){var t;return (t=i).call.apply(t,[r,n].concat(e))}))}}var f;if("function"!=typeof i&&n$5(6),void 0!==o&&"function"!=typeof o&&n$5(7),t$5(r)){var c=w$3(e),s=N(e,r,void 0),v=!0;try{f=i(s),v=!1;}finally{v?g$3(c):O(c);}return "undefined"!=typeof Promise&&f instanceof Promise?f.then((function(n){return j(c,o),P(n,c)}),(function(n){throw g$3(c),n})):(j(c,o),P(f,c))}if(!r||"object"!=typeof r){if(void 0===(f=i(r))&&(f=r),f===H&&(f=void 0),e.D&&d$3(f,!0),o){var p=[],l=[];b$3("Patches").M(r,f,p,l),o(p,l);}return f}n$5(21,r);},this.produceWithPatches=function(n,r){if("function"==typeof n)return function(r){for(var t=arguments.length,i=Array(t>1?t-1:0),o=1;o<t;o++)i[o-1]=arguments[o];return e.produceWithPatches(r,(function(r){return n.apply(void 0,[r].concat(i))}))};var t,i,o=e.produce(n,r,(function(n,r){t=n,i=r;}));return "undefined"!=typeof Promise&&o instanceof Promise?o.then((function(n){return [n,t,i]})):[o,t,i]},"boolean"==typeof(null==r?void 0:r.useProxies)&&this.setUseProxies(r.useProxies),"boolean"==typeof(null==r?void 0:r.autoFreeze)&&this.setAutoFreeze(r.autoFreeze);}var i=e.prototype;return i.createDraft=function(e){t$5(e)||n$5(8),r$5(e)&&(e=R(e));var i=w$3(this),o=N(this,e,void 0);return o[Q].C=!0,O(i),o},i.finishDraft=function(r,t){var e=r&&r[Q];"production"!==process.env.NODE_ENV&&(e&&e.C||n$5(9),e.I&&n$5(10));var i=e.A;return j(i,t),P(void 0,i)},i.setAutoFreeze=function(n){this.D=n;},i.setUseProxies=function(r){r&&!B&&n$5(20),this.O=r;},i.applyPatches=function(n,t){var e;for(e=t.length-1;e>=0;e--){var i=t[e];if(0===i.path.length&&"replace"===i.op){n=i.value;break}}e>-1&&(t=t.slice(e+1));var o=b$3("Patches").$;return r$5(n)?o(n,t):this.produce(n,(function(n){return o(n,t)}))},e}(),an=new un,fn=an.produce;an.produceWithPatches.bind(an);an.setAutoFreeze.bind(an);an.setUseProxies.bind(an);an.applyPatches.bind(an);an.createDraft.bind(an);an.finishDraft.bind(an);
|
|
818
|
-
|
|
819
817
|
/* *
|
|
820
818
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
821
819
|
* you may not use this file except in compliance with the License.
|
|
@@ -945,7 +943,7 @@ var getMaxCloudLowerLevelValue = function getMaxCloudLowerLevelValue(unit, selec
|
|
|
945
943
|
// Return max value for selected unit - if not present in list, return null
|
|
946
944
|
return cloud_lower_level_max !== undefined && cloud_lower_level_max[unit] ? cloud_lower_level_max[unit] : null;
|
|
947
945
|
};
|
|
948
|
-
// Retrieve
|
|
946
|
+
// Retrieve max value from config - if not set, there is no max value for this unit so we return null
|
|
949
947
|
var getMaxLevelValue = function getMaxLevelValue(unit, selectedFIR, productConfig) {
|
|
950
948
|
// Use first FIR in list if no FIR selected
|
|
951
949
|
var _getActiveFIRArea5 = getActiveFIRArea(selectedFIR, productConfig),
|
|
@@ -1262,18 +1260,6 @@ var getFir = function getFir(productConfig, firName) {
|
|
|
1262
1260
|
var isFir = function isFir(geojson) {
|
|
1263
1261
|
return geojson && geojson.features && geojson.features.length > 0 && geojson.features[0].properties['selectionType'] === 'fir';
|
|
1264
1262
|
};
|
|
1265
|
-
var rewindGeometry = function rewindGeometry(geoJSON) {
|
|
1266
|
-
return fn(geoJSON, function (geoJSONDraft) {
|
|
1267
|
-
if (geoJSONDraft && geoJSONDraft.features.length > 0 && geoJSONDraft.features[0].geometry.type === 'Polygon' && geoJSONDraft.features[0].geometry.coordinates[0].length > 1) {
|
|
1268
|
-
var geometry = geoJSON.features[0].geometry;
|
|
1269
|
-
var lineString = polygonToLineString(geometry);
|
|
1270
|
-
if (booleanClockwise(lineString.geometry.coordinates)) {
|
|
1271
|
-
// eslint-disable-next-line no-param-reassign
|
|
1272
|
-
geoJSONDraft.features[0].geometry = rewind(geoJSONDraft.features[0].geometry);
|
|
1273
|
-
}
|
|
1274
|
-
}
|
|
1275
|
-
});
|
|
1276
|
-
};
|
|
1277
1263
|
var getFieldLabel = function getFieldLabel(title, isDisabled) {
|
|
1278
1264
|
var action = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 'Select';
|
|
1279
1265
|
return isDisabled ? title : "".concat(action, " ").concat(title.toLowerCase());
|
|
@@ -1407,7 +1393,7 @@ var DrawTools = function DrawTools(_ref) {
|
|
|
1407
1393
|
icon: getToolIcon(tool.drawModeId),
|
|
1408
1394
|
value: true,
|
|
1409
1395
|
checkedIcon: getToolIcon(tool.drawModeId),
|
|
1410
|
-
checked:
|
|
1396
|
+
checked: activeTool === tool.drawModeId,
|
|
1411
1397
|
onChange: function onChange() {
|
|
1412
1398
|
onChangeTool(tool);
|
|
1413
1399
|
},
|
|
@@ -1496,17 +1482,25 @@ var Levels = function Levels(_ref) {
|
|
|
1496
1482
|
unregister = _useFormContext.unregister;
|
|
1497
1483
|
var _useDraftFormHelpers = useDraftFormHelpers(),
|
|
1498
1484
|
isRequired = _useDraftFormHelpers.isRequired;
|
|
1485
|
+
var level = watch('level.value');
|
|
1499
1486
|
var levelInfoMode = watch('levelInfoMode');
|
|
1487
|
+
var isRadioactiveCloud = watch('phenomenon') === 'RDOACT_CLD';
|
|
1500
1488
|
var getFIRValue = function getFIRValue() {
|
|
1501
1489
|
return getValues('locationIndicatorATSR');
|
|
1502
1490
|
};
|
|
1503
1491
|
// Get allowed level units based on selected FIR - if no FIR selected, allow all default units
|
|
1504
1492
|
var allowedLevelUnitsForFir = getAllowedUnits(getFIRValue(), productConfig, 'level_unit', LevelUnits);
|
|
1493
|
+
var radioactiveCloudLevel = getMaxLevelValue(LevelUnits.FL, getFIRValue(), productConfig);
|
|
1505
1494
|
React__default.useEffect(function () {
|
|
1506
1495
|
if (levelInfoMode !== 'BETW') {
|
|
1507
1496
|
unregister('lowerLevel');
|
|
1508
1497
|
}
|
|
1509
|
-
|
|
1498
|
+
if (isRadioactiveCloud) {
|
|
1499
|
+
setValue('level.unit', 'FL');
|
|
1500
|
+
setValue('level.value', radioactiveCloudLevel);
|
|
1501
|
+
triggerValidations(['level.value'], getValues, trigger);
|
|
1502
|
+
}
|
|
1503
|
+
}, [getValues, isRadioactiveCloud, levelInfoMode, radioactiveCloudLevel, setValue, trigger, unregister]);
|
|
1510
1504
|
return /*#__PURE__*/React__default.createElement(ProductFormFieldLayout, {
|
|
1511
1505
|
title: "Levels",
|
|
1512
1506
|
sx: styles$2.containerItem
|
|
@@ -1520,7 +1514,7 @@ var Levels = function Levels(_ref) {
|
|
|
1520
1514
|
isRequired: isRequired
|
|
1521
1515
|
}
|
|
1522
1516
|
},
|
|
1523
|
-
disabled: isDisabled,
|
|
1517
|
+
disabled: isDisabled || isRadioactiveCloud,
|
|
1524
1518
|
isReadOnly: isReadOnly,
|
|
1525
1519
|
onChange: function onChange() {
|
|
1526
1520
|
// Reset default value for the level value to '' so when it rerenders it uses this empty default value
|
|
@@ -1534,8 +1528,8 @@ var Levels = function Levels(_ref) {
|
|
|
1534
1528
|
label: "At",
|
|
1535
1529
|
checked: levelInfoMode === 'AT' || levelInfoMode === 'TOPS',
|
|
1536
1530
|
"data-testid": "levels-AT",
|
|
1537
|
-
disabled: isDisabled
|
|
1538
|
-
}), levelInfoMode === 'AT' || levelInfoMode === 'TOPS' ? /*#__PURE__*/React__default.createElement(Grid, {
|
|
1531
|
+
disabled: isDisabled || isRadioactiveCloud
|
|
1532
|
+
}), (levelInfoMode === 'AT' || levelInfoMode === 'TOPS') && !isRadioactiveCloud ? /*#__PURE__*/React__default.createElement(Grid, {
|
|
1539
1533
|
item: true,
|
|
1540
1534
|
xs: 12,
|
|
1541
1535
|
container: true,
|
|
@@ -1626,7 +1620,7 @@ var Levels = function Levels(_ref) {
|
|
|
1626
1620
|
label: "Between",
|
|
1627
1621
|
checked: levelInfoMode === 'BETW' || levelInfoMode === 'BETW_SFC',
|
|
1628
1622
|
"data-testid": "levels-BETW",
|
|
1629
|
-
disabled: isDisabled
|
|
1623
|
+
disabled: isDisabled || isRadioactiveCloud
|
|
1630
1624
|
}), levelInfoMode === 'BETW' || levelInfoMode === 'BETW_SFC' ? /*#__PURE__*/React__default.createElement(React__default.Fragment, null, /*#__PURE__*/React__default.createElement(Grid, {
|
|
1631
1625
|
item: true,
|
|
1632
1626
|
xs: 12,
|
|
@@ -1656,7 +1650,7 @@ var Levels = function Levels(_ref) {
|
|
|
1656
1650
|
},
|
|
1657
1651
|
size: "small",
|
|
1658
1652
|
sx: styles$2.unit,
|
|
1659
|
-
disabled: isDisabled,
|
|
1653
|
+
disabled: isDisabled || isRadioactiveCloud,
|
|
1660
1654
|
isReadOnly: isReadOnly,
|
|
1661
1655
|
defaultValue: 'FL',
|
|
1662
1656
|
onChange: function onChange() {
|
|
@@ -1673,6 +1667,7 @@ var Levels = function Levels(_ref) {
|
|
|
1673
1667
|
xs: 8,
|
|
1674
1668
|
md: 6
|
|
1675
1669
|
}, /*#__PURE__*/React__default.createElement(ReactHookFormNumberField, {
|
|
1670
|
+
value: level || '',
|
|
1676
1671
|
name: "level.value",
|
|
1677
1672
|
label: "Upper level",
|
|
1678
1673
|
sx: styles$2.levelField,
|
|
@@ -1701,7 +1696,7 @@ var Levels = function Levels(_ref) {
|
|
|
1701
1696
|
}
|
|
1702
1697
|
}
|
|
1703
1698
|
},
|
|
1704
|
-
disabled: isDisabled,
|
|
1699
|
+
disabled: isDisabled || isRadioactiveCloud,
|
|
1705
1700
|
isReadOnly: isReadOnly,
|
|
1706
1701
|
onChange: function onChange() {
|
|
1707
1702
|
triggerValidations(['lowerLevel.value'], getValues, trigger);
|
|
@@ -1729,7 +1724,7 @@ var Levels = function Levels(_ref) {
|
|
|
1729
1724
|
},
|
|
1730
1725
|
name: "checkedF",
|
|
1731
1726
|
color: "secondary",
|
|
1732
|
-
disabled: isDisabled
|
|
1727
|
+
disabled: isDisabled || isRadioactiveCloud
|
|
1733
1728
|
}),
|
|
1734
1729
|
"data-testid": "levels-SFC",
|
|
1735
1730
|
label: "SFC"
|
|
@@ -1808,7 +1803,7 @@ var Levels = function Levels(_ref) {
|
|
|
1808
1803
|
}))))) : null, /*#__PURE__*/React__default.createElement(RadioButtonAndLabel, {
|
|
1809
1804
|
value: "ABV",
|
|
1810
1805
|
label: "Above",
|
|
1811
|
-
disabled: isDisabled,
|
|
1806
|
+
disabled: isDisabled || isRadioactiveCloud,
|
|
1812
1807
|
checked: levelInfoMode === 'ABV' || levelInfoMode === 'TOPS_ABV',
|
|
1813
1808
|
"data-testid": "levels-ABV"
|
|
1814
1809
|
}), levelInfoMode === 'ABV' || levelInfoMode === 'TOPS_ABV' ? /*#__PURE__*/React__default.createElement(Grid, {
|
|
@@ -2006,7 +2001,8 @@ var ObservationForecastTime = function ObservationForecastTime(_ref) {
|
|
|
2006
2001
|
onChange: function onChange() {
|
|
2007
2002
|
return _onChange();
|
|
2008
2003
|
},
|
|
2009
|
-
sx: styles$2.helperText
|
|
2004
|
+
sx: styles$2.helperText,
|
|
2005
|
+
"data-testid": "obs-fcst-time"
|
|
2010
2006
|
})) : null;
|
|
2011
2007
|
};
|
|
2012
2008
|
|
|
@@ -2054,6 +2050,12 @@ var Phenomenon = function Phenomenon(_ref) {
|
|
|
2054
2050
|
onChange: function onChange() {
|
|
2055
2051
|
if (getValues('movementType') === 'NO_VA_EXP') {
|
|
2056
2052
|
setValue('movementType', null);
|
|
2053
|
+
} else if (getValues('phenomenon') === 'RDOACT_CLD') {
|
|
2054
|
+
// By definition, phenomenon 'RDOACT_CLD'shall not ever move but stay stationary
|
|
2055
|
+
setValue('movementType', 'STATIONARY');
|
|
2056
|
+
// Also by definition, phenomenon 'RDOACT_CLD' is strictly defined to always span from surface to upper level
|
|
2057
|
+
// with no lower explicit level values defined, hence level mode shall be set to 'BETW_SFC' instead of 'BETW'.
|
|
2058
|
+
setValue('levelInfoMode', 'BETW_SFC');
|
|
2057
2059
|
}
|
|
2058
2060
|
triggerValidations(['validDateStart', 'validDateEnd'], getValues, trigger);
|
|
2059
2061
|
_onChange();
|
|
@@ -2233,6 +2235,9 @@ var Progress = function Progress(_ref) {
|
|
|
2233
2235
|
unregister('endGeometryIntersect');
|
|
2234
2236
|
}
|
|
2235
2237
|
}, [movementType, unregister]);
|
|
2238
|
+
var isSigmet = productType === 'sigmet';
|
|
2239
|
+
var isRadioactiveCloud = watch('phenomenon') === 'RDOACT_CLD';
|
|
2240
|
+
var isVolcanicCloud = watch('phenomenon') === 'VA_CLD';
|
|
2236
2241
|
return /*#__PURE__*/React__default.createElement(ProductFormFieldLayout, {
|
|
2237
2242
|
title: "Progress",
|
|
2238
2243
|
sx: styles$2.containerItem
|
|
@@ -2256,22 +2261,27 @@ var Progress = function Progress(_ref) {
|
|
|
2256
2261
|
onChangeTool(deleteTool);
|
|
2257
2262
|
}
|
|
2258
2263
|
}
|
|
2259
|
-
},
|
|
2264
|
+
}, isVolcanicCloud && /*#__PURE__*/React__default.createElement(RadioButtonAndLabel, {
|
|
2260
2265
|
value: "NO_VA_EXP",
|
|
2261
2266
|
label: "No volcanic ash expected",
|
|
2262
2267
|
disabled: isDisabled,
|
|
2263
2268
|
"data-testid": "movementType-NO_VA_EXP"
|
|
2264
|
-
}), /*#__PURE__*/React__default.createElement(RadioButtonAndLabel, {
|
|
2269
|
+
}), /*#__PURE__*/React__default.createElement(React__default.Fragment, null, /*#__PURE__*/React__default.createElement(RadioButtonAndLabel, {
|
|
2265
2270
|
value: "STATIONARY",
|
|
2266
2271
|
label: "Stationary",
|
|
2267
|
-
disabled: isDisabled,
|
|
2272
|
+
disabled: isDisabled || isRadioactiveCloud,
|
|
2268
2273
|
"data-testid": "movementType-STATIONARY"
|
|
2269
2274
|
}), /*#__PURE__*/React__default.createElement(RadioButtonAndLabel, {
|
|
2270
2275
|
value: "MOVEMENT",
|
|
2271
2276
|
label: "Movement",
|
|
2272
|
-
disabled: isDisabled,
|
|
2277
|
+
disabled: isDisabled || isRadioactiveCloud,
|
|
2273
2278
|
"data-testid": "movementType-MOVEMENT"
|
|
2274
|
-
}),
|
|
2279
|
+
}), isSigmet && isRadioactiveCloud && /*#__PURE__*/React__default.createElement(RadioButtonAndLabel, {
|
|
2280
|
+
value: "FORECAST_POSITION",
|
|
2281
|
+
label: "End position",
|
|
2282
|
+
disabled: isDisabled || isRadioactiveCloud,
|
|
2283
|
+
"data-testid": "movementType-FORECAST_POSITION"
|
|
2284
|
+
})), movementType === 'MOVEMENT' && !isRadioactiveCloud && /*#__PURE__*/React__default.createElement(React__default.Fragment, null, /*#__PURE__*/React__default.createElement(Grid, {
|
|
2275
2285
|
item: true,
|
|
2276
2286
|
xs: 12
|
|
2277
2287
|
}, /*#__PURE__*/React__default.createElement(ReactHookFormSelect, {
|
|
@@ -2361,12 +2371,12 @@ var Progress = function Progress(_ref) {
|
|
|
2361
2371
|
onChange: function onChange(event) {
|
|
2362
2372
|
return event && event.stopPropagation();
|
|
2363
2373
|
}
|
|
2364
|
-
})))),
|
|
2374
|
+
})))), isSigmet && !isRadioactiveCloud && /*#__PURE__*/React__default.createElement(RadioButtonAndLabel, {
|
|
2365
2375
|
value: "FORECAST_POSITION",
|
|
2366
2376
|
label: "End position",
|
|
2367
2377
|
disabled: isDisabled,
|
|
2368
2378
|
"data-testid": "movementType-FORECAST_POSITION"
|
|
2369
|
-
})),
|
|
2379
|
+
})), isSigmet && !isRadioactiveCloud && movementType === 'FORECAST_POSITION' && /*#__PURE__*/React__default.createElement(Grid, {
|
|
2370
2380
|
item: true,
|
|
2371
2381
|
xs: 12,
|
|
2372
2382
|
"data-testid": "endGeometry",
|
|
@@ -2496,16 +2506,20 @@ var SelectFIR = function SelectFIR(_ref) {
|
|
|
2496
2506
|
}, fir.FIR);
|
|
2497
2507
|
})), /*#__PURE__*/React__default.createElement(ReactHookFormHiddenInput, {
|
|
2498
2508
|
name: "locationIndicatorATSU",
|
|
2499
|
-
defaultValue: locationIndicatorATSU
|
|
2509
|
+
defaultValue: locationIndicatorATSU,
|
|
2510
|
+
"data-testid": "locationIndicatorATSU"
|
|
2500
2511
|
}), /*#__PURE__*/React__default.createElement(ReactHookFormHiddenInput, {
|
|
2501
2512
|
name: "locationIndicatorMWO",
|
|
2502
|
-
defaultValue: locationIndicatorMWO
|
|
2513
|
+
defaultValue: locationIndicatorMWO,
|
|
2514
|
+
"data-testid": "locationIndicatorMWO"
|
|
2503
2515
|
}), /*#__PURE__*/React__default.createElement(ReactHookFormHiddenInput, {
|
|
2504
2516
|
name: "firName",
|
|
2505
|
-
defaultValue: firName
|
|
2517
|
+
defaultValue: firName,
|
|
2518
|
+
"data-testid": "firName"
|
|
2506
2519
|
}), /*#__PURE__*/React__default.createElement(ReactHookFormHiddenInput, {
|
|
2507
2520
|
name: "firGeometry",
|
|
2508
|
-
defaultValue: firGeometry
|
|
2521
|
+
defaultValue: firGeometry,
|
|
2522
|
+
"data-testid": "firGeometry"
|
|
2509
2523
|
}));
|
|
2510
2524
|
};
|
|
2511
2525
|
|
|
@@ -12704,7 +12718,7 @@ tags.forEach(function (tagName) {
|
|
|
12704
12718
|
});
|
|
12705
12719
|
|
|
12706
12720
|
/**
|
|
12707
|
-
* @mui/styled-engine v5.14.
|
|
12721
|
+
* @mui/styled-engine v5.14.16
|
|
12708
12722
|
*
|
|
12709
12723
|
* @license MIT
|
|
12710
12724
|
* This source code is licensed under the MIT license found in the
|
|
@@ -15543,7 +15557,7 @@ var fakeSigmetList = [{
|
|
|
15543
15557
|
locationIndicatorATSR: 'EHAA',
|
|
15544
15558
|
locationIndicatorMWO: 'EHDB',
|
|
15545
15559
|
isObservationOrForecast: 'OBS',
|
|
15546
|
-
observationOrForecastTime: dateUtils.dateToString(dateUtils.
|
|
15560
|
+
observationOrForecastTime: dateUtils.dateToString(dateUtils.sub(dateUtils.utc(), {
|
|
15547
15561
|
hours: 1
|
|
15548
15562
|
})),
|
|
15549
15563
|
movementType: 'STATIONARY',
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@opengeoweb/sigmet-airmet",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "9.0.0",
|
|
4
4
|
"description": "GeoWeb Sigmet/Airmet library for the opengeoweb project",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"repository": {
|
|
@@ -9,30 +9,5 @@
|
|
|
9
9
|
},
|
|
10
10
|
"module": "./index.esm.js",
|
|
11
11
|
"type": "module",
|
|
12
|
-
"main": "./index.esm.js"
|
|
13
|
-
"dependencies": {
|
|
14
|
-
"@mui/material": "5.12.0",
|
|
15
|
-
"@mui/system": "5.14.14",
|
|
16
|
-
"@opengeoweb/api": "8.4.0",
|
|
17
|
-
"@opengeoweb/authentication": "8.4.0",
|
|
18
|
-
"@opengeoweb/core": "8.4.0",
|
|
19
|
-
"@opengeoweb/form-fields": "8.4.0",
|
|
20
|
-
"@opengeoweb/shared": "8.4.0",
|
|
21
|
-
"@opengeoweb/store": "8.4.0",
|
|
22
|
-
"@opengeoweb/theme": "8.4.0",
|
|
23
|
-
"@opengeoweb/webmap": "8.4.0",
|
|
24
|
-
"@opengeoweb/webmap-react": "8.4.0",
|
|
25
|
-
"@redux-eggs/redux-toolkit": "2.2.0",
|
|
26
|
-
"@redux-eggs/saga-extension": "2.2.0",
|
|
27
|
-
"@reduxjs/toolkit": "1.9.7",
|
|
28
|
-
"@turf/turf": "6.5.0",
|
|
29
|
-
"axios": "1.5.0",
|
|
30
|
-
"immer": "9.0.21",
|
|
31
|
-
"lodash": "4.17.21",
|
|
32
|
-
"moment": "2.29.4",
|
|
33
|
-
"react": "18.2.0",
|
|
34
|
-
"react-hook-form": "7.47.0",
|
|
35
|
-
"react-redux": "8.1.3"
|
|
36
|
-
},
|
|
37
|
-
"peerDependencies": {}
|
|
12
|
+
"main": "./index.esm.js"
|
|
38
13
|
}
|
|
@@ -1,6 +1,4 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
|
-
import { Feature } from '@turf/turf';
|
|
3
|
-
import { FeatureCollection } from 'geojson';
|
|
4
2
|
import { FieldValues, UseFormGetValues, UseFormTrigger } from 'react-hook-form';
|
|
5
3
|
import { layerTypes, mapTypes } from '@opengeoweb/store';
|
|
6
4
|
import { DrawMode } from '@opengeoweb/webmap-react';
|
|
@@ -55,7 +53,6 @@ export declare const getFir: (productConfig: ProductConfig, firName?: string) =>
|
|
|
55
53
|
* Function to check if the given geojson object has 'fir' selectionType property
|
|
56
54
|
*/
|
|
57
55
|
export declare const isFir: (geojson: GeoJSON.FeatureCollection) => boolean;
|
|
58
|
-
export declare const rewindGeometry: (geoJSON: FeatureCollection) => FeatureCollection;
|
|
59
56
|
export declare const getFieldLabel: (title: string, isDisabled: boolean, action?: string) => string;
|
|
60
57
|
export declare const getBaseLayers: (productConfig: ProductConfig) => layerTypes.Layer[];
|
|
61
58
|
export declare const getMaxMovementSpeedValue: (unit: string, selectedFIR: string, productConfig: ProductConfig) => number | null;
|