@fmidev/smartmet-alert-client 4.4.19 → 4.7.0-alpha.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.
Files changed (105) hide show
  1. package/.eslintignore +2 -14
  2. package/.github/workflows/test.yaml +26 -0
  3. package/.nvmrc +1 -0
  4. package/dist/index.html +5 -0
  5. package/dist/index.js +105 -135
  6. package/dist/index.mjs +112 -135
  7. package/dist/locale-en-DCEKDw5G.js +8 -0
  8. package/dist/locale-fi-DPiOM1rB.js +8 -0
  9. package/dist/locale-sv-B0FlbgEF.js +8 -0
  10. package/dist/vendor-Cfkkvdz7.js +21 -0
  11. package/dist/vue/index.mjs +15245 -0
  12. package/dist/vue/style.css +1 -0
  13. package/dist/xml-parser-BiNO9kc-.js +13 -0
  14. package/package.json +60 -24
  15. package/src/AlertClientVue.vue +170 -0
  16. package/src/App.vue +55 -205
  17. package/src/assets/img/ui/arrow-down.svg +4 -11
  18. package/src/assets/img/ui/arrow-up.svg +4 -11
  19. package/src/assets/img/ui/clear.svg +7 -21
  20. package/src/assets/img/ui/close.svg +4 -15
  21. package/src/assets/img/ui/toggle-selected.svg +5 -6
  22. package/src/assets/img/ui/toggle-unselected.svg +5 -6
  23. package/src/assets/img/warning/cold-weather.svg +3 -6
  24. package/src/assets/img/warning/flood-level-3.svg +4 -7
  25. package/src/assets/img/warning/forest-fire-weather.svg +2 -6
  26. package/src/assets/img/warning/grass-fire-weather.svg +2 -6
  27. package/src/assets/img/warning/hot-weather.svg +3 -6
  28. package/src/assets/img/warning/pedestrian-safety.svg +3 -7
  29. package/src/assets/img/warning/rain.svg +2 -7
  30. package/src/assets/img/warning/sea-icing.svg +2 -6
  31. package/src/assets/img/warning/sea-thunder-storm.svg +2 -5
  32. package/src/assets/img/warning/sea-water-height-high-water.svg +3 -8
  33. package/src/assets/img/warning/sea-water-height-shallow-water.svg +3 -7
  34. package/src/assets/img/warning/sea-wave-height.svg +4 -7
  35. package/src/assets/img/warning/sea-wind-legend.svg +2 -5
  36. package/src/assets/img/warning/sea-wind.svg +2 -5
  37. package/src/assets/img/warning/several.svg +2 -5
  38. package/src/assets/img/warning/thunder-storm.svg +2 -5
  39. package/src/assets/img/warning/traffic-weather.svg +2 -6
  40. package/src/assets/img/warning/uv-note.svg +2 -6
  41. package/src/assets/img/warning/wind.svg +2 -5
  42. package/src/components/AlertClient.vue +41 -19
  43. package/src/components/CollapsiblePanel.vue +284 -0
  44. package/src/components/DayLarge.vue +12 -7
  45. package/src/components/DaySmall.vue +16 -6
  46. package/src/components/Days.vue +76 -51
  47. package/src/components/DescriptionWarning.vue +15 -8
  48. package/src/components/GrayScaleToggle.vue +11 -6
  49. package/src/components/Legend.vue +36 -248
  50. package/src/components/MapLarge.vue +41 -42
  51. package/src/components/MapSmall.vue +44 -28
  52. package/src/components/PopupRow.vue +6 -3
  53. package/src/components/Region.vue +30 -15
  54. package/src/components/RegionWarning.vue +6 -5
  55. package/src/components/Regions.vue +50 -19
  56. package/src/components/Warning.vue +18 -10
  57. package/src/components/Warnings.vue +36 -21
  58. package/src/main.js +1 -0
  59. package/src/mixins/alertClientCore.js +210 -0
  60. package/src/mixins/config.js +262 -256
  61. package/src/mixins/utils.js +40 -26
  62. package/src/plugins/index.js +1 -1
  63. package/src/scss/_utilities.scss +193 -0
  64. package/src/scss/constants.scss +2 -1
  65. package/src/scss/warningImages.scss +8 -3
  66. package/src/vue.js +41 -0
  67. package/svgo.config.js +45 -0
  68. package/tests/README.md +430 -0
  69. package/tests/fixtures/mockWarningData.js +135 -0
  70. package/tests/integration/warning-flow.spec.js +452 -0
  71. package/tests/setup.js +41 -0
  72. package/tests/unit/components/AlertClient.spec.js +734 -0
  73. package/tests/unit/components/DayLarge.spec.js +281 -0
  74. package/tests/unit/components/DaySmall.spec.js +278 -0
  75. package/tests/unit/components/Days.spec.js +565 -0
  76. package/tests/unit/components/DescriptionWarning.spec.js +432 -0
  77. package/tests/unit/components/GrayScaleToggle.spec.js +311 -0
  78. package/tests/unit/components/Legend.spec.js +223 -0
  79. package/tests/unit/components/MapLarge.spec.js +276 -0
  80. package/tests/unit/components/MapSmall.spec.js +226 -0
  81. package/tests/unit/components/PopupRow.spec.js +261 -0
  82. package/tests/unit/components/Region.spec.js +430 -0
  83. package/tests/unit/components/RegionWarning.snapshot.spec.js +73 -0
  84. package/tests/unit/components/RegionWarning.spec.js +408 -0
  85. package/tests/unit/components/Regions.spec.js +335 -0
  86. package/tests/unit/components/Warning.snapshot.spec.js +107 -0
  87. package/tests/unit/components/Warning.spec.js +472 -0
  88. package/tests/unit/components/Warnings.spec.js +329 -0
  89. package/tests/unit/components/__snapshots__/RegionWarning.snapshot.spec.js.snap +21 -0
  90. package/tests/unit/components/__snapshots__/Warning.snapshot.spec.js.snap +199 -0
  91. package/tests/unit/mixins/config.spec.js +269 -0
  92. package/tests/unit/mixins/i18n.spec.js +115 -0
  93. package/tests/unit/mixins/keycodes.spec.js +37 -0
  94. package/tests/unit/mixins/utils.spec.js +624 -0
  95. package/vite.config.js +96 -26
  96. package/vitest.config.js +40 -0
  97. package/dist/index.mjs.map +0 -1
  98. package/dist/index.relative.html +0 -19
  99. package/dist/index.start.html +0 -20
  100. package/playwright.config.ts +0 -18
  101. package/public/index.relative.html +0 -19
  102. package/public/index.start.html +0 -20
  103. package/src/mixins/panzoom.js +0 -900
  104. package/test/snapshot.test.ts +0 -126
  105. package/vitest.config.ts +0 -6
