@dargmuesli/nuxt-vio 20.0.0-beta.5 → 20.0.0-beta.7

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.
@@ -1,22 +1,33 @@
1
1
  <template>
2
2
  <NuxtTime
3
3
  v-bind="forwardedProps"
4
- :locale="props.locale || defaultLocale"
5
- :time-zone="props.timeZone || defaultTimeZone"
4
+ :locale="props.options.locale || defaultLocale"
5
+ :time-zone="props.options.timeZone || defaultTimeZone"
6
6
  />
7
7
  </template>
8
8
 
9
9
  <script setup lang="ts">
10
- import { reactiveOmit } from '@vueuse/core'
11
- import { useForwardProps } from 'reka-ui'
12
-
13
10
  import type { NuxtTimeProps } from 'nuxt/app'
14
11
 
15
12
  const { locale: defaultLocale } = useI18n()
16
13
  const defaultTimeZone = useTimeZone()
17
14
 
18
- const props = defineProps<NuxtTimeProps>()
15
+ const props = withDefaults(
16
+ defineProps<{
17
+ datetime: NuxtTimeProps['datetime']
18
+ options?: Omit<NuxtTimeProps, 'datetime'>
19
+ }>(),
20
+ {
21
+ options: () => ({
22
+ dateStyle: 'medium',
23
+ timeStyle: 'short',
24
+ }),
25
+ },
26
+ )
27
+
28
+ const forwardedProps = computed(() => {
29
+ const { locale, timeZone, ...delegated } = props.options
19
30
 
20
- const delegatedProps = reactiveOmit(props, 'locale', 'timeZone')
21
- const forwardedProps = useForwardProps(delegatedProps)
31
+ return { datetime: props.datetime, ...delegated }
32
+ })
22
33
  </script>
package/package.json CHANGED
@@ -114,5 +114,5 @@
114
114
  "start:static": "serve playground/.output/public --ssl-cert ./.config/certificates/ssl.crt --ssl-key ./.config/certificates/ssl.key"
115
115
  },
116
116
  "type": "module",
117
- "version": "20.0.0-beta.5"
117
+ "version": "20.0.0-beta.7"
118
118
  }
@@ -1,20 +0,0 @@
1
- <template>
2
- <VioTime v-bind="props" />
3
- </template>
4
-
5
- <script setup lang="ts">
6
- import type { NuxtTimeProps } from 'nuxt/app'
7
-
8
- const props = withDefaults(defineProps<NuxtTimeProps>(), {
9
- day: 'numeric',
10
- hour: 'numeric',
11
- locale: undefined,
12
- minute: 'numeric',
13
- month: 'short',
14
- relative: undefined,
15
- timeZone: undefined,
16
- timeZoneName: undefined,
17
- weekday: undefined,
18
- year: 'numeric',
19
- })
20
- </script>