@falcondev-oss/nuxt-layers-base 0.6.0 → 0.6.2

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,6 +1,6 @@
1
1
  <script setup lang="ts">
2
2
  import type { ButtonProps, FooterSlots, HeaderSlots, NavigationMenuItem } from '@nuxt/ui'
3
- import { omit } from 'remeda'
3
+ import { omit, pickBy, pipe } from 'remeda'
4
4
 
5
5
  defineProps<{
6
6
  header?: {
@@ -72,15 +72,20 @@ const omitFooterSlots = [
72
72
  </slot>
73
73
  </template>
74
74
 
75
- <template v-for="(_, name) in omit(slots, omitHeaderSlots)" #[name]="slotData">
75
+ <template
76
+ v-for="(_, name) in pipe(
77
+ slots,
78
+ pickBy((_, key) => key.startsWith('header-')),
79
+ omit(omitHeaderSlots),
80
+ )"
81
+ #[name]="slotData"
82
+ >
76
83
  <!-- @vue-ignore -->
77
- <slot :name="name" v-bind="slotData || {}" />
84
+ <slot :name="name.replace('header-', '')" v-bind="slotData || {}" />
78
85
  </template>
79
86
  </UHeader>
80
87
  <UMain>
81
- <UContainer>
82
- <slot />
83
- </UContainer>
88
+ <slot />
84
89
  </UMain>
85
90
  <UFooter v-if="footer">
86
91
  <template #left>
@@ -98,9 +103,16 @@ const omitFooterSlots = [
98
103
  />
99
104
  </template>
100
105
 
101
- <template v-for="(_, name) in omit(slots, omitFooterSlots)" #[name]="slotData">
106
+ <template
107
+ v-for="(_, name) in pipe(
108
+ slots,
109
+ pickBy((_, key) => key.startsWith('footer-')),
110
+ omit(omitFooterSlots),
111
+ )"
112
+ #[name]="slotData"
113
+ >
102
114
  <!-- @vue-ignore -->
103
- <slot :name="name" v-bind="slotData || {}" />
115
+ <slot :name="name.replace('footer-', '')" v-bind="slotData || {}" />
104
116
  </template>
105
117
  </UFooter>
106
118
  </div>
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.6.0",
4
+ "version": "0.6.2",
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",