@opengeoweb/taf 4.12.0 → 4.13.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.
Files changed (125) hide show
  1. package/README.md +0 -0
  2. package/index.d.ts +0 -0
  3. package/index.esm.js +219 -138
  4. package/index.umd.js +214 -131
  5. package/lib/TafDemo.stories.d.ts +0 -0
  6. package/lib/components/ComponentsLookUp/ComponentsLookUp.d.ts +0 -0
  7. package/lib/components/ComponentsLookUp/ComponentsLookUp.spec.d.ts +0 -0
  8. package/lib/components/ComponentsLookUp/index.d.ts +0 -0
  9. package/lib/components/IssuesPane/IssuesButton.d.ts +0 -0
  10. package/lib/components/IssuesPane/IssuesButton.spec.d.ts +0 -0
  11. package/lib/components/IssuesPane/IssuesPane.d.ts +0 -0
  12. package/lib/components/IssuesPane/IssuesPane.spec.d.ts +0 -0
  13. package/lib/components/IssuesPane/IssuesPane.stories.d.ts +0 -0
  14. package/lib/components/IssuesPane/IssuesPaneWrapper.d.ts +0 -0
  15. package/lib/components/IssuesPane/IssuesPaneWrapper.spec.d.ts +0 -0
  16. package/lib/components/IssuesPane/index.d.ts +0 -0
  17. package/lib/components/IssuesPane/types.d.ts +0 -0
  18. package/lib/components/IssuesPane/utils.d.ts +0 -0
  19. package/lib/components/IssuesPane/utils.spec.d.ts +0 -0
  20. package/lib/components/Providers/Providers.d.ts +0 -0
  21. package/lib/components/Providers/index.d.ts +0 -0
  22. package/lib/components/ResponsiveWrapper/ResponsiveWrapper.d.ts +4 -0
  23. package/lib/components/ResponsiveWrapper/ResponsiveWrapper.spec.d.ts +1 -0
  24. package/lib/components/Spinner/Spinner.d.ts +0 -0
  25. package/lib/components/Spinner/Spinner.spec.d.ts +0 -0
  26. package/lib/components/Spinner/Spinner.stories.d.ts +0 -0
  27. package/lib/components/StatusIcon/StatusIcon.d.ts +0 -0
  28. package/lib/components/StatusIcon/StatusIcon.spec.d.ts +0 -0
  29. package/lib/components/SwitchButton/SwitchButton.d.ts +0 -0
  30. package/lib/components/SwitchButton/SwitchButton.spec.d.ts +0 -0
  31. package/lib/components/SwitchButton/index.d.ts +0 -0
  32. package/lib/components/TabPanel/TabPanel.d.ts +0 -0
  33. package/lib/components/TabPanel/TabPanel.spec.d.ts +0 -0
  34. package/lib/components/TabPanel/index.d.ts +0 -0
  35. package/lib/components/TafAvatar/TafAvatar.d.ts +0 -0
  36. package/lib/components/TafAvatar/index.d.ts +0 -0
  37. package/lib/components/TafForm/TafForm.d.ts +0 -0
  38. package/lib/components/TafForm/TafForm.spec.d.ts +0 -0
  39. package/lib/components/TafForm/TafForm.statusChanges.spec.d.ts +0 -0
  40. package/lib/components/TafForm/TafForm.stories.d.ts +0 -0
  41. package/lib/components/TafForm/TafFormButtons/TafFormButtons.d.ts +0 -0
  42. package/lib/components/TafForm/TafFormButtons/TafFormButtons.spec.d.ts +0 -0
  43. package/lib/components/TafForm/TafFormButtons/TafFormOptionsButton.d.ts +0 -0
  44. package/lib/components/TafForm/TafFormButtons/TafFormOptionsButton.spec.d.ts +0 -0
  45. package/lib/components/TafForm/TafFormRow/DragHandle.d.ts +0 -0
  46. package/lib/components/TafForm/TafFormRow/DragHandle.spec.d.ts +0 -0
  47. package/lib/components/TafForm/TafFormRow/TafFormRow.d.ts +0 -0
  48. package/lib/components/TafForm/TafFormRow/TafFormRow.spec.d.ts +0 -0
  49. package/lib/components/TafForm/TafFormRow/TafFormTextField.d.ts +5 -1
  50. package/lib/components/TafForm/TafFormRow/TafFormTextField.spec.d.ts +0 -0
  51. package/lib/components/TafForm/TafFormRow/types.d.ts +0 -0
  52. package/lib/components/TafForm/TafFormRow/validations/change.d.ts +0 -0
  53. package/lib/components/TafForm/TafFormRow/validations/change.spec.d.ts +0 -0
  54. package/lib/components/TafForm/TafFormRow/validations/clouds.d.ts +3 -3
  55. package/lib/components/TafForm/TafFormRow/validations/clouds.spec.d.ts +0 -0
  56. package/lib/components/TafForm/TafFormRow/validations/probability.d.ts +0 -0
  57. package/lib/components/TafForm/TafFormRow/validations/probability.spec.d.ts +0 -0
  58. package/lib/components/TafForm/TafFormRow/validations/utils.d.ts +0 -0
  59. package/lib/components/TafForm/TafFormRow/validations/utils.spec.d.ts +0 -0
  60. package/lib/components/TafForm/TafFormRow/validations/validField.d.ts +0 -0
  61. package/lib/components/TafForm/TafFormRow/validations/validField.spec.d.ts +0 -0
  62. package/lib/components/TafForm/TafFormRow/validations/visibility.d.ts +0 -0
  63. package/lib/components/TafForm/TafFormRow/validations/visibility.spec.d.ts +0 -0
  64. package/lib/components/TafForm/TafFormRow/validations/weather.d.ts +3 -3
  65. package/lib/components/TafForm/TafFormRow/validations/weather.spec.d.ts +0 -0
  66. package/lib/components/TafForm/TafFormRow/validations/wind.d.ts +0 -0
  67. package/lib/components/TafForm/TafFormRow/validations/wind.spec.d.ts +0 -0
  68. package/lib/components/TafForm/index.d.ts +0 -0
  69. package/lib/components/TafForm/utils.d.ts +0 -0
  70. package/lib/components/TafForm/utils.spec.d.ts +0 -0
  71. package/lib/components/TafHeader/TafHeader.d.ts +0 -0
  72. package/lib/components/TafHeader/TafHeader.spec.d.ts +0 -0
  73. package/lib/components/TafLayout/LastUpdateTime/LastUpdateTime.d.ts +0 -0
  74. package/lib/components/TafLayout/LastUpdateTime/LastUpdateTime.spec.d.ts +0 -0
  75. package/lib/components/TafLayout/LastUpdateTime/LastUpdateTime.stories.d.ts +0 -0
  76. package/lib/components/TafLayout/LastUpdateTime/index.d.ts +0 -0
  77. package/lib/components/TafLayout/LocationTabs/LocationTabs.d.ts +0 -0
  78. package/lib/components/TafLayout/LocationTabs/LocationTabs.spec.d.ts +0 -0
  79. package/lib/components/TafLayout/LocationTabs/LocationTabs.stories.d.ts +0 -0
  80. package/lib/components/TafLayout/LocationTabs/index.d.ts +0 -0
  81. package/lib/components/TafLayout/TacOverview/AdverseWeatherTacMessage.d.ts +0 -0
  82. package/lib/components/TafLayout/TacOverview/AdverseWeatherTacMessage.spec.d.ts +0 -0
  83. package/lib/components/TafLayout/TacOverview/AdverseWeatherTacMessage.stories.d.ts +0 -0
  84. package/lib/components/TafLayout/TacOverview/ExportButton.d.ts +0 -0
  85. package/lib/components/TafLayout/TacOverview/ExportButton.spec.d.ts +0 -0
  86. package/lib/components/TafLayout/TacOverview/TacContainer.d.ts +0 -0
  87. package/lib/components/TafLayout/TacOverview/TacContainer.spec.d.ts +0 -0
  88. package/lib/components/TafLayout/TacOverview/TacOverview.d.ts +0 -0
  89. package/lib/components/TafLayout/TacOverview/TacOverview.spec.d.ts +0 -0
  90. package/lib/components/TafLayout/TacOverview/TacOverview.stories.d.ts +0 -0
  91. package/lib/components/TafLayout/TacOverview/TacOverviewMobile.d.ts +0 -0
  92. package/lib/components/TafLayout/TacOverview/TacOverviewMobile.spec.d.ts +0 -0
  93. package/lib/components/TafLayout/TacOverview/TacOverviewMobile.stories.d.ts +0 -0
  94. package/lib/components/TafLayout/TacOverview/index.d.ts +0 -0
  95. package/lib/components/TafLayout/TafLayout.d.ts +0 -0
  96. package/lib/components/TafLayout/TafLayout.spec.d.ts +0 -0
  97. package/lib/components/TafLayout/TafLayout.stories.d.ts +0 -0
  98. package/lib/components/TafLayout/TafPanel/TafPanel.d.ts +0 -0
  99. package/lib/components/TafLayout/TafPanel/TafPanel.spec.d.ts +0 -0
  100. package/lib/components/TafLayout/TafPanel/TafPanel.stories.d.ts +0 -0
  101. package/lib/components/TafLayout/TafPanel/index.d.ts +0 -0
  102. package/lib/components/TafLayout/TopTabs/TopTabs.d.ts +0 -0
  103. package/lib/components/TafLayout/TopTabs/TopTabs.spec.d.ts +0 -0
  104. package/lib/components/TafLayout/TopTabs/TopTabs.stories.d.ts +0 -0
  105. package/lib/components/TafLayout/TopTabs/index.d.ts +0 -0
  106. package/lib/components/TafLayout/utils.d.ts +0 -0
  107. package/lib/components/TafLayout/utils.spec.d.ts +0 -0
  108. package/lib/components/TafModule/TafModule.d.ts +0 -0
  109. package/lib/components/TafModule/TafModule.spec.d.ts +0 -0
  110. package/lib/components/TafModule/TafModule.stories.d.ts +0 -0
  111. package/lib/components/TafModule/TafModuleProvider.d.ts +0 -0
  112. package/lib/components/TafModule/index.d.ts +0 -0
  113. package/lib/components/TafWrapper/TafWrapper.d.ts +0 -0
  114. package/lib/components/TafWrapper/TafWrapper.spec.d.ts +0 -0
  115. package/lib/components/TafWrapper/index.d.ts +0 -0
  116. package/lib/storyshots/Storyshots.spec.d.ts +0 -0
  117. package/lib/types.d.ts +0 -0
  118. package/lib/utils/__mocks__/api.d.ts +0 -0
  119. package/lib/utils/api.d.ts +0 -0
  120. package/lib/utils/api.spec.d.ts +0 -0
  121. package/lib/utils/fakeApi.d.ts +0 -0
  122. package/lib/utils/fakeApi.spec.d.ts +0 -0
  123. package/lib/utils/mockdata/fakeTafList.d.ts +0 -0
  124. package/lib/utils/weatherPhenomena.d.ts +0 -0
  125. package/package.json +10 -9
