Skip to content

Commit

Permalink
Merge branch 'feat_v3.x' into feat_tabs_har
Browse files Browse the repository at this point in the history
  • Loading branch information
xiaoyatong authored Dec 5, 2024
2 parents b268d29 + fbfe98f commit facfb0c
Show file tree
Hide file tree
Showing 115 changed files with 2,317 additions and 835 deletions.
4 changes: 4 additions & 0 deletions migrate-from-v2.md
Original file line number Diff line number Diff line change
Expand Up @@ -616,6 +616,8 @@ plugins: [
- 移除 `isAsync`,通过 `checked`实现
- 移除 `activeColor` ,通过css变量`--nutui-switch-open-background-color`实现
- 移除 `inactiveColor`,通过css变量`--nutui-switch-close-background-color`实现
- `activeText 属性类型更改为 `ReactNode`
- `inactiveText` 属性类型更改为 `ReactNode`

#### Toast

Expand Down Expand Up @@ -829,6 +831,8 @@ plugins: [
- `upIconName` 重命名为 `riseIcon`,类型修改为 `React.Node`
- `downIconName` 重命名为 `dropIcon`,类型修改为 `React.Node`
- 移除 `iconSize`,通过`riseIcon``dropIcon`自定义传入icon大小
- 新增 `size`,star 尺寸, 默认值 `normal``12px`
- 新增 `showScore`, 展示评分

#### Video

Expand Down
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -132,6 +132,7 @@
"@tarojs/components": "4.0.8-beta.1",
"@tarojs/plugin-platform-alipay": "4.0.8-beta.1",
"@tarojs/plugin-platform-weapp": "4.0.8-beta.1",
"@tarojs/plugin-platform-jd": "4.0.8-beta.1",
"@tarojs/react": "4.0.8-beta.1",
"@tarojs/taro": "4.0.8-beta.1",
"@testing-library/jest-dom": "^6.4.2",
Expand Down
48 changes: 30 additions & 18 deletions packages/nutui-taro-demo/src/pages/index/index.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,16 @@
import Taro from '@tarojs/taro'
import { View, Image, Swiper, SwiperItem, Text, ScrollView, Button, Input, Video } from '@tarojs/components'
import {
View,
Image,
Swiper,
SwiperItem,
Text,
ScrollView,
Button,
Input,
Video,
Textarea,
} from '@tarojs/components'
import pkg from '@/packages/../config.json'
import packageJson from '@/packages/../../package.json'
import './index.scss'
Expand All @@ -8,9 +19,8 @@ import './index.scss'
const navs = pkg.nav
// console.log(navs)


// hack taro load button xml
console.log(Button, Input, Video,Image, Swiper, SwiperItem, )
console.log(Button, Input, Video, Image, Swiper, SwiperItem, Textarea)

// try {
// console.log('xxx', Schema)
Expand Down Expand Up @@ -39,37 +49,39 @@ const Index = () => {
}

return (
<ScrollView className='index'>
<View className='index-header'>
<ScrollView className="index">
<View className="index-header">
<Image
className='index-header-img'
src='https://img14.360buyimg.com/imagetools/jfs/t1/117879/25/28831/6279/6329723bE66715a2f/5f099b8feca9e8cc.png'
className="index-header-img"
src="https://img14.360buyimg.com/imagetools/jfs/t1/117879/25/28831/6279/6329723bE66715a2f/5f099b8feca9e8cc.png"
/>
<View className='index-header-info'>
<View className='index-header-info-h1'>NutUI React</View>
<View className='index-header-info-p'>
<View className="index-header-info">
<View className="index-header-info-h1">NutUI React</View>
<View className="index-header-info-p">
京东风格的轻量级小程序组件库 React 版
</View>
<View className='index-header-info-p'>
<Text className='index-header-info-text'>v{packageJson?.version}</Text>
<View className="index-header-info-p">
<Text className="index-header-info-text">
v{packageJson?.version}
</Text>
</View>
</View>
</View>
<View className='index-components'>
<View className="index-components">
{navs.map((nav) => (
<View key={nav.enName} className='index-components-item'>
<View key={nav.enName} className="index-components-item">
{nav.enName === 'dataentry' ? null : (
<View className='index-components-item-title'>{nav.name}</View>
<View className="index-components-item-title">{nav.name}</View>
)}
<View className='index-components-sublist'>
<View className="index-components-sublist">
{nav.packages.map((com) =>
com.show && com.taro && com.version === '3.0.0' ? (
<View
key={com.name}
className='index-components-sublist-item'
className="index-components-sublist-item"
>
<View
className='index-components-sublist-item-content'
className="index-components-sublist-item-content"
key={com.name}
onClick={() => gotoNext(com.name, nav.enName)}
>
Expand Down
15 changes: 15 additions & 0 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

21 changes: 18 additions & 3 deletions src/config.json
Original file line number Diff line number Diff line change
Expand Up @@ -642,6 +642,7 @@
"sort": 1,
"show": true,
"taro": true,
"v14": true,
"author": "dsj"
},
{
Expand Down Expand Up @@ -686,6 +687,7 @@
"sort": 11,
"show": true,
"taro": true,
"v14": true,
"author": "dsj"
},
{
Expand Down Expand Up @@ -897,6 +899,7 @@
"sort": 1,
"show": true,
"taro": true,
"v14": true,
"author": "VickyYe"
}
]
Expand Down Expand Up @@ -1002,8 +1005,8 @@
"sort": 17,
"show": true,
"taro": true,
"author": "songsong",
"v14": true
"v14": true,
"author": "songsong"
},
{
"version": "2.0.0",
Expand Down Expand Up @@ -1050,6 +1053,18 @@
"v14": true,
"author": "lkjh3214"
},
{
"version": "3.0.0",
"name": "Segmented",
"type": "component",
"cName": "分段选择器",
"desc": "用于带页面类型区分的内容型卡片切换,如主图视频、图文切换。",
"sort": 6,
"show": true,
"taro": true,
"v14": true,
"author": "lkjh3214"
},
{
"version": "3.0.0",
"name": "Price",
Expand Down Expand Up @@ -1202,7 +1217,7 @@
"author": "songsong"
},
{
"version": "2.0.0",
"version": "3.0.0",
"name": "TimeDetail",
"type": "component",
"cName": "配送时间",
Expand Down
7 changes: 1 addition & 6 deletions src/packages/configprovider/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -333,19 +333,13 @@ export type NutCSSVariables =
| 'nutuiCalendarDayFontWeight'
| 'nutuiCalendarDayActiveBorderRadius'
| 'nutuiHoverbuttonSpacing'
| 'nutuiSpacing16'
| 'nutuiHoverbuttonPositionBottom'
| 'nutuiHoverbuttonPositionRight'
| 'nutuiHoverbuttonItemBorderColor'
| 'nutuiBlack3'
| 'nutuiHoverbuttonItemBackground'
| 'nutuiGray1'
| 'nutuiHoverbuttonItemBackgroundActive'
| 'nutuiGray3'
| 'nutuiHoverbuttonItemIconColor'
| 'nutuiGray7'
| 'nutuiHoverbuttonItemIconColorActive'
| 'nutuiGray6'
| 'nutuiOverlayBgColor'
| 'nutuiOverlayZIndex'
| 'nutuiOverlayContentBgColor'
Expand Down Expand Up @@ -816,4 +810,5 @@ export type NutCSSVariables =
| 'nutuiResultpageDescriptionLineHeight'
| 'nutuiResultpageActionsMarginTop'
| 'nutuiSafeAreaMultiple'
| 'nutuiBlack3'
| 'nutuiBlack1'
1 change: 0 additions & 1 deletion src/packages/empty/doc.en-US.md
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,5 @@ The component provides the following CSS variables, which can be used to customi
| \--nutui-empty-image-small-size | When size is small, the size of the Empty component image | `120px` |
| \--nutui-empty-title-margin-top | The value of margin-top of the Empty component image title | `0px` |
| \--nutui-empty-title-line-height | Empty component image title line height | `$font-size-l` |
| \--nutui-empty-description-margin-top | The value of margin-top of the Empty component image description | `4px` |
| \--nutui-empty-description-line-height | Empty component image description line height | `1` |
| \--nutui-empty-background-color | Empty component background color | `#fff` |
1 change: 0 additions & 1 deletion src/packages/empty/doc.md
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,5 @@ import { Empty } from '@nutui/nutui-react'
| \--nutui-empty-image-small-size | size 为 small 时,Empty组件图片的尺寸大小 | `120px` |
| \--nutui-empty-title-margin-top | Empty组件图片标题margin-top的值 | `0px` |
| \--nutui-empty-title-line-height | Empty组件图片标题行高 | `$font-size-l` |
| \--nutui-empty-description-margin-top | Empty组件图片描述margin-top的值 | `4px` |
| \--nutui-empty-description-line-height | Empty组件图片描述行高 | `1` |
| \--nutui-empty-background-color | Empty组件背景色 | `#fff` |
1 change: 0 additions & 1 deletion src/packages/empty/doc.taro.md
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,5 @@ import { Empty } from '@nutui/nutui-react-taro'
| \--nutui-empty-image-small-size | size 为 small 时,Empty组件图片的尺寸大小 | `120px` |
| \--nutui-empty-title-margin-top | Empty组件图片标题margin-top的值 | `0px` |
| \--nutui-empty-title-line-height | Empty组件图片标题行高 | `$font-size-l` |
| \--nutui-empty-description-margin-top | Empty组件图片描述margin-top的值 | `4px` |
| \--nutui-empty-description-line-height | Empty组件图片描述行高 | `1` |
| \--nutui-empty-background-color | Empty组件背景色 | `#fff` |
1 change: 0 additions & 1 deletion src/packages/empty/doc.zh-TW.md
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,5 @@ import { Empty } from '@nutui/nutui-react'
| \--nutui-empty-image-small-size | size 爲 small 時,Empty組件圖片的尺寸大小 | `120px` |
| \--nutui-empty-title-margin-top | Empty組件圖片標題margin-top的值 | `0px` |
| \--nutui-empty-title-line-height | Empty組件圖片標題行高 | `$font-size-l` |
| \--nutui-empty-description-margin-top | Empty組件圖片描述margin-top的值 | `4px` |
| \--nutui-empty-description-line-height | Empty組件圖片描述行高 | `1` |
| \--nutui-empty-background-color | Empty組件背景色 | `#fff` |
4 changes: 2 additions & 2 deletions src/packages/empty/empty.scss
Original file line number Diff line number Diff line change
Expand Up @@ -47,12 +47,12 @@
&-actions-base {
display: flex;
flex-direction: row;
margin-top: 16px;
margin-top: 24px;
}
&-actions-small {
display: flex;
flex-direction: row;
margin-top: 24px;
margin-top: 16px;
}

&-action {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ exports[`child element count 1`] = `
>
<svg
aria-labelledby="Cart"
class="nut-icon nut-icon-Cart "
class="nut-icon nut-icon-Cart nut-icon"
role="presentation"
viewBox="0 0 1024 1024"
xmlns="http://www.w3.org/2000/svg"
Expand All @@ -37,7 +37,7 @@ exports[`child element count 1`] = `
>
<svg
aria-labelledby="Cart"
class="nut-icon nut-icon-Cart "
class="nut-icon nut-icon-Cart nut-icon"
role="presentation"
viewBox="0 0 1024 1024"
xmlns="http://www.w3.org/2000/svg"
Expand All @@ -58,7 +58,7 @@ exports[`child element count 1`] = `
>
<svg
aria-labelledby="Cart"
class="nut-icon nut-icon-Cart "
class="nut-icon nut-icon-Cart nut-icon"
role="presentation"
viewBox="0 0 1024 1024"
xmlns="http://www.w3.org/2000/svg"
Expand All @@ -71,6 +71,31 @@ exports[`child element count 1`] = `
</svg>
</div>
</div>
<div
class="nut-hoverbutton-item-container nut-hoverbutton-item-container-icontext"
>
<div
class="nut-hoverbutton-item-text-icon"
/>
<svg
aria-labelledby="Cart"
class="nut-icon nut-icon-Cart nut-icon"
role="presentation"
viewBox="0 0 1024 1024"
xmlns="http://www.w3.org/2000/svg"
>
<path
d="M0 65.17c0-24.21 19.37-43.84 43.24-43.84h51.14c70.46 0 128.85 55.4 133.55 126.68l.74 11.12h661.46c81.45 0 144 73.15 132.48 154.9l-33.02 234.45c-14.63 103.94-97.49 184.23-200.58 194.35l-467.47 45.86C246.4 796.07 180.12 739 175.1 662.63l-30.03-456.32v-.76l-3.42-51.69c-1.66-25.24-22.34-44.84-47.27-44.85H43.24C19.35 109.01 0 89.38 0 65.17m234.45 181.66 26.95 409.98c1.77 27.03 25.22 47.21 51.82 44.59l467.47-45.87c63.36-6.19 114.28-55.55 123.29-119.44L937 301.63c4.1-28.93-18.05-54.83-46.87-54.82h-655.7zm64.22 670.5a85.33 85.33 0 1 1-170.67 0 85.33 85.33 0 0 1 170.67 0M896 1002.67A85.33 85.33 0 1 0 896 832a85.33 85.33 0 0 0 0 170.67"
fill="currentColor"
fill-opacity="0.9"
/>
</svg>
<div
class="nut-hoverbutton-item-text"
>
购物
</div>
</div>
</div>
<div
class="nut-safe-area nut-safe-area-position-bottom"
Expand All @@ -95,7 +120,7 @@ exports[`emit click event 1`] = `
>
<svg
aria-labelledby="Cart"
class="nut-icon nut-icon-Cart "
class="nut-icon nut-icon-Cart nut-icon"
role="presentation"
viewBox="0 0 1024 1024"
xmlns="http://www.w3.org/2000/svg"
Expand All @@ -120,7 +145,7 @@ exports[`tabbar height 1`] = `
<div>
<div
class="nut-hoverbutton-container"
style="bottom: 64px;"
style="bottom: 108px;"
>
<div
class="nut-hoverbutton"
Expand All @@ -133,7 +158,7 @@ exports[`tabbar height 1`] = `
>
<svg
aria-labelledby="Cart"
class="nut-icon nut-icon-Cart "
class="nut-icon nut-icon-Cart nut-icon"
role="presentation"
viewBox="0 0 1024 1024"
xmlns="http://www.w3.org/2000/svg"
Expand Down
5 changes: 3 additions & 2 deletions src/packages/hoverbutton/__test__/hoverbutton.spec.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,10 @@ test('child element count', () => {
<HoverButton.Item icon={<Cart />} />
<HoverButton.Item icon={<Cart />} />
<HoverButton.Item icon={<Cart />} />
<HoverButton.Item icon={<Cart />}>购物</HoverButton.Item>
</HoverButton>
)
expect(container.querySelector('.nut-hoverbutton')?.childElementCount).toBe(3)
expect(container.querySelector('.nut-hoverbutton')?.childElementCount).toBe(4)
expect(container).toMatchSnapshot()
})

Expand All @@ -34,7 +35,7 @@ test('tabbar height', () => {

expect(container.querySelector('.nut-hoverbutton-container')).toHaveAttribute(
'style',
'bottom: 64px;'
'bottom: 108px;'
)
expect(container).toMatchSnapshot()
})
Empty file removed src/packages/hoverbutton/demo.scss
Empty file.
Loading

0 comments on commit facfb0c

Please sign in to comment.