@falcondev-oss/nuxt-layers-base 0.29.0 → 0.30.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.
|
@@ -11,8 +11,8 @@ const form = useForm({
|
|
|
11
11
|
dateIso: z.string().meta({ title: 'Datum' }),
|
|
12
12
|
text: z
|
|
13
13
|
.string()
|
|
14
|
-
.
|
|
15
|
-
.max(
|
|
14
|
+
.length(8)
|
|
15
|
+
// .max(8)
|
|
16
16
|
.meta({
|
|
17
17
|
title: 'Text',
|
|
18
18
|
description: 'Beschreibung',
|
|
@@ -253,7 +253,8 @@ const columns = useTableColumns<typeof data>(
|
|
|
253
253
|
class="flex flex-col gap-4"
|
|
254
254
|
>
|
|
255
255
|
{{ form.data }}
|
|
256
|
-
<UField v-slot="{ bind }" :field="form.fields.text.$use()">
|
|
256
|
+
<UField v-slot="{ bind, field }" :field="form.fields.text.$use()">
|
|
257
|
+
{{ field.schema }}
|
|
257
258
|
<UInput class="w-full" v-bind="bind" />
|
|
258
259
|
</UField>
|
|
259
260
|
<UField
|
|
@@ -44,7 +44,7 @@ const formFieldProps = computed<FormFieldProps>(() => {
|
|
|
44
44
|
const { field, ...rest } = forwardedProps.value
|
|
45
45
|
|
|
46
46
|
const hint =
|
|
47
|
-
field.schema.maxLength === undefined
|
|
47
|
+
field.schema.maxLength === undefined || field.schema.maxLength === field.schema.minLength
|
|
48
48
|
? undefined
|
|
49
49
|
: `${(field.value as string | number | null)?.toString().length ?? 0}/${field.schema.maxLength}`
|
|
50
50
|
|
|
@@ -123,7 +123,7 @@ const model_ = { model }
|
|
|
123
123
|
</span>
|
|
124
124
|
</template>
|
|
125
125
|
|
|
126
|
-
<template #help>
|
|
126
|
+
<template v-if="field.schema.examples" #help>
|
|
127
127
|
<template v-if="Array.isArray(field.schema.examples)">
|
|
128
128
|
<ul>
|
|
129
129
|
<li v-for="(example, index) in field.schema.examples" :key="index">
|
|
@@ -131,7 +131,7 @@ const model_ = { model }
|
|
|
131
131
|
</li>
|
|
132
132
|
</ul>
|
|
133
133
|
</template>
|
|
134
|
-
<p v-else
|
|
134
|
+
<p v-else>
|
|
135
135
|
{{ field.schema.examples }}
|
|
136
136
|
</p>
|
|
137
137
|
</template>
|
|
@@ -70,14 +70,17 @@ const rootErrors = computed(() => props.form.errors?.filter((error) => error.pat
|
|
|
70
70
|
<template>
|
|
71
71
|
<form class="w-full" @submit.prevent="() => form.submit()">
|
|
72
72
|
<slot />
|
|
73
|
-
<div
|
|
73
|
+
<div
|
|
74
|
+
v-show="rootErrors?.length || !actionsTeleportTo"
|
|
75
|
+
class="col-span-full flex w-full flex-col gap-4"
|
|
76
|
+
>
|
|
74
77
|
<ul v-if="rootErrors?.length" class="text-error text-sm">
|
|
75
78
|
<li v-for="error of rootErrors" :key="`${error.path}:${error.message}`">
|
|
76
79
|
{{ error.path }}:{{ error.message }}
|
|
77
80
|
</li>
|
|
78
81
|
</ul>
|
|
79
|
-
<div class="flex items-center justify-end gap-4">
|
|
80
|
-
<Teleport defer :disabled="!
|
|
82
|
+
<div v-show="!actionsTeleportTo" class="flex items-center justify-end gap-4">
|
|
83
|
+
<Teleport defer :disabled="!actionsTeleportTo" :to="actionsTeleportTo">
|
|
81
84
|
<UActions :defaults="{ variant: 'subtle' }" :actions="actionsWithSubmit" />
|
|
82
85
|
</Teleport>
|
|
83
86
|
</div>
|
|
@@ -1,17 +1,38 @@
|
|
|
1
1
|
<script setup lang="ts">
|
|
2
2
|
import type { DateValue } from '@internationalized/date'
|
|
3
|
+
import type { CalendarProps, InputDateProps } from '@nuxt/ui'
|
|
4
|
+
|
|
5
|
+
defineProps<{
|
|
6
|
+
input?: InputDateProps
|
|
7
|
+
calendar?: CalendarProps
|
|
8
|
+
disabled?: boolean
|
|
9
|
+
loading?: boolean
|
|
10
|
+
placeholder?: string
|
|
11
|
+
}>()
|
|
12
|
+
|
|
13
|
+
const emit = defineEmits<{
|
|
14
|
+
blur: []
|
|
15
|
+
}>()
|
|
3
16
|
|
|
4
17
|
const inputDate = useTemplateRef('inputDate')
|
|
5
18
|
|
|
6
19
|
const model = defineModel<DateValue | null>({ required: true })
|
|
7
20
|
const open = ref(false)
|
|
21
|
+
|
|
22
|
+
watch(open, () => {
|
|
23
|
+
if (!open.value) emit('blur')
|
|
24
|
+
})
|
|
8
25
|
</script>
|
|
9
26
|
|
|
10
27
|
<template>
|
|
11
28
|
<UInputDate
|
|
12
29
|
ref="inputDate"
|
|
13
|
-
|
|
30
|
+
v-bind="input"
|
|
31
|
+
:disabled
|
|
32
|
+
:loading
|
|
14
33
|
:range="false"
|
|
34
|
+
:model-value="model"
|
|
35
|
+
@blur="() => emit('blur')"
|
|
15
36
|
@update:model-value="
|
|
16
37
|
(val) => {
|
|
17
38
|
model = val ?? null
|
|
@@ -25,6 +46,7 @@ const open = ref(false)
|
|
|
25
46
|
<template #content>
|
|
26
47
|
<div class="p-2">
|
|
27
48
|
<UCalendar
|
|
49
|
+
v-bind="calendar"
|
|
28
50
|
:model-value="model ?? undefined"
|
|
29
51
|
:multiple="false"
|
|
30
52
|
:range="false"
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@falcondev-oss/nuxt-layers-base",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "0.
|
|
4
|
+
"version": "0.30.0",
|
|
5
5
|
"description": "Nuxt layer with lots of useful helpers and @nuxt/ui components",
|
|
6
6
|
"license": "MIT",
|
|
7
7
|
"repository": "github:falcondev-oss/nuxt-layers",
|
|
@@ -14,20 +14,20 @@
|
|
|
14
14
|
"pnpm": "10"
|
|
15
15
|
},
|
|
16
16
|
"peerDependencies": {
|
|
17
|
+
"@falcondev-oss/form-core": "^0.22.4",
|
|
18
|
+
"@falcondev-oss/form-vue": "^0.22.4",
|
|
19
|
+
"@internationalized/date": "^3.12.0",
|
|
17
20
|
"@nuxt/ui": "~4.5.0"
|
|
18
21
|
},
|
|
19
22
|
"dependencies": {
|
|
20
|
-
"@falcondev-oss/form-core": "^0.22.1",
|
|
21
|
-
"@falcondev-oss/form-vue": "^0.22.1",
|
|
22
23
|
"@falcondev-oss/trpc-typed-form-data": "^0.4.1",
|
|
23
24
|
"@falcondev-oss/trpc-vue-query": "^0.5.2",
|
|
24
|
-
"@iconify-json/lucide": "^1.2.
|
|
25
|
-
"@internationalized/date": "^3.11.0",
|
|
25
|
+
"@iconify-json/lucide": "^1.2.96",
|
|
26
26
|
"@nuxt/icon": "^2.2.1",
|
|
27
27
|
"@nuxtjs/color-mode": "^4.0.0",
|
|
28
28
|
"@tanstack/vue-query": "^5.92.9",
|
|
29
|
-
"@trpc/client": "^11.
|
|
30
|
-
"@trpc/server": "^11.
|
|
29
|
+
"@trpc/client": "^11.12.0",
|
|
30
|
+
"@trpc/server": "^11.12.0",
|
|
31
31
|
"@vue/devtools-api": "^8.0.7",
|
|
32
32
|
"@vueuse/core": "^14.2.1",
|
|
33
33
|
"@vueuse/nuxt": "^14.2.1",
|
|
@@ -36,13 +36,13 @@
|
|
|
36
36
|
"consola": "^3.4.2",
|
|
37
37
|
"defu": "^6.1.4",
|
|
38
38
|
"maska": "^3.2.0",
|
|
39
|
-
"reka-ui": "^2.
|
|
39
|
+
"reka-ui": "^2.9.1",
|
|
40
40
|
"remeda": "^2.33.6",
|
|
41
41
|
"superjson": "^2.2.6",
|
|
42
42
|
"tailwindcss": "^4.2.1",
|
|
43
43
|
"trpc-nuxt": "^2.0.1",
|
|
44
44
|
"type-fest": "^5.4.4",
|
|
45
|
-
"vue": "^3.5.
|
|
45
|
+
"vue": "^3.5.30",
|
|
46
46
|
"vue-router": "^4.6.4"
|
|
47
47
|
},
|
|
48
48
|
"devDependencies": {
|