@mapomodule/uikit 2.0.0-beta.1 → 2.0.0-beta.11
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/__tests__/langInfo.test.d.ts +2 -0
- package/dist/__tests__/langInfo.test.d.ts.map +1 -0
- 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 +632 -0
- package/dist/runtime/components/MapoDetail.vue.d.ts +422 -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 +293 -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/runtime/utils/langInfo.d.ts +30 -0
- package/dist/runtime/utils/langInfo.d.ts.map +1 -0
- package/dist/runtime/utils/langInfo.js +8 -0
- package/dist/types.d.mts +6 -10
- package/package.json +15 -11
- package/src/__tests__/langInfo.test.ts +48 -0
- 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 +130 -55
- 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 +437 -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/src/runtime/utils/langInfo.ts +38 -0
- package/dist/index.d.cts +0 -2
- package/dist/module.d.cts +0 -2
|
@@ -1,11 +1,14 @@
|
|
|
1
1
|
<script setup lang="ts">
|
|
2
2
|
import { ref, computed, watch } from "vue";
|
|
3
|
+
import { useI18n } from "vue-i18n";
|
|
3
4
|
import type {
|
|
4
5
|
FilterDescriptor,
|
|
5
6
|
ActiveFilter,
|
|
6
7
|
FilterChoice,
|
|
7
8
|
} from "../types/list.js";
|
|
8
9
|
|
|
10
|
+
const { t } = useI18n();
|
|
11
|
+
|
|
9
12
|
const props = defineProps<{
|
|
10
13
|
filters: FilterDescriptor[];
|
|
11
14
|
modelValue: ActiveFilter[];
|
|
@@ -188,7 +191,7 @@ const isOpen = ref(false);
|
|
|
188
191
|
color="neutral"
|
|
189
192
|
@click="removeAll"
|
|
190
193
|
>
|
|
191
|
-
|
|
194
|
+
{{ t("mapo.listFilters.clearAll") }}
|
|
192
195
|
</UButton>
|
|
193
196
|
|
|
194
197
|
<!-- Filter dropdown button -->
|
|
@@ -201,7 +204,7 @@ const isOpen = ref(false);
|
|
|
201
204
|
:disabled="disabled"
|
|
202
205
|
trailing-icon=""
|
|
203
206
|
>
|
|
204
|
-
|
|
207
|
+
{{ t("mapo.listFilters.filters") }}
|
|
205
208
|
</UButton>
|
|
206
209
|
|
|
207
210
|
<template #content>
|
|
@@ -1,9 +1,11 @@
|
|
|
1
1
|
<script setup lang="ts" generic="T extends object">
|
|
2
2
|
import { ref, computed, watch } from "vue";
|
|
3
|
+
import { useI18n } from "vue-i18n";
|
|
3
4
|
import type { Ref } from "vue";
|
|
4
5
|
import type { AnyFieldDescriptor, FieldRegistry } from "@mapomodule/form/types";
|
|
5
6
|
import { useSnackStore } from "@mapomodule/store/runtime/stores/snack";
|
|
6
7
|
import { useCrud } from "@mapomodule/core/runtime/api/crud";
|
|
8
|
+
import { getErrorDetail } from "@mapomodule/core/runtime/utils/fetchError";
|
|
7
9
|
|
|
8
10
|
const props = withDefaults(
|
|
9
11
|
defineProps<{
|
|
@@ -45,6 +47,7 @@ defineSlots<{
|
|
|
45
47
|
extra(props: { model: T }): any;
|
|
46
48
|
}>();
|
|
47
49
|
|
|
50
|
+
const { t } = useI18n();
|
|
48
51
|
const snack = useSnackStore();
|
|
49
52
|
const crud = useCrud<T>(props.endpoint);
|
|
50
53
|
|
|
@@ -77,7 +80,7 @@ watch(
|
|
|
77
80
|
try {
|
|
78
81
|
model.value = await crud.detail(id as string | number);
|
|
79
82
|
} catch {
|
|
80
|
-
snack.show("
|
|
83
|
+
snack.show(t("mapo.loadItemError"), "error");
|
|
81
84
|
isOpen.value = false;
|
|
82
85
|
} finally {
|
|
83
86
|
loading.value = false;
|
|
@@ -91,7 +94,7 @@ async function save() {
|
|
|
91
94
|
// Offline: no backend roundtrip — emit the locally edited model and let
|
|
92
95
|
// the parent splice it back into the source array.
|
|
93
96
|
if (props.offline) {
|
|
94
|
-
snack.show("
|
|
97
|
+
snack.show(t("mapo.saveSuccess"), "success");
|
|
95
98
|
emit("saved", { ...model.value } as T);
|
|
96
99
|
isOpen.value = false;
|
|
97
100
|
return;
|
|
@@ -100,13 +103,11 @@ async function save() {
|
|
|
100
103
|
props.itemId != null
|
|
101
104
|
? await crud.partialUpdate(props.itemId as string | number, model.value)
|
|
102
105
|
: await crud.create(model.value);
|
|
103
|
-
snack.show("
|
|
106
|
+
snack.show(t("mapo.saveSuccess"), "success");
|
|
104
107
|
emit("saved", result);
|
|
105
108
|
isOpen.value = false;
|
|
106
109
|
} catch (err: unknown) {
|
|
107
|
-
|
|
108
|
-
?.response?.data?.detail;
|
|
109
|
-
snack.show(detail ?? "Failed to save", "error");
|
|
110
|
+
snack.show(getErrorDetail(err) ?? t("mapo.saveError"), "error");
|
|
110
111
|
} finally {
|
|
111
112
|
saving.value = false;
|
|
112
113
|
}
|
|
@@ -119,7 +120,9 @@ async function save() {
|
|
|
119
120
|
<div class="p-6 space-y-4">
|
|
120
121
|
<div class="flex items-center justify-between">
|
|
121
122
|
<h3 class="text-base font-semibold text-highlighted">
|
|
122
|
-
{{
|
|
123
|
+
{{
|
|
124
|
+
itemId != null ? t("mapo.edit") : t("mapo.listQuickEdit.newItem")
|
|
125
|
+
}}
|
|
123
126
|
</h3>
|
|
124
127
|
<UButton
|
|
125
128
|
size="xs"
|
|
@@ -150,10 +153,10 @@ async function save() {
|
|
|
150
153
|
|
|
151
154
|
<div class="flex justify-end gap-2 pt-2">
|
|
152
155
|
<UButton variant="ghost" color="neutral" @click="isOpen = false">
|
|
153
|
-
|
|
156
|
+
{{ t("mapo.cancel") }}
|
|
154
157
|
</UButton>
|
|
155
158
|
<UButton color="primary" :loading="saving" @click="save">
|
|
156
|
-
|
|
159
|
+
{{ t("mapo.save") }}
|
|
157
160
|
</UButton>
|
|
158
161
|
</div>
|
|
159
162
|
</template>
|
|
@@ -9,6 +9,7 @@ import {
|
|
|
9
9
|
useSlots,
|
|
10
10
|
} from "vue";
|
|
11
11
|
import type { Ref } from "vue";
|
|
12
|
+
import { useI18n } from "vue-i18n";
|
|
12
13
|
import type { TableColumn } from "@nuxt/ui";
|
|
13
14
|
import type { SortingState, PaginationState } from "@tanstack/vue-table";
|
|
14
15
|
import type { ListColumn } from "../types/list.js";
|
|
@@ -18,7 +19,7 @@ import { usePermissions } from "@mapomodule/store/runtime/composables/usePermiss
|
|
|
18
19
|
import { useCrud } from "@mapomodule/core/runtime/api/crud";
|
|
19
20
|
import type { AnyFieldDescriptor, FieldRegistry } from "@mapomodule/form/types";
|
|
20
21
|
import { debounce, splitEndpointParams } from "@mapomodule/utils";
|
|
21
|
-
import { useRoute, useRouter } from "
|
|
22
|
+
import { useRoute, useRouter } from "#app";
|
|
22
23
|
|
|
23
24
|
const props = withDefaults(
|
|
24
25
|
defineProps<{
|
|
@@ -139,6 +140,7 @@ const slots = useSlots();
|
|
|
139
140
|
// which is both accurate and avoids any implicit-any errors at the call sites.
|
|
140
141
|
const atKey = (item: T, key: string): T[keyof T] => item[key as keyof T];
|
|
141
142
|
|
|
143
|
+
const { t } = useI18n();
|
|
142
144
|
const snack = useSnackStore();
|
|
143
145
|
const confirm = useConfirmStore();
|
|
144
146
|
|
|
@@ -328,9 +330,9 @@ const quickEditLocalItem = computed<T | null>(() => {
|
|
|
328
330
|
// --- Delete ---
|
|
329
331
|
async function deleteRow(item: T) {
|
|
330
332
|
const ok = await confirm.ask({
|
|
331
|
-
title: "
|
|
332
|
-
message: "
|
|
333
|
-
confirmText: "
|
|
333
|
+
title: t("mapo.listTable.deleteItemTitle"),
|
|
334
|
+
message: t("mapo.confirmDelete"),
|
|
335
|
+
confirmText: t("mapo.delete"),
|
|
334
336
|
dangerous: true,
|
|
335
337
|
});
|
|
336
338
|
if (!ok) return;
|
|
@@ -340,16 +342,16 @@ async function deleteRow(item: T) {
|
|
|
340
342
|
String(atKey(r, props.lookup)) !== String(atKey(item, props.lookup)),
|
|
341
343
|
);
|
|
342
344
|
emit("update:items", next);
|
|
343
|
-
snack.show("
|
|
345
|
+
snack.show(t("mapo.listTable.itemDeleted"), "success");
|
|
344
346
|
return;
|
|
345
347
|
}
|
|
346
348
|
try {
|
|
347
349
|
await crud.delete(atKey(item, props.lookup) as string | number);
|
|
348
|
-
snack.show("
|
|
350
|
+
snack.show(t("mapo.listTable.itemDeleted"), "success");
|
|
349
351
|
if (hybridMode.value) hybridLoaded.value = false;
|
|
350
352
|
refresh();
|
|
351
353
|
} catch {
|
|
352
|
-
snack.show("
|
|
354
|
+
snack.show(t("mapo.listTable.deleteItemError"), "error");
|
|
353
355
|
}
|
|
354
356
|
}
|
|
355
357
|
|
|
@@ -454,13 +456,13 @@ async function onDrop(fromIdx: number, toIdx: number) {
|
|
|
454
456
|
atKey(moved, props.lookup) as string | number,
|
|
455
457
|
atKey(target, props.lookup) as string | number,
|
|
456
458
|
);
|
|
457
|
-
snack.show("
|
|
459
|
+
snack.show(t("mapo.listTable.orderSaved"), "success");
|
|
458
460
|
if (hybridMode.value) {
|
|
459
461
|
hybridLoaded.value = false;
|
|
460
462
|
refresh();
|
|
461
463
|
}
|
|
462
464
|
} catch {
|
|
463
|
-
snack.show("
|
|
465
|
+
snack.show(t("mapo.listTable.orderError"), "error");
|
|
464
466
|
refresh();
|
|
465
467
|
}
|
|
466
468
|
}
|
|
@@ -554,7 +556,7 @@ async function fetchAll() {
|
|
|
554
556
|
fullDataset.value = nextItems;
|
|
555
557
|
hybridLoaded.value = true;
|
|
556
558
|
} catch {
|
|
557
|
-
snack.show("
|
|
559
|
+
snack.show(t("mapo.loadError"), "error");
|
|
558
560
|
} finally {
|
|
559
561
|
loading.value = false;
|
|
560
562
|
}
|
|
@@ -626,7 +628,7 @@ async function refresh() {
|
|
|
626
628
|
rows.value = nextItems;
|
|
627
629
|
total.value = nextTotal;
|
|
628
630
|
} catch {
|
|
629
|
-
snack.show("
|
|
631
|
+
snack.show(t("mapo.loadError"), "error");
|
|
630
632
|
} finally {
|
|
631
633
|
loading.value = false;
|
|
632
634
|
}
|
|
@@ -682,14 +684,14 @@ const tableColumns = computed<TableColumn<T>[]>(() => {
|
|
|
682
684
|
modelValue: isAllSelected.value,
|
|
683
685
|
indeterminate: isIndeterminate.value,
|
|
684
686
|
"onUpdate:modelValue": toggleAll,
|
|
685
|
-
ariaLabel: "
|
|
687
|
+
ariaLabel: t("mapo.listTable.selectAllRows"),
|
|
686
688
|
}),
|
|
687
689
|
cell: ({ row }: { row: { original: T } }) => {
|
|
688
690
|
const k = pkOf(row.original);
|
|
689
691
|
return h(UCheckbox, {
|
|
690
692
|
modelValue: !!rowSelection.value[k],
|
|
691
693
|
"onUpdate:modelValue": () => toggleRowByKey(k),
|
|
692
|
-
ariaLabel: "
|
|
694
|
+
ariaLabel: t("mapo.listTable.selectRow"),
|
|
693
695
|
});
|
|
694
696
|
},
|
|
695
697
|
meta: { class: { th: "w-10", td: "w-10" } },
|
|
@@ -709,8 +711,8 @@ const tableColumns = computed<TableColumn<T>[]>(() => {
|
|
|
709
711
|
: "cursor-not-allowed text-muted opacity-30",
|
|
710
712
|
draggable: canReorder.value,
|
|
711
713
|
title: canReorder.value
|
|
712
|
-
? "
|
|
713
|
-
: "
|
|
714
|
+
? t("mapo.listTable.dragToReorder")
|
|
715
|
+
: t("mapo.listTable.clearToReorder"),
|
|
714
716
|
onDragstart: (e: DragEvent) => {
|
|
715
717
|
e.dataTransfer?.setData("text/plain", "");
|
|
716
718
|
onDragStart(row.index);
|
|
@@ -815,7 +817,7 @@ const sortingOptions = computed(() => ({
|
|
|
815
817
|
<div v-if="searchable" class="flex items-center gap-2">
|
|
816
818
|
<UInput
|
|
817
819
|
:model-value="search"
|
|
818
|
-
placeholder="
|
|
820
|
+
:placeholder="t('mapo.search')"
|
|
819
821
|
icon="i-lucide-search"
|
|
820
822
|
size="sm"
|
|
821
823
|
class="max-w-xs"
|
|
@@ -839,7 +841,7 @@ const sortingOptions = computed(() => ({
|
|
|
839
841
|
:pagination-options="paginationOptions"
|
|
840
842
|
:sorting="sorting"
|
|
841
843
|
:sorting-options="sortingOptions"
|
|
842
|
-
empty="
|
|
844
|
+
:empty="t('mapo.listTable.noItems')"
|
|
843
845
|
@update:pagination="pagination = $event ?? pagination"
|
|
844
846
|
@update:sorting="sorting = $event ?? sorting"
|
|
845
847
|
>
|
|
@@ -847,7 +849,7 @@ const sortingOptions = computed(() => ({
|
|
|
847
849
|
<slot name="dtable.empty">
|
|
848
850
|
<div class="flex flex-col items-center gap-2 py-8 text-muted">
|
|
849
851
|
<UIcon name="i-lucide-inbox" class="h-8 w-8" />
|
|
850
|
-
<span class="text-sm">
|
|
852
|
+
<span class="text-sm">{{ t("mapo.listTable.noItems") }}</span>
|
|
851
853
|
</div>
|
|
852
854
|
</slot>
|
|
853
855
|
</template>
|
|
@@ -867,11 +869,11 @@ const sortingOptions = computed(() => ({
|
|
|
867
869
|
|
|
868
870
|
<!-- Pagination controls -->
|
|
869
871
|
<div class="flex items-center justify-between text-sm text-muted">
|
|
870
|
-
<span>{{ total }}
|
|
872
|
+
<span>{{ t("mapo.listTable.totalItems", { total }) }}</span>
|
|
871
873
|
<UPagination
|
|
872
874
|
:model-value="pagination.pageIndex + 1"
|
|
873
875
|
:total="total"
|
|
874
|
-
:page
|
|
876
|
+
:items-per-page="pagination.pageSize"
|
|
875
877
|
size="sm"
|
|
876
878
|
@update:model-value="
|
|
877
879
|
pagination = { ...pagination, pageIndex: $event - 1 }
|
|
@@ -880,7 +882,10 @@ const sortingOptions = computed(() => ({
|
|
|
880
882
|
<USelect
|
|
881
883
|
:model-value="pagination.pageSize"
|
|
882
884
|
:items="
|
|
883
|
-
pageSizeOptions.map((n) => ({
|
|
885
|
+
pageSizeOptions.map((n) => ({
|
|
886
|
+
label: t('mapo.listTable.perPage', { n }),
|
|
887
|
+
value: n,
|
|
888
|
+
}))
|
|
884
889
|
"
|
|
885
890
|
size="xs"
|
|
886
891
|
class="w-28"
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
<script setup lang="ts">
|
|
2
2
|
import { reactive, ref } from "vue";
|
|
3
|
+
import { useI18n } from "vue-i18n";
|
|
3
4
|
import { useMapoAuth } from "@mapomodule/core/runtime/auth/useMapoAuth";
|
|
4
|
-
import { useRoute } from "
|
|
5
|
-
import { navigateTo } from "#app";
|
|
5
|
+
import { useRoute, navigateTo } from "#app";
|
|
6
6
|
|
|
7
7
|
defineSlots<{
|
|
8
8
|
/** Left decorative panel (shown lg+). Replace with your own branding. */
|
|
@@ -17,6 +17,7 @@ defineSlots<{
|
|
|
17
17
|
footer(): unknown;
|
|
18
18
|
}>();
|
|
19
19
|
|
|
20
|
+
const { t } = useI18n();
|
|
20
21
|
const { login } = useMapoAuth();
|
|
21
22
|
const route = useRoute();
|
|
22
23
|
|
|
@@ -41,7 +42,7 @@ async function submit() {
|
|
|
41
42
|
if (data.username?.length) fieldErrors.username = data.username[0];
|
|
42
43
|
if (data.password?.length) fieldErrors.password = data.password[0];
|
|
43
44
|
} else {
|
|
44
|
-
error.value = "
|
|
45
|
+
error.value = t("mapo.login.invalidCredentials");
|
|
45
46
|
}
|
|
46
47
|
} finally {
|
|
47
48
|
loading.value = false;
|
|
@@ -77,9 +78,11 @@ async function submit() {
|
|
|
77
78
|
<UIcon name="i-lucide-layers" class="size-10 text-white" />
|
|
78
79
|
</div>
|
|
79
80
|
<div class="space-y-2">
|
|
80
|
-
<h2 class="text-3xl font-bold tracking-tight">
|
|
81
|
+
<h2 class="text-3xl font-bold tracking-tight">
|
|
82
|
+
{{ t("mapo.login.welcome") }}
|
|
83
|
+
</h2>
|
|
81
84
|
<p class="text-white/70 text-sm leading-relaxed max-w-xs">
|
|
82
|
-
|
|
85
|
+
{{ t("mapo.login.tagline") }}
|
|
83
86
|
</p>
|
|
84
87
|
</div>
|
|
85
88
|
<div class="flex gap-2 flex-wrap justify-center">
|
|
@@ -125,10 +128,10 @@ async function submit() {
|
|
|
125
128
|
</div>
|
|
126
129
|
<div>
|
|
127
130
|
<h1 class="text-2xl font-bold text-highlighted tracking-tight">
|
|
128
|
-
|
|
131
|
+
{{ t("mapo.signIn") }}
|
|
129
132
|
</h1>
|
|
130
133
|
<p class="text-sm text-muted mt-1">
|
|
131
|
-
|
|
134
|
+
{{ t("mapo.login.subtitle") }}
|
|
132
135
|
</p>
|
|
133
136
|
</div>
|
|
134
137
|
</div>
|
|
@@ -139,7 +142,7 @@ async function submit() {
|
|
|
139
142
|
<UCard class="shadow-xl ring-1 ring-default/60">
|
|
140
143
|
<form class="space-y-5" @submit.prevent="submit">
|
|
141
144
|
<UFormField
|
|
142
|
-
label="
|
|
145
|
+
:label="t('mapo.username')"
|
|
143
146
|
name="username"
|
|
144
147
|
:error="fieldErrors.username"
|
|
145
148
|
>
|
|
@@ -156,7 +159,7 @@ async function submit() {
|
|
|
156
159
|
</UFormField>
|
|
157
160
|
|
|
158
161
|
<UFormField
|
|
159
|
-
label="
|
|
162
|
+
:label="t('mapo.password')"
|
|
160
163
|
name="password"
|
|
161
164
|
:error="fieldErrors.password"
|
|
162
165
|
>
|
|
@@ -195,7 +198,7 @@ async function submit() {
|
|
|
195
198
|
:disabled="!form.username || !form.password"
|
|
196
199
|
block
|
|
197
200
|
>
|
|
198
|
-
|
|
201
|
+
{{ t("mapo.signIn") }}
|
|
199
202
|
</UButton>
|
|
200
203
|
</form>
|
|
201
204
|
</UCard>
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
<script setup lang="ts">
|
|
2
|
+
import { useI18n } from "vue-i18n";
|
|
2
3
|
import { useMapoAuth } from "@mapomodule/core/runtime/auth/useMapoAuth";
|
|
3
4
|
|
|
4
5
|
withDefaults(
|
|
@@ -27,6 +28,7 @@ withDefaults(
|
|
|
27
28
|
},
|
|
28
29
|
);
|
|
29
30
|
|
|
31
|
+
const { t } = useI18n();
|
|
30
32
|
const { logout } = useMapoAuth();
|
|
31
33
|
</script>
|
|
32
34
|
|
|
@@ -36,11 +38,11 @@ const { logout } = useMapoAuth();
|
|
|
36
38
|
:color="color"
|
|
37
39
|
:size="size"
|
|
38
40
|
icon="i-lucide-log-out"
|
|
39
|
-
:aria-label="iconOnly ? '
|
|
41
|
+
:aria-label="iconOnly ? t('mapo.logout') : undefined"
|
|
40
42
|
@click="logout()"
|
|
41
43
|
>
|
|
42
44
|
<span v-if="!iconOnly">
|
|
43
|
-
<slot>
|
|
45
|
+
<slot>{{ t("mapo.logout") }}</slot>
|
|
44
46
|
</span>
|
|
45
47
|
</UButton>
|
|
46
48
|
</template>
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
<script setup lang="ts">
|
|
2
|
+
import { computed } from "vue";
|
|
3
|
+
import { useI18n } from "vue-i18n";
|
|
4
|
+
import { useMediaStore } from "../stores/media.js";
|
|
5
|
+
import type { MediaFolder } from "../types/media.js";
|
|
6
|
+
|
|
7
|
+
const { t } = useI18n();
|
|
8
|
+
const store = useMediaStore();
|
|
9
|
+
|
|
10
|
+
const items = computed(() => [
|
|
11
|
+
{
|
|
12
|
+
label: t("mapo.mediaManager.root"),
|
|
13
|
+
icon: "i-lucide-folder-open",
|
|
14
|
+
folder: null as MediaFolder | null,
|
|
15
|
+
},
|
|
16
|
+
...store.parentFolders.map((f) => ({
|
|
17
|
+
label: f.name,
|
|
18
|
+
icon: "i-lucide-folder",
|
|
19
|
+
folder: f,
|
|
20
|
+
})),
|
|
21
|
+
]);
|
|
22
|
+
|
|
23
|
+
function navigate(folder: MediaFolder | null) {
|
|
24
|
+
store.navigateToFolder(folder);
|
|
25
|
+
}
|
|
26
|
+
</script>
|
|
27
|
+
|
|
28
|
+
<template>
|
|
29
|
+
<nav class="flex items-center gap-1 overflow-x-auto py-1 text-sm">
|
|
30
|
+
<template v-for="(item, i) in items" :key="i">
|
|
31
|
+
<UButton
|
|
32
|
+
variant="ghost"
|
|
33
|
+
color="neutral"
|
|
34
|
+
size="xs"
|
|
35
|
+
:icon="item.icon"
|
|
36
|
+
:disabled="i === items.length - 1"
|
|
37
|
+
:class="
|
|
38
|
+
i === items.length - 1
|
|
39
|
+
? 'font-semibold text-highlighted'
|
|
40
|
+
: 'text-muted hover:text-highlighted'
|
|
41
|
+
"
|
|
42
|
+
@click="navigate(item.folder)"
|
|
43
|
+
>
|
|
44
|
+
{{ item.label }}
|
|
45
|
+
</UButton>
|
|
46
|
+
<UIcon
|
|
47
|
+
v-if="i < items.length - 1"
|
|
48
|
+
name="i-lucide-chevron-right"
|
|
49
|
+
class="size-3 shrink-0 text-dimmed"
|
|
50
|
+
/>
|
|
51
|
+
</template>
|
|
52
|
+
</nav>
|
|
53
|
+
</template>
|