@fmidev/smartmet-alert-client 4.2.7 → 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 (127) hide show
  1. package/.eslintignore +2 -14
  2. package/.github/workflows/test.yaml +26 -0
  3. package/.nvmrc +1 -0
  4. package/dist/index.dark.html +1 -1
  5. package/dist/index.en.html +1 -1
  6. package/dist/index.fi.html +1 -1
  7. package/dist/index.html +5 -0
  8. package/dist/index.js +105 -135
  9. package/dist/index.mjs +112 -135
  10. package/dist/index.sv.html +1 -1
  11. package/dist/locale-en-DCEKDw5G.js +8 -0
  12. package/dist/locale-fi-DPiOM1rB.js +8 -0
  13. package/dist/locale-sv-B0FlbgEF.js +8 -0
  14. package/dist/vendor-Cfkkvdz7.js +21 -0
  15. package/dist/vue/index.mjs +15245 -0
  16. package/dist/vue/style.css +1 -0
  17. package/dist/xml-parser-BiNO9kc-.js +13 -0
  18. package/package.json +61 -25
  19. package/public/index.dark.html +1 -1
  20. package/public/index.en.html +1 -1
  21. package/public/index.fi.html +1 -1
  22. package/public/index.sv.html +1 -1
  23. package/src/AlertClientVue.vue +170 -0
  24. package/src/App.vue +58 -176
  25. package/src/assets/img/ui/arrow-down.svg +4 -14
  26. package/src/assets/img/ui/arrow-up.svg +4 -14
  27. package/src/assets/img/ui/clear.svg +7 -21
  28. package/src/assets/img/ui/close.svg +4 -15
  29. package/src/assets/img/ui/toggle-selected.svg +12 -0
  30. package/src/assets/img/ui/toggle-unselected.svg +12 -0
  31. package/src/assets/img/warning/cold-weather.svg +3 -6
  32. package/src/assets/img/warning/flood-level-3.svg +4 -7
  33. package/src/assets/img/warning/forest-fire-weather.svg +2 -6
  34. package/src/assets/img/warning/grass-fire-weather.svg +2 -6
  35. package/src/assets/img/warning/hot-weather.svg +3 -6
  36. package/src/assets/img/warning/pedestrian-safety.svg +3 -7
  37. package/src/assets/img/warning/rain.svg +2 -7
  38. package/src/assets/img/warning/sea-icing.svg +2 -6
  39. package/src/assets/img/warning/sea-thunder-storm.svg +2 -5
  40. package/src/assets/img/warning/sea-water-height-high-water.svg +3 -8
  41. package/src/assets/img/warning/sea-water-height-shallow-water.svg +3 -7
  42. package/src/assets/img/warning/sea-wave-height.svg +4 -7
  43. package/src/assets/img/warning/sea-wind-legend.svg +2 -5
  44. package/src/assets/img/warning/sea-wind.svg +2 -5
  45. package/src/assets/img/warning/several.svg +2 -5
  46. package/src/assets/img/warning/thunder-storm.svg +2 -5
  47. package/src/assets/img/warning/traffic-weather.svg +2 -6
  48. package/src/assets/img/warning/uv-note.svg +2 -6
  49. package/src/assets/img/warning/wind.svg +2 -5
  50. package/src/components/AlertClient.vue +42 -20
  51. package/src/components/CollapsiblePanel.vue +284 -0
  52. package/src/components/DayLarge.vue +40 -32
  53. package/src/components/DaySmall.vue +17 -7
  54. package/src/components/Days.vue +77 -52
  55. package/src/components/DescriptionWarning.vue +26 -8
  56. package/src/components/GrayScaleToggle.vue +42 -35
  57. package/src/components/Legend.vue +36 -240
  58. package/src/components/MapLarge.vue +55 -50
  59. package/src/components/MapSmall.vue +48 -29
  60. package/src/components/PopupRow.vue +6 -3
  61. package/src/components/Region.vue +162 -53
  62. package/src/components/RegionWarning.vue +33 -11
  63. package/src/components/Regions.vue +59 -29
  64. package/src/components/Warning.vue +53 -49
  65. package/src/components/Warnings.vue +54 -16
  66. package/src/locales/en.json +21 -4
  67. package/src/locales/fi.json +23 -6
  68. package/src/locales/sv.json +20 -3
  69. package/src/main.js +1 -0
  70. package/src/mixins/alertClientCore.js +210 -0
  71. package/src/mixins/config.js +263 -257
  72. package/src/mixins/utils.js +46 -15
  73. package/src/plugins/index.js +1 -1
  74. package/src/scss/_utilities.scss +193 -0
  75. package/src/scss/backgrounds.scss +2 -0
  76. package/src/scss/colors.scss +5 -3
  77. package/src/scss/constants.scss +3 -2
  78. package/src/scss/themes/dark-gray.scss +3 -3
  79. package/src/scss/themes/dark.scss +1 -1
  80. package/src/scss/themes/light-gray.scss +5 -5
  81. package/src/scss/themes/light.scss +3 -3
  82. package/src/scss/warningImages.scss +9 -5
  83. package/src/vue.js +41 -0
  84. package/svgo.config.js +45 -0
  85. package/tests/README.md +430 -0
  86. package/tests/fixtures/mockWarningData.js +135 -0
  87. package/tests/integration/warning-flow.spec.js +452 -0
  88. package/tests/setup.js +41 -0
  89. package/tests/unit/components/AlertClient.spec.js +734 -0
  90. package/tests/unit/components/DayLarge.spec.js +281 -0
  91. package/tests/unit/components/DaySmall.spec.js +278 -0
  92. package/tests/unit/components/Days.spec.js +565 -0
  93. package/tests/unit/components/DescriptionWarning.spec.js +432 -0
  94. package/tests/unit/components/GrayScaleToggle.spec.js +311 -0
  95. package/tests/unit/components/Legend.spec.js +223 -0
  96. package/tests/unit/components/MapLarge.spec.js +276 -0
  97. package/tests/unit/components/MapSmall.spec.js +226 -0
  98. package/tests/unit/components/PopupRow.spec.js +261 -0
  99. package/tests/unit/components/Region.spec.js +430 -0
  100. package/tests/unit/components/RegionWarning.snapshot.spec.js +73 -0
  101. package/tests/unit/components/RegionWarning.spec.js +408 -0
  102. package/tests/unit/components/Regions.spec.js +335 -0
  103. package/tests/unit/components/Warning.snapshot.spec.js +107 -0
  104. package/tests/unit/components/Warning.spec.js +472 -0
  105. package/tests/unit/components/Warnings.spec.js +329 -0
  106. package/tests/unit/components/__snapshots__/RegionWarning.snapshot.spec.js.snap +21 -0
  107. package/tests/unit/components/__snapshots__/Warning.snapshot.spec.js.snap +199 -0
  108. package/tests/unit/mixins/config.spec.js +269 -0
  109. package/tests/unit/mixins/i18n.spec.js +115 -0
  110. package/tests/unit/mixins/keycodes.spec.js +37 -0
  111. package/tests/unit/mixins/utils.spec.js +624 -0
  112. package/vite.config.js +96 -26
  113. package/vitest.config.js +40 -0
  114. package/dist/index.mjs.map +0 -1
  115. package/dist/index.relative.html +0 -19
  116. package/dist/index.start.html +0 -20
  117. package/playwright.config.ts +0 -18
  118. package/public/index.relative.html +0 -19
  119. package/public/index.start.html +0 -20
  120. package/src/assets/img/ui/toggle-selected-blue.svg +0 -4
  121. package/src/assets/img/ui/toggle-selected-dark.svg +0 -4
  122. package/src/assets/img/ui/toggle-selected-light.svg +0 -4
  123. package/src/assets/img/ui/toggle-unselected-dark.svg +0 -4
  124. package/src/assets/img/ui/toggle-unselected-light.svg +0 -4
  125. package/src/mixins/panzoom.js +0 -900
  126. package/test/snapshot.test.ts +0 -126
  127. package/vitest.config.ts +0 -6
