From abdb7fe1128e7352aeb7062574c91d16b375cdc3 Mon Sep 17 00:00:00 2001 From: yangxuexue Date: Mon, 17 Jun 2024 10:33:46 +0800 Subject: [PATCH 1/7] =?UTF-8?q?feat(date-picker):=20=E6=96=B0=E5=A2=9E?= =?UTF-8?q?=E5=89=8D=E7=BD=AE=E5=90=8E=E7=BD=AE=E5=86=85=E5=AE=B9=E6=89=A9?= =?UTF-8?q?=E5=B1=95(#2894)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- packages/ui/date-picker/src/DatePicker.tsx | 2 ++ .../ui/date-picker/src/components/root.tsx | 3 +++ packages/ui/date-picker/src/types.ts | 4 ++++ .../ui/date-picker/stories/addon.stories.tsx | 22 +++++++++++++++++++ .../ui/date-picker/stories/index.stories.tsx | 1 + 5 files changed, 32 insertions(+) create mode 100644 packages/ui/date-picker/stories/addon.stories.tsx diff --git a/packages/ui/date-picker/src/DatePicker.tsx b/packages/ui/date-picker/src/DatePicker.tsx index 6524fb284..cdda14389 100644 --- a/packages/ui/date-picker/src/DatePicker.tsx +++ b/packages/ui/date-picker/src/DatePicker.tsx @@ -78,6 +78,7 @@ export const DatePicker = forwardRef( cellRender, footerRender, strideSelectMode = 'auto', + prefix, ...otherProps }, ref @@ -441,6 +442,7 @@ export const DatePicker = forwardRef( setAttachEl={setAttachEl} dateRangeTimePanelNow={dateRangeTimePanelNow} invalid={invalid} + prefix={prefix} /> void onClear: () => void @@ -23,6 +24,7 @@ const Root = ({ inputChangeEvent: InputChangeEvent dateRangeTimePanelNow: number invalid: boolean + prefix: React.ReactNode }) => { const { i18n, @@ -136,6 +138,7 @@ const Root = ({ return (
+ {prefix ?
{prefix}
: ''}
, 'placehold * @default 'auto' */ strideSelectMode?: 'auto' | 'fixed' + /** + * 选择框前置内容 + */ + prefix?: React.ReactNode } diff --git a/packages/ui/date-picker/stories/addon.stories.tsx b/packages/ui/date-picker/stories/addon.stories.tsx new file mode 100644 index 000000000..eaf00b8b3 --- /dev/null +++ b/packages/ui/date-picker/stories/addon.stories.tsx @@ -0,0 +1,22 @@ +import React from 'react' +import DatePicker from '../src' +import { AppStoreOutlined } from '@hi-ui/icons' + +/** + * @title 前置后置内容扩展 + */ +export const Addon = () => { + return ( +
+

Addon

+ { + console.log('onChange', date, dateStr) + }} + onSelect={console.log} + prefix={} + /> +
+ ) +} diff --git a/packages/ui/date-picker/stories/index.stories.tsx b/packages/ui/date-picker/stories/index.stories.tsx index 3ec21ef85..f8695174b 100644 --- a/packages/ui/date-picker/stories/index.stories.tsx +++ b/packages/ui/date-picker/stories/index.stories.tsx @@ -11,6 +11,7 @@ export * from './shortcut.stories' export * from './lunar.stories' export * from './size.stories' export * from './footer-render.stories' +export * from './addon.stories' export default { title: 'Data Input/DatePicker', From 8080714c331a9107d1a56f64e62a3cf3b24c4c7f Mon Sep 17 00:00:00 2001 From: yangxuexue Date: Mon, 17 Jun 2024 10:35:16 +0800 Subject: [PATCH 2/7] =?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/cyan-rules-sparkle.md | 5 +++++ .changeset/funny-zebras-pretend.md | 5 +++++ 2 files changed, 10 insertions(+) create mode 100644 .changeset/cyan-rules-sparkle.md create mode 100644 .changeset/funny-zebras-pretend.md diff --git a/.changeset/cyan-rules-sparkle.md b/.changeset/cyan-rules-sparkle.md new file mode 100644 index 000000000..031b3a292 --- /dev/null +++ b/.changeset/cyan-rules-sparkle.md @@ -0,0 +1,5 @@ +--- +"@hi-ui/date-picker": minor +--- + +feat: 新增前置后置内容扩展 diff --git a/.changeset/funny-zebras-pretend.md b/.changeset/funny-zebras-pretend.md new file mode 100644 index 000000000..603a6229e --- /dev/null +++ b/.changeset/funny-zebras-pretend.md @@ -0,0 +1,5 @@ +--- +"@hi-ui/hiui": patch +--- + +chore: 生成变更记录文件 From f2062091321109cd32bbc0fa2148ddadd8089446 Mon Sep 17 00:00:00 2001 From: yangxuexue Date: Mon, 17 Jun 2024 18:55:37 +0800 Subject: [PATCH 3/7] =?UTF-8?q?fix(date-picker):=20=E4=BF=AE=E6=94=B9?= =?UTF-8?q?=E5=8F=98=E6=9B=B4=E8=AE=B0=E5=BD=95=E6=96=87=E4=BB=B6=E6=A0=BC?= =?UTF-8?q?=E5=BC=8F=E8=A7=84=E8=8C=83(#2894)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .changeset/cyan-rules-sparkle.md | 2 +- .changeset/funny-zebras-pretend.md | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.changeset/cyan-rules-sparkle.md b/.changeset/cyan-rules-sparkle.md index 031b3a292..8cfb313ca 100644 --- a/.changeset/cyan-rules-sparkle.md +++ b/.changeset/cyan-rules-sparkle.md @@ -2,4 +2,4 @@ "@hi-ui/date-picker": minor --- -feat: 新增前置后置内容扩展 +feat: 新增前缀后缀内容扩展 diff --git a/.changeset/funny-zebras-pretend.md b/.changeset/funny-zebras-pretend.md index 603a6229e..c02b91d3a 100644 --- a/.changeset/funny-zebras-pretend.md +++ b/.changeset/funny-zebras-pretend.md @@ -2,4 +2,4 @@ "@hi-ui/hiui": patch --- -chore: 生成变更记录文件 +feat(date-picker): 新增前缀后缀内容扩展 From ca0c7a96f670ab1aee44cebfe7c6dccef3879dda Mon Sep 17 00:00:00 2001 From: yangxuexue Date: Tue, 18 Jun 2024 11:24:38 +0800 Subject: [PATCH 4/7] =?UTF-8?q?fix(date-picker):=20=E4=BF=AE=E6=94=B9?= =?UTF-8?q?=E8=A1=8C=E5=86=85=E6=A0=B7=E5=BC=8F=E4=B8=BAclass=E6=A0=B7?= =?UTF-8?q?=E5=BC=8F(#2894)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- packages/ui/date-picker/src/components/root.tsx | 2 +- packages/ui/date-picker/src/styles/date-picker.scss | 9 +++++++++ 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/packages/ui/date-picker/src/components/root.tsx b/packages/ui/date-picker/src/components/root.tsx index 2fde0a1c0..aec04983b 100644 --- a/packages/ui/date-picker/src/components/root.tsx +++ b/packages/ui/date-picker/src/components/root.tsx @@ -138,7 +138,7 @@ const Root = ({ return (
- {prefix ?
{prefix}
: ''} + {prefix ? {prefix} : null}
Date: Wed, 19 Jun 2024 19:14:58 +0800 Subject: [PATCH 5/7] =?UTF-8?q?fix(date-picker):=20=E4=BF=AE=E6=94=B9?= =?UTF-8?q?=E5=89=8D=E7=BC=80=E6=A0=B7=E5=BC=8F(#2894)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- packages/ui/date-picker/src/styles/date-picker.scss | 1 + 1 file changed, 1 insertion(+) diff --git a/packages/ui/date-picker/src/styles/date-picker.scss b/packages/ui/date-picker/src/styles/date-picker.scss index 9a5c6748a..b56eb801e 100644 --- a/packages/ui/date-picker/src/styles/date-picker.scss +++ b/packages/ui/date-picker/src/styles/date-picker.scss @@ -236,6 +236,7 @@ $calendar-large-background-border-radius: $calendar-large-indicator-border-radiu &__prefix { display: inline-flex; + margin-left: use-spacing(3); align-items: center; flex-shrink: 0; color: use-color('gray', 700); From 060f2ef0dda48a5e31e886cf9d569e7426faec83 Mon Sep 17 00:00:00 2001 From: yangxuexue Date: Thu, 20 Jun 2024 10:15:48 +0800 Subject: [PATCH 6/7] =?UTF-8?q?fix(date-picker):=20=E4=BF=AE=E6=94=B9?= =?UTF-8?q?=E5=89=8D=E7=BC=80=E9=97=B4=E8=B7=9D(#2894)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- packages/ui/date-picker/src/styles/date-picker.scss | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/ui/date-picker/src/styles/date-picker.scss b/packages/ui/date-picker/src/styles/date-picker.scss index b56eb801e..7914fe362 100644 --- a/packages/ui/date-picker/src/styles/date-picker.scss +++ b/packages/ui/date-picker/src/styles/date-picker.scss @@ -236,7 +236,7 @@ $calendar-large-background-border-radius: $calendar-large-indicator-border-radiu &__prefix { display: inline-flex; - margin-left: use-spacing(3); + margin-left: use-spacing(4); align-items: center; flex-shrink: 0; color: use-color('gray', 700); From 91d24ad12d36a50587882131b10f027ca9f553fc Mon Sep 17 00:00:00 2001 From: yangxuexue Date: Thu, 20 Jun 2024 11:48:21 +0800 Subject: [PATCH 7/7] =?UTF-8?q?fix(date-picker):=20=E4=BF=AE=E6=94=B9?= =?UTF-8?q?=E5=89=8D=E7=BC=80=E5=B7=A6=E9=97=B4=E8=B7=9D(#2894)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- packages/ui/date-picker/src/styles/date-picker.scss | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/ui/date-picker/src/styles/date-picker.scss b/packages/ui/date-picker/src/styles/date-picker.scss index 7914fe362..fc5334d02 100644 --- a/packages/ui/date-picker/src/styles/date-picker.scss +++ b/packages/ui/date-picker/src/styles/date-picker.scss @@ -236,7 +236,7 @@ $calendar-large-background-border-radius: $calendar-large-indicator-border-radiu &__prefix { display: inline-flex; - margin-left: use-spacing(4); + margin-left: use-spacing(6); align-items: center; flex-shrink: 0; color: use-color('gray', 700);