@opengeoweb/sigmet-airmet 8.3.1 → 8.4.1
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 +199 -77
- package/package.json +10 -10
- package/src/lib/components/ProductForms/ProductForm.styles.d.ts +31 -1
- package/src/lib/types.d.ts +8 -0
package/index.esm.js
CHANGED
|
@@ -416,6 +416,15 @@ function _toPropertyKey(arg) {
|
|
|
416
416
|
return typeof key === "symbol" ? key : String(key);
|
|
417
417
|
}
|
|
418
418
|
|
|
419
|
+
/**
|
|
420
|
+
* The possible type for the sigmet
|
|
421
|
+
*/
|
|
422
|
+
var SigmetType;
|
|
423
|
+
(function (SigmetType) {
|
|
424
|
+
SigmetType["NORMAL"] = "Normal";
|
|
425
|
+
SigmetType["TEST"] = "Test";
|
|
426
|
+
SigmetType["EXERCISE"] = "Exercise";
|
|
427
|
+
})(SigmetType || (SigmetType = {}));
|
|
419
428
|
/**
|
|
420
429
|
* The possible phenomena for the sigmet
|
|
421
430
|
*/
|
|
@@ -586,6 +595,20 @@ var styles$2 = {
|
|
|
586
595
|
containerItem: {
|
|
587
596
|
' .MuiTypography-subtitle1': {
|
|
588
597
|
marginTop: 1
|
|
598
|
+
},
|
|
599
|
+
paddingTop: '8px!important',
|
|
600
|
+
'+ .MuiGrid-item': {
|
|
601
|
+
paddingTop: 0
|
|
602
|
+
},
|
|
603
|
+
'.MuiButtonBase-root.MuiRadio-root': {
|
|
604
|
+
padding: '6px',
|
|
605
|
+
marginLeft: '3px'
|
|
606
|
+
},
|
|
607
|
+
'.MuiFormControl-root.MuiTextField-root': {
|
|
608
|
+
marginBottom: 0
|
|
609
|
+
},
|
|
610
|
+
'.MuiGrid-root': {
|
|
611
|
+
alignItems: 'flex-start'
|
|
589
612
|
}
|
|
590
613
|
},
|
|
591
614
|
volcanicField: {
|
|
@@ -604,7 +627,10 @@ var styles$2 = {
|
|
|
604
627
|
marginBottom: 2
|
|
605
628
|
},
|
|
606
629
|
latitude: {
|
|
607
|
-
width: '97%'
|
|
630
|
+
width: '97%',
|
|
631
|
+
'.MuiFormControl-root.MuiTextField-root': {
|
|
632
|
+
margin: 0
|
|
633
|
+
}
|
|
608
634
|
},
|
|
609
635
|
unit: {
|
|
610
636
|
width: '95%'
|
|
@@ -623,12 +649,25 @@ var styles$2 = {
|
|
|
623
649
|
},
|
|
624
650
|
helperText: {
|
|
625
651
|
' .MuiFormHelperText-root': {
|
|
626
|
-
|
|
627
|
-
|
|
652
|
+
top: 'auto',
|
|
653
|
+
position: 'relative',
|
|
654
|
+
lineHeight: '1.33em',
|
|
628
655
|
'&.Mui-error': {
|
|
629
656
|
top: 'auto',
|
|
630
657
|
position: 'relative'
|
|
631
658
|
}
|
|
659
|
+
},
|
|
660
|
+
'.MuiFormLabel-root.MuiInputLabel-root': {
|
|
661
|
+
top: -4,
|
|
662
|
+
lineHeight: '1.33em'
|
|
663
|
+
},
|
|
664
|
+
'.MuiSvgIcon-root': {
|
|
665
|
+
width: '0.8em',
|
|
666
|
+
height: '0.8em'
|
|
667
|
+
},
|
|
668
|
+
'.MuiButtonBase-root.MuiIconButton-root': {
|
|
669
|
+
padding: '2px',
|
|
670
|
+
marginLeft: '-4px'
|
|
632
671
|
}
|
|
633
672
|
}
|
|
634
673
|
};
|
|
@@ -906,7 +945,7 @@ var getMaxCloudLowerLevelValue = function getMaxCloudLowerLevelValue(unit, selec
|
|
|
906
945
|
// Return max value for selected unit - if not present in list, return null
|
|
907
946
|
return cloud_lower_level_max !== undefined && cloud_lower_level_max[unit] ? cloud_lower_level_max[unit] : null;
|
|
908
947
|
};
|
|
909
|
-
// Retrieve
|
|
948
|
+
// Retrieve max value from config - if not set, there is no max value for this unit so we return null
|
|
910
949
|
var getMaxLevelValue = function getMaxLevelValue(unit, selectedFIR, productConfig) {
|
|
911
950
|
// Use first FIR in list if no FIR selected
|
|
912
951
|
var _getActiveFIRArea5 = getActiveFIRArea(selectedFIR, productConfig),
|
|
@@ -1457,17 +1496,25 @@ var Levels = function Levels(_ref) {
|
|
|
1457
1496
|
unregister = _useFormContext.unregister;
|
|
1458
1497
|
var _useDraftFormHelpers = useDraftFormHelpers(),
|
|
1459
1498
|
isRequired = _useDraftFormHelpers.isRequired;
|
|
1499
|
+
var level = watch('level.value');
|
|
1460
1500
|
var levelInfoMode = watch('levelInfoMode');
|
|
1501
|
+
var isRadioactiveCloud = watch('phenomenon') === 'RDOACT_CLD';
|
|
1461
1502
|
var getFIRValue = function getFIRValue() {
|
|
1462
1503
|
return getValues('locationIndicatorATSR');
|
|
1463
1504
|
};
|
|
1464
1505
|
// Get allowed level units based on selected FIR - if no FIR selected, allow all default units
|
|
1465
1506
|
var allowedLevelUnitsForFir = getAllowedUnits(getFIRValue(), productConfig, 'level_unit', LevelUnits);
|
|
1507
|
+
var radioactiveCloudLevel = getMaxLevelValue(LevelUnits.FL, getFIRValue(), productConfig);
|
|
1466
1508
|
React__default.useEffect(function () {
|
|
1467
1509
|
if (levelInfoMode !== 'BETW') {
|
|
1468
1510
|
unregister('lowerLevel');
|
|
1469
1511
|
}
|
|
1470
|
-
|
|
1512
|
+
if (isRadioactiveCloud) {
|
|
1513
|
+
setValue('level.unit', 'FL');
|
|
1514
|
+
setValue('level.value', radioactiveCloudLevel);
|
|
1515
|
+
triggerValidations(['level.value'], getValues, trigger);
|
|
1516
|
+
}
|
|
1517
|
+
}, [getValues, isRadioactiveCloud, levelInfoMode, radioactiveCloudLevel, setValue, trigger, unregister]);
|
|
1471
1518
|
return /*#__PURE__*/React__default.createElement(ProductFormFieldLayout, {
|
|
1472
1519
|
title: "Levels",
|
|
1473
1520
|
sx: styles$2.containerItem
|
|
@@ -1481,7 +1528,7 @@ var Levels = function Levels(_ref) {
|
|
|
1481
1528
|
isRequired: isRequired
|
|
1482
1529
|
}
|
|
1483
1530
|
},
|
|
1484
|
-
disabled: isDisabled,
|
|
1531
|
+
disabled: isDisabled || isRadioactiveCloud,
|
|
1485
1532
|
isReadOnly: isReadOnly,
|
|
1486
1533
|
onChange: function onChange() {
|
|
1487
1534
|
// Reset default value for the level value to '' so when it rerenders it uses this empty default value
|
|
@@ -1495,8 +1542,8 @@ var Levels = function Levels(_ref) {
|
|
|
1495
1542
|
label: "At",
|
|
1496
1543
|
checked: levelInfoMode === 'AT' || levelInfoMode === 'TOPS',
|
|
1497
1544
|
"data-testid": "levels-AT",
|
|
1498
|
-
disabled: isDisabled
|
|
1499
|
-
}), levelInfoMode === 'AT' || levelInfoMode === 'TOPS' ? /*#__PURE__*/React__default.createElement(Grid, {
|
|
1545
|
+
disabled: isDisabled || isRadioactiveCloud
|
|
1546
|
+
}), (levelInfoMode === 'AT' || levelInfoMode === 'TOPS') && !isRadioactiveCloud ? /*#__PURE__*/React__default.createElement(Grid, {
|
|
1500
1547
|
item: true,
|
|
1501
1548
|
xs: 12,
|
|
1502
1549
|
container: true,
|
|
@@ -1533,6 +1580,7 @@ var Levels = function Levels(_ref) {
|
|
|
1533
1580
|
}
|
|
1534
1581
|
},
|
|
1535
1582
|
sx: styles$2.unit,
|
|
1583
|
+
size: "small",
|
|
1536
1584
|
disabled: isDisabled,
|
|
1537
1585
|
isReadOnly: isReadOnly,
|
|
1538
1586
|
defaultValue: 'FL',
|
|
@@ -1577,6 +1625,7 @@ var Levels = function Levels(_ref) {
|
|
|
1577
1625
|
}
|
|
1578
1626
|
}
|
|
1579
1627
|
},
|
|
1628
|
+
size: "small",
|
|
1580
1629
|
disabled: isDisabled,
|
|
1581
1630
|
isReadOnly: isReadOnly,
|
|
1582
1631
|
autoFocus: true
|
|
@@ -1585,7 +1634,7 @@ var Levels = function Levels(_ref) {
|
|
|
1585
1634
|
label: "Between",
|
|
1586
1635
|
checked: levelInfoMode === 'BETW' || levelInfoMode === 'BETW_SFC',
|
|
1587
1636
|
"data-testid": "levels-BETW",
|
|
1588
|
-
disabled: isDisabled
|
|
1637
|
+
disabled: isDisabled || isRadioactiveCloud
|
|
1589
1638
|
}), levelInfoMode === 'BETW' || levelInfoMode === 'BETW_SFC' ? /*#__PURE__*/React__default.createElement(React__default.Fragment, null, /*#__PURE__*/React__default.createElement(Grid, {
|
|
1590
1639
|
item: true,
|
|
1591
1640
|
xs: 12,
|
|
@@ -1613,8 +1662,9 @@ var Levels = function Levels(_ref) {
|
|
|
1613
1662
|
}
|
|
1614
1663
|
}
|
|
1615
1664
|
},
|
|
1665
|
+
size: "small",
|
|
1616
1666
|
sx: styles$2.unit,
|
|
1617
|
-
disabled: isDisabled,
|
|
1667
|
+
disabled: isDisabled || isRadioactiveCloud,
|
|
1618
1668
|
isReadOnly: isReadOnly,
|
|
1619
1669
|
defaultValue: 'FL',
|
|
1620
1670
|
onChange: function onChange() {
|
|
@@ -1631,9 +1681,11 @@ var Levels = function Levels(_ref) {
|
|
|
1631
1681
|
xs: 8,
|
|
1632
1682
|
md: 6
|
|
1633
1683
|
}, /*#__PURE__*/React__default.createElement(ReactHookFormNumberField, {
|
|
1684
|
+
value: level || '',
|
|
1634
1685
|
name: "level.value",
|
|
1635
1686
|
label: "Upper level",
|
|
1636
1687
|
sx: styles$2.levelField,
|
|
1688
|
+
size: "small",
|
|
1637
1689
|
rules: {
|
|
1638
1690
|
validate: {
|
|
1639
1691
|
isRequired: isRequired,
|
|
@@ -1658,7 +1710,7 @@ var Levels = function Levels(_ref) {
|
|
|
1658
1710
|
}
|
|
1659
1711
|
}
|
|
1660
1712
|
},
|
|
1661
|
-
disabled: isDisabled,
|
|
1713
|
+
disabled: isDisabled || isRadioactiveCloud,
|
|
1662
1714
|
isReadOnly: isReadOnly,
|
|
1663
1715
|
onChange: function onChange() {
|
|
1664
1716
|
triggerValidations(['lowerLevel.value'], getValues, trigger);
|
|
@@ -1686,7 +1738,7 @@ var Levels = function Levels(_ref) {
|
|
|
1686
1738
|
},
|
|
1687
1739
|
name: "checkedF",
|
|
1688
1740
|
color: "secondary",
|
|
1689
|
-
disabled: isDisabled
|
|
1741
|
+
disabled: isDisabled || isRadioactiveCloud
|
|
1690
1742
|
}),
|
|
1691
1743
|
"data-testid": "levels-SFC",
|
|
1692
1744
|
label: "SFC"
|
|
@@ -1708,6 +1760,7 @@ var Levels = function Levels(_ref) {
|
|
|
1708
1760
|
}
|
|
1709
1761
|
}
|
|
1710
1762
|
},
|
|
1763
|
+
size: "small",
|
|
1711
1764
|
sx: styles$2.unit,
|
|
1712
1765
|
disabled: isDisabled,
|
|
1713
1766
|
isReadOnly: isReadOnly,
|
|
@@ -1758,12 +1811,13 @@ var Levels = function Levels(_ref) {
|
|
|
1758
1811
|
}
|
|
1759
1812
|
}
|
|
1760
1813
|
},
|
|
1814
|
+
size: "small",
|
|
1761
1815
|
disabled: isDisabled,
|
|
1762
1816
|
isReadOnly: isReadOnly
|
|
1763
1817
|
}))))) : null, /*#__PURE__*/React__default.createElement(RadioButtonAndLabel, {
|
|
1764
1818
|
value: "ABV",
|
|
1765
1819
|
label: "Above",
|
|
1766
|
-
disabled: isDisabled,
|
|
1820
|
+
disabled: isDisabled || isRadioactiveCloud,
|
|
1767
1821
|
checked: levelInfoMode === 'ABV' || levelInfoMode === 'TOPS_ABV',
|
|
1768
1822
|
"data-testid": "levels-ABV"
|
|
1769
1823
|
}), levelInfoMode === 'ABV' || levelInfoMode === 'TOPS_ABV' ? /*#__PURE__*/React__default.createElement(Grid, {
|
|
@@ -1801,6 +1855,7 @@ var Levels = function Levels(_ref) {
|
|
|
1801
1855
|
isRequired: isRequired
|
|
1802
1856
|
}
|
|
1803
1857
|
},
|
|
1858
|
+
size: "small",
|
|
1804
1859
|
sx: styles$2.unit,
|
|
1805
1860
|
disabled: isDisabled,
|
|
1806
1861
|
isReadOnly: isReadOnly,
|
|
@@ -1845,6 +1900,7 @@ var Levels = function Levels(_ref) {
|
|
|
1845
1900
|
}
|
|
1846
1901
|
}
|
|
1847
1902
|
},
|
|
1903
|
+
size: "small",
|
|
1848
1904
|
disabled: isDisabled,
|
|
1849
1905
|
isReadOnly: isReadOnly,
|
|
1850
1906
|
autoFocus: true
|
|
@@ -1879,8 +1935,9 @@ var ObservationForecast = function ObservationForecast(_ref) {
|
|
|
1879
1935
|
return /*#__PURE__*/React__default.createElement(ProductFormFieldLayout, {
|
|
1880
1936
|
sx: {
|
|
1881
1937
|
paddingTop: '8px!important',
|
|
1882
|
-
'
|
|
1883
|
-
|
|
1938
|
+
'.MuiButtonBase-root.MuiRadio-root': {
|
|
1939
|
+
padding: '6px',
|
|
1940
|
+
marginLeft: '3px'
|
|
1884
1941
|
}
|
|
1885
1942
|
}
|
|
1886
1943
|
}, /*#__PURE__*/React__default.createElement(ReactHookFormRadioGroup, {
|
|
@@ -1958,7 +2015,8 @@ var ObservationForecastTime = function ObservationForecastTime(_ref) {
|
|
|
1958
2015
|
onChange: function onChange() {
|
|
1959
2016
|
return _onChange();
|
|
1960
2017
|
},
|
|
1961
|
-
sx: styles$2.helperText
|
|
2018
|
+
sx: styles$2.helperText,
|
|
2019
|
+
"data-testid": "obs-fcst-time"
|
|
1962
2020
|
})) : null;
|
|
1963
2021
|
};
|
|
1964
2022
|
|
|
@@ -2001,15 +2059,21 @@ var Phenomenon = function Phenomenon(_ref) {
|
|
|
2001
2059
|
},
|
|
2002
2060
|
disabled: isDisabled,
|
|
2003
2061
|
isReadOnly: isReadOnly,
|
|
2062
|
+
size: "small",
|
|
2004
2063
|
"data-testid": "phenomenon",
|
|
2005
2064
|
onChange: function onChange() {
|
|
2006
2065
|
if (getValues('movementType') === 'NO_VA_EXP') {
|
|
2007
2066
|
setValue('movementType', null);
|
|
2067
|
+
} else if (getValues('phenomenon') === 'RDOACT_CLD') {
|
|
2068
|
+
// By definition, phenomenon 'RDOACT_CLD'shall not ever move but stay stationary
|
|
2069
|
+
setValue('movementType', 'STATIONARY');
|
|
2070
|
+
// Also by definition, phenomenon 'RDOACT_CLD' is strictly defined to always span from surface to upper level
|
|
2071
|
+
// with no lower explicit level values defined, hence level mode shall be set to 'BETW_SFC' instead of 'BETW'.
|
|
2072
|
+
setValue('levelInfoMode', 'BETW_SFC');
|
|
2008
2073
|
}
|
|
2009
2074
|
triggerValidations(['validDateStart', 'validDateEnd'], getValues, trigger);
|
|
2010
2075
|
_onChange();
|
|
2011
|
-
}
|
|
2012
|
-
autoFocus: true
|
|
2076
|
+
}
|
|
2013
2077
|
}, Object.keys(phenomenaList).map(function (key) {
|
|
2014
2078
|
return /*#__PURE__*/React__default.createElement(MenuItem, {
|
|
2015
2079
|
value: key,
|
|
@@ -2185,6 +2249,9 @@ var Progress = function Progress(_ref) {
|
|
|
2185
2249
|
unregister('endGeometryIntersect');
|
|
2186
2250
|
}
|
|
2187
2251
|
}, [movementType, unregister]);
|
|
2252
|
+
var isSigmet = productType === 'sigmet';
|
|
2253
|
+
var isRadioactiveCloud = watch('phenomenon') === 'RDOACT_CLD';
|
|
2254
|
+
var isVolcanicCloud = watch('phenomenon') === 'VA_CLD';
|
|
2188
2255
|
return /*#__PURE__*/React__default.createElement(ProductFormFieldLayout, {
|
|
2189
2256
|
title: "Progress",
|
|
2190
2257
|
sx: styles$2.containerItem
|
|
@@ -2208,22 +2275,27 @@ var Progress = function Progress(_ref) {
|
|
|
2208
2275
|
onChangeTool(deleteTool);
|
|
2209
2276
|
}
|
|
2210
2277
|
}
|
|
2211
|
-
},
|
|
2278
|
+
}, isVolcanicCloud && /*#__PURE__*/React__default.createElement(RadioButtonAndLabel, {
|
|
2212
2279
|
value: "NO_VA_EXP",
|
|
2213
2280
|
label: "No volcanic ash expected",
|
|
2214
2281
|
disabled: isDisabled,
|
|
2215
2282
|
"data-testid": "movementType-NO_VA_EXP"
|
|
2216
|
-
}), /*#__PURE__*/React__default.createElement(RadioButtonAndLabel, {
|
|
2283
|
+
}), /*#__PURE__*/React__default.createElement(React__default.Fragment, null, /*#__PURE__*/React__default.createElement(RadioButtonAndLabel, {
|
|
2217
2284
|
value: "STATIONARY",
|
|
2218
2285
|
label: "Stationary",
|
|
2219
|
-
disabled: isDisabled,
|
|
2286
|
+
disabled: isDisabled || isRadioactiveCloud,
|
|
2220
2287
|
"data-testid": "movementType-STATIONARY"
|
|
2221
2288
|
}), /*#__PURE__*/React__default.createElement(RadioButtonAndLabel, {
|
|
2222
2289
|
value: "MOVEMENT",
|
|
2223
2290
|
label: "Movement",
|
|
2224
|
-
disabled: isDisabled,
|
|
2291
|
+
disabled: isDisabled || isRadioactiveCloud,
|
|
2225
2292
|
"data-testid": "movementType-MOVEMENT"
|
|
2226
|
-
}),
|
|
2293
|
+
}), isSigmet && isRadioactiveCloud && /*#__PURE__*/React__default.createElement(RadioButtonAndLabel, {
|
|
2294
|
+
value: "FORECAST_POSITION",
|
|
2295
|
+
label: "End position",
|
|
2296
|
+
disabled: isDisabled || isRadioactiveCloud,
|
|
2297
|
+
"data-testid": "movementType-FORECAST_POSITION"
|
|
2298
|
+
})), movementType === 'MOVEMENT' && !isRadioactiveCloud && /*#__PURE__*/React__default.createElement(React__default.Fragment, null, /*#__PURE__*/React__default.createElement(Grid, {
|
|
2227
2299
|
item: true,
|
|
2228
2300
|
xs: 12
|
|
2229
2301
|
}, /*#__PURE__*/React__default.createElement(ReactHookFormSelect, {
|
|
@@ -2232,6 +2304,7 @@ var Progress = function Progress(_ref) {
|
|
|
2232
2304
|
rules: {
|
|
2233
2305
|
validate: isRequired
|
|
2234
2306
|
},
|
|
2307
|
+
size: "small",
|
|
2235
2308
|
sx: styles$2.movement,
|
|
2236
2309
|
disabled: isDisabled,
|
|
2237
2310
|
isReadOnly: isReadOnly,
|
|
@@ -2259,6 +2332,7 @@ var Progress = function Progress(_ref) {
|
|
|
2259
2332
|
rules: {
|
|
2260
2333
|
validate: isRequired
|
|
2261
2334
|
},
|
|
2335
|
+
size: "small",
|
|
2262
2336
|
sx: styles$2.unit,
|
|
2263
2337
|
disabled: isDisabled,
|
|
2264
2338
|
isReadOnly: isReadOnly,
|
|
@@ -2304,18 +2378,19 @@ var Progress = function Progress(_ref) {
|
|
|
2304
2378
|
}
|
|
2305
2379
|
}
|
|
2306
2380
|
},
|
|
2381
|
+
size: "small",
|
|
2307
2382
|
disabled: isDisabled,
|
|
2308
2383
|
isReadOnly: isReadOnly,
|
|
2309
2384
|
"data-testid": "movement-movementSpeed",
|
|
2310
2385
|
onChange: function onChange(event) {
|
|
2311
2386
|
return event && event.stopPropagation();
|
|
2312
2387
|
}
|
|
2313
|
-
})))),
|
|
2388
|
+
})))), isSigmet && !isRadioactiveCloud && /*#__PURE__*/React__default.createElement(RadioButtonAndLabel, {
|
|
2314
2389
|
value: "FORECAST_POSITION",
|
|
2315
2390
|
label: "End position",
|
|
2316
2391
|
disabled: isDisabled,
|
|
2317
2392
|
"data-testid": "movementType-FORECAST_POSITION"
|
|
2318
|
-
})),
|
|
2393
|
+
})), isSigmet && !isRadioactiveCloud && movementType === 'FORECAST_POSITION' && /*#__PURE__*/React__default.createElement(Grid, {
|
|
2319
2394
|
item: true,
|
|
2320
2395
|
xs: 12,
|
|
2321
2396
|
"data-testid": "endGeometry",
|
|
@@ -2424,8 +2499,7 @@ var SelectFIR = function SelectFIR(_ref) {
|
|
|
2424
2499
|
onChange(changeEvent);
|
|
2425
2500
|
};
|
|
2426
2501
|
return /*#__PURE__*/React__default.createElement(ProductFormFieldLayout, {
|
|
2427
|
-
title: "Where"
|
|
2428
|
-
sx: styles$2.containerItem
|
|
2502
|
+
title: "Where"
|
|
2429
2503
|
}, /*#__PURE__*/React__default.createElement(ReactHookFormSelect, {
|
|
2430
2504
|
name: "locationIndicatorATSR",
|
|
2431
2505
|
label: isReadOnly ? 'FIR' : 'Select FIR',
|
|
@@ -2437,7 +2511,8 @@ var SelectFIR = function SelectFIR(_ref) {
|
|
|
2437
2511
|
disabled: isDisabled,
|
|
2438
2512
|
isReadOnly: isReadOnly,
|
|
2439
2513
|
defaultValue: locationIndicatorATSR,
|
|
2440
|
-
onChange: onChangeLocationATSR
|
|
2514
|
+
onChange: onChangeLocationATSR,
|
|
2515
|
+
size: "small"
|
|
2441
2516
|
}, optionsFIR.map(function (fir) {
|
|
2442
2517
|
return /*#__PURE__*/React__default.createElement(MenuItem, {
|
|
2443
2518
|
key: "".concat(fir.ATSR, "-").concat(fir.FIR),
|
|
@@ -2476,41 +2551,33 @@ var SelectFIR = function SelectFIR(_ref) {
|
|
|
2476
2551
|
* */
|
|
2477
2552
|
var Type = function Type(_ref) {
|
|
2478
2553
|
var isReadOnly = _ref.isReadOnly,
|
|
2479
|
-
isDisabled = _ref.isDisabled
|
|
2480
|
-
|
|
2481
|
-
|
|
2554
|
+
isDisabled = _ref.isDisabled,
|
|
2555
|
+
_ref$onChange = _ref.onChange,
|
|
2556
|
+
_onChange = _ref$onChange === void 0 ? function () {} : _ref$onChange;
|
|
2557
|
+
var _useFormContext = useFormContext(),
|
|
2558
|
+
getValues = _useFormContext.getValues,
|
|
2559
|
+
trigger = _useFormContext.trigger;
|
|
2560
|
+
var label = getFieldLabel('Type', isReadOnly);
|
|
2482
2561
|
return /*#__PURE__*/React__default.createElement(ProductFormFieldLayout, {
|
|
2483
|
-
title: "Type"
|
|
2484
|
-
|
|
2485
|
-
}, /*#__PURE__*/React__default.createElement(Grid, {
|
|
2486
|
-
item: true,
|
|
2487
|
-
xs: 12
|
|
2488
|
-
}, /*#__PURE__*/React__default.createElement(ReactHookFormRadioGroup, {
|
|
2562
|
+
title: "Type"
|
|
2563
|
+
}, /*#__PURE__*/React__default.createElement(ReactHookFormSelect, {
|
|
2489
2564
|
name: "type",
|
|
2490
|
-
|
|
2491
|
-
validate: {
|
|
2492
|
-
isRequired: isRequired
|
|
2493
|
-
}
|
|
2494
|
-
},
|
|
2565
|
+
label: label,
|
|
2495
2566
|
disabled: isDisabled,
|
|
2496
2567
|
isReadOnly: isReadOnly,
|
|
2497
|
-
|
|
2498
|
-
|
|
2499
|
-
|
|
2500
|
-
|
|
2501
|
-
|
|
2502
|
-
|
|
2503
|
-
|
|
2504
|
-
|
|
2505
|
-
|
|
2506
|
-
|
|
2507
|
-
|
|
2508
|
-
|
|
2509
|
-
|
|
2510
|
-
label: "Exercise",
|
|
2511
|
-
disabled: isDisabled,
|
|
2512
|
-
"data-testid": "type-EXERCISE"
|
|
2513
|
-
}))));
|
|
2568
|
+
size: "small",
|
|
2569
|
+
"data-testid": "type",
|
|
2570
|
+
onChange: function onChange() {
|
|
2571
|
+
triggerValidations(['validDateStart', 'validDateEnd'], getValues, trigger);
|
|
2572
|
+
_onChange();
|
|
2573
|
+
},
|
|
2574
|
+
autoFocus: true
|
|
2575
|
+
}, Object.keys(SigmetType).map(function (key) {
|
|
2576
|
+
return /*#__PURE__*/React__default.createElement(MenuItem, {
|
|
2577
|
+
value: key,
|
|
2578
|
+
key: key
|
|
2579
|
+
}, SigmetType[key]);
|
|
2580
|
+
})));
|
|
2514
2581
|
};
|
|
2515
2582
|
|
|
2516
2583
|
/* *
|
|
@@ -2578,7 +2645,8 @@ var ValidFrom = function ValidFrom(_ref) {
|
|
|
2578
2645
|
},
|
|
2579
2646
|
disabled: isDisabled,
|
|
2580
2647
|
isReadOnly: isReadOnly,
|
|
2581
|
-
"data-testid": "valid-from"
|
|
2648
|
+
"data-testid": "valid-from",
|
|
2649
|
+
sx: styles$2.helperText
|
|
2582
2650
|
}));
|
|
2583
2651
|
};
|
|
2584
2652
|
|
|
@@ -2643,7 +2711,8 @@ var ValidUntil = function ValidUntil(_ref) {
|
|
|
2643
2711
|
onChange: function onChange() {
|
|
2644
2712
|
triggerValidations(['validDateStart', 'observationOrForecastTime'], getValues, trigger);
|
|
2645
2713
|
_onChange();
|
|
2646
|
-
}
|
|
2714
|
+
},
|
|
2715
|
+
sx: styles$2.helperText
|
|
2647
2716
|
}));
|
|
2648
2717
|
};
|
|
2649
2718
|
|
|
@@ -2698,7 +2767,8 @@ var VolcanicFields = function VolcanicFields(_ref) {
|
|
|
2698
2767
|
disabled: isDisabled,
|
|
2699
2768
|
helperText: helperText,
|
|
2700
2769
|
upperCase: true,
|
|
2701
|
-
isReadOnly: isReadOnly
|
|
2770
|
+
isReadOnly: isReadOnly,
|
|
2771
|
+
size: "small"
|
|
2702
2772
|
})), (!isReadOnly || !!watch('vaSigmetVolcanoCoordinates.latitude')) && /*#__PURE__*/React__default.createElement(Grid, {
|
|
2703
2773
|
item: true,
|
|
2704
2774
|
xs: 6
|
|
@@ -2716,6 +2786,7 @@ var VolcanicFields = function VolcanicFields(_ref) {
|
|
|
2716
2786
|
}
|
|
2717
2787
|
}
|
|
2718
2788
|
},
|
|
2789
|
+
size: "small",
|
|
2719
2790
|
sx: Object.assign({}, styles$2.latitude),
|
|
2720
2791
|
disabled: isDisabled,
|
|
2721
2792
|
onChange: function onChange() {
|
|
@@ -2730,6 +2801,8 @@ var VolcanicFields = function VolcanicFields(_ref) {
|
|
|
2730
2801
|
"data-testid": "vaSigmetVolcanoCoordinates.longitude",
|
|
2731
2802
|
label: "Longitude",
|
|
2732
2803
|
inputMode: "decimal",
|
|
2804
|
+
size: "small",
|
|
2805
|
+
sx: Object.assign({}, styles$2.latitude),
|
|
2733
2806
|
rules: {
|
|
2734
2807
|
required: true,
|
|
2735
2808
|
validate: {
|
|
@@ -2847,6 +2920,7 @@ var SurfaceVisibility = function SurfaceVisibility(_ref) {
|
|
|
2847
2920
|
}
|
|
2848
2921
|
}
|
|
2849
2922
|
},
|
|
2923
|
+
size: "small",
|
|
2850
2924
|
disabled: isDisabled,
|
|
2851
2925
|
isReadOnly: isReadOnly
|
|
2852
2926
|
})), /*#__PURE__*/React__default.createElement(Grid, {
|
|
@@ -2866,7 +2940,8 @@ var SurfaceVisibility = function SurfaceVisibility(_ref) {
|
|
|
2866
2940
|
onChange: function onChange(event) {
|
|
2867
2941
|
event.stopPropagation();
|
|
2868
2942
|
_onChange();
|
|
2869
|
-
}
|
|
2943
|
+
},
|
|
2944
|
+
size: "small"
|
|
2870
2945
|
}, Object.keys(VisibilityCause).map(function (key) {
|
|
2871
2946
|
return /*#__PURE__*/React__default.createElement(MenuItem, {
|
|
2872
2947
|
value: key,
|
|
@@ -2965,6 +3040,7 @@ var SurfaceWind = function SurfaceWind(_ref) {
|
|
|
2965
3040
|
}
|
|
2966
3041
|
}
|
|
2967
3042
|
},
|
|
3043
|
+
size: "small",
|
|
2968
3044
|
disabled: isDisabled,
|
|
2969
3045
|
isReadOnly: isReadOnly,
|
|
2970
3046
|
"data-testid": "surfaceWind-windDirection"
|
|
@@ -2983,6 +3059,7 @@ var SurfaceWind = function SurfaceWind(_ref) {
|
|
|
2983
3059
|
isRequired: isRequired
|
|
2984
3060
|
}
|
|
2985
3061
|
},
|
|
3062
|
+
size: "small",
|
|
2986
3063
|
sx: styles$2.unit,
|
|
2987
3064
|
disabled: isDisabled,
|
|
2988
3065
|
isReadOnly: isReadOnly,
|
|
@@ -3021,6 +3098,7 @@ var SurfaceWind = function SurfaceWind(_ref) {
|
|
|
3021
3098
|
}
|
|
3022
3099
|
}
|
|
3023
3100
|
},
|
|
3101
|
+
size: "small",
|
|
3024
3102
|
disabled: isDisabled,
|
|
3025
3103
|
isReadOnly: isReadOnly,
|
|
3026
3104
|
"data-testid": "surfaceWind-windSpeed"
|
|
@@ -3185,6 +3263,7 @@ var CloudLevels = function CloudLevels(_ref) {
|
|
|
3185
3263
|
isRequired: isRequired
|
|
3186
3264
|
}
|
|
3187
3265
|
},
|
|
3266
|
+
size: "small",
|
|
3188
3267
|
sx: styles$2.unit,
|
|
3189
3268
|
disabled: isDisabled,
|
|
3190
3269
|
isReadOnly: isReadOnly,
|
|
@@ -3207,6 +3286,7 @@ var CloudLevels = function CloudLevels(_ref) {
|
|
|
3207
3286
|
name: "cloudLevel.value",
|
|
3208
3287
|
label: "Upper level",
|
|
3209
3288
|
"data-testid": "cloudLevel-value",
|
|
3289
|
+
size: "small",
|
|
3210
3290
|
sx: styles$2.levelField,
|
|
3211
3291
|
rules: {
|
|
3212
3292
|
validate: {
|
|
@@ -3289,6 +3369,7 @@ var CloudLevels = function CloudLevels(_ref) {
|
|
|
3289
3369
|
isRequired: isRequired
|
|
3290
3370
|
}
|
|
3291
3371
|
},
|
|
3372
|
+
size: "small",
|
|
3292
3373
|
sx: styles$2.unit,
|
|
3293
3374
|
disabled: isDisabled,
|
|
3294
3375
|
isReadOnly: isReadOnly,
|
|
@@ -3338,6 +3419,7 @@ var CloudLevels = function CloudLevels(_ref) {
|
|
|
3338
3419
|
}
|
|
3339
3420
|
}
|
|
3340
3421
|
},
|
|
3422
|
+
size: "small",
|
|
3341
3423
|
disabled: isDisabled,
|
|
3342
3424
|
isReadOnly: isReadOnly
|
|
3343
3425
|
})))))));
|
|
@@ -3534,6 +3616,12 @@ var IssuedAt = function IssuedAt(_ref) {
|
|
|
3534
3616
|
var date = _ref.date,
|
|
3535
3617
|
isReadOnly = _ref.isReadOnly;
|
|
3536
3618
|
return /*#__PURE__*/React__default.createElement(ProductFormFieldLayout, {
|
|
3619
|
+
sx: {
|
|
3620
|
+
paddingTop: 0,
|
|
3621
|
+
'+ .MuiGrid-item': {
|
|
3622
|
+
paddingTop: 0
|
|
3623
|
+
}
|
|
3624
|
+
},
|
|
3537
3625
|
title: "Issued at"
|
|
3538
3626
|
}, /*#__PURE__*/React__default.createElement(Grid, {
|
|
3539
3627
|
item: true,
|
|
@@ -8301,8 +8389,28 @@ var SigmetForm = function SigmetForm(_ref) {
|
|
|
8301
8389
|
return /*#__PURE__*/React__default.createElement(Grid, {
|
|
8302
8390
|
container: true,
|
|
8303
8391
|
direction: "column",
|
|
8304
|
-
spacing:
|
|
8305
|
-
|
|
8392
|
+
spacing: 2,
|
|
8393
|
+
sx: {
|
|
8394
|
+
'.MuiSelect-select.MuiInputBase-input.MuiFilledInput-input': {
|
|
8395
|
+
paddingTop: '17px',
|
|
8396
|
+
paddingBottom: '0px'
|
|
8397
|
+
},
|
|
8398
|
+
'.MuiInputBase-input.MuiFilledInput-input': {
|
|
8399
|
+
paddingTop: '15px',
|
|
8400
|
+
paddingBottom: '2px'
|
|
8401
|
+
},
|
|
8402
|
+
'+ .MuiGrid-item': {
|
|
8403
|
+
paddingTop: '16px'
|
|
8404
|
+
},
|
|
8405
|
+
'.MuiFormHelperText-root': {
|
|
8406
|
+
lineHeight: '1.33em'
|
|
8407
|
+
}
|
|
8408
|
+
}
|
|
8409
|
+
}, /*#__PURE__*/React__default.createElement(Type, {
|
|
8410
|
+
isDisabled: isDisabled,
|
|
8411
|
+
isReadOnly: isReadOnly,
|
|
8412
|
+
onChange: onChangeForm
|
|
8413
|
+
}), !isCancelSigmet && /*#__PURE__*/React__default.createElement(Phenomenon, {
|
|
8306
8414
|
productType: "sigmet",
|
|
8307
8415
|
isDisabled: isDisabled,
|
|
8308
8416
|
isReadOnly: isReadOnly,
|
|
@@ -8383,10 +8491,7 @@ var SigmetForm = function SigmetForm(_ref) {
|
|
|
8383
8491
|
name: "validDateEndOfSigmetToCancel"
|
|
8384
8492
|
}), /*#__PURE__*/React__default.createElement(ReactHookFormHiddenInput, {
|
|
8385
8493
|
name: "validDateStartOfSigmetToCancel"
|
|
8386
|
-
})))
|
|
8387
|
-
isDisabled: isDisabled,
|
|
8388
|
-
isReadOnly: isReadOnly
|
|
8389
|
-
}));
|
|
8494
|
+
}))));
|
|
8390
8495
|
};
|
|
8391
8496
|
if (!showMap) {
|
|
8392
8497
|
return renderForm();
|
|
@@ -8554,8 +8659,28 @@ var AirmetForm = function AirmetForm(_ref) {
|
|
|
8554
8659
|
return /*#__PURE__*/React__default.createElement(Grid, {
|
|
8555
8660
|
container: true,
|
|
8556
8661
|
direction: "column",
|
|
8557
|
-
spacing:
|
|
8558
|
-
|
|
8662
|
+
spacing: 2,
|
|
8663
|
+
sx: {
|
|
8664
|
+
'.MuiSelect-select.MuiInputBase-input.MuiFilledInput-input': {
|
|
8665
|
+
paddingTop: '17px',
|
|
8666
|
+
paddingBottom: '0px'
|
|
8667
|
+
},
|
|
8668
|
+
'.MuiInputBase-input.MuiFilledInput-input': {
|
|
8669
|
+
paddingTop: '15px',
|
|
8670
|
+
paddingBottom: '2px'
|
|
8671
|
+
},
|
|
8672
|
+
'+ .MuiGrid-item': {
|
|
8673
|
+
paddingTop: '16px'
|
|
8674
|
+
},
|
|
8675
|
+
'.MuiFormHelperText-root': {
|
|
8676
|
+
lineHeight: '1.33em'
|
|
8677
|
+
}
|
|
8678
|
+
}
|
|
8679
|
+
}, /*#__PURE__*/React__default.createElement(Type, {
|
|
8680
|
+
isDisabled: isDisabled,
|
|
8681
|
+
isReadOnly: isReadOnly,
|
|
8682
|
+
onChange: onChangeForm
|
|
8683
|
+
}), !isCancelAirmet && /*#__PURE__*/React__default.createElement(Phenomenon, {
|
|
8559
8684
|
productType: "airmet",
|
|
8560
8685
|
isDisabled: isDisabled,
|
|
8561
8686
|
isReadOnly: isReadOnly,
|
|
@@ -8635,10 +8760,7 @@ var AirmetForm = function AirmetForm(_ref) {
|
|
|
8635
8760
|
name: "validDateEndOfAirmetToCancel"
|
|
8636
8761
|
}), /*#__PURE__*/React__default.createElement(ReactHookFormHiddenInput, {
|
|
8637
8762
|
name: "validDateStartOfAirmetToCancel"
|
|
8638
|
-
})))
|
|
8639
|
-
isDisabled: isDisabled,
|
|
8640
|
-
isReadOnly: isReadOnly
|
|
8641
|
-
}));
|
|
8763
|
+
}))));
|
|
8642
8764
|
};
|
|
8643
8765
|
if (!showMap) {
|
|
8644
8766
|
return renderForm();
|
|
@@ -15445,7 +15567,7 @@ var fakeSigmetList = [{
|
|
|
15445
15567
|
locationIndicatorATSR: 'EHAA',
|
|
15446
15568
|
locationIndicatorMWO: 'EHDB',
|
|
15447
15569
|
isObservationOrForecast: 'OBS',
|
|
15448
|
-
observationOrForecastTime: dateUtils.dateToString(dateUtils.
|
|
15570
|
+
observationOrForecastTime: dateUtils.dateToString(dateUtils.sub(dateUtils.utc(), {
|
|
15449
15571
|
hours: 1
|
|
15450
15572
|
})),
|
|
15451
15573
|
movementType: 'STATIONARY',
|
|
@@ -16848,4 +16970,4 @@ var AirmetComponentsLookUp = function AirmetComponentsLookUp(payload, _ref) {
|
|
|
16848
16970
|
}
|
|
16849
16971
|
};
|
|
16850
16972
|
|
|
16851
|
-
export { AirmetComponentsLookUp, AirmetForm, AirmetPhenomena, CloudLevelUnits, ContentDialog, Direction, DownloadSigmetAirmetConfigWrapper, LevelUnits, MapViewGeoJson, MetInfoWrapper, MovementUnit, ProductList, ProductListRow, ProductStatusDescription, SigmetComponentsLookUp, SigmetForm, SigmetPhenomena, StartOrEndDrawing, VisibilityCause, WindUnit, airmetConfig, createApi$1 as createApi, createApi as createFakeApi, isInstanceOfAirmet, isInstanceOfCancelAirmet, isInstanceOfCancelSigmet, isInstanceOfCancelSigmetOrAirmet, isInstanceOfSigmet, isInstanceOfSigmetOrAirmet, sigmetConfig };
|
|
16973
|
+
export { AirmetComponentsLookUp, AirmetForm, AirmetPhenomena, CloudLevelUnits, ContentDialog, Direction, DownloadSigmetAirmetConfigWrapper, LevelUnits, MapViewGeoJson, MetInfoWrapper, MovementUnit, ProductList, ProductListRow, ProductStatusDescription, SigmetComponentsLookUp, SigmetForm, SigmetPhenomena, SigmetType, StartOrEndDrawing, VisibilityCause, WindUnit, airmetConfig, createApi$1 as createApi, createApi as createFakeApi, isInstanceOfAirmet, isInstanceOfCancelAirmet, isInstanceOfCancelSigmet, isInstanceOfCancelSigmetOrAirmet, isInstanceOfSigmet, isInstanceOfSigmetOrAirmet, sigmetConfig };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@opengeoweb/sigmet-airmet",
|
|
3
|
-
"version": "8.
|
|
3
|
+
"version": "8.4.1",
|
|
4
4
|
"description": "GeoWeb Sigmet/Airmet library for the opengeoweb project",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"repository": {
|
|
@@ -13,15 +13,15 @@
|
|
|
13
13
|
"dependencies": {
|
|
14
14
|
"@mui/material": "5.12.0",
|
|
15
15
|
"@mui/system": "5.14.14",
|
|
16
|
-
"@opengeoweb/api": "8.
|
|
17
|
-
"@opengeoweb/authentication": "8.
|
|
18
|
-
"@opengeoweb/core": "8.
|
|
19
|
-
"@opengeoweb/form-fields": "8.
|
|
20
|
-
"@opengeoweb/shared": "8.
|
|
21
|
-
"@opengeoweb/store": "8.
|
|
22
|
-
"@opengeoweb/theme": "8.
|
|
23
|
-
"@opengeoweb/webmap": "8.
|
|
24
|
-
"@opengeoweb/webmap-react": "8.
|
|
16
|
+
"@opengeoweb/api": "8.4.1",
|
|
17
|
+
"@opengeoweb/authentication": "8.4.1",
|
|
18
|
+
"@opengeoweb/core": "8.4.1",
|
|
19
|
+
"@opengeoweb/form-fields": "8.4.1",
|
|
20
|
+
"@opengeoweb/shared": "8.4.1",
|
|
21
|
+
"@opengeoweb/store": "8.4.1",
|
|
22
|
+
"@opengeoweb/theme": "8.4.1",
|
|
23
|
+
"@opengeoweb/webmap": "8.4.1",
|
|
24
|
+
"@opengeoweb/webmap-react": "8.4.1",
|
|
25
25
|
"@redux-eggs/redux-toolkit": "2.2.0",
|
|
26
26
|
"@redux-eggs/saga-extension": "2.2.0",
|
|
27
27
|
"@reduxjs/toolkit": "1.9.7",
|
|
@@ -11,6 +11,20 @@ export declare const styles: {
|
|
|
11
11
|
' .MuiTypography-subtitle1': {
|
|
12
12
|
marginTop: number;
|
|
13
13
|
};
|
|
14
|
+
paddingTop: string;
|
|
15
|
+
'+ .MuiGrid-item': {
|
|
16
|
+
paddingTop: number;
|
|
17
|
+
};
|
|
18
|
+
'.MuiButtonBase-root.MuiRadio-root': {
|
|
19
|
+
padding: string;
|
|
20
|
+
marginLeft: string;
|
|
21
|
+
};
|
|
22
|
+
'.MuiFormControl-root.MuiTextField-root': {
|
|
23
|
+
marginBottom: number;
|
|
24
|
+
};
|
|
25
|
+
'.MuiGrid-root': {
|
|
26
|
+
alignItems: string;
|
|
27
|
+
};
|
|
14
28
|
};
|
|
15
29
|
volcanicField: {
|
|
16
30
|
marginBottom: number;
|
|
@@ -29,6 +43,9 @@ export declare const styles: {
|
|
|
29
43
|
};
|
|
30
44
|
latitude: {
|
|
31
45
|
width: string;
|
|
46
|
+
'.MuiFormControl-root.MuiTextField-root': {
|
|
47
|
+
margin: number;
|
|
48
|
+
};
|
|
32
49
|
};
|
|
33
50
|
unit: {
|
|
34
51
|
width: string;
|
|
@@ -47,12 +64,25 @@ export declare const styles: {
|
|
|
47
64
|
};
|
|
48
65
|
helperText: {
|
|
49
66
|
' .MuiFormHelperText-root': {
|
|
67
|
+
top: string;
|
|
50
68
|
position: string;
|
|
51
|
-
|
|
69
|
+
lineHeight: string;
|
|
52
70
|
'&.Mui-error': {
|
|
53
71
|
top: string;
|
|
54
72
|
position: string;
|
|
55
73
|
};
|
|
56
74
|
};
|
|
75
|
+
'.MuiFormLabel-root.MuiInputLabel-root': {
|
|
76
|
+
top: number;
|
|
77
|
+
lineHeight: string;
|
|
78
|
+
};
|
|
79
|
+
'.MuiSvgIcon-root': {
|
|
80
|
+
width: string;
|
|
81
|
+
height: string;
|
|
82
|
+
};
|
|
83
|
+
'.MuiButtonBase-root.MuiIconButton-root': {
|
|
84
|
+
padding: string;
|
|
85
|
+
marginLeft: string;
|
|
86
|
+
};
|
|
57
87
|
};
|
|
58
88
|
};
|
package/src/lib/types.d.ts
CHANGED
|
@@ -1,6 +1,14 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
2
|
import { mapTypes } from '@opengeoweb/store';
|
|
3
3
|
export type ProductType = 'sigmet' | 'airmet';
|
|
4
|
+
/**
|
|
5
|
+
* The possible type for the sigmet
|
|
6
|
+
*/
|
|
7
|
+
export declare enum SigmetType {
|
|
8
|
+
'NORMAL' = "Normal",
|
|
9
|
+
'TEST' = "Test",
|
|
10
|
+
'EXERCISE' = "Exercise"
|
|
11
|
+
}
|
|
4
12
|
/**
|
|
5
13
|
* The possible phenomena for the sigmet
|
|
6
14
|
*/
|