@@ -1,44 +1,47 @@
1
1
  <template>
2
- <b-card no-body class="mb-1 current-warning-panel" :class="theme">
3
- <b-card-header header-tag="header" class="p-1">
2
+ <h3>
3
+ <button
4
+ :id="`accordion-${code}`"
5
+ type="button"
6
+ :aria-expanded="open"
7
+ :class="['accordion-trigger', 'focus-ring', open ? '' : 'collapsed']"
8
+ :aria-controls="`accordion-section-${code}`"
9
+ :aria-label="ariaButton"
10
+ @click="onRegionToggle">
4
11
  <div class="region-header">
12
+ <span class="region-item-text">
13
+ {{ regionName }}
14
+ </span>
5
15
  <div>
6
16
  <RegionWarning
7
17
  v-for="warning in warningsSummary"
8
18
  :key="warning.key"
9
- :input="warning"></RegionWarning>
19
+ :input="warning"
20
+ :language="language">
21
+ </RegionWarning>
10
22
  </div>
11
- <span class="region-item-text">
12
- {{ regionName }}
13
- </span>
14
23
  </div>
15
- <b-button
16
- block
17
- :class="['current-warning-toggle', visible ? '' : 'collapsed']"
18
- :aria-label="ariaButton"
19
- @click="onRegionToggle" />
20
- </b-card-header>
21
- <b-collapse
22
- :id="identifier"
23
- v-model="visible"
24
- class="accordion-item-region focus-ring"
25
- :accordion="`accordion-${type}`"
26
- tabindex="0"
27
- :aria-label="ariaInfo">
28
- <b-card-body body-class="p-0">
29
- <div class="current-description">
30
- <div class="current-description-table">
31
- <DescriptionWarning
32
- v-for="warning in reducedWarnings"
33
- :key="warning.identification"
34
- :input="warning"
35
- :theme="theme"
36
- :language="language" />
37
- </div>
38
- </div>
39
- </b-card-body>
40
- </b-collapse>
41
- </b-card>
24
+ <div block :class="['current-warning-toggle', open ? '' : 'collapsed']" />
25
+ </button>
26
+ </h3>
27
+ <div
28
+ :id="`accordion-section-${code}`"
29
+ role="region"
30
+ :aria-labelledby="`accordion-${code}`"
31
+ :aria-expanded="open"
32
+ class="accordion-panel"
33
+ :hidden="open ? null : ''">
34
+ <div class="current-description">
35
+ <div class="current-description-table">
36
+ <DescriptionWarning
37
+ v-for="warning in reducedWarnings"
38
+ :key="warning.identification"
39
+ :input="warning"
40
+ :theme="theme"
41
+ :language="language" />
42
+ </div>
43
+ </div>
44
+ </div>
42
45
  </template>
