Remove expand icons from grids

This commit is contained in:
Andrew Kingston 2023-06-21 11:51:23 +01:00
parent 1403ee59ce
commit 0a3dd1a1b4
3 changed files with 11 additions and 19 deletions

View File

@ -9,7 +9,7 @@
export let rowFocused = false
export let rowHovered = false
export let rowSelected = false
export let disableExpand = false
export let expandable = false
export let disableNumber = false
export let defaultHeight = false
export let disabled = false
@ -24,13 +24,6 @@
selectedRows.actions.toggleRow(id)
}
}
const expand = () => {
svelteDispatch("expand")
if (row) {
dispatch("edit-row", row)
}
}
</script>
<GridCell
@ -71,13 +64,13 @@
/>
</div>
{:else}
<div
class="expand"
class:visible={$config.allowExpandRows &&
!disableExpand &&
(rowFocused || rowHovered)}
>
<Icon name="Maximize" hoverable size="S" on:click={expand} />
<div class="expand" class:visible={$config.allowExpandRows && expandable}>
<Icon
size="S"
name="Maximize"
hoverable
on:click={() => svelteDispatch("expand")}
/>
</div>
{/if}
</div>

View File

@ -145,7 +145,7 @@
</script>
<!-- New row FAB -->
{#if !visible && !$config.showControls && !selectedRowCount}
{#if !visible && !selectedRowCount}
<div
class="new-row-fab"
on:click={() => dispatch("add-row-inline")}
@ -165,7 +165,7 @@
<div class="underlay sticky" transition:fade|local={{ duration: 130 }} />
<div class="underlay" transition:fade|local={{ duration: 130 }} />
<div class="sticky-column" transition:fade|local={{ duration: 130 }}>
<GutterCell on:expand={addViaModal} rowHovered>
<GutterCell expandable on:expand={addViaModal} rowHovered>
<Icon name="Add" color="var(--spectrum-global-color-gray-500)" />
{#if isAdding}
<div in:fade={{ duration: 130 }} class="loading-overlay" />

View File

@ -51,7 +51,6 @@
>
<div class="header row">
<GutterCell
disableExpand
disableNumber
on:select={selectAll}
defaultHeight
@ -103,7 +102,7 @@
on:mouseleave={$isDragging ? null : () => ($hoveredRowId = null)}
on:click={() => dispatch("add-row-inline")}
>
<GutterCell disableExpand rowHovered={$hoveredRowId === BlankRowID}>
<GutterCell rowHovered={$hoveredRowId === BlankRowID}>
<Icon name="Add" color="var(--spectrum-global-color-gray-500)" />
</GutterCell>
{#if $stickyColumn}