From c868fa66d42a2f25a4d523f5abeb820eea477c01 Mon Sep 17 00:00:00 2001 From: "BugMaker.Huang" Date: Thu, 11 Apr 2024 14:28:00 +0800 Subject: [PATCH] feat(dropdown): add events for dropdown --- .changeset/strange-owls-search.md | 6 ++++++ packages/banana-react/src/dropdown/index.ts | 8 ++++++++ 2 files changed, 14 insertions(+) create mode 100644 .changeset/strange-owls-search.md diff --git a/.changeset/strange-owls-search.md b/.changeset/strange-owls-search.md new file mode 100644 index 00000000..eeb21b69 --- /dev/null +++ b/.changeset/strange-owls-search.md @@ -0,0 +1,6 @@ +--- +'@banana-ui/react': patch +'@banana-ui/banana': patch +--- + +Add events for dropdown. diff --git a/packages/banana-react/src/dropdown/index.ts b/packages/banana-react/src/dropdown/index.ts index 0f809a52..33d5e5cc 100644 --- a/packages/banana-react/src/dropdown/index.ts +++ b/packages/banana-react/src/dropdown/index.ts @@ -2,8 +2,16 @@ import { BDropdown } from '@banana-ui/banana'; import { createComponent } from '@lit-labs/react'; import * as React from 'react'; +const events = { + onShow: 'show', + onAfterShow: 'afterShow', + onHide: 'hide', + onAfterHide: 'afterHide', +}; + export const Dropdown = createComponent({ tagName: 'b-dropdown', react: React, elementClass: BDropdown, + events, });