@fmidev/smartmet-alert-client 4.0.9 → 4.1.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/.env.sample +1 -2
- package/dist/index.html +1 -1
- package/dist/index.js +18 -18
- package/dist/index.mjs +277 -0
- package/dist/index.mjs.map +1 -0
- package/package.json +4 -3
- package/src/components/Days.vue +45 -2
- package/src/components/GrayScaleToggle.vue +1 -1
- package/src/components/Legend.vue +1 -1
- package/src/components/RegionWarning.vue +4 -0
- package/src/components/Warning.vue +1 -1
- package/src/components/Warnings.vue +1 -1
- package/src/mixins/keycodes.js +10 -0
- package/src/scss/themes/light-gray.scss +1 -0
- package/vite.config.js +11 -3
- package/dist/index.js.map +0 -1
- package/env.sample +0 -2
package/package.json
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@fmidev/smartmet-alert-client",
|
|
3
|
-
"version": "4.0
|
|
3
|
+
"version": "4.1.0",
|
|
4
4
|
"description": "Web application for viewing weather and flood alerts",
|
|
5
5
|
"author": "Finnish Meteorological Institute",
|
|
6
6
|
"license": "MIT",
|
|
7
|
-
"main": "dist/index.
|
|
7
|
+
"main": "dist/index.mjs",
|
|
8
8
|
"type": "module",
|
|
9
9
|
"repository": {
|
|
10
10
|
"type": "git",
|
|
@@ -49,8 +49,9 @@
|
|
|
49
49
|
"prettier": "3.1.1",
|
|
50
50
|
"rollup-plugin-visualizer": "5.11.0",
|
|
51
51
|
"unplugin-vue-components": "0.26.0",
|
|
52
|
-
"vite": "5.1.
|
|
52
|
+
"vite": "5.1.7",
|
|
53
53
|
"vite-plugin-banner": "0.7.1",
|
|
54
|
+
"vite-plugin-static-copy": "1.0.2",
|
|
54
55
|
"vitest": "0.34.4"
|
|
55
56
|
},
|
|
56
57
|
"eslintConfig": {
|
package/src/components/Days.vue
CHANGED
|
@@ -49,9 +49,11 @@
|
|
|
49
49
|
<script>
|
|
50
50
|
import DayLarge from './DayLarge.vue'
|
|
51
51
|
import DaySmall from './DaySmall.vue'
|
|
52
|
+
import keycodes from '../mixins/keycodes'
|
|
52
53
|
|
|
53
54
|
export default {
|
|
54
55
|
name: 'Days',
|
|
56
|
+
mixins: [keycodes],
|
|
55
57
|
components: {
|
|
56
58
|
DaySmall,
|
|
57
59
|
DayLarge,
|
|
@@ -117,6 +119,29 @@ export default {
|
|
|
117
119
|
this.onDaySelected(newSelectedDay)
|
|
118
120
|
},
|
|
119
121
|
},
|
|
122
|
+
mounted() {
|
|
123
|
+
const button = Array.from(this.$el.querySelectorAll('button.day')).forEach(
|
|
124
|
+
(button) => {
|
|
125
|
+
button.addEventListener('keydown', this.switchDay, true)
|
|
126
|
+
}
|
|
127
|
+
)
|
|
128
|
+
},
|
|
129
|
+
beforeUnmount() {
|
|
130
|
+
const button = Array.from(this.$el.querySelectorAll('button.day')).forEach(
|
|
131
|
+
(button) => {
|
|
132
|
+
button.removeEventListener('keydown', this.switchDay, true)
|
|
133
|
+
}
|
|
134
|
+
)
|
|
135
|
+
},
|
|
136
|
+
updated() {
|
|
137
|
+
Array.from(this.$el.querySelectorAll('button.day')).forEach((button) => {
|
|
138
|
+
if (button.classList.contains('active')) {
|
|
139
|
+
button.removeAttribute('tabindex')
|
|
140
|
+
} else {
|
|
141
|
+
button.setAttribute('tabindex', -1)
|
|
142
|
+
}
|
|
143
|
+
})
|
|
144
|
+
},
|
|
120
145
|
methods: {
|
|
121
146
|
onDaySelected(newSelectedDay) {
|
|
122
147
|
this.$emit('daySelected', newSelectedDay)
|
|
@@ -126,6 +151,23 @@ export default {
|
|
|
126
151
|
this.$emit('loaded', true)
|
|
127
152
|
}
|
|
128
153
|
},
|
|
154
|
+
switchDay(event) {
|
|
155
|
+
switch (event.keyCode) {
|
|
156
|
+
case this.KEY_CODE_LEFT:
|
|
157
|
+
this.day = Math.max(this.day - 1, 0)
|
|
158
|
+
break
|
|
159
|
+
case this.KEY_CODE_RIGHT:
|
|
160
|
+
this.day = Math.min(this.day + 1, 4)
|
|
161
|
+
break
|
|
162
|
+
case this.KEY_CODE_HOME:
|
|
163
|
+
this.day = 0
|
|
164
|
+
break
|
|
165
|
+
case this.KEY_CODE_END:
|
|
166
|
+
this.day = 4
|
|
167
|
+
break
|
|
168
|
+
}
|
|
169
|
+
this.$el.querySelector(`button.day.day${this.day}`).focus()
|
|
170
|
+
},
|
|
129
171
|
},
|
|
130
172
|
}
|
|
131
173
|
</script>
|
|
@@ -175,8 +217,9 @@ div#fmi-warnings-date-selector.tabs {
|
|
|
175
217
|
color: transparent;
|
|
176
218
|
}
|
|
177
219
|
|
|
178
|
-
button.day div.date-selector-cell {
|
|
179
|
-
|
|
220
|
+
:deep(button.day div.date-selector-cell) {
|
|
221
|
+
height: $day-small-height;
|
|
222
|
+
overflow: hidden;
|
|
180
223
|
}
|
|
181
224
|
|
|
182
225
|
:deep(button.day) {
|
package/vite.config.js
CHANGED
|
@@ -6,6 +6,7 @@ import { BootstrapVueNextResolver } from 'unplugin-vue-components/resolvers'
|
|
|
6
6
|
import Components from 'unplugin-vue-components/vite'
|
|
7
7
|
import { defineConfig } from 'vite'
|
|
8
8
|
import banner from 'vite-plugin-banner'
|
|
9
|
+
import { viteStaticCopy } from 'vite-plugin-static-copy'
|
|
9
10
|
|
|
10
11
|
import pkg from './package.json'
|
|
11
12
|
|
|
@@ -22,6 +23,15 @@ export default defineConfig({
|
|
|
22
23
|
`/**\n * name: ${pkg.name}\n * version: v${pkg.version}\n * description: ${pkg.description}\n * author: ${pkg.author}\n * homepage: ${pkg.homepage}\n */`
|
|
23
24
|
),
|
|
24
25
|
visualizer(),
|
|
26
|
+
viteStaticCopy({
|
|
27
|
+
targets: [
|
|
28
|
+
{
|
|
29
|
+
src: 'dist/index.mjs',
|
|
30
|
+
dest: './',
|
|
31
|
+
rename: 'index.js',
|
|
32
|
+
}
|
|
33
|
+
]
|
|
34
|
+
})
|
|
25
35
|
],
|
|
26
36
|
resolve: {
|
|
27
37
|
alias: {
|
|
@@ -36,9 +46,7 @@ export default defineConfig({
|
|
|
36
46
|
minify: true,
|
|
37
47
|
rollupOptions: {
|
|
38
48
|
output: {
|
|
39
|
-
entryFileNames:
|
|
40
|
-
chunkFileNames: `[name].js`,
|
|
41
|
-
assetFileNames: `[name].[ext]`,
|
|
49
|
+
entryFileNames: 'index.mjs',
|
|
42
50
|
},
|
|
43
51
|
},
|
|
44
52
|
},
|