@sfxcode/nuxt-ui-mongocamp 1.5.3 → 1.5.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/module.json
CHANGED
|
@@ -5,6 +5,8 @@ type __VLS_Props = {
|
|
|
5
5
|
persistState?: boolean;
|
|
6
6
|
stateKey?: string;
|
|
7
7
|
hideRefresh?: boolean;
|
|
8
|
+
stickyActions?: boolean;
|
|
9
|
+
stickyId?: boolean;
|
|
8
10
|
};
|
|
9
11
|
declare function init(): Promise<void>;
|
|
10
12
|
declare const __VLS_template: () => {
|
|
@@ -24,6 +26,8 @@ declare const __VLS_base: import("vue").DefineComponent<__VLS_Props, {
|
|
|
24
26
|
aggregatePath: string;
|
|
25
27
|
persistState: boolean;
|
|
26
28
|
stateKey: string;
|
|
29
|
+
stickyActions: boolean;
|
|
30
|
+
stickyId: boolean;
|
|
27
31
|
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
28
32
|
declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
|
|
29
33
|
declare const _default: typeof __VLS_export;
|
|
@@ -34,7 +34,9 @@ const props = defineProps({
|
|
|
34
34
|
aggregatePath: { type: String, required: false, default: "" },
|
|
35
35
|
persistState: { type: Boolean, required: false, default: true },
|
|
36
36
|
stateKey: { type: String, required: false, default: "" },
|
|
37
|
-
hideRefresh: { type: Boolean, required: false, default: false }
|
|
37
|
+
hideRefresh: { type: Boolean, required: false, default: false },
|
|
38
|
+
stickyActions: { type: Boolean, required: false, default: true },
|
|
39
|
+
stickyId: { type: Boolean, required: false, default: false }
|
|
38
40
|
});
|
|
39
41
|
const emit = defineEmits(["changed"]);
|
|
40
42
|
const { t } = useI18n();
|
|
@@ -326,6 +328,17 @@ function columnHeader(column, key) {
|
|
|
326
328
|
]);
|
|
327
329
|
}
|
|
328
330
|
const columns = ref([]);
|
|
331
|
+
const STICKY_ACTIONS = "sticky right-0 z-10 bg-default";
|
|
332
|
+
const STICKY_ID = "sticky left-0 z-10 bg-default";
|
|
333
|
+
const tableColumns = computed(() => {
|
|
334
|
+
if (!props.stickyActions && !props.stickyId) return columns.value;
|
|
335
|
+
const firstData = columns.value.find((column) => "accessorKey" in column);
|
|
336
|
+
return columns.value.map((column) => {
|
|
337
|
+
if (props.stickyActions && column.id === "actions") return { ...column, meta: { class: { th: STICKY_ACTIONS, td: STICKY_ACTIONS } } };
|
|
338
|
+
if (props.stickyId && column === firstData) return { ...column, meta: { class: { th: STICKY_ID, td: STICKY_ID } } };
|
|
339
|
+
return column;
|
|
340
|
+
});
|
|
341
|
+
});
|
|
329
342
|
const documents = ref([]);
|
|
330
343
|
const loading = ref(false);
|
|
331
344
|
const filterText = ref("");
|
|
@@ -673,12 +686,10 @@ async function fetchDocuments() {
|
|
|
673
686
|
...keys.filter((k) => k !== "_id" && k !== "metaData").sort(),
|
|
674
687
|
...keys.filter((k) => k === "metaData")
|
|
675
688
|
];
|
|
676
|
-
columns.value = orderedKeys.map((key
|
|
689
|
+
columns.value = orderedKeys.map((key) => ({
|
|
677
690
|
accessorKey: key,
|
|
678
691
|
header: ({ column }) => columnHeader(column, key),
|
|
679
|
-
cell: makeCell(key, "string")
|
|
680
|
-
// keep the first column (usually _id) pinned so rows stay identifiable when the table scrolls sideways
|
|
681
|
-
...index === 0 ? { meta: { class: { th: "sticky left-0 z-10 bg-default", td: "sticky left-0 z-10 bg-default" } } } : {}
|
|
692
|
+
cell: makeCell(key, "string")
|
|
682
693
|
}));
|
|
683
694
|
filterableColumns.value = orderedKeys.filter((k) => k !== "_id" && k !== "metaData" && typeof firstRow[k] === "string");
|
|
684
695
|
pageFilterFields.value = schemaFromSamples(rows.map((row) => unwrapExtendedJson(row, { exactLongs: false }))).map((c) => ({ key: c.columnKey, type: c.columnKey === "_id" ? "objectId" : toFilterFieldType(c.columnType) })).filter((f) => operatorsFor(f.type).length > 0);
|
|
@@ -1036,7 +1047,7 @@ defineExpose({ refresh: init });
|
|
|
1036
1047
|
:get-row-id="rowId"
|
|
1037
1048
|
:sorting-options="{ manualSorting: true }"
|
|
1038
1049
|
:data="documents"
|
|
1039
|
-
:columns="
|
|
1050
|
+
:columns="tableColumns"
|
|
1040
1051
|
:loading="loading"
|
|
1041
1052
|
>
|
|
1042
1053
|
<template #empty>
|
|
@@ -5,6 +5,8 @@ type __VLS_Props = {
|
|
|
5
5
|
persistState?: boolean;
|
|
6
6
|
stateKey?: string;
|
|
7
7
|
hideRefresh?: boolean;
|
|
8
|
+
stickyActions?: boolean;
|
|
9
|
+
stickyId?: boolean;
|
|
8
10
|
};
|
|
9
11
|
declare function init(): Promise<void>;
|
|
10
12
|
declare const __VLS_template: () => {
|
|
@@ -24,6 +26,8 @@ declare const __VLS_base: import("vue").DefineComponent<__VLS_Props, {
|
|
|
24
26
|
aggregatePath: string;
|
|
25
27
|
persistState: boolean;
|
|
26
28
|
stateKey: string;
|
|
29
|
+
stickyActions: boolean;
|
|
30
|
+
stickyId: boolean;
|
|
27
31
|
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
28
32
|
declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
|
|
29
33
|
declare const _default: typeof __VLS_export;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@sfxcode/nuxt-ui-mongocamp",
|
|
3
|
-
"version": "1.5.
|
|
3
|
+
"version": "1.5.4",
|
|
4
4
|
"description": "A Nuxt module that wraps @sfxcode/nuxt-mongocamp-server with ready-made UI components, composables, and a runtime plugin",
|
|
5
5
|
"repository": "sfxcode/nuxt-ui-mongocamp",
|
|
6
6
|
"homepage": "https://sfxcode.github.io/nuxt-ui-mongocamp/",
|
|
@@ -82,12 +82,12 @@
|
|
|
82
82
|
"@nuxt/module-builder": "^1.0.4",
|
|
83
83
|
"@nuxt/schema": "^4.6.4",
|
|
84
84
|
"@nuxt/test-utils": "^4.4.0",
|
|
85
|
-
"@playwright/test": "^1.65.
|
|
85
|
+
"@playwright/test": "^1.65.1",
|
|
86
86
|
"@types/node": "latest",
|
|
87
87
|
"@unhead/vue": "^3.4.3",
|
|
88
88
|
"@vue/test-utils": "^2.5.1",
|
|
89
89
|
"changelogen": "^0.6.2",
|
|
90
|
-
"eslint": "^10.
|
|
90
|
+
"eslint": "^10.15.0",
|
|
91
91
|
"happy-dom": "^21.0.4",
|
|
92
92
|
"nuxt": "^4.6.4",
|
|
93
93
|
"typescript": "~6.0.3",
|