@@ -1,60 +1,56 @@
1
1
  <template>
2
- <div class="sticky-top" :class="theme">
2
+ <div
3
+ class="sticky-top"
4
+ :class="theme"
5
+ >
3
6
  <GrayScaleToggle
4
7
  class="narrow-screen"
5
8
  :language="language"
6
9
  :gray-scale-selector="grayScaleSelector"
7
10
  :theme="theme"
8
- @themeChanged="onThemeChanged" />
11
+ @theme-changed="onThemeChanged"
12
+ />
9
13
  <div class="row symbol-list-header-row">
10
14
  <nav class="symbol-list-header bold-text">
11
15
  {{ warningSymbolsText }}
12
- <br v-if="input.length > 0" class="symbol-list-header-line-break" />
16
+ <br
17
+ v-if="input.length > 0"
18
+ class="symbol-list-header-line-break"
19
+ />
13
20
  </nav>
14
21
  </div>
15
- <b-card no-body class="mb-1 d-md-none legends-panel">
16
- <b-card-header header-tag="header" class="legends-heading p-1">
17
- <div class="legends-header">
18
- <span class="legends-text">
19
- {{ toggleLegendsText }}
20
- </span>
21
- </div>
22
- <b-button
23
- block
24
- :class="['legends-toggle', visible ? '' : 'collapsed']"
25
- :aria-label="toggleLegendsText"
26
- @click="onLegendToggle" />
27
- </b-card-header>
28
- <b-collapse
29
- id="legends-collapse"
30
- v-model="visible"
31
- class="legends-collapse-item focus-ring"
32
- tabindex="0">
33
- <b-card-body body-class="p-0">
34
- <div class="legends-container">
35
- <Warnings
36
- :input="input"
37
- :visible-warnings="visibleWarnings"
38
- :theme="theme"
39
- :language="language" />
40
- </div>
41
- </b-card-body>
42
- </b-collapse>
43
- </b-card>
44
- <div ref="warningsContainer" class="d-md-block d-none">
22
+ <CollapsiblePanel
23
+ :visible="visible"
24
+ :title="toggleLegendsText"
25
+ :theme="theme"
26
+ @toggle="onLegendToggle"
27
+ >
45
28
  <Warnings