package/README.md CHANGED
File without changes
package/index.d.ts CHANGED
File without changes
package/index.esm.js CHANGED
@@ -7,12 +7,13 @@ import { ReactSortable } from 'react-sortablejs';
7
7
  import Sortable from 'sortablejs';
8
8
  import { useAuthenticationContext } from '@opengeoweb/authentication';
9
9
  import { getDeepProperty, ReactHookFormHiddenInput, ReactHookFormProvider } from '@opengeoweb/form-fields';
10
- import { HIDDEN_INPUT_HELPER_IS_DRAFT, useIsMounted, CustomTooltip, ToolContainerDraggable, Avatar, getInitials, ToggleMenu, useConfirmationDialog, useDraftFormHelpers, usePreventBrowserClose, ToolButton, ToolHeader, AlertBanner, getErrorMessage as getErrorMessage$1, getWarningMessage, ConfirmationServiceProvider, usePoller, ErrorBoundary } from '@opengeoweb/shared';
10
+ import { HIDDEN_INPUT_HELPER_IS_DRAFT, useIsMounted, CustomTooltip, ToolContainerDraggable, Avatar, getInitials, IS_JEST, ToggleMenu, useConfirmationDialog, useDraftFormHelpers, usePreventBrowserClose, ToolButton, ToolHeader, AlertBanner, getErrorMessage as getErrorMessage$1, getWarningMessage, ConfirmationServiceProvider, usePoller, ErrorBoundary } from '@opengeoweb/shared';
11
11
  import { snackbarActions } from '@opengeoweb/core';
