mirror of
https://github.com/directus/directus.git
synced 2026-04-25 03:00:53 -04:00
move meta+a to layout
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
<template>
|
||||
<div class="v-table" :class="{ loading, inline, disabled }" ref="table">
|
||||
<div class="v-table" :class="{ loading, inline, disabled }">
|
||||
<table
|
||||
:summary="_headers.map((header) => header.text).join(', ')"
|
||||
:style="{
|
||||
@@ -86,7 +86,6 @@ import { sortBy, clone, forEach, pick } from 'lodash';
|
||||
import { i18n } from '@/lang/';
|
||||
import draggable from 'vuedraggable';
|
||||
import hideDragImage from '@/utils/hide-drag-image';
|
||||
import useShortcut from '@/composables/use-shortcut';
|
||||
|
||||
const HeaderDefaults: Header = {
|
||||
text: '',
|
||||
@@ -185,8 +184,6 @@ export default defineComponent({
|
||||
},
|
||||
},
|
||||
setup(props, { emit, listeners, slots }) {
|
||||
const table = ref<HTMLElement | null>(null);
|
||||
|
||||
const _headers = computed({
|
||||
get: () => {
|
||||
return props.headers
|
||||
@@ -294,14 +291,6 @@ export default defineComponent({
|
||||
return gridTemplateColumns;
|
||||
});
|
||||
|
||||
useShortcut(
|
||||
'meta+a',
|
||||
() => {
|
||||
onToggleSelectAll(!allItemsSelected.value);
|
||||
},
|
||||
table
|
||||
);
|
||||
|
||||
return {
|
||||
_headers,
|
||||
_items,
|
||||
@@ -317,7 +306,6 @@ export default defineComponent({
|
||||
columnStyle,
|
||||
hasItemAppendSlot,
|
||||
hideDragImage,
|
||||
table,
|
||||
};
|
||||
|
||||
function onItemSelected(event: ItemSelectEvent) {
|
||||
|
||||
@@ -149,13 +149,14 @@ import { HeaderRaw, Item } from '@/components/v-table/types';
|
||||
import { Field, Filter } from '@/types';
|
||||
import router from '@/router';
|
||||
import useSync from '@/composables/use-sync';
|
||||
import { debounce } from 'lodash';
|
||||
import { debounce, clone } from 'lodash';
|
||||
import Draggable from 'vuedraggable';
|
||||
import useCollection from '@/composables/use-collection';
|
||||
import useItems from '@/composables/use-items';
|
||||
import i18n from '@/lang';
|
||||
import adjustFieldsForDisplays from '@/utils/adjust-fields-for-displays';
|
||||
import hideDragImage from '@/utils/hide-drag-image';
|
||||
import useShortcut from '@/composables/use-shortcut';
|
||||
|
||||
type layoutOptions = {
|
||||
widths?: {
|
||||
@@ -260,6 +261,14 @@ export default defineComponent({
|
||||
return count;
|
||||
});
|
||||
|
||||
useShortcut(
|
||||
'meta+a',
|
||||
() => {
|
||||
_selection.value = clone(items.value).map((item: any) => item[primaryKeyField.value.field]);
|
||||
},
|
||||
table
|
||||
);
|
||||
|
||||
return {
|
||||
_selection,
|
||||
table,
|
||||
|
||||
Reference in New Issue
Block a user