@mapomodule/uikit 2.0.0-beta.13 → 2.0.0-beta.15
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 +46 -184
- package/dist/__tests__/MapoConfirmDialog.component.test.d.ts +2 -0
- package/dist/__tests__/MapoConfirmDialog.component.test.d.ts.map +1 -0
- package/dist/__tests__/MapoDetail.component.test.d.ts +2 -0
- package/dist/__tests__/MapoDetail.component.test.d.ts.map +1 -0
- package/dist/__tests__/MapoDetailLangSwitch.component.test.d.ts +2 -0
- package/dist/__tests__/MapoDetailLangSwitch.component.test.d.ts.map +1 -0
- package/dist/__tests__/MapoListTable.component.test.d.ts +2 -0
- package/dist/__tests__/MapoListTable.component.test.d.ts.map +1 -0
- package/dist/__tests__/__mocks__/nuxt-app.d.ts +9 -0
- package/dist/__tests__/__mocks__/nuxt-app.d.ts.map +1 -0
- package/dist/__tests__/listTable.test.d.ts +2 -0
- package/dist/__tests__/listTable.test.d.ts.map +1 -0
- package/dist/module.json +1 -1
- package/dist/runtime/assets/main.css +1 -1
- package/dist/runtime/components/MapoConfirmDialog.vue +18 -1
- package/dist/runtime/components/MapoConfirmDialog.vue.d.ts.map +1 -1
- package/dist/runtime/components/MapoDetail.vue +43 -11
- package/dist/runtime/components/MapoDetail.vue.d.ts +76 -0
- package/dist/runtime/components/MapoDetail.vue.d.ts.map +1 -1
- package/dist/runtime/components/MapoDetailLangSwitch.vue +21 -25
- package/dist/runtime/components/MapoDetailLangSwitch.vue.d.ts +4 -3
- package/dist/runtime/components/MapoDetailLangSwitch.vue.d.ts.map +1 -1
- package/dist/runtime/components/MapoList.vue +3 -2
- package/dist/runtime/components/MapoList.vue.d.ts +9 -4
- package/dist/runtime/components/MapoList.vue.d.ts.map +1 -1
- package/dist/runtime/components/MapoListTable.vue +98 -32
- package/dist/runtime/components/MapoListTable.vue.d.ts +11 -6
- package/dist/runtime/components/MapoListTable.vue.d.ts.map +1 -1
- package/dist/runtime/components/MapoMediaPreview.vue.d.ts +1 -1
- package/dist/runtime/components/MapoMediaPreview.vue.d.ts.map +1 -1
- package/dist/runtime/components/MapoMediaUploader.vue +21 -21
- package/dist/runtime/components/MapoMediaUploader.vue.d.ts.map +1 -1
- package/dist/runtime/components/MapoMenuManager.vue.d.ts +1 -1
- package/dist/runtime/components/MapoMenuManager.vue.d.ts.map +1 -1
- package/dist/runtime/components/MapoMenuTreeview.vue.d.ts +1 -1
- package/dist/runtime/components/MapoMenuTreeview.vue.d.ts.map +1 -1
- package/dist/runtime/components/MapoMenuTreeviewNode.vue.d.ts +2 -2
- package/dist/runtime/page-meta.nuxt.d.ts +4 -0
- package/dist/runtime/stores/media.d.ts +2 -2
- package/dist/runtime/types/list.d.ts +10 -2
- package/dist/runtime/types/list.d.ts.map +1 -1
- package/dist/runtime/utils/listTable.d.ts +29 -0
- package/dist/runtime/utils/listTable.d.ts.map +1 -0
- package/dist/runtime/utils/listTable.js +21 -0
- package/package.json +6 -6
- package/src/__tests__/MapoConfirmDialog.component.test.ts +165 -0
- package/src/__tests__/MapoDetail.component.test.ts +293 -0
- package/src/__tests__/MapoDetailLangSwitch.component.test.ts +145 -0
- package/src/__tests__/MapoListTable.component.test.ts +504 -0
- package/src/__tests__/__mocks__/nuxt-app.ts +8 -0
- package/src/__tests__/listTable.test.ts +82 -0
- package/src/runtime/assets/main.css +9 -0
- package/src/runtime/components/MapoConfirmDialog.vue +28 -1
- package/src/runtime/components/MapoDetail.vue +78 -11
- package/src/runtime/components/MapoDetailLangSwitch.vue +26 -27
- package/src/runtime/components/MapoList.vue +13 -5
- package/src/runtime/components/MapoListTable.vue +128 -41
- package/src/runtime/components/MapoMediaUploader.vue +25 -21
- package/src/runtime/page-meta.nuxt.d.ts +4 -0
- package/src/runtime/types/list.ts +10 -2
- package/src/runtime/utils/listTable.ts +54 -0
|
@@ -6,21 +6,34 @@ import {
|
|
|
6
6
|
watch,
|
|
7
7
|
h,
|
|
8
8
|
resolveComponent,
|
|
9
|
-
useSlots
|
|
9
|
+
useSlots,
|
|
10
|
+
onBeforeUnmount
|
|
10
11
|
} from "vue";
|
|
11
12
|
import { useI18n } from "vue-i18n";
|
|
12
13
|
import { useSnackStore } from "@mapomodule/store/runtime/stores/snack";
|
|
13
14
|
import { useConfirmStore } from "@mapomodule/store/runtime/stores/confirm";
|
|
14
15
|
import { usePermissions } from "@mapomodule/store/runtime/composables/usePermissions";
|
|
15
16
|
import { useCrud } from "@mapomodule/core/runtime/api/crud";
|
|
16
|
-
import {
|
|
17
|
+
import {
|
|
18
|
+
debounce,
|
|
19
|
+
getNestedValue,
|
|
20
|
+
splitEndpointParams
|
|
21
|
+
} from "@mapomodule/utils";
|
|
17
22
|
import { useRoute, useRouter } from "#app";
|
|
23
|
+
import {
|
|
24
|
+
ALL_ROWS,
|
|
25
|
+
formatPageSize,
|
|
26
|
+
nextSorting,
|
|
27
|
+
orderingParam,
|
|
28
|
+
parsePageSize,
|
|
29
|
+
toPageSize
|
|
30
|
+
} from "../utils/listTable.js";
|
|
18
31
|
const props = defineProps({
|
|
19
32
|
endpoint: { type: String, required: false, default: "" },
|
|
20
33
|
items: { type: Array, required: false, default: void 0 },
|
|
21
34
|
crudEndpoint: { type: String, required: false },
|
|
22
35
|
filterParams: { type: Object, required: false },
|
|
23
|
-
defaultPageSize: { type: Number, required: false, default: 20 },
|
|
36
|
+
defaultPageSize: { type: [Number, String], required: false, default: 20 },
|
|
24
37
|
pageSizeOptions: { type: Array, required: false, default: () => [10, 20, 50, 100] },
|
|
25
38
|
responseAdapter: { type: Function, required: false },
|
|
26
39
|
paginationParams: { type: Function, required: false },
|
|
@@ -42,7 +55,7 @@ const emit = defineEmits(["update:selection", "update:selectionQuery", "update:i
|
|
|
42
55
|
defineExpose({ refresh });
|
|
43
56
|
defineSlots();
|
|
44
57
|
const slots = useSlots();
|
|
45
|
-
const atKey = (item, key) => item
|
|
58
|
+
const atKey = (item, key) => getNestedValue(item, key);
|
|
46
59
|
const { t } = useI18n();
|
|
47
60
|
const snack = useSnackStore();
|
|
48
61
|
const confirm = useConfirmStore();
|
|
@@ -66,10 +79,17 @@ function toPositiveNumber(value, fallback) {
|
|
|
66
79
|
const n = Number(value);
|
|
67
80
|
return Number.isFinite(n) && n > 0 ? n : fallback;
|
|
68
81
|
}
|
|
82
|
+
const defaultPageSize = toPageSize(props.defaultPageSize);
|
|
69
83
|
const pagination = ref({
|
|
70
84
|
pageIndex: route.query.page ? Math.max(0, toPositiveNumber(route.query.page, 1) - 1) : 0,
|
|
71
|
-
pageSize: route.query.page_size ?
|
|
85
|
+
pageSize: route.query.page_size ? parsePageSize(route.query.page_size, defaultPageSize) : defaultPageSize
|
|
72
86
|
});
|
|
87
|
+
const showsAllRows = computed(() => pagination.value.pageSize === ALL_ROWS);
|
|
88
|
+
const pageSizeItems = computed(
|
|
89
|
+
() => props.pageSizeOptions.map(
|
|
90
|
+
(option) => option === "all" ? { label: t("mapo.listTable.allRows"), value: ALL_ROWS } : { label: t("mapo.listTable.perPage", { n: option }), value: option }
|
|
91
|
+
)
|
|
92
|
+
);
|
|
73
93
|
const sorting = ref(
|
|
74
94
|
route.query.ordering ? String(route.query.ordering).split(",").map((o) => ({
|
|
75
95
|
id: o.startsWith("-") ? o.slice(1) : o,
|
|
@@ -88,8 +108,8 @@ const writeUrlState = debounce(() => {
|
|
|
88
108
|
const page = pagination.value.pageIndex + 1;
|
|
89
109
|
if (page > 1) query.page = String(page);
|
|
90
110
|
else delete query.page;
|
|
91
|
-
if (pagination.value.pageSize !==
|
|
92
|
-
query.page_size =
|
|
111
|
+
if (pagination.value.pageSize !== defaultPageSize)
|
|
112
|
+
query.page_size = formatPageSize(pagination.value.pageSize);
|
|
93
113
|
else delete query.page_size;
|
|
94
114
|
if (search.value) query.search = search.value;
|
|
95
115
|
else delete query.search;
|
|
@@ -99,6 +119,10 @@ const writeUrlState = debounce(() => {
|
|
|
99
119
|
router.replace({ query });
|
|
100
120
|
}, 150);
|
|
101
121
|
watch([pagination, search, sorting], writeUrlState, { deep: true });
|
|
122
|
+
onBeforeUnmount(() => {
|
|
123
|
+
onSearchInput.cancel();
|
|
124
|
+
writeUrlState.cancel();
|
|
125
|
+
});
|
|
102
126
|
const rowSelection = ref({});
|
|
103
127
|
const pkOf = (row) => String(atKey(row, props.lookup));
|
|
104
128
|
const isAllSelected = computed(
|
|
@@ -117,11 +141,11 @@ watch(selectedRows, (rows2) => {
|
|
|
117
141
|
});
|
|
118
142
|
function buildSelectionQuery() {
|
|
119
143
|
const params = new URLSearchParams();
|
|
120
|
-
|
|
144
|
+
if (!showsAllRows.value)
|
|
145
|
+
params.set("page_size", String(pagination.value.pageSize));
|
|
121
146
|
if (search.value) params.set("search", search.value);
|
|
122
|
-
sorting.value.
|
|
123
|
-
|
|
124
|
-
);
|
|
147
|
+
if (sorting.value.length)
|
|
148
|
+
params.set("ordering", orderingParam(sorting.value));
|
|
125
149
|
return params;
|
|
126
150
|
}
|
|
127
151
|
function toggleAll() {
|
|
@@ -288,7 +312,7 @@ function applyOffline(source) {
|
|
|
288
312
|
const q = search.value.toLowerCase();
|
|
289
313
|
arr = arr.filter(
|
|
290
314
|
(row) => props.columns.some(
|
|
291
|
-
(c) => String(row
|
|
315
|
+
(c) => String(atKey(row, c.key) ?? "").toLowerCase().includes(q)
|
|
292
316
|
)
|
|
293
317
|
);
|
|
294
318
|
}
|
|
@@ -377,11 +401,11 @@ async function refresh() {
|
|
|
377
401
|
const params = {
|
|
378
402
|
...endpointParams,
|
|
379
403
|
...props.filterParams ?? {},
|
|
380
|
-
|
|
404
|
+
// "All rows" sends no pagination params: the backend returns the whole collection.
|
|
405
|
+
...showsAllRows.value ? {} : paginationP
|
|
381
406
|
};
|
|
382
407
|
if (search.value) params.search = search.value;
|
|
383
|
-
if (sorting.value.length)
|
|
384
|
-
params.ordering = sorting.value.map((s) => `${s.desc ? "-" : ""}${s.id}`).join(",");
|
|
408
|
+
if (sorting.value.length) params.ordering = orderingParam(sorting.value);
|
|
385
409
|
const res = await crud.list(params);
|
|
386
410
|
let nextItems = [];
|
|
387
411
|
let nextTotal = 0;
|
|
@@ -425,18 +449,51 @@ watch(
|
|
|
425
449
|
search
|
|
426
450
|
],
|
|
427
451
|
([newEndpoint, , newFilters], [oldEndpoint, , oldFilters]) => {
|
|
428
|
-
const
|
|
429
|
-
if (
|
|
430
|
-
pagination.value = { ...pagination.value, pageIndex: 0 };
|
|
431
|
-
} else {
|
|
452
|
+
const isFirstRun = oldFilters === void 0;
|
|
453
|
+
if (isFirstRun) {
|
|
432
454
|
refresh();
|
|
455
|
+
return;
|
|
456
|
+
}
|
|
457
|
+
const endpointChanged = newEndpoint !== oldEndpoint;
|
|
458
|
+
const filtersChanged = newFilters !== oldFilters;
|
|
459
|
+
const contextChanged = endpointChanged || filtersChanged;
|
|
460
|
+
const isOnFirstPage = pagination.value.pageIndex === 0;
|
|
461
|
+
if (contextChanged && !isOnFirstPage) {
|
|
462
|
+
pagination.value = { ...pagination.value, pageIndex: 0 };
|
|
463
|
+
return;
|
|
433
464
|
}
|
|
465
|
+
refresh();
|
|
434
466
|
},
|
|
435
467
|
{ immediate: true, deep: true }
|
|
436
468
|
);
|
|
437
469
|
const UCheckbox = resolveComponent("UCheckbox");
|
|
438
470
|
const UButton = resolveComponent("UButton");
|
|
439
471
|
const UIcon = resolveComponent("UIcon");
|
|
472
|
+
const SORT_ICONS = {
|
|
473
|
+
none: "i-lucide-arrow-up-down",
|
|
474
|
+
asc: "i-lucide-arrow-up-narrow-wide",
|
|
475
|
+
desc: "i-lucide-arrow-down-wide-narrow"
|
|
476
|
+
};
|
|
477
|
+
const SORT_NEXT_ACTION = {
|
|
478
|
+
none: "mapo.listTable.sortAscending",
|
|
479
|
+
asc: "mapo.listTable.sortDescending",
|
|
480
|
+
desc: "mapo.listTable.clearSorting"
|
|
481
|
+
};
|
|
482
|
+
function sortHeader(col) {
|
|
483
|
+
const sort = sorting.value.find((s) => s.id === col.key);
|
|
484
|
+
const direction = !sort ? "none" : sort.desc ? "desc" : "asc";
|
|
485
|
+
return h(UButton, {
|
|
486
|
+
color: "neutral",
|
|
487
|
+
variant: "ghost",
|
|
488
|
+
label: col.label,
|
|
489
|
+
icon: SORT_ICONS[direction],
|
|
490
|
+
class: "-mx-2.5",
|
|
491
|
+
"aria-label": t(SORT_NEXT_ACTION[direction], { column: col.label }),
|
|
492
|
+
onClick: () => {
|
|
493
|
+
sorting.value = nextSorting(sorting.value, col.key);
|
|
494
|
+
}
|
|
495
|
+
});
|
|
496
|
+
}
|
|
440
497
|
const tableColumns = computed(() => {
|
|
441
498
|
const cols = [];
|
|
442
499
|
cols.push({
|
|
@@ -482,8 +539,11 @@ const tableColumns = computed(() => {
|
|
|
482
539
|
const col = props.columns[i];
|
|
483
540
|
const isFirst = i === 0 && !!props.detailBase;
|
|
484
541
|
cols.push({
|
|
542
|
+
// TanStack would turn a dotted key into `category_name`; the sorting
|
|
543
|
+
// state uses the column key, so the id must be the key itself.
|
|
544
|
+
id: col.key,
|
|
485
545
|
accessorKey: col.key,
|
|
486
|
-
header: col.label,
|
|
546
|
+
header: col.sortable ? () => sortHeader(col) : col.label,
|
|
487
547
|
cell: ({ row }) => {
|
|
488
548
|
const cellSlot = slots[`cell.${col.key}`];
|
|
489
549
|
if (cellSlot)
|
|
@@ -519,6 +579,7 @@ const tableColumns = computed(() => {
|
|
|
519
579
|
variant: "ghost",
|
|
520
580
|
color: "neutral",
|
|
521
581
|
icon: "i-lucide-pencil",
|
|
582
|
+
"aria-label": t("mapo.edit"),
|
|
522
583
|
onClick: () => openQuickEdit(
|
|
523
584
|
atKey(row.original, props.lookup)
|
|
524
585
|
)
|
|
@@ -532,6 +593,7 @@ const tableColumns = computed(() => {
|
|
|
532
593
|
variant: "ghost",
|
|
533
594
|
color: "error",
|
|
534
595
|
icon: "i-lucide-trash-2",
|
|
596
|
+
"aria-label": t("mapo.delete"),
|
|
535
597
|
onClick: () => deleteRow(row.original)
|
|
536
598
|
})
|
|
537
599
|
);
|
|
@@ -546,6 +608,15 @@ const tableColumns = computed(() => {
|
|
|
546
608
|
});
|
|
547
609
|
return cols;
|
|
548
610
|
});
|
|
611
|
+
const emptyText = computed(() => {
|
|
612
|
+
const isSearching = !!search.value;
|
|
613
|
+
const isFiltering = Object.values(props.filterParams ?? {}).some(
|
|
614
|
+
(value) => value != null && value !== ""
|
|
615
|
+
);
|
|
616
|
+
return t(
|
|
617
|
+
isSearching || isFiltering ? "mapo.listTable.noResults" : "mapo.listTable.noItems"
|
|
618
|
+
);
|
|
619
|
+
});
|
|
549
620
|
const paginationOptions = computed(() => ({
|
|
550
621
|
manualPagination: true,
|
|
551
622
|
rowCount: total.value
|
|
@@ -585,7 +656,7 @@ const sortingOptions = computed(() => ({
|
|
|
585
656
|
:pagination-options="paginationOptions"
|
|
586
657
|
:sorting="sorting"
|
|
587
658
|
:sorting-options="sortingOptions"
|
|
588
|
-
:empty="
|
|
659
|
+
:empty="emptyText"
|
|
589
660
|
@update:pagination="pagination = $event ?? pagination"
|
|
590
661
|
@update:sorting="sorting = $event ?? sorting"
|
|
591
662
|
>
|
|
@@ -593,7 +664,7 @@ const sortingOptions = computed(() => ({
|
|
|
593
664
|
<slot name="dtable.empty">
|
|
594
665
|
<div class="flex flex-col items-center gap-2 py-8 text-muted">
|
|
595
666
|
<UIcon name="i-lucide-inbox" class="h-8 w-8" />
|
|
596
|
-
<span class="text-sm">{{
|
|
667
|
+
<span class="text-sm">{{ emptyText }}</span>
|
|
597
668
|
</div>
|
|
598
669
|
</slot>
|
|
599
670
|
</template>
|
|
@@ -614,23 +685,18 @@ const sortingOptions = computed(() => ({
|
|
|
614
685
|
<!-- Pagination controls -->
|
|
615
686
|
<div class="flex items-center justify-between text-sm text-muted">
|
|
616
687
|
<span>{{ t("mapo.listTable.totalItems", { total }) }}</span>
|
|
688
|
+
<!-- Nuxt UI 4's UPagination models `page`: with `modelValue` it runs uncontrolled. -->
|
|
617
689
|
<UPagination
|
|
618
|
-
|
|
690
|
+
v-if="!showsAllRows"
|
|
691
|
+
:page="pagination.pageIndex + 1"
|
|
619
692
|
:total="total"
|
|
620
693
|
:items-per-page="pagination.pageSize"
|
|
621
694
|
size="sm"
|
|
622
|
-
@update:
|
|
623
|
-
pagination = { ...pagination, pageIndex: $event - 1 }
|
|
624
|
-
"
|
|
695
|
+
@update:page="pagination = { ...pagination, pageIndex: $event - 1 }"
|
|
625
696
|
/>
|
|
626
697
|
<USelect
|
|
627
698
|
:model-value="pagination.pageSize"
|
|
628
|
-
:items="
|
|
629
|
-
pageSizeOptions.map((n) => ({
|
|
630
|
-
label: t('mapo.listTable.perPage', { n }),
|
|
631
|
-
value: n
|
|
632
|
-
}))
|
|
633
|
-
"
|
|
699
|
+
:items="pageSizeItems"
|
|
634
700
|
size="xs"
|
|
635
701
|
class="w-28"
|
|
636
702
|
@update:model-value="
|
|
@@ -23,10 +23,14 @@ declare const __VLS_export: <T extends object>(__VLS_props: NonNullable<Awaited<
|
|
|
23
23
|
* and tab params without baking them into the endpoint string.
|
|
24
24
|
*/
|
|
25
25
|
filterParams?: Record<string, unknown>;
|
|
26
|
-
/** Initial page size
|
|
27
|
-
defaultPageSize?: number;
|
|
28
|
-
/**
|
|
29
|
-
|
|
26
|
+
/** Initial page size: a number, or `"all"`. Default: 20. */
|
|
27
|
+
defaultPageSize?: number | "all";
|
|
28
|
+
/**
|
|
29
|
+
* Options of the per-page selector. `"all"` adds an option that requests
|
|
30
|
+
* the list without pagination params, like `clientSide` does: the backend
|
|
31
|
+
* has to return the whole collection then. Default: [10, 20, 50, 100].
|
|
32
|
+
*/
|
|
33
|
+
pageSizeOptions?: (number | "all")[];
|
|
30
34
|
/**
|
|
31
35
|
* Custom response parser. When provided it replaces the built-in DRF / flat-array
|
|
32
36
|
* detection. Return `{ items, total }` from any shape your backend returns.
|
|
@@ -52,6 +56,7 @@ declare const __VLS_export: <T extends object>(__VLS_props: NonNullable<Awaited<
|
|
|
52
56
|
* still hit the backend, then re-fetch. Ignored when `items` is provided.
|
|
53
57
|
*/
|
|
54
58
|
clientSide?: boolean;
|
|
59
|
+
/** Column definitions. A dotted `key` (`category.name`) reads a field of a related object. */
|
|
55
60
|
columns: ListColumn<T>[];
|
|
56
61
|
lookup?: string;
|
|
57
62
|
searchable?: boolean;
|
|
@@ -69,9 +74,9 @@ declare const __VLS_export: <T extends object>(__VLS_props: NonNullable<Awaited<
|
|
|
69
74
|
*/
|
|
70
75
|
permissionModel?: string;
|
|
71
76
|
} & {
|
|
72
|
-
"onUpdate:items"?: ((value: T[]) => any) | undefined;
|
|
73
77
|
"onUpdate:selection"?: ((value: "all" | T[]) => any) | undefined;
|
|
74
78
|
"onUpdate:selectionQuery"?: ((value: URLSearchParams) => any) | undefined;
|
|
79
|
+
"onUpdate:items"?: ((value: T[]) => any) | undefined;
|
|
75
80
|
}> & (typeof globalThis extends {
|
|
76
81
|
__VLS_PROPS_FALLBACK: infer P;
|
|
77
82
|
} ? P : {});
|
|
@@ -91,7 +96,7 @@ declare const __VLS_export: <T extends object>(__VLS_props: NonNullable<Awaited<
|
|
|
91
96
|
item: T;
|
|
92
97
|
value: T[K];
|
|
93
98
|
}) => any; };
|
|
94
|
-
emit: ((evt: "update:
|
|
99
|
+
emit: ((evt: "update:selection", value: "all" | T[]) => void) & ((evt: "update:selectionQuery", value: URLSearchParams) => void) & ((evt: "update:items", value: T[]) => void);
|
|
95
100
|
}>) => import("vue").VNode & {
|
|
96
101
|
__ctx?: Awaited<typeof __VLS_setup>;
|
|
97
102
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"MapoListTable.vue.d.ts","sourceRoot":"","sources":["../../../src/runtime/components/MapoListTable.vue"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"MapoListTable.vue.d.ts","sourceRoot":"","sources":["../../../src/runtime/components/MapoListTable.vue"],"names":[],"mappings":"AA2gCA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAC;AAKnD,OAAO,KAAK,EAAE,kBAA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,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;;+BApmCgB,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;;EAgmCT,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"}
|
|
@@ -8,8 +8,8 @@ type __VLS_Props = {
|
|
|
8
8
|
videoAutoplay?: boolean;
|
|
9
9
|
};
|
|
10
10
|
declare const __VLS_export: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {
|
|
11
|
-
contain: boolean;
|
|
12
11
|
size: "xs" | "sm" | "md" | "lg";
|
|
12
|
+
contain: boolean;
|
|
13
13
|
showFilename: boolean;
|
|
14
14
|
videoControls: boolean;
|
|
15
15
|
videoAutoplay: boolean;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"MapoMediaPreview.vue.d.ts","sourceRoot":"","sources":["../../../src/runtime/components/MapoMediaPreview.vue"],"names":[],"mappings":"AAmHA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,mBAAmB,CAAC;AAEnD,KAAK,WAAW,GAAG;IACf,KAAK,EAAE,SAAS,CAAC;IACjB,IAAI,CAAC,EAAE,IAAI,GAAG,IAAI,GAAG,IAAI,GAAG,IAAI,CAAC;IACjC,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,YAAY,CAAC,EAAE,OAAO,CAAC;IACvB,aAAa,CAAC,EAAE,OAAO,CAAC;IACxB,aAAa,CAAC,EAAE,OAAO,CAAC;CACzB,CAAC;AAoMJ,QAAA,MAAM,YAAY;
|
|
1
|
+
{"version":3,"file":"MapoMediaPreview.vue.d.ts","sourceRoot":"","sources":["../../../src/runtime/components/MapoMediaPreview.vue"],"names":[],"mappings":"AAmHA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,mBAAmB,CAAC;AAEnD,KAAK,WAAW,GAAG;IACf,KAAK,EAAE,SAAS,CAAC;IACjB,IAAI,CAAC,EAAE,IAAI,GAAG,IAAI,GAAG,IAAI,GAAG,IAAI,CAAC;IACjC,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,YAAY,CAAC,EAAE,OAAO,CAAC;IACvB,aAAa,CAAC,EAAE,OAAO,CAAC;IACxB,aAAa,CAAC,EAAE,OAAO,CAAC;CACzB,CAAC;AAoMJ,QAAA,MAAM,YAAY;UAzMP,IAAI,GAAG,IAAI,GAAG,IAAI,GAAG,IAAI;aACtB,OAAO;kBACF,OAAO;mBACN,OAAO;mBACP,OAAO;6EAwMzB,CAAC;wBACkB,OAAO,YAAY;AAAxC,wBAAyC"}
|
|
@@ -23,6 +23,11 @@ const canUpload = computed(
|
|
|
23
23
|
const pendingCount = computed(
|
|
24
24
|
() => entries.value.filter((e) => e.status === "pending").length
|
|
25
25
|
);
|
|
26
|
+
const textFields = computed(() => [
|
|
27
|
+
{ key: "title", label: t("mapo.title") },
|
|
28
|
+
{ key: "alt_text", label: t("mapo.altTag") },
|
|
29
|
+
{ key: "description", label: t("mapo.description") }
|
|
30
|
+
]);
|
|
26
31
|
const folderOptions = computed(() => [
|
|
27
32
|
{
|
|
28
33
|
label: store.parentFolder?.path ?? "/",
|
|
@@ -201,32 +206,27 @@ onUnmounted(clearAll);
|
|
|
201
206
|
</span>
|
|
202
207
|
</div>
|
|
203
208
|
|
|
204
|
-
<!-- Metadata inputs (only for pending)
|
|
209
|
+
<!-- Metadata inputs (only for pending). The inputs take their
|
|
210
|
+
size from UFormField. -->
|
|
205
211
|
<div
|
|
206
212
|
v-if="entry.status === 'pending'"
|
|
207
213
|
class="grid grid-cols-2 gap-1.5"
|
|
208
214
|
>
|
|
209
|
-
<
|
|
210
|
-
v-
|
|
211
|
-
|
|
212
|
-
:
|
|
213
|
-
/>
|
|
214
|
-
<UInput
|
|
215
|
-
v-model="entry.alt_text"
|
|
216
|
-
size="xs"
|
|
217
|
-
:placeholder="t('mapo.altTag')"
|
|
218
|
-
/>
|
|
219
|
-
<UInput
|
|
220
|
-
v-model="entry.description"
|
|
221
|
-
size="xs"
|
|
222
|
-
:placeholder="t('mapo.description')"
|
|
223
|
-
/>
|
|
224
|
-
<USelect
|
|
225
|
-
v-model="entry.folder"
|
|
226
|
-
:items="folderOptions"
|
|
215
|
+
<UFormField
|
|
216
|
+
v-for="field in textFields"
|
|
217
|
+
:key="field.key"
|
|
218
|
+
:label="field.label"
|
|
227
219
|
size="xs"
|
|
228
|
-
|
|
229
|
-
|
|
220
|
+
>
|
|
221
|
+
<UInput v-model="entry[field.key]" class="w-full" />
|
|
222
|
+
</UFormField>
|
|
223
|
+
<UFormField :label="t('mapo.folder')" size="xs">
|
|
224
|
+
<USelect
|
|
225
|
+
v-model="entry.folder"
|
|
226
|
+
:items="folderOptions"
|
|
227
|
+
class="w-full"
|
|
228
|
+
/>
|
|
229
|
+
</UFormField>
|
|
230
230
|
</div>
|
|
231
231
|
|
|
232
232
|
<!-- Progress bar -->
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"MapoMediaUploader.vue.d.ts","sourceRoot":"","sources":["../../../src/runtime/components/MapoMediaUploader.vue"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"MapoMediaUploader.vue.d.ts","sourceRoot":"","sources":["../../../src/runtime/components/MapoMediaUploader.vue"],"names":[],"mappings":"AAqiCA,QAAA,MAAM,YAAY;;;;iFAEhB,CAAC;wBACkB,OAAO,YAAY;AAAxC,wBAAyC"}
|
|
@@ -69,8 +69,8 @@ declare const __VLS_base: import("vue").DefineComponent<__VLS_Props, {}, {}, {},
|
|
|
69
69
|
"onUpdate:lang"?: ((lang: string) => any) | undefined;
|
|
70
70
|
}>, {
|
|
71
71
|
translatable: boolean;
|
|
72
|
-
languages: string[];
|
|
73
72
|
readonly: boolean;
|
|
73
|
+
languages: string[];
|
|
74
74
|
usePatch: boolean;
|
|
75
75
|
permissionModel: string;
|
|
76
76
|
modelValue: MapoMenu | null;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"MapoMenuManager.vue.d.ts","sourceRoot":"","sources":["../../../src/runtime/components/MapoMenuManager.vue"],"names":[],"mappings":"AAocA,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,wBAAwB,CAAC;AACjE,OAAO,EAEL,KAAK,QAAQ,EAEd,MAAM,kBAAkB,CAAC;AAI1B;;;;;;;;;;;;;;;;;GAiBG;AACH,KAAK,WAAW,GAAG;IACf,8CAA8C;IAC9C,QAAQ,EAAE,MAAM,CAAC;IACjB,+DAA+D;IAC/D,UAAU,CAAC,EAAE,MAAM,GAAG,MAAM,CAAC;IAC7B,sFAAsF;IACtF,UAAU,CAAC,EAAE,QAAQ,GAAG,IAAI,CAAC;IAC7B,8DAA8D;IAC9D,YAAY,CAAC,EAAE,OAAO,CAAC;IACvB,oFAAoF;IACpF,IAAI,CAAC,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AE;cAET,OAAO;qBAOA,MAAM;gBAfX,QAAQ,GAAG,IAAI;UAIrB,MAAM;cAMF,MAAM;gBASJ,kBAAkB,EAAE,GAAG,IAAI;sBAErB,kBAAkB,EAAE;sBAEpB,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC;gBAzB5B,MAAM,GAAG,MAAM;6EA6mB9B,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"}
|
|
@@ -41,8 +41,8 @@ declare const __VLS_base: import("vue").DefineComponent<__VLS_Props, {
|
|
|
41
41
|
"onUpdate:nodes"?: ((nodes: MenuTreeNode[]) => any) | undefined;
|
|
42
42
|
}>, {
|
|
43
43
|
title: string;
|
|
44
|
-
loading: boolean;
|
|
45
44
|
readonly: boolean;
|
|
45
|
+
loading: boolean;
|
|
46
46
|
modelValue: MenuTreeNode | null;
|
|
47
47
|
maxDepth: number;
|
|
48
48
|
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"MapoMenuTreeview.vue.d.ts","sourceRoot":"","sources":["../../../src/runtime/components/MapoMenuTreeview.vue"],"names":[],"mappings":"AAiRA,OAAO,EAIL,KAAK,YAAY,EAClB,MAAM,kBAAkB,CAAC;AAI1B;;;;;;GAMG;AACH,KAAK,WAAW,GAAG;IACf,KAAK,EAAE,YAAY,EAAE,CAAC;IACtB,yCAAyC;IACzC,UAAU,CAAC,EAAE,YAAY,GAAG,IAAI,CAAC;IACjC,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,2CAA2C;IAC3C,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,QAAQ,CAA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D,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"}
|
|
@@ -9,16 +9,16 @@ declare const __VLS_export: import("vue").DefineComponent<{
|
|
|
9
9
|
}, {
|
|
10
10
|
openIfChild: (child: MenuTreeNode) => void;
|
|
11
11
|
}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
12
|
-
delete: (node: MenuTreeNode) => any;
|
|
13
12
|
select: (node: MenuTreeNode) => any;
|
|
13
|
+
delete: (node: MenuTreeNode) => any;
|
|
14
14
|
}, string, import("vue").PublicProps, Readonly<{
|
|
15
15
|
node: MenuTreeNode;
|
|
16
16
|
depth?: number;
|
|
17
17
|
selectedId?: string | number | null;
|
|
18
18
|
readonly?: boolean;
|
|
19
19
|
}> & Readonly<{
|
|
20
|
-
onDelete?: ((node: MenuTreeNode) => any) | undefined;
|
|
21
20
|
onSelect?: ((node: MenuTreeNode) => any) | undefined;
|
|
21
|
+
onDelete?: ((node: MenuTreeNode) => any) | undefined;
|
|
22
22
|
}>, {
|
|
23
23
|
readonly: boolean;
|
|
24
24
|
depth: number;
|
|
@@ -10,6 +10,8 @@ declare module "#app" {
|
|
|
10
10
|
parent?: string;
|
|
11
11
|
/** Pin this page to the sidebar footer instead of the main navigation list. */
|
|
12
12
|
sidebarFooter?: boolean;
|
|
13
|
+
/** Sort this page among siblings in the sidebar; lower values appear first. */
|
|
14
|
+
sidebarOrder?: number;
|
|
13
15
|
}
|
|
14
16
|
}
|
|
15
17
|
|
|
@@ -29,6 +31,8 @@ declare module "vue-router" {
|
|
|
29
31
|
parent?: string;
|
|
30
32
|
/** Pin this page to the sidebar footer instead of the main navigation list. */
|
|
31
33
|
sidebarFooter?: boolean;
|
|
34
|
+
/** Sort this page among siblings in the sidebar; lower values appear first. */
|
|
35
|
+
sidebarOrder?: number;
|
|
32
36
|
}
|
|
33
37
|
}
|
|
34
38
|
|
|
@@ -154,7 +154,7 @@ export declare const useMediaStore: import("pinia").StoreDefinition<"mapo-media"
|
|
|
154
154
|
setMimeType: (mime: string | null) => void;
|
|
155
155
|
lockMimeType: (mime: string | null) => void;
|
|
156
156
|
reset: () => void;
|
|
157
|
-
}, "pages" | "page" | "
|
|
157
|
+
}, "pages" | "page" | "languages" | "loading" | "medias" | "folders" | "parentFolders" | "mimeType" | "lockedMime" | "editMedia" | "selection" | "editList" | "selectMode">, Pick<{
|
|
158
158
|
medias: import("vue").Ref<{
|
|
159
159
|
id: number;
|
|
160
160
|
file: string;
|
|
@@ -464,5 +464,5 @@ export declare const useMediaStore: import("pinia").StoreDefinition<"mapo-media"
|
|
|
464
464
|
setMimeType: (mime: string | null) => void;
|
|
465
465
|
lockMimeType: (mime: string | null) => void;
|
|
466
466
|
reset: () => void;
|
|
467
|
-
}, "getRoot" | "deriveLanguages" | "navigateToFolder" | "openEditor" | "closeEditor" | "setLang" | "updateMedia" | "replaceFile" | "updateOrCreateFolder" | "deleteFolder" | "deleteMedia" | "
|
|
467
|
+
}, "select" | "reset" | "getRoot" | "deriveLanguages" | "navigateToFolder" | "openEditor" | "closeEditor" | "setLang" | "updateMedia" | "replaceFile" | "updateOrCreateFolder" | "deleteFolder" | "deleteMedia" | "setSelectionMode" | "setSelection" | "editSelect" | "editSelectAll" | "deleteSelected" | "uploadMedia" | "setMimeType" | "lockMimeType">>;
|
|
468
468
|
//# sourceMappingURL=media.d.ts.map
|
|
@@ -1,8 +1,16 @@
|
|
|
1
1
|
/** Defines a single column in the list table. */
|
|
2
2
|
export interface ListColumn<T = Record<string, unknown>> {
|
|
3
|
-
/**
|
|
4
|
-
|
|
3
|
+
/**
|
|
4
|
+
* Property of the row to show, a key of `T`. A dotted path (`category.name`)
|
|
5
|
+
* reads a field of a related object; it starts with a key of `T`.
|
|
6
|
+
*/
|
|
7
|
+
key: (keyof T & string) | `${keyof T & string}.${string}`;
|
|
5
8
|
label: string;
|
|
9
|
+
/**
|
|
10
|
+
* Turns the header into a button that cycles ascending, descending and
|
|
11
|
+
* unsorted. The list sends the order to the backend as `ordering`, or sorts
|
|
12
|
+
* in memory in offline and hybrid mode.
|
|
13
|
+
*/
|
|
6
14
|
sortable?: boolean;
|
|
7
15
|
/** CSS class applied to the `<td>` cell. */
|
|
8
16
|
class?: string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"list.d.ts","sourceRoot":"","sources":["../../../src/runtime/types/list.ts"],"names":[],"mappings":"AAAA,iDAAiD;AACjD,MAAM,WAAW,UAAU,CAAC,CAAC,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC;IACrD
|
|
1
|
+
{"version":3,"file":"list.d.ts","sourceRoot":"","sources":["../../../src/runtime/types/list.ts"],"names":[],"mappings":"AAAA,iDAAiD;AACjD,MAAM,WAAW,UAAU,CAAC,CAAC,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC;IACrD;;;OAGG;IACH,GAAG,EAAE,CAAC,MAAM,CAAC,GAAG,MAAM,CAAC,GAAG,GAAG,MAAM,CAAC,GAAG,MAAM,IAAI,MAAM,EAAE,CAAC;IAC1D,KAAK,EAAE,MAAM,CAAC;IACd;;;;OAIG;IACH,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,4CAA4C;IAC5C,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB;AAED,2DAA2D;AAC3D,MAAM,WAAW,YAAY;IAC3B,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,EAAE,OAAO,CAAC;IACf,IAAI,CAAC,EAAE,MAAM,CAAC;CACf;AAED,kEAAkE;AAClE,MAAM,WAAW,gBAAgB;IAC/B,kFAAkF;IAClF,KAAK,EAAE,MAAM,CAAC;IACd,8CAA8C;IAC9C,IAAI,EAAE,MAAM,CAAC;IACb,OAAO,CAAC,EAAE,YAAY,EAAE,CAAC;IACzB,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,mGAAmG;IACnG,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,iGAAiG;IACjG,aAAa,CAAC,EAAE,MAAM,CAAC;CACxB;AAED,mEAAmE;AACnE,MAAM,WAAW,YAAa,SAAQ,gBAAgB;IACpD,MAAM,EAAE,YAAY,EAAE,CAAC;IACvB,KAAK,CAAC,EAAE,MAAM,EAAE,CAAC;CAClB;AAED,+CAA+C;AAC/C,MAAM,WAAW,aAAa,CAAC,CAAC,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC;IACxD,4EAA4E;IAC5E,SAAS,EAAE,CAAC,EAAE,GAAG,IAAI,CAAC;IACtB,cAAc,EAAE,eAAe,CAAC;IAChC,MAAM,EAAE,MAAM,CAAC;CAChB;AAED,qEAAqE;AACrE,MAAM,WAAW,gBAAgB,CAAC,CAAC,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC;IAC3D,KAAK,EAAE,MAAM,CAAC;IACd,OAAO,EAAE,CAAC,GAAG,EAAE,aAAa,CAAC,CAAC,CAAC,KAAK,OAAO,CAAC,OAAO,CAAC,CAAC;IACrD,WAAW,CAAC,EAAE,MAAM,GAAG,MAAM,EAAE,CAAC;IAChC,8EAA8E;IAC9E,cAAc,CAAC,EAAE,OAAO,CAAC;IACzB,kFAAkF;IAClF,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,wFAAwF;IACxF,SAAS,CAAC,EAAE,OAAO,CAAC;CACrB;AAED,6EAA6E;AAC7E,MAAM,WAAW,WAAW;IAC1B,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,EAAE,MAAM,CAAC;IACd,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB"}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
/** One sort key as `UTable` holds it: the column id and the direction. */
|
|
2
|
+
export interface TableSort {
|
|
3
|
+
id: string;
|
|
4
|
+
desc: boolean;
|
|
5
|
+
}
|
|
6
|
+
/**
|
|
7
|
+
* The page size that stands for "all rows". A plain number, so the paging
|
|
8
|
+
* arithmetic and the in-memory slicing keep working unchanged.
|
|
9
|
+
*/
|
|
10
|
+
export declare const ALL_ROWS: number;
|
|
11
|
+
/** A `pageSizeOptions` entry as the table stores it: `"all"` → {@link ALL_ROWS}. */
|
|
12
|
+
export declare function toPageSize(option: number | "all"): number;
|
|
13
|
+
/** Reads `page_size` from the URL: `all`, or a positive number, else `fallback`. */
|
|
14
|
+
export declare function parsePageSize(value: unknown, fallback: number): number;
|
|
15
|
+
/** Writes a page size to the URL: {@link ALL_ROWS} as `all`. */
|
|
16
|
+
export declare function formatPageSize(size: number): string;
|
|
17
|
+
/**
|
|
18
|
+
* The sorting after a click on a sortable header. The column goes from
|
|
19
|
+
* unsorted to ascending, to descending, and back to unsorted, so the natural
|
|
20
|
+
* order (needed by drag reorder) is one click away. It replaces any other key.
|
|
21
|
+
*/
|
|
22
|
+
export declare function nextSorting(sorting: TableSort[], columnId: string): TableSort[];
|
|
23
|
+
/**
|
|
24
|
+
* The `ordering` param for a sorting: comma-separated keys, `-` for descending.
|
|
25
|
+
* A dotted key becomes a Django lookup (`category.name` → `category__name`),
|
|
26
|
+
* the way DRF's OrderingFilter reaches a field of a related object.
|
|
27
|
+
*/
|
|
28
|
+
export declare function orderingParam(sorting: TableSort[]): string;
|
|
29
|
+
//# sourceMappingURL=listTable.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"listTable.d.ts","sourceRoot":"","sources":["../../../src/runtime/utils/listTable.ts"],"names":[],"mappings":"AAAA,0EAA0E;AAC1E,MAAM,WAAW,SAAS;IACxB,EAAE,EAAE,MAAM,CAAC;IACX,IAAI,EAAE,OAAO,CAAC;CACf;AAED;;;GAGG;AACH,eAAO,MAAM,QAAQ,QAA0B,CAAC;AAEhD,oFAAoF;AACpF,wBAAgB,UAAU,CAAC,MAAM,EAAE,MAAM,GAAG,KAAK,GAAG,MAAM,CAEzD;AAED,oFAAoF;AACpF,wBAAgB,aAAa,CAAC,KAAK,EAAE,OAAO,EAAE,QAAQ,EAAE,MAAM,GAAG,MAAM,CAItE;AAED,gEAAgE;AAChE,wBAAgB,cAAc,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CAEnD;AAED;;;;GAIG;AACH,wBAAgB,WAAW,CACzB,OAAO,EAAE,SAAS,EAAE,EACpB,QAAQ,EAAE,MAAM,GACf,SAAS,EAAE,CAKb;AAED;;;;GAIG;AACH,wBAAgB,aAAa,CAAC,OAAO,EAAE,SAAS,EAAE,GAAG,MAAM,CAI1D"}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
export const ALL_ROWS = Number.MAX_SAFE_INTEGER;
|
|
2
|
+
export function toPageSize(option) {
|
|
3
|
+
return option === "all" ? ALL_ROWS : option;
|
|
4
|
+
}
|
|
5
|
+
export function parsePageSize(value, fallback) {
|
|
6
|
+
if (value === "all") return ALL_ROWS;
|
|
7
|
+
const size = Number(value);
|
|
8
|
+
return Number.isFinite(size) && size > 0 ? size : fallback;
|
|
9
|
+
}
|
|
10
|
+
export function formatPageSize(size) {
|
|
11
|
+
return size === ALL_ROWS ? "all" : String(size);
|
|
12
|
+
}
|
|
13
|
+
export function nextSorting(sorting, columnId) {
|
|
14
|
+
const current = sorting.find((sort) => sort.id === columnId);
|
|
15
|
+
if (!current) return [{ id: columnId, desc: false }];
|
|
16
|
+
if (!current.desc) return [{ id: columnId, desc: true }];
|
|
17
|
+
return [];
|
|
18
|
+
}
|
|
19
|
+
export function orderingParam(sorting) {
|
|
20
|
+
return sorting.map((sort) => `${sort.desc ? "-" : ""}${sort.id.split(".").join("__")}`).join(",");
|
|
21
|
+
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@mapomodule/uikit",
|
|
3
|
-
"version": "2.0.0-beta.
|
|
3
|
+
"version": "2.0.0-beta.15",
|
|
4
4
|
"description": "Mapo UI components: Sidebar, Topbar, Login, SnackBar, ConfirmDialog, List, Detail, Media",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"license": "MIT",
|
|
@@ -45,14 +45,14 @@
|
|
|
45
45
|
"lint": "eslint src"
|
|
46
46
|
},
|
|
47
47
|
"dependencies": {
|
|
48
|
-
"@mapomodule/form": "2.0.0-beta.
|
|
49
|
-
"@mapomodule/i18n": "2.0.0-beta.
|
|
48
|
+
"@mapomodule/form": "2.0.0-beta.12",
|
|
49
|
+
"@mapomodule/i18n": "2.0.0-beta.4",
|
|
50
50
|
"@mapomodule/store": "2.0.0-beta.6",
|
|
51
|
-
"@mapomodule/utils": "2.0.0-beta.
|
|
52
|
-
"@mapomodule/core": "2.0.0-beta.
|
|
51
|
+
"@mapomodule/utils": "2.0.0-beta.7",
|
|
52
|
+
"@mapomodule/core": "2.0.0-beta.11",
|
|
53
53
|
"tailwindcss": "^4.0.0",
|
|
54
54
|
"vue-draggable-plus": "^0.6.0",
|
|
55
|
-
"vue-i18n": "^11.4.
|
|
55
|
+
"vue-i18n": "^11.4.8"
|
|
56
56
|
},
|
|
57
57
|
"peerDependencies": {
|
|
58
58
|
"@nuxt/ui": ">=4.0.0",
|