From 2dd977a5c0db411e07aa5c4ea50ef04f37ebf8d2 Mon Sep 17 00:00:00 2001 From: zhouyun1 Date: Wed, 20 Sep 2023 17:17:46 +0800 Subject: [PATCH 1/2] feat(check-tree-select): add size api --- .changeset/real-masks-glow.md | 5 + .changeset/wise-teachers-tease.md | 5 + .../check-tree-select/src/CheckTreeSelect.tsx | 8 +- .../stories/index.stories.tsx | 1 + .../stories/size.stories.tsx | 119 ++++++++++++++++++ 5 files changed, 137 insertions(+), 1 deletion(-) create mode 100644 .changeset/real-masks-glow.md create mode 100644 .changeset/wise-teachers-tease.md create mode 100644 packages/ui/check-tree-select/stories/size.stories.tsx diff --git a/.changeset/real-masks-glow.md b/.changeset/real-masks-glow.md new file mode 100644 index 000000000..59c052718 --- /dev/null +++ b/.changeset/real-masks-glow.md @@ -0,0 +1,5 @@ +--- +"@hi-ui/check-tree-select": minor +--- + +feat: add size api diff --git a/.changeset/wise-teachers-tease.md b/.changeset/wise-teachers-tease.md new file mode 100644 index 000000000..ba7f06c59 --- /dev/null +++ b/.changeset/wise-teachers-tease.md @@ -0,0 +1,5 @@ +--- +"@hi-ui/hiui": patch +--- + +CheckTreeSelect feat: add size api diff --git a/packages/ui/check-tree-select/src/CheckTreeSelect.tsx b/packages/ui/check-tree-select/src/CheckTreeSelect.tsx index d9ea5fb66..5f097da64 100644 --- a/packages/ui/check-tree-select/src/CheckTreeSelect.tsx +++ b/packages/ui/check-tree-select/src/CheckTreeSelect.tsx @@ -17,7 +17,7 @@ import { uniqBy } from '@hi-ui/array-utils' import { Highlighter } from '@hi-ui/highlighter' import { TagInputMock, TagInputMockProps } from '@hi-ui/tag-input' import { UpOutlined, DownOutlined } from '@hi-ui/icons' -import { useLocaleContext } from '@hi-ui/core' +import { HiBaseSizeEnum, useLocaleContext } from '@hi-ui/core' import { callAllFuncs } from '@hi-ui/func-utils' import Checkbox from '@hi-ui/checkbox' // import { UseDataSource } from '@hi-ui/use-data-source' @@ -89,6 +89,7 @@ export const CheckTreeSelect = forwardRef { + const [data] = React.useState([ + { + title: '手机类', + id: '0', + children: [ + { + title: 'Redmi系列', + id: '0-0', + disabled: true, + children: [ + { + id: '0-0-1', + title: 'Redmi K30', + }, + { + id: '0-0-2', + title: 'Redmi K30 Pro', + }, + { + id: '0-0-3', + title: 'Redmi 10X 5G', + }, + { + id: '0-0-4', + title: 'Redmi Note 8', + }, + { + id: '0-0-5', + title: 'Redmi 9', + }, + { + id: '0-0-6', + title: 'Redmi 9A', + }, + ], + }, + { + title: '小米手机', + id: '0-1', + children: [ + { + id: '0-1-1', + title: '小米10 Pro', + }, + { + id: '0-1-2', + title: '小米10', + }, + { + id: '0-1-3', + title: '小米10 青春版 5G', + }, + { + id: '0-1-4', + title: '小米MIX Alpha', + }, + ], + }, + ], + }, + { + title: '电视', + id: '1', + children: [ + { + title: '小米电视 大师 65英寸OLED', + id: '1-0', + }, + { + title: 'Redmi 智能电视 MAX 98', + id: '1-1', + }, + { + title: '小米电视4A 60英寸', + id: '1-2', + }, + ], + }, + ]) + + return ( + <> +

Size

+
+

sm

+ +

md

+ +

lg

+ +
+ + ) +} From 3acef9f68b2c3129975776200e36869da193628a Mon Sep 17 00:00:00 2001 From: zhouyun1 Date: Thu, 21 Sep 2023 20:35:52 +0800 Subject: [PATCH 2/2] =?UTF-8?q?chore(check-tree-select):=20=E8=B0=83?= =?UTF-8?q?=E6=95=B4=E4=B8=8B=E6=8B=89=E9=80=89=E9=A1=B9=E9=AB=98=E5=BA=A6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- packages/ui/check-tree-select/src/CheckTreeSelect.tsx | 1 + 1 file changed, 1 insertion(+) diff --git a/packages/ui/check-tree-select/src/CheckTreeSelect.tsx b/packages/ui/check-tree-select/src/CheckTreeSelect.tsx index 5f097da64..309fca09b 100644 --- a/packages/ui/check-tree-select/src/CheckTreeSelect.tsx +++ b/packages/ui/check-tree-select/src/CheckTreeSelect.tsx @@ -372,6 +372,7 @@ export const CheckTreeSelect = forwardRef