43
46
 
44
47
  <script>
@@ -55,10 +58,6 @@ export default {
55
58
  type: {
56
59
  type: String,
57
60
  },
58
- shown: {
59
- type: Boolean,
60
- default: false,
61
- },
62
61
  code: {
63
62
  type: String,
64
63
  },
@@ -83,7 +82,7 @@ export default {
83
82
  },
84
83
  data() {
85
84
  return {
86
- visible: this.shown,
85
+ open: false,
87
86
  }
88
87
  },
89
88
  computed: {
@@ -131,7 +130,7 @@ export default {
131
130
  },
132
131
  ariaButton() {
133
132
  return `${
134
- this.visible
133
+ this.open
135
134
  ? this.t('infoButtonAriaLabelCloseRegion')
136
135
  : this.t('infoButtonAriaLabelShowRegion')
137
136
  } ${this.regionName} ${this.t('infoButtonAriaLabelValidWarnings')}`
@@ -145,17 +144,9 @@ export default {
145
144
  )
146
145
  },
147
146
  },
148
- watch: {
149
- shown(isShown) {
150
- this.visible = isShown
151
- },
152
- },
153
147
  methods: {
154
148
  onRegionToggle() {
155
- this.$emit('regionToggled', {
156
- code: this.code,
157
- shown: !this.visible,
158
- })
149
+ this.open = !this.open
159
150
  },
160
151
  },
161
152
  }
