Skip to content

Commit 7491bcc

Browse files
committed
Merge branch 'develop' of https://github.com/Tencent/tdesign-mobile-react into develop
2 parents fb655da + c8512cf commit 7491bcc

File tree

351 files changed

+52367
-18496
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

351 files changed

+52367
-18496
lines changed

.github/workflows/pr-comment-ci.yml

Lines changed: 89 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -15,30 +15,30 @@ jobs:
1515
steps:
1616
- uses: actions/checkout@v4
1717
with:
18+
repository: Tencent/tdesign
1819
sparse-checkout: |
19-
.github/CODEOWNERS
20+
.github/.pr-comment-ci-whitelist
2021
sparse-checkout-cone-mode: false
2122

2223
- uses: actions/github-script@v7
2324
id: get-action
2425
with:
2526
script: |
2627
const user = context.payload.comment.user.login
27-
core.debug(`user: ${user}`)
28+
core.info(`user: ${user}`)
2829
29-
const fs = require('fs')
30-
const CODEOWNERS = fs.readFileSync('.github/CODEOWNERS', 'utf8')
31-
core.debug(`CODEOWNERS: ${CODEOWNERS}`)
30+
const fs = require('fs');
31+
const whitelist = fs.readFileSync('.github/.pr-comment-ci-whitelist', 'utf8');
3232
33-
let isReviewer = false;
34-
CODEOWNERS.match(/@\w+/g).forEach((owner) => {
35-
if (owner === `@${user}`) {
36-
isReviewer = true
33+
let isWhitelist = false;
34+
whitelist.split('\n').forEach((owner) => {
35+
if (owner === user) {
36+
isWhitelist = true;
3737
}
38-
})
38+
});
3939
4040
let next_action = ''
41-
if (isReviewer) {
41+
if (isWhitelist) {
4242
const body = context.payload.comment.body
4343
core.info(`body: ${body}`)
4444
if (body.startsWith('/update-common')) {
@@ -47,6 +47,10 @@ jobs:
4747
if (body.startsWith('/update-snapshot')) {
4848
next_action='update-snapshot'
4949
}
50+
if (body.startsWith('/update-coverage')) {
51+
next_action='update-coverage'
52+
}
53+
5054
if(next_action){
5155
await github.rest.reactions.createForIssueComment({
5256
owner: context.repo.owner,
@@ -151,6 +155,21 @@ jobs:
151155
GH_TOKEN: ${{ secrets.PERSONAL_TOKEN }}
152156
run: gh pr checkout ${{ github.event.issue.number }} --recurse-submodules
153157

158+
- name: bot commtent
159+
id: bot-comment
160+
uses: actions/github-script@v7
161+
with:
162+
script: |
163+
const url = `${context.serverUrl}//${context.repo.owner}/${context.repo.repo}/actions/runs/${context.runId}`
164+
const urlLink = `[Open](${url})`
165+
const { data: comment } = await github.rest.issues.createComment({
166+
issue_number: context.issue.number,
167+
owner: context.repo.owner,
168+
repo: context.repo.repo,
169+
body: `⏳ 正在运行快照更新。。。 CI: ${urlLink}`
170+
})
171+
return comment.id
172+
154173
- name: git config
155174
run: |
156175
git config --local user.email "github-actions[bot]@users.noreply.github.com"
@@ -225,7 +244,65 @@ jobs:
225244
git commit -m "chore: update snapshot"
226245
fi
227246
git status
228-
247+
248+
- name: git push
249+
run: |
250+
git status
251+
git push || true
252+
253+
update-coverage:
254+
needs: check
255+
runs-on: ubuntu-latest
256+
if: ${{ needs.check.outputs.next_action == 'update-coverage' }}
257+
steps:
258+
- uses: actions/checkout@v4
259+
with:
260+
fetch-depth: 0
261+
token: ${{ secrets.PERSONAL_TOKEN }}
262+
263+
- name: gh checkout pr
264+
env:
265+
GH_TOKEN: ${{ secrets.PERSONAL_TOKEN }}
266+
run: gh pr checkout ${{ github.event.issue.number }} --recurse-submodules
267+
268+
- name: git config
269+
run: |
270+
git config --local user.email "github-actions[bot]@users.noreply.github.com"
271+
git config --local user.name "github-actions[bot]"
272+
273+
- name: bot commtent
274+
id: bot-comment
275+
uses: actions/github-script@v7
276+
with:
277+
script: |
278+
const url = `${context.serverUrl}//${context.repo.owner}/${context.repo.repo}/actions/runs/${context.runId}`
279+
const urlLink = `[Open](${url})`
280+
const { data: comment } = await github.rest.issues.createComment({
281+
issue_number: context.issue.number,
282+
owner: context.repo.owner,
283+
repo: context.repo.repo,
284+
body: `⏳ 正在运行 coverage badge 更新。。。 CI: ${urlLink}`
285+
})
286+
return comment.id
287+
288+
- uses: actions/setup-node@v4
289+
with:
290+
node-version: 18
291+
292+
- run: npm install
293+
294+
- run: npm run generate:coverage-badge
295+
296+
- name: commit coverage badge
297+
run: |
298+
git status
299+
working_tree_clean=$(git status | grep -c 'nothing to commit, working tree clean') || true
300+
if [ "$working_tree_clean" -eq "0" ]; then
301+
git add .
302+
git commit -m "chore: update coverage badge"
303+
fi
304+
git status
305+
229306
- name: git push
230307
run: |
231308
git status

CHANGELOG.md

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,40 @@ toc: false
55
spline: explain
66
---
77

8+
## 🌈 0.7.0 `2024-09-20`
9+
### ❗ Breaking Changes
10+
- `Checkbox`: 组件重构,新增 `readonly` 属性 @epoll-j ([#504](https://github.com/Tencent/tdesign-mobile-react/pull/504))
11+
- `Drawer`: 组件重构,新增 `attach``title``footer` 等属性,并支持函数式调用 @novlan1 ([#488](https://github.com/Tencent/tdesign-mobile-react/pull/488))
12+
- `SwipeCell`: 组件重构,移除 `expanded` 属性,新增 `opened` 属性 @novlan1 ([#492](https://github.com/Tencent/tdesign-mobile-react/pull/492))
13+
- `Indexes`: 组件重构,移除 `list`, `height` 属性,`select` 事件参数有变更,新增`indexList`, `sticky``stickyOffset` 等属性,新增 `change` 事件,新增`IndexesAnchor`子组件; @Lyan-u ([#513](https://github.com/Tencent/tdesign-mobile-react/pull/513))
14+
- `Stepper`: 组件重构,新增 `integer``size` 属性,新增 `focus` 事件 @taninsist ([#525](https://github.com/Tencent/tdesign-mobile-react/pull/525))
15+
- `Slider`: 组件重构,新增 `theme` 属性,`dragend` 事件参数有调整 @slatejack ([#522](https://github.com/Tencent/tdesign-mobile-react/pull/522))
16+
- `Tabs`: 组件重构,新增`bottomLineMode ``spaceEvenly `属性,新增`onClick``onScroll `事件 @epoll-j ([#515](https://github.com/Tencent/tdesign-mobile-react/pull/515))
17+
- `Toast`: 组件重构,新增 `style``className``showOverlay``overlayProps` 等属性,新增 `close` 事件 @novlan1 ([#494](https://github.com/Tencent/tdesign-mobile-react/pull/494))
18+
### 🚀 Features
19+
- `Empty`: 新增 `Empty` 组件 @epoll-j ([#505](https://github.com/Tencent/tdesign-mobile-react/pull/505))
20+
- `Popover`: 新增 `Popover` 组件 @epoll-j ([#510](https://github.com/Tencent/tdesign-mobile-react/pull/510))
21+
22+
23+
## 🌈 0.6.1 `2024-09-04`
24+
### 🚀 Features
25+
- `Icon`: 更新图标库版本到 `0.3.5``lock-on` 图标存在更新 @liweijie0812 ([#507](https://github.com/Tencent/tdesign-mobile-react/pull/507))
26+
27+
## 🌈 0.6.0 `2024-08-30`
28+
### 🚀 Features
29+
- `Table`: 新增 `Table` 组件 @TianlunXiong ([#472](https://github.com/Tencent/tdesign-mobile-react/pull/472))
30+
- `SideBar`: 新增 `SideBar` 组件 @tobytovi ([#491](https://github.com/Tencent/tdesign-mobile-react/pull/491))
31+
- `layout`: 新增 layout 组件 @jiasy1616 ([#452](https://github.com/Tencent/tdesign-mobile-react/pull/452))
32+
- `NoticeBar`: 新增 `direction` 属性, `extra` 属性名称变更为 `operation`,废弃 `change` 事件 @slatejack ([#501](https://github.com/Tencent/tdesign-mobile-react/pull/501))
33+
- `TabBar`: 新增 `children``split``shape` 等属性 @tobytovi ([#482](https://github.com/Tencent/tdesign-mobile-react/pull/482))
34+
- `TabBarItem`: 新增 `children` 属性 @tobytovi ([#482](https://github.com/Tencent/tdesign-mobile-react/pull/482))
35+
- `Collapse`: 新增 `children``theme` 属性 @tobytovi ([#500](https://github.com/Tencent/tdesign-mobile-react/pull/500))
36+
- `CollapsePanel`: 新增 `placement``headerLeftIcon` 属性 @tobytovi ([#500](https://github.com/Tencent/tdesign-mobile-react/pull/500))
37+
38+
### 🐞 Bug Fixes
39+
- `Badge`: 修复 `content``ReactNode` 类型时组件渲染异常 @anlyyao ([#499](https://github.com/Tencent/tdesign-mobile-react/pull/499))
40+
41+
842
## 🌈 0.5.0 `2024-08-23`
943
### ❗ Breaking Changes
1044
- `Input`: 组件重构,新增 `allowInputOverMax``autocomplete``borderless``readonly``status``tips` 属性,新增 `onValidate` 事件 @slatejack ([#467](https://github.com/Tencent/tdesign-mobile-react/pull/467))

package.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "tdesign-mobile-react",
3-
"version": "0.5.0",
3+
"version": "0.7.0",
44
"description": "TDesign Component for Mobile React",
55
"title": "tdesign-mobile-react",
66
"main": "cjs/index.js",
@@ -44,7 +44,7 @@
4444
"test:snap": "cross-env NODE_ENV=test-snap vitest run",
4545
"test:snap-update": "cross-env NODE_ENV=test-snap vitest run -u",
4646
"test:update": "vitest run -u && npm run test:snap-update",
47-
"generate:coverage-badge": "node script/generate-coverage.js",
47+
"generate:coverage-badge": "npm run test:unit-coverage && node script/generate-coverage.js",
4848
"prebuild": "rimraf es/* lib/* dist/* esm/* cjs/*",
4949
"build": "cross-env NODE_ENV=production rollup -c script/rollup.config.js && npm run build:tsc",
5050
"build:tsc": "concurrently \"npm:build:tsc-*\"",
@@ -169,7 +169,7 @@
169169
"react-spring": "9.6.1",
170170
"react-transition-group": "^4.4.2",
171171
"smoothscroll-polyfill": "^0.4.4",
172-
"tdesign-icons-react": "^0.3.4"
172+
"tdesign-icons-react": "^0.3.5"
173173
},
174174
"config": {
175175
"commitizen": {

site/mobile/components/DemoBlock.jsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,11 @@ import classNames from 'classnames';
33
import './style/index.less';
44

55
const TDemoBlock = (prop) => {
6-
const { title, summary, padding, children } = prop;
6+
const { title, summary, padding, children, style } = prop;
77

88
return (
99
<>
10-
<div className={classNames('tdesign-mobile-demo-block', { 'tdesign-mobile-demo-block_subtitle': !title })}>
10+
<div className={classNames('tdesign-mobile-demo-block', { 'tdesign-mobile-demo-block_subtitle': !title })} style={style}>
1111
{(title || summary) && (
1212
<div className="tdesign-mobile-demo-block__header">
1313
{title && <h2 className="tdesign-mobile-demo-block__title">{title}</h2>}

site/mobile/components/Header.jsx

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,22 @@
11
import React from 'react';
2+
import { ChevronLeftIcon } from 'tdesign-icons-react';
3+
import { useSearchParams, useNavigate } from 'react-router-dom';
24

35
const THeader = (prop) => {
46
const { title } = prop;
7+
const [searchParams] = useSearchParams();
8+
const navigate = useNavigate();
9+
10+
const showNavBack = !!searchParams.get('showNavBack');
11+
12+
const navBack = () => navigate(-1);
13+
514
return (
615
<>
716
{title ? (
817
<div className="tdesign-demo-topnav">
918
<div className="tdesign-demo-topnav-title">{title}</div>
10-
{/* <chevron-left-icon className="tdesign-demo-topnav__back" name="chevron-left"/> */}
19+
{showNavBack && <ChevronLeftIcon className="tdesign-demo-topnav__back" onClick={navBack} />}
1120
</div>
1221
) : null}
1322
</>

site/mobile/mobile.config.js

Lines changed: 52 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -15,10 +15,15 @@ export default {
1515
name: 'icon',
1616
component: () => import('tdesign-mobile-react/icon/_example/index.tsx'),
1717
},
18+
{
19+
title: 'Layout 布局',
20+
name: 'layout',
21+
component: () => import('tdesign-mobile-react/layout/_example/index.tsx'),
22+
},
1823
{
1924
title: 'Tabs 选项卡',
2025
name: 'tabs',
21-
component: () => import('tdesign-mobile-react/tabs/_example/index.jsx'),
26+
component: () => import('tdesign-mobile-react/tabs/_example/index.tsx'),
2227
},
2328
{
2429
title: 'Input 输入框',
@@ -45,6 +50,11 @@ export default {
4550
name: 'overlay',
4651
component: () => import('tdesign-mobile-react/overlay/_example/index.tsx'),
4752
},
53+
{
54+
title: 'Popover 弹出气泡',
55+
name: 'popover',
56+
component: () => import('tdesign-mobile-react/popover/_example/index.tsx'),
57+
},
4858
{
4959
title: 'Popup 弹出层',
5060
name: 'popup',
@@ -58,7 +68,7 @@ export default {
5868
{
5969
title: 'Slider 滑动选择器',
6070
name: 'slider',
61-
component: () => import('tdesign-mobile-react/slider/_example/index.jsx'),
71+
component: () => import('tdesign-mobile-react/slider/_example/index.tsx'),
6272
},
6373
{
6474
title: 'Radio 单选框',
@@ -125,7 +135,7 @@ export default {
125135
{
126136
title: 'Checkbox 多选框',
127137
name: 'checkbox',
128-
component: () => import('tdesign-mobile-react/checkbox/_example/index.jsx'),
138+
component: () => import('tdesign-mobile-react/checkbox/_example/index.tsx'),
129139
},
130140
{
131141
title: 'Dialog 对话框',
@@ -147,10 +157,35 @@ export default {
147157
name: 'navbar',
148158
component: () => import('tdesign-mobile-react/navbar/_example/index.tsx'),
149159
},
160+
{
161+
title: 'SideBar 侧边栏',
162+
name: 'side-bar',
163+
component: () => import('tdesign-mobile-react/side-bar/_example/index.tsx'),
164+
},
165+
{
166+
title: 'SideBar 侧边栏',
167+
name: 'side-bar-base',
168+
component: () => import('tdesign-mobile-react/side-bar/_example/base.tsx'),
169+
},
170+
{
171+
title: 'SideBar 侧边栏',
172+
name: 'side-bar-switch',
173+
component: () => import('tdesign-mobile-react/side-bar/_example/switch.tsx'),
174+
},
175+
{
176+
title: 'SideBar 侧边栏',
177+
name: 'side-bar-with-icon',
178+
component: () => import('tdesign-mobile-react/side-bar/_example/with-icon.tsx'),
179+
},
180+
{
181+
title: 'SideBar 侧边栏',
182+
name: 'side-bar-custom',
183+
component: () => import('tdesign-mobile-react/side-bar/_example/custom.tsx'),
184+
},
150185
{
151186
title: 'SwipeCell 滑动单元格',
152187
name: 'swipe-cell',
153-
component: () => import('tdesign-mobile-react/swipe-cell/_example/index.jsx'),
188+
component: () => import('tdesign-mobile-react/swipe-cell/_example/index.tsx'),
154189
},
155190
{
156191
title: 'Tag 标签',
@@ -160,22 +195,22 @@ export default {
160195
{
161196
title: 'Toast 轻提示',
162197
name: 'toast',
163-
component: () => import('tdesign-mobile-react/toast/_example/index.jsx'),
198+
component: () => import('tdesign-mobile-react/toast/_example/index.tsx'),
164199
},
165200
{
166201
title: 'Drawer 抽屉',
167202
name: 'drawer',
168-
component: () => import('tdesign-mobile-react/drawer/_example/index.jsx'),
203+
component: () => import('tdesign-mobile-react/drawer/_example/index.tsx'),
169204
},
170205
{
171206
title: 'Collapse 折叠面板',
172207
name: 'Collapse',
173-
component: () => import('tdesign-mobile-react/collapse/_example/index.jsx'),
208+
component: () => import('tdesign-mobile-react/collapse/_example/index.tsx'),
174209
},
175210
{
176211
title: 'Stepper 步进器',
177212
name: 'Stepper',
178-
component: () => import('tdesign-mobile-react/stepper/_example/index.jsx'),
213+
component: () => import('tdesign-mobile-react/stepper/_example/index.tsx'),
179214
},
180215
{
181216
title: 'PullDownRefresh 下拉刷新',
@@ -190,7 +225,7 @@ export default {
190225
{
191226
title: 'Indexes 索引',
192227
name: 'indexes',
193-
component: () => import('tdesign-mobile-react/indexes/_example/index.jsx'),
228+
component: () => import('tdesign-mobile-react/indexes/_example/index.tsx'),
194229
},
195230
{
196231
title: 'Picker 选择器',
@@ -210,7 +245,7 @@ export default {
210245
{
211246
title: 'TabBar 标签栏',
212247
name: 'tab-bar',
213-
component: () => import('tdesign-mobile-react/tab-bar/_example/mobile.jsx'),
248+
component: () => import('tdesign-mobile-react/tab-bar/_example/mobile.tsx'),
214249
},
215250
{
216251
title: 'Fab 悬浮按钮',
@@ -220,7 +255,7 @@ export default {
220255
{
221256
title: 'NoticeBar 公告栏',
222257
name: 'notice-bar',
223-
component: () => import('tdesign-mobile-react/notice-bar/_example/mobile.jsx'),
258+
component: () => import('tdesign-mobile-react/notice-bar/_example/mobile.tsx'),
224259
},
225260
{
226261
title: 'Result 结果',
@@ -235,7 +270,12 @@ export default {
235270
{
236271
title: 'Table 表格',
237272
name: 'table',
238-
component: () => import('tdesign-mobile-react/table/_example/index.jsx'),
273+
component: () => import('tdesign-mobile-react/table/_example/index.tsx'),
274+
},
275+
{
276+
title: 'Empty 空状态',
277+
name: 'empty',
278+
component: () => import('tdesign-mobile-react/empty/_example/index.tsx'),
239279
},
240280
],
241281
};

0 commit comments

Comments
 (0)