@dargmuesli/nuxt-vio 3.0.0-beta.4 → 3.0.0-beta.6
Sign up to get free protection for your applications and to get access to all the features.
- package/components/vio/form/VioForm.vue +1 -1
- package/components/vio/form/input/VioFormInput.vue +2 -2
- package/components/vio/loader/indicator/VioLoaderIndicator.vue +1 -1
- package/components/vio/loader/indicator/VioLoaderIndicatorPing.vue +1 -1
- package/composables/useAppLayout.ts +1 -1
- package/locales/de.json +1 -1
- package/locales/en.json +1 -1
- package/nuxt.config.ts +1 -1
- package/package.json +1 -1
- package/plugins/dayjs.ts +7 -6
- package/types/api.d.ts +3 -1
- package/utils/networking.ts +18 -6
@@ -53,7 +53,7 @@
|
|
53
53
|
<VioFormInputIconWrapper v-if="validationProperty.$pending">
|
54
54
|
<IconHourglass
|
55
55
|
class="text-blue-600"
|
56
|
-
:title="t('
|
56
|
+
:title="t('globalStatusLoading')"
|
57
57
|
/>
|
58
58
|
</VioFormInputIconWrapper>
|
59
59
|
<VioFormInputIconWrapper
|
@@ -91,7 +91,7 @@
|
|
91
91
|
<div class="md:w-2/3">
|
92
92
|
<slot name="stateInfo" />
|
93
93
|
<VioFormInputStateInfo v-if="value?.$pending">
|
94
|
-
{{ t('
|
94
|
+
{{ t('globalStatusLoading') }}
|
95
95
|
</VioFormInputStateInfo>
|
96
96
|
</div>
|
97
97
|
<div class="md:w-1/3" />
|
package/locales/de.json
CHANGED
package/locales/en.json
CHANGED
package/nuxt.config.ts
CHANGED
package/package.json
CHANGED
package/plugins/dayjs.ts
CHANGED
@@ -1,4 +1,5 @@
|
|
1
|
-
|
1
|
+
/* eslint-disable import/no-named-as-default-member */
|
2
|
+
import dayjs from 'dayjs'
|
2
3
|
|
3
4
|
// workaround for [1]
|
4
5
|
import de from 'dayjs/locale/de'
|
@@ -10,13 +11,13 @@ import timezone from 'dayjs/plugin/timezone'
|
|
10
11
|
import utc from 'dayjs/plugin/utc'
|
11
12
|
|
12
13
|
export default defineNuxtPlugin((_nuxtApp) => {
|
13
|
-
extend(isSameOrBefore)
|
14
|
-
extend(localizedFormat)
|
15
|
-
extend(timezone)
|
16
|
-
extend(utc)
|
14
|
+
dayjs.extend(isSameOrBefore)
|
15
|
+
dayjs.extend(localizedFormat)
|
16
|
+
dayjs.extend(timezone)
|
17
|
+
dayjs.extend(utc)
|
17
18
|
|
18
19
|
// workaround for [1]
|
19
|
-
locale(de)
|
20
|
+
dayjs.locale(de)
|
20
21
|
// dayjs.locale(en) makes `format` error
|
21
22
|
|
22
23
|
return {
|
package/types/api.d.ts
CHANGED
@@ -1,7 +1,9 @@
|
|
1
|
-
|
1
|
+
import type { CombinedError } from '@urql/core'
|
2
2
|
|
3
3
|
export type ApiData = ComputedRef<{
|
4
4
|
data?: Object
|
5
5
|
errors: BackendError[]
|
6
6
|
isFetching: boolean
|
7
7
|
}>
|
8
|
+
|
9
|
+
export type BackendError = CombinedError | { errcode: string; message: string }
|
package/utils/networking.ts
CHANGED
@@ -106,10 +106,22 @@ export const getServiceHref = ({
|
|
106
106
|
}
|
107
107
|
}
|
108
108
|
|
109
|
-
export const getTimezone = async (event: H3Event) =>
|
110
|
-
getCookie(event, TIMEZONE_COOKIE_NAME)
|
111
|
-
|
112
|
-
|
109
|
+
export const getTimezone = async (event: H3Event) => {
|
110
|
+
const timezoneCookie = getCookie(event, TIMEZONE_COOKIE_NAME)
|
111
|
+
|
112
|
+
if (timezoneCookie) {
|
113
|
+
return timezoneCookie
|
114
|
+
}
|
115
|
+
|
116
|
+
if (event.node.req.headers['x-real-ip']) {
|
117
|
+
const ipApiResult = await ofetch(
|
113
118
|
`http://ip-api.com/json/${event.node.req.headers['x-real-ip']}`,
|
114
|
-
)
|
115
|
-
|
119
|
+
).catch(() => {})
|
120
|
+
|
121
|
+
if (ipApiResult) {
|
122
|
+
return ipApiResult.timezone
|
123
|
+
}
|
124
|
+
}
|
125
|
+
|
126
|
+
return undefined
|
127
|
+
}
|