diff --git a/packages/bbui/src/Actions/click_outside.js b/packages/bbui/src/Actions/click_outside.js index 5b7a059493..1961dca47c 100644 --- a/packages/bbui/src/Actions/click_outside.js +++ b/packages/bbui/src/Actions/click_outside.js @@ -1,4 +1,8 @@ -const ignoredClasses = [".flatpickr-calendar", ".spectrum-Popover"] +const ignoredClasses = [ + ".flatpickr-calendar", + ".spectrum-Popover", + ".download-js-link", +] let clickHandlers = [] /** @@ -22,8 +26,8 @@ const handleClick = event => { } // Ignore clicks for modals, unless the handler is registered from a modal - const sourceInModal = handler.anchor.closest(".spectrum-Modal") != null - const clickInModal = event.target.closest(".spectrum-Modal") != null + const sourceInModal = handler.anchor.closest(".spectrum-Underlay") != null + const clickInModal = event.target.closest(".spectrum-Underlay") != null if (clickInModal && !sourceInModal) { return } diff --git a/packages/builder/src/components/backend/DataTable/buttons/ExistingRelationshipButton.svelte b/packages/builder/src/components/backend/DataTable/buttons/ExistingRelationshipButton.svelte index 3d837a54f0..0f4bafb001 100644 --- a/packages/builder/src/components/backend/DataTable/buttons/ExistingRelationshipButton.svelte +++ b/packages/builder/src/components/backend/DataTable/buttons/ExistingRelationshipButton.svelte @@ -39,7 +39,7 @@ {#if datasource}
- Define existing relationship + Define relationship
diff --git a/packages/builder/src/components/backend/DataTable/buttons/grid/GridExportButton.svelte b/packages/builder/src/components/backend/DataTable/buttons/grid/GridExportButton.svelte index 1661808e9d..b5fe202d11 100644 --- a/packages/builder/src/components/backend/DataTable/buttons/grid/GridExportButton.svelte +++ b/packages/builder/src/components/backend/DataTable/buttons/grid/GridExportButton.svelte @@ -9,13 +9,21 @@ $: selectedRowArray = Object.keys($selectedRows).map(id => ({ _id: id })) - + + + + + diff --git a/packages/builder/src/components/backend/DataTable/buttons/grid/GridFilterButton.svelte b/packages/builder/src/components/backend/DataTable/buttons/grid/GridFilterButton.svelte index aff98deaaf..2283862303 100644 --- a/packages/builder/src/components/backend/DataTable/buttons/grid/GridFilterButton.svelte +++ b/packages/builder/src/components/backend/DataTable/buttons/grid/GridFilterButton.svelte @@ -2,19 +2,19 @@ import TableFilterButton from "../TableFilterButton.svelte" import { getContext } from "svelte" - const { columns, config, filter, table } = getContext("grid") + const { columns, tableId, filter, table } = getContext("grid") const onFilter = e => { filter.set(e.detail || []) } -{#key $config.tableId} +{#key $tableId} {/key} diff --git a/packages/builder/src/components/backend/DataTable/buttons/grid/GridManageAccessButton.svelte b/packages/builder/src/components/backend/DataTable/buttons/grid/GridManageAccessButton.svelte index d41d0a1a25..154007950a 100644 --- a/packages/builder/src/components/backend/DataTable/buttons/grid/GridManageAccessButton.svelte +++ b/packages/builder/src/components/backend/DataTable/buttons/grid/GridManageAccessButton.svelte @@ -2,7 +2,7 @@ import ManageAccessButton from "../ManageAccessButton.svelte" import { getContext } from "svelte" - const { config } = getContext("grid") + const { tableId } = getContext("grid") - + diff --git a/packages/frontend-core/src/components/grid/cells/GutterCell.svelte b/packages/frontend-core/src/components/grid/cells/GutterCell.svelte index d9fd09fb6c..00b99c0711 100644 --- a/packages/frontend-core/src/components/grid/cells/GutterCell.svelte +++ b/packages/frontend-core/src/components/grid/cells/GutterCell.svelte @@ -70,7 +70,15 @@ {/if} {/if} - {#if $config.allowExpandRows} + {#if rowSelected && $config.allowDeleteRows} +
dispatch("request-bulk-delete")}> + +
+ {:else if $config.allowExpandRows}
diff --git a/packages/frontend-core/src/components/grid/controls/DeleteButton.svelte b/packages/frontend-core/src/components/grid/controls/BulkDeleteHandler.svelte similarity index 53% rename from packages/frontend-core/src/components/grid/controls/DeleteButton.svelte rename to packages/frontend-core/src/components/grid/controls/BulkDeleteHandler.svelte index 8ca5f0920d..f87b529390 100644 --- a/packages/frontend-core/src/components/grid/controls/DeleteButton.svelte +++ b/packages/frontend-core/src/components/grid/controls/BulkDeleteHandler.svelte @@ -1,8 +1,8 @@ -{#if selectedRowCount} -
- -
-{/if} - - - diff --git a/packages/frontend-core/src/components/grid/controls/ColumnWidthButton.svelte b/packages/frontend-core/src/components/grid/controls/ColumnWidthButton.svelte index 754aebbb51..5ffd968d30 100644 --- a/packages/frontend-core/src/components/grid/controls/ColumnWidthButton.svelte +++ b/packages/frontend-core/src/components/grid/controls/ColumnWidthButton.svelte @@ -3,7 +3,7 @@ import { ActionButton, Popover } from "@budibase/bbui" import { DefaultColumnWidth } from "../lib/constants" - const { stickyColumn, columns } = getContext("grid") + const { stickyColumn, columns, compact } = getContext("grid") const smallSize = 120 const mediumSize = DefaultColumnWidth const largeSize = DefaultColumnWidth * 1.5 @@ -59,12 +59,13 @@ on:click={() => (open = !open)} selected={open} disabled={!allCols.length} + tooltip={$compact ? "Width" : null} > - Width + {$compact ? "" : "Width"}
- +
{#each sizeOptions as option} import { getContext } from "svelte" - import { ActionButton, Popover, Toggle } from "@budibase/bbui" + import { ActionButton, Popover, Toggle, Icon } from "@budibase/bbui" + import { getColumnIcon } from "../lib/utils" - const { columns, stickyColumn } = getContext("grid") + const { columns, stickyColumn, compact } = getContext("grid") let open = false let anchor @@ -47,25 +48,32 @@ on:click={() => (open = !open)} selected={open || anyHidden} disabled={!$columns.length} + tooltip={$compact ? "Columns" : ""} > - Columns + {$compact ? "" : "Columns"}
- +
{#if $stickyColumn} +
+ + {$stickyColumn.label} +
- {$stickyColumn.label} {/if} {#each $columns as column} +
+ + {column.label} +
toggleVisibility(column, e.detail)} /> - {column.label} {/each}
@@ -90,6 +98,13 @@ .columns { display: grid; align-items: center; - grid-template-columns: auto 1fr; + grid-template-columns: 1fr auto; + } + .columns :global(.spectrum-Switch) { + margin-right: 0; + } + .column { + display: flex; + gap: 8px; } diff --git a/packages/frontend-core/src/components/grid/controls/RowHeightButton.svelte b/packages/frontend-core/src/components/grid/controls/RowHeightButton.svelte index e9045ac5c7..e9617ce0b6 100644 --- a/packages/frontend-core/src/components/grid/controls/RowHeightButton.svelte +++ b/packages/frontend-core/src/components/grid/controls/RowHeightButton.svelte @@ -7,7 +7,7 @@ SmallRowHeight, } from "../lib/constants" - const { rowHeight, columns, table } = getContext("grid") + const { rowHeight, columns, table, compact } = getContext("grid") const sizeOptions = [ { label: "Small", @@ -41,12 +41,13 @@ size="M" on:click={() => (open = !open)} selected={open} + tooltip={$compact ? "Height" : null} > - Height + {$compact ? "" : "Height"}
- +
{#each sizeOptions as option} (open = !open)} selected={open} disabled={!columnOptions.length} + tooltip={$compact ? "Sort" : ""} > - Sort + {$compact ? "" : "Sort"}
- +