From ea14af8a64eeba84b3a964b13f63a49bfd67906f Mon Sep 17 00:00:00 2001 From: Andrew Kingston Date: Tue, 28 May 2024 11:00:47 +0100 Subject: [PATCH 01/27] Offset button column to account for vertical scrollbar if required --- .../src/components/grid/layout/ButtonColumn.svelte | 7 ++++++- .../src/components/grid/layout/Grid.svelte | 3 ++- .../components/grid/overlays/ScrollOverlay.svelte | 12 ++++++------ 3 files changed, 14 insertions(+), 8 deletions(-) diff --git a/packages/frontend-core/src/components/grid/layout/ButtonColumn.svelte b/packages/frontend-core/src/components/grid/layout/ButtonColumn.svelte index 3448042894..2e9bcf43d5 100644 --- a/packages/frontend-core/src/components/grid/layout/ButtonColumn.svelte +++ b/packages/frontend-core/src/components/grid/layout/ButtonColumn.svelte @@ -3,6 +3,7 @@ import { Button } from "@budibase/bbui" import GridCell from "../cells/GridCell.svelte" import GridScrollWrapper from "./GridScrollWrapper.svelte" + import { ScrollBarSize } from "../lib/constants" const { renderedRows, @@ -16,6 +17,7 @@ scroll, isDragging, buttonColumnWidth, + showVScrollbar, } = getContext("grid") let measureContainer @@ -67,7 +69,7 @@ selected={rowSelected} highlighted={rowHovered || rowFocused} > -
+
{#each buttons as button}
diff --git a/packages/frontend-core/src/components/grid/controls/ToggleActionButtonGroup.svelte b/packages/frontend-core/src/components/grid/controls/ToggleActionButtonGroup.svelte deleted file mode 100644 index 647b1af526..0000000000 --- a/packages/frontend-core/src/components/grid/controls/ToggleActionButtonGroup.svelte +++ /dev/null @@ -1,25 +0,0 @@ - - -
- {#each options as option} - onClick(option.value)} - size="S" - icon={option.icon} - quiet - selected={option.value === value} - /> - {/each} -
From 151ff27351e9ac0422d47933286f82a4fa1b4533 Mon Sep 17 00:00:00 2001 From: Adria Navarro Date: Wed, 29 May 2024 15:38:30 +0200 Subject: [PATCH 16/27] Styling --- .../grid/controls/ColumnsSettingButton.svelte | 20 +++++++++++++------ 1 file changed, 14 insertions(+), 6 deletions(-) diff --git a/packages/frontend-core/src/components/grid/controls/ColumnsSettingButton.svelte b/packages/frontend-core/src/components/grid/controls/ColumnsSettingButton.svelte index 8fe3854d93..2608eea75f 100644 --- a/packages/frontend-core/src/components/grid/controls/ColumnsSettingButton.svelte +++ b/packages/frontend-core/src/components/grid/controls/ColumnsSettingButton.svelte @@ -78,7 +78,7 @@ {column.label}
-
+
{#each options as option} toggleColumn(column, option.value)} @@ -86,6 +86,7 @@ icon={option.icon} quiet selected={option.value === columnToPermissionOptions(column)} + noPadding /> {/each}
@@ -101,11 +102,6 @@ flex-direction: column; gap: 12px; } - .buttons { - display: flex; - flex-direction: row; - gap: 8px; - } .columns { display: grid; align-items: center; @@ -118,4 +114,16 @@ display: flex; gap: 8px; } + .permissionPicker { + display: flex; + gap: var(--spacing-xs); + padding-left: calc(var(--spacing-xl) * 2); + } + + .permissionPicker :global(.spectrum-Icon) { + width: 14px; + } + .permissionPicker :global(.spectrum-ActionButton) { + width: 22px; + } From 06549149b6867acac854751a85aa42c77f64f30f Mon Sep 17 00:00:00 2001 From: Adria Navarro Date: Wed, 29 May 2024 16:01:11 +0200 Subject: [PATCH 17/27] Remove readonly --- .../components/grid/controls/ColumnsSettingButton.svelte | 9 +-------- 1 file changed, 1 insertion(+), 8 deletions(-) diff --git a/packages/frontend-core/src/components/grid/controls/ColumnsSettingButton.svelte b/packages/frontend-core/src/components/grid/controls/ColumnsSettingButton.svelte index 2608eea75f..c3ce6d2743 100644 --- a/packages/frontend-core/src/components/grid/controls/ColumnsSettingButton.svelte +++ b/packages/frontend-core/src/components/grid/controls/ColumnsSettingButton.svelte @@ -13,9 +13,8 @@ const toggleColumn = async (column, permission) => { const visible = permission !== PERMISSION_OPTIONS.HIDDEN - const readonly = permission === PERMISSION_OPTIONS.READONLY - datasource.actions.addSchemaMutation(column.name, { visible, readonly }) + datasource.actions.addSchemaMutation(column.name, { visible }) await datasource.actions.saveSchemaMutations() dispatch(visible ? "show-column" : "hide-column") } @@ -27,13 +26,11 @@ const PERMISSION_OPTIONS = { WRITABLE: "writable", - READONLY: "readonly", HIDDEN: "hidden", } const options = [ { icon: "Edit", value: PERMISSION_OPTIONS.WRITABLE }, - { icon: "Visibility", value: PERMISSION_OPTIONS.READONLY }, { icon: "VisibilityOff", value: PERMISSION_OPTIONS.HIDDEN }, ] @@ -42,10 +39,6 @@ return PERMISSION_OPTIONS.HIDDEN } - if (column.readonly) { - return PERMISSION_OPTIONS.READONLY - } - return PERMISSION_OPTIONS.WRITABLE } From 5b42aff1f750f2ae3c175d147e164b183fd46c8b Mon Sep 17 00:00:00 2001 From: Adria Navarro Date: Wed, 29 May 2024 16:21:19 +0200 Subject: [PATCH 18/27] Add picker to sticky columns --- .../bbui/src/ActionButton/ActionButton.svelte | 4 ++++ .../grid/controls/ColumnsSettingButton.svelte | 15 ++++++++++++++- 2 files changed, 18 insertions(+), 1 deletion(-) diff --git a/packages/bbui/src/ActionButton/ActionButton.svelte b/packages/bbui/src/ActionButton/ActionButton.svelte index 96969d1435..d3cec0f307 100644 --- a/packages/bbui/src/ActionButton/ActionButton.svelte +++ b/packages/bbui/src/ActionButton/ActionButton.svelte @@ -57,6 +57,7 @@ class:fullWidth class="spectrum-ActionButton spectrum-ActionButton--size{size}" class:active + class:disabled {disabled} on:longPress on:click|preventDefault @@ -122,6 +123,9 @@ .is-selected:not(.emphasized) .spectrum-Icon { color: var(--spectrum-global-color-gray-900); } + .is-selected.disabled .spectrum-Icon { + color: var(--spectrum-global-color-gray-500); + } .tooltip { position: absolute; pointer-events: none; diff --git a/packages/frontend-core/src/components/grid/controls/ColumnsSettingButton.svelte b/packages/frontend-core/src/components/grid/controls/ColumnsSettingButton.svelte index c3ce6d2743..2f8e141a61 100644 --- a/packages/frontend-core/src/components/grid/controls/ColumnsSettingButton.svelte +++ b/packages/frontend-core/src/components/grid/controls/ColumnsSettingButton.svelte @@ -64,7 +64,19 @@ {$stickyColumn.label}
- + +
+ {#each options as option} + + {/each} +
{/if} {#each $columns as column}
@@ -99,6 +111,7 @@ display: grid; align-items: center; grid-template-columns: 1fr auto; + gap: 8px; } .columns :global(.spectrum-Switch) { margin-right: 0; From 53968f0725d4b1d9019ebe64e45061b0dd81a79e Mon Sep 17 00:00:00 2001 From: Adria Navarro Date: Wed, 29 May 2024 16:22:32 +0200 Subject: [PATCH 19/27] Copy change --- .../src/components/grid/controls/ColumnsSettingButton.svelte | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/frontend-core/src/components/grid/controls/ColumnsSettingButton.svelte b/packages/frontend-core/src/components/grid/controls/ColumnsSettingButton.svelte index 2f8e141a61..5d398574c3 100644 --- a/packages/frontend-core/src/components/grid/controls/ColumnsSettingButton.svelte +++ b/packages/frontend-core/src/components/grid/controls/ColumnsSettingButton.svelte @@ -21,7 +21,7 @@ const getText = columns => { const hidden = columns.filter(col => !col.visible).length - return hidden ? `Columns (${hidden})` : "Columns" + return hidden ? `Columns (${hidden} restricted)` : "Columns" } const PERMISSION_OPTIONS = { From 3d15f71344273796bc13fd68fda52020ba2198d7 Mon Sep 17 00:00:00 2001 From: Adria Navarro Date: Wed, 29 May 2024 16:50:07 +0200 Subject: [PATCH 20/27] Break down component --- .../grid/controls/ColumnsSettingButton.svelte | 57 ++++++------------- .../controls/ToggleActionButtonGroup.svelte | 41 +++++++++++++ 2 files changed, 59 insertions(+), 39 deletions(-) create mode 100644 packages/frontend-core/src/components/grid/controls/ToggleActionButtonGroup.svelte diff --git a/packages/frontend-core/src/components/grid/controls/ColumnsSettingButton.svelte b/packages/frontend-core/src/components/grid/controls/ColumnsSettingButton.svelte index 5d398574c3..0a85e41966 100644 --- a/packages/frontend-core/src/components/grid/controls/ColumnsSettingButton.svelte +++ b/packages/frontend-core/src/components/grid/controls/ColumnsSettingButton.svelte @@ -1,7 +1,8 @@ + +
+ {#each options as option} + dispatch("click", option.value)} + {disabled} + size="S" + icon={option.icon} + quiet + selected={option.value === value} + noPadding + tooltip={option.tooltip} + /> + {/each} +
+ + From 21e5c8ecda3f243718ad8fc9890bdb392f3f2c47 Mon Sep 17 00:00:00 2001 From: Adria Navarro Date: Wed, 29 May 2024 17:19:07 +0200 Subject: [PATCH 21/27] Overflow tooltip --- packages/bbui/src/Popover/Popover.svelte | 5 +++++ .../src/components/grid/controls/ColumnsSettingButton.svelte | 4 ++-- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/packages/bbui/src/Popover/Popover.svelte b/packages/bbui/src/Popover/Popover.svelte index aa811afe1e..05d8af1693 100644 --- a/packages/bbui/src/Popover/Popover.svelte +++ b/packages/bbui/src/Popover/Popover.svelte @@ -27,6 +27,7 @@ export let clickOutsideOverride = false export let resizable = true export let wrap = false + export let overflow = false $: target = portalTarget || getContext(Context.PopoverRoot) || ".spectrum" @@ -104,6 +105,7 @@ class="spectrum-Popover is-open" class:customZindex class:hidden={!showPopover} + class:overflow role="presentation" style="height: {customHeight}; --customZindex: {customZindex};" transition:fly|local={{ y: -20, duration: animate ? 260 : 0 }} @@ -122,6 +124,9 @@ overflow: auto; transition: opacity 260ms ease-out; } + .spectrum-Popover.overflow { + overflow: visible; + } .hidden { opacity: 0; pointer-events: none; diff --git a/packages/frontend-core/src/components/grid/controls/ColumnsSettingButton.svelte b/packages/frontend-core/src/components/grid/controls/ColumnsSettingButton.svelte index 0a85e41966..1c8a8ec6a0 100644 --- a/packages/frontend-core/src/components/grid/controls/ColumnsSettingButton.svelte +++ b/packages/frontend-core/src/components/grid/controls/ColumnsSettingButton.svelte @@ -31,7 +31,7 @@ } const options = [ - { icon: "Edit", value: PERMISSION_OPTIONS.WRITABLE, tooltip: "Writable" }, + { icon: "Edit", value: PERMISSION_OPTIONS.WRITABLE, tooltip: "Writeable" }, { icon: "VisibilityOff", value: PERMISSION_OPTIONS.HIDDEN, @@ -61,7 +61,7 @@
- +
{#if $stickyColumn} From 8b22beb0a204baa91fd298cb3d23748d61c9759c Mon Sep 17 00:00:00 2001 From: Adria Navarro Date: Thu, 30 May 2024 10:07:17 +0200 Subject: [PATCH 22/27] Use AbsTooltip --- .../controls/ToggleActionButtonGroup.svelte | 23 ++++++++++--------- 1 file changed, 12 insertions(+), 11 deletions(-) diff --git a/packages/frontend-core/src/components/grid/controls/ToggleActionButtonGroup.svelte b/packages/frontend-core/src/components/grid/controls/ToggleActionButtonGroup.svelte index 4c82da9e21..4f83f069d3 100644 --- a/packages/frontend-core/src/components/grid/controls/ToggleActionButtonGroup.svelte +++ b/packages/frontend-core/src/components/grid/controls/ToggleActionButtonGroup.svelte @@ -3,7 +3,7 @@ let dispatch = createEventDispatcher() - import { ActionButton } from "@budibase/bbui" + import { ActionButton, AbsTooltip, TooltipType } from "@budibase/bbui" export let value export let options @@ -12,16 +12,17 @@
{#each options as option} - dispatch("click", option.value)} - {disabled} - size="S" - icon={option.icon} - quiet - selected={option.value === value} - noPadding - tooltip={option.tooltip} - /> + + dispatch("click", option.value)} + {disabled} + size="S" + icon={option.icon} + quiet + selected={option.value === value} + noPadding + /> + {/each}
From a672c0089931e14eda859c00661d338d9791fbeb Mon Sep 17 00:00:00 2001 From: Adria Navarro Date: Thu, 30 May 2024 10:07:47 +0200 Subject: [PATCH 23/27] Copy changes --- .../src/components/grid/controls/ColumnsSettingButton.svelte | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/frontend-core/src/components/grid/controls/ColumnsSettingButton.svelte b/packages/frontend-core/src/components/grid/controls/ColumnsSettingButton.svelte index 1c8a8ec6a0..7ba746da33 100644 --- a/packages/frontend-core/src/components/grid/controls/ColumnsSettingButton.svelte +++ b/packages/frontend-core/src/components/grid/controls/ColumnsSettingButton.svelte @@ -31,7 +31,7 @@ } const options = [ - { icon: "Edit", value: PERMISSION_OPTIONS.WRITABLE, tooltip: "Writeable" }, + { icon: "Edit", value: PERMISSION_OPTIONS.WRITABLE, tooltip: "Writable" }, { icon: "VisibilityOff", value: PERMISSION_OPTIONS.HIDDEN, From b5a036509784576e00555f4a6e25479fc3e60863 Mon Sep 17 00:00:00 2001 From: Adria Navarro Date: Thu, 30 May 2024 10:11:04 +0200 Subject: [PATCH 24/27] Remove new overflow setting --- packages/bbui/src/Popover/Popover.svelte | 5 ----- .../src/components/grid/controls/ColumnsSettingButton.svelte | 2 +- 2 files changed, 1 insertion(+), 6 deletions(-) diff --git a/packages/bbui/src/Popover/Popover.svelte b/packages/bbui/src/Popover/Popover.svelte index 05d8af1693..aa811afe1e 100644 --- a/packages/bbui/src/Popover/Popover.svelte +++ b/packages/bbui/src/Popover/Popover.svelte @@ -27,7 +27,6 @@ export let clickOutsideOverride = false export let resizable = true export let wrap = false - export let overflow = false $: target = portalTarget || getContext(Context.PopoverRoot) || ".spectrum" @@ -105,7 +104,6 @@ class="spectrum-Popover is-open" class:customZindex class:hidden={!showPopover} - class:overflow role="presentation" style="height: {customHeight}; --customZindex: {customZindex};" transition:fly|local={{ y: -20, duration: animate ? 260 : 0 }} @@ -124,9 +122,6 @@ overflow: auto; transition: opacity 260ms ease-out; } - .spectrum-Popover.overflow { - overflow: visible; - } .hidden { opacity: 0; pointer-events: none; diff --git a/packages/frontend-core/src/components/grid/controls/ColumnsSettingButton.svelte b/packages/frontend-core/src/components/grid/controls/ColumnsSettingButton.svelte index 7ba746da33..0a85e41966 100644 --- a/packages/frontend-core/src/components/grid/controls/ColumnsSettingButton.svelte +++ b/packages/frontend-core/src/components/grid/controls/ColumnsSettingButton.svelte @@ -61,7 +61,7 @@
- +
{#if $stickyColumn} From adcda035ed9dc736a68b61f6a0809ff44022e344 Mon Sep 17 00:00:00 2001 From: Adria Navarro Date: Thu, 30 May 2024 10:11:11 +0200 Subject: [PATCH 25/27] Change size --- .../components/grid/controls/ToggleActionButtonGroup.svelte | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/packages/frontend-core/src/components/grid/controls/ToggleActionButtonGroup.svelte b/packages/frontend-core/src/components/grid/controls/ToggleActionButtonGroup.svelte index 4f83f069d3..e705b5016d 100644 --- a/packages/frontend-core/src/components/grid/controls/ToggleActionButtonGroup.svelte +++ b/packages/frontend-core/src/components/grid/controls/ToggleActionButtonGroup.svelte @@ -37,6 +37,7 @@ width: 14px; } .permissionPicker :global(.spectrum-ActionButton) { - width: 22px; + width: 28px; + height: 28px; } From 7b4304d4a2ebace99dbaa01d3c46caedfb7cfb1c Mon Sep 17 00:00:00 2001 From: Andrew Kingston Date: Thu, 30 May 2024 09:11:42 +0100 Subject: [PATCH 26/27] Force wrapping long words in field labels --- packages/client/src/components/app/forms/Field.svelte | 3 +++ 1 file changed, 3 insertions(+) diff --git a/packages/client/src/components/app/forms/Field.svelte b/packages/client/src/components/app/forms/Field.svelte index 690e328cf4..74ff5442a9 100644 --- a/packages/client/src/components/app/forms/Field.svelte +++ b/packages/client/src/components/app/forms/Field.svelte @@ -126,6 +126,9 @@ display: flex; flex-direction: column; } + label { + word-wrap: break-word; + } label.hidden { padding: 0; } From 19a422ca1ccf7accf621728aeb1995a3dd8b28fc Mon Sep 17 00:00:00 2001 From: Andrew Kingston Date: Thu, 30 May 2024 09:14:56 +0100 Subject: [PATCH 27/27] Typo --- packages/frontend-core/src/components/grid/stores/rows.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/frontend-core/src/components/grid/stores/rows.js b/packages/frontend-core/src/components/grid/stores/rows.js index 5140a7da8b..d354dfd9b3 100644 --- a/packages/frontend-core/src/components/grid/stores/rows.js +++ b/packages/frontend-core/src/components/grid/stores/rows.js @@ -404,7 +404,7 @@ export const createActions = context => { // Save change try { - // Incremenet change count for this row + // Increment change count for this row inProgressChanges.update(state => ({ ...state, [rowId]: (state[rowId] || 0) + 1,