@mapomodule/uikit 2.0.0-beta.1 → 2.0.0-beta.10
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/README.md +33 -1
- package/dist/index.d.mts +5 -2
- package/dist/index.d.ts +6 -2
- package/dist/index.d.ts.map +1 -0
- package/dist/index.mjs +1 -18
- package/dist/module.d.mts +60 -2
- package/dist/module.d.ts +55 -2
- package/dist/module.d.ts.map +1 -0
- package/dist/module.json +1 -1
- package/dist/module.mjs +174 -13
- package/dist/runtime/adapters/defaultMediaAdapter.d.ts +14 -0
- package/dist/runtime/adapters/defaultMediaAdapter.d.ts.map +1 -0
- package/dist/runtime/adapters/defaultMediaAdapter.js +30 -0
- package/dist/runtime/assets/main.css +1 -0
- package/dist/runtime/components/MapoConfirmDialog.vue +35 -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 +606 -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/MapoDropArea.vue +99 -0
- package/dist/runtime/components/MapoDropArea.vue.d.ts +33 -0
- package/dist/runtime/components/MapoDropArea.vue.d.ts.map +1 -0
- package/dist/runtime/components/MapoLangSwitcher.vue +39 -0
- package/dist/runtime/components/MapoLangSwitcher.vue.d.ts +18 -0
- package/dist/runtime/components/MapoLangSwitcher.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 +119 -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 +246 -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 +123 -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 +665 -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 +196 -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 +27 -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/MapoMediaBreadcrumbs.vue +47 -0
- package/dist/runtime/components/MapoMediaBreadcrumbs.vue.d.ts +4 -0
- package/dist/runtime/components/MapoMediaBreadcrumbs.vue.d.ts.map +1 -0
- package/dist/runtime/components/MapoMediaEditor.vue +320 -0
- package/dist/runtime/components/MapoMediaEditor.vue.d.ts +8 -0
- package/dist/runtime/components/MapoMediaEditor.vue.d.ts.map +1 -0
- package/dist/runtime/components/MapoMediaFileChanger.vue +112 -0
- package/dist/runtime/components/MapoMediaFileChanger.vue.d.ts +15 -0
- package/dist/runtime/components/MapoMediaFileChanger.vue.d.ts.map +1 -0
- package/dist/runtime/components/MapoMediaFolders.vue +220 -0
- package/dist/runtime/components/MapoMediaFolders.vue.d.ts +4 -0
- package/dist/runtime/components/MapoMediaFolders.vue.d.ts.map +1 -0
- package/dist/runtime/components/MapoMediaGallery.vue +219 -0
- package/dist/runtime/components/MapoMediaGallery.vue.d.ts +4 -0
- package/dist/runtime/components/MapoMediaGallery.vue.d.ts.map +1 -0
- package/dist/runtime/components/MapoMediaManager.vue +140 -0
- package/dist/runtime/components/MapoMediaManager.vue.d.ts +35 -0
- package/dist/runtime/components/MapoMediaManager.vue.d.ts.map +1 -0
- package/dist/runtime/components/MapoMediaManagerDialog.vue +116 -0
- package/dist/runtime/components/MapoMediaManagerDialog.vue.d.ts +41 -0
- package/dist/runtime/components/MapoMediaManagerDialog.vue.d.ts.map +1 -0
- package/dist/runtime/components/MapoMediaPreview.vue +92 -0
- package/dist/runtime/components/MapoMediaPreview.vue.d.ts +19 -0
- package/dist/runtime/components/MapoMediaPreview.vue.d.ts.map +1 -0
- package/dist/runtime/components/MapoMediaUploader.vue +290 -0
- package/dist/runtime/components/MapoMediaUploader.vue.d.ts +8 -0
- package/dist/runtime/components/MapoMediaUploader.vue.d.ts.map +1 -0
- package/dist/runtime/components/MapoMenuManager.vue +273 -0
- package/dist/runtime/components/MapoMenuManager.vue.d.ts +92 -0
- package/dist/runtime/components/MapoMenuManager.vue.d.ts.map +1 -0
- package/dist/runtime/components/MapoMenuNodeEditor.vue +201 -0
- package/dist/runtime/components/MapoMenuNodeEditor.vue.d.ts +61 -0
- package/dist/runtime/components/MapoMenuNodeEditor.vue.d.ts.map +1 -0
- package/dist/runtime/components/MapoMenuTreeview.vue +181 -0
- package/dist/runtime/components/MapoMenuTreeview.vue.d.ts +57 -0
- package/dist/runtime/components/MapoMenuTreeview.vue.d.ts.map +1 -0
- package/dist/runtime/components/MapoMenuTreeviewNode.vue +175 -0
- package/dist/runtime/components/MapoMenuTreeviewNode.vue.d.ts +27 -0
- package/dist/runtime/components/MapoMenuTreeviewNode.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 +89 -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 +55 -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 +23 -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/components/menuDndContext.d.ts +19 -0
- package/dist/runtime/components/menuDndContext.d.ts.map +1 -0
- package/dist/runtime/components/menuDndContext.js +3 -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 +14 -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 +3 -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/plugins/media-adapter.d.ts +18 -0
- package/dist/runtime/plugins/media-adapter.d.ts.map +1 -0
- package/dist/runtime/plugins/media-adapter.js +8 -0
- package/dist/runtime/stores/media.d.ts +462 -0
- package/dist/runtime/stores/media.d.ts.map +1 -0
- package/dist/runtime/stores/media.js +344 -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/runtime/types/media.d.ts +116 -0
- package/dist/runtime/types/media.d.ts.map +1 -0
- package/dist/runtime/types/media.js +0 -0
- package/dist/runtime/types/menu.d.ts +66 -0
- package/dist/runtime/types/menu.d.ts.map +1 -0
- package/dist/runtime/types/menu.js +30 -0
- package/dist/types.d.mts +6 -10
- package/package.json +15 -11
- package/src/index.ts +20 -0
- package/src/module.ts +130 -0
- package/src/runtime/adapters/defaultMediaAdapter.ts +57 -0
- package/src/runtime/components/MapoConfirmDialog.vue +5 -3
- package/src/runtime/components/MapoDetail.vue +39 -36
- package/src/runtime/components/MapoDetailLangSwitch.vue +1 -1
- package/src/runtime/components/MapoDropArea.vue +127 -0
- package/src/runtime/components/MapoLangSwitcher.vue +74 -0
- package/src/runtime/components/MapoList.vue +1 -1
- package/src/runtime/components/MapoListActions.vue +16 -10
- package/src/runtime/components/MapoListFilters.vue +5 -2
- package/src/runtime/components/MapoListQuickEdit.vue +12 -9
- package/src/runtime/components/MapoListTable.vue +26 -21
- package/src/runtime/components/MapoLogin.vue +13 -10
- package/src/runtime/components/MapoLogoutButton.vue +4 -2
- package/src/runtime/components/MapoMediaBreadcrumbs.vue +53 -0
- package/src/runtime/components/MapoMediaEditor.vue +350 -0
- package/src/runtime/components/MapoMediaFileChanger.vue +136 -0
- package/src/runtime/components/MapoMediaFolders.vue +239 -0
- package/src/runtime/components/MapoMediaGallery.vue +239 -0
- package/src/runtime/components/MapoMediaManager.vue +180 -0
- package/src/runtime/components/MapoMediaManagerDialog.vue +148 -0
- package/src/runtime/components/MapoMediaPreview.vue +111 -0
- package/src/runtime/components/MapoMediaUploader.vue +351 -0
- package/src/runtime/components/MapoMenuManager.vue +402 -0
- package/src/runtime/components/MapoMenuNodeEditor.vue +282 -0
- package/src/runtime/components/MapoMenuTreeview.vue +264 -0
- package/src/runtime/components/MapoMenuTreeviewNode.vue +234 -0
- package/src/runtime/components/MapoSidebar.vue +3 -1
- package/src/runtime/components/MapoSidebarList.vue +1 -1
- package/src/runtime/components/MapoSidebarProfile.vue +6 -2
- package/src/runtime/components/MapoThemeToggle.vue +5 -1
- package/src/runtime/components/menuDndContext.ts +22 -0
- package/src/runtime/pages/index.vue +4 -3
- package/src/runtime/pages/login.vue +0 -4
- package/src/runtime/plugins/media-adapter.ts +33 -0
- package/src/runtime/stores/media.ts +474 -0
- package/src/runtime/types/media.ts +126 -0
- package/src/runtime/types/menu.ts +105 -0
- 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":"AAm7BA,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;WAqoCO,OAAO,KAAK,EAAE,WAAW,GAAG,mBAAmB,CAAC;mBAnoCzC,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;;;;;KAqkC+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;;+BAhiCgB,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;;EA4hCT,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,196 @@
|
|
|
1
|
+
<script setup>
|
|
2
|
+
import { reactive, ref } from "vue";
|
|
3
|
+
import { useI18n } from "vue-i18n";
|
|
4
|
+
import { useMapoAuth } from "@mapomodule/core/runtime/auth/useMapoAuth";
|
|
5
|
+
import { useRoute, navigateTo } from "#app";
|
|
6
|
+
defineSlots();
|
|
7
|
+
const { t } = useI18n();
|
|
8
|
+
const { login } = useMapoAuth();
|
|
9
|
+
const route = useRoute();
|
|
10
|
+
const form = reactive({ username: "", password: "" });
|
|
11
|
+
const error = ref(null);
|
|
12
|
+
const fieldErrors = reactive({});
|
|
13
|
+
const loading = ref(false);
|
|
14
|
+
async function submit() {
|
|
15
|
+
error.value = null;
|
|
16
|
+
fieldErrors.username = void 0;
|
|
17
|
+
fieldErrors.password = void 0;
|
|
18
|
+
loading.value = true;
|
|
19
|
+
try {
|
|
20
|
+
await login(form);
|
|
21
|
+
const redirect = route.query.redirect ?? "/";
|
|
22
|
+
await navigateTo(redirect);
|
|
23
|
+
} catch (e) {
|
|
24
|
+
const data = e?.data;
|
|
25
|
+
if (data?.username || data?.password) {
|
|
26
|
+
if (data.username?.length) fieldErrors.username = data.username[0];
|
|
27
|
+
if (data.password?.length) fieldErrors.password = data.password[0];
|
|
28
|
+
} else {
|
|
29
|
+
error.value = t("mapo.login.invalidCredentials");
|
|
30
|
+
}
|
|
31
|
+
} finally {
|
|
32
|
+
loading.value = false;
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
</script>
|
|
36
|
+
|
|
37
|
+
<template>
|
|
38
|
+
<div class="flex h-full min-h-screen bg-default">
|
|
39
|
+
<!-- Left decorative panel (lg+) -->
|
|
40
|
+
<div
|
|
41
|
+
class="hidden lg:flex lg:w-1/2 relative flex-col items-center justify-center overflow-hidden bg-primary"
|
|
42
|
+
>
|
|
43
|
+
<div class="absolute inset-0 pointer-events-none overflow-hidden">
|
|
44
|
+
<div
|
|
45
|
+
class="absolute -top-40 -left-40 size-96 rounded-full bg-white/10 blur-3xl"
|
|
46
|
+
/>
|
|
47
|
+
<div
|
|
48
|
+
class="absolute -bottom-32 -right-32 size-80 rounded-full bg-black/15 blur-3xl"
|
|
49
|
+
/>
|
|
50
|
+
<div
|
|
51
|
+
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"
|
|
52
|
+
/>
|
|
53
|
+
</div>
|
|
54
|
+
|
|
55
|
+
<slot name="panel">
|
|
56
|
+
<div
|
|
57
|
+
class="relative z-10 flex flex-col items-center gap-6 px-12 text-center text-white"
|
|
58
|
+
>
|
|
59
|
+
<div
|
|
60
|
+
class="size-20 rounded-3xl bg-white/20 backdrop-blur-sm ring-1 ring-white/30 flex items-center justify-center"
|
|
61
|
+
>
|
|
62
|
+
<UIcon name="i-lucide-layers" class="size-10 text-white" />
|
|
63
|
+
</div>
|
|
64
|
+
<div class="space-y-2">
|
|
65
|
+
<h2 class="text-3xl font-bold tracking-tight">
|
|
66
|
+
{{ t("mapo.login.welcome") }}
|
|
67
|
+
</h2>
|
|
68
|
+
<p class="text-white/70 text-sm leading-relaxed max-w-xs">
|
|
69
|
+
{{ t("mapo.login.tagline") }}
|
|
70
|
+
</p>
|
|
71
|
+
</div>
|
|
72
|
+
<div class="flex gap-2 flex-wrap justify-center">
|
|
73
|
+
<span
|
|
74
|
+
v-for="tag in [
|
|
75
|
+
'Nuxt 4',
|
|
76
|
+
'Pinia',
|
|
77
|
+
'Nuxt UI v4',
|
|
78
|
+
'Tailwind v4',
|
|
79
|
+
'TypeScript'
|
|
80
|
+
]"
|
|
81
|
+
:key="tag"
|
|
82
|
+
class="px-3 py-1 rounded-full bg-white/10 text-xs font-medium text-white/80 ring-1 ring-white/20"
|
|
83
|
+
>{{ tag }}</span
|
|
84
|
+
>
|
|
85
|
+
</div>
|
|
86
|
+
</div>
|
|
87
|
+
</slot>
|
|
88
|
+
</div>
|
|
89
|
+
|
|
90
|
+
<!-- Right: login form -->
|
|
91
|
+
<div
|
|
92
|
+
class="flex flex-1 flex-col items-center justify-center px-6 py-12 relative"
|
|
93
|
+
>
|
|
94
|
+
<div
|
|
95
|
+
class="pointer-events-none absolute inset-0 overflow-hidden lg:hidden"
|
|
96
|
+
>
|
|
97
|
+
<div
|
|
98
|
+
class="absolute -top-32 -right-32 size-96 rounded-full bg-primary/6 blur-3xl"
|
|
99
|
+
/>
|
|
100
|
+
<div
|
|
101
|
+
class="absolute -bottom-32 -left-32 size-80 rounded-full bg-primary/4 blur-3xl"
|
|
102
|
+
/>
|
|
103
|
+
</div>
|
|
104
|
+
|
|
105
|
+
<div class="relative z-10 w-full max-w-sm space-y-8">
|
|
106
|
+
<slot name="brand">
|
|
107
|
+
<div class="flex flex-col items-center gap-3 text-center">
|
|
108
|
+
<div
|
|
109
|
+
class="lg:hidden size-12 rounded-2xl bg-primary/10 ring-1 ring-primary/20 flex items-center justify-center"
|
|
110
|
+
>
|
|
111
|
+
<UIcon name="i-lucide-layers" class="size-6 text-primary" />
|
|
112
|
+
</div>
|
|
113
|
+
<div>
|
|
114
|
+
<h1 class="text-2xl font-bold text-highlighted tracking-tight">
|
|
115
|
+
{{ t("mapo.signIn") }}
|
|
116
|
+
</h1>
|
|
117
|
+
<p class="text-sm text-muted mt-1">
|
|
118
|
+
{{ t("mapo.login.subtitle") }}
|
|
119
|
+
</p>
|
|
120
|
+
</div>
|
|
121
|
+
</div>
|
|
122
|
+
</slot>
|
|
123
|
+
|
|
124
|
+
<slot name="before-form" />
|
|
125
|
+
|
|
126
|
+
<UCard class="shadow-xl ring-1 ring-default/60">
|
|
127
|
+
<form class="space-y-5" @submit.prevent="submit">
|
|
128
|
+
<UFormField
|
|
129
|
+
:label="t('mapo.username')"
|
|
130
|
+
name="username"
|
|
131
|
+
:error="fieldErrors.username"
|
|
132
|
+
>
|
|
133
|
+
<UInput
|
|
134
|
+
v-model="form.username"
|
|
135
|
+
placeholder="username"
|
|
136
|
+
autocomplete="username"
|
|
137
|
+
:disabled="loading"
|
|
138
|
+
:color="fieldErrors.username ? 'error' : void 0"
|
|
139
|
+
leading-icon="i-lucide-user"
|
|
140
|
+
size="lg"
|
|
141
|
+
class="w-full"
|
|
142
|
+
/>
|
|
143
|
+
</UFormField>
|
|
144
|
+
|
|
145
|
+
<UFormField
|
|
146
|
+
:label="t('mapo.password')"
|
|
147
|
+
name="password"
|
|
148
|
+
:error="fieldErrors.password"
|
|
149
|
+
>
|
|
150
|
+
<UInput
|
|
151
|
+
v-model="form.password"
|
|
152
|
+
type="password"
|
|
153
|
+
placeholder="••••••••"
|
|
154
|
+
autocomplete="current-password"
|
|
155
|
+
:disabled="loading"
|
|
156
|
+
:color="fieldErrors.password ? 'error' : void 0"
|
|
157
|
+
leading-icon="i-lucide-lock"
|
|
158
|
+
size="lg"
|
|
159
|
+
class="w-full"
|
|
160
|
+
/>
|
|
161
|
+
</UFormField>
|
|
162
|
+
|
|
163
|
+
<Transition
|
|
164
|
+
enter-active-class="transition duration-200 ease-out"
|
|
165
|
+
enter-from-class="opacity-0 -translate-y-1"
|
|
166
|
+
leave-active-class="transition duration-150 ease-in"
|
|
167
|
+
leave-to-class="opacity-0 -translate-y-1"
|
|
168
|
+
>
|
|
169
|
+
<UAlert
|
|
170
|
+
v-if="error"
|
|
171
|
+
color="error"
|
|
172
|
+
variant="subtle"
|
|
173
|
+
:description="error"
|
|
174
|
+
icon="i-lucide-alert-circle"
|
|
175
|
+
/>
|
|
176
|
+
</Transition>
|
|
177
|
+
|
|
178
|
+
<UButton
|
|
179
|
+
type="submit"
|
|
180
|
+
size="lg"
|
|
181
|
+
:loading="loading"
|
|
182
|
+
:disabled="!form.username || !form.password"
|
|
183
|
+
block
|
|
184
|
+
>
|
|
185
|
+
{{ t("mapo.signIn") }}
|
|
186
|
+
</UButton>
|
|
187
|
+
</form>
|
|
188
|
+
</UCard>
|
|
189
|
+
|
|
190
|
+
<slot name="after-form" />
|
|
191
|
+
|
|
192
|
+
<slot name="footer" />
|
|
193
|
+
</div>
|
|
194
|
+
</div>
|
|
195
|
+
</div>
|
|
196
|
+
</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":"AA4NA,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;AAmeF,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 { useI18n } from "vue-i18n";
|
|
3
|
+
import { useMapoAuth } from "@mapomodule/core/runtime/auth/useMapoAuth";
|
|
4
|
+
defineProps({
|
|
5
|
+
variant: { type: String, required: false, default: "ghost" },
|
|
6
|
+
color: { type: String, required: false, default: "neutral" },
|
|
7
|
+
size: { type: String, required: false, default: "sm" },
|
|
8
|
+
iconOnly: { type: Boolean, required: false, default: false }
|
|
9
|
+
});
|
|
10
|
+
const { t } = useI18n();
|
|
11
|
+
const { logout } = useMapoAuth();
|
|
12
|
+
</script>
|
|
13
|
+
|
|
14
|
+
<template>
|
|
15
|
+
<UButton
|
|
16
|
+
:variant="variant"
|
|
17
|
+
:color="color"
|
|
18
|
+
:size="size"
|
|
19
|
+
icon="i-lucide-log-out"
|
|
20
|
+
:aria-label="iconOnly ? t('mapo.logout') : void 0"
|
|
21
|
+
@click="logout()"
|
|
22
|
+
>
|
|
23
|
+
<span v-if="!iconOnly">
|
|
24
|
+
<slot>{{ t("mapo.logout") }}</slot>
|
|
25
|
+
</span>
|
|
26
|
+
</UButton>
|
|
27
|
+
</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":"AAsDA,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;AAiFJ,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;UA3FL,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;6EA4FpB,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,47 @@
|
|
|
1
|
+
<script setup>
|
|
2
|
+
import { computed } from "vue";
|
|
3
|
+
import { useI18n } from "vue-i18n";
|
|
4
|
+
import { useMediaStore } from "../stores/media.js";
|
|
5
|
+
const { t } = useI18n();
|
|
6
|
+
const store = useMediaStore();
|
|
7
|
+
const items = computed(() => [
|
|
8
|
+
{
|
|
9
|
+
label: t("mapo.mediaManager.root"),
|
|
10
|
+
icon: "i-lucide-folder-open",
|
|
11
|
+
folder: null
|
|
12
|
+
},
|
|
13
|
+
...store.parentFolders.map((f) => ({
|
|
14
|
+
label: f.name,
|
|
15
|
+
icon: "i-lucide-folder",
|
|
16
|
+
folder: f
|
|
17
|
+
}))
|
|
18
|
+
]);
|
|
19
|
+
function navigate(folder) {
|
|
20
|
+
store.navigateToFolder(folder);
|
|
21
|
+
}
|
|
22
|
+
</script>
|
|
23
|
+
|
|
24
|
+
<template>
|
|
25
|
+
<nav class="flex items-center gap-1 overflow-x-auto py-1 text-sm">
|
|
26
|
+
<template v-for="(item, i) in items" :key="i">
|
|
27
|
+
<UButton
|
|
28
|
+
variant="ghost"
|
|
29
|
+
color="neutral"
|
|
30
|
+
size="xs"
|
|
31
|
+
:icon="item.icon"
|
|
32
|
+
:disabled="i === items.length - 1"
|
|
33
|
+
:class="
|
|
34
|
+
i === items.length - 1 ? 'font-semibold text-highlighted' : 'text-muted hover:text-highlighted'
|
|
35
|
+
"
|
|
36
|
+
@click="navigate(item.folder)"
|
|
37
|
+
>
|
|
38
|
+
{{ item.label }}
|
|
39
|
+
</UButton>
|
|
40
|
+
<UIcon
|
|
41
|
+
v-if="i < items.length - 1"
|
|
42
|
+
name="i-lucide-chevron-right"
|
|
43
|
+
class="size-3 shrink-0 text-dimmed"
|
|
44
|
+
/>
|
|
45
|
+
</template>
|
|
46
|
+
</nav>
|
|
47
|
+
</template>
|
|
@@ -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=MapoMediaBreadcrumbs.vue.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"MapoMediaBreadcrumbs.vue.d.ts","sourceRoot":"","sources":["../../../src/runtime/components/MapoMediaBreadcrumbs.vue"],"names":[],"mappings":"AAkLA,QAAA,MAAM,YAAY,+QAChB,CAAC;wBACkB,OAAO,YAAY;AAAxC,wBAAyC"}
|