@@ -197,18 +188,25 @@ export default {
197
188
 
198
189
  button {
199
190
  border: none;
191
+ cursor: pointer;
192
+ &:focus:not(:focus-visible) {
193
+ box-shadow: none;
194
+ }
200
195
  }
201
196
 
202
197
  .region-header {
203
198
  position: absolute;
204
199
  left: 0;
205
200
  right: 38px;
201
+ display: flex;
202
+ align-items: center;
203
+ justify-content: space-between;
204
+ height: $current-warning-height;
206
205
  }
207
206
 
208
207
  .region-item-text {
209
208
  display: block;
210
209
  text-align: left;
211
- line-height: $current-warning-height;
212
210
  white-space: nowrap;
213
211
  overflow: hidden;
214
212
  text-overflow: ellipsis;
@@ -303,22 +301,22 @@ button {
303
301
  }
304
302
 
305
303
  .light-theme .current-description {
306
- border-top: 1px solid $light-description-border-color;
304
+ border-top: 0.5px solid $light-description-border-color;
307
305
  background-color: $light-description-background-color;
308
306
  }
309
307
 
310
308
  .dark-theme .current-description {
311
- border-top: 1px solid $dark-description-border-color;
309
+ border-top: 0.5px solid $dark-description-border-color;
312
310
  background-color: $dark-description-background-color;
313
311
  }
314
312
 
315
313
  .light-gray-theme .current-description {
316
- border-top: 1px solid $light-gray-description-border-color;
314
+ border-top: 0.5px solid $light-gray-description-border-color;
317
315
  background-color: $light-gray-description-background-color;
318
316
  }
319
317
 
320
318
  .dark-gray-theme .current-description {
321
- border-top: 1px solid $dark-gray-description-border-color;
319
+ border-top: 0.5px solid $dark-gray-description-border-color;
322
320
  background-color: $dark-gray-description-background-color;
323
321
  }
324
322
 
@@ -333,4 +331,115 @@ div.accordion-item-region {
333
331
  padding: 0;
334
332
  }
335
333
  }
334
+
335
+ h3 {
336
+ margin: 0;
337
+ padding: 0;
338
+ }
339
+
340
+ .accordion-trigger {
341
+ background: none;
342
+ color: hsl(0deg 0% 13%);
343
+ display: block;
344
+ font-size: $font-size;
345
+ font-weight: normal;
346
+ margin: 0;
347
+ padding: 0;
348
+ position: relative;
349
+ text-align: left;
350
+ width: 100%;
351
+ outline: none;
352
+ }
353
+
354
+ .accordion > div:first-child .accordion-trigger > .region-header {
355
+ border-radius: 0;
356
+ }
357
+
358
+ .accordion > div:last-child .accordion-trigger.collapsed > .region-header {
359
+ border-radius: 0;
360
+ }
361
+
362
+ .accordion > div:first-child:last-child .accordion-trigger > .region-header {
363
+ border-radius: 0;
364
+ }
365
+
366
+ .accordion
367
+ > div:first-child:last-child
368
+ .accordion-trigger.collapsed
369
+ > .region-header {
370
+ border-radius: 0;
371
+ }
372
+
373
+ .accordion > div:first-child > h3 > button,
374
+ .accordion > div:first-child > h3 > button:hover {
375
+ border-radius: 0;
376
+ }
377
+
378
+ .accordion > div:last-child > h3 > button.collapsed,
379
+ .accordion > div:last-child > h3 > button.collapsed:hover {
380
+ border-radius: 0;
381
+ }
382
+
383
+ .accordion > div:first-child:last-child > h3 > button,
384
+ .accordion > div:first-child:last-child > h3 > button:hover {
385
+ border-radius: 0;
386
+ }
387
+
388
+ .accordion > div:first-child:last-child > h3 > button.collapsed,
389
+ .accordion > div:first-child:last-child > h3 > button.collapsed:hover {
390
+ border-radius: 0;
391
+ }
392
+
393
+ .accordion > div:last-child .current-description {
394
+ border-radius: 0;
395
+ }
396
+
397
+ .accordion > div:first-child > div > h3 > button > div.current-warning-toggle {
398
+ border-radius: 0;
399
+ }
400
+
401
+ .accordion
402
+ > div:last-child
403
+ > div
404
+ > h3
405
+ > button
406
+ > div.current-warning-toggle.collapsed {
407
+ border-radius: 0;
408
+ }
409
+
410
+ .accordion
411
+ > div:first-child:last-child
412
+ > div
413
+ > h3
414
+ > button
415
+ > div.current-warning-toggle {
416
+ border-radius: 0;
417
+ }
418
+
419
+ .accordion
420
+ > div:first-child:last-child
421
+ > div
422
+ > h3
423
+ > button
424
+ > div.current-warning-toggle.collapsed {
425
+ border-radius: 0;
426
+ }
427
+
428
+ button {
429
+ border-style: none;
430
+ }
431
+
432
+ .accordion button::-moz-focus-inner {
433
+ border: 0;
434
+ }
435
+
436
+ .accordion-panel {
437
+ margin: 0;
438
+ padding: 0;
439
+ }
440
+
441
+ /* For Edge bug https://developer.microsoft.com/en-us/microsoft-edge/platform/issues/4806035/ */
442
+ .accordion-panel[hidden] {
443
+ display: none;
444
+ }
336
445
  </style>
@@ -8,7 +8,9 @@
8
8
  `symbol-rotate-${rotation}`,
9
9
  `level-${input.severity}`,
10
10
  `${typeClass}`,
11
- ]">
11
+ ]"
12
+ :aria-label="`${warningLevel} ${warningTypeText}${warningDetails}`"
13
+ >
12
14
  <span
