@falcondev-oss/nuxt-layers-base 0.27.2 → 0.28.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.
@@ -105,9 +105,17 @@ const model_ = { model }
105
105
  >
106
106
  <UIcon name="lucide:circle-alert" class="text-error" />
107
107
  <template #content>
108
- <p class="text-(--ui-color-neutral-800) max-w-sm whitespace-normal text-xs">
109
- {{ field.errors.join('\n') }}
110
- </p>
108
+ <div class="text-(--ui-color-neutral-800) max-w-sm text-xs">
109
+ <p v-if="field.errors.length === 1">
110
+ {{ field.errors.join('\n') }}
111
+ </p>
112
+
113
+ <ul v-else>
114
+ <li v-for="(error, index) in field.errors" :key="error + index" class="list-inside">
115
+ {{ error }}
116
+ </li>
117
+ </ul>
118
+ </div>
111
119
  </template>
112
120
  </UPopover>
113
121
 
@@ -8,6 +8,7 @@ const props = withDefaults(
8
8
  submitLabel?: string
9
9
  submitButtonProps?: ButtonProps
10
10
  actions?: ButtonProps[]
11
+ actionsTeleportTo?: string
11
12
  form: FormHandle
12
13
  disableSubmitIfUnchanged?: boolean
13
14
  successToast?: Partial<Toast>
@@ -42,9 +43,7 @@ watch(
42
43
  },
43
44
  })
44
45
  },
45
- {
46
- immediate: true,
47
- },
46
+ { immediate: true },
48
47
  )
49
48
 
50
49
  const actionsWithSubmit = computed(() => {
@@ -78,12 +77,9 @@ const rootErrors = computed(() => props.form.errors?.filter((error) => error.pat
78
77
  </li>
79
78
  </ul>
80
79
  <div class="flex items-center justify-end gap-4">
81
- <UActions
82
- :defaults="{
83
- variant: 'subtle',
84
- }"
85
- :actions="actionsWithSubmit"
86
- />
80
+ <Teleport defer :disabled="!props.actionsTeleportTo" :to="props.actionsTeleportTo">
81
+ <UActions :defaults="{ variant: 'subtle' }" :actions="actionsWithSubmit" />
82
+ </Teleport>
87
83
  </div>
88
84
  </div>
89
85
  </form>
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.27.2",
4
+ "version": "0.28.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",