diff --git a/src/components/v-table/table-header/table-header.vue b/src/components/v-table/table-header/table-header.vue index a6716f4394..e99c1f19ed 100644 --- a/src/components/v-table/table-header/table-header.vue +++ b/src/components/v-table/table-header/table-header.vue @@ -289,7 +289,7 @@ export default defineComponent({ padding-right: 0; } - .fixed th { + .fixed { position: sticky; top: var(--v-table-sticky-offset-top); z-index: 2; diff --git a/src/components/v-table/v-table.vue b/src/components/v-table/v-table.vue index 043c6ef97d..c6ff1ee162 100644 --- a/src/components/v-table/v-table.vue +++ b/src/components/v-table/v-table.vue @@ -341,6 +341,10 @@ export default defineComponent({ } ::v-deep { + thead { + display: contents; + } + tr { display: grid; grid-template-columns: var(--grid-columns); diff --git a/src/compositions/use-collection-preset/use-collection-preset.ts b/src/compositions/use-collection-preset/use-collection-preset.ts index f17e98eeb0..d67b8703ad 100644 --- a/src/compositions/use-collection-preset/use-collection-preset.ts +++ b/src/compositions/use-collection-preset/use-collection-preset.ts @@ -50,6 +50,19 @@ export function useCollectionPreset(collection: Ref) { }, }); + const viewType = computed({ + get() { + return localPreset.value.view_type || 'tabular'; + }, + set(val) { + localPreset.value = { + ...localPreset.value, + view_type: val, + }; + savePreset(localPreset.value); + }, + }); + const filters = computed({ get() { return localPreset.value.filters || []; @@ -63,5 +76,5 @@ export function useCollectionPreset(collection: Ref) { }, }); - return { viewOptions, viewQuery, filters }; + return { viewType, viewOptions, viewQuery, filters }; } diff --git a/src/lang/en-US/index.json b/src/lang/en-US/index.json index 7c29cc2011..249eabd133 100644 --- a/src/lang/en-US/index.json +++ b/src/lang/en-US/index.json @@ -222,6 +222,7 @@ "upload_file_indeterminate": "Uploading File | Uploading files {done}/{total}", "upload_file_success": "File Uploaded | {count} Files Uploaded", "upload_file_failed": "Couldn't Upload File | Couldn't Upload Files", + "view_type": "View As...", "about_directus": "About Directus", "activity_log": "Activity Log", @@ -677,7 +678,6 @@ "values": "Values", "version": "Version", "version_and_updates": "Version and Updates", - "view_type": "View As...", "visible_all_users": "Visible for all users", "webhook_count": "No Webhooks | 1 Webhook | {count} Webhooks", "weeks": { diff --git a/src/layouts/tabular/index.ts b/src/layouts/tabular/index.ts index 7eade0c57b..3701d7cb12 100644 --- a/src/layouts/tabular/index.ts +++ b/src/layouts/tabular/index.ts @@ -4,6 +4,6 @@ import TabularLayout from './tabular.vue'; export default defineLayout(({ i18n }) => ({ id: 'tabular', name: i18n.t('layouts.tabular.tabular'), - icon: 'table', + icon: 'reorder', component: TabularLayout, })); diff --git a/src/modules/collections/routes/browse/browse.vue b/src/modules/collections/routes/browse/browse.vue index c842b44d52..9bd7a1f71a 100644 --- a/src/modules/collections/routes/browse/browse.vue +++ b/src/modules/collections/routes/browse/browse.vue @@ -8,6 +8,7 @@ @@ -53,9 +54,10 @@ - { const collectionsStore = useCollectionsStore(); @@ -115,7 +118,12 @@ export default defineComponent({ beforeRouteEnter: redirectIfNeeded, beforeRouteUpdate: redirectIfNeeded, name: 'collections-browse', - components: { CollectionsNavigation, CollectionsNotFound, FilterDrawerDetail }, + components: { + CollectionsNavigation, + CollectionsNotFound, + FilterDrawerDetail, + LayoutDrawerDetail, + }, props: { collection: { type: String, @@ -132,22 +140,23 @@ export default defineComponent({ const { selection } = useSelection(); const { info: currentCollection, primaryKeyField } = useCollection(collection); const { addNewLink, batchLink, collectionsLink } = useLinks(); - const { viewOptions, viewQuery, filters } = useCollectionPreset(collection); + const { viewType, viewOptions, viewQuery, filters } = useCollectionPreset(collection); const { confirmDelete, deleting, batchDelete } = useBatchDelete(); return { - currentCollection, addNewLink, - batchLink, - selection, - confirmDelete, batchDelete, + batchLink, + collectionsLink, + confirmDelete, + currentCollection, deleting, + filters, layout, + selection, viewOptions, viewQuery, - collectionsLink, - filters, + viewType, }; function useSelection() { diff --git a/src/modules/files/routes/browse/browse.vue b/src/modules/files/routes/browse/browse.vue index ca6b2a3b03..a663a8a599 100644 --- a/src/modules/files/routes/browse/browse.vue +++ b/src/modules/files/routes/browse/browse.vue @@ -7,6 +7,7 @@ @@ -52,9 +53,10 @@ - (null); @@ -90,23 +93,26 @@ export default defineComponent({ const selection = ref([]); - const { viewOptions, viewQuery, filters } = useCollectionPreset(ref('directus_files')); + const { viewType, viewOptions, viewQuery, filters } = useCollectionPreset( + ref('directus_files') + ); const { addNewLink, batchLink } = useLinks(); const { confirmDelete, deleting, batchDelete } = useBatchDelete(); const { breadcrumb } = useBreadcrumb(); return { addNewLink, + batchDelete, batchLink, - selection, breadcrumb, confirmDelete, - batchDelete, deleting, + filters, layout, + selection, viewOptions, viewQuery, - filters, + viewType, }; function useBatchDelete() { diff --git a/src/modules/users/routes/browse/browse.vue b/src/modules/users/routes/browse/browse.vue index d35bafb172..2a559bb146 100644 --- a/src/modules/users/routes/browse/browse.vue +++ b/src/modules/users/routes/browse/browse.vue @@ -7,6 +7,7 @@ @@ -52,9 +53,10 @@ - ([]); - const { viewOptions, viewQuery, filters } = useCollectionPreset(ref('directus_users')); + const { viewType, viewOptions, viewQuery, filters } = useCollectionPreset( + ref('directus_users') + ); const { addNewLink, batchLink } = useLinks(); const { confirmDelete, deleting, batchDelete } = useBatchDelete(); const { breadcrumb } = useBreadcrumb(); @@ -129,18 +134,19 @@ export default defineComponent({ }); return { + _filters, addNewLink, + batchDelete, batchLink, - selection, breadcrumb, confirmDelete, - batchDelete, deleting, + filters, layout, + selection, viewOptions, viewQuery, - _filters, - filters, + viewType, }; function useBatchDelete() { diff --git a/src/views/private/components/layout-drawer-detail/index.ts b/src/views/private/components/layout-drawer-detail/index.ts new file mode 100644 index 0000000000..ae9cf53b4d --- /dev/null +++ b/src/views/private/components/layout-drawer-detail/index.ts @@ -0,0 +1,4 @@ +import LayoutDrawerDetail from './layout-drawer-detail.vue'; + +export { LayoutDrawerDetail }; +export default LayoutDrawerDetail; diff --git a/src/views/private/components/layout-drawer-detail/layout-drawer-detail.vue b/src/views/private/components/layout-drawer-detail/layout-drawer-detail.vue new file mode 100644 index 0000000000..b0762f9276 --- /dev/null +++ b/src/views/private/components/layout-drawer-detail/layout-drawer-detail.vue @@ -0,0 +1,39 @@ + + +