From 9be541b25a58b9799055c0bbe82ba73624bbb22e Mon Sep 17 00:00:00 2001 From: wdy01684395 Date: Fri, 13 Oct 2023 16:15:33 +0800 Subject: [PATCH] fix cr and add borderless tag demo --- .dumirc.ts | 3 +- .../src/select/demo/custom-tag-render.tsx | 31 ++++ packages/design/src/select/index.md | 15 ++ packages/design/src/select/index.tsx | 26 ++-- packages/design/src/select/style/index.ts | 30 ++-- packages/design/src/tag/demo/basic.tsx | 45 +++--- packages/design/src/tag/demo/borderless.tsx | 69 +++++++++ packages/design/src/tag/demo/checkable.tsx | 2 +- packages/design/src/tag/demo/color.tsx | 54 +++---- packages/design/src/tag/demo/ellipsis.tsx | 15 ++ packages/design/src/tag/demo/icon.tsx | 52 +++---- packages/design/src/tag/demo/select.tsx | 74 ++++----- packages/design/src/tag/demo/status.tsx | 84 +++++----- packages/design/src/tag/index.md | 16 +- packages/design/src/tag/index.tsx | 70 +++++---- packages/design/src/tag/style/index.ts | 146 ++++++++---------- 16 files changed, 418 insertions(+), 314 deletions(-) create mode 100644 packages/design/src/select/demo/custom-tag-render.tsx create mode 100644 packages/design/src/select/index.md create mode 100644 packages/design/src/tag/demo/borderless.tsx create mode 100644 packages/design/src/tag/demo/ellipsis.tsx diff --git a/.dumirc.ts b/.dumirc.ts index ccf7f47df..0dd578982 100644 --- a/.dumirc.ts +++ b/.dumirc.ts @@ -111,6 +111,7 @@ export default defineConfig({ children: [ { title: 'Form 表单', link: '/components/form' }, { title: 'InputNumber 数字输入框', link: '/components/input-number' }, + { title: 'Select 选择器', link: '/components/select' }, ], }, { @@ -120,7 +121,7 @@ export default defineConfig({ { title: 'Descriptions 描述列表', link: '/components/descriptions' }, { title: 'Table 表格', link: '/components/table' }, { title: 'Tabs 标签页', link: '/components/tabs' }, - {title: 'Tag 标签', link: '/components/tag'}, + { title: 'Tag 标签', link: '/components/tag' }, { title: 'Tooltip 文字提示', link: '/components/tooltip' }, ], }, diff --git a/packages/design/src/select/demo/custom-tag-render.tsx b/packages/design/src/select/demo/custom-tag-render.tsx new file mode 100644 index 000000000..694b04de0 --- /dev/null +++ b/packages/design/src/select/demo/custom-tag-render.tsx @@ -0,0 +1,31 @@ +import { Select, Tag } from '@oceanbase/design'; +import React from 'react'; + +const options = ['gold', 'green', 'red', 'cyan']; + +const tagRender = props => { + const { label, value, closable, onClose } = props; + const onPreventMouseDown = (event: React.MouseEvent) => { + event.preventDefault(); + event.stopPropagation(); + }; + return ( + + {label} + + ); +}; + +const App: React.FC = () => ( + <> + ({label: item, value: item}))} - /> - Input - ({ label: item, value: item }))} + /> + Input +