From 2f9a820d54950df2629f6bbaaa6f044a8511620c Mon Sep 17 00:00:00 2001 From: xiamiao Date: Wed, 12 Jun 2024 10:58:25 +0800 Subject: [PATCH 1/4] =?UTF-8?q?feat(check-cascader):=20=E6=96=B0=E5=A2=9E?= =?UTF-8?q?=E6=94=AF=E6=8C=81=E9=85=8D=E7=BD=AE=E5=AD=97=E6=AE=B5=E5=88=AB?= =?UTF-8?q?=E5=90=8D=E5=8A=9F=E8=83=BD(#2866)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- packages/ui/check-cascader/src/CheckCascader.tsx | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/packages/ui/check-cascader/src/CheckCascader.tsx b/packages/ui/check-cascader/src/CheckCascader.tsx index 3c8fdb677..ad43aad21 100644 --- a/packages/ui/check-cascader/src/CheckCascader.tsx +++ b/packages/ui/check-cascader/src/CheckCascader.tsx @@ -72,6 +72,7 @@ export const CheckCascader = forwardRef flattenTreeData(cascaderData), [cascaderData]) + const flattedData = useMemo(() => flattenTreeData(cascaderData, fieldNames), [ + cascaderData, + fieldNames, + ]) const [_value, tryChangeValue] = useUncontrolledState(defaultValue, valueProp, onChange) // 内部实现使用尾部 id @@ -280,6 +284,10 @@ export interface CheckCascaderProps extends Omit /** * 设置当前多选值 */ From 95f2e843d154d5767c08d7a04a86d61804d71396 Mon Sep 17 00:00:00 2001 From: xiamiao Date: Wed, 12 Jun 2024 11:03:43 +0800 Subject: [PATCH 2/4] =?UTF-8?q?chore:=20=E7=94=9F=E6=88=90=E5=8F=98?= =?UTF-8?q?=E6=9B=B4=E8=AE=B0=E5=BD=95=E6=96=87=E4=BB=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .changeset/grumpy-owls-cover.md | 5 +++++ .changeset/nice-taxis-help.md | 6 ++++++ 2 files changed, 11 insertions(+) create mode 100644 .changeset/grumpy-owls-cover.md create mode 100644 .changeset/nice-taxis-help.md diff --git a/.changeset/grumpy-owls-cover.md b/.changeset/grumpy-owls-cover.md new file mode 100644 index 000000000..55d424207 --- /dev/null +++ b/.changeset/grumpy-owls-cover.md @@ -0,0 +1,5 @@ +--- +"@hi-ui/check-cascader": minor +--- + +feat: 新增支持配置字段别名 diff --git a/.changeset/nice-taxis-help.md b/.changeset/nice-taxis-help.md new file mode 100644 index 000000000..57fb96d68 --- /dev/null +++ b/.changeset/nice-taxis-help.md @@ -0,0 +1,6 @@ +--- +"@hi-ui/check-cascader": patch +"@hi-ui/hiui": patch +--- + +feat(check-cascader): 新增支持配置字段别名 From bd531a9c0c5d765be898ec77472261fa3b5a597d Mon Sep 17 00:00:00 2001 From: xiamiao Date: Tue, 25 Jun 2024 11:25:29 +0800 Subject: [PATCH 3/4] =?UTF-8?q?chore:=20=E4=BF=AE=E6=94=B9=E5=8F=98?= =?UTF-8?q?=E6=9B=B4=E8=AE=B0=E5=BD=95=E6=96=87=E4=BB=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .changeset/nice-taxis-help.md | 1 - 1 file changed, 1 deletion(-) diff --git a/.changeset/nice-taxis-help.md b/.changeset/nice-taxis-help.md index 57fb96d68..d49858192 100644 --- a/.changeset/nice-taxis-help.md +++ b/.changeset/nice-taxis-help.md @@ -1,5 +1,4 @@ --- -"@hi-ui/check-cascader": patch "@hi-ui/hiui": patch --- From f47509ba64f4312da4b40b9bc2d129e0a316e883 Mon Sep 17 00:00:00 2001 From: xiamiao Date: Tue, 25 Jun 2024 11:29:32 +0800 Subject: [PATCH 4/4] =?UTF-8?q?feat(check-cascader):=20=E4=BF=AE=E6=94=B9f?= =?UTF-8?q?ieldNames=E7=B1=BB=E5=9E=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- packages/ui/check-cascader/src/CheckCascader.tsx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/ui/check-cascader/src/CheckCascader.tsx b/packages/ui/check-cascader/src/CheckCascader.tsx index ad43aad21..c20ad72d0 100644 --- a/packages/ui/check-cascader/src/CheckCascader.tsx +++ b/packages/ui/check-cascader/src/CheckCascader.tsx @@ -24,7 +24,7 @@ import { flattenTreeData } from './utils' import { getNodeAncestorsWithMe, getTopDownAncestors } from '@hi-ui/tree-utils' import { useLatestCallback } from '@hi-ui/use-latest' import { isArrayNonEmpty, isFunction, isUndef } from '@hi-ui/type-assertion' -import { HiBaseAppearanceEnum, HiBaseSizeEnum, useLocaleContext } from '@hi-ui/core' +import { HiBaseAppearanceEnum, HiBaseFieldNames, HiBaseSizeEnum, useLocaleContext } from '@hi-ui/core' import { callAllFuncs } from '@hi-ui/func-utils' @@ -287,7 +287,7 @@ export interface CheckCascaderProps extends Omit + fieldNames?: HiBaseFieldNames /** * 设置当前多选值 */