diff --git a/public/app/features/dashboard-scene/scene/layout-responsive-grid/ResponsiveGridLayoutManagerEditor.tsx b/public/app/features/dashboard-scene/scene/layout-responsive-grid/ResponsiveGridLayoutManagerEditor.tsx index 4762b519603..4cf04f51071 100644 --- a/public/app/features/dashboard-scene/scene/layout-responsive-grid/ResponsiveGridLayoutManagerEditor.tsx +++ b/public/app/features/dashboard-scene/scene/layout-responsive-grid/ResponsiveGridLayoutManagerEditor.tsx @@ -1,7 +1,9 @@ +import { css } from '@emotion/css'; import { capitalize } from 'lodash'; import React, { useEffect } from 'react'; -import { Button, Combobox, ComboboxOption, Field, InlineSwitch, Input, Stack } from '@grafana/ui'; +import { GrafanaTheme2 } from '@grafana/data'; +import { Button, Combobox, ComboboxOption, Field, InlineSwitch, Input, Stack, useStyles2 } from '@grafana/ui'; import { t } from 'app/core/internationalization'; import { OptionsPaneItemDescriptor } from 'app/features/dashboard/components/PanelEditor/OptionsPaneItemDescriptor'; @@ -34,6 +36,7 @@ function GridLayoutColumns({ layoutManager }: { layoutManager: AutoGridLayoutMan const [inputRef, setInputRef] = React.useState(null); const [focusInput, setFocusInput] = React.useState(false); const [customMinWidthError, setCustomMinWidthError] = React.useState(false); + const styles = useStyles2(getStyles); useEffect(() => { if (focusInput && inputRef) { @@ -87,7 +90,7 @@ function GridLayoutColumns({ layoutManager }: { layoutManager: AutoGridLayoutMan }; return ( - + {isStandardMinWidth ? ( @@ -122,11 +126,12 @@ function GridLayoutColumns({ layoutManager }: { layoutManager: AutoGridLayoutMan /> )} - + layoutManager.onMaxColumnCountChanged(parseInt(value, 10))} + width={6.5} /> @@ -138,6 +143,7 @@ function GridLayoutRows({ layoutManager }: { layoutManager: AutoGridLayoutManage const [inputRef, setInputRef] = React.useState(null); const [focusInput, setFocusInput] = React.useState(false); const [customMinWidthError, setCustomMinWidthError] = React.useState(false); + const styles = useStyles2(getStyles); useEffect(() => { if (focusInput && inputRef) { @@ -189,7 +195,7 @@ function GridLayoutRows({ layoutManager }: { layoutManager: AutoGridLayoutManage }; return ( - + {isStandardHeight ? ( - + ) : ( setInputRef(ref)} - width={18} type="number" min={50} max={2000} @@ -225,9 +231,19 @@ function GridLayoutRows({ layoutManager }: { layoutManager: AutoGridLayoutManage /> )} - + layoutManager.onFillScreenChanged(!fillScreen)} /> ); } + +const getStyles = (theme: GrafanaTheme2) => ({ + wideSelector: css({ + minWidth: theme.spacing(14), + flex: `1 1 ${theme.spacing(14)}`, + }), + narrowSelector: css({ + width: theme.spacing(10), + }), +}); diff --git a/public/app/features/dashboard-scene/scene/layouts-shared/DashboardLayoutSelector.tsx b/public/app/features/dashboard-scene/scene/layouts-shared/DashboardLayoutSelector.tsx index 8351dc28cf7..d2f04503aa3 100644 --- a/public/app/features/dashboard-scene/scene/layouts-shared/DashboardLayoutSelector.tsx +++ b/public/app/features/dashboard-scene/scene/layouts-shared/DashboardLayoutSelector.tsx @@ -38,7 +38,7 @@ export function DashboardLayoutSelector({ layoutManager }: Props) { })); return ( - + );