@xy-planning-network/trees 0.11.1-dev → 0.11.1-dev-3
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.
- package/dist/trees.es.js +1264 -1242
- package/dist/trees.umd.js +9 -9
- package/package.json +1 -1
- package/src/lib-components/layout/UserMenu.vue +11 -9
- package/src/lib-components/overlays/Popover/PopoverContent.vue +38 -1
- package/types/composables/nav.d.ts +0 -1
- package/types/lib-components/overlays/Popover/PopoverContent.vue.d.ts +6 -1
package/package.json
CHANGED
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
<script setup lang="ts">
|
|
2
2
|
import { UserMenuItem } from "@/composables/nav"
|
|
3
|
-
import
|
|
3
|
+
import AppIcon from "@/lib-components/indicators/AppIcon.vue"
|
|
4
|
+
import Popover from "@/lib-components/overlays/Popover/Popover.vue"
|
|
5
|
+
import PopoverContent from "@/lib-components/overlays/Popover/PopoverContent.vue"
|
|
4
6
|
import TooltipWrapper from "@/lib-components/overlays/TooltipWrapper.vue"
|
|
5
7
|
import { computed } from "vue"
|
|
6
8
|
|
|
@@ -56,8 +58,8 @@ const items = computed(() => {
|
|
|
56
58
|
</template>
|
|
57
59
|
|
|
58
60
|
<template #default>
|
|
59
|
-
<PopoverContent>
|
|
60
|
-
<ul
|
|
61
|
+
<PopoverContent v-if="item.action === 'nav'">
|
|
62
|
+
<ul class="flex flex-col text-sm/6">
|
|
61
63
|
<li v-for="(nav, navKey) in item.navigation" :key="navKey">
|
|
62
64
|
<a
|
|
63
65
|
:href="nav.url"
|
|
@@ -72,13 +74,13 @@ const items = computed(() => {
|
|
|
72
74
|
</a>
|
|
73
75
|
</li>
|
|
74
76
|
</ul>
|
|
75
|
-
|
|
76
|
-
<component
|
|
77
|
-
:is="item.component"
|
|
78
|
-
v-if="item.action === 'flyout'"
|
|
79
|
-
v-bind="item.props"
|
|
80
|
-
/>
|
|
81
77
|
</PopoverContent>
|
|
78
|
+
|
|
79
|
+
<component
|
|
80
|
+
:is="item.component"
|
|
81
|
+
v-if="item.action === 'flyout'"
|
|
82
|
+
v-bind="item.props"
|
|
83
|
+
/>
|
|
82
84
|
</template>
|
|
83
85
|
</Popover>
|
|
84
86
|
</div>
|
|
@@ -1,7 +1,44 @@
|
|
|
1
|
+
<script setup lang="ts">
|
|
2
|
+
import { computed } from "vue"
|
|
3
|
+
|
|
4
|
+
const props = withDefaults(
|
|
5
|
+
defineProps<{ size?: "xs" | "sm" | "md" | "lg" | "xl" | "2xl" }>(),
|
|
6
|
+
{ size: "xs" }
|
|
7
|
+
)
|
|
8
|
+
const maxWidth = computed(() => {
|
|
9
|
+
let maxWidth = "max-w-xs"
|
|
10
|
+
switch (props.size) {
|
|
11
|
+
case "xs":
|
|
12
|
+
maxWidth = "max-w-xs"
|
|
13
|
+
break
|
|
14
|
+
case "sm":
|
|
15
|
+
maxWidth = "max-w-sm"
|
|
16
|
+
break
|
|
17
|
+
case "md":
|
|
18
|
+
maxWidth = "max-w-md"
|
|
19
|
+
break
|
|
20
|
+
case "lg":
|
|
21
|
+
maxWidth = "max-w-lg"
|
|
22
|
+
break
|
|
23
|
+
case "xl":
|
|
24
|
+
maxWidth = "max-w-xl"
|
|
25
|
+
break
|
|
26
|
+
case "2xl":
|
|
27
|
+
maxWidth = "max-w-2xl"
|
|
28
|
+
break
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
return maxWidth
|
|
32
|
+
})
|
|
33
|
+
</script>
|
|
34
|
+
|
|
1
35
|
<template>
|
|
2
36
|
<!--styling wrapper - top level element will merge attrs for class overrides -->
|
|
3
37
|
<div
|
|
4
|
-
class="
|
|
38
|
+
:class="[
|
|
39
|
+
'w-full bg-white rounded-xy p-2 border border-gray-100 shadow-md',
|
|
40
|
+
maxWidth,
|
|
41
|
+
]"
|
|
5
42
|
>
|
|
6
43
|
<slot></slot>
|
|
7
44
|
</div>
|
|
@@ -19,7 +19,6 @@ export interface UserMenuItemFlyout<T extends Component> extends UserMenuItemBas
|
|
|
19
19
|
}
|
|
20
20
|
export type UserMenuItem = UserMenuItemUrl | UserMenuItemNav | UserMenuItemFlyout<Component>;
|
|
21
21
|
export interface NavItem {
|
|
22
|
-
badge?: boolean | string | number;
|
|
23
22
|
icon?: Component | RenderFunction;
|
|
24
23
|
name: string;
|
|
25
24
|
description?: string;
|
|
@@ -1,4 +1,9 @@
|
|
|
1
|
-
|
|
1
|
+
type __VLS_Props = {
|
|
2
|
+
size?: "xs" | "sm" | "md" | "lg" | "xl" | "2xl";
|
|
3
|
+
};
|
|
4
|
+
declare const _default: __VLS_WithTemplateSlots<import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {
|
|
5
|
+
size: "xs" | "sm" | "lg" | "xl" | "md" | "2xl";
|
|
6
|
+
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>, {
|
|
2
7
|
default?(_: {}): any;
|
|
3
8
|
}>;
|
|
4
9
|
export default _default;
|