Skip to content

Commit

Permalink
Merge pull request #1393 from ant-design/5.3.0
Browse files Browse the repository at this point in the history
* feat: Modal add useModal(#1383)

* feat: Picker support modalType(#1383)

* feat: Carousel support onScrollAnimationEnd

* fix:[Form] fix Require cycle

* feat:[typescript] export all component types

* feat: Slider add disabledStep、onSlidingStart、onSlidingComplete prop

* fix: Tooltip safe floatingStyles

* chore: test

* feat: Slider add tapToSeek prop

* feat: [email protected]

* fix: Picker & DatePicker defaultValue prop works(#1331)

* fix: DatePicker children extra placeholder

* feat: refactor useTheme by lodash.mergewith

* 代码暂存

* feat: Toast support useToast (#1388)

* fix: Switch styles doc

* feat: Modal support animationDuration prop(#1386)

* Temp 5.2.4 (#1392)

* feat: refactor Slider

* feat: Toast support useToast (#1388)

* fix: Switch styles doc

* feat: Modal support animationDuration prop(#1386)

* feat: 5.3.0

* feat: [email protected] not support jest snap (software-mansion/react-native-reanimated#6645)

* bump 5.3.0

* fix: Switch style in 0.76 (#1389)

* fix: Radio defaultCheck not works (#1380)

* feat: Upgrade [email protected]+
  • Loading branch information
1uokun authored Nov 14, 2024
2 parents 84f828d + ef8c268 commit 962895a
Show file tree
Hide file tree
Showing 78 changed files with 2,176 additions and 7,339 deletions.
21 changes: 21 additions & 0 deletions CHANGELOG.en-US.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,27 @@ toc: false
- Major version release is not included in this schedule for breadking change and new features.

---
### 5.3.0
`2024-11-14`
- 🌟 **Typescript**: export all component props types.
(To support for [nativewind](https://github.com/nativewind/nativewind))
- **Toast**:
- feat: add `useToast` hook method [#1388](https://github.com/ant-design/ant-design-mobile-rn/issues/1388)
- **Modal**
- feat: add `useModal` hook method [#1383](https://github.com/ant-design/ant-design-mobile-rn/issues/1383)
- feat: add `modalType` prop (Sync to **Picker**)
- **Carousel**
- feat: add `onScrollAnimationEnd` prop
- **Slider**
- feat: add `disabledStep``onSlidingStart``onSlidingComplete``tapToSeek` prop
- 🔥 Upgrade [email protected]+
- fix: [Switch] `style` props works [#1389](https://github.com/ant-design/ant-design-mobile-rn/issues/1398)
- fix: [Pagination] Remove `flex: 1` to avoid height collapse
- other fix
- fix: [Form] fix Require cycle
- fix: [Tooltip] safe floatingStyles
- fix: [Picker] `defaultValue` prop works [#1311](https://github.com/ant-design/ant-design-mobile-rn/issues/1311)
- fix: [Radio] `defaultChecked` prop works [#1380](https://github.com/ant-design/ant-design-mobile-rn/issues/1380)

### 5.2.3
`2024-09-09`
Expand Down
22 changes: 22 additions & 0 deletions CHANGELOG.zh-CN.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,28 @@ toc: false

---

### 5.3.0
`2024-11-14`
- 🌟 **Typescript**: 导出所有 component 的 props types。
(以支持 [nativewind](https://github.com/nativewind/nativewind))
- 🔥 **Toast**:
- feat: 新增 `useToast` hook 方法 [#1388](https://github.com/ant-design/ant-design-mobile-rn/issues/1388)
- 🔥 **Modal**
- feat: 新增 `useModal` hook 方法 [#1383](https://github.com/ant-design/ant-design-mobile-rn/issues/1383)
- feat: 新增 `modalType` 属性 (**Picker** 也同步支持)
- **Carousel**
- feat: 新增 `onScrollAnimationEnd` 属性
- **Slider**
- feat: 新增 `disabledStep``onSlidingStart``onSlidingComplete``tapToSeek` 属性
- 🔥 适配 [email protected]+
- fix: [Switch] `style` props works [#1389](https://github.com/ant-design/ant-design-mobile-rn/issues/1398)
- fix: [Pagination] 移除`flex: 1`,避免高度坍塌
- 其他fix
- fix: [Form] fix Require cycle
- fix: [Tooltip] safe floatingStyles
- fix: [Picker] `defaultValue` prop works [#1311](https://github.com/ant-design/ant-design-mobile-rn/issues/1311)
- fix: [Radio] `defaultChecked` prop works [#1380](https://github.com/ant-design/ant-design-mobile-rn/issues/1380)

### 5.2.3
`2024-09-09`
- 🔥 **Carousel**
Expand Down
29 changes: 15 additions & 14 deletions components/carousel/index.en-US.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,20 +6,21 @@ title: Carousel

## API

Properties | Descrition | Type | Default
-----------|------------|------|--------
| afterChange | callback to be called after a slide is changed | (current: number) => void | |
| autoplay | autoplay mode active | Boolean | false |
| autoplayInterval | interval for autoplay iteration | Number | 3000 |
| dots | whether to display the indication dots | Boolean | true |
| dotStyle | style of dots | ViewStyle | |
| dotActiveStyle | style of active dot | ViewStyle | |
| infinite | whether is infinite loop | Boolean | false |
| pageStyle | style of the carousel page | ViewStyle | |
| pagination | A generator function which could be used to customized pagination. | (props) => ReactNode | |
| selectedIndex | current selected index | number | 0 |
| style | ScrollView style<br/>(`tips: Recommended setting, the overall carousel size is determined by the container scrollview and not the inner page`) | ViewStyle | |
| vertical | controls the pagination display direction. | Boolean | false |
Properties | Descrition | Type | Default | Version
-----------|------------|------|---------|----------
| afterChange | callback to be called after a slide is changed | (current: number) => void | | |
| autoplay | autoplay mode active | Boolean | false | |
| autoplayInterval | interval for autoplay iteration | Number | 3000 | |
| dots | whether to display the indication dots | Boolean | true | |
| dotStyle | style of dots | ViewStyle | | |
| dotActiveStyle | style of active dot | ViewStyle | | |
| infinite | whether is infinite loop | Boolean | false | |
| pageStyle | style of the carousel page | ViewStyle | | |
| pagination | A generator function which could be used to customized pagination. | (props) => ReactNode | | |
| selectedIndex | current selected index | number | 0 | |
| style | ScrollView style<br/>(`tips: Recommended setting, the overall carousel size is determined by the container scrollview and not the inner page`) | ViewStyle | | |
| vertical | controls the pagination display direction. | Boolean | false | |
| onScrollAnimationEnd | Called when a scrolling animation ends. | ()=>void | | `5.3.0` |

The rest of the props of Carousel are exactly the same as the react-native [ScrollView](https://reactnative.dev/docs/scrollview.html);

Expand Down
8 changes: 6 additions & 2 deletions components/carousel/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -217,6 +217,9 @@ class Carousel extends React.PureComponent<CarouselProps, CarouselState> {
if (isScrollAnimationEnd) {
this.updateIndex(currentOffset)
this.autoplay()
if (this.props.onScrollAnimationEnd) {
this.props.onScrollAnimationEnd()
}
}
}

Expand Down Expand Up @@ -249,7 +252,7 @@ class Carousel extends React.PureComponent<CarouselProps, CarouselState> {
},
() => {
// web & android
this.scrollview?.current?.scrollTo({ ...offset, animated: true })
this.scrollview?.current?.scrollTo({ ...offset, animated: false })
this.autoplay()
},
)
Expand Down Expand Up @@ -440,7 +443,8 @@ class Carousel extends React.PureComponent<CarouselProps, CarouselState> {
onScrollEndDrag={this.onScrollEndDrag}
onScroll={this.onScroll}
onTouchStart={this.onTouchStartForWeb}
onTouchEnd={this.onTouchEndForWeb}>
onTouchEnd={this.onTouchEndForWeb}
onScrollAnimationEnd={undefined}>
{pages}
</ScrollView>
)
Expand Down
29 changes: 15 additions & 14 deletions components/carousel/index.zh-CN.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,20 +9,21 @@ subtitle: 走马灯

## API

属性 | 说明 | 类型 | 默认值
----|-----|------|------
| afterChange | 切换面板后的回调函数 | (current: number) => void ||
| autoplay | 是否自动切换 | Boolean | false |
| autoplayInterval | 自动切换的时间间隔 | Number | 3000 |
| dots | 是否显示面板指示点 | Boolean | true |
| dotStyle | 指示点样式 | ViewStyle ||
| dotActiveStyle | 当前激活的指示点样式 | ViewStyle ||
| infinite | 是否循环播放 | Boolean | false |
| pageStyle | 轮播页内样式 | ViewStyle ||
| pagination | 自定义 pagination | (props) => ReactNode | |
| selectedIndex | 手动设置当前显示的索引 | number | 0 |
| style | 轮播容器样式<br/>(建议设置,整体轮播大小由容器决定非页内决定) | ViewStyle ||
| vertical | 垂直显示 | Boolean | false |
属性 | 说明 | 类型 | 默认值 | 版本
----|-----|------|-------|-----
| afterChange | 切换面板后的回调函数 | (current: number) => void || |
| autoplay | 是否自动切换 | Boolean | false | |
| autoplayInterval | 自动切换的时间间隔 | Number | 3000 | |
| dots | 是否显示面板指示点 | Boolean | true | |
| dotStyle | 指示点样式 | ViewStyle || |
| dotActiveStyle | 当前激活的指示点样式 | ViewStyle || |
| infinite | 是否循环播放 | Boolean | false | |
| pageStyle | 轮播页内样式 | ViewStyle || |
| pagination | 自定义 pagination | (props) => ReactNode | | |
| selectedIndex | 手动设置当前显示的索引 | number | 0 | |
| style | 轮播容器样式<br/>(建议设置,整体轮播大小由容器决定非页内决定) | ViewStyle || |
| vertical | 垂直显示 | Boolean | false | |
| onScrollAnimationEnd | 当滚动动画结束时调用 | ()=>void || `5.3.0` |


Carousel 的其他属性和 react-native 内置组件[ScrollView](https://reactnative.dev/docs/scrollview.html) 一致;<br/>
Expand Down
Loading

0 comments on commit 962895a

Please sign in to comment.