@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.
- package/.eslintignore +2 -14
- package/.github/workflows/test.yaml +26 -0
- package/.nvmrc +1 -0
- package/dist/index.dark.html +1 -1
- package/dist/index.en.html +1 -1
- package/dist/index.fi.html +1 -1
- package/dist/index.html +5 -0
- package/dist/index.js +105 -135
- package/dist/index.mjs +112 -135
- package/dist/index.sv.html +1 -1
- package/dist/locale-en-DCEKDw5G.js +8 -0
- package/dist/locale-fi-DPiOM1rB.js +8 -0
- package/dist/locale-sv-B0FlbgEF.js +8 -0
- package/dist/vendor-Cfkkvdz7.js +21 -0
- package/dist/vue/index.mjs +15245 -0
- package/dist/vue/style.css +1 -0
- package/dist/xml-parser-BiNO9kc-.js +13 -0
- package/package.json +61 -25
- package/public/index.dark.html +1 -1
- package/public/index.en.html +1 -1
- package/public/index.fi.html +1 -1
- package/public/index.sv.html +1 -1
- package/src/AlertClientVue.vue +170 -0
- package/src/App.vue +58 -176
- package/src/assets/img/ui/arrow-down.svg +4 -14
- package/src/assets/img/ui/arrow-up.svg +4 -14
- package/src/assets/img/ui/clear.svg +7 -21
- package/src/assets/img/ui/close.svg +4 -15
- package/src/assets/img/ui/toggle-selected.svg +12 -0
- package/src/assets/img/ui/toggle-unselected.svg +12 -0
- package/src/assets/img/warning/cold-weather.svg +3 -6
- package/src/assets/img/warning/flood-level-3.svg +4 -7
- package/src/assets/img/warning/forest-fire-weather.svg +2 -6
- package/src/assets/img/warning/grass-fire-weather.svg +2 -6
- package/src/assets/img/warning/hot-weather.svg +3 -6
- package/src/assets/img/warning/pedestrian-safety.svg +3 -7
- package/src/assets/img/warning/rain.svg +2 -7
- package/src/assets/img/warning/sea-icing.svg +2 -6
- package/src/assets/img/warning/sea-thunder-storm.svg +2 -5
- package/src/assets/img/warning/sea-water-height-high-water.svg +3 -8
- package/src/assets/img/warning/sea-water-height-shallow-water.svg +3 -7
- package/src/assets/img/warning/sea-wave-height.svg +4 -7
- package/src/assets/img/warning/sea-wind-legend.svg +2 -5
- package/src/assets/img/warning/sea-wind.svg +2 -5
- package/src/assets/img/warning/several.svg +2 -5
- package/src/assets/img/warning/thunder-storm.svg +2 -5
- package/src/assets/img/warning/traffic-weather.svg +2 -6
- package/src/assets/img/warning/uv-note.svg +2 -6
- package/src/assets/img/warning/wind.svg +2 -5
- package/src/components/AlertClient.vue +42 -20
- package/src/components/CollapsiblePanel.vue +284 -0
- package/src/components/DayLarge.vue +40 -32
- package/src/components/DaySmall.vue +17 -7
- package/src/components/Days.vue +77 -52
- package/src/components/DescriptionWarning.vue +26 -8
- package/src/components/GrayScaleToggle.vue +42 -35
- package/src/components/Legend.vue +36 -240
- package/src/components/MapLarge.vue +55 -50
- package/src/components/MapSmall.vue +48 -29
- package/src/components/PopupRow.vue +6 -3
- package/src/components/Region.vue +162 -53
- package/src/components/RegionWarning.vue +33 -11
- package/src/components/Regions.vue +59 -29
- package/src/components/Warning.vue +53 -49
- package/src/components/Warnings.vue +54 -16
- package/src/locales/en.json +21 -4
- package/src/locales/fi.json +23 -6
- package/src/locales/sv.json +20 -3
- package/src/main.js +1 -0
- package/src/mixins/alertClientCore.js +210 -0
- package/src/mixins/config.js +263 -257
- package/src/mixins/utils.js +46 -15
- package/src/plugins/index.js +1 -1
- package/src/scss/_utilities.scss +193 -0
- package/src/scss/backgrounds.scss +2 -0
- package/src/scss/colors.scss +5 -3
- package/src/scss/constants.scss +3 -2
- package/src/scss/themes/dark-gray.scss +3 -3
- package/src/scss/themes/dark.scss +1 -1
- package/src/scss/themes/light-gray.scss +5 -5
- package/src/scss/themes/light.scss +3 -3
- package/src/scss/warningImages.scss +9 -5
- package/src/vue.js +41 -0
- package/svgo.config.js +45 -0
- package/tests/README.md +430 -0
- package/tests/fixtures/mockWarningData.js +135 -0
- package/tests/integration/warning-flow.spec.js +452 -0
- package/tests/setup.js +41 -0
- package/tests/unit/components/AlertClient.spec.js +734 -0
- package/tests/unit/components/DayLarge.spec.js +281 -0
- package/tests/unit/components/DaySmall.spec.js +278 -0
- package/tests/unit/components/Days.spec.js +565 -0
- package/tests/unit/components/DescriptionWarning.spec.js +432 -0
- package/tests/unit/components/GrayScaleToggle.spec.js +311 -0
- package/tests/unit/components/Legend.spec.js +223 -0
- package/tests/unit/components/MapLarge.spec.js +276 -0
- package/tests/unit/components/MapSmall.spec.js +226 -0
- package/tests/unit/components/PopupRow.spec.js +261 -0
- package/tests/unit/components/Region.spec.js +430 -0
- package/tests/unit/components/RegionWarning.snapshot.spec.js +73 -0
- package/tests/unit/components/RegionWarning.spec.js +408 -0
- package/tests/unit/components/Regions.spec.js +335 -0
- package/tests/unit/components/Warning.snapshot.spec.js +107 -0
- package/tests/unit/components/Warning.spec.js +472 -0
- package/tests/unit/components/Warnings.spec.js +329 -0
- package/tests/unit/components/__snapshots__/RegionWarning.snapshot.spec.js.snap +21 -0
- package/tests/unit/components/__snapshots__/Warning.snapshot.spec.js.snap +199 -0
- package/tests/unit/mixins/config.spec.js +269 -0
- package/tests/unit/mixins/i18n.spec.js +115 -0
- package/tests/unit/mixins/keycodes.spec.js +37 -0
- package/tests/unit/mixins/utils.spec.js +624 -0
- package/vite.config.js +96 -26
- package/vitest.config.js +40 -0
- package/dist/index.mjs.map +0 -1
- package/dist/index.relative.html +0 -19
- package/dist/index.start.html +0 -20
- package/playwright.config.ts +0 -18
- package/public/index.relative.html +0 -19
- package/public/index.start.html +0 -20
- package/src/assets/img/ui/toggle-selected-blue.svg +0 -4
- package/src/assets/img/ui/toggle-selected-dark.svg +0 -4
- package/src/assets/img/ui/toggle-selected-light.svg +0 -4
- package/src/assets/img/ui/toggle-unselected-dark.svg +0 -4
- package/src/assets/img/ui/toggle-unselected-light.svg +0 -4
- package/src/mixins/panzoom.js +0 -900
- package/test/snapshot.test.ts +0 -126
- package/vitest.config.ts +0 -6
package/src/mixins/utils.js
CHANGED
|
@@ -1,5 +1,3 @@
|
|
|
1
|
-
import 'url-search-params-polyfill'
|
|
2
|
-
|
|
3
1
|
import { DOMParser } from '@xmldom/xmldom'
|
|
4
2
|
import he from 'he'
|
|
5
3
|
import xpath from 'xpath'
|
|
@@ -43,7 +41,7 @@ export default {
|
|
|
43
41
|
extreme: 4,
|
|
44
42
|
}),
|
|
45
43
|
strokeColor() {
|
|
46
|
-
return this.colors[this.theme]
|
|
44
|
+
return this.colors?.[this.theme]?.stroke || 'DarkSlateGray'
|
|
47
45
|
},
|
|
48
46
|
bluePaths() {
|
|
49
47
|
return this.paths({
|
|
@@ -76,10 +74,10 @@ export default {
|
|
|
76
74
|
},
|
|
77
75
|
overlayPaths() {
|
|
78
76
|
return this.regionIds.reduce((regions, regionId) => {
|
|
77
|
+
const region = this.geometries?.[this.geometryId]?.[regionId]
|
|
79
78
|
if (
|
|
80
|
-
|
|
81
|
-
(
|
|
82
|
-
this.geometries[this.geometryId][regionId].subType === 'lake')
|
|
79
|
+
region?.pathLarge &&
|
|
80
|
+
(region.type === 'land' || region.subType === 'lake')
|
|
83
81
|
) {
|
|
84
82
|
const visualization = this.regionVisualization(regionId)
|
|
85
83
|
regions.push({
|
|
@@ -140,7 +138,10 @@ export default {
|
|
|
140
138
|
return [
|
|
141
139
|
{
|
|
142
140
|
key: `border.${area}`,
|
|
143
|
-
d:
|
|
141
|
+
d:
|
|
142
|
+
this.geometries?.[this.geometryId]?.borders?.[area]?.[
|
|
143
|
+
`path${this.size}`
|
|
144
|
+
] || '',
|
|
144
145
|
opacity: '1',
|
|
145
146
|
strokeWidth: this.strokeWidth,
|
|
146
147
|
},
|
|
@@ -195,7 +196,9 @@ export default {
|
|
|
195
196
|
},
|
|
196
197
|
msSinceStartOfDay(timestamp) {
|
|
197
198
|
const moment = this.toTimeZone(timestamp)
|
|
198
|
-
const ms =
|
|
199
|
+
const ms =
|
|
200
|
+
((moment.hour * 60 + moment.minute) * 60 + moment.second) * 1000 +
|
|
201
|
+
moment.millisecond
|
|
199
202
|
// Daylight saving time
|
|
200
203
|
const ref = this.toTimeZone(timestamp - ms)
|
|
201
204
|
if (ref.day !== moment.day) {
|
|
@@ -479,7 +482,7 @@ export default {
|
|
|
479
482
|
if (covRegions.has(regionId)) {
|
|
480
483
|
warningItem.coverage += covRegions.get(regionId)
|
|
481
484
|
} else {
|
|
482
|
-
warningItem.coverage =
|
|
485
|
+
warningItem.coverage = 100
|
|
483
486
|
}
|
|
484
487
|
}
|
|
485
488
|
})
|
|
@@ -546,8 +549,11 @@ export default {
|
|
|
546
549
|
if (!this.coverageWarnings.includes(key)) {
|
|
547
550
|
;[...this.warnings[key].covRegions.keys()].forEach((covRegion) => {
|
|
548
551
|
if (
|
|
549
|
-
this.coverageRegions[covRegion] == null ||
|
|
550
|
-
|
|
552
|
+
(this.coverageRegions[covRegion] == null ||
|
|
553
|
+
this.coverageRegions[covRegion] <
|
|
554
|
+
this.warnings[key].severity) &&
|
|
555
|
+
this.warnings[key].covRegions.get(covRegion) >=
|
|
556
|
+
this.coverageCriterion
|
|
551
557
|
) {
|
|
552
558
|
this.coverageRegions[covRegion] = this.warnings[key].severity
|
|
553
559
|
}
|
|
@@ -748,6 +754,7 @@ export default {
|
|
|
748
754
|
const maxSeverities = this.getMaxSeverities(warnings)
|
|
749
755
|
const legend = this.createLegend(maxSeverities)
|
|
750
756
|
const regions = this.createRegions(warnings)
|
|
757
|
+
this.optimizeCovRegions(warnings, regions)
|
|
751
758
|
return {
|
|
752
759
|
warnings,
|
|
753
760
|
days,
|
|
@@ -760,8 +767,10 @@ export default {
|
|
|
760
767
|
return typeof document !== 'undefined' && document
|
|
761
768
|
},
|
|
762
769
|
regionData(regionId) {
|
|
763
|
-
const
|
|
764
|
-
return
|
|
770
|
+
const region = this.geometries?.[this.geometryId]?.[regionId]
|
|
771
|
+
if (!region) return null
|
|
772
|
+
const regionType = region.type
|
|
773
|
+
return this.input?.[regionType]?.find(
|
|
765
774
|
(regionData) => regionData.key === regionId
|
|
766
775
|
)
|
|
767
776
|
},
|
|
@@ -794,10 +803,11 @@ export default {
|
|
|
794
803
|
const severity = this.regionSeverity(regionId)
|
|
795
804
|
const isLand =
|
|
796
805
|
this.geometries[this.geometryId][regionId].type === this.REGION_LAND
|
|
806
|
+
const themeColors = this.colors?.[this.theme]
|
|
797
807
|
const color =
|
|
798
808
|
severity || isLand
|
|
799
|
-
?
|
|
800
|
-
:
|
|
809
|
+
? themeColors?.levels?.[severity] || '#cccccc'
|
|
810
|
+
: themeColors?.sea || '#add8e6'
|
|
801
811
|
const visible = severity > 0 || geom.subType !== this.REGION_LAKE
|
|
802
812
|
return {
|
|
803
813
|
geom,
|
|
@@ -806,6 +816,27 @@ export default {
|
|
|
806
816
|
visible,
|
|
807
817
|
}
|
|
808
818
|
},
|
|
819
|
+
// Include also lakes to prevent overlapping symbols in Saimaa
|
|
820
|
+
optimizeCovRegions(warnings, regions) {
|
|
821
|
+
Object.keys(this.geometries[this.geometryId])
|
|
822
|
+
.filter(
|
|
823
|
+
(regionId) =>
|
|
824
|
+
this.geometries[this.geometryId][regionId]?.type === 'sea' &&
|
|
825
|
+
this.geometries[this.geometryId][regionId]?.subType === 'lake'
|
|
826
|
+
)
|
|
827
|
+
.filter((regionId) =>
|
|
828
|
+
regions.some((day) =>
|
|
829
|
+
day.sea.some((region) => region.key === regionId)
|
|
830
|
+
)
|
|
831
|
+
)
|
|
832
|
+
.forEach((regionId) =>
|
|
833
|
+
Object.keys(warnings)
|
|
834
|
+
.filter((warningKey) => warnings[warningKey].covRegions.size > 0)
|
|
835
|
+
.forEach((warningKey) => {
|
|
836
|
+
warnings[warningKey].covRegions.set(regionId, 0)
|
|
837
|
+
})
|
|
838
|
+
)
|
|
839
|
+
},
|
|
809
840
|
regionsDefault() {
|
|
810
841
|
return [
|
|
811
842
|
{
|
package/src/plugins/index.js
CHANGED
|
@@ -0,0 +1,193 @@
|
|
|
1
|
+
// Responsive display utilities
|
|
2
|
+
.mobile-only {
|
|
3
|
+
display: block;
|
|
4
|
+
@media (min-width: 768px) {
|
|
5
|
+
display: none;
|
|
6
|
+
}
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
.desktop-only {
|
|
10
|
+
display: none;
|
|
11
|
+
@media (min-width: 768px) {
|
|
12
|
+
display: block;
|
|
13
|
+
}
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
.d-none {
|
|
17
|
+
display: none !important;
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
.d-block {
|
|
21
|
+
display: block !important;
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
// Medium breakpoint and up (768px+)
|
|
25
|
+
@media (min-width: 768px) {
|
|
26
|
+
.d-md-none {
|
|
27
|
+
display: none !important;
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
.d-md-block {
|
|
31
|
+
display: block !important;
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
.d-md-table-cell {
|
|
35
|
+
display: table-cell !important;
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
// Display inline
|
|
40
|
+
.d-inline {
|
|
41
|
+
display: inline !important;
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
// For screen readers
|
|
45
|
+
.visually-hidden {
|
|
46
|
+
position: absolute;
|
|
47
|
+
width: 1px;
|
|
48
|
+
height: 1px;
|
|
49
|
+
padding: 0;
|
|
50
|
+
margin: -1px;
|
|
51
|
+
overflow: hidden;
|
|
52
|
+
clip: rect(0, 0, 0, 0);
|
|
53
|
+
white-space: nowrap;
|
|
54
|
+
border: 0;
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
// Accessibility utilities
|
|
58
|
+
.visually-hidden-focusable {
|
|
59
|
+
position: absolute !important;
|
|
60
|
+
width: 1px !important;
|
|
61
|
+
height: 1px !important;
|
|
62
|
+
padding: 0 !important;
|
|
63
|
+
margin: -1px !important;
|
|
64
|
+
overflow: hidden !important;
|
|
65
|
+
clip: rect(0, 0, 0, 0) !important;
|
|
66
|
+
white-space: nowrap !important;
|
|
67
|
+
border: 0 !important;
|
|
68
|
+
|
|
69
|
+
&:focus,
|
|
70
|
+
&:focus-within {
|
|
71
|
+
position: static !important;
|
|
72
|
+
width: auto !important;
|
|
73
|
+
height: auto !important;
|
|
74
|
+
overflow: visible !important;
|
|
75
|
+
clip: auto !important;
|
|
76
|
+
white-space: normal !important;
|
|
77
|
+
}
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
.focus-ring {
|
|
81
|
+
outline: none;
|
|
82
|
+
|
|
83
|
+
&:focus {
|
|
84
|
+
outline: 2px solid #0d6efd;
|
|
85
|
+
outline-offset: 2px;
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
&:focus:not(:focus-visible) {
|
|
89
|
+
outline: none;
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
&:focus-visible {
|
|
93
|
+
outline: 2px solid #0d6efd;
|
|
94
|
+
outline-offset: 2px;
|
|
95
|
+
}
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
// Small breakpoint specific (576px+)
|
|
99
|
+
@media (min-width: 576px) {
|
|
100
|
+
.d-sm-block {
|
|
101
|
+
display: block !important;
|
|
102
|
+
}
|
|
103
|
+
|
|
104
|
+
.d-sm-none {
|
|
105
|
+
display: none !important;
|
|
106
|
+
}
|
|
107
|
+
}
|
|
108
|
+
|
|
109
|
+
// Spacing utilities
|
|
110
|
+
.mb-1 {
|
|
111
|
+
margin-bottom: 0.25rem;
|
|
112
|
+
}
|
|
113
|
+
|
|
114
|
+
.p-0 {
|
|
115
|
+
padding: 0;
|
|
116
|
+
}
|
|
117
|
+
|
|
118
|
+
.p-1 {
|
|
119
|
+
padding: 0.25rem;
|
|
120
|
+
}
|
|
121
|
+
|
|
122
|
+
// Position utilities
|
|
123
|
+
.sticky-top {
|
|
124
|
+
position: sticky;
|
|
125
|
+
top: 0;
|
|
126
|
+
z-index: 1020;
|
|
127
|
+
}
|
|
128
|
+
|
|
129
|
+
// Grid/Layout utilities
|
|
130
|
+
.row {
|
|
131
|
+
display: flex;
|
|
132
|
+
flex-wrap: wrap;
|
|
133
|
+
margin-left: 0;
|
|
134
|
+
margin-right: 0;
|
|
135
|
+
}
|
|
136
|
+
|
|
137
|
+
// Tab navigation utilities
|
|
138
|
+
.nav {
|
|
139
|
+
display: flex;
|
|
140
|
+
flex-wrap: wrap;
|
|
141
|
+
padding-left: 0;
|
|
142
|
+
margin-bottom: 0;
|
|
143
|
+
list-style: none;
|
|
144
|
+
}
|
|
145
|
+
|
|
146
|
+
.nav-tabs {
|
|
147
|
+
border-bottom: none;
|
|
148
|
+
}
|
|
149
|
+
|
|
150
|
+
.nav-item {
|
|
151
|
+
margin-bottom: 0;
|
|
152
|
+
}
|
|
153
|
+
|
|
154
|
+
.nav-link {
|
|
155
|
+
display: block;
|
|
156
|
+
padding: 0;
|
|
157
|
+
text-decoration: none;
|
|
158
|
+
background: none;
|
|
159
|
+
border: none;
|
|
160
|
+
cursor: pointer;
|
|
161
|
+
}
|
|
162
|
+
|
|
163
|
+
.tab-content {
|
|
164
|
+
> .tab-pane {
|
|
165
|
+
display: none;
|
|
166
|
+
|
|
167
|
+
&.active,
|
|
168
|
+
&.show {
|
|
169
|
+
display: block;
|
|
170
|
+
}
|
|
171
|
+
}
|
|
172
|
+
|
|
173
|
+
.spinner-border {
|
|
174
|
+
display: inline-block;
|
|
175
|
+
width: 2rem;
|
|
176
|
+
height: 2rem;
|
|
177
|
+
vertical-align: text-bottom;
|
|
178
|
+
border: 0.25em solid currentColor;
|
|
179
|
+
border-right-color: transparent;
|
|
180
|
+
border-radius: 50%;
|
|
181
|
+
animation: spinner-border-animation 0.75s linear infinite;
|
|
182
|
+
}
|
|
183
|
+
|
|
184
|
+
@keyframes spinner-border-animation {
|
|
185
|
+
to {
|
|
186
|
+
transform: rotate(360deg);
|
|
187
|
+
}
|
|
188
|
+
}
|
|
189
|
+
|
|
190
|
+
.text-center {
|
|
191
|
+
text-align: center !important;
|
|
192
|
+
}
|
|
193
|
+
}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
$disabled-zoom-in: url(data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0iVVRGLTgiIHN0YW5kYWxvbmU9Im5vIj8+Cjxzdmcgd2lkdGg9IjM0cHgiIGhlaWdodD0iMzRweCIgdmlld0JveD0iMCAwIDM0IDM0IiB2ZXJzaW9uPSIxLjEiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgeG1sbnM6eGxpbms9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkveGxpbmsiPgogICAgPHRpdGxlPnBsdXMtc3ltYm9sPC90aXRsZT4KICAgIDxnIGlkPSJpY29ucyIgc3Ryb2tlPSJub25lIiBzdHJva2Utd2lkdGg9IjEiIGZpbGw9Im5vbmUiIGZpbGwtcnVsZT0iZXZlbm9kZCI+CiAgICAgICAgPGcgaWQ9IlN5bWJvbHMiPgogICAgICAgICAgICA8ZyBpZD0icGx1cy1zeW1ib2wiPgogICAgICAgICAgICAgICAgPHJlY3QgaWQ9ImZpbGwtMyIgZmlsbD0iIzkyOTI5MiIgeD0iMCIgeT0iMCIgd2lkdGg9IjM0IiBoZWlnaHQ9IjM0Ij48L3JlY3Q+CiAgICAgICAgICAgICAgICA8cGF0aCBkPSJNMTcsMjQgTDE3LDEwIiBpZD0iZmlsbC0yIiBzdHJva2U9IiNGRkZGRkYiIHN0cm9rZS13aWR0aD0iMiIgc3Ryb2tlLWxpbmVjYXA9InJvdW5kIj48L3BhdGg+CiAgICAgICAgICAgICAgICA8cGF0aCBkPSJNMTAsMTcgTDI0LDE3IiBpZD0iZmlsbC0xIiBzdHJva2U9IiNGRkZGRkYiIHN0cm9rZS13aWR0aD0iMiIgc3Ryb2tlLWxpbmVjYXA9InJvdW5kIj48L3BhdGg+CiAgICAgICAgICAgIDwvZz4KICAgICAgICA8L2c+CiAgICA8L2c+Cjwvc3ZnPg==);
|
|
2
|
+
$disabled-zoom-out: url(data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0iVVRGLTgiIHN0YW5kYWxvbmU9Im5vIj8+Cjxzdmcgd2lkdGg9IjM0cHgiIGhlaWdodD0iMzRweCIgdmlld0JveD0iMCAwIDM0IDM0IiB2ZXJzaW9uPSIxLjEiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgeG1sbnM6eGxpbms9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkveGxpbmsiPgogICAgPHRpdGxlPm1pbnVzLXN5bWJvbDwvdGl0bGU+CiAgICA8ZyBpZD0iaWNvbnMiIHN0cm9rZT0ibm9uZSIgc3Ryb2tlLXdpZHRoPSIxIiBmaWxsPSJub25lIiBmaWxsLXJ1bGU9ImV2ZW5vZGQiPgogICAgICAgIDxnIGlkPSJTeW1ib2xzIj4KICAgICAgICAgICAgPGcgaWQ9Im1pbnVzLXN5bWJvbCI+CiAgICAgICAgICAgICAgICA8cmVjdCBpZD0iZmlsbC0yIiBmaWxsPSIjOTI5MjkyIiB4PSIwIiB5PSIwIiB3aWR0aD0iMzQiIGhlaWdodD0iMzQiPjwvcmVjdD4KICAgICAgICAgICAgICAgIDxwYXRoIGQ9Ik0xMCwxNyBMMjQsMTciIGlkPSJmaWxsLTEiIHN0cm9rZT0iI0ZGRkZGRiIgc3Ryb2tlLXdpZHRoPSIyIiBzdHJva2UtbGluZWNhcD0icm91bmQiPjwvcGF0aD4KICAgICAgICAgICAgPC9nPgogICAgICAgIDwvZz4KICAgIDwvZz4KPC9zdmc+);
|
package/src/scss/colors.scss
CHANGED
|
@@ -13,7 +13,7 @@ $lightest-gray: #f8f8f8;
|
|
|
13
13
|
$lighter-gray: #eee;
|
|
14
14
|
$light-gray: #e8e8e8;
|
|
15
15
|
$gray: #e3e3e3;
|
|
16
|
-
$dark-gray: #
|
|
16
|
+
$dark-gray: #929292;
|
|
17
17
|
$darker-gray: #434752;
|
|
18
18
|
$darkest-gray: #282b34;
|
|
19
19
|
$variant-gray-lightest: #f4f4f4;
|
|
@@ -21,8 +21,8 @@ $variant-gray-lighter: #e8e8e8;
|
|
|
21
21
|
$variant-gray-light: #e4e4e4;
|
|
22
22
|
$variant-gray: #e1e1e1;
|
|
23
23
|
$variant-gray-dark: #aaaaaa;
|
|
24
|
-
$variant-gray-darker: #
|
|
25
|
-
$variant-gray-darkest: #
|
|
24
|
+
$variant-gray-darker: #858585;
|
|
25
|
+
$variant-gray-darkest: #555555;
|
|
26
26
|
$light-blue: #e7f0fa;
|
|
27
27
|
$blue: #3a66e3;
|
|
28
28
|
$dark-blue: #303193;
|
|
@@ -31,3 +31,5 @@ $tooltip-background-color: $white;
|
|
|
31
31
|
$tooltip-inner-color: $black;
|
|
32
32
|
$turquoise: rgba(2, 184, 206, 0.4);
|
|
33
33
|
$notification-color: #e7f0fa;
|
|
34
|
+
$toggle-on-text: $white;
|
|
35
|
+
$toggle-off-text: #606060;
|
package/src/scss/constants.scss
CHANGED
|
@@ -9,7 +9,7 @@ $warning-symbol-font-size: 0.625rem;
|
|
|
9
9
|
$current-warning-height: 38px;
|
|
10
10
|
$current-warning-image-height: 28px;
|
|
11
11
|
$current-description-image-height: 48px;
|
|
12
|
-
$symbol-list-width:
|
|
12
|
+
$symbol-list-width: 260px;
|
|
13
13
|
$symbol-list-line-height: 50px;
|
|
14
14
|
$symbol-list-select-height: 30px;
|
|
15
15
|
$symbol-list-image-size: 44px;
|
|
@@ -35,7 +35,8 @@ $popup-width: 250px;
|
|
|
35
35
|
font-family: 'Noto Sans';
|
|
36
36
|
font-weight: normal;
|
|
37
37
|
font-style: normal;
|
|
38
|
-
src: url($font-base-path + 'Noto_Sans/Noto-Sans-regular.woff2')
|
|
38
|
+
src: url($font-base-path + 'Noto_Sans/Noto-Sans-regular.woff2')
|
|
39
|
+
format('woff2');
|
|
39
40
|
font-display: swap;
|
|
40
41
|
}
|
|
41
42
|
$font-family: Roboto, Helvetica, Arial, 'Noto Sans', sans-serif;
|
|
@@ -12,8 +12,8 @@ $dark-gray-current-warning-toggle-color: $darker-gray;
|
|
|
12
12
|
$dark-gray-current-warning-toggle-active-color: $darkest-gray;
|
|
13
13
|
$dark-gray-legend-heading-background-color: $black;
|
|
14
14
|
$dark-gray-legend-container-background-color: $black;
|
|
15
|
-
$dark-gray-legend-background-color: $
|
|
16
|
-
$dark-gray-legend-toggle-background-color: $
|
|
15
|
+
$dark-gray-legend-background-color: $variant-gray-darker;
|
|
16
|
+
$dark-gray-legend-toggle-background-color: $darker-gray;
|
|
17
17
|
$dark-gray-legend-active-toggle-background-color: $lighter-gray;
|
|
18
18
|
$dark-gray-description-background-color: $darker-gray;
|
|
19
19
|
$dark-gray-description-border-color: $dark-gray;
|
|
@@ -26,7 +26,7 @@ $dark-gray-popup-border-color: $dark-gray;
|
|
|
26
26
|
$dark-gray-popup-table-background-color: $darker-gray;
|
|
27
27
|
$dark-gray-green: white;
|
|
28
28
|
$dark-gray-yellow: $variant-gray-dark;
|
|
29
|
-
$dark-gray-orange: $variant-gray-
|
|
29
|
+
$dark-gray-orange: $variant-gray-darkest;
|
|
30
30
|
$dark-gray-red: black;
|
|
31
31
|
$dark-gray-green-shadow: $dark-gray;
|
|
32
32
|
$dark-gray-yellow-shadow: $dark-gray;
|
|
@@ -12,7 +12,7 @@ $dark-current-warning-toggle-color: $darker-gray;
|
|
|
12
12
|
$dark-current-warning-toggle-active-color: $darkest-gray;
|
|
13
13
|
$dark-legend-container-background-color: $darkest-gray;
|
|
14
14
|
$dark-legend-heading-background-color: $darkest-gray;
|
|
15
|
-
$dark-legend-background-color: $
|
|
15
|
+
$dark-legend-background-color: $variant-gray-darker;
|
|
16
16
|
$dark-legend-toggle-background-color: $darker-gray;
|
|
17
17
|
$dark-legend-active-toggle-background-color: $dark-gray;
|
|
18
18
|
$dark-description-background-color: $darker-gray;
|
|
@@ -8,12 +8,12 @@ $light-gray-date-selector-mobile-text-color: $black;
|
|
|
8
8
|
$light-gray-border-color: $white;
|
|
9
9
|
$light-gray-horizontal-rule-color: $lighter-gray;
|
|
10
10
|
$light-gray-current-warning-heading-color: $lightest-gray;
|
|
11
|
-
$light-gray-current-warning-toggle-color: $
|
|
11
|
+
$light-gray-current-warning-toggle-color: $dark-gray;
|
|
12
12
|
$light-gray-current-warning-toggle-active-color: $darker-gray;
|
|
13
13
|
$light-gray-legend-heading-background-color: $white;
|
|
14
14
|
$light-gray-legend-container-background-color: $white;
|
|
15
|
-
$light-gray-legend-background-color: $
|
|
16
|
-
$light-gray-legend-toggle-background-color: $
|
|
15
|
+
$light-gray-legend-background-color: $variant-gray-darker;
|
|
16
|
+
$light-gray-legend-toggle-background-color: $dark-gray;
|
|
17
17
|
$light-gray-legend-active-toggle-background-color: $darker-gray;
|
|
18
18
|
$light-gray-description-background-color: $lighter-gray;
|
|
19
19
|
$light-gray-description-border-color: $gray;
|
|
@@ -26,10 +26,10 @@ $light-gray-popup-border-color: $light-gray;
|
|
|
26
26
|
$light-gray-popup-table-background-color: $lighter-gray;
|
|
27
27
|
$light-gray-green: white;
|
|
28
28
|
$light-gray-yellow: $variant-gray-dark;
|
|
29
|
-
$light-gray-orange: $variant-gray-
|
|
29
|
+
$light-gray-orange: $variant-gray-darkest;
|
|
30
30
|
$light-gray-red: black;
|
|
31
31
|
$light-gray-green-shadow: $light-gray;
|
|
32
32
|
$light-gray-yellow-shadow: $light-gray;
|
|
33
33
|
$light-gray-orange-shadow: $light-gray;
|
|
34
34
|
$light-gray-red-shadow: $light-gray;
|
|
35
|
-
$light-gray-border:
|
|
35
|
+
$light-gray-border: $variant-gray-darker;
|
|
@@ -8,12 +8,12 @@ $light-date-selector-mobile-text-color: $black;
|
|
|
8
8
|
$light-border-color: $white;
|
|
9
9
|
$light-horizontal-rule-color: $lighter-gray;
|
|
10
10
|
$light-current-warning-heading-color: $lightest-gray;
|
|
11
|
-
$light-current-warning-toggle-color: $
|
|
11
|
+
$light-current-warning-toggle-color: $dark-gray;
|
|
12
12
|
$light-current-warning-toggle-active-color: $blue;
|
|
13
13
|
$light-legend-heading-background-color: $white;
|
|
14
14
|
$light-legend-container-background-color: $white;
|
|
15
|
-
$light-legend-background-color: $
|
|
16
|
-
$light-legend-toggle-background-color: $
|
|
15
|
+
$light-legend-background-color: $variant-gray-darker;
|
|
16
|
+
$light-legend-toggle-background-color: $dark-gray;
|
|
17
17
|
$light-legend-active-toggle-background-color: $blue;
|
|
18
18
|
$light-description-background-color: $lighter-gray;
|
|
19
19
|
$light-description-border-color: $gray;
|
|
@@ -1,8 +1,9 @@
|
|
|
1
|
-
@
|
|
1
|
+
@use 'sass:string';
|
|
2
|
+
@import './constants.scss';
|
|
2
3
|
|
|
3
4
|
@for $i from 0 through 72 {
|
|
4
5
|
$angle: 5 * $i;
|
|
5
|
-
$rotationDegree: unquote($angle + 'deg');
|
|
6
|
+
$rotationDegree: string.unquote($angle + 'deg');
|
|
6
7
|
.transform-rotate-#{$angle} {
|
|
7
8
|
transform: rotate($rotationDegree);
|
|
8
9
|
}
|
|
@@ -101,7 +102,11 @@ div.symbol-image {
|
|
|
101
102
|
}
|
|
102
103
|
|
|
103
104
|
@media (forced-colors: active) {
|
|
104
|
-
.level-0,
|
|
105
|
+
.level-0,
|
|
106
|
+
.level-1,
|
|
107
|
+
.level-2,
|
|
108
|
+
.level-3,
|
|
109
|
+
.level-4 {
|
|
105
110
|
forced-color-adjust: none;
|
|
106
111
|
}
|
|
107
112
|
}
|
|
@@ -181,7 +186,6 @@ div.symbol-image {
|
|
|
181
186
|
span.symbol-text {
|
|
182
187
|
display: table-cell;
|
|
183
188
|
vertical-align: middle;
|
|
184
|
-
line-height: $current-warning-image-height;
|
|
185
189
|
width: 100%;
|
|
186
190
|
text-align: center;
|
|
187
191
|
margin: 0 auto;
|
|
@@ -192,7 +196,7 @@ span.symbol-text {
|
|
|
192
196
|
font-weight: 700;
|
|
193
197
|
}
|
|
194
198
|
|
|
195
|
-
@media (
|
|
199
|
+
@media (width < 576px) {
|
|
196
200
|
.symbol-text {
|
|
197
201
|
display: none;
|
|
198
202
|
}
|
package/src/vue.js
ADDED
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Vue component exports for use in Vue/Nuxt applications.
|
|
3
|
+
*
|
|
4
|
+
* Usage:
|
|
5
|
+
* import { SmartMetAlertClient } from '@fmidev/smartmet-alert-client/vue'
|
|
6
|
+
* import '@fmidev/smartmet-alert-client/vue/style.css'
|
|
7
|
+
*
|
|
8
|
+
* <SmartMetAlertClient
|
|
9
|
+
* :refresh-interval="900000"
|
|
10
|
+
* :selected-day="0"
|
|
11
|
+
* :geometry-id="2021"
|
|
12
|
+
* language="fi"
|
|
13
|
+
* />
|
|
14
|
+
*
|
|
15
|
+
* Props:
|
|
16
|
+
* language String 'fi' Language code: 'fi', 'sv', 'en'
|
|
17
|
+
* theme String 'light' Theme: 'light', 'dark', 'light-gray', 'dark-gray'
|
|
18
|
+
* geometry-id String|Number 2021 Geometry version ID
|
|
19
|
+
* selected-day String|Number 0 Initially selected day (0-4)
|
|
20
|
+
* refresh-interval String|Number 900000 Data refresh interval in ms (0 to disable)
|
|
21
|
+
* region-list-enabled String|Boolean true Show region list below the map
|
|
22
|
+
* static-days String|Boolean true Use static day labels
|
|
23
|
+
* spinner-enabled String|Boolean true Show loading spinner
|
|
24
|
+
* gray-scale-selector String|Boolean true Show grayscale theme toggle
|
|
25
|
+
* sleep String|Boolean true Pause updates when tab is hidden
|
|
26
|
+
* font-scale String|Number 1 Font size multiplier
|
|
27
|
+
* base-url String (FMI GeoServer) Base URL for WFS queries
|
|
28
|
+
* start-from String '' Start date override (ISO format)
|
|
29
|
+
* current-date String|Date null Override current date for testing
|
|
30
|
+
* warnings String|Object null Pre-loaded warnings data (skip fetch)
|
|
31
|
+
* weather-warnings String '' Custom weather warnings query
|
|
32
|
+
* flood-warnings String '' Custom flood warnings query
|
|
33
|
+
* weather-updated String '' Custom weather update time query
|
|
34
|
+
* flood-updated String '' Custom flood update time query
|
|
35
|
+
* daily-warning-types String|Array [] Filter specific warning types
|
|
36
|
+
* debug-mode String|Boolean false Enable debug logging
|
|
37
|
+
*/
|
|
38
|
+
import AlertClientVue from './AlertClientVue.vue'
|
|
39
|
+
|
|
40
|
+
export { AlertClientVue as SmartMetAlertClient }
|
|
41
|
+
export default AlertClientVue
|
package/svgo.config.js
ADDED
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
export default {
|
|
2
|
+
multipass: true,
|
|
3
|
+
js2svg: {
|
|
4
|
+
indent: 2,
|
|
5
|
+
pretty: true,
|
|
6
|
+
},
|
|
7
|
+
plugins: [
|
|
8
|
+
{
|
|
9
|
+
name: 'preset-default',
|
|
10
|
+
params: {
|
|
11
|
+
overrides: {
|
|
12
|
+
// Keep useful IDs in case they're referenced
|
|
13
|
+
cleanupIds: {
|
|
14
|
+
minify: false,
|
|
15
|
+
},
|
|
16
|
+
},
|
|
17
|
+
},
|
|
18
|
+
},
|
|
19
|
+
// Keep viewBox as it's needed for responsive scaling
|
|
20
|
+
{
|
|
21
|
+
name: 'removeViewBox',
|
|
22
|
+
active: false,
|
|
23
|
+
},
|
|
24
|
+
// Remove XML declaration (<?xml version="1.0"?>)
|
|
25
|
+
'removeXMLProcInst',
|
|
26
|
+
// Remove unnecessary xmlns:xlink
|
|
27
|
+
{
|
|
28
|
+
name: 'removeUnusedNS',
|
|
29
|
+
},
|
|
30
|
+
// Clean up numeric values (reduce decimal precision with rounding)
|
|
31
|
+
{
|
|
32
|
+
name: 'cleanupNumericValues',
|
|
33
|
+
params: {
|
|
34
|
+
floatPrecision: 3,
|
|
35
|
+
},
|
|
36
|
+
},
|
|
37
|
+
// Convert style attributes to attributes where possible
|
|
38
|
+
{
|
|
39
|
+
name: 'convertStyleToAttrs',
|
|
40
|
+
params: {
|
|
41
|
+
keepImportant: true,
|
|
42
|
+
},
|
|
43
|
+
},
|
|
44
|
+
],
|
|
45
|
+
}
|