12
12
  import moment from 'moment';
13
13
  import { isEqual } from 'lodash';
14
14
  import { DragHandle as DragHandle$1, ThumbsUp, Add, Delete, Close, Clock, Cancel, Success, Edit, Export, ListItem, Cached } from '@opengeoweb/theme';
15
15
  import ReactDOM from 'react-dom';
16
+ import { useTheme } from '@emotion/react';
16
17
  import { useApiContext, createApiInstance, createFakeApiInstance, ApiProvider } from '@opengeoweb/api';
17
18
  import LinearProgress from '@mui/material/LinearProgress';
18
19
  import Box$1 from '@mui/material/Box';
@@ -322,8 +323,34 @@ var TafFormButtons = function TafFormButtons(_ref2) {
322
323
  * See the License for the specific language governing permissions and
323
324
  * limitations under the License.
324
325
  *
325
- * Copyright 2021 - Koninklijk Nederlands Meteorologisch Instituut (KNMI)
326
- * Copyright 2021 - Finnish Meteorological Institute (FMI)
326
+ * Copyright 2023 - Koninklijk Nederlands Meteorologisch Instituut (KNMI)
327
+ * Copyright 2023 - Finnish Meteorological Institute (FMI)
328
+ * */
329
+ var prependZeroes = function prependZeroes(value, totalDigits) {
330
+ var valueAsString = value.toString();
331
+ return _toConsumableArray(Array(totalDigits - valueAsString.length)).reduce(function (newVal) {
332
+ return "0".concat(newVal);
333
+ }, valueAsString);
334
+ };
335
+ var getFieldValue = function getFieldValue(fieldValue) {
336
+ return fieldValue === null || fieldValue === void 0 ? void 0 : fieldValue.trim().toUpperCase();
337
+ };
338
+
339
+ /* *
340
+ * Licensed under the Apache License, Version 2.0 (the "License");
341
+ * you may not use this file except in compliance with the License.
342
+ * You may obtain a copy of the License at
343
+ *
344
+ * http://www.apache.org/licenses/LICENSE-2.0
345
+ *
346
+ * Unless required by applicable law or agreed to in writing, software
347
+ * distributed under the License is distributed on an "AS IS" BASIS,
348
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
349
+ * See the License for the specific language governing permissions and
350
+ * limitations under the License.
351
+ *
352
+ * Copyright 2023 - Koninklijk Nederlands Meteorologisch Instituut (KNMI)
353
+ * Copyright 2023 - Finnish Meteorological Institute (FMI)
327
354
  * */
328
355
  var FORMAT_DAYS_HOURS = 'DDHH';
329
356
  var FORMAT_DAYS_HOURS_MINUTES = 'DDHHmm'; // formatters
@@ -457,7 +484,7 @@ var validateIsValidDates = function validateIsValidDates(value, tafStart, tafEnd
457
484
 
458
485
 
459
486
  var validateValidField = function validateValidField(value, tafStart, tafEnd) {
460
- var trimmedValue = value.trim();
487
+ var trimmedValue = getFieldValue(value);
461
488
 
462
489
  if (!trimmedValue.length) {
463
490
  return true;
@@ -480,9 +507,9 @@ var validateValidField = function validateValidField(value, tafStart, tafEnd) {
480
507
  return true;
481
508
  };
482
509
  var validateValidChangeGroupInterField = function validateValidChangeGroupInterField(value, valueChange, valueProb, tafStart, tafEnd) {
483
- var trimmedValue = value.trim();
484
- var trimmedValueChange = valueChange.trim();
485
- var trimmedValueProb = valueProb.trim();
510
+ var trimmedValue = getFieldValue(value);
511
+ var trimmedValueChange = getFieldValue(valueChange);
512
+ var trimmedValueProb = getFieldValue(valueProb);
486
513
 
487
514
  if (!trimmedValue.length) {
488
515
  return true;
@@ -532,16 +559,12 @@ var invalidPreviousChangeGroupOrderMessage = "When valid times are equal, the ch
532
559
  var invalidPreviousChangeGroupHasSameValue = "When valid times are equal, probability/change can't have the same value as previous row value";
533
560
  var validatePreviousChangeGroup = function validatePreviousChangeGroup(currentChangeGroup, previousChangeGroup, tafStart, tafEnd) {
534
561
  // extract the needed values from changeGroups
535
- var valid = currentChangeGroup.valid,
536
- _currentChangeGroup$c = currentChangeGroup.change,
537
- change = _currentChangeGroup$c === void 0 ? '' : _currentChangeGroup$c,
538
- _currentChangeGroup$p = currentChangeGroup.probability,
539
- probability = _currentChangeGroup$p === void 0 ? '' : _currentChangeGroup$p;
540
- var previousValid = previousChangeGroup.valid,
541
- _previousChangeGroup$ = previousChangeGroup.change,
542
- previousChange = _previousChangeGroup$ === void 0 ? '' : _previousChangeGroup$,
543
- _previousChangeGroup$2 = previousChangeGroup.probability,
544
- previousProbability = _previousChangeGroup$2 === void 0 ? '' : _previousChangeGroup$2; // get the parsed values
562
+ var valid = getFieldValue(currentChangeGroup.valid);
563
+ var change = getFieldValue(currentChangeGroup.change || '');
564
+ var probability = getFieldValue(currentChangeGroup.probability || '');
565
+ var previousValid = getFieldValue(previousChangeGroup.valid);
566
+ var previousChange = getFieldValue(previousChangeGroup.change || '');
567
+ var previousProbability = getFieldValue(previousChangeGroup.probability || ''); // get the parsed values
545
568
 
546
569
  var validValue = parseValidToObject(valid, tafStart, tafEnd);
547
570
  var previousValidValue = parseValidToObject(previousValid, tafStart, tafEnd);
@@ -578,12 +601,12 @@ var validatePreviousChangeGroup = function validatePreviousChangeGroup(currentCh
578
601
  }; // validate overlapping validity when one of the following changegroups is FM
579
602
 
580
603
  var validateOverlapWithFM = function validateOverlapWithFM(currentChangeGroup, nextChangeGroups, tafStart, tafEnd) {
581
- var valid = currentChangeGroup.valid;
604
+ var valid = getFieldValue(currentChangeGroup.valid);
582
605
  if (!valid || !nextChangeGroups.length) return true;
583
606
  var validValue = parseValidToObject(valid, tafStart, tafEnd);
584
607
  var currentRowEndTime = moment(validValue.end);
585
608
  var firstFMChangeGroup = nextChangeGroups.find(function (nextChangeGroup) {
586
- return nextChangeGroup.change.trim() === 'FM';
609
+ return getFieldValue(nextChangeGroup.change) === 'FM';
587
610
  });
588
611
 
589
612
  if (firstFMChangeGroup && firstFMChangeGroup.valid) {
@@ -598,32 +621,6 @@ var validateOverlapWithFM = function validateOverlapWithFM(currentChangeGroup, n
598
621
  return true;
599
622
  };
600
623
 
601
- /* *
602
- * Licensed under the Apache License, Version 2.0 (the "License");
603
- * you may not use this file except in compliance with the License.
604
- * You may obtain a copy of the License at
605
- *
606
- * http://www.apache.org/licenses/LICENSE-2.0
607
- *
608
- * Unless required by applicable law or agreed to in writing, software
609
- * distributed under the License is distributed on an "AS IS" BASIS,
610
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
611
- * See the License for the specific language governing permissions and
612
- * limitations under the License.
613
- *
614
- * Copyright 2023 - Koninklijk Nederlands Meteorologisch Instituut (KNMI)
615
- * Copyright 2023 - Finnish Meteorological Institute (FMI)
616
- * */
617
- var prependZeroes = function prependZeroes(value, totalDigits) {
618
- var valueAsString = value.toString();
619
- return _toConsumableArray(Array(totalDigits - valueAsString.length)).reduce(function (newVal) {
620
- return "0".concat(newVal);
621
- }, valueAsString);
622
- };
623
- var getFieldValue = function getFieldValue(fieldValue) {
624
- return fieldValue === null || fieldValue === void 0 ? void 0 : fieldValue.trim().toUpperCase();
625
- };
626
-
627
624
  var config$1 = [{
628
625
  key: 'range',
629
626
  size: 4
@@ -653,7 +650,7 @@ var formatVisibilityToString = function formatVisibilityToString(value) {
653
650
  // returns object with validity if passed numbers - returns object with cavOK: true if passed CAVOK
654
651
 
655
652
  var parseVisibilityToObject = function parseVisibilityToObject(value) {
656
- var trimmedValue = value.trim();
653
+ var trimmedValue = getFieldValue(value);
657
654
 
658
655
  if (trimmedValue === 'CAVOK') {
659
656
  return {
@@ -701,7 +698,7 @@ var validateRange = function validateRange(value) {
701
698
 
702
699
 
703
700
  var validateVisibilityField = function validateVisibilityField(value) {
704
- var trimmedValue = value.trim();
701
+ var trimmedValue = getFieldValue(value);
705
702
 
706
703
  if (!trimmedValue.length) {
707
704
  return true;
@@ -714,7 +711,7 @@ var validateVisibilityField = function validateVisibilityField(value) {
714
711
 
715
712
 
716
713
  if (!trimmedValue.match(/^[0-9]+$/)) {
717
- return value === 'CAVOK' || invalidVisibilityMessage;
714
+ return trimmedValue === 'CAVOK' || invalidVisibilityMessage;
718
715
  } // validate range
719
716
 
720
717
 
@@ -1180,9 +1177,10 @@ var invalidWeatherBRVisibility = 'Invalid weather input, weather code BR needs t
1180
1177
  var invalidWeatherFGVisibility = 'Invalid weather input, weather code FG needs to be combined with a visibility below 1000m'; // validations
1181
1178
 
1182
1179
  var WeatherVisibilityBelow5000 = [WeatherPhenomena.FU, WeatherPhenomena.DU, WeatherPhenomena.HZ, WeatherPhenomena.DRDU, WeatherPhenomena.BLDU];
1183
- var validateWeatherField = function validateWeatherField(value, visibilityValue) {
1180
+ var validateWeatherField = function validateWeatherField(value, visibilityFieldValue) {
1184
1181
  var NSWAllowed = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : true;
1185
- var trimmedValue = value.trim(); // if empty, validate as true
1182
+ var trimmedValue = getFieldValue(value);
1183
+ var visibilityValue = getFieldValue(visibilityFieldValue); // if empty, validate as true
1186
1184
 
1187
1185
  if (trimmedValue === '') {
1188
1186
  return true;
@@ -1221,14 +1219,15 @@ var validateWeatherField = function validateWeatherField(value, visibilityValue)
1221
1219
 
1222
1220
  return true;
1223
1221
  };
1224
- var validateSecondWeatherField = function validateSecondWeatherField(weather1Value, weather2Value, visibilityValue) {
1225
- var trimmedWeather2Value = weather2Value.trim(); // Field can be left empty
1222
+ var validateSecondWeatherField = function validateSecondWeatherField(weather1Value, weather2Value, visibilityFieldValue) {
1223
+ var trimmedWeather2Value = getFieldValue(weather2Value);
1224
+ var visibilityValue = getFieldValue(visibilityFieldValue); // Field can be left empty
1226
1225
 
1227
1226
  if (!trimmedWeather2Value.length) {
1228
1227
  return true;
1229
1228
  }
1230
1229
 
1231
- var trimmedWeather1Value = weather1Value.trim(); // If weather1 is NSW weather2 should be empty
1230
+ var trimmedWeather1Value = getFieldValue(weather1Value); // If weather1 is NSW weather2 should be empty
1232
1231
 
1233
1232
  if (trimmedWeather1Value === 'NSW' && trimmedWeather2Value !== '') {
1234
1233
  return invalidWeatherNonEmptyNSWGroups;
@@ -1246,15 +1245,16 @@ var validateSecondWeatherField = function validateSecondWeatherField(weather1Val
1246
1245
 
1247
1246
  return validateWeatherField(weather2Value, visibilityValue, false);
1248
1247
  };
1249
- var validateThirdWeatherField = function validateThirdWeatherField(weather1Value, weather2Value, weather3Value, visibilityValue) {
1250
- var trimmedWeather3Value = weather3Value.trim(); // Field can be left empty
1248
+ var validateThirdWeatherField = function validateThirdWeatherField(weather1Value, weather2Value, weather3Value, visibilityFieldValue) {
1249
+ var trimmedWeather3Value = getFieldValue(weather3Value);
1250
+ var visibilityValue = getFieldValue(visibilityFieldValue); // Field can be left empty
1251
1251
 
1252
1252
  if (!trimmedWeather3Value.length) {
1253
1253
  return true;
1254
1254
  }
1255
1255
 
1256
- var trimmedWeather1Value = weather1Value.trim();
1257
- var trimmedWeather2Value = weather2Value.trim(); // If weather1 is NSW weather3 should be empty
1256
+ var trimmedWeather1Value = getFieldValue(weather1Value);
1257
+ var trimmedWeather2Value = getFieldValue(weather2Value); // If weather1 is NSW weather3 should be empty
1258
1258
 
1259
1259
  if (trimmedWeather1Value === 'NSW' && trimmedWeather3Value !== '') {
1260
1260
  return invalidWeatherNonEmptyNSWGroups;
@@ -1617,10 +1617,10 @@ var validateWindInterSection = function validateWindInterSection(speed, gust, di
1617
1617
 
1618
1618
 
1619
1619
  var validateWindField = function validateWindField(value, weatherfield1, weatherfield2, weatherfield3) {
1620
- var trimmedWindValue = value.trim();
1621
- var trimmedWeather1Value = weatherfield1.trim();
1622
- var trimmedWeather2Value = weatherfield2.trim();
1623
- var trimmedWeather3Value = weatherfield3.trim();
1620
+ var trimmedWindValue = getFieldValue(value);
1621
+ var trimmedWeather1Value = getFieldValue(weatherfield1);
1622
+ var trimmedWeather2Value = getFieldValue(weatherfield2);
1623
+ var trimmedWeather3Value = getFieldValue(weatherfield3);
1624
1624
 
1625
1625
  if (!trimmedWindValue.length) {
1626
1626
  return true;
@@ -1887,11 +1887,11 @@ var sharedCloudValidations = function sharedCloudValidations(_ref) {
1887
1887
  };
1888
1888
 
1889
1889
  var validateFirstCloud = function validateFirstCloud(value, visibilityValue, weatherfield1, weatherfield2, weatherfield3) {
1890
- var trimmedValueFirstCloud = value.trim();
1891
- var trimmedValueVisibility = visibilityValue.trim();
1892
- var trimmedWeather1Value = weatherfield1.trim();
1893
- var trimmedWeather2Value = weatherfield2.trim();
1894
- var trimmedWeather3Value = weatherfield3.trim(); // Field can be left empty
1890
+ var trimmedValueFirstCloud = getFieldValue(value);
1891
+ var trimmedValueVisibility = getFieldValue(visibilityValue);
1892
+ var trimmedWeather1Value = getFieldValue(weatherfield1);
1893
+ var trimmedWeather2Value = getFieldValue(weatherfield2);
1894
+ var trimmedWeather3Value = getFieldValue(weatherfield3); // Field can be left empty
1895
1895
 
1896
1896
  if (!trimmedValueFirstCloud.length) {
1897
1897
  return true;
@@ -1927,9 +1927,10 @@ var validateFirstCloud = function validateFirstCloud(value, visibilityValue, wea
1927
1927
 
1928
1928
  return errorMessages.length ? errorMessages[0] : true;
1929
1929
  };
1930
- var validateSecondCloud = function validateSecondCloud(firstCloudValue, secondCloudValue, visibilityValue) {
1931
- var trimmedValueFirstCloud = firstCloudValue.trim();
1932
- var trimmedValueSecondCloud = secondCloudValue.trim(); // Field can be left empty
1930
+ var validateSecondCloud = function validateSecondCloud(firstCloudValue, secondCloudValue, visibilityFieldValue) {
1931
+ var trimmedValueFirstCloud = getFieldValue(firstCloudValue);
1932
+ var trimmedValueSecondCloud = getFieldValue(secondCloudValue);
1933
+ var visibilityValue = getFieldValue(visibilityFieldValue); // Field can be left empty
1933
1934
 
1934
1935
  if (!trimmedValueSecondCloud.length) {
1935
1936
  return true;
@@ -1996,10 +1997,11 @@ var validateSecondCloud = function validateSecondCloud(firstCloudValue, secondCl
1996
1997
 
1997
1998
  return true;
1998
1999
  };
1999
- var validateThirdCloud = function validateThirdCloud(firstCloudValue, secondCloudValue, thirdCloudValue, visibilityValue) {
2000
- var trimmedValueFirstCloud = firstCloudValue.trim();
2001
- var trimmedValueSecondCloud = secondCloudValue.trim();
2002
- var trimmedValueThirdCloud = thirdCloudValue.trim(); // Field can be left empty
2000
+ var validateThirdCloud = function validateThirdCloud(firstCloudValue, secondCloudValue, thirdCloudValue, visibilityFieldValue) {
2001
+ var trimmedValueFirstCloud = getFieldValue(firstCloudValue);
2002
+ var trimmedValueSecondCloud = getFieldValue(secondCloudValue);
2003
+ var trimmedValueThirdCloud = getFieldValue(thirdCloudValue);
2004
+ var visibilityValue = getFieldValue(visibilityFieldValue); // Field can be left empty
2003
2005
 
2004
2006
  if (!trimmedValueThirdCloud.length) {
2005
2007
  return true;
@@ -2074,11 +2076,12 @@ var validateThirdCloud = function validateThirdCloud(firstCloudValue, secondClou
2074
2076
 
2075
2077
  return true;
2076
2078
  };
2077
- var validateFourthCloud = function validateFourthCloud(firstCloudValue, secondCloudValue, thirdCloudValue, fourthCloudValue, visibilityValue) {
2078
- var trimmedValueFirstCloud = firstCloudValue.trim();
2079
- var trimmedValueSecondCloud = secondCloudValue.trim();
2080
- var trimmedValueThirdCloud = thirdCloudValue.trim();
2081
- var trimmedValueFourthCloud = fourthCloudValue.trim(); // Field can be left empty
2079
+ var validateFourthCloud = function validateFourthCloud(firstCloudValue, secondCloudValue, thirdCloudValue, fourthCloudValue, visibilityFieldValue) {
2080
+ var trimmedValueFirstCloud = getFieldValue(firstCloudValue);
2081
+ var trimmedValueSecondCloud = getFieldValue(secondCloudValue);
2082
+ var trimmedValueThirdCloud = getFieldValue(thirdCloudValue);
2083
+ var trimmedValueFourthCloud = getFieldValue(fourthCloudValue);
2084
+ var visibilityValue = getFieldValue(visibilityFieldValue); // Field can be left empty
2082
2085
 
2083
2086
  if (!trimmedValueFourthCloud.length) {
2084
2087
  return true;
@@ -3122,6 +3125,7 @@ var IssuesPane = function IssuesPane(_ref) {
3122
3125
  isOpen: isOpen,
3123
3126
  "data-testid": "moveable-issues-pane",
3124
3127
  bounds: "parent",
3128
+ cancel: "",
3125
3129
  onDragEnd: function onDragEnd(event) {
3126
3130
  if (event.x !== 0 && event.y !== 0) {
3127
3131
  onUserHasDragged();
@@ -3257,17 +3261,43 @@ var TafAvatar = function TafAvatar(_ref) {
3257
3261
  }, getInitials(editor))));
3258
3262
  };
3259
3263
 
3260
- var textFieldStyle = function textFieldStyle(theme) {
3261
- return {
3264
+ /* *
3265
+ * Licensed under the Apache License, Version 2.0 (the "License");
3266
+ * you may not use this file except in compliance with the License.
3267
+ * You may obtain a copy of the License at
3268
+ *
3269
+ * http://www.apache.org/licenses/LICENSE-2.0
3270
+ *
3271
+ * Unless required by applicable law or agreed to in writing, software
3272
+ * distributed under the License is distributed on an "AS IS" BASIS,
3273
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
3274
+ * See the License for the specific language governing permissions and
3275
+ * limitations under the License.
3276
+ *
3277
+ * Copyright 2023 - Koninklijk Nederlands Meteorologisch Instituut (KNMI)
3278
+ * Copyright 2023 - Finnish Meteorological Institute (FMI)
3279
+ * */
3280
+ var TAF_MODULE_ID = 'tafmodule';
3281
+ var ResponsiveWrapper = function ResponsiveWrapper(_ref) {
3282
+ var children = _ref.children;
3283
+ return /*#__PURE__*/React.createElement(Box, {
3284
+ sx: {
3285
+ containerType: 'inline-size',
3286
+ containerName: TAF_MODULE_ID
3287
+ }
3288
+ }, children);
3289
+ };
3290
+
3291
+ var textFieldStyle = function textFieldStyle(theme, shouldPreventUppercase) {
3292
+ return Object.assign(Object.assign({
3262
3293
  // input
3263
- marginRight: '2px',
3264
3294
  marginBottom: '4px',
3265
- width: 56,
3295
+ width: '100%',
3266
3296
  height: 46,
3267
3297
  input: {
3268
3298
  textAlign: 'center',
3269
- fontSize: 10,
3270
- fontWeight: 500,
3299
+ textTransform: shouldPreventUppercase ? 'none' : 'uppercase',
3300
+ fontWeight: 'normal',
3271
3301
  paddingLeft: 0,
3272
3302
  paddingRight: 0,
3273
3303
  '&.Mui-disabled': {
@@ -3306,8 +3336,20 @@ var textFieldStyle = function textFieldStyle(theme) {
3306
3336
  '.Mui-disabled:before': {
3307
3337
  borderColor: 'transparent'
3308
3338
  }
3339
+ },
3340
+ '& .MuiFilledInput-root': {
3341
+ borderTopLeftRadius: '0px',
3342
+ borderTopRightRadius: '0px'
3309
3343
  }
3310
- };
3344
+ }, !IS_JEST && _defineProperty({}, "@container ".concat(TAF_MODULE_ID, " (min-width: 1440px)"), {
3345
+ '&.MuiFormControl-root.MuiTextField-root .inputText': {
3346
+ fontSize: 14
3347
+ }
3348
+ })), {
3349
+ '.inputText': {
3350
+ fontSize: 12
3351
+ }
3352
+ });
3311
3353
  };
3312
3354
 
3313
3355
  var getTafErrors = function getTafErrors(name, errors) {
@@ -3330,35 +3372,43 @@ var getTafErrors = function getTafErrors(name, errors) {
3330
3372
  var getDisplayValue = function getDisplayValue(value, disabled) {
3331
3373
  return disabled && !value ? '-' : value;
3332
3374
  };
3333
- var BaseTextField = /*#__PURE__*/React__default.memo(function (props) {
3375
+ var BaseTextField = /*#__PURE__*/React__default.memo(function (_a) {
3376
+ var _a$shouldPreventUpper = _a.shouldPreventUppercase,
3377
+ shouldPreventUppercase = _a$shouldPreventUpper === void 0 ? false : _a$shouldPreventUpper,
3378
+ props = __rest(_a, ["shouldPreventUppercase"]);
3379
+
3380
+ var theme = useTheme();
3381
+ var styling = textFieldStyle(theme, shouldPreventUppercase);
3334
3382
  return /*#__PURE__*/React__default.createElement(TextField, Object.assign({
3335
3383
  type: "text",
3336
3384
  variant: "filled",
3337
- sx: textFieldStyle
3385
+ sx: styling
3338
3386
  }, props));
3339
3387
  }, function (prevProps, nextProps) {
3340
3388
  return prevProps.value === nextProps.value && prevProps.error === nextProps.error && prevProps.name === nextProps.name && prevProps.disabled === nextProps.disabled;
3341
3389
  });
3342
3390
 
3343
- var TafFormTextField = function TafFormTextField(_ref) {
3344
- var label = _ref.label,
3345
- _ref$disabled = _ref.disabled,
3346
- disabled = _ref$disabled === void 0 ? false : _ref$disabled,
3347
- _ref$name = _ref.name,
3348
- name = _ref$name === void 0 ? '' : _ref$name,
3349
- _ref$onChange = _ref.onChange,
3350
- onChange = _ref$onChange === void 0 ? function () {} : _ref$onChange,
3351
- _ref$onBlur = _ref.onBlur,
3352
- onBlur = _ref$onBlur === void 0 ? function () {} : _ref$onBlur,
3353
- _ref$defaultValue = _ref.defaultValue,
3354
- defaultValue = _ref$defaultValue === void 0 ? '' : _ref$defaultValue,
3355
- _ref$formatter = _ref.formatter,
3356
- formatter = _ref$formatter === void 0 ? null : _ref$formatter,
3357
- rules = _ref.rules,
3358
- _ref$autoComplete = _ref.autoComplete,
3359
- autoComplete = _ref$autoComplete === void 0 ? [] : _ref$autoComplete,
3360
- _ref$autoFocus = _ref.autoFocus,
3361
- autoFocus = _ref$autoFocus === void 0 ? false : _ref$autoFocus;
3391
+ var TafFormTextField = function TafFormTextField(_ref2) {
3392
+ var label = _ref2.label,
3393
+ _ref2$disabled = _ref2.disabled,
3394
+ disabled = _ref2$disabled === void 0 ? false : _ref2$disabled,
3395
+ _ref2$name = _ref2.name,
3396
+ name = _ref2$name === void 0 ? '' : _ref2$name,
3397
+ _ref2$onChange = _ref2.onChange,
3398
+ onChange = _ref2$onChange === void 0 ? function () {} : _ref2$onChange,
3399
+ _ref2$onBlur = _ref2.onBlur,
3400
+ onBlur = _ref2$onBlur === void 0 ? function () {} : _ref2$onBlur,
3401
+ _ref2$defaultValue = _ref2.defaultValue,
3402
+ defaultValue = _ref2$defaultValue === void 0 ? '' : _ref2$defaultValue,
3403
+ _ref2$formatter = _ref2.formatter,
3404
+ formatter = _ref2$formatter === void 0 ? null : _ref2$formatter,
3405
+ rules = _ref2.rules,
3406
+ _ref2$autoComplete = _ref2.autoComplete,
3407
+ autoComplete = _ref2$autoComplete === void 0 ? [] : _ref2$autoComplete,
3408
+ _ref2$autoFocus = _ref2.autoFocus,
3409
+ autoFocus = _ref2$autoFocus === void 0 ? false : _ref2$autoFocus,
3410
+ _ref2$shouldPreventUp = _ref2.shouldPreventUppercase,
3411
+ shouldPreventUppercase = _ref2$shouldPreventUp === void 0 ? false : _ref2$shouldPreventUp;
3362
3412
 
3363
3413
  var _useFormContext = useFormContext(),
3364
3414
  control = _useFormContext.control,
@@ -3387,7 +3437,8 @@ var TafFormTextField = function TafFormTextField(_ref) {
3387
3437
 
3388
3438
  if (foundValue) {
3389
3439
  setValue(name, foundValue.value, {
3390
- shouldDirty: true
3440
+ shouldDirty: true,
3441
+ shouldValidate: true
3391
3442
  });
3392
3443
  setMaxLength(foundValue.value.length);
3393
3444
  event.preventDefault();
@@ -3395,9 +3446,10 @@ var TafFormTextField = function TafFormTextField(_ref) {
3395
3446
  }
3396
3447
  }, [name, autoComplete, setValue]);
3397
3448
  var onChangeField = React__default.useCallback(function (event, callback) {
3398
- var valueUppercase = event.currentTarget.value.toUpperCase();
3449
+ var value = event.currentTarget.value;
3399
3450
 
3400
3451
  if (autoComplete) {
3452
+ var valueUppercase = value.toUpperCase();
3401
3453
  var exist = autoComplete.find(function (e) {
3402
3454
  return e.value === valueUppercase;
3403
3455
  });
@@ -3405,17 +3457,32 @@ var TafFormTextField = function TafFormTextField(_ref) {
3405
3457
  setMaxLength(newMaxLength);
3406
3458
  }
3407
3459
 
3408
- callback(valueUppercase);
3409
- onChange(valueUppercase);
3460
+ callback(value);
3461
+ onChange(value);
3410
3462
  }, [onChange, autoComplete]);
3411
- var onBlurField = React__default.useCallback(function (callback) {
3463
+ var onBlurField = React__default.useCallback(function (event, callback) {
3464
+ var value = event.target.value;
3465
+ var valueUppercase = value.toUpperCase();
3466
+
3467
+ if (value !== valueUppercase && !shouldPreventUppercase) {
3468
+ setValue(name, valueUppercase, {
3469
+ shouldValidate: true
3470
+ });
3471
+ }
3472
+
3412
3473
  callback();
3413
3474
  onBlur();
3414
- }, [onBlur]);
3475
+ }, [onBlur, name, setValue, shouldPreventUppercase]);
3415
3476
  var hasError = !!fieldErrors;
3416
- return /*#__PURE__*/React__default.createElement(Controller, {
3417
- render: function render(_ref2) {
3418
- var field = _ref2.field;
3477
+ return /*#__PURE__*/React__default.createElement(Grid, {
3478
+ item: true,
3479
+ sx: {
3480
+ width: "".concat(100 / 13, "%"),
3481
+ minWidth: 60
3482
+ }
3483
+ }, /*#__PURE__*/React__default.createElement(Controller, {
3484
+ render: function render(_ref3) {
3485
+ var field = _ref3.field;
3419
3486
  var displayValue = formatter ? formatter(field.value) : getDisplayValue(field.value, disabled);
3420
3487
  return /*#__PURE__*/React__default.createElement(BaseTextField, {
3421
3488
  label: label,
@@ -3423,25 +3490,27 @@ var TafFormTextField = function TafFormTextField(_ref) {
3423
3490
  name: name,
3424
3491
  value: displayValue,
3425
3492
  inputRef: field.ref,
3426
- onChange: function onChange(e) {
3427
- return onChangeField(e, field.onChange);
3493
+ onChange: function onChange(event) {
3494
+ return onChangeField(event, field.onChange);
3428
3495
  },
3429
3496
  onKeyDown: onKeyDown,
3430
3497
  error: hasError,
3431
- onBlur: function onBlur() {
3432
- return onBlurField(field.onBlur);
3498
+ onBlur: function onBlur(event) {
3499
+ return onBlurField(event, field.onBlur);
3433
3500
  },
3434
3501
  inputProps: {
3435
- maxLength: maxLength
3502
+ maxLength: maxLength,
3503
+ className: 'inputText'
3436
3504
  },
3437
- autoFocus: autoFocus
3505
+ autoFocus: autoFocus,
3506
+ shouldPreventUppercase: shouldPreventUppercase
3438
3507
  });
3439
3508
  },
3440
3509
  name: name,
3441
3510
  control: control,
3442
3511
  defaultValue: defaultValue,
3443
3512
  rules: rules
3444
- });
3513
+ }));
3445
3514
  };
3446
3515
 
3447
3516
  /* *
@@ -3718,6 +3787,14 @@ var TafFormRow = /*#__PURE__*/React__default.forwardRef(function (_a, ref) {
3718
3787
  marginTop: '8px',
3719
3788
  backgroundColor: 'geowebColors.cards.cardContainer',
3720
3789
  position: 'relative',
3790
+ paddingLeft: {
3791
+ xs: '2px',
3792
+ lg: '10px'
3793
+ },
3794
+ paddingRight: {
3795
+ xs: '2px',
3796
+ lg: '10px'
3797
+ },
3721
3798
  '&.sortable-chosen': {
3722
3799
  boxShadow: 1
3723
3800
  },
@@ -3732,12 +3809,10 @@ var TafFormRow = /*#__PURE__*/React__default.forwardRef(function (_a, ref) {
3732
3809
  }, props, {
3733
3810
  className: "formRow"
3734
3811
  }), /*#__PURE__*/React__default.createElement(Grid, {
3735
- columns: 24,
3736
3812
  item: true,
3737
3813
  container: true,
3738
3814
  justifyContent: "flex-end",
3739
- xs: 24,
3740
- sm: 23
3815
+ xs: true
3741
3816
  }, !isChangeGroup && /*#__PURE__*/React__default.createElement(React__default.Fragment, null, /*#__PURE__*/React__default.createElement(TafFormTextField, {
3742
3817
  label: "Type",
3743
3818
  name: fieldNames.messageType,
@@ -3750,12 +3825,15 @@ var TafFormRow = /*#__PURE__*/React__default.forwardRef(function (_a, ref) {
3750
3825
  formatter: formatIssueTime,
3751
3826
  label: "Issue time",
3752
3827
  name: "issueDate",
3753
- disabled: true
3828
+ disabled: true,
3829
+ shouldPreventUppercase: true
3754
3830
  })), isChangeGroup && /*#__PURE__*/React__default.createElement(React__default.Fragment, null, /*#__PURE__*/React__default.createElement(Box, {
3755
3831
  sx: {
3756
- width: 56,
3757
- marginRight: '2px'
3758
- }
3832
+ marginRight: '2px',
3833
+ minWidth: 60
3834
+ },
3835
+ display: "flex",
3836
+ justifyContent: "center"
3759
3837
  }, !disabled && dragHandle), /*#__PURE__*/React__default.createElement(TafFormTextField, {
3760
3838
  label: "Prob",
3761
3839
  name: fieldNames.probability,
@@ -3999,12 +4077,11 @@ var TafFormRow = /*#__PURE__*/React__default.forwardRef(function (_a, ref) {
3999
4077
  container: true,
4000
4078
  justifyContent: "flex-end",
4001
4079
  alignItems: "flex-end",
4002
- xs: 24,
4003
- sm: 1,
4004
4080
  sx: {
4005
- marginBottom: '16px'
4006
- },
4007
- columns: 24
4081
+ width: '3.5%',
4082
+ marginBottom: '14px',
4083
+ minWidth: 28
4084
+ }
4008
4085
  }, /*#__PURE__*/React__default.createElement(TafFormOptionsButton, {
4009
4086
  isChangeGroup: isChangeGroup,
4010
4087
  addChangeGroupBelow: addChangeGroupBelow,
@@ -5246,7 +5323,12 @@ var TacOverview = function TacOverview(_ref) {
5246
5323
  }))), /*#__PURE__*/React__default.createElement(Box, {
5247
5324
  ref: scrollRef,
5248
5325
  sx: {
5249
- padding: '10px',
5326
+ padding: {
5327
+ xs: '12px',
5328
+ sm: '6px',
5329
+ md: '16px',
5330
+ lg: '24px'
5331
+ },
5250
5332
  maxHeight: '100%',
5251
5333
  overflow: 'auto'
5252
5334
  }
@@ -6164,7 +6246,6 @@ var TafLayout = function TafLayout(_ref2) {
6164
6246
  }, /*#__PURE__*/React__default.createElement(Box, {
6165
6247
  sx: {
6166
6248
  minWidth: 320,
6167
- maxWidth: 1272,
6168
6249
  margin: 'auto',
6169
6250
  height: '100%',
6170
6251
  display: 'flex',
@@ -6373,7 +6454,7 @@ var TafModule = function TafModule() {
6373
6454
  }, []);
6374
6455
  usePoller([tafList, getTafListError], fetchNewTafList);
6375
6456
  var hasTafListError = getTafListError !== null;
6376
- return /*#__PURE__*/React.createElement(Box, {
6457
+ return /*#__PURE__*/React.createElement(ResponsiveWrapper, null, /*#__PURE__*/React.createElement(Box, {
6377
6458
  component: "div",
6378
6459
  id: "tafmodule",
6379
6460
  sx: {
@@ -6398,7 +6479,7 @@ var TafModule = function TafModule() {
6398
6479
  tafList: tafList,
6399
6480
  onUpdateTaf: onUpdateTaf,
6400
6481
  lastUpdateTime: lastUpdateTime
6401
- }));
6482
+ })));
6402
6483
  };
6403
6484
 
6404
6485
  var Wrapper = function Wrapper(props) {