Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions src/packages/calendar/calendar.taro.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ export interface CalendarProps {
showSubTitle?: boolean
scrollAnimation?: boolean
firstDayOfWeek: number
closeIcon?: ReactNode
disableDate: (date: CalendarDay) => boolean
renderHeaderButtons?: () => string | JSX.Element
renderDay?: (date: CalendarDay) => string | JSX.Element
Expand Down Expand Up @@ -88,6 +89,7 @@ export const Calendar = React.forwardRef<
showSubTitle,
scrollAnimation,
firstDayOfWeek,
closeIcon,
disableDate,
renderHeaderButtons,
renderDay,
Expand Down Expand Up @@ -176,6 +178,7 @@ export const Calendar = React.forwardRef<
onOverlayClick={closePopup}
onCloseIconClick={closePopup}
style={{ height: '83%' }}
closeIcon={closeIcon}
>
{renderItem()}
</Popup>
Expand Down
3 changes: 3 additions & 0 deletions src/packages/calendar/calendar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ export interface CalendarProps {
showSubTitle?: boolean
scrollAnimation?: boolean
firstDayOfWeek: number
closeIcon?: ReactNode
disableDate: (date: CalendarDay) => boolean
renderHeaderButtons?: () => string | JSX.Element
renderDay?: (date: CalendarDay) => string | JSX.Element
Expand Down Expand Up @@ -88,6 +89,7 @@ export const Calendar = React.forwardRef<
showSubTitle,
scrollAnimation,
firstDayOfWeek,
closeIcon,
disableDate,
renderHeaderButtons,
renderDay,
Expand Down Expand Up @@ -172,6 +174,7 @@ export const Calendar = React.forwardRef<
position="bottom"
round
closeable
closeIcon={closeIcon}
destroyOnClose
onOverlayClick={closePopup}
onCloseIconClick={closePopup}
Expand Down
2 changes: 2 additions & 0 deletions src/packages/calendar/demos/h5/demo1.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import React, { useState } from 'react'
import { Cell, Calendar } from '@nutui/nutui-react'
import { Star } from '@nutui/icons-react'

const Demo1 = () => {
const d = new Date()
Expand Down Expand Up @@ -39,6 +40,7 @@ const Demo1 = () => {
onClose={closeSwitch}
onConfirm={setChooseValue}
onDayClick={select}
closeIcon={<Star />}
/>
</>
)
Expand Down
2 changes: 2 additions & 0 deletions src/packages/calendar/demos/taro/demo1.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import React, { useState } from 'react'
import { Cell, Calendar } from '@nutui/nutui-react-taro'
import { Star } from '@nutui/icons-react'

const Demo1 = () => {
const d = new Date()
Expand Down Expand Up @@ -39,6 +40,7 @@ const Demo1 = () => {
onClose={closeSwitch}
onConfirm={setChooseValue}
onDayClick={select}
closeIcon={<Star />}
/>
</>
)
Expand Down
1 change: 1 addition & 0 deletions src/packages/calendar/doc.en-US.md
Original file line number Diff line number Diff line change
Expand Up @@ -120,6 +120,7 @@ import { Calendar } from '@nutui/nutui-react'
| showSubTitle | whether to show sub title for calendar | `boolean` | `true` |
| scrollAnimation | whether to start scroll animation | `boolean` | `true` |
| firstDayOfWeek | first day of week | `0-6` | `0` |
| closeIcon | Custom Icon | `ReactNode` | `close` |
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue

新属性 closeIcon 已正确添加,但存在一些问题需要注意。

  1. 新属性 closeIcon 已正确添加到 Props 表格中,包括描述、类型和默认值。这很好。

  2. 然而,我注意到文档中使用的属性名称是 closeIcon,而 PR 目标中提到的是 deleteIcon。这里存在不一致性,需要确认正确的属性名称并在整个文档中保持一致。

  3. 建议在演示部分添加一个使用这个新属性的例子,以便用户更好地理解如何使用它。

| disableDate | set disable date | `(date: CalendarDay) => boolean` | `-` |
| renderHeaderButtons | custom buttons, under the title but above the subtitle | `() => string` \| `JSX.Element` | `-` |
| renderDay | day info | `(date: CalendarDay) => string` \| `JSX.Element` | `-` |
Expand Down
1 change: 1 addition & 0 deletions src/packages/calendar/doc.md
Original file line number Diff line number Diff line change
Expand Up @@ -120,6 +120,7 @@ import { Calendar } from '@nutui/nutui-react'
| showSubTitle | 是否展示日期标题 | `boolean` | `true` |
| scrollAnimation | 是否启动滚动动画 | `boolean` | `true` |
| firstDayOfWeek | 设置周起始日 | `0-6` | `0` |
| closeIcon | 自定义 Icon | `ReactNode` | `close` |
| disableDate | 设置不可选日期 | `(date: CalendarDay) => boolean` | `-` |
| renderHeaderButtons | 自定义日历标题下部,可用以添加自定义操作 | `() => string` \| `JSX.Element` | `-` |
| renderDay | 日期信息 | `(date: CalendarDay) => string` \| `JSX.Element` | `-` |
Expand Down
1 change: 1 addition & 0 deletions src/packages/calendar/doc.taro.md
Original file line number Diff line number Diff line change
Expand Up @@ -120,6 +120,7 @@ import { Calendar } from '@nutui/nutui-react-taro'
| showSubTitle | 是否展示日期标题 | `boolean` | `true` |
| scrollAnimation | 是否启动滚动动画 | `boolean` | `true` |
| firstDayOfWeek | 设置周起始日 | `0-6` | `0` |
| closeIcon | 自定义 Icon | `ReactNode` | `close` |
| disableDate | 设置不可选日期 | `(date: CalendarDay) => boolean` | `-` |
| renderHeaderButtons | 自定义日历标题下部,可用以添加自定义操作 | `() => string` \| `JSX.Element` | `-` |
| renderDay | 日期信息 | `(date: CalendarDay) => string` \| `JSX.Element` | `-` |
Expand Down
1 change: 1 addition & 0 deletions src/packages/calendar/doc.zh-TW.md
Original file line number Diff line number Diff line change
Expand Up @@ -120,6 +120,7 @@ import { Calendar } from '@nutui/nutui-react'
| showSubTitle | 是否展示日期標題 | `boolean` | `true` |
| scrollAnimation | 是否啟動滾動動畫 | `boolean` | `true` |
| firstDayOfWeek | 設置周起始日 | `0-6` | `0` |
| closeIcon | 自定義 Icon | `ReactNode` | `close` |
| disableDate | 設置不可選日期 | `(date: CalendarDay) => boolean` | `-` |
| renderHeaderButtons | 自定義日歴標題下部,可用以添加自定義操作 | `() => string` \| `JSX.Element` | `-` |
| renderDay | 日期信息 | `(date: CalendarDay) => string` \| `JSX.Element` | `-` |
Expand Down
Loading