@falcondev-oss/nuxt-layers-base 0.10.0 → 0.10.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.
|
@@ -8,7 +8,7 @@ import type {
|
|
|
8
8
|
NavigationMenuItem,
|
|
9
9
|
NavigationMenuProps,
|
|
10
10
|
} from '@nuxt/ui'
|
|
11
|
-
import { omit, pickBy, pipe } from 'remeda'
|
|
11
|
+
import { keys, omit, pickBy, pipe, pullObject } from 'remeda'
|
|
12
12
|
|
|
13
13
|
defineProps<{
|
|
14
14
|
header?: {
|
|
@@ -44,11 +44,37 @@ const omitHeaderSlots = [
|
|
|
44
44
|
'header-default',
|
|
45
45
|
] satisfies (keyof typeof slots)[]
|
|
46
46
|
|
|
47
|
+
const headerSlots = computed(() =>
|
|
48
|
+
pipe(
|
|
49
|
+
slots,
|
|
50
|
+
pickBy((_, key) => key.startsWith('header-')),
|
|
51
|
+
omit(omitHeaderSlots),
|
|
52
|
+
keys(),
|
|
53
|
+
pullObject(
|
|
54
|
+
(key) => key.replace('header-', ''),
|
|
55
|
+
(key) => key,
|
|
56
|
+
),
|
|
57
|
+
),
|
|
58
|
+
)
|
|
59
|
+
|
|
47
60
|
const omitFooterSlots = [
|
|
48
61
|
'footer-left',
|
|
49
62
|
'footer-right',
|
|
50
63
|
'footer-default',
|
|
51
64
|
] satisfies (keyof typeof slots)[]
|
|
65
|
+
|
|
66
|
+
const footerSlots = computed(() =>
|
|
67
|
+
pipe(
|
|
68
|
+
slots,
|
|
69
|
+
pickBy((_, key) => key.startsWith('footer-')),
|
|
70
|
+
omit(omitFooterSlots),
|
|
71
|
+
keys(),
|
|
72
|
+
pullObject(
|
|
73
|
+
(key) => key.replace('footer-', ''),
|
|
74
|
+
(key) => key,
|
|
75
|
+
),
|
|
76
|
+
),
|
|
77
|
+
)
|
|
52
78
|
</script>
|
|
53
79
|
|
|
54
80
|
<!-- eslint-disable vue/require-explicit-slots -->
|
|
@@ -82,16 +108,9 @@ const omitFooterSlots = [
|
|
|
82
108
|
</slot>
|
|
83
109
|
</template>
|
|
84
110
|
|
|
85
|
-
<template
|
|
86
|
-
v-for="(_, name) in pipe(
|
|
87
|
-
slots,
|
|
88
|
-
pickBy((_, key) => key.startsWith('header-')),
|
|
89
|
-
omit(omitHeaderSlots),
|
|
90
|
-
)"
|
|
91
|
-
#[name]="slotData"
|
|
92
|
-
>
|
|
111
|
+
<template v-for="(originalName, slotName) in headerSlots" #[slotName]="slotData">
|
|
93
112
|
<!-- @vue-ignore -->
|
|
94
|
-
<slot :name="
|
|
113
|
+
<slot :name="originalName" v-bind="slotData || {}" />
|
|
95
114
|
</template>
|
|
96
115
|
</UHeader>
|
|
97
116
|
<UMain>
|
|
@@ -99,30 +118,27 @@ const omitFooterSlots = [
|
|
|
99
118
|
</UMain>
|
|
100
119
|
<UFooter v-if="footer" :ui="footer.ui">
|
|
101
120
|
<template #left>
|
|
102
|
-
<
|
|
121
|
+
<slot name="footer-left">
|
|
122
|
+
<p class="text-muted text-sm">Copyright © {{ new Date().getFullYear() }}</p>
|
|
123
|
+
</slot>
|
|
103
124
|
</template>
|
|
104
125
|
|
|
105
126
|
<UNavigationMenu v-if="footer.items" :items="footer.items" variant="link" />
|
|
106
127
|
|
|
107
|
-
<template v-if="footer.actions" #right>
|
|
108
|
-
<
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
128
|
+
<template v-if="footer.actions || slots['footer-right']" #right>
|
|
129
|
+
<slot name="footer-right">
|
|
130
|
+
<UActions
|
|
131
|
+
:actions="footer.actions"
|
|
132
|
+
:defaults="{
|
|
133
|
+
variant: 'ghost',
|
|
134
|
+
}"
|
|
135
|
+
/>
|
|
136
|
+
</slot>
|
|
114
137
|
</template>
|
|
115
138
|
|
|
116
|
-
<template
|
|
117
|
-
v-for="(_, name) in pipe(
|
|
118
|
-
slots,
|
|
119
|
-
pickBy((_, key) => key.startsWith('footer-')),
|
|
120
|
-
omit(omitFooterSlots),
|
|
121
|
-
)"
|
|
122
|
-
#[name]="slotData"
|
|
123
|
-
>
|
|
139
|
+
<template v-for="(originalName, slotName) in footerSlots" #[slotName]="slotData">
|
|
124
140
|
<!-- @vue-ignore -->
|
|
125
|
-
<slot :name="
|
|
141
|
+
<slot :name="originalName" v-bind="slotData || {}" />
|
|
126
142
|
</template>
|
|
127
143
|
</UFooter>
|
|
128
144
|
</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.10.
|
|
4
|
+
"version": "0.10.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",
|
|
@@ -16,7 +16,7 @@
|
|
|
16
16
|
"peerDependencies": {
|
|
17
17
|
"@falcondev-oss/form-core": "^0.18.5",
|
|
18
18
|
"@falcondev-oss/form-vue": "^0.18.5",
|
|
19
|
-
"@falcondev-oss/trpc-typed-form-data": "^0.
|
|
19
|
+
"@falcondev-oss/trpc-typed-form-data": "^0.2.0",
|
|
20
20
|
"@falcondev-oss/trpc-vue-query": "^0.5.2",
|
|
21
21
|
"@iconify-json/lucide": "^1.2.2",
|
|
22
22
|
"@internationalized/date": "^3.10.1",
|
|
@@ -47,7 +47,7 @@
|
|
|
47
47
|
"devDependencies": {
|
|
48
48
|
"@falcondev-oss/configs": "^5.0.2",
|
|
49
49
|
"eslint": "^9.39.2",
|
|
50
|
-
"prettier": "^3.
|
|
50
|
+
"prettier": "^3.8.0",
|
|
51
51
|
"typescript": "^5.9.3",
|
|
52
52
|
"vue-tsc": "^3.2.2",
|
|
53
53
|
"zod": "^4.3.5"
|