mirror of
https://github.com/DeNNiiInc/dbgate.git
synced 2026-04-23 20:45:59 +00:00
copy column names #1119
This commit is contained in:
@@ -14,10 +14,16 @@
|
||||
export let clickable = false;
|
||||
export let onAddNew = null;
|
||||
export let displayNameFieldName = null;
|
||||
export let multipleItemsActions = null;
|
||||
|
||||
export let filters = writable({});
|
||||
|
||||
let collapsed = false;
|
||||
let activeMultipleSelection;
|
||||
|
||||
function handleChangeMultipleSelection(list) {
|
||||
activeMultipleSelection = list;
|
||||
}
|
||||
</script>
|
||||
|
||||
{#if collection?.length > 0 || showIfEmpty || emptyMessage}
|
||||
@@ -35,6 +41,16 @@
|
||||
{#if onAddNew}
|
||||
<Link onClick={onAddNew}><FontIcon icon="icon add" /> Add new</Link>
|
||||
{/if}
|
||||
{#if multipleItemsActions && activeMultipleSelection && activeMultipleSelection?.length > 0}
|
||||
{#each multipleItemsActions as item}
|
||||
<span class="ml-2">
|
||||
<Link onClick={() => item.onClick(activeMultipleSelection)}>
|
||||
<FontIcon icon={item.icon} />
|
||||
{item.text} ({activeMultipleSelection.length})
|
||||
</Link>
|
||||
</span>
|
||||
{/each}
|
||||
{/if}
|
||||
</div>
|
||||
{#if (collection?.length || 0) == 0 && emptyMessage}
|
||||
<div class="body">
|
||||
@@ -45,6 +61,7 @@
|
||||
<div class="body">
|
||||
<TableControl
|
||||
rows={collection || []}
|
||||
allowMultiSelect={!!multipleItemsActions}
|
||||
columns={_.compact([
|
||||
!hideDisplayName && {
|
||||
fieldName: displayNameFieldName || 'displayName',
|
||||
@@ -58,6 +75,7 @@
|
||||
{clickable}
|
||||
{filters}
|
||||
on:clickrow
|
||||
onChangeMultipleSelection={handleChangeMultipleSelection}
|
||||
>
|
||||
<svelte:fragment slot="-1" let:row let:col>
|
||||
<slot name="name" {row} {col} />
|
||||
|
||||
Reference in New Issue
Block a user