mirror of
https://github.com/DeNNiiInc/dbgate.git
synced 2026-04-21 21:06:00 +00:00
show sort in perspective deisgner and tree
This commit is contained in:
@@ -6,6 +6,7 @@
|
||||
import CheckboxField from '../forms/CheckboxField.svelte';
|
||||
import FontIcon from '../icons/FontIcon.svelte';
|
||||
import contextMenu from '../utility/contextMenu';
|
||||
import SortOrderIcon from './SortOrderIcon.svelte';
|
||||
export let column;
|
||||
export let table;
|
||||
export let designer;
|
||||
@@ -25,6 +26,16 @@
|
||||
|
||||
function createMenu() {
|
||||
const foreignKey = findForeignKeyForColumn(table, column);
|
||||
|
||||
if (settings?.columnMenu) {
|
||||
return settings?.columnMenu({
|
||||
designer,
|
||||
designerId,
|
||||
column,
|
||||
foreignKey,
|
||||
});
|
||||
}
|
||||
|
||||
const setSortOrder = sortOrder => {
|
||||
onChangeColumn(
|
||||
{
|
||||
@@ -47,6 +58,8 @@
|
||||
foreignKey && { text: 'Add reference', onClick: addReference },
|
||||
];
|
||||
}
|
||||
|
||||
$: sortOrderProps = settings?.getSortOrderProps ? settings?.getSortOrderProps(designerId, column.columnName) : null;
|
||||
</script>
|
||||
|
||||
<div
|
||||
@@ -144,6 +157,10 @@
|
||||
<FontIcon icon="img group" />
|
||||
{/if}
|
||||
|
||||
{#if sortOrderProps}
|
||||
<SortOrderIcon {...sortOrderProps} />
|
||||
{/if}
|
||||
|
||||
{#if designer?.style?.showNullability || designer?.style?.showDataType}
|
||||
<div class="space" />
|
||||
{#if designer?.style?.showDataType && column?.dataType}
|
||||
|
||||
Reference in New Issue
Block a user