File tree Expand file tree Collapse file tree 8 files changed +14
-0
lines changed Expand file tree Collapse file tree 8 files changed +14
-0
lines changed Original file line number Diff line number Diff line change @@ -23,6 +23,7 @@ export interface CalendarProps {
23
23
showSubTitle ?: boolean
24
24
scrollAnimation ?: boolean
25
25
firstDayOfWeek : number
26
+ closeIcon ?: ReactNode
26
27
disableDate : ( date : CalendarDay ) => boolean
27
28
renderHeaderButtons ?: ( ) => string | JSX . Element
28
29
renderDay ?: ( date : CalendarDay ) => string | JSX . Element
@@ -88,6 +89,7 @@ export const Calendar = React.forwardRef<
88
89
showSubTitle,
89
90
scrollAnimation,
90
91
firstDayOfWeek,
92
+ closeIcon,
91
93
disableDate,
92
94
renderHeaderButtons,
93
95
renderDay,
@@ -176,6 +178,7 @@ export const Calendar = React.forwardRef<
176
178
onOverlayClick = { closePopup }
177
179
onCloseIconClick = { closePopup }
178
180
style = { { height : '83%' } }
181
+ closeIcon = { closeIcon }
179
182
>
180
183
{ renderItem ( ) }
181
184
</ Popup >
Original file line number Diff line number Diff line change @@ -23,6 +23,7 @@ export interface CalendarProps {
23
23
showSubTitle ?: boolean
24
24
scrollAnimation ?: boolean
25
25
firstDayOfWeek : number
26
+ closeIcon ?: ReactNode
26
27
disableDate : ( date : CalendarDay ) => boolean
27
28
renderHeaderButtons ?: ( ) => string | JSX . Element
28
29
renderDay ?: ( date : CalendarDay ) => string | JSX . Element
@@ -88,6 +89,7 @@ export const Calendar = React.forwardRef<
88
89
showSubTitle,
89
90
scrollAnimation,
90
91
firstDayOfWeek,
92
+ closeIcon,
91
93
disableDate,
92
94
renderHeaderButtons,
93
95
renderDay,
@@ -172,6 +174,7 @@ export const Calendar = React.forwardRef<
172
174
position = "bottom"
173
175
round
174
176
closeable
177
+ closeIcon = { closeIcon }
175
178
destroyOnClose
176
179
onOverlayClick = { closePopup }
177
180
onCloseIconClick = { closePopup }
Original file line number Diff line number Diff line change 1
1
import React , { useState } from 'react'
2
2
import { Cell , Calendar } from '@nutui/nutui-react'
3
+ import { Star } from '@nutui/icons-react'
3
4
4
5
const Demo1 = ( ) => {
5
6
const d = new Date ( )
@@ -39,6 +40,7 @@ const Demo1 = () => {
39
40
onClose = { closeSwitch }
40
41
onConfirm = { setChooseValue }
41
42
onDayClick = { select }
43
+ closeIcon = { < Star /> }
42
44
/>
43
45
</ >
44
46
)
Original file line number Diff line number Diff line change 1
1
import React , { useState } from 'react'
2
2
import { Cell , Calendar } from '@nutui/nutui-react-taro'
3
+ import { Star } from '@nutui/icons-react'
3
4
4
5
const Demo1 = ( ) => {
5
6
const d = new Date ( )
@@ -39,6 +40,7 @@ const Demo1 = () => {
39
40
onClose = { closeSwitch }
40
41
onConfirm = { setChooseValue }
41
42
onDayClick = { select }
43
+ closeIcon = { < Star /> }
42
44
/>
43
45
</ >
44
46
)
Original file line number Diff line number Diff line change @@ -120,6 +120,7 @@ import { Calendar } from '@nutui/nutui-react'
120
120
| showSubTitle | whether to show sub title for calendar | ` boolean ` | ` true ` |
121
121
| scrollAnimation | whether to start scroll animation | ` boolean ` | ` true ` |
122
122
| firstDayOfWeek | first day of week | ` 0-6 ` | ` 0 ` |
123
+ | closeIcon | Custom Icon | ` ReactNode ` | ` close ` |
123
124
| disableDate | set disable date | ` (date: CalendarDay) => boolean ` | ` - ` |
124
125
| renderHeaderButtons | custom buttons, under the title but above the subtitle | ` () => string ` \| ` JSX.Element ` | ` - ` |
125
126
| renderDay | day info | ` (date: CalendarDay) => string ` \| ` JSX.Element ` | ` - ` |
Original file line number Diff line number Diff line change @@ -120,6 +120,7 @@ import { Calendar } from '@nutui/nutui-react'
120
120
| showSubTitle | 是否展示日期标题 | ` boolean ` | ` true ` |
121
121
| scrollAnimation | 是否启动滚动动画 | ` boolean ` | ` true ` |
122
122
| firstDayOfWeek | 设置周起始日 | ` 0-6 ` | ` 0 ` |
123
+ | closeIcon | 自定义 Icon | ` ReactNode ` | ` close ` |
123
124
| disableDate | 设置不可选日期 | ` (date: CalendarDay) => boolean ` | ` - ` |
124
125
| renderHeaderButtons | 自定义日历标题下部,可用以添加自定义操作 | ` () => string ` \| ` JSX.Element ` | ` - ` |
125
126
| renderDay | 日期信息 | ` (date: CalendarDay) => string ` \| ` JSX.Element ` | ` - ` |
Original file line number Diff line number Diff line change @@ -120,6 +120,7 @@ import { Calendar } from '@nutui/nutui-react-taro'
120
120
| showSubTitle | 是否展示日期标题 | ` boolean ` | ` true ` |
121
121
| scrollAnimation | 是否启动滚动动画 | ` boolean ` | ` true ` |
122
122
| firstDayOfWeek | 设置周起始日 | ` 0-6 ` | ` 0 ` |
123
+ | closeIcon | 自定义 Icon | ` ReactNode ` | ` close ` |
123
124
| disableDate | 设置不可选日期 | ` (date: CalendarDay) => boolean ` | ` - ` |
124
125
| renderHeaderButtons | 自定义日历标题下部,可用以添加自定义操作 | ` () => string ` \| ` JSX.Element ` | ` - ` |
125
126
| renderDay | 日期信息 | ` (date: CalendarDay) => string ` \| ` JSX.Element ` | ` - ` |
Original file line number Diff line number Diff line change @@ -120,6 +120,7 @@ import { Calendar } from '@nutui/nutui-react'
120
120
| showSubTitle | 是否展示日期標題 | ` boolean ` | ` true ` |
121
121
| scrollAnimation | 是否啟動滾動動畫 | ` boolean ` | ` true ` |
122
122
| firstDayOfWeek | 設置周起始日 | ` 0-6 ` | ` 0 ` |
123
+ | closeIcon | 自定義 Icon | ` ReactNode ` | ` close ` |
123
124
| disableDate | 設置不可選日期 | ` (date: CalendarDay) => boolean ` | ` - ` |
124
125
| renderHeaderButtons | 自定義日歴標題下部,可用以添加自定義操作 | ` () => string ` \| ` JSX.Element ` | ` - ` |
125
126
| renderDay | 日期信息 | ` (date: CalendarDay) => string ` \| ` JSX.Element ` | ` - ` |
You can’t perform that action at this time.
0 commit comments