Skip to content

Commit

Permalink
Next theme (#1298)
Browse files Browse the repository at this point in the history
* fix(Address): 修复Address组件通过点击CloseIcon和Overlay关闭后,无法再次打开的问题 (#1233)

* fix(button): 渐变色导致边框出现重叠 (#1250)

* chore(release): v2.0.6

* feat: uploader 添加上传的响应数据 (#1251)

* feat: formitem label 支持 reactnode (#1254)

* chore: 优化 any 类型 (#1222)

* docs(SearchBar): 补充 onClear 属性说明 (#1256)

* chore(release): v2.0.7

* feat: 增加了space组件 (#1259)

* refactor: tabs 去除 console (#1261)

Remove console log

* chore(script): 简化开发环境启动逻辑 (#1264)

* chore(scriptt): 简化开发环境启动逻辑

* chore(script): 调整 taro demo 生成逻辑

* chore(release): v2.0.8

* fix: space 版本号修改为 2.0 (#1265)

* chore(config): 优化 taro demo 环境配置文件 (#1266)

* docs: cascader 文档更新 (#1270)

* feat(notify): 支持函数调用的展开和关闭 (#1271)

* docs: 升级文档更新 (#1274)

* docs: tag 文档和 demo 同步 (#1275)

* docs: tag 文档和 demo 同步

* docs: tag 文档和 demo 同步

* chore(release): v2.0.9

* feat: 日历组件支持在 footer 部分的children自定义,增加demo 日历+datepicker的交互demo

* docs: 补充文档

* fix: elevator 计算索引出现 -1,导致组件运行报错 (#1276)

* fix: review

* feat: loading 组件 (#1204)

* feat: loading功能实现,目前由于taro环境在windows10下无法启动,所以只测试了h5版本的代码

* fix:修正eslint的一些错误

* fix: 修正测试用例用的问题, 坑: 使用npm run add后生成的模板,tsx里面会有引入scss,但是实际上并不能 引入这个文件,否则执行测试就报错

* fix: eslint格式规范修正

* fix: 排列方式的设置统一改成和其他组件一样, direction=horizontal|vertical

* fix: 去掉一些可以用主题和样式来配置的属性,修正了对taro的支持

* fix: 根据规范,修改代码

* fix: 修正一个导出类型的路径bug

* feat: 日历支持footer的children定义,增加日历+datepicker的demo (#1277)

* feat: 日历组件支持在 footer 部分的children自定义,增加demo 日历+datepicker的交互demo

* docs: 补充文档

* fix: review

* fix: loading 组件导出 props 类型 (#1278)

* feat: 修改名字,废弃-0

* chore(release): v2.0.10

* feat: 修订名称。

* docs: numberkeyboard 的 type 属性类型更新 (#1284)

* feat: 新增 tour 引导组件 (#1279)

* docs: step 组件的 description 属性示例改为节点的实现方式 (#1289)

* docs: divider 组件的 styles 属性示例改为 style (#1290)

* fix: numberkeyboard 设置标题后,完成按钮应该触发 onConfirm 事件 (#1285)

* docs: numberkeyboard 的 type 属性类型更新

* fix: numberkeyboard 设置标题后,完成按钮应该触发 onConfirm 事件

* fix: input 组件点击清除图标无法清空内容 (#1292)

* docs: 调整 image tao 文档中引入包名 (#1295)

* fix: uploader taro-h5 上传状态样式错乱 (#1293)

* fix: uploader h5/taro 增加校验 (#1297)

* fix: 修改migrate文档

* fix: 调整文档

* fix: 修改v1升级到v2的兼容文档

* fix: 提交h5的uploader样式错乱的问题

* fix: 提交uploader校验判断

* fix: h5下多选上传时 uid 重复的问题 (#1269)

Co-authored-by: liuqh <[email protected]>

* feat: 通用字号。

* feat: 通用+button,button的样式展示逻辑做了修订。

* docs: button

* feat: button 增加 rightIcon ,增加仅有icon的样式处理。

---------

Co-authored-by: Tralafalgar Wang <[email protected]>
Co-authored-by: oasis-cloud <[email protected]>
Co-authored-by: 逍遥 <[email protected]>
Co-authored-by: junjun666 <[email protected]>
Co-authored-by: ivan-My <[email protected]>
Co-authored-by: vapao <[email protected]>
Co-authored-by: Eiinu <[email protected]>
Co-authored-by: mike8625 <[email protected]>
Co-authored-by: Liuqh233 <[email protected]>
Co-authored-by: liuqh <[email protected]>
  • Loading branch information
11 people authored Aug 9, 2023
1 parent 870b583 commit 0ae461f
Show file tree
Hide file tree
Showing 308 changed files with 8,411 additions and 1,934 deletions.
45 changes: 45 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,48 @@
# v2.0.10
`2023-08-04`

* :sparkles: feat: loading 组件 (#1204) @mike8625
* :sparkles: feat: 日历支持footer的children定义,增加日历+datepicker的demo (#1277) @xiaoyatong
* :bug: fix: elevator 计算索引出现 -1,导致组件运行报错 (#1276) @oasis-cloud
* :bug: fix: loading 组件导出 props 类型 (#1278) @oasis-cloud


# v2.0.9
`2023-08-02`

* :sparkles: feat(notify): 支持函数调用的展开和关闭 (#1271) @oasis-cloud
* :bug: fix: space 版本号修改为 2.0 (#1265) @oasis-cloud
* 🔨 chore(config): 优化 taro demo 环境配置文件 (#1266) @oasis-cloud
* 📖 docs: cascader 文档更新 (#1270) @vapao
* 📖 docs: tag 文档和 demo 同步 (#1275) @oasis-cloud
* 📖 docs: 升级文档更新 (#1274) @oasis-cloud


# v2.0.8
`2023-07-28`

* :sparkles: feat: 增加了space组件 (#1259) @ivan-My
* 🛠 refactor: tabs 去除 console (#1261) @vapao
* 🔨 chore(script): 简化开发环境启动逻辑 (#1264) @Eiinu



# v2.0.7
`2023-07-26`

* :sparkles: feat: formitem label 支持 reactnode (#1254) @oasis-cloud
* :sparkles: feat: uploader 添加上传的响应数据 (#1251) @逍遥
* 🔨 chore: 优化 any 类型 (#1222) @junjun666
* 📖 docs(SearchBar): 补充 onClear 属性说明 (#1256) @Tralafalgar Wang


# v2.0.6
`2023-07-21`

* :bug: fix(Address): 修复Address组件通过点击CloseIcon和Overlay关闭后,无法再次打开的问题 (#1233) @Tralafalgar Wang
* :bug: fix(button): 渐变色导致边框出现重叠 (#1250) @oasis-cloud


# v2.0.5
`2023-07-19`

Expand Down
7 changes: 5 additions & 2 deletions migrate-from-v1.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,13 @@ npm install @nutui/nutui-react-taro
3. 处理不兼容更新

从 NutUI React 1.x 到 NutUI React 2.x 存在一些不兼容更新,需要仔细阅读不兼容更新内容,并依次处理。

你可以手动对照下面的列表逐条检查代码进行修改,另外,我们也提供了一个 codemod cli 工具 @nutui/nutui-react-codemod 以帮助你快速升级到 v2 版本。在运行 codemod cli 前,请先提交你的本地代码修改。

## 兼容更新
1. 组件样式处理

新增了按需引入 css 文件的支持。可通过 babel-import-plugin 插件实现
新增了按需引入 css 文件的支持,同时保留了按需引入 scss 文件的能力。可通过 babel-import-plugin 插件实现按需引入 css

H5配置如下:
```json
Expand Down Expand Up @@ -50,7 +53,7 @@ plugins: [
style: 'css',
camel2DashComponentName: false,
},
"nutui-react",
"nutui-react-taro",
]
]
```
Expand Down
20 changes: 10 additions & 10 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@nutui/nutui-react-taro",
"version": "2.0.5",
"name": "@nutui/nutui-react",
"version": "2.0.10",
"style": "dist/style.css",
"main": "dist/nutui.react.umd.js",
"module": "dist/esm/nutui-react.es.js",
Expand Down Expand Up @@ -44,13 +44,13 @@
"registry": "https://registry.npmjs.org/"
},
"scripts": {
"add": "node scripts/create-component-mode.js",
"add": "node scripts/create-component-mode.js && npm run prepare",
"generate:file": "node scripts/generate-nutui.js",
"generate:themes": "node scripts/generate-themes.js",
"generate:themes-dev": "node scripts/generate-themes-dev.js",
"checked": "npm run generate:file && tsc --project ./tsconfig.h5.json",
"dev": "npm run checked && vite --open --force",
"dev:jmapp": "npm run checked && VITE_APP_PROJECT_ID=jmapp vite --open --force",
"dev": "vite --open --force",
"dev:jmapp": "VITE_APP_PROJECT_ID=jmapp vite --open --force",
"dev:theme": "npm run generate:themes-dev && npm run checked && vite --force --config vite.config.theme.ts",
"replace:scss": "node scripts/replace-scss-alias.js",
"build:loader-style": "node scripts/generate-loader-style.js",
Expand All @@ -67,15 +67,15 @@
"lint": "eslint ./src/packages",
"lint:fix": "eslint --fix ./src/packages",
"publish:beta": "npm publish --tag beta",
"prepare": "husky install",
"prepare": "husky install && npm run generate:file && npm run generate:file:taro && npm run generate:file:taro:pages",
"test": "jest",
"generate:file:taro": "node scripts/taro/generate-nutui-taro.js",
"checked:taro": "npm run generate:file:taro && tsc --project ./tsconfig.taro.json",
"generate:file:taro:pages": "node scripts/taro/generate-taro-pages.js",
"dev:taro:weapp": "npm run checked:taro && npm run generate:file:taro:pages && cd ./src/sites/mobile-taro && npm run dev:weapp",
"dev:taro:jd": "npm run checked:taro && npm run generate:file:taro:pages && cd ./src/sites/mobile-taro && npm run dev:jd",
"dev:taro:h5": "npm run checked:taro && npm run generate:file:taro:pages && cd ./src/sites/mobile-taro && npm run dev:h5",
"dev:taro:weapp:jmapp": "npm run checked:taro && VITE_APP_PROJECT_ID=jmapp npm run generate:file:taro:pages && cd ./src/sites/mobile-taro && npm run dev:weapp:jmapp",
"dev:taro:weapp": "cd ./src/sites/mobile-taro && npm run dev:weapp",
"dev:taro:jd": "cd ./src/sites/mobile-taro && npm run dev:jd",
"dev:taro:h5": "cd ./src/sites/mobile-taro && npm run dev:h5",
"dev:taro:weapp:jmapp": "cd ./src/sites/mobile-taro && npm run dev:weapp:jmapp",
"build:taro": "npm run checked:taro && node scripts/create-theme-typings.js && vite build --config vite.config.build.taro.ts && npm run build:taro:es && npm run build:css && npm run build:loader-style && npm run build:component:css && npm run build:locales && TARO=1 node scripts/add-comments-to-dts.js",
"build:taro:es": "vite build --config vite.config.build.disperse.taro.ts",
"build:taro:jmapp": "npm run checked:taro && VITE_APP_PROJECT_ID=jmapp node scripts/create-theme-typings.js && vite build --config vite.config.build.taro.ts && npm run build:taro:es && VITE_APP_PROJECT_ID=jmapp npm run build:css && VITE_APP_PROJECT_ID=jmapp npm run build:loader-style && VITE_APP_PROJECT_ID=jmapp npm run build:component:css && npm run build:locales && TARO=1 node scripts/add-comments-to-dts.js",
Expand Down
1 change: 0 additions & 1 deletion scripts/format-table-markdown.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ function convertMdTables(inputFile, outputFile) {

// 在 HTML 中查找表格,并将其转换为数组
const tables = html.match(/<table[\s\S]*?<\/table>/g)

// 将数组中的每个表格转换为对象
const tableObjects = tables.map((table) => {
const rows = table.match(/<tr[\s\S]*?<\/tr>/g)
Expand Down
47 changes: 16 additions & 31 deletions scripts/taro/generate-taro-pages.js
Original file line number Diff line number Diff line change
Expand Up @@ -39,37 +39,22 @@ const createIndexConfig = (enName, package) => {
resolve(`生成index.config.ts文件成功`)
})

// 拷贝demo
const fileDemoPath = path.resolve(dirPath, `index.tsx`)
let demoPath = `src/packages/${nameLc}/demo.taro.tsx`
fse.readFile(demoPath, (err, data) => {
if (!err) {
let fileString = data.toString()
const lines = fileString.split('\n')
const reg =
/import{1,}[\w\s\S]+(\'@\/packages\/nutui\.react\.taro\'){1,}/g
let fileStrArr = fileString.match(reg)
fileStrArr = fileStrArr[0].split('import')
// let importScssStr = ''
// for (let i = 0, lens = fileStrArr.length; i < lens; i++) {
// if (fileStrArr[i].indexOf('@/packages/nutui.react.taro') != -1) {
// let str = fileStrArr[i]
// str = str.substring(str.indexOf('{') + 1, str.indexOf('}'))
// let strs = str.split(',')
// strs.forEach((namestr) => {
// namestr = namestr.trim()
// namestr &&
// (importScssStr += `import '@/packages/${namestr.toLowerCase()}/${namestr.toLowerCase()}.scss';\n`)
// })
// }
// }
// lines.splice(1, 0, importScssStr)
fileString = lines.join('\n')
fsExtra.outputFile(fileDemoPath, fileString, 'utf8', (error) => {
if (error) console.log('Error', error)
// console.log(`文件写入成功`)
})
}
// 生成 demo
const demoContent = `import Demo from '@/packages/${nameLc}/demo.taro';
export default Demo;`
const demoDirPath = path.join(
__dirname,
`../../src/sites/mobile-taro/src/${enName}/pages/${nameLc}`
)
const demoFilePath = path.join(demoDirPath, `index.tsx`)
if (!fs.existsSync(demoDirPath)) {
fs.mkdirSync(demoDirPath, { recursive: true }, (err) => {
console.log('mkdir error', err)
})
}
fs.writeFile(demoFilePath, demoContent, (err) => {
if (err) { throw err }
resolve(`生成 index.tsx 文件成功`)
})
}
})
Expand Down
35 changes: 34 additions & 1 deletion src/config.json
Original file line number Diff line number Diff line change
Expand Up @@ -212,6 +212,17 @@
"exportEmpty": true,
"author": "yushuang24"
},
{
"version": "2.0.0",
"name": "Space",
"type": "component",
"cName": "间距",
"desc": "元素之间的间距,保持相同的宽度",
"sort": 8,
"show": true,
"taro": true,
"author": "ivan"
},
{
"version": "2.0.0",
"name": "Sticky",
Expand Down Expand Up @@ -709,6 +720,17 @@
"taro": true,
"author": "swag~jun"
},
{
"version": "2.0.0",
"name": "Loading",
"type": "component",
"cName": "加载中",
"desc": "加载图标,用于显示正在加载中的状态",
"sort": 15,
"show": true,
"taro": true,
"author": "mike8625"
},
{
"version": "2.0.0",
"name": "NoticeBar",
Expand Down Expand Up @@ -1036,6 +1058,17 @@
"taro": true,
"author": "lzz"
},
{
"version": "2.0.0",
"name": "Tour",
"type": "component",
"cName": "引导",
"desc": "用于引导用户了解产品功能的气泡组件。自 4.0 版本开始提供该组件。",
"sort": 24,
"show": true,
"taro": true,
"author": "swag~jun"
},
{
"version": "2.0.0",
"name": "Video",
Expand Down Expand Up @@ -1135,4 +1168,4 @@
]
}
]
}
}
5 changes: 5 additions & 0 deletions src/locales/base.ts
Original file line number Diff line number Diff line change
Expand Up @@ -126,6 +126,11 @@ export interface BaseLang {
refreshingText: string
completeText: string
}
tour: {
prevStepText: string
completeText: string
nextStepText: string
}
watermark: {
errorCanvasTips: string
}
Expand Down
5 changes: 5 additions & 0 deletions src/locales/en-US.ts
Original file line number Diff line number Diff line change
Expand Up @@ -125,6 +125,11 @@ const enUS: BaseLang = {
refreshingText: 'Loading...',
completeText: 'Refresh successful',
},
tour: {
prevStepText: 'Previous',
completeText: 'Finish',
nextStepText: 'Next step',
},
watermark: {
errorCanvasTips: 'Canvas is not supported in the current environment',
},
Expand Down
5 changes: 5 additions & 0 deletions src/locales/id-ID.ts
Original file line number Diff line number Diff line change
Expand Up @@ -126,6 +126,11 @@ const idID: BaseLang = {
refreshingText: 'Memuat...',
completeText: 'Penyegaran berhasil',
},
tour: {
prevStepText: 'Sebelumnya',
completeText: 'Menyelesaikan',
nextStepText: 'Langkah berikutnya',
},
watermark: {
errorCanvasTips: 'Canvas is not supported in the current environment',
},
Expand Down
5 changes: 5 additions & 0 deletions src/locales/tr-TR.ts
Original file line number Diff line number Diff line change
Expand Up @@ -134,6 +134,11 @@ const trTR: BaseLang = {
refreshingText: 'Yükleniyor...',
completeText: 'Yenileme başarılı',
},
tour: {
prevStepText: 'Sonraki adım',
completeText: 'Sona ermek',
nextStepText: 'Sonraki adım',
},
watermark: {
errorCanvasTips: 'Geçerli ortam Canvası desteklemiyor',
},
Expand Down
5 changes: 5 additions & 0 deletions src/locales/zh-CN.ts
Original file line number Diff line number Diff line change
Expand Up @@ -126,6 +126,11 @@ const zhCN: BaseLang = {
refreshingText: '加载中...',
completeText: '刷新成功',
},
tour: {
prevStepText: '上一步',
completeText: '完成',
nextStepText: '下一步',
},
watermark: {
errorCanvasTips: '当前环境不支持Canvas',
},
Expand Down
5 changes: 5 additions & 0 deletions src/locales/zh-TW.ts
Original file line number Diff line number Diff line change
Expand Up @@ -124,6 +124,11 @@ const zhTW: BaseLang = {
refreshingText: '加載中...',
completeText: '刷新成功',
},
tour: {
prevStepText: '上一步',
completeText: '完成',
nextStepText: '下一步',
},
watermark: {
errorCanvasTips: '當前環境不支持Canvas',
},
Expand Down
5 changes: 5 additions & 0 deletions src/locales/zh-UG.ts
Original file line number Diff line number Diff line change
Expand Up @@ -124,6 +124,11 @@ const zhUG: BaseLang = {
refreshingText: 'يېڭىلىنىۋاتىدۇ...',
completeText: 'تامام',
},
tour: {
prevStepText: 'ئالدىنقى',
completeText: 'تامام',
nextStepText: 'كېيىنكى قەدەم',
},
watermark: {
errorCanvasTips: 'Canvas نى قوللىمايدۇ',
},
Expand Down
10 changes: 5 additions & 5 deletions src/packages/actionsheet/actionsheet.scss
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
&__description {
padding: 10px;
display: block;
font-size: $font-text;
font-size: $font-size;
color: $color-text;
margin-inline-start: 0px;
}
Expand All @@ -31,14 +31,14 @@
padding: 10px;
text-align: $actionsheet-item-text-align;
line-height: $actionsheet-item-line-height;
font-size: $font-text;
font-size: $font-size;
color: $actionsheet-item-color;
background-color: $color-card-background;
background-color: $color-background-overlay;
cursor: pointer;

&-description {
display: block;
font-size: $font-help;
font-size: $font-size-small;
color: $color-text;
}

Expand All @@ -47,7 +47,7 @@
}

&.disabled {
color: $color-disabled !important;
color: $color-text-disable !important;
cursor: not-allowed;
}
}
Expand Down
Loading

0 comments on commit 0ae461f

Please sign in to comment.