From d444a2447c1bfafbf492dbb048785a1b3a3d5f8e Mon Sep 17 00:00:00 2001 From: Martin McKeaveney Date: Tue, 27 Oct 2020 22:57:05 +0000 Subject: [PATCH] styling updates from code review --- .../components/backend/DataTable/Table.svelte | 17 +++------- .../DataTable/TableHeader/TableHeader.svelte | 31 +++++++++++++------ .../DataTable/buttons/DeleteRowsButton.svelte | 8 +++-- .../DataTable/modals/CreateEditColumn.svelte | 12 ++++--- 4 files changed, 39 insertions(+), 29 deletions(-) diff --git a/packages/builder/src/components/backend/DataTable/Table.svelte b/packages/builder/src/components/backend/DataTable/Table.svelte index 3d101a3004..8dd25da3cd 100644 --- a/packages/builder/src/components/backend/DataTable/Table.svelte +++ b/packages/builder/src/components/backend/DataTable/Table.svelte @@ -44,7 +44,7 @@ customLoadingOverlay: TableLoadingOverlay, }, loadingOverlayComponent: "customLoadingOverlay", - animateRows: true + animateRows: true, } $: { @@ -62,22 +62,13 @@ width: 100, cellRenderer: editRowRenderer, }, - { - headerName: "", - checkboxSelection: true, - sortable: false, - resizable: false, - suppressMovable: true, - suppressMenu: true, - minWidth: 50, - width: 50, - }, ] } - for (let key in schema) { + Object.keys(schema || {}).forEach((key, idx) => { result.push({ headerCheckboxSelection: false, + checkboxSelection: idx === 0 && allowEditing, headerComponent: TableHeader, headerComponentParams: { field: schema[key], @@ -94,7 +85,7 @@ resizable: true, minWidth: 200, }) - } + }) columnDefs = result } diff --git a/packages/builder/src/components/backend/DataTable/TableHeader/TableHeader.svelte b/packages/builder/src/components/backend/DataTable/TableHeader/TableHeader.svelte index 9832e28340..922f565a22 100644 --- a/packages/builder/src/components/backend/DataTable/TableHeader/TableHeader.svelte +++ b/packages/builder/src/components/backend/DataTable/TableHeader/TableHeader.svelte @@ -1,5 +1,5 @@ @@ -59,14 +70,14 @@ -
- {#if editable} +
+ {#if editable && hovered} {/if} - +
@@ -85,7 +96,7 @@ section { opacity: 0; - transition: 0.2s all; + transition: 0.3s all; } section.show { diff --git a/packages/builder/src/components/backend/DataTable/buttons/DeleteRowsButton.svelte b/packages/builder/src/components/backend/DataTable/buttons/DeleteRowsButton.svelte index 051a40a924..fc933e374c 100644 --- a/packages/builder/src/components/backend/DataTable/buttons/DeleteRowsButton.svelte +++ b/packages/builder/src/components/backend/DataTable/buttons/DeleteRowsButton.svelte @@ -16,7 +16,9 @@
- Delete {selectedRows.length} row(s) + Delete + {selectedRows.length} + row(s)
@@ -25,6 +27,8 @@ confirmText="Delete" onConfirm={confirmDeletion} title="Confirm Row Deletion"> - Are you sure you want to delete {selectedRows.length} row{selectedRows.length > 1 ? 's' : ''}? + Are you sure you want to delete + {selectedRows.length} + row{selectedRows.length > 1 ? 's' : ''}? diff --git a/packages/builder/src/components/backend/DataTable/modals/CreateEditColumn.svelte b/packages/builder/src/components/backend/DataTable/modals/CreateEditColumn.svelte index 4233a3be37..c831ef8193 100644 --- a/packages/builder/src/components/backend/DataTable/modals/CreateEditColumn.svelte +++ b/packages/builder/src/components/backend/DataTable/modals/CreateEditColumn.svelte @@ -1,5 +1,5 @@