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

View File

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

View File

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