From 015651f860552009c030037c8aec1699db4e0695 Mon Sep 17 00:00:00 2001 From: Gilles De Mey Date: Wed, 5 Oct 2022 10:33:47 +0200 Subject: [PATCH] @grafana/ui: adds a virtualized options for the Select component (#55629) --- .../src/components/Select/Select.story.tsx | 20 +++++++- .../src/components/Select/Select.tsx | 6 ++- .../src/components/Select/SelectBase.tsx | 11 ++-- .../src/components/Select/SelectMenu.tsx | 51 +++++++++++++++++++ .../src/components/Select/mockOptions.tsx | 10 ++++ .../grafana-ui/src/components/Select/types.ts | 7 +++ .../grafana-ui/src/components/Select/utils.ts | 7 +++ 7 files changed, 106 insertions(+), 6 deletions(-) diff --git a/packages/grafana-ui/src/components/Select/Select.story.tsx b/packages/grafana-ui/src/components/Select/Select.story.tsx index d4fca54b60b..7c69d7aa3d1 100644 --- a/packages/grafana-ui/src/components/Select/Select.story.tsx +++ b/packages/grafana-ui/src/components/Select/Select.story.tsx @@ -10,7 +10,7 @@ import { getAvailableIcons } from '../../types'; import { withCenteredStory, withHorizontallyCenteredStory } from '../../utils/storybook/withCenteredStory'; import mdx from './Select.mdx'; -import { generateOptions } from './mockOptions'; +import { generateOptions, generateThousandsOfOptions } from './mockOptions'; import { SelectCommonProps } from './types'; const meta: Meta = { @@ -105,6 +105,24 @@ export const Basic: Story = (args) => { ); }; +export const BasicVirtualizedList: Story = (args) => { + const [value, setValue] = useState>(); + + return ( + <> +