From 3d969f04e117e86c18d5d19eff2b7ce21ee525c4 Mon Sep 17 00:00:00 2001 From: -l Date: Wed, 11 Dec 2024 09:46:50 +0100 Subject: [PATCH 1/4] fix(Dropdown): fix using interface as type for data --- .../dropdown/stories/Dropdown.stories.tsx | 18 ++++++++++++++++++ .../src/fragments/drawer-list/DrawerList.d.ts | 1 - 2 files changed, 18 insertions(+), 1 deletion(-) diff --git a/packages/dnb-eufemia/src/components/dropdown/stories/Dropdown.stories.tsx b/packages/dnb-eufemia/src/components/dropdown/stories/Dropdown.stories.tsx index b612481f121..9e52fcfb8c3 100644 --- a/packages/dnb-eufemia/src/components/dropdown/stories/Dropdown.stories.tsx +++ b/packages/dnb-eufemia/src/components/dropdown/stories/Dropdown.stories.tsx @@ -1006,6 +1006,24 @@ export const GlobalStatusExample = () => { ) } +export const TypesExample = () => { + interface MyInterface { + content: string + selected_key: string + } + + const myData: MyInterface[] = [] + + return ( + + ) +} + export function InDialog() { const list = Array(30).fill('Content') return ( diff --git a/packages/dnb-eufemia/src/fragments/drawer-list/DrawerList.d.ts b/packages/dnb-eufemia/src/fragments/drawer-list/DrawerList.d.ts index cdad59a81cc..d70bfabfeea 100644 --- a/packages/dnb-eufemia/src/fragments/drawer-list/DrawerList.d.ts +++ b/packages/dnb-eufemia/src/fragments/drawer-list/DrawerList.d.ts @@ -16,7 +16,6 @@ export type DrawerListValue = string | number; /** @deprecated use `DrawerListDataArrayObject` */ export type DrawerListDataObject = DrawerListDataArrayObject; export type DrawerListDataArrayObject = { - [customProperty: string]: unknown; selected_value?: string | React.ReactNode; selectedKey?: string | number; selected_key?: string | number; From 8988fb6ab7ee3a746fc66c1b8356633ff1665964 Mon Sep 17 00:00:00 2001 From: Anders Date: Wed, 11 Dec 2024 09:50:33 +0100 Subject: [PATCH 2/4] Update packages/dnb-eufemia/src/components/dropdown/stories/Dropdown.stories.tsx --- .../src/components/dropdown/stories/Dropdown.stories.tsx | 1 - 1 file changed, 1 deletion(-) diff --git a/packages/dnb-eufemia/src/components/dropdown/stories/Dropdown.stories.tsx b/packages/dnb-eufemia/src/components/dropdown/stories/Dropdown.stories.tsx index 9e52fcfb8c3..5d29e1d6f07 100644 --- a/packages/dnb-eufemia/src/components/dropdown/stories/Dropdown.stories.tsx +++ b/packages/dnb-eufemia/src/components/dropdown/stories/Dropdown.stories.tsx @@ -1018,7 +1018,6 @@ export const TypesExample = () => { ) From 0bc00ee09b70fe87d7e2414fe3a7d79520aa3fb9 Mon Sep 17 00:00:00 2001 From: -l Date: Wed, 11 Dec 2024 09:54:21 +0100 Subject: [PATCH 3/4] fix(Dropdown): fix using interface as type for data --- .../src/components/dropdown/stories/Dropdown.stories.tsx | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/packages/dnb-eufemia/src/components/dropdown/stories/Dropdown.stories.tsx b/packages/dnb-eufemia/src/components/dropdown/stories/Dropdown.stories.tsx index 5d29e1d6f07..e6640c42534 100644 --- a/packages/dnb-eufemia/src/components/dropdown/stories/Dropdown.stories.tsx +++ b/packages/dnb-eufemia/src/components/dropdown/stories/Dropdown.stories.tsx @@ -1014,13 +1014,7 @@ export const TypesExample = () => { const myData: MyInterface[] = [] - return ( - - ) + return } export function InDialog() { From 1143f5dde42757816e4038c6f8f8b4b56e152549 Mon Sep 17 00:00:00 2001 From: -l Date: Wed, 11 Dec 2024 10:06:36 +0100 Subject: [PATCH 4/4] fix(Dropdown): fix using interface as type for data --- packages/dnb-eufemia/src/fragments/drawer-list/DrawerList.d.ts | 1 + 1 file changed, 1 insertion(+) diff --git a/packages/dnb-eufemia/src/fragments/drawer-list/DrawerList.d.ts b/packages/dnb-eufemia/src/fragments/drawer-list/DrawerList.d.ts index d70bfabfeea..071df9ebd98 100644 --- a/packages/dnb-eufemia/src/fragments/drawer-list/DrawerList.d.ts +++ b/packages/dnb-eufemia/src/fragments/drawer-list/DrawerList.d.ts @@ -16,6 +16,7 @@ export type DrawerListValue = string | number; /** @deprecated use `DrawerListDataArrayObject` */ export type DrawerListDataObject = DrawerListDataArrayObject; export type DrawerListDataArrayObject = { + [customProperty: string]: any; selected_value?: string | React.ReactNode; selectedKey?: string | number; selected_key?: string | number;