Skip to content

Commit

Permalink
fix: merge next
Browse files Browse the repository at this point in the history
  • Loading branch information
xiaoyatong committed Dec 30, 2024
2 parents e3a6a6e + 7b33cda commit 3f3e3f8
Show file tree
Hide file tree
Showing 169 changed files with 3,624 additions and 941 deletions.
11 changes: 11 additions & 0 deletions codecov.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
# codecov.yml
coverage:
status:
project:
default:
threshold: 0.5%
target: 85%
patch:
default:
target: 80%

2 changes: 1 addition & 1 deletion cypress/e2e/common/pageWhiteTest.cy.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ export const checkTaroBlank = () => {
nav.forEach((item) => {
const path = item.enName
item.packages
.filter((i) => i.show && i.taro && i.version === '3.0.0')
.filter((i) => i.show && i.taro && i.dd)
.forEach((i) => {
visitTaroDemo(path, i.name)
})
Expand Down
4 changes: 2 additions & 2 deletions gulpfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@ const adaptedNameArray = []
// eslint-disable-next-line array-callback-return
config.nav.map((item) => {
item.packages.forEach((element) => {
const { name, version } = element
if (version !== '3.0.0') return // 未适配不导出
const { name, version, dd } = element
if (!dd) return // 未适配不导出
adaptedNameArray.push(name.toLowerCase())
})
})
Expand Down
39 changes: 16 additions & 23 deletions migrate-from-v2.md
Original file line number Diff line number Diff line change
Expand Up @@ -152,12 +152,7 @@ plugins: [

#### Button

- 移除 `plain`,通过 `fill="outline"` 实现
- 增加 `ref`,对外暴露组件内 `button` 元素
- CSS 变量中,对 `type` 类型对应的色值的定义,不在暴露到文档中,建议使用默认值,或修改主题变量
- 增加 `fill` 模式类型,`dashed`,修改 `fill` 默认值为 `outline`
- 增加 `rightIcon`,可满足同时设置左右两个icon的情况。
- 修改 `size``large` 时的默认 `width``100%` 的值,如果使用通栏的 `button`,可搭配 `block` 来使用。
- 去掉一些样式变量。如 `$button-default-font-weight` `$button-large-font-weight` 等。

#### Cell

Expand Down Expand Up @@ -291,6 +286,16 @@ plugins: [

- `offset` 重命名为 `indent`

#### SideBar

- 新增SideBar组件
- 支持属性value,用于当前激活的`item`的key
- 支持属性defaultValue, 表示未设置value时,`item`的key的默认值
- 支持属性contentDuration, 用于内容滚动动画时长
- 支持属性sidebarDuration, 用于侧栏滚动动画时长
- 支持属性onClick, 点击标签时触发
- 支持属性onChange, 当前激活的标签改变时触发

#### Tabbar

- `unactiveColor` 重命名为 `inactiveColor`
Expand Down Expand Up @@ -550,21 +555,9 @@ plugins: [

#### Dialog

- `okText` 重命名为 `confirmText`,规范命名。
- `mask` 重命名为 `overlay`,组件库中统一使用 Overlay 组件作为遮罩层,并使用 overlay 作为是否展示遮罩层的属性值。
- `closeOnClickOverlay` 重命名为 `closeOnOverlayClick`,组件库统一到该属性。
- `noOkBtn` 重命名为 `hideConfirmButton`,初始值不变,依然表示是否隐藏确认按钮,主要是为了语义化更强。
- `noCancelBtn` 重命名为 `hideCancelButton`,初始值不变,依然表示是否隐藏取消按钮,主要是为了语义化更强。
- `okBtnDisabled` 重命名为 `disableConfirmButton`,初始值不变,依然表示是否禁用确认按钮,主要是为了语义化更强。
- 移除 `noFooter`,使用 footer 统一处理,当 footer 为空时,及可替代该值。目前 noFooter 也需要手动声明是否为 noFooter;修改后需手动指出 footer={null}
- 移除 `textAlign`,改用样式变量 `--nutui-dialog-content-text-align` 或 SCSS 变量 `$dialog-content-text-align` 控制,默认值为 center。
- 移除 `cancelAutoClose`,改为 `beforeCancel``beforeClose` 来实现,在点击关闭或取消时,可先触发这两个方法,以确定是否要关闭弹框,如返回true,则关闭;否则不关闭。
- `onOk` 重命名为 `onConfirm`,规范命名。
- `onClosed` 重命名为 `onClose`,规范命名,关闭时触发。
- `onClickSelf` 重命名为 `onClick`,语义不变,仍表示点击弹框自身时触发事件。
- 增加 `overlayStyle``overlayClassName`,用来配置 Overlay 组件样式。
- 增加 `onOverlayClick`,支持点击overlay时,触发事件。
- `onCancel` 回调不会自动关闭弹层,需主动调用 `Dialog.close(xx)`
- 修改了操作按钮上下布局的样式;
- 当只有一个主操作按钮时,主操作按钮样式撑开;
- 增加了底部icon的大小设置的样式变量;修改右侧按钮的默认值为 16 px;

#### Drag

Expand Down Expand Up @@ -597,7 +590,7 @@ plugins: [
- 移除 `isAsync`,通过 `checked`实现
- 移除 `activeColor` ,通过css变量`--nutui-switch-open-background-color`实现
- 移除 `inactiveColor`,通过css变量`--nutui-switch-close-background-color`实现
- `activeText 属性类型更改为 `ReactNode`
- `activeText` 属性类型更改为`ReactNode`
- `inactiveText` 属性类型更改为 `ReactNode`

#### Toast
Expand Down Expand Up @@ -780,7 +773,7 @@ plugins: [
- 移除 `pageContent`,通过 indicator 实现
- `autoplay` 重命名为 `autoplay`
- `initPage` 重命名为 `defaultValue`
- `paginationVisible` 重命名为 `indicator`,类型改为` ReactNode`
- `paginationVisible` 重命名为 `indicator`,类型改为`ReactNode`
- `isPreventDefault` 重命名为 `preventDefault`
- `isStopPropagation` 重命名为 `stopPropagation`
- `isCenter` 重命名为 `center`
Expand Down
17 changes: 11 additions & 6 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@nutui/nutui-react",
"version": "3.0.0-beta.8",
"name": "@nutui/nutui-react-taro",
"version": "3.0.0-beta.9",
"style": "dist/style.css",
"main": "dist/nutui.react.umd.js",
"module": "dist/es/packages/nutui.react.build.js",
Expand Down Expand Up @@ -102,8 +102,8 @@
},
"dependencies": {
"@babel/runtime": "^7.23.9",
"@nutui/icons-react": "^3.0.0-beta.1",
"@nutui/icons-react-taro": "^3.0.1-beta.0",
"@nutui/icons-react": "^3.0.0-beta.2",
"@nutui/icons-react-taro": "^3.0.0-beta.2",
"@nutui/jdesign-icons-react-taro": "1.0.6-beta.2",
"@nutui/touch-emulator": "^1.0.0",
"@react-spring/web": "~9.6.1",
Expand All @@ -113,6 +113,8 @@
"classnames": "^2.5.1",
"lodash.isequal": "^4.5.0",
"lodash.kebabcase": "^4.1.1",
"lottie-miniprogram": "^1.0.12",
"lottie-react": "^2.4.0",
"react-transition-group": "^4.4.5"
},
"devDependencies": {
Expand All @@ -131,8 +133,8 @@
"@swc/core": "^1.4.8",
"@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/plugin-platform-weapp": "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 Expand Up @@ -228,6 +230,9 @@
},
"resolutions": {
"@types/react": "^18.2.57",
"@types/react-dom": "^18.2.19"
"@types/react-dom": "^18.2.19",
"sass": "1.77.6",
"@tarojs/api": "4.0.8-beta.1",
"@tarojs/components": "4.0.8-beta.1"
}
}
5 changes: 0 additions & 5 deletions packages/nutui-taro-demo/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -115,10 +115,5 @@
"postcss": "^8.4.35",
"stylelint": "^16.7.0",
"typescript": "^5.3.3"
},
"resolutions": {
"sass": "1.77.6",
"@tarojs/api": "4.0.8-beta.1",
"@tarojs/components": "4.0.8-beta.1"
}
}
4 changes: 2 additions & 2 deletions packages/nutui-taro-demo/scripts/taro/generate-nutui-taro.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,9 @@ const raws = []

config.nav.map((item) => {
item.packages.forEach((element) => {
let { name, show, type, taro, exportEmpty, exclude, version, rn } = element
let { name, show, type, taro, exportEmpty, exclude, version, rn, dd } = element
if (exclude) return
if (version !== '3.0.0') return
if (!dd) return

importStr += `import ${name} from '@/packages/${name.toLowerCase()}/index.taro'\n`
importStr += `export * from '@/packages/${name.toLowerCase()}/index.taro'\n`
Expand Down
2 changes: 1 addition & 1 deletion packages/nutui-taro-demo/src/pages/index/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ const Index = () => {
)}
<View className="index-components-sublist">
{nav.packages.map((com) =>
com.show && com.taro && com.version === '3.0.0' && (!search || new RegExp(search, 'ig').test(com.name.toLowerCase())) ? (
com.show && com.taro && com.dd && (!search || new RegExp(search, 'ig').test(com.name.toLowerCase())) ? (
<View
key={com.name}
className="index-components-sublist-item"
Expand Down
Loading

0 comments on commit 3f3e3f8

Please sign in to comment.