46
29
  :input="input"
47
30
  :visible-warnings="visibleWarnings"
48
31
  :theme="theme"
49
32
  :language="language"
50
- @warningsToggled="onWarningsToggled"
51
- @showAllWarnings="onShowAllWarnings" />
33
+ />
34
+ </CollapsiblePanel>
35
+ <div
36
+ ref="warningsContainer"
37
+ class="desktop-only"
38
+ >
39
+ <Warnings
40
+ :input="input"
41
+ :visible-warnings="visibleWarnings"
42
+ :theme="theme"
43
+ :language="language"
44
+ @warnings-toggled="onWarningsToggled"
45
+ @show-all-warnings="onShowAllWarnings"
46
+ />
52
47
  </div>
53
48
  <GrayScaleToggle
54
49
  :language="language"
55
50
  :gray-scale-selector="grayScaleSelector"
56
51
  :theme="theme"
57
- @themeChanged="onThemeChanged" />
52
+ @theme-changed="onThemeChanged"
53
+ />
58
54
  </div>
59
55
  </template>
60
56
 
@@ -62,11 +58,15 @@
62
58
  import { onMounted, onUnmounted, ref } from 'vue'
63
59
 
64
60
  import i18n from '../mixins/i18n'
61
+ import CollapsiblePanel from './CollapsiblePanel.vue'
62
+ import GrayScaleToggle from './GrayScaleToggle.vue'
65
63
  import Warnings from './Warnings.vue'
66
64
 
67
65
  export default {
68
66
  name: 'Legend',
69
67
  components: {
68
+ CollapsiblePanel,
69
+ GrayScaleToggle,
70
70
  Warnings,
71
71
  },
72
72
  mixins: [i18n],
@@ -167,218 +167,6 @@ div.symbol-list-header-row {
167
167
  }
168
168
  }
169
169
 
170
- .legends-panel {
171
- margin-left: 0;
172
- margin-right: 0;
173
- border-radius: 0;
174
- }
175
-
176
- .light-theme .legends-panel {
177
- border: 0.5px solid $light-legend-background-color;
178
- }
179
-
180
- .dark-theme .legends-panel {
181
- border: 0.5px solid $dark-legend-background-color;
182
- }
183
-
184
- .light-gray-theme .legends-panel {
185
- border: 0.5px solid $light-gray-legend-background-color;
186
- }
187
-
188
- .dark-gray-theme .legends-panel {
189
- border: 0.5px solid $dark-gray-legend-background-color;
190
- }
191
-
192
- .legends-heading {
193
- height: $current-warning-height;
194
- padding: 0 0 0 15px !important;
195
- line-height: $current-warning-height;
196
- border: none;
197
- border-bottom: 0.5px solid rgba(0, 0, 0, 0.125);
198
- border-radius: 0 !important;
199
- }
200
-
201
- .light-theme .legends-heading {
202
- background-color: $light-legend-heading-background-color;
203
- }
204
-
205
- .dark-theme .legends-heading {
206
- background-color: $dark-legend-heading-background-color;
207
- }
208
-
209
- .light-gray-theme .legends-heading {
210
- background-color: $light-gray-legend-heading-background-color;
211
- }
212
-
213
- .dark-gray-theme .legends-heading {
214
- background-color: $dark-gray-legend-heading-background-color;
215
- }
216
-
217
- .legends-header {
218
- position: absolute;
219
- left: 0;
220
- right: 38px;
221
- border-radius: 0;
222
- display: flex;
223
- align-items: center;
224
- justify-content: start;
225
- height: $current-warning-height;
226
- }
227
-
228
- .light-theme .legends-header {
229
- background: $light-legend-heading-background-color;
230
- }
231
-
232
- .dark-theme .legends-header {
233
- background: $dark-legend-heading-background-color;
234
- }
235
-
236
- .light-gray-theme .legends-header {
237
- background: $light-gray-legend-heading-background-color;
238
- }
239
-
240
- .dark-gray-theme .legends-header {
241
- background: $dark-gray-legend-heading-background-color;
242
- }
243
-
244
- .legends-text {
245
- display: block;
246
- text-align: left;
247
- white-space: nowrap;
248
- overflow: hidden;
249
- text-overflow: ellipsis;
250
- margin-left: 15px;
251
- }
252
-
253
- .light-theme .legends-text {
254
- background-color: $light-legend-heading-background-color;
255
- }
256
-
257
- .dark-theme .legends-text {
258
- background-color: $dark-legend-heading-background-color;
259
- }
260
-
261
- .light-gray-theme .legends-text {
262
- background-color: $light-gray-legend-heading-background-color;
263
- }
264
-
265
- .dark-gray-theme .legends-text {
266
- background-color: $dark-gray-legend-heading-background-color;
267
- }
268
-
269
- button.legends-toggle {
270
- position: relative;
271
- height: $current-warning-height;
272
- width: $current-warning-height;
273
- min-width: $current-warning-height;
274
- background-image: url($ui-image-path + 'arrow-up.svg');
275
- background-repeat: no-repeat;
276
- background-position: center;
277
- border-radius: 0 !important;
278
- border-style: none;
279
- float: right;
280
- padding: $image-padding;
281
- margin-left: 5px;
282
-
283
- &.collapsed {
284
- background-image: url($ui-image-path + 'arrow-down.svg');
285
- border-radius: 0 3px 3px 0;
286
- }
287
- }
288
-
289
- .light-theme .legends-toggle {
290
- background-color: $light-legend-toggle-background-color;
291
-
292
- &:hover {
293
- background-color: $light-legend-toggle-background-color;
294
- }
295
-
296
- &:active {
297
- background-color: $light-legend-toggle-background-color;
298
- }
299
-
300
- &:not(:disabled):not(.disabled):active {
301
- background-color: $light-current-warning-toggle-active-color;
302
- }
303
- }
304
-
305
- .dark-theme .legends-toggle {
306
- background-color: $dark-legend-toggle-background-color;
307
-
308
- &:hover {
309
- background-color: $dark-legend-toggle-background-color;
310
- }
311
-
312
- &:active {
313
- background-color: $dark-legend-toggle-background-color;
314
- }
315
-
316
- &:not(:disabled):not(.disabled):active {
317
- background-color: $dark-current-warning-toggle-active-color;
318
- }
319
- }
320
-
321
- .light-gray-theme .legends-toggle {
322
- background-color: $light-gray-legend-toggle-background-color;
323
-
324
- &:hover {
325
- background-color: $light-gray-legend-toggle-background-color;
326
- }
327
-
328
- &:active {
329
- background-color: $light-gray-legend-toggle-background-color;
330
- }
331
-
332
- &:not(:disabled):not(.disabled):active {
333
- background-color: $light-gray-current-warning-toggle-active-color;
334
- }
335
- }
336
-
337
- .dark-gray-theme .legends-toggle {
338
- background-color: $dark-gray-legend-toggle-background-color;
339
-
340
- &:hover {
341
- background-color: $dark-gray-legend-toggle-background-color;
342
- }
343
-
344
- &:active {
345
- background-color: $dark-gray-legend-toggle-background-color;
346
- }
347
-
348
- &:not(:disabled):not(.disabled):active {
349
- background-color: $dark-gray-current-warning-toggle-active-color;
350
- }
351
- }
352
-
353
- .legends-container {
354
- padding: 15px;
355
- border-radius: 0;
356
- }
357
-
358
- .light-theme .legends-container {
359
- background-color: $light-legend-container-background-color;
360
- border-top: 0.5px solid $light-legend-background-color;
361
- }
362
-
363
- .dark-theme .legends-container {
364
- background-color: $dark-legend-container-background-color;
365
- border-top: 0.5px solid $dark-legend-background-color;
366
- }
367
-
368
- .light-gray-theme .legends-container {
369
- background-color: $light-gray-legend-container-background-color;
370
- border-top: 0.5px solid $light-gray-legend-background-color;
371
- }
372
-
373
- .dark-gray-theme .legends-container {
374
- background-color: $dark-gray-legend-container-background-color;
375
- border-top: 0.5px solid $dark-gray-legend-background-color;
376
- }
377
-
378
- div#legends-collapse div.card-body {
379
- padding: 0;
380
- }
381
-
382
170
  nav.symbol-list-header {
383
171
  padding-left: 0;
384
172
  text-align: left;
@@ -1,7 +1,9 @@
1
1
  <template>
2
2
  <div class="map-large focus-ring" :class="theme" tabindex="0">
3
3
  <div v-if="spinnerEnabled && loading" class="spinner-container text-center">
4
- <BSpinner />
4
+ <div class="spinner-border" role="status">
5
+ <span class="visually-hidden"></span>
6
+ </div>
5
7
  </div>
6
8
  <div ref="dayMapLarge" class="day-map-large">
7
9
  <svg
@@ -35,8 +37,8 @@
35
37
  <path
36
38
  v-for="path in seaBorders"
37
39
  :id="path.key"
38
- class="border-path"
39
40
  :key="path.key"
41
+ class="border-path"
40
42
  :stroke="strokeColor"
41
43
  :stroke-width="path.strokeWidth"
42
44
  :stroke-opacity="strokeOpacity"
@@ -134,17 +136,17 @@
134
136
  :d="path.d"
135
137
  fill-opacity="0"
136
138
  style="cursor: pointer; pointer-events: none" />
137
- <path
138
- v-for="path in landBorders"
139
- :id="path.key"
140
- class="border-path"
141
- :key="path.key"
142
- :stroke="strokeColor"
143
- :stroke-width="2*path.strokeWidth"
144
- :stroke-opacity="strokeOpacity"
145
- :d="path.d"
146
- fill-opacity="0"
147
- style="cursor: pointer; pointer-events: none" />
139
+ <path
140
+ v-for="path in landBorders"
141
+ :id="path.key"
142
+ :key="path.key"
143
+ class="border-path"
144
+ :stroke="strokeColor"
145
+ :stroke-width="2 * path.strokeWidth"
146
+ :stroke-opacity="strokeOpacity"
147
+ :d="path.d"
148
+ fill-opacity="0"
149
+ style="cursor: pointer; pointer-events: none" />
148
150
  </g>
149
151
  <g v-if="!loading">
150
152
  <path
@@ -257,17 +259,17 @@
257
259
 
258
260
  <script>
259
261
  import { onMounted, onUnmounted, ref } from 'vue'
262
+ import Panzoom from '@panzoom/panzoom'
260
263
 
261
264
  import config from '../mixins/config'
262
265
  import i18n from '../mixins/i18n'
263
- import Panzoom from '../mixins/panzoom'
264
266
  import utils from '../mixins/utils'
265
267
  import PopupRow from './PopupRow.vue'
266
268
 
267
269
  export default {
268
270
  name: 'MapLarge',
269
271
  components: { PopupRow },
270
- mixins: [config, i18n, Panzoom, utils],
272
+ mixins: [config, i18n, utils],
271
273
  props: {
272
274
  index: {
273
275
  type: Number,
@@ -386,23 +388,33 @@ export default {
386
388
  const maxWarningIcons = this.maxWarningIcons
387
389
  this.regionIds.forEach((regionId) => {
388
390
  const region = this.regionData(regionId)
389
- const geometry = this.geometries[this.geometryId][regionId]
391
+ const geometry = this.geometries?.[this.geometryId]?.[regionId]
390
392
  if (
393
+ geometry &&
391
394
  region != null &&
392
395
  geometry.children.length === 0 &&
393
396
  (!this.mergedRegions.has(regionId) ||
394
- (geometry.weight > this.maxMergedWeight && region?.warnings?.filter((warning) =>
395
- this.visibleWarnings.includes(warning.type)).length === 1) &&
396
- !(geometry?.parent?.length && this.regionData(geometry.parent)?.warnings?.some((warning) =>
397
- this.visibleWarnings.includes(warning.type))))
397
+ (geometry.weight > this.maxMergedWeight &&
398
+ region?.warnings?.filter((warning) =>
399
+ this.visibleWarnings.includes(warning.type)
400
+ ).length === 1 &&
401
+ !(
402
+ geometry?.parent?.length &&
403
+ this.regionData(geometry.parent)?.warnings?.some((warning) =>
404
+ this.visibleWarnings.includes(warning.type)
405
+ )
406
+ )))
398
407
  ) {
399
408
  const iconSizes = []
400
409
  const aspectRatios = []
401
410
  const keys = []
402
411
  const geoms = []
403
412
  region.warnings
404
- .filter((warning) => this.visibleWarnings.includes(warning.type) &&
405
- warning.coverage === 100 )
413
+ .filter(
414
+ (warning) =>
415
+ this.visibleWarnings.includes(warning.type) &&
416
+ warning.coverage === 100
417
+ )
406
418
  .forEach((regionWarning, index, regionWarnings) => {
407
419
  const identifier = regionWarning.identifiers.find(
408
420
  (id) => warnings[id] && warnings[id].covRegions.size === 0
@@ -920,12 +932,13 @@ export default {
920
932
  if (currentNode.parentNode === document) {
921
933
  return true
922
934
  }
923
- currentNode = currentNode.parentNode instanceof ShadowRoot
924
- ? currentNode.parentNode.host
925
- : currentNode.parentNode
935
+ currentNode =
936
+ currentNode.parentNode instanceof ShadowRoot
937
+ ? currentNode.parentNode.host
938
+ : currentNode.parentNode
926
939
  }
927
940
  return false
928
- }
941
+ },
929
942
  },
930
943
  }
931
944
  </script>
@@ -975,22 +988,8 @@ button.fmi-warnings-map-tool {
975
988
  background-repeat: no-repeat;
976
989
  background-position: center;
977
990
  cursor: pointer;
978
- }
979
-
980
- .light-theme button.fmi-warnings-map-tool {
981
- border-color: $light-button-border-color;
982
- }
983
-
984
- .dark-theme button.fmi-warnings-map-tool {
985
- border-color: $dark-button-border-color;
986
- }
987
-
988
- .light-gray-theme button.fmi-warnings-map-tool {
989
- border-color: $light-gray-button-border-color;
990
- }
991
-
992
- .dark-gray-theme button.fmi-warnings-map-tool {
993
- border-color: $dark-gray-button-border-color;
991
+ border: none;
992
+ padding: 0;
994
993
  }
995
994
 
996
995
  div.map-large div.day-map-large button {
@@ -1,5 +1,8 @@
1
1
  <template>
2
- <div :id="`day-map-small-${index}`" class="map-small">
2
+ <div
3
+ :id="`day-map-small-${index}`"
4
+ class="map-small"
5
+ >
3
6
  <svg
4
7
  class="finland-small"
5
8
  xmlns="http://www.w3.org/2000/svg"
@@ -9,8 +12,12 @@
9
12
  height="120"
10
13
  viewBox="0 0 75 120"
11
14
  stroke-linecap="round"
12
- stroke-linejoin="round">
13
- <g v-if="pathsNeeded" :id="`finland-small-${index}`">
15
+ stroke-linejoin="round"
16
+ >
17
+ <g
18
+ v-if="pathsNeeded"
19
+ :id="`finland-small-${index}`"
20
+ >
14
21
  <path
15
22
  v-for="path in bluePaths"
16
23
  :key="path.key"
@@ -18,15 +25,17 @@
18
25
  :stroke-width="path.strokeWidth"
19
26
  :fill="path.fill"
20
27
  :d="path.d"
21
- :opacity="path.opacity" />
28
+ :opacity="path.opacity"
29
+ />
22
30
  <path
23
31
  v-for="path in seaBorders"
24
- class="border-path"
25
32
  :key="path.key"
33
+ class="border-path"
26
34
  :stroke="strokeColor"
27
35
  :stroke-width="path.strokeWidth"
28
36
  :d="path.d"
29
- fill-opacity="0" />
37
+ fill-opacity="0"
38
+ />
30
39
  <path
31
40
  v-for="path in greenPaths"
32
41
  :key="path.key"
@@ -34,7 +43,8 @@
34
43
  :stroke-width="path.strokeWidth"
35
44
  :fill="path.fill"
36
45
  :d="path.d"
37
- :opacity="path.opacity" />
46
+ :opacity="path.opacity"
47
+ />
38
48
  <path
39
49
  v-for="path in yellowPaths"
40
50
  :key="path.key"
@@ -42,7 +52,8 @@
42
52
  :stroke-width="path.strokeWidth"
43
53
  :fill="path.fill"
44
54
  :d="path.d"
45
- :opacity="path.opacity" />
55
+ :opacity="path.opacity"
56
+ />
46
57
  <path
47
58
  v-for="coverage in yellowCoverages"
48
59
  :key="coverage.key"
@@ -51,7 +62,8 @@
51
62
  :fill="coverage.fill"
52
63
  :d="coverage.d"
53
64
  :fill-opacity="coverage.fillOpacity"
54
- pointer-events="fill" />
65
+ pointer-events="fill"
66
+ />
55
67
  <path
56
68
  v-for="path in orangePaths"
57
69
  :key="path.key"
@@ -59,7 +71,8 @@
59
71
  :stroke-width="path.strokeWidth"
60
72
  :fill="path.fill"
61
73
  :d="path.d"
62
- :opacity="path.opacity" />
74
+ :opacity="path.opacity"
75
+ />
63
76
  <path
64
77
  v-for="coverage in orangeCoverages"
65
78
  :key="coverage.key"
@@ -68,7 +81,8 @@
68
81
  :fill="coverage.fill"
69
82
  :d="coverage.d"
70
83
  :fill-opacity="coverage.fillOpacity"
71
- pointer-events="fill" />
84
+ pointer-events="fill"
85
+ />
72
86
  <path
73
87
  v-for="path in redPaths"
74
88
  :key="path.key"
@@ -76,7 +90,8 @@
76
90
  :stroke-width="path.strokeWidth"
77
91
  :fill="path.fill"
78
92
  :d="path.d"
79
- :opacity="path.opacity" />
93
+ :opacity="path.opacity"
94
+ />
80
95
  <path
81
96
  v-for="coverage in redCoverages"
82
97
  :key="coverage.key"
@@ -85,22 +100,25 @@
85
100
  :fill="coverage.fill"
86
101
  :d="coverage.d"
87
102
  :fill-opacity="coverage.fillOpacity"
88
- pointer-events="fill" />
103
+ pointer-events="fill"
104
+ />
89
105
  <path
90
106
  v-for="path in overlayPaths"
91
107
  :key="path.key"
92
108
  :stroke="strokeColor"
93
109
  :stroke-width="path.strokeWidth"
94
110
  :d="path.d"
95
- fill-opacity="0" />
111
+ fill-opacity="0"
112
+ />
96
113
  <path
97
114
  v-for="path in landBorders"
98
- class="border-path"
99
115
  :key="path.key"
116
+ class="border-path"
100
117
  :stroke="strokeColor"
101
- :stroke-width="1.5*path.strokeWidth"
118
+ :stroke-width="1.5 * path.strokeWidth"
102
119
  :d="path.d"
103
- fill-opacity="0" />
120
+ fill-opacity="0"
121
+ />
104
122
  <path
105
123
  v-for="coverage in overlayCoverages"
106
124
  :key="coverage.key"
@@ -109,7 +127,8 @@
109
127
  :fill="coverage.fill"
110
128
  :d="coverage.d"
111
129
  :fill-opacity="coverage.fillOpacity"
112
- pointer-events="fill" />
130
+ pointer-events="fill"
131
+ />
113
132
  </g>
114
133
  </svg>
115
134
  </div>
@@ -177,7 +196,7 @@ export default {
177
196
  return 'Small'
178
197
  },
179
198
  strokeColor() {
180
- return 'DarkSlateGray'
199
+ return 'DarkSlateGray'
181
200
  },
182
201
  strokeWidth() {
183
202
  return 0.6
@@ -199,11 +218,10 @@ export default {
199
218
  paths(options) {
200
219
  return this.pathsNeeded
201
220
  ? this.regionIds.reduce((regions, regionId) => {
221
+ const region = this.geometries?.[this.geometryId]?.[regionId]
202
222
  if (
203
- this.geometries[this.geometryId][regionId].pathSmall &&
204
- (this.geometries[this.geometryId][regionId].type ===
205
- options.type) ===
206
- (this.geometries[this.geometryId][regionId].subType == null)
223
+ region?.pathSmall &&
224
+ (region.type === options.type) === (region.subType == null)
207
225
  ) {
208
226
  const visualization = this.regionVisualization(regionId)
209
227
  if (
@@ -213,14 +231,12 @@ export default {
213
231
  regions.push({
214
232
  key: `${regionId}${this.size}${this.index}Path`,
215
233
  fill: this.loading
216
- ? this.colors[this.theme].missing
234
+ ? this.colors?.[this.theme]?.missing || '#cccccc'
217
235
  : visualization.color,
218
236
  d: visualization.geom.pathSmall,
219
237
  opacity: visualization.visible ? '1' : '0',
220
238
  strokeWidth:
221
- this.geometries[this.geometryId][regionId].type === 'sea' &&
222
- this.geometries[this.geometryId][regionId].subType !==
223
- 'lake'
239
+ region.type === 'sea' && region.subType !== 'lake'
224
240
  ? this.strokeWidth
225
241
  : 0,
226
242
  })
@@ -231,7 +247,7 @@ export default {
231
247
  : []
232
248
  },
233
249
  isFullMode() {
234
- return true;
250
+ return true
235
251
  },
236
252
  },
237
253
  }
@@ -9,20 +9,23 @@
9
9
  `level-${severity}`,
10
10
  typeClass,
11
11
  'warning-image',
12
- ]">
12
+ ]"
13
+ >
13
14
  <span
14
15
  :class="[
15
16
  'symbol-text',
16
17
  `transform-rotate-${invertedRotation}`,
17
18
  'warning-symbol-text',
18
- ]">
19
+ ]"
20
+ >
19
21
  {{ input.text }}
20
22
  </span>
21
23
  </div>
22
24
  <div
23
25
  class="popup-table-cell popup-table-text-cell"
24
26
  :class="[`text-level-${severity}`]"
25
- v-html="input.interval"></div>
27
+ v-html="input.interval"
28
+ ></div>
26
29
  </div>
27
30
  </template>
28
31