13
15
  aria-hidden="true"
14
16
  :class="[
@@ -16,19 +18,43 @@
16
18
  'symbol-text',
17
19
  `transform-rotate-${invertedRotation}`,
18
20
  ]"
19
- >{{ input.text }}</span
20
- >
21
+ >{{ input.text }}</span>
21
22
  </div>
22
23
  </template>
23
24
 
24
25
  <script>
25
26
  import fields from '../mixins/fields'
27
+ import i18n from '../mixins/i18n'
26
28
  import utils from '../mixins/utils'
27
29
 
28
30
  export default {
29
31
  name: 'RegionWarning',
30
- mixins: [fields, utils],
31
- props: ['input'],
32
+ mixins: [fields, i18n, utils],
33
+ props: {
34
+ input: {
35
+ type: Object,
36
+ default: null,
37
+ },
38
+ language: {
39
+ type: String,
40
+ },
41
+ },
42
+ computed: {
43
+ warningLevel() {
44
+ return this.t(`warningLevel${this.input.severity}`)
45
+ },
46
+ warningTypeText() {
47
+ return this.t(this.input.type).toLowerCase()
48
+ },
49
+ warningDetails() {
50
+ if (this.input.text == null || this.input.direction == null) {
51
+ return ''
52
+ }
53
+ return ` (${this.input.text} m/s ${this.t('fromDirection')} ${
54
+ this.input.direction + 180
55
+ }°)`
56
+ },
57
+ },
32
58
  }
33
59
  </script>
34
60
 
@@ -47,15 +73,11 @@ div.warning-image {
47
73
  }
48
74
 
49
75
  .current-warning-image {
50
- background-size: 28px 28px;
76
+ background-size: $current-warning-image-height $current-warning-image-height;
51
77
  height: $current-warning-image-height;
52
78
  width: $current-warning-image-height;
53
- margin-top: calc(
54
- ($current-warning-height - $current-warning-image-height) / 2
55
- );
79
+ margin: 0 5px;
56
80
  float: right;
57
- margin-left: 5px;
58
- margin-right: 5px;
59
81
  }
