@falcondev-oss/nuxt-layers-base 0.26.0 → 0.27.1

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.
@@ -9,7 +9,16 @@ const form = useForm({
9
9
  schema: z.object({
10
10
  duration: z.number().meta({ title: 'Duration' }),
11
11
  dateIso: z.string().meta({ title: 'Datum' }),
12
- text: z.string().max(10).meta({ title: 'Text' }),
12
+ text: z
13
+ .string()
14
+ .min(3)
15
+ .max(10)
16
+ .meta({
17
+ title: 'Text',
18
+ description: 'Beschreibung',
19
+ default: 'Default Wert',
20
+ examples: ['Hier könnte ein Beispieltext stehen', '123'],
21
+ }),
13
22
  }),
14
23
  sourceValues: () => ({
15
24
  dateIso: null,
@@ -60,7 +60,7 @@ const formFieldProps = computed<FormFieldProps>(() => {
60
60
  const bind = computed(() => {
61
61
  const field = forwardedProps.value.field
62
62
 
63
- const placeholder = field.errors && field.errors.join('\n')
63
+ const placeholder = (field.errors && field.errors.join('\n')) || field.schema.default?.toString()
64
64
 
65
65
  return {
66
66
  'modelValue': field.value,
@@ -115,6 +115,19 @@ const model_ = { model }
115
115
  </span>
116
116
  </template>
117
117
 
118
+ <template #help>
119
+ <template v-if="Array.isArray(field.schema.examples)">
120
+ <ul>
121
+ <li v-for="(example, index) in field.schema.examples" :key="index">
122
+ {{ example }}
123
+ </li>
124
+ </ul>
125
+ </template>
126
+ <p v-else-if="field.schema.examples">
127
+ {{ field.schema.examples }}
128
+ </p>
129
+ </template>
130
+
118
131
  <slot v-bind="{ bind, model: model_.model, field: forwardedProps.field }">
119
132
  <DevOnly>
120
133
  <p class="font-black text-red-500">UField missing slot</p>
@@ -132,6 +145,7 @@ const model_ = { model }
132
145
  :deep([aria-invalid='true']) {
133
146
  &::placeholder {
134
147
  color: var(--ui-color-error-500);
148
+ opacity: 0.5;
135
149
  }
136
150
  }
137
151
  </style>
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.26.0",
4
+ "version": "0.27.1",
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",
@@ -17,18 +17,18 @@
17
17
  "@nuxt/ui": "~4.5.0"
18
18
  },
19
19
  "dependencies": {
20
- "@falcondev-oss/form-core": "^0.21.2",
21
- "@falcondev-oss/form-vue": "^0.21.2",
20
+ "@falcondev-oss/form-core": "^0.22.1",
21
+ "@falcondev-oss/form-vue": "^0.22.1",
22
22
  "@falcondev-oss/trpc-typed-form-data": "^0.4.1",
23
23
  "@falcondev-oss/trpc-vue-query": "^0.5.2",
24
- "@iconify-json/lucide": "^1.2.94",
24
+ "@iconify-json/lucide": "^1.2.95",
25
25
  "@internationalized/date": "^3.11.0",
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.10.0",
30
- "@trpc/server": "^11.10.0",
31
- "@vue/devtools-api": "^8.0.6",
29
+ "@trpc/client": "^11.11.0",
30
+ "@trpc/server": "^11.11.0",
31
+ "@vue/devtools-api": "^8.0.7",
32
32
  "@vueuse/core": "^14.2.1",
33
33
  "@vueuse/nuxt": "^14.2.1",
34
34
  "@vueuse/router": "^14.2.1",