diff --git a/packages/frontend-core/src/components/grid/controls/ColumnsSettingButton.svelte b/packages/frontend-core/src/components/grid/controls/ColumnsSettingButton.svelte index 2f3b1df405..8fe3854d93 100644 --- a/packages/frontend-core/src/components/grid/controls/ColumnsSettingButton.svelte +++ b/packages/frontend-core/src/components/grid/controls/ColumnsSettingButton.svelte @@ -2,7 +2,6 @@ import { getContext } from "svelte" import { ActionButton, Popover, Toggle, Icon } from "@budibase/bbui" import { getColumnIcon } from "../lib/utils" - import ToggleActionButtonGroup from "./ToggleActionButtonGroup.svelte" const { columns, datasource, stickyColumn, dispatch } = getContext("grid") @@ -32,6 +31,12 @@ HIDDEN: "hidden", } + const options = [ + { icon: "Edit", value: PERMISSION_OPTIONS.WRITABLE }, + { icon: "Visibility", value: PERMISSION_OPTIONS.READONLY }, + { icon: "VisibilityOff", value: PERMISSION_OPTIONS.HIDDEN }, + ] + function columnToPermissionOptions(column) { if (!column.visible) { return PERMISSION_OPTIONS.HIDDEN @@ -73,15 +78,17 @@ {column.label} - toggleColumn(column, e.detail)} - value={columnToPermissionOptions(column)} - options={[ - { icon: "Edit", value: PERMISSION_OPTIONS.WRITABLE }, - { icon: "Visibility", value: PERMISSION_OPTIONS.READONLY }, - { icon: "VisibilityOff", value: PERMISSION_OPTIONS.HIDDEN }, - ]} - /> +
+ {#each options as option} + toggleColumn(column, option.value)} + size="S" + icon={option.icon} + quiet + selected={option.value === columnToPermissionOptions(column)} + /> + {/each} +
{/each} 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} -