sprintify-ui 0.4.11 → 0.5.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/sprintify-ui.es.js +11240 -11075
- package/dist/style.css +1 -1
- package/dist/types/src/components/BaseActionItem.vue.d.ts +7 -17
- package/dist/types/src/components/BaseActionItemButton.vue.d.ts +3 -3
- package/dist/types/src/components/BaseAutocomplete.vue.d.ts +1 -1
- package/dist/types/src/components/BaseAutocompleteFetch.vue.d.ts +1 -1
- package/dist/types/src/components/BaseBelongsTo.vue.d.ts +1 -1
- package/dist/types/src/components/BaseBelongsToFetch.vue.d.ts +1 -1
- package/dist/types/src/components/BaseButtonGroup.vue.d.ts +1 -1
- package/dist/types/src/components/BaseColor.vue.d.ts +1 -1
- package/dist/types/src/components/BaseDataIterator.vue.d.ts +5 -4
- package/dist/types/src/components/BaseDataTable.vue.d.ts +8 -7
- package/dist/types/src/components/BaseDatePicker.vue.d.ts +9 -9
- package/dist/types/src/components/BaseDateSelect.vue.d.ts +1 -1
- package/dist/types/src/components/BaseDropdownAutocomplete.vue.d.ts +1 -1
- package/dist/types/src/components/BaseField.vue.d.ts +1 -1
- package/dist/types/src/components/BaseFieldI18n.vue.d.ts +1 -1
- package/dist/types/src/components/BaseHeader.vue.d.ts +2 -1
- package/dist/types/src/components/BaseInput.vue.d.ts +1 -1
- package/dist/types/src/components/BaseInputPercent.vue.d.ts +1 -1
- package/dist/types/src/components/BaseLayoutSidebarConfigurable.vue.d.ts +4 -3
- package/dist/types/src/components/BaseLayoutStacked.vue.d.ts +39 -7
- package/dist/types/src/components/BaseLayoutStackedConfigurable.vue.d.ts +20 -1
- package/dist/types/src/components/BaseMenu.vue.d.ts +7 -7
- package/dist/types/src/components/BaseMenuItem.vue.d.ts +9 -0
- package/dist/types/src/components/BaseNavbar.vue.d.ts +40 -8
- package/dist/types/src/components/BaseNavbarItem.vue.d.ts +10 -1
- package/dist/types/src/components/BaseNavbarItemContent.vue.d.ts +4 -4
- package/dist/types/src/components/BaseNavbarSideItem.vue.d.ts +1 -10
- package/dist/types/src/components/BaseNavbarSideItemContent.vue.d.ts +1 -1
- package/dist/types/src/components/BasePassword.vue.d.ts +1 -1
- package/dist/types/src/components/BaseRadioGroup.vue.d.ts +1 -1
- package/dist/types/src/components/BaseRichText.vue.d.ts +4 -4
- package/dist/types/src/components/BaseSelect.vue.d.ts +1 -1
- package/dist/types/src/components/BaseShortcut.vue.d.ts +1 -1
- package/dist/types/src/components/BaseStatistic.vue.d.ts +1 -1
- package/dist/types/src/components/BaseSwitch.vue.d.ts +1 -1
- package/dist/types/src/components/BaseSystemAlert.vue.d.ts +1 -1
- package/dist/types/src/components/BaseTableColumn.vue.d.ts +1 -1
- package/dist/types/src/components/BaseTagAutocomplete.vue.d.ts +1 -1
- package/dist/types/src/components/BaseTextarea.vue.d.ts +1 -1
- package/dist/types/src/types/ActionItem.d.ts +15 -0
- package/dist/types/src/types/index.d.ts +0 -26
- package/package.json +1 -1
- package/src/components/BaseActionItem.vue +25 -14
- package/src/components/BaseActionItemButton.vue +14 -16
- package/src/components/BaseDataIterator.stories.js +1 -1
- package/src/components/BaseDataIterator.vue +2 -2
- package/src/components/BaseDataTable.stories.js +1 -1
- package/src/components/BaseDataTable.vue +4 -4
- package/src/components/BaseHeader.vue +3 -2
- package/src/components/BaseLayoutNotificationDropdown.vue +7 -7
- package/src/components/BaseLayoutSidebarConfigurable.stories.js +25 -5
- package/src/components/BaseLayoutSidebarConfigurable.vue +23 -27
- package/src/components/BaseLayoutStacked.vue +38 -11
- package/src/components/BaseLayoutStackedConfigurable.stories.js +50 -1
- package/src/components/BaseLayoutStackedConfigurable.vue +22 -6
- package/src/components/BaseMenu.vue +3 -3
- package/src/components/BaseMenuItem.vue +39 -15
- package/src/components/BaseNavbar.stories.js +8 -7
- package/src/components/BaseNavbar.vue +81 -17
- package/src/components/BaseNavbarItem.vue +38 -7
- package/src/components/BaseNavbarItemContent.vue +37 -19
- package/src/components/BaseNavbarSideItem.vue +22 -17
- package/src/components/BaseNavbarSideItemContent.vue +1 -1
- package/src/components/BaseShortcut.vue +5 -3
- package/src/components/BaseSideNavigation.stories.js +1 -1
- package/src/components/BaseTabItem.vue +4 -9
- package/src/components/BaseTabs.stories.js +7 -3
- package/src/components/BaseTabs.vue +94 -5
- package/src/stories/List.stories.js +1 -1
- package/src/types/ActionItem.ts +16 -0
- package/src/types/index.ts +0 -29
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { RouteLocationRaw } from "vue-router";
|
|
2
|
+
import { ActionColors } from ".";
|
|
3
|
+
export interface ActionItem {
|
|
4
|
+
label?: string;
|
|
5
|
+
description?: string;
|
|
6
|
+
href?: string;
|
|
7
|
+
to?: RouteLocationRaw;
|
|
8
|
+
action?: () => Promise<void> | void;
|
|
9
|
+
icon?: string;
|
|
10
|
+
count?: number;
|
|
11
|
+
color?: ActionColors;
|
|
12
|
+
disabled?: boolean;
|
|
13
|
+
meta?: Record<string, any>;
|
|
14
|
+
actions?: ActionItem[];
|
|
15
|
+
}
|
|
@@ -52,32 +52,6 @@ export interface PaginatedCollection extends PaginationMetadata {
|
|
|
52
52
|
data: Collection;
|
|
53
53
|
}
|
|
54
54
|
export type ActionColors = 'dark' | 'light' | 'danger' | 'success' | 'warning' | 'primary' | 'secondary';
|
|
55
|
-
export interface MenuItemInterface {
|
|
56
|
-
label?: string;
|
|
57
|
-
href?: string;
|
|
58
|
-
to?: RouteLocationRaw;
|
|
59
|
-
action?: () => Promise<void> | void;
|
|
60
|
-
icon?: string;
|
|
61
|
-
count?: number;
|
|
62
|
-
color?: ActionColors;
|
|
63
|
-
line?: boolean;
|
|
64
|
-
}
|
|
65
|
-
export interface ActionItem {
|
|
66
|
-
label: string;
|
|
67
|
-
href?: string;
|
|
68
|
-
to?: RouteLocationRaw;
|
|
69
|
-
action?: () => Promise<void> | void;
|
|
70
|
-
icon?: string;
|
|
71
|
-
count?: number;
|
|
72
|
-
color?: ActionColors;
|
|
73
|
-
disabled?: boolean;
|
|
74
|
-
meta?: Record<string, any>;
|
|
75
|
-
actions?: ActionItem[];
|
|
76
|
-
}
|
|
77
|
-
export interface ActionSection {
|
|
78
|
-
title: string;
|
|
79
|
-
actions: ActionItem[];
|
|
80
|
-
}
|
|
81
55
|
export type Row = Record<string, any>;
|
|
82
56
|
export interface BaseTableColumn {
|
|
83
57
|
id: string;
|
package/package.json
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
<template>
|
|
2
2
|
<RouterLink
|
|
3
|
-
v-if="to"
|
|
3
|
+
v-if="item.to"
|
|
4
4
|
v-slot="{ isActive, href: slotHref, navigate }"
|
|
5
5
|
custom
|
|
6
|
-
:to="to"
|
|
6
|
+
:to="item.to"
|
|
7
7
|
>
|
|
8
8
|
<a
|
|
9
9
|
:active="isActive"
|
|
10
10
|
:href="slotHref"
|
|
11
|
-
:class="
|
|
11
|
+
:class="classInternal"
|
|
12
12
|
:aria-current="isActive ? 'page' : undefined"
|
|
13
13
|
@click.prevent="onClick(navigate)"
|
|
14
14
|
>
|
|
@@ -16,22 +16,27 @@
|
|
|
16
16
|
</a>
|
|
17
17
|
</RouterLink>
|
|
18
18
|
<button
|
|
19
|
-
v-else-if="action"
|
|
19
|
+
v-else-if="item.action"
|
|
20
20
|
type="button"
|
|
21
|
-
class="
|
|
22
|
-
|
|
23
|
-
@click="onClick(action)"
|
|
21
|
+
:class="classInternal"
|
|
22
|
+
@click="onClick(item.action)"
|
|
24
23
|
>
|
|
25
24
|
<slot :active="false" />
|
|
26
25
|
</button>
|
|
27
26
|
<a
|
|
28
|
-
v-else-if="href"
|
|
29
|
-
:href="href"
|
|
30
|
-
:class="
|
|
27
|
+
v-else-if="item.href"
|
|
28
|
+
:href="item.href"
|
|
29
|
+
:class="classInternal"
|
|
31
30
|
@click="onClick()"
|
|
32
31
|
>
|
|
33
32
|
<slot :active="false" />
|
|
34
33
|
</a>
|
|
34
|
+
<div
|
|
35
|
+
v-else
|
|
36
|
+
:class="classInternal"
|
|
37
|
+
>
|
|
38
|
+
<slot :active="false" />
|
|
39
|
+
</div>
|
|
35
40
|
</template>
|
|
36
41
|
|
|
37
42
|
<script lang="ts">
|
|
@@ -41,15 +46,21 @@ export default {
|
|
|
41
46
|
</script>
|
|
42
47
|
|
|
43
48
|
<script setup lang="ts">
|
|
44
|
-
import {
|
|
49
|
+
import { ActionItem } from '@/types/ActionItem';
|
|
50
|
+
import { twMerge } from 'tailwind-merge';
|
|
45
51
|
|
|
46
52
|
const props = defineProps<{
|
|
47
|
-
|
|
48
|
-
href?: string;
|
|
49
|
-
action?: (() => Promise<void>) | (() => void);
|
|
53
|
+
item: ActionItem,
|
|
50
54
|
class?: string | string[] | null;
|
|
51
55
|
}>();
|
|
52
56
|
|
|
57
|
+
const classInternal = computed(() => {
|
|
58
|
+
return twMerge(
|
|
59
|
+
'block text-left',
|
|
60
|
+
props.class,
|
|
61
|
+
);
|
|
62
|
+
});
|
|
63
|
+
|
|
53
64
|
const closeMenu = inject('closeMenu', () => {
|
|
54
65
|
return;
|
|
55
66
|
}) as () => void;
|
|
@@ -1,31 +1,29 @@
|
|
|
1
1
|
<template>
|
|
2
2
|
<BaseActionItem
|
|
3
|
-
:
|
|
4
|
-
:href="action.href"
|
|
5
|
-
:action="action.action"
|
|
3
|
+
:item="item"
|
|
6
4
|
:class="classes"
|
|
7
5
|
class="flex items-center justify-center"
|
|
8
6
|
>
|
|
9
7
|
<BaseIcon
|
|
10
|
-
v-if="
|
|
11
|
-
:icon="
|
|
8
|
+
v-if="item.icon"
|
|
9
|
+
:icon="item.icon"
|
|
12
10
|
:class="iconClasses"
|
|
13
11
|
class="mr-2"
|
|
14
12
|
/>
|
|
15
13
|
<span
|
|
16
|
-
:class="[
|
|
17
|
-
>{{
|
|
14
|
+
:class="[item.icon ? 'pr-1' : '']"
|
|
15
|
+
>{{ item.label }}</span>
|
|
18
16
|
</BaseActionItem>
|
|
19
17
|
</template>
|
|
20
18
|
|
|
21
19
|
<script lang="ts" setup>
|
|
22
|
-
import { ActionItem } from '@/types';
|
|
23
20
|
import { BaseIcon } from '..';
|
|
21
|
+
import { ActionItem } from '@/types/ActionItem';
|
|
24
22
|
import BaseActionItem from './BaseActionItem.vue';
|
|
25
23
|
|
|
26
24
|
const props = withDefaults(
|
|
27
25
|
defineProps<{
|
|
28
|
-
|
|
26
|
+
item: ActionItem;
|
|
29
27
|
size: 'sm' | 'md' | 'lg';
|
|
30
28
|
}>(),
|
|
31
29
|
{
|
|
@@ -36,19 +34,19 @@ const props = withDefaults(
|
|
|
36
34
|
const classes = computed(() => {
|
|
37
35
|
const classList = ['btn'];
|
|
38
36
|
|
|
39
|
-
if (props.
|
|
37
|
+
if (props.item.color == 'primary') {
|
|
40
38
|
classList.push('btn-primary');
|
|
41
|
-
} else if (props.
|
|
39
|
+
} else if (props.item.color == 'secondary') {
|
|
42
40
|
classList.push('btn-secondary-outline');
|
|
43
|
-
} else if (props.
|
|
41
|
+
} else if (props.item.color == 'danger') {
|
|
44
42
|
classList.push('btn-danger');
|
|
45
|
-
} else if (props.
|
|
43
|
+
} else if (props.item.color == 'warning') {
|
|
46
44
|
classList.push('btn-warning');
|
|
47
|
-
} else if (props.
|
|
45
|
+
} else if (props.item.color == 'success') {
|
|
48
46
|
classList.push('btn-success');
|
|
49
|
-
} else if (props.
|
|
47
|
+
} else if (props.item.color == 'light') {
|
|
50
48
|
classList.push('');
|
|
51
|
-
} else if (props.
|
|
49
|
+
} else if (props.item.color == 'dark') {
|
|
52
50
|
classList.push('btn-black');
|
|
53
51
|
}
|
|
54
52
|
|
|
@@ -228,10 +228,10 @@ import {
|
|
|
228
228
|
Collection,
|
|
229
229
|
DataIteratorSection,
|
|
230
230
|
DataTableQuery,
|
|
231
|
-
MenuItemInterface,
|
|
232
231
|
PaginatedCollection,
|
|
233
232
|
ResourceCollection,
|
|
234
233
|
} from '@/types';
|
|
234
|
+
import { ActionItem } from '@/types/ActionItem';
|
|
235
235
|
|
|
236
236
|
import BaseMenu from './BaseMenu.vue';
|
|
237
237
|
import BasePagination from './BasePagination.vue';
|
|
@@ -285,7 +285,7 @@ const props = defineProps({
|
|
|
285
285
|
*/
|
|
286
286
|
actions: {
|
|
287
287
|
default: undefined,
|
|
288
|
-
type: Array as PropType<
|
|
288
|
+
type: Array as PropType<ActionItem[]>,
|
|
289
289
|
},
|
|
290
290
|
|
|
291
291
|
/**
|
|
@@ -242,7 +242,6 @@ import {
|
|
|
242
242
|
CollectionItem,
|
|
243
243
|
DataIteratorSection,
|
|
244
244
|
DataTableQuery,
|
|
245
|
-
MenuItemInterface,
|
|
246
245
|
PaginatedCollection,
|
|
247
246
|
ResourceCollection,
|
|
248
247
|
RowAction,
|
|
@@ -261,6 +260,7 @@ import BaseEmptyState from '../svg/BaseEmptyState.vue';
|
|
|
261
260
|
import { RouteLocationRaw } from 'vue-router';
|
|
262
261
|
import BaseMenu from './BaseMenu.vue';
|
|
263
262
|
import BaseDataTableRowAction from './BaseDataTableRowAction.vue';
|
|
263
|
+
import { ActionItem } from '@/types/ActionItem';
|
|
264
264
|
|
|
265
265
|
const router = useRouter();
|
|
266
266
|
|
|
@@ -372,7 +372,7 @@ const props = defineProps({
|
|
|
372
372
|
*/
|
|
373
373
|
checkableActions: {
|
|
374
374
|
default: undefined,
|
|
375
|
-
type: Array as PropType<
|
|
375
|
+
type: Array as PropType<ActionItem[]>,
|
|
376
376
|
},
|
|
377
377
|
|
|
378
378
|
/**
|
|
@@ -416,7 +416,7 @@ const props = defineProps({
|
|
|
416
416
|
*/
|
|
417
417
|
actions: {
|
|
418
418
|
default: undefined,
|
|
419
|
-
type: Array as PropType<
|
|
419
|
+
type: Array as PropType<ActionItem[]>,
|
|
420
420
|
},
|
|
421
421
|
|
|
422
422
|
/**
|
|
@@ -654,7 +654,7 @@ const showRowActionMenu = computed<boolean>(() => {
|
|
|
654
654
|
return rowActionsInternal.value.length > props.numberOfVisibleRowActions;
|
|
655
655
|
});
|
|
656
656
|
|
|
657
|
-
function rowActionMenuItems(row: CollectionItem):
|
|
657
|
+
function rowActionMenuItems(row: CollectionItem): ActionItem[] {
|
|
658
658
|
return rowActionsInternal.value.map((action) => {
|
|
659
659
|
return {
|
|
660
660
|
label: action.label,
|
|
@@ -71,7 +71,7 @@
|
|
|
71
71
|
<BaseActionItemButton
|
|
72
72
|
v-for="(primaryAction, i) in primaryActions"
|
|
73
73
|
:key="i"
|
|
74
|
-
:
|
|
74
|
+
:item="primaryAction"
|
|
75
75
|
size="sm"
|
|
76
76
|
/>
|
|
77
77
|
<BaseMenu
|
|
@@ -99,7 +99,8 @@
|
|
|
99
99
|
</template>
|
|
100
100
|
|
|
101
101
|
<script setup lang="ts">
|
|
102
|
-
import {
|
|
102
|
+
import { Breadcrumb } from '@/types';
|
|
103
|
+
import { ActionItem } from '@/types/ActionItem';
|
|
103
104
|
import { useResizeObserver } from '@vueuse/core';
|
|
104
105
|
import { BaseBreadcrumbs, BaseIcon } from '..';
|
|
105
106
|
import BaseActionItemButton from './BaseActionItemButton.vue';
|
|
@@ -6,8 +6,12 @@
|
|
|
6
6
|
>
|
|
7
7
|
<template #button="{ open }">
|
|
8
8
|
<div
|
|
9
|
-
class="relative flex items-center rounded-md p-1.5
|
|
10
|
-
:class="[
|
|
9
|
+
class="relative flex items-center rounded-md p-1.5"
|
|
10
|
+
:class="[
|
|
11
|
+
dark ? 'hover:bg-slate-700' : 'hover:bg-slate-100',
|
|
12
|
+
open && !dark ? 'bg-slate-100' : '',
|
|
13
|
+
open && dark ? 'bg-slate-700' : '',
|
|
14
|
+
]"
|
|
11
15
|
@click="onOpen"
|
|
12
16
|
>
|
|
13
17
|
<BaseIcon
|
|
@@ -62,11 +66,7 @@
|
|
|
62
66
|
class="hover block px-3 py-2 text-center text-sm font-medium text-primary-600 hover:bg-slate-100"
|
|
63
67
|
:class="[active ? 'bg-slate-100' : '']"
|
|
64
68
|
>
|
|
65
|
-
{{
|
|
66
|
-
notificationsConfig.footerLabel
|
|
67
|
-
? notificationsConfig.footerLabel
|
|
68
|
-
: t('sui.see_all_notifications')
|
|
69
|
-
}}
|
|
69
|
+
{{ notificationsConfig.footerLabel ? notificationsConfig.footerLabel : t('sui.see_all_notifications') }}
|
|
70
70
|
</div>
|
|
71
71
|
</RouterLink>
|
|
72
72
|
</MenuItem>
|
|
@@ -19,13 +19,32 @@ export default {
|
|
|
19
19
|
},
|
|
20
20
|
menu: [
|
|
21
21
|
{
|
|
22
|
-
|
|
22
|
+
label: 'Dashboard',
|
|
23
|
+
to: '/dashboard',
|
|
24
|
+
icon: 'heroicons:home-20-solid',
|
|
25
|
+
count: 1,
|
|
26
|
+
meta: {
|
|
27
|
+
showSubItems: 'always',
|
|
28
|
+
},
|
|
23
29
|
actions: [
|
|
24
30
|
{
|
|
25
|
-
label: '
|
|
26
|
-
to: '/',
|
|
27
|
-
|
|
31
|
+
label: 'Sales',
|
|
32
|
+
to: '/dashboard/1',
|
|
33
|
+
count: 10,
|
|
34
|
+
},
|
|
35
|
+
{
|
|
36
|
+
label: 'Performance',
|
|
37
|
+
to: '/dashboard/2',
|
|
28
38
|
},
|
|
39
|
+
{
|
|
40
|
+
label: 'Workload',
|
|
41
|
+
to: '/dashboard/3',
|
|
42
|
+
},
|
|
43
|
+
],
|
|
44
|
+
},
|
|
45
|
+
{
|
|
46
|
+
label: 'General',
|
|
47
|
+
actions: [
|
|
29
48
|
{
|
|
30
49
|
label: 'Articles',
|
|
31
50
|
to: '/articles',
|
|
@@ -35,6 +54,7 @@ export default {
|
|
|
35
54
|
{
|
|
36
55
|
label: 'Articles',
|
|
37
56
|
to: '/articles/1',
|
|
57
|
+
count: 10,
|
|
38
58
|
},
|
|
39
59
|
{
|
|
40
60
|
label: 'Videos',
|
|
@@ -59,7 +79,7 @@ export default {
|
|
|
59
79
|
],
|
|
60
80
|
},
|
|
61
81
|
{
|
|
62
|
-
|
|
82
|
+
label: 'Settings',
|
|
63
83
|
actions: [
|
|
64
84
|
{
|
|
65
85
|
label: 'Account',
|
|
@@ -9,17 +9,20 @@
|
|
|
9
9
|
<div class="px-3 py-6">
|
|
10
10
|
<div class="space-y-8">
|
|
11
11
|
<div
|
|
12
|
-
v-for="section in
|
|
13
|
-
:key="section.
|
|
12
|
+
v-for="section in menu"
|
|
13
|
+
:key="section.label"
|
|
14
14
|
>
|
|
15
|
-
<
|
|
16
|
-
v-if="section.
|
|
17
|
-
|
|
18
|
-
:class="sectionTitleClasses"
|
|
15
|
+
<div
|
|
16
|
+
v-if="section.label && !section.href && !section.to && !section.action"
|
|
17
|
+
:key="section.label"
|
|
19
18
|
>
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
19
|
+
<h2
|
|
20
|
+
class="pl-3"
|
|
21
|
+
:class="sectionLabelClasses"
|
|
22
|
+
>
|
|
23
|
+
{{ section.label }}
|
|
24
|
+
</h2>
|
|
25
|
+
|
|
23
26
|
<div :class="[size == 'md' ? 'space-y-1' : 'space-y-0.5']">
|
|
24
27
|
<BaseNavbarSideItem
|
|
25
28
|
v-for="item in section.actions"
|
|
@@ -30,6 +33,13 @@
|
|
|
30
33
|
/>
|
|
31
34
|
</div>
|
|
32
35
|
</div>
|
|
36
|
+
|
|
37
|
+
<BaseNavbarSideItem
|
|
38
|
+
v-else
|
|
39
|
+
:item="section"
|
|
40
|
+
:dark="dark"
|
|
41
|
+
:size="size"
|
|
42
|
+
/>
|
|
33
43
|
</div>
|
|
34
44
|
</div>
|
|
35
45
|
</div>
|
|
@@ -92,7 +102,8 @@
|
|
|
92
102
|
<script setup lang="ts">
|
|
93
103
|
import { User } from '@/types/User';
|
|
94
104
|
import { PropType } from 'vue';
|
|
95
|
-
import {
|
|
105
|
+
import { NotificationsConfig } from '../types';
|
|
106
|
+
import { ActionItem } from '@/types/ActionItem';
|
|
96
107
|
import BaseAvatar from './BaseAvatar.vue';
|
|
97
108
|
import BaseLayoutNotificationDropdown from './BaseLayoutNotificationDropdown.vue';
|
|
98
109
|
import BaseLayoutSidebar from './BaseLayoutSidebar.vue';
|
|
@@ -112,7 +123,7 @@ const props = defineProps({
|
|
|
112
123
|
},
|
|
113
124
|
menu: {
|
|
114
125
|
required: true,
|
|
115
|
-
type: Array as PropType<ActionItem[]
|
|
126
|
+
type: Array as PropType<ActionItem[]>,
|
|
116
127
|
},
|
|
117
128
|
userMenu: {
|
|
118
129
|
required: true,
|
|
@@ -136,22 +147,7 @@ const props = defineProps({
|
|
|
136
147
|
},
|
|
137
148
|
});
|
|
138
149
|
|
|
139
|
-
const
|
|
140
|
-
const isActionSections = props.menu.length > 0 && 'actions' in props.menu[0];
|
|
141
|
-
|
|
142
|
-
if (isActionSections) {
|
|
143
|
-
return props.menu as ActionSection[];
|
|
144
|
-
}
|
|
145
|
-
|
|
146
|
-
return [
|
|
147
|
-
{
|
|
148
|
-
title: '',
|
|
149
|
-
actions: props.menu as ActionItem[],
|
|
150
|
-
},
|
|
151
|
-
];
|
|
152
|
-
});
|
|
153
|
-
|
|
154
|
-
const sectionTitleClasses = computed((): string[] => {
|
|
150
|
+
const sectionLabelClasses = computed((): string[] => {
|
|
155
151
|
const classList = ['mb-3 font-semibold uppercase tracking-widest'];
|
|
156
152
|
|
|
157
153
|
if (props.dark) {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
<template>
|
|
2
|
-
<div class="
|
|
2
|
+
<div :class="classInternal">
|
|
3
3
|
<BaseSystemAlert
|
|
4
4
|
v-for="systemAlert in systemAlerts"
|
|
5
5
|
:key="systemAlert.id"
|
|
@@ -12,13 +12,24 @@
|
|
|
12
12
|
{{ systemAlert.message }}
|
|
13
13
|
</BaseSystemAlert>
|
|
14
14
|
|
|
15
|
-
<BaseNavbar
|
|
16
|
-
|
|
17
|
-
|
|
15
|
+
<BaseNavbar
|
|
16
|
+
v-bind="navbar"
|
|
17
|
+
:dark="dark"
|
|
18
|
+
:size="size"
|
|
19
|
+
class="shadow"
|
|
20
|
+
>
|
|
21
|
+
<template #navbar="navbarProps">
|
|
22
|
+
<slot
|
|
23
|
+
name="navbar"
|
|
24
|
+
v-bind="navbarProps"
|
|
25
|
+
/>
|
|
18
26
|
</template>
|
|
19
27
|
|
|
20
|
-
<template #mobile>
|
|
21
|
-
<slot
|
|
28
|
+
<template #mobile="mobileProps">
|
|
29
|
+
<slot
|
|
30
|
+
name="mobile"
|
|
31
|
+
v-bind="mobileProps"
|
|
32
|
+
/>
|
|
22
33
|
</template>
|
|
23
34
|
</BaseNavbar>
|
|
24
35
|
</div>
|
|
@@ -29,17 +40,33 @@
|
|
|
29
40
|
</template>
|
|
30
41
|
|
|
31
42
|
<script lang="ts" setup>
|
|
43
|
+
import { twMerge } from 'tailwind-merge';
|
|
32
44
|
import { useSystemAlertStore } from '../stores/systemAlerts';
|
|
33
45
|
import BaseNavbar from './BaseNavbar.vue';
|
|
34
46
|
import BaseSystemAlert from './BaseSystemAlert.vue';
|
|
35
47
|
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
48
|
+
defineOptions({
|
|
49
|
+
inheritAttrs: false
|
|
50
|
+
});
|
|
51
|
+
|
|
52
|
+
const props = withDefaults(defineProps<{
|
|
53
|
+
class?: string | string[];
|
|
54
|
+
dark?: boolean;
|
|
55
|
+
navbar?: Record<string, unknown>;
|
|
56
|
+
size?: 'xs' | 'sm' | 'md';
|
|
57
|
+
}>(), {
|
|
58
|
+
class: '',
|
|
59
|
+
navbar: {} as any,
|
|
60
|
+
size: 'md',
|
|
41
61
|
});
|
|
42
62
|
|
|
63
|
+
const classInternal = computed(() => {
|
|
64
|
+
return twMerge(
|
|
65
|
+
'sticky top-0 z-20 w-full shadow-sm',
|
|
66
|
+
props.class,
|
|
67
|
+
)
|
|
68
|
+
})
|
|
69
|
+
|
|
43
70
|
/**
|
|
44
71
|
* System Alerts
|
|
45
72
|
*/
|
|
@@ -20,12 +20,37 @@ export default {
|
|
|
20
20
|
menu: [
|
|
21
21
|
{
|
|
22
22
|
label: 'Products',
|
|
23
|
-
to: '/',
|
|
24
23
|
count: 234,
|
|
24
|
+
actions: [
|
|
25
|
+
{
|
|
26
|
+
label: 'New product',
|
|
27
|
+
icon: 'heroicons:plus-20-solid',
|
|
28
|
+
description: 'Create a new product',
|
|
29
|
+
to: '/',
|
|
30
|
+
},
|
|
31
|
+
{
|
|
32
|
+
label: 'All products',
|
|
33
|
+
icon: 'heroicons:academic-cap-20-solid',
|
|
34
|
+
description: 'View all products',
|
|
35
|
+
to: '/',
|
|
36
|
+
},
|
|
37
|
+
],
|
|
25
38
|
},
|
|
26
39
|
{
|
|
27
40
|
label: 'Users',
|
|
28
41
|
to: '/setup',
|
|
42
|
+
actions: [
|
|
43
|
+
{
|
|
44
|
+
label: 'New product',
|
|
45
|
+
icon: 'heroicons:plus-20-solid',
|
|
46
|
+
to: '/',
|
|
47
|
+
},
|
|
48
|
+
{
|
|
49
|
+
label: 'All products',
|
|
50
|
+
icon: 'heroicons:academic-cap-20-solid',
|
|
51
|
+
to: '/',
|
|
52
|
+
},
|
|
53
|
+
],
|
|
29
54
|
},
|
|
30
55
|
{
|
|
31
56
|
label: 'Account',
|
|
@@ -44,6 +69,9 @@ export default {
|
|
|
44
69
|
to: '/account',
|
|
45
70
|
icon: 'heroicons:cog',
|
|
46
71
|
},
|
|
72
|
+
{
|
|
73
|
+
meta: { line: true }
|
|
74
|
+
},
|
|
47
75
|
{
|
|
48
76
|
label: 'Logout',
|
|
49
77
|
action: logout,
|
|
@@ -107,3 +135,24 @@ Dark.args = {
|
|
|
107
135
|
dark: true,
|
|
108
136
|
logoUrl: 'https://sprintify.witify.io/img/logo/logo-side-dark.svg',
|
|
109
137
|
};
|
|
138
|
+
|
|
139
|
+
export const SizeXS = Template.bind({});
|
|
140
|
+
SizeXS.args = {
|
|
141
|
+
size: 'xs',
|
|
142
|
+
dark: true,
|
|
143
|
+
logoUrl: 'https://sprintify.witify.io/img/logo/logo-side-dark.svg',
|
|
144
|
+
};
|
|
145
|
+
|
|
146
|
+
export const SizeSM = Template.bind({});
|
|
147
|
+
SizeSM.args = {
|
|
148
|
+
size: 'sm',
|
|
149
|
+
dark: true,
|
|
150
|
+
logoUrl: 'https://sprintify.witify.io/img/logo/logo-side-dark.svg',
|
|
151
|
+
};
|
|
152
|
+
|
|
153
|
+
export const SizeMD = Template.bind({});
|
|
154
|
+
SizeMD.args = {
|
|
155
|
+
size: 'md',
|
|
156
|
+
dark: true,
|
|
157
|
+
logoUrl: 'https://sprintify.witify.io/img/logo/logo-side-dark.svg',
|
|
158
|
+
};
|