@mapomodule/uikit 2.0.0-beta.1 → 2.0.0-beta.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/index.d.mts +3 -2
- package/dist/index.d.ts +3 -2
- package/dist/index.d.ts.map +1 -0
- package/dist/index.mjs +0 -17
- package/dist/module.d.mts +30 -2
- package/dist/module.d.ts +27 -2
- package/dist/module.d.ts.map +1 -0
- package/dist/module.json +1 -1
- package/dist/module.mjs +109 -13
- package/dist/runtime/assets/main.css +1 -0
- package/dist/runtime/components/MapoConfirmDialog.vue +33 -0
- package/dist/runtime/components/MapoConfirmDialog.vue.d.ts +4 -0
- package/dist/runtime/components/MapoConfirmDialog.vue.d.ts.map +1 -0
- package/dist/runtime/components/MapoDetail.vue +598 -0
- package/dist/runtime/components/MapoDetail.vue.d.ts +401 -0
- package/dist/runtime/components/MapoDetail.vue.d.ts.map +1 -0
- package/dist/runtime/components/MapoDetailLangSwitch.vue +126 -0
- package/dist/runtime/components/MapoDetailLangSwitch.vue.d.ts +23 -0
- package/dist/runtime/components/MapoDetailLangSwitch.vue.d.ts.map +1 -0
- package/dist/runtime/components/MapoList.vue +191 -0
- package/dist/runtime/components/MapoList.vue.d.ts +111 -0
- package/dist/runtime/components/MapoList.vue.d.ts.map +1 -0
- package/dist/runtime/components/MapoListActions.vue +112 -0
- package/dist/runtime/components/MapoListActions.vue.d.ts +33 -0
- package/dist/runtime/components/MapoListActions.vue.d.ts.map +1 -0
- package/dist/runtime/components/MapoListFilters.vue +244 -0
- package/dist/runtime/components/MapoListFilters.vue.d.ts +38 -0
- package/dist/runtime/components/MapoListFilters.vue.d.ts.map +1 -0
- package/dist/runtime/components/MapoListHead.vue +9 -0
- package/dist/runtime/components/MapoListHead.vue.d.ts +14 -0
- package/dist/runtime/components/MapoListHead.vue.d.ts.map +1 -0
- package/dist/runtime/components/MapoListQuickEdit.vue +119 -0
- package/dist/runtime/components/MapoListQuickEdit.vue.d.ts +47 -0
- package/dist/runtime/components/MapoListQuickEdit.vue.d.ts.map +1 -0
- package/dist/runtime/components/MapoListTable.vue +660 -0
- package/dist/runtime/components/MapoListTable.vue.d.ts +105 -0
- package/dist/runtime/components/MapoListTable.vue.d.ts.map +1 -0
- package/dist/runtime/components/MapoListTabs.vue +38 -0
- package/dist/runtime/components/MapoListTabs.vue.d.ts +26 -0
- package/dist/runtime/components/MapoListTabs.vue.d.ts.map +1 -0
- package/dist/runtime/components/MapoLogin.vue +193 -0
- package/dist/runtime/components/MapoLogin.vue.d.ts +22 -0
- package/dist/runtime/components/MapoLogin.vue.d.ts.map +1 -0
- package/dist/runtime/components/MapoLogoutButton.vue +25 -0
- package/dist/runtime/components/MapoLogoutButton.vue.d.ts +29 -0
- package/dist/runtime/components/MapoLogoutButton.vue.d.ts.map +1 -0
- package/dist/runtime/components/MapoRootComponents.vue +9 -0
- package/dist/runtime/components/MapoRootComponents.vue.d.ts +4 -0
- package/dist/runtime/components/MapoRootComponents.vue.d.ts.map +1 -0
- package/dist/runtime/components/MapoSidebar.vue +87 -0
- package/dist/runtime/components/MapoSidebar.vue.d.ts +22 -0
- package/dist/runtime/components/MapoSidebar.vue.d.ts.map +1 -0
- package/dist/runtime/components/MapoSidebarList.vue +27 -0
- package/dist/runtime/components/MapoSidebarList.vue.d.ts +8 -0
- package/dist/runtime/components/MapoSidebarList.vue.d.ts.map +1 -0
- package/dist/runtime/components/MapoSidebarListItem.vue +74 -0
- package/dist/runtime/components/MapoSidebarListItem.vue.d.ts +9 -0
- package/dist/runtime/components/MapoSidebarListItem.vue.d.ts.map +1 -0
- package/dist/runtime/components/MapoSidebarProfile.vue +51 -0
- package/dist/runtime/components/MapoSidebarProfile.vue.d.ts +10 -0
- package/dist/runtime/components/MapoSidebarProfile.vue.d.ts.map +1 -0
- package/dist/runtime/components/MapoSnackBar.vue +38 -0
- package/dist/runtime/components/MapoSnackBar.vue.d.ts +4 -0
- package/dist/runtime/components/MapoSnackBar.vue.d.ts.map +1 -0
- package/dist/runtime/components/MapoThemeToggle.vue +19 -0
- package/dist/runtime/components/MapoThemeToggle.vue.d.ts +4 -0
- package/dist/runtime/components/MapoThemeToggle.vue.d.ts.map +1 -0
- package/dist/runtime/components/MapoTopbar.vue +30 -0
- package/dist/runtime/components/MapoTopbar.vue.d.ts +15 -0
- package/dist/runtime/components/MapoTopbar.vue.d.ts.map +1 -0
- package/dist/runtime/layouts/default.vue +43 -0
- package/dist/runtime/layouts/default.vue.d.ts +20 -0
- package/dist/runtime/layouts/default.vue.d.ts.map +1 -0
- package/dist/runtime/layouts/empty.vue +9 -0
- package/dist/runtime/layouts/empty.vue.d.ts +14 -0
- package/dist/runtime/layouts/empty.vue.d.ts.map +1 -0
- package/dist/runtime/page-meta.nuxt.d.ts +45 -0
- package/dist/runtime/pages/index.vue +13 -0
- package/dist/runtime/pages/index.vue.d.ts +4 -0
- package/dist/runtime/pages/index.vue.d.ts.map +1 -0
- package/dist/runtime/pages/login.vue +7 -0
- package/dist/runtime/pages/login.vue.d.ts +4 -0
- package/dist/runtime/pages/login.vue.d.ts.map +1 -0
- package/dist/runtime/types/list.d.ts +59 -0
- package/dist/runtime/types/list.d.ts.map +1 -0
- package/dist/runtime/types/list.js +0 -0
- package/dist/types.d.mts +6 -10
- package/package.json +6 -6
- package/dist/index.d.cts +0 -2
- package/dist/module.d.cts +0 -2
|
@@ -0,0 +1,105 @@
|
|
|
1
|
+
import type { ListColumn } from "../types/list.js";
|
|
2
|
+
import type { AnyFieldDescriptor, FieldRegistry } from "@mapomodule/form/types";
|
|
3
|
+
declare const __VLS_export: <T extends object>(__VLS_props: NonNullable<Awaited<typeof __VLS_setup>>["props"], __VLS_ctx?: __VLS_PrettifyLocal<Pick<NonNullable<Awaited<typeof __VLS_setup>>, "attrs" | "emit" | "slots">>, __VLS_exposed?: NonNullable<Awaited<typeof __VLS_setup>>["expose"], __VLS_setup?: Promise<{
|
|
4
|
+
props: import("vue").PublicProps & __VLS_PrettifyLocal<{
|
|
5
|
+
endpoint?: string;
|
|
6
|
+
/**
|
|
7
|
+
* Offline mode: when provided, the table renders this array and applies
|
|
8
|
+
* search/filter/sort/pagination/drag/delete in memory — no API calls.
|
|
9
|
+
* Mutations (drag reorder, delete, quick-edit) emit `update:items` so the
|
|
10
|
+
* parent owns the source of truth.
|
|
11
|
+
*/
|
|
12
|
+
items?: T[];
|
|
13
|
+
/**
|
|
14
|
+
* Clean endpoint used for detail / delete / updateOrder CRUD operations.
|
|
15
|
+
* Defaults to `endpoint` with the query string stripped.
|
|
16
|
+
* Pass this explicitly when `endpoint` carries user-configured query params
|
|
17
|
+
* (e.g. `?fields=id,title`) that must not be included in mutation URLs.
|
|
18
|
+
*/
|
|
19
|
+
crudEndpoint?: string;
|
|
20
|
+
/**
|
|
21
|
+
* Extra query params merged into every `list()` call (on top of pagination /
|
|
22
|
+
* sort / search). Used by the parent `MapoList` to pass active filter values
|
|
23
|
+
* and tab params without baking them into the endpoint string.
|
|
24
|
+
*/
|
|
25
|
+
filterParams?: Record<string, unknown>;
|
|
26
|
+
/** Initial page size. Default: 20. */
|
|
27
|
+
defaultPageSize?: number;
|
|
28
|
+
/** Page size options shown in the per-page selector. Default: [10, 20, 50, 100]. */
|
|
29
|
+
pageSizeOptions?: number[];
|
|
30
|
+
/**
|
|
31
|
+
* Custom response parser. When provided it replaces the built-in DRF / flat-array
|
|
32
|
+
* detection. Return `{ items, total }` from any shape your backend returns.
|
|
33
|
+
* @example (raw) => ({ items: raw.data, total: raw.meta.total })
|
|
34
|
+
*/
|
|
35
|
+
responseAdapter?: (raw: unknown) => {
|
|
36
|
+
items: T[];
|
|
37
|
+
total: number;
|
|
38
|
+
};
|
|
39
|
+
/**
|
|
40
|
+
* Custom pagination query params factory. When provided it replaces the default
|
|
41
|
+
* `{ page, page_size }` params. Use this to support offset/limit or cursor pagination.
|
|
42
|
+
* @example ({ page, pageSize }) => ({ offset: (page - 1) * pageSize, limit: pageSize })
|
|
43
|
+
*/
|
|
44
|
+
paginationParams?: (state: {
|
|
45
|
+
page: number;
|
|
46
|
+
pageSize: number;
|
|
47
|
+
}) => Record<string, unknown>;
|
|
48
|
+
/**
|
|
49
|
+
* Hybrid mode: when true and `endpoint` is set, the table fetches the
|
|
50
|
+
* full dataset ONCE (no pagination/sort/filter params) and then runs
|
|
51
|
+
* search/filter/sort/pagination locally. Mutations (delete, drag, quick-edit)
|
|
52
|
+
* still hit the backend, then re-fetch. Ignored when `items` is provided.
|
|
53
|
+
*/
|
|
54
|
+
clientSide?: boolean;
|
|
55
|
+
columns: ListColumn<T>[];
|
|
56
|
+
lookup?: string;
|
|
57
|
+
searchable?: boolean;
|
|
58
|
+
draggable?: boolean;
|
|
59
|
+
positionField?: string;
|
|
60
|
+
editFields?: AnyFieldDescriptor<T>[];
|
|
61
|
+
languages?: string[];
|
|
62
|
+
registry?: FieldRegistry;
|
|
63
|
+
/** Base path for the detail page. If set, each row shows a link button → `${detailBase}/${item[lookup]}`. */
|
|
64
|
+
detailBase?: string;
|
|
65
|
+
/**
|
|
66
|
+
* Django model name for permission gating (e.g. `"article"`).
|
|
67
|
+
* When provided, the edit and delete row buttons are hidden when the user
|
|
68
|
+
* lacks the corresponding `change` / `delete` permission.
|
|
69
|
+
*/
|
|
70
|
+
permissionModel?: string;
|
|
71
|
+
} & {
|
|
72
|
+
"onUpdate:items"?: ((value: T[]) => any) | undefined;
|
|
73
|
+
"onUpdate:selection"?: ((value: "all" | T[]) => any) | undefined;
|
|
74
|
+
"onUpdate:selectionQuery"?: ((value: URLSearchParams) => any) | undefined;
|
|
75
|
+
}> & (typeof globalThis extends {
|
|
76
|
+
__VLS_PROPS_FALLBACK: infer P;
|
|
77
|
+
} ? P : {});
|
|
78
|
+
expose: (exposed: import("vue").ShallowUnwrapRef<{
|
|
79
|
+
refresh: () => Promise<void>;
|
|
80
|
+
}>) => void;
|
|
81
|
+
attrs: any;
|
|
82
|
+
slots: {
|
|
83
|
+
[K: string]: (...args: any[]) => any;
|
|
84
|
+
/** Extra content rendered alongside the search input in the toolbar. */
|
|
85
|
+
"dtable.toolbar"(): any;
|
|
86
|
+
/** Override for the empty state displayed when no rows are found. */
|
|
87
|
+
"dtable.empty"(): any;
|
|
88
|
+
/** Override for the loading skeleton displayed while data is being fetched. */
|
|
89
|
+
"dtable.loading"(): any;
|
|
90
|
+
} & { [K in keyof T as `cell.${K & string}`]: (props: {
|
|
91
|
+
item: T;
|
|
92
|
+
value: T[K];
|
|
93
|
+
}) => any; };
|
|
94
|
+
emit: ((evt: "update:items", value: T[]) => void) & ((evt: "update:selection", value: "all" | T[]) => void) & ((evt: "update:selectionQuery", value: URLSearchParams) => void);
|
|
95
|
+
}>) => import("vue").VNode & {
|
|
96
|
+
__ctx?: Awaited<typeof __VLS_setup>;
|
|
97
|
+
};
|
|
98
|
+
declare const _default: typeof __VLS_export;
|
|
99
|
+
export default _default;
|
|
100
|
+
type __VLS_PrettifyLocal<T> = (T extends any ? {
|
|
101
|
+
[K in keyof T]: T[K];
|
|
102
|
+
} : {
|
|
103
|
+
[K in keyof T as K]: T[K];
|
|
104
|
+
}) & {};
|
|
105
|
+
//# sourceMappingURL=MapoListTable.vue.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"MapoListTable.vue.d.ts","sourceRoot":"","sources":["../../../src/runtime/components/MapoListTable.vue"],"names":[],"mappings":"AA66BA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAC;AAKnD,OAAO,KAAK,EAAE,kBAAkB,EAAE,aAAa,EAAE,MAAM,wBAAwB,CAAC;AAIhF,QAAA,MAAM,YAAY,GAAK,CAAC,SAAS,MAAM,EACtC,aAAa,WAAW,CAAC,OAAO,CAAC,OAAO,WAAW,CAAC,CAAC,CAAC,OAAO,CAAC,EAC9D,YAAY,mBAAmB,CAAC,IAAI,CAAC,WAAW,CAAC,OAAO,CAAC,OAAO,WAAW,CAAC,CAAC,EAAE,OAAO,GAAG,MAAM,GAAG,OAAO,CAAC,CAAC,EAC3G,gBAAgB,WAAW,CAAC,OAAO,CAAC,OAAO,WAAW,CAAC,CAAC,CAAC,QAAQ,CAAC,EAClE;WA4nCO,OAAO,KAAK,EAAE,WAAW,GAAG,mBAAmB,CAAC;mBA1nCzC,MAAM;QACjB;;;;;WAKG;gBACK,CAAC,EAAE;QACX;;;;;WAKG;uBACY,MAAM;QACrB;;;;WAIG;uBACY,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC;QACtC,sCAAsC;0BACpB,MAAM;QACxB,oFAAoF;0BAClE,MAAM,EAAE;QAC1B;;;;WAIG;0BACe,CAAC,GAAG,EAAE,OAAO,KAAK;YAAE,KAAK,EAAE,CAAC,EAAE,CAAC;YAAC,KAAK,EAAE,MAAM,CAAA;SAAE;QACjE;;;;WAIG;2BACgB,CAAC,KAAK,EAAE;YACzB,IAAI,EAAE,MAAM,CAAC;YACb,QAAQ,EAAE,MAAM,CAAC;SAClB,KAAK,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC;QAC7B;;;;;WAKG;qBACU,OAAO;iBACX,UAAU,CAAC,CAAC,CAAC,EAAE;iBACf,MAAM;qBACF,OAAO;oBACR,OAAO;wBACH,MAAM;qBACT,kBAAkB,CAAC,CAAC,CAAC,EAAE;oBACxB,MAAM,EAAE;mBACT,aAAa;QACxB,6GAA6G;qBAChG,MAAM;QACnB;;;;WAIG;0BACe,MAAM;;;;;KA4jC+D,CAAC,GAAG,CAAC,OAAO,UAAU,SAAS;QAAE,oBAAoB,EAAE,MAAM,CAAC,CAAA;KAAE,GAAG,CAAC,GAAG,EAAE,CAAC;YAC5J,CAAC,OAAO,EAAE,OAAO,KAAK,EAAE,gBAAgB;;MAAsB,KAAK,IAAI;WACxE,GAAG;;+BAvhCgB,GAAG,EAAE,KAAK,GAAG;QAPpC,wEAAwE;4BACpD,GAAG;QACvB,qEAAqE;0BACnD,GAAG;QACrB,+EAA+E;4BAC3D,GAAG;WAOtB,CAAC,8CAA8C;QAC9C,IAAI,EAAE,CAAC,CAAC;QACR,KAAK,EAAE,CAAC,CAAC,CAAC,CAAC,CAAC;KACb,KAAK,GAAG;;EAmhCT,KACQ,OAAO,KAAK,EAAE,KAAK,GAAG;IAAE,KAAK,CAAC,EAAE,OAAO,CAAC,OAAO,WAAW,CAAC,CAAA;CAAI,CAAC;wBACvD,OAAO,YAAY;AAAxC,wBAAyC;AACzC,KAAK,mBAAmB,CAAC,CAAC,IAAI,CAAC,CAAC,SAAS,GAAG,GAAG;KAAG,CAAC,IAAI,MAAM,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC;CAAG,GAAG;KAAG,CAAC,IAAI,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC;CAAG,CAAC,GAAG,EAAE,CAAC"}
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
<script setup>
|
|
2
|
+
import { computed } from "vue";
|
|
3
|
+
const props = defineProps({
|
|
4
|
+
tabs: { type: Array, required: true },
|
|
5
|
+
modelValue: { type: String, required: false }
|
|
6
|
+
});
|
|
7
|
+
const emit = defineEmits(["update:modelValue"]);
|
|
8
|
+
const active = computed(() => props.modelValue ?? props.tabs[0]?.value ?? "");
|
|
9
|
+
defineSlots();
|
|
10
|
+
</script>
|
|
11
|
+
|
|
12
|
+
<template>
|
|
13
|
+
<div
|
|
14
|
+
v-if="tabs.length"
|
|
15
|
+
class="mapo-list-tabs flex gap-4 border-b border-default mb-4"
|
|
16
|
+
>
|
|
17
|
+
<button
|
|
18
|
+
v-for="tab in tabs"
|
|
19
|
+
:key="tab.value"
|
|
20
|
+
class="pb-2 text-sm font-medium transition-colors relative"
|
|
21
|
+
:class="
|
|
22
|
+
active === tab.value ? 'text-primary border-b-2 border-primary -mb-px' : 'text-muted hover:text-default'
|
|
23
|
+
"
|
|
24
|
+
@click="emit('update:modelValue', tab.value)"
|
|
25
|
+
>
|
|
26
|
+
<slot name="tab" :tab="tab" :active="active === tab.value">
|
|
27
|
+
{{ tab.text }}
|
|
28
|
+
<UBadge
|
|
29
|
+
v-if="tab.count !== void 0"
|
|
30
|
+
:label="String(tab.count)"
|
|
31
|
+
size="xs"
|
|
32
|
+
variant="soft"
|
|
33
|
+
class="ml-1"
|
|
34
|
+
/>
|
|
35
|
+
</slot>
|
|
36
|
+
</button>
|
|
37
|
+
</div>
|
|
38
|
+
</template>
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import type { ListTabItem } from "../types/list.js";
|
|
2
|
+
type __VLS_Props = {
|
|
3
|
+
tabs: ListTabItem[];
|
|
4
|
+
modelValue?: string;
|
|
5
|
+
};
|
|
6
|
+
type __VLS_Slots = {
|
|
7
|
+
/** Override for a single tab button. Receives `{ tab: ListTabItem, active: boolean }`. */
|
|
8
|
+
tab(props: {
|
|
9
|
+
tab: ListTabItem;
|
|
10
|
+
active: boolean;
|
|
11
|
+
}): any;
|
|
12
|
+
};
|
|
13
|
+
declare const __VLS_base: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
14
|
+
"update:modelValue": (value: string) => any;
|
|
15
|
+
}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{
|
|
16
|
+
"onUpdate:modelValue"?: ((value: string) => any) | undefined;
|
|
17
|
+
}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
18
|
+
declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
|
|
19
|
+
declare const _default: typeof __VLS_export;
|
|
20
|
+
export default _default;
|
|
21
|
+
type __VLS_WithSlots<T, S> = T & {
|
|
22
|
+
new (): {
|
|
23
|
+
$slots: S;
|
|
24
|
+
};
|
|
25
|
+
};
|
|
26
|
+
//# sourceMappingURL=MapoListTabs.vue.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"MapoListTabs.vue.d.ts","sourceRoot":"","sources":["../../../src/runtime/components/MapoListTabs.vue"],"names":[],"mappings":"AAoDA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAC;AAEpD,KAAK,WAAW,GAAG;IACjB,IAAI,EAAE,WAAW,EAAE,CAAC;IACpB,UAAU,CAAC,EAAE,MAAM,CAAC;CACrB,CAAC;AAQF,KAAK,WAAW,GAAG;IACjB,0FAA0F;IAC1F,GAAG,CAAC,KAAK,EAAE;QAAE,GAAG,EAAE,WAAW,CAAC;QAAC,MAAM,EAAE,OAAO,CAAA;KAAE,GAAG,GAAG,CAAC;CACxD,CAAC;AAsFF,QAAA,MAAM,UAAU;;;;kFAGd,CAAC;AACH,QAAA,MAAM,YAAY,EAAS,eAAe,CAAC,OAAO,UAAU,EAAE,WAAW,CAAC,CAAC;wBACtD,OAAO,YAAY;AAAxC,wBAAyC;AACzC,KAAK,eAAe,CAAC,CAAC,EAAE,CAAC,IAAI,CAAC,GAAG;IAChC,QAAO;QACN,MAAM,EAAE,CAAC,CAAC;KACV,CAAA;CACD,CAAC"}
|
|
@@ -0,0 +1,193 @@
|
|
|
1
|
+
<script setup>
|
|
2
|
+
import { reactive, ref } from "vue";
|
|
3
|
+
import { useMapoAuth } from "@mapomodule/core/runtime/auth/useMapoAuth";
|
|
4
|
+
import { useRoute } from "vue-router";
|
|
5
|
+
import { navigateTo } from "#app";
|
|
6
|
+
defineSlots();
|
|
7
|
+
const { login } = useMapoAuth();
|
|
8
|
+
const route = useRoute();
|
|
9
|
+
const form = reactive({ username: "", password: "" });
|
|
10
|
+
const error = ref(null);
|
|
11
|
+
const fieldErrors = reactive({});
|
|
12
|
+
const loading = ref(false);
|
|
13
|
+
async function submit() {
|
|
14
|
+
error.value = null;
|
|
15
|
+
fieldErrors.username = void 0;
|
|
16
|
+
fieldErrors.password = void 0;
|
|
17
|
+
loading.value = true;
|
|
18
|
+
try {
|
|
19
|
+
await login(form);
|
|
20
|
+
const redirect = route.query.redirect ?? "/";
|
|
21
|
+
await navigateTo(redirect);
|
|
22
|
+
} catch (e) {
|
|
23
|
+
const data = e?.data;
|
|
24
|
+
if (data?.username || data?.password) {
|
|
25
|
+
if (data.username?.length) fieldErrors.username = data.username[0];
|
|
26
|
+
if (data.password?.length) fieldErrors.password = data.password[0];
|
|
27
|
+
} else {
|
|
28
|
+
error.value = "Invalid credentials. Please try again.";
|
|
29
|
+
}
|
|
30
|
+
} finally {
|
|
31
|
+
loading.value = false;
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
</script>
|
|
35
|
+
|
|
36
|
+
<template>
|
|
37
|
+
<div class="flex h-full min-h-screen bg-default">
|
|
38
|
+
<!-- Left decorative panel (lg+) -->
|
|
39
|
+
<div
|
|
40
|
+
class="hidden lg:flex lg:w-1/2 relative flex-col items-center justify-center overflow-hidden bg-primary"
|
|
41
|
+
>
|
|
42
|
+
<div class="absolute inset-0 pointer-events-none overflow-hidden">
|
|
43
|
+
<div
|
|
44
|
+
class="absolute -top-40 -left-40 size-96 rounded-full bg-white/10 blur-3xl"
|
|
45
|
+
/>
|
|
46
|
+
<div
|
|
47
|
+
class="absolute -bottom-32 -right-32 size-80 rounded-full bg-black/15 blur-3xl"
|
|
48
|
+
/>
|
|
49
|
+
<div
|
|
50
|
+
class="absolute top-1/2 left-1/2 -translate-x-1/2 -translate-y-1/2 size-72 rounded-full bg-white/5 blur-2xl"
|
|
51
|
+
/>
|
|
52
|
+
</div>
|
|
53
|
+
|
|
54
|
+
<slot name="panel">
|
|
55
|
+
<div
|
|
56
|
+
class="relative z-10 flex flex-col items-center gap-6 px-12 text-center text-white"
|
|
57
|
+
>
|
|
58
|
+
<div
|
|
59
|
+
class="size-20 rounded-3xl bg-white/20 backdrop-blur-sm ring-1 ring-white/30 flex items-center justify-center"
|
|
60
|
+
>
|
|
61
|
+
<UIcon name="i-lucide-layers" class="size-10 text-white" />
|
|
62
|
+
</div>
|
|
63
|
+
<div class="space-y-2">
|
|
64
|
+
<h2 class="text-3xl font-bold tracking-tight">Welcome to Mapo</h2>
|
|
65
|
+
<p class="text-white/70 text-sm leading-relaxed max-w-xs">
|
|
66
|
+
A modern admin framework built on Nuxt 4, Pinia, and Nuxt UI v4.
|
|
67
|
+
</p>
|
|
68
|
+
</div>
|
|
69
|
+
<div class="flex gap-2 flex-wrap justify-center">
|
|
70
|
+
<span
|
|
71
|
+
v-for="tag in [
|
|
72
|
+
'Nuxt 4',
|
|
73
|
+
'Pinia',
|
|
74
|
+
'Nuxt UI v4',
|
|
75
|
+
'Tailwind v4',
|
|
76
|
+
'TypeScript'
|
|
77
|
+
]"
|
|
78
|
+
:key="tag"
|
|
79
|
+
class="px-3 py-1 rounded-full bg-white/10 text-xs font-medium text-white/80 ring-1 ring-white/20"
|
|
80
|
+
>{{ tag }}</span
|
|
81
|
+
>
|
|
82
|
+
</div>
|
|
83
|
+
</div>
|
|
84
|
+
</slot>
|
|
85
|
+
</div>
|
|
86
|
+
|
|
87
|
+
<!-- Right: login form -->
|
|
88
|
+
<div
|
|
89
|
+
class="flex flex-1 flex-col items-center justify-center px-6 py-12 relative"
|
|
90
|
+
>
|
|
91
|
+
<div
|
|
92
|
+
class="pointer-events-none absolute inset-0 overflow-hidden lg:hidden"
|
|
93
|
+
>
|
|
94
|
+
<div
|
|
95
|
+
class="absolute -top-32 -right-32 size-96 rounded-full bg-primary/6 blur-3xl"
|
|
96
|
+
/>
|
|
97
|
+
<div
|
|
98
|
+
class="absolute -bottom-32 -left-32 size-80 rounded-full bg-primary/4 blur-3xl"
|
|
99
|
+
/>
|
|
100
|
+
</div>
|
|
101
|
+
|
|
102
|
+
<div class="relative z-10 w-full max-w-sm space-y-8">
|
|
103
|
+
<slot name="brand">
|
|
104
|
+
<div class="flex flex-col items-center gap-3 text-center">
|
|
105
|
+
<div
|
|
106
|
+
class="lg:hidden size-12 rounded-2xl bg-primary/10 ring-1 ring-primary/20 flex items-center justify-center"
|
|
107
|
+
>
|
|
108
|
+
<UIcon name="i-lucide-layers" class="size-6 text-primary" />
|
|
109
|
+
</div>
|
|
110
|
+
<div>
|
|
111
|
+
<h1 class="text-2xl font-bold text-highlighted tracking-tight">
|
|
112
|
+
Sign in
|
|
113
|
+
</h1>
|
|
114
|
+
<p class="text-sm text-muted mt-1">
|
|
115
|
+
Enter your credentials to continue
|
|
116
|
+
</p>
|
|
117
|
+
</div>
|
|
118
|
+
</div>
|
|
119
|
+
</slot>
|
|
120
|
+
|
|
121
|
+
<slot name="before-form" />
|
|
122
|
+
|
|
123
|
+
<UCard class="shadow-xl ring-1 ring-default/60">
|
|
124
|
+
<form class="space-y-5" @submit.prevent="submit">
|
|
125
|
+
<UFormField
|
|
126
|
+
label="Username"
|
|
127
|
+
name="username"
|
|
128
|
+
:error="fieldErrors.username"
|
|
129
|
+
>
|
|
130
|
+
<UInput
|
|
131
|
+
v-model="form.username"
|
|
132
|
+
placeholder="username"
|
|
133
|
+
autocomplete="username"
|
|
134
|
+
:disabled="loading"
|
|
135
|
+
:color="fieldErrors.username ? 'error' : void 0"
|
|
136
|
+
leading-icon="i-lucide-user"
|
|
137
|
+
size="lg"
|
|
138
|
+
class="w-full"
|
|
139
|
+
/>
|
|
140
|
+
</UFormField>
|
|
141
|
+
|
|
142
|
+
<UFormField
|
|
143
|
+
label="Password"
|
|
144
|
+
name="password"
|
|
145
|
+
:error="fieldErrors.password"
|
|
146
|
+
>
|
|
147
|
+
<UInput
|
|
148
|
+
v-model="form.password"
|
|
149
|
+
type="password"
|
|
150
|
+
placeholder="••••••••"
|
|
151
|
+
autocomplete="current-password"
|
|
152
|
+
:disabled="loading"
|
|
153
|
+
:color="fieldErrors.password ? 'error' : void 0"
|
|
154
|
+
leading-icon="i-lucide-lock"
|
|
155
|
+
size="lg"
|
|
156
|
+
class="w-full"
|
|
157
|
+
/>
|
|
158
|
+
</UFormField>
|
|
159
|
+
|
|
160
|
+
<Transition
|
|
161
|
+
enter-active-class="transition duration-200 ease-out"
|
|
162
|
+
enter-from-class="opacity-0 -translate-y-1"
|
|
163
|
+
leave-active-class="transition duration-150 ease-in"
|
|
164
|
+
leave-to-class="opacity-0 -translate-y-1"
|
|
165
|
+
>
|
|
166
|
+
<UAlert
|
|
167
|
+
v-if="error"
|
|
168
|
+
color="error"
|
|
169
|
+
variant="subtle"
|
|
170
|
+
:description="error"
|
|
171
|
+
icon="i-lucide-alert-circle"
|
|
172
|
+
/>
|
|
173
|
+
</Transition>
|
|
174
|
+
|
|
175
|
+
<UButton
|
|
176
|
+
type="submit"
|
|
177
|
+
size="lg"
|
|
178
|
+
:loading="loading"
|
|
179
|
+
:disabled="!form.username || !form.password"
|
|
180
|
+
block
|
|
181
|
+
>
|
|
182
|
+
Sign in
|
|
183
|
+
</UButton>
|
|
184
|
+
</form>
|
|
185
|
+
</UCard>
|
|
186
|
+
|
|
187
|
+
<slot name="after-form" />
|
|
188
|
+
|
|
189
|
+
<slot name="footer" />
|
|
190
|
+
</div>
|
|
191
|
+
</div>
|
|
192
|
+
</div>
|
|
193
|
+
</template>
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
type __VLS_Slots = {
|
|
2
|
+
/** Left decorative panel (shown lg+). Replace with your own branding. */
|
|
3
|
+
panel(): unknown;
|
|
4
|
+
/** Logo / title area above the login form. */
|
|
5
|
+
brand(): unknown;
|
|
6
|
+
/** Content injected between the brand slot and the login form card. */
|
|
7
|
+
"before-form"(): unknown;
|
|
8
|
+
/** Content injected between the login form card and the footer slot. */
|
|
9
|
+
"after-form"(): unknown;
|
|
10
|
+
/** Content below the login card (links, copyright…). */
|
|
11
|
+
footer(): unknown;
|
|
12
|
+
};
|
|
13
|
+
declare const __VLS_base: import("vue").DefineComponent<{}, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<{}> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
|
|
14
|
+
declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
|
|
15
|
+
declare const _default: typeof __VLS_export;
|
|
16
|
+
export default _default;
|
|
17
|
+
type __VLS_WithSlots<T, S> = T & {
|
|
18
|
+
new (): {
|
|
19
|
+
$slots: S;
|
|
20
|
+
};
|
|
21
|
+
};
|
|
22
|
+
//# sourceMappingURL=MapoLogin.vue.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"MapoLogin.vue.d.ts","sourceRoot":"","sources":["../../../src/runtime/components/MapoLogin.vue"],"names":[],"mappings":"AAyNA,KAAK,WAAW,GAAG;IACjB,yEAAyE;IACzE,KAAK,IAAI,OAAO,CAAC;IACjB,8CAA8C;IAC9C,KAAK,IAAI,OAAO,CAAC;IACjB,uEAAuE;IACvE,aAAa,IAAI,OAAO,CAAC;IACzB,wEAAwE;IACxE,YAAY,IAAI,OAAO,CAAC;IACxB,wDAAwD;IACxD,MAAM,IAAI,OAAO,CAAC;CACnB,CAAC;AA0dF,QAAA,MAAM,UAAU,+QACd,CAAC;AACH,QAAA,MAAM,YAAY,EAAS,eAAe,CAAC,OAAO,UAAU,EAAE,WAAW,CAAC,CAAC;wBACtD,OAAO,YAAY;AAAxC,wBAAyC;AACzC,KAAK,eAAe,CAAC,CAAC,EAAE,CAAC,IAAI,CAAC,GAAG;IAChC,QAAO;QACN,MAAM,EAAE,CAAC,CAAC;KACV,CAAA;CACD,CAAC"}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
<script setup>
|
|
2
|
+
import { useMapoAuth } from "@mapomodule/core/runtime/auth/useMapoAuth";
|
|
3
|
+
defineProps({
|
|
4
|
+
variant: { type: String, required: false, default: "ghost" },
|
|
5
|
+
color: { type: String, required: false, default: "neutral" },
|
|
6
|
+
size: { type: String, required: false, default: "sm" },
|
|
7
|
+
iconOnly: { type: Boolean, required: false, default: false }
|
|
8
|
+
});
|
|
9
|
+
const { logout } = useMapoAuth();
|
|
10
|
+
</script>
|
|
11
|
+
|
|
12
|
+
<template>
|
|
13
|
+
<UButton
|
|
14
|
+
:variant="variant"
|
|
15
|
+
:color="color"
|
|
16
|
+
:size="size"
|
|
17
|
+
icon="i-lucide-log-out"
|
|
18
|
+
:aria-label="iconOnly ? 'Logout' : void 0"
|
|
19
|
+
@click="logout()"
|
|
20
|
+
>
|
|
21
|
+
<span v-if="!iconOnly">
|
|
22
|
+
<slot>Logout</slot>
|
|
23
|
+
</span>
|
|
24
|
+
</UButton>
|
|
25
|
+
</template>
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
type __VLS_Props = {
|
|
2
|
+
/** Nuxt UI UButton `variant` prop. */
|
|
3
|
+
variant?: "solid" | "outline" | "soft" | "ghost" | "link";
|
|
4
|
+
/** Nuxt UI UButton `color` prop. */
|
|
5
|
+
color?: "primary" | "secondary" | "neutral" | "info" | "success" | "warning" | "error";
|
|
6
|
+
/** Nuxt UI UButton `size` prop. */
|
|
7
|
+
size?: "xs" | "sm" | "md" | "lg" | "xl";
|
|
8
|
+
/** Show only the icon (no label). */
|
|
9
|
+
iconOnly?: boolean;
|
|
10
|
+
};
|
|
11
|
+
declare var __VLS_10: {};
|
|
12
|
+
type __VLS_Slots = {} & {
|
|
13
|
+
default?: (props: typeof __VLS_10) => any;
|
|
14
|
+
};
|
|
15
|
+
declare const __VLS_base: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {
|
|
16
|
+
size: "xs" | "sm" | "md" | "lg" | "xl";
|
|
17
|
+
color: "primary" | "secondary" | "neutral" | "info" | "success" | "warning" | "error";
|
|
18
|
+
variant: "solid" | "outline" | "soft" | "ghost" | "link";
|
|
19
|
+
iconOnly: boolean;
|
|
20
|
+
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
21
|
+
declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
|
|
22
|
+
declare const _default: typeof __VLS_export;
|
|
23
|
+
export default _default;
|
|
24
|
+
type __VLS_WithSlots<T, S> = T & {
|
|
25
|
+
new (): {
|
|
26
|
+
$slots: S;
|
|
27
|
+
};
|
|
28
|
+
};
|
|
29
|
+
//# sourceMappingURL=MapoLogoutButton.vue.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"MapoLogoutButton.vue.d.ts","sourceRoot":"","sources":["../../../src/runtime/components/MapoLogoutButton.vue"],"names":[],"mappings":"AAmDA,KAAK,WAAW,GAAG;IACf,sCAAsC;IACtC,OAAO,CAAC,EAAE,OAAO,GAAG,SAAS,GAAG,MAAM,GAAG,OAAO,GAAG,MAAM,CAAC;IAC1D,oCAAoC;IACpC,KAAK,CAAC,EACF,SAAS,GACT,WAAW,GACX,SAAS,GACT,MAAM,GACN,SAAS,GACT,SAAS,GACT,OAAO,CAAC;IACZ,mCAAmC;IACnC,IAAI,CAAC,EAAE,IAAI,GAAG,IAAI,GAAG,IAAI,GAAG,IAAI,GAAG,IAAI,CAAC;IACxC,qCAAqC;IACrC,QAAQ,CAAC,EAAE,OAAO,CAAC;CACpB,CAAC;AA8EJ,QAAA,IAAI,QAAQ,IAAW,CAAE;AACzB,KAAK,WAAW,GAAG,EAAE,GACnB;IAAE,OAAO,CAAC,EAAE,CAAC,KAAK,EAAE,OAAO,QAAQ,KAAK,GAAG,CAAA;CAAE,CAAC;AAKhD,QAAA,MAAM,UAAU;UAxFL,IAAI,GAAG,IAAI,GAAG,IAAI,GAAG,IAAI,GAAG,IAAI;WARnC,SAAS,GACT,WAAW,GACX,SAAS,GACT,MAAM,GACN,SAAS,GACT,SAAS,GACT,OAAO;aATD,OAAO,GAAG,SAAS,GAAG,MAAM,GAAG,OAAO,GAAG,MAAM;cAa9C,OAAO;6EAyFpB,CAAC;AACH,QAAA,MAAM,YAAY,EAAS,eAAe,CAAC,OAAO,UAAU,EAAE,WAAW,CAAC,CAAC;wBACtD,OAAO,YAAY;AAAxC,wBAAyC;AAWzC,KAAK,eAAe,CAAC,CAAC,EAAE,CAAC,IAAI,CAAC,GAAG;IAChC,QAAO;QACN,MAAM,EAAE,CAAC,CAAC;KACV,CAAA;CACD,CAAC"}
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
declare const __VLS_export: import("vue").DefineComponent<{}, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<{}> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
|
|
2
|
+
declare const _default: typeof __VLS_export;
|
|
3
|
+
export default _default;
|
|
4
|
+
//# sourceMappingURL=MapoRootComponents.vue.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"MapoRootComponents.vue.d.ts","sourceRoot":"","sources":["../../../src/runtime/components/MapoRootComponents.vue"],"names":[],"mappings":"AA8CA,QAAA,MAAM,YAAY,+QAChB,CAAC;wBACkB,OAAO,YAAY;AAAxC,wBAAyC"}
|
|
@@ -0,0 +1,87 @@
|
|
|
1
|
+
<script setup>
|
|
2
|
+
import { computed } from "vue";
|
|
3
|
+
import { useSidebarStore } from "@mapomodule/store/runtime/stores/sidebar";
|
|
4
|
+
defineSlots();
|
|
5
|
+
const sidebar = useSidebarStore();
|
|
6
|
+
const sidebarWidth = computed(() => sidebar.mini ? "w-[60px]" : "w-60");
|
|
7
|
+
</script>
|
|
8
|
+
|
|
9
|
+
<template>
|
|
10
|
+
<Transition name="sidebar">
|
|
11
|
+
<aside
|
|
12
|
+
v-if="sidebar.drawer"
|
|
13
|
+
class="relative flex flex-col h-full shrink-0 bg-elevated transition-[width] duration-200 overflow-hidden"
|
|
14
|
+
:class="sidebarWidth"
|
|
15
|
+
style="box-shadow: 1px 0 0 0 var(--ui-border)"
|
|
16
|
+
>
|
|
17
|
+
<!-- Logo header — same height as topbar so they sit flush -->
|
|
18
|
+
<div
|
|
19
|
+
class="flex h-14 shrink-0 items-center p-3 pt-1"
|
|
20
|
+
:class="sidebar.mini ? 'justify-center' : 'justify-between gap-2'"
|
|
21
|
+
>
|
|
22
|
+
<template v-if="sidebar.mini">
|
|
23
|
+
<UTooltip text="Expand" :side="'right'">
|
|
24
|
+
<UButton
|
|
25
|
+
variant="ghost"
|
|
26
|
+
color="neutral"
|
|
27
|
+
icon="i-lucide-panel-left-open"
|
|
28
|
+
size="sm"
|
|
29
|
+
@click="sidebar.toggleMini()"
|
|
30
|
+
/>
|
|
31
|
+
</UTooltip>
|
|
32
|
+
</template>
|
|
33
|
+
<template v-else>
|
|
34
|
+
<slot name="logo">
|
|
35
|
+
<NuxtLink to="/" class="flex items-center gap-2.5 min-w-0">
|
|
36
|
+
<div
|
|
37
|
+
class="size-7 rounded-lg bg-primary flex items-center justify-center shrink-0"
|
|
38
|
+
>
|
|
39
|
+
<UIcon name="i-lucide-layers" class="size-4 text-white" />
|
|
40
|
+
</div>
|
|
41
|
+
<span class="font-semibold text-sm text-highlighted truncate"
|
|
42
|
+
>Mapo</span
|
|
43
|
+
>
|
|
44
|
+
</NuxtLink>
|
|
45
|
+
</slot>
|
|
46
|
+
<UButton
|
|
47
|
+
variant="ghost"
|
|
48
|
+
color="neutral"
|
|
49
|
+
icon="i-lucide-panel-left-close"
|
|
50
|
+
size="sm"
|
|
51
|
+
class="shrink-0"
|
|
52
|
+
@click="sidebar.toggleMini()"
|
|
53
|
+
/>
|
|
54
|
+
</template>
|
|
55
|
+
</div>
|
|
56
|
+
|
|
57
|
+
<!-- Navigation -->
|
|
58
|
+
<div class="flex-1 overflow-y-auto py-2 px-2 space-y-4">
|
|
59
|
+
<slot name="nav-top" />
|
|
60
|
+
<MapoSidebarList :mini="sidebar.mini" />
|
|
61
|
+
<slot name="nav-bottom" />
|
|
62
|
+
</div>
|
|
63
|
+
|
|
64
|
+
<!-- Footer nav (sidebarFooter routes) -->
|
|
65
|
+
<div v-if="!sidebar.mini" class="px-2 pb-1">
|
|
66
|
+
<MapoSidebarList footer :mini="sidebar.mini" />
|
|
67
|
+
</div>
|
|
68
|
+
|
|
69
|
+
<!-- Extra footer content (above user row) -->
|
|
70
|
+
<slot name="footer-extra" />
|
|
71
|
+
|
|
72
|
+
<!-- User row -->
|
|
73
|
+
<div
|
|
74
|
+
class="shrink-0 px-2 pb-3 pt-1"
|
|
75
|
+
style="border-top: 1px solid var(--ui-border)"
|
|
76
|
+
>
|
|
77
|
+
<slot name="footer">
|
|
78
|
+
<MapoSidebarProfile :mini="sidebar.mini" />
|
|
79
|
+
</slot>
|
|
80
|
+
</div>
|
|
81
|
+
</aside>
|
|
82
|
+
</Transition>
|
|
83
|
+
</template>
|
|
84
|
+
|
|
85
|
+
<style scoped>
|
|
86
|
+
.sidebar-enter-active,.sidebar-leave-active{overflow:hidden;transition:width .2s ease,opacity .15s ease}.sidebar-enter-from,.sidebar-leave-to{opacity:0;width:0!important}
|
|
87
|
+
</style>
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
type __VLS_Slots = {
|
|
2
|
+
/** Logo / app name in the sidebar header. */
|
|
3
|
+
logo(): unknown;
|
|
4
|
+
/** Extra content above the main navigation list. */
|
|
5
|
+
"nav-top"(): unknown;
|
|
6
|
+
/** Extra content below the main navigation list. */
|
|
7
|
+
"nav-bottom"(): unknown;
|
|
8
|
+
/** Extra links or content between the footer nav and the user profile row. */
|
|
9
|
+
"footer-extra"(): unknown;
|
|
10
|
+
/** Replaces the user profile row at the very bottom of the sidebar. */
|
|
11
|
+
footer(): unknown;
|
|
12
|
+
};
|
|
13
|
+
declare const __VLS_base: import("vue").DefineComponent<{}, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<{}> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
|
|
14
|
+
declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
|
|
15
|
+
declare const _default: typeof __VLS_export;
|
|
16
|
+
export default _default;
|
|
17
|
+
type __VLS_WithSlots<T, S> = T & {
|
|
18
|
+
new (): {
|
|
19
|
+
$slots: S;
|
|
20
|
+
};
|
|
21
|
+
};
|
|
22
|
+
//# sourceMappingURL=MapoSidebar.vue.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"MapoSidebar.vue.d.ts","sourceRoot":"","sources":["../../../src/runtime/components/MapoSidebar.vue"],"names":[],"mappings":"AAsHA,KAAK,WAAW,GAAG;IACjB,6CAA6C;IAC7C,IAAI,IAAI,OAAO,CAAC;IAChB,oDAAoD;IACpD,SAAS,IAAI,OAAO,CAAC;IACrB,oDAAoD;IACpD,YAAY,IAAI,OAAO,CAAC;IACxB,8EAA8E;IAC9E,cAAc,IAAI,OAAO,CAAC;IAC1B,uEAAuE;IACvE,MAAM,IAAI,OAAO,CAAC;CACnB,CAAC;AAgRF,QAAA,MAAM,UAAU,+QACd,CAAC;AACH,QAAA,MAAM,YAAY,EAAS,eAAe,CAAC,OAAO,UAAU,EAAE,WAAW,CAAC,CAAC;wBACtD,OAAO,YAAY;AAAxC,wBAAyC;AACzC,KAAK,eAAe,CAAC,CAAC,EAAE,CAAC,IAAI,CAAC,GAAG;IAChC,QAAO;QACN,MAAM,EAAE,CAAC,CAAC;KACV,CAAA;CACD,CAAC"}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
<script setup>
|
|
2
|
+
import { computed } from "vue";
|
|
3
|
+
import { useRouter } from "vue-router";
|
|
4
|
+
import { buildRouteTree } from "@mapomodule/utils";
|
|
5
|
+
const { footer = false, mini = false } = defineProps({
|
|
6
|
+
footer: { type: Boolean, required: false },
|
|
7
|
+
mini: { type: Boolean, required: false }
|
|
8
|
+
});
|
|
9
|
+
const router = useRouter();
|
|
10
|
+
const nodes = computed(() => {
|
|
11
|
+
const tree = buildRouteTree(router.getRoutes());
|
|
12
|
+
return footer ? tree.filter((n) => n.sidebarFooter) : tree.filter((n) => !n.sidebarFooter);
|
|
13
|
+
});
|
|
14
|
+
</script>
|
|
15
|
+
|
|
16
|
+
<template>
|
|
17
|
+
<nav>
|
|
18
|
+
<ul class="space-y-0.5">
|
|
19
|
+
<MapoSidebarListItem
|
|
20
|
+
v-for="node in nodes"
|
|
21
|
+
:key="node.link"
|
|
22
|
+
:node="node"
|
|
23
|
+
:mini="mini"
|
|
24
|
+
/>
|
|
25
|
+
</ul>
|
|
26
|
+
</nav>
|
|
27
|
+
</template>
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
interface Props {
|
|
2
|
+
footer?: boolean;
|
|
3
|
+
mini?: boolean;
|
|
4
|
+
}
|
|
5
|
+
declare const __VLS_export: import("vue").DefineComponent<Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<Props> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
6
|
+
declare const _default: typeof __VLS_export;
|
|
7
|
+
export default _default;
|
|
8
|
+
//# sourceMappingURL=MapoSidebarList.vue.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"MapoSidebarList.vue.d.ts","sourceRoot":"","sources":["../../../src/runtime/components/MapoSidebarList.vue"],"names":[],"mappings":"AA2CA,UAAU,KAAK;IACb,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB,IAAI,CAAC,EAAE,OAAO,CAAC;CAChB;AA4DD,QAAA,MAAM,YAAY,sRAEhB,CAAC;wBACkB,OAAO,YAAY;AAAxC,wBAAyC"}
|