sprintify-ui 0.0.64 → 0.0.66
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/sprintify-ui.es.js +2930 -2894
- package/dist/types/src/components/BaseNavbarSideItem.vue.d.ts +9 -0
- package/dist/types/src/types/index.d.ts +1 -0
- package/package.json +1 -1
- package/src/components/BaseClipboard.vue +0 -2
- package/src/components/BaseLayoutSidebarConfigurable.stories.js +19 -0
- package/src/components/BaseNavbarSideItem.vue +67 -17
- package/src/types/index.ts +1 -0
|
@@ -9,6 +9,10 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
9
9
|
default: boolean;
|
|
10
10
|
type: BooleanConstructor;
|
|
11
11
|
};
|
|
12
|
+
actionsVisible: {
|
|
13
|
+
default: string;
|
|
14
|
+
type: PropType<"toggle" | "always">;
|
|
15
|
+
};
|
|
12
16
|
}, {}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, "click"[], "click", import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
|
|
13
17
|
item: {
|
|
14
18
|
required: true;
|
|
@@ -18,9 +22,14 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
18
22
|
default: boolean;
|
|
19
23
|
type: BooleanConstructor;
|
|
20
24
|
};
|
|
25
|
+
actionsVisible: {
|
|
26
|
+
default: string;
|
|
27
|
+
type: PropType<"toggle" | "always">;
|
|
28
|
+
};
|
|
21
29
|
}>> & {
|
|
22
30
|
onClick?: ((...args: any[]) => any) | undefined;
|
|
23
31
|
}, {
|
|
24
32
|
dark: boolean;
|
|
33
|
+
actionsVisible: "toggle" | "always";
|
|
25
34
|
}>;
|
|
26
35
|
export default _default;
|
package/package.json
CHANGED
|
@@ -29,7 +29,26 @@ export default {
|
|
|
29
29
|
label: 'Articles',
|
|
30
30
|
to: '/articles',
|
|
31
31
|
icon: 'heroicons:document-text',
|
|
32
|
+
actions: [
|
|
33
|
+
{
|
|
34
|
+
label: 'Articles',
|
|
35
|
+
to: '/articles/1',
|
|
36
|
+
},
|
|
37
|
+
{
|
|
38
|
+
label: 'Videos',
|
|
39
|
+
to: '/articles/2',
|
|
40
|
+
},
|
|
41
|
+
{
|
|
42
|
+
label: 'Training',
|
|
43
|
+
to: '/articles/3',
|
|
44
|
+
},
|
|
45
|
+
{
|
|
46
|
+
label: 'Archived',
|
|
47
|
+
to: '/articles/4',
|
|
48
|
+
},
|
|
49
|
+
],
|
|
32
50
|
},
|
|
51
|
+
|
|
33
52
|
{
|
|
34
53
|
label: 'Users',
|
|
35
54
|
to: '/users',
|
|
@@ -1,20 +1,42 @@
|
|
|
1
1
|
<template>
|
|
2
|
-
<
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
<
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
2
|
+
<div>
|
|
3
|
+
<BaseActionItem
|
|
4
|
+
:item="item"
|
|
5
|
+
:dark="dark"
|
|
6
|
+
item-class="flex w-full"
|
|
7
|
+
@click="onClick"
|
|
8
|
+
>
|
|
9
|
+
<template #default="{ active }">
|
|
10
|
+
<BaseNavbarSideItemContent
|
|
11
|
+
:label="item.label"
|
|
12
|
+
:icon="item.icon"
|
|
13
|
+
:active="active"
|
|
14
|
+
:count="item.count"
|
|
15
|
+
:dark="dark"
|
|
16
|
+
/>
|
|
17
|
+
</template>
|
|
18
|
+
</BaseActionItem>
|
|
19
|
+
|
|
20
|
+
<div
|
|
21
|
+
v-if="showSubActions && item.actions && item.actions.length"
|
|
22
|
+
class="ml-10 mt-1.5 mb-3"
|
|
23
|
+
>
|
|
24
|
+
<div v-for="subItem in item.actions" :key="subItem.label" class="mb-1">
|
|
25
|
+
<BaseActionItem
|
|
26
|
+
:item="subItem"
|
|
27
|
+
:dark="dark"
|
|
28
|
+
:item-class="[
|
|
29
|
+
'flex w-full',
|
|
30
|
+
dark
|
|
31
|
+
? 'text-slate-300 hover:text-white'
|
|
32
|
+
: 'text-slate-900 hover:text-slate-600',
|
|
33
|
+
]"
|
|
34
|
+
>
|
|
35
|
+
{{ subItem.label }}
|
|
36
|
+
</BaseActionItem>
|
|
37
|
+
</div>
|
|
38
|
+
</div>
|
|
39
|
+
</div>
|
|
18
40
|
</template>
|
|
19
41
|
|
|
20
42
|
<script setup lang="ts">
|
|
@@ -23,7 +45,7 @@ import { ActionItem } from '@/types';
|
|
|
23
45
|
import BaseActionItem from './BaseActionItem.vue';
|
|
24
46
|
import BaseNavbarSideItemContent from './BaseNavbarSideItemContent.vue';
|
|
25
47
|
|
|
26
|
-
defineProps({
|
|
48
|
+
const props = defineProps({
|
|
27
49
|
item: {
|
|
28
50
|
required: true,
|
|
29
51
|
type: Object as PropType<ActionItem>,
|
|
@@ -32,11 +54,39 @@ defineProps({
|
|
|
32
54
|
default: false,
|
|
33
55
|
type: Boolean,
|
|
34
56
|
},
|
|
57
|
+
actionsVisible: {
|
|
58
|
+
default: 'toggle',
|
|
59
|
+
type: String as PropType<'toggle' | 'always'>,
|
|
60
|
+
},
|
|
35
61
|
});
|
|
36
62
|
|
|
37
63
|
const emit = defineEmits(['click']);
|
|
38
64
|
|
|
65
|
+
const router = useRouter();
|
|
66
|
+
|
|
39
67
|
async function onClick() {
|
|
40
68
|
emit('click');
|
|
41
69
|
}
|
|
70
|
+
|
|
71
|
+
const routeActive = computed((): boolean => {
|
|
72
|
+
if (!props.item.to) {
|
|
73
|
+
return false;
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
const itemRoute = router.resolve(props.item.to);
|
|
77
|
+
|
|
78
|
+
return router.currentRoute.value.matched.some((route) => {
|
|
79
|
+
return itemRoute.path == route.path;
|
|
80
|
+
});
|
|
81
|
+
});
|
|
82
|
+
|
|
83
|
+
const showSubActions = computed((): boolean => {
|
|
84
|
+
if (props.actionsVisible == 'always') {
|
|
85
|
+
return true;
|
|
86
|
+
}
|
|
87
|
+
if (!props.item.to) {
|
|
88
|
+
return true;
|
|
89
|
+
}
|
|
90
|
+
return routeActive.value;
|
|
91
|
+
});
|
|
42
92
|
</script>
|