60
82
 
61
83
  span.warning-symbol-text {
@@ -1,53 +1,82 @@
1
1
  <template>
2
- <div id="region-warnings" class="row">
3
- <div v-if="anyLandWarnings" class="region-type-container">
4
- <h3 id="header-land" class="header-region">{{ landText }}</h3>
2
+ <div
3
+ id="region-warnings"
4
+ class="row"
5
+ >
6
+ <div
7
+ v-if="anyLandWarnings"
8
+ class="region-type-container"
9
+ >
10
+ <h3
11
+ id="header-land"
12
+ class="header-region"
13
+ >
14
+ {{ landText }}
15
+ </h3>
5
16
  <a
6
17
  id="fmi-warnings-region-content"
7
18
  :href="fromLandToNextContentHref"
8
19
  tabindex="0"
9
20
  class="fmi-warnings-to-next-content visually-hidden-focusable focus-ring"
10
21
  @click="fromLandToNextContentClicked"
11
- >{{ fromLandToNextContentText }}</a
22
+ >{{ fromLandToNextContentText }}</a>
23
+ <div
24
+ id="accordion-group-land"
25
+ class="accordion"
12
26
  >
13
- <div id="accordion-land" class="accordion-region" role="tablist">
14
- <div v-for="region in regions.land" :key="region.key">
27
+ <div
28
+ v-for="region in regions.land"
29
+ :key="region.key"
30
+ >
15
31
  <Region
16
32
  v-if="region.warnings.length"
17
33
  type="land"
18
- :shown="shownRegion === region.key"
19
34
  :code="region.key"
20
35
  :name="region.name"
21
36
  :input="region.warnings"
22
37
  :warnings="warnings"
38
+ :theme="theme"
23
39
  :language="language"
24
- @regionToggled="onRegionToggled" />
40
+ />
25
41
  </div>
26
42
  </div>
27
43
  </div>
28
- <div v-if="anySeaWarnings" class="region-type-container">
29
- <h3 id="header-sea" class="header-region">{{ seaText }}</h3>
44
+
45
+ <div
46
+ v-if="anySeaWarnings"
47
+ class="region-type-container"
48
+ >
49
+ <h3
50
+ id="header-sea"
51
+ class="header-region"
52
+ >
53
+ {{ seaText }}
54
+ </h3>
30
55
  <a
31
56
  :id="fromSeaToNextContentId"
32
57
  href="#fmi-warnings-end-of-regions"
33
58
  tabindex="0"
34
59
  class="fmi-warnings-to-next-content visually-hidden-focusable focus-ring"
35
60
  @click="fromSeaToNextContentClicked"
36
- >{{ fromSeaToNextContentText }}</a
61
+ >{{ fromSeaToNextContentText }}</a>
62
+ <div
63
+ id="accordion-group-sea"
64
+ class="accordion"
37
65
  >
38
- <div id="accordion-sea" class="accordion-region" role="tablist">
39
- <div v-for="region in regions.sea" :key="region.key">
66
+ <div
67
+ v-for="region in regions.sea"
68
+ :key="region.key"
69
+ >
40
70
  <Region
41
71
  v-if="region.warnings.length"
42
72
  type="sea"
43
- :shown="shownRegion === region.key"
44
73
  :code="region.key"
45
74
  :name="region.name"
46
75
  :input="region.warnings"
47
76
  :warnings="warnings"
48
77
  :theme="theme"
49
78
  :language="language"
50
- @regionToggled="onRegionToggled" />
79
+ />
51
80
  </div>
52
81
  </div>
53
82
  </div>
@@ -77,11 +106,6 @@ export default {
77
106
  theme: String,
78
107
  language: String,
79
108
  },
80
- data() {
81
- return {
82
- shownRegion: null,
83
- }
84
- },
85
109
  computed: {
86
110
  landText() {
87
111
  return this.t('regionLand')
@@ -90,14 +114,14 @@ export default {
90
114
  return this.t('regionSea')
91
115
  },
92
116
  fromLandToNextContentText() {
93
- return `${this.t('warningsInAreaStart')} ${
94
- this.regions.land.length
95
- } ${this.t('warningsInAreaEnd')} ${this.t('toNextContent')}`
117
+ return `${this.t('warningsInAreasStart')} ${this.t(
118
+ `in${this.regions.land.length}Areas`
119
+ )}. ${this.t('toNextContent')}`
96
120
  },
97
121
  fromSeaToNextContentText() {
98
- return `${this.t('warningsInAreaStart')} ${
99
- this.regions.sea.length
100
- } ${this.t('warningsInAreaEnd')} ${this.t('toNextContent')}`
122
+ return `${this.t('warningsInAreasStart')} ${this.t(
123
+ `in${this.regions.sea.length}Areas`
124
+ )}. ${this.t('toNextContent')}`
101
125
  },
102
126
  fromLandToNextContentHref() {
103
127
  return this.anySeaWarnings
@@ -155,9 +179,6 @@ export default {
155
179
  this.regions[regionType].length > 0
156
180
  )
157
181
  },
158
- onRegionToggled({ code, shown }) {
159
- this.shownRegion = shown ? code : null
160
- },
161
182
  fromLandToNextContentClicked() {
162
183
  const nextContent = this.$el.querySelector(this.fromLandToNextContentHref)
163
184
  nextContent.scrollIntoView()
@@ -209,4 +230,13 @@ div.region-type-container {
209
230
  width: 100%;
210
231
  padding: 0;
211
232
  }
233
+
234
+ div.accordion {
235
+ margin: 0;
236
+ border: 0.5px solid $variant-gray-darker;
237
+ border-radius: 0;
238
+ > * + * {
239
+ border-top: 0.5px solid $variant-gray-darker;
240
+ }
241
+ }
212
242
  </style>
@@ -1,13 +1,21 @@
1
1
  <template>
2
- <div class="symbol-list-table" :class="theme">
2
+ <div
3
+ class="symbol-list-table"
4
+ :class="theme"
5
+ >
3
6
  <div class="symbol-list-cell symbol-list-cell-image">
4
7
  <div
5
- :class="`level-${severity} ${typeClass} symbol-list-image-column symbol-list-image warning-image`"></div>
8
+ :class="`level-${severity} ${typeClass} symbol-list-image-column symbol-list-image warning-image`"
9
+ :aria-label="`${warningLevelText} ${title.toLowerCase()}`"
10
+ ></div>
6
11
  </div>
7
12
  <div class="symbol-list-cell symbol-list-cell-text">
8
13
  <div class="symbol-list-text-select">
9
14
  <!-- eslint-disable-next-line vue/no-v-html -->
10
- <div class="item-text symbol-list-text" v-html="title"></div>
15
+ <div
16
+ class="item-text symbol-list-text"
17
+ v-html="title"
18
+ ></div>
11
19
  <div class="symbol-list-select-container d-none d-md-table-cell">
12
20
  <div
13
21
  :id="id"
@@ -18,11 +26,19 @@
18
26
  'focus-ring',
19
27
  'd-none',
20
28
  ]"
29
+ role="button"
21
30
  tabindex="0"
31
+ :aria-pressed="input.visible ? 'true' : 'false'"
32
+ :aria-label="title.replace(/&[^;]*;/g, '')"
22
33
  @mousedown="preventEvents"
23
34
  @click="toggle"
24
35
  @keydown.enter="toggle"
25
- @keydown.space="toggle" />
36
+ @keydown.space="toggle"
37
+ >
38
+ <span>
39
+ {{ toggleText }}
40
+ </span>
41
+ </div>
26
42
  </div>
27
43
  </div>
28
44
  <hr />
@@ -46,6 +62,12 @@ export default {
46
62
  title() {
47
63
  return this.t(this.input.type)
48
64
  },
65
+ warningLevelText() {
66
+ return this.t(`warningLevel${this.severity}`)
67
+ },
68
+ toggleText() {
69
+ return this.input.visible ? this.t('toggleOn') : this.t('toggleOff')
70
+ },
49
71
  },
50
72
  methods: {
51
73
  toggle(event) {
@@ -151,7 +173,6 @@ hr {
151
173
 
152
174
  div#fmi-warnings-list div.symbol-list-cell-text {
153
175
  padding-right: 0;
154
-
155
176
  hr {
156
177
  margin-right: 0;
157
178
  }
@@ -172,70 +193,53 @@ div.symbol-list-text {
172
193
  display: table-cell;
173
194
  height: $symbol-list-line-height;
174
195
  max-width: 141px;
175
- padding-right: 5px;
196
+ padding-right: 10px;
197
+ word-break: break-word;
176
198
  hyphens: auto;
177
199
  }
178
200
 
179
201
  .symbol-list-select-container {
180
- width: 30px;
202
+ width: 55px;
181
203
  height: $symbol-list-line-height;
182
204
  display: table-cell;
183
205
  vertical-align: middle;
184
206
  }
185
207
 
186
- .symbol-list-select {
208
+ .symbol-list-select.d-md-block {
209
+ display: flex !important;
210
+ align-items: center;
211
+ justify-content: center;
187
212
  width: 100%;
188
213
  height: $symbol-list-select-height;
214
+ cursor: pointer;
189
215
  margin: 0;
190
216
  background-repeat: no-repeat;
191
217
  background-position: center;
192
- }
193
-
194
- .flag-selected {
195
- cursor: pointer;
196
- }
197
-
198
- .light-theme .flag-selected {
199
- background-image: url($ui-image-path + 'toggle-selected-blue' + $image-extension);
200
- }
201
-
202
- .dark-theme .flag-selected {
203
- background-image: url($ui-image-path + 'toggle-selected-light' + $image-extension);
204
- }
205
-
206
- .light-gray-theme .flag-selected {
207
- background-image: url($ui-image-path + 'toggle-selected-dark' + $image-extension);
208
- }
209
-
210
- .dark-gray-theme .flag-selected {
211
- background-image: url($ui-image-path + 'toggle-selected-light' + $image-extension);
212
- }
213
-
214
- .flag-unselected {
215
- cursor: pointer;
216
- }
217
-
218
- .light-theme .flag-unselected {
219
- background-image: url($ui-image-path + 'toggle-unselected-light' + $image-extension);
220
- }
221
-
222
- .dark-theme .flag-unselected {
223
- background-image: url($ui-image-path + 'toggle-unselected-dark' + $image-extension);
224
- }
225
-
226
- .light-gray-theme .flag-unselected {
227
- background-image: url($ui-image-path + 'toggle-unselected-light' + $image-extension);
228
- }
229
-
230
- .dark-gray-theme .flag-unselected {
231
- background-image: url($ui-image-path + 'toggle-unselected-dark' + $image-extension);
218
+ &.flag-selected {
219
+ padding-right: 18px;
220
+ background-image: url($ui-image-path + 'toggle-selected' + $image-extension);
221
+ span {
222
+ color: $toggle-on-text;
223
+ }
224
+ }
225
+ &.flag-unselected {
226
+ padding-left: 18px;
227
+ background-image: url($ui-image-path + 'toggle-unselected' + $image-extension);
228
+ span {
229
+ color: $toggle-off-text;
230
+ }
231
+ }
232
+ span {
233
+ font-family: 'Noto Sans', sans-serif;
234
+ font-size: $font-size;
235
+ forced-color-adjust: none;
236
+ }
232
237
  }
233
238
 
234
239
  @media (max-width: 767px) {
235
240
  div.symbol-list-table {
236
241
  div.symbol-list-cell.symbol-list-cell-text {
237
242
  padding-right: 0;
238
-
239
243
  hr {
240
244
  margin-right: 0;
241
245
  }