mirror of
https://github.com/DeNNiiInc/dbgate.git
synced 2026-04-21 01:16:01 +00:00
export menu refactor
This commit is contained in:
@@ -23,23 +23,21 @@
|
||||
import ToolStripCommandButton from './ToolStripCommandButton.svelte';
|
||||
import ToolStripDropDownButton from './ToolStripDropDownButton.svelte';
|
||||
|
||||
const electron = getElectron();
|
||||
|
||||
export let quickExportHandlerRef = null;
|
||||
export let command = 'sqlDataGrid.export';
|
||||
export let label = 'Advanced settings';
|
||||
export let label = 'Export';
|
||||
|
||||
function getExportMenu() {
|
||||
return [
|
||||
quickExportHandlerRef?.value ? createQuickExportMenuItems(quickExportHandlerRef?.value) : null,
|
||||
{ divider: true },
|
||||
{ command, text: label },
|
||||
quickExportHandlerRef?.value
|
||||
? createQuickExportMenuItems(quickExportHandlerRef?.value, { command })
|
||||
: { command },
|
||||
];
|
||||
}
|
||||
</script>
|
||||
|
||||
{#if quickExportHandlerRef && electron}
|
||||
<ToolStripDropDownButton menu={getExportMenu} label="Export" icon="icon export" />
|
||||
{#if quickExportHandlerRef}
|
||||
<ToolStripDropDownButton menu={getExportMenu} {label} icon="icon export" />
|
||||
{:else}
|
||||
<ToolStripCommandButton {command} />
|
||||
{/if}
|
||||
|
||||
Reference in New Issue
Block a user