Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
…eact into develop
  • Loading branch information
feaswcy committed Sep 24, 2024
2 parents fb655da + c8512cf commit 7491bcc
Show file tree
Hide file tree
Showing 351 changed files with 52,367 additions and 18,496 deletions.
101 changes: 89 additions & 12 deletions .github/workflows/pr-comment-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,30 +15,30 @@ jobs:
steps:
- uses: actions/checkout@v4
with:
repository: Tencent/tdesign
sparse-checkout: |
.github/CODEOWNERS
.github/.pr-comment-ci-whitelist
sparse-checkout-cone-mode: false

- uses: actions/github-script@v7
id: get-action
with:
script: |
const user = context.payload.comment.user.login
core.debug(`user: ${user}`)
core.info(`user: ${user}`)
const fs = require('fs')
const CODEOWNERS = fs.readFileSync('.github/CODEOWNERS', 'utf8')
core.debug(`CODEOWNERS: ${CODEOWNERS}`)
const fs = require('fs');
const whitelist = fs.readFileSync('.github/.pr-comment-ci-whitelist', 'utf8');
let isReviewer = false;
CODEOWNERS.match(/@\w+/g).forEach((owner) => {
if (owner === `@${user}`) {
isReviewer = true
let isWhitelist = false;
whitelist.split('\n').forEach((owner) => {
if (owner === user) {
isWhitelist = true;
}
})
});
let next_action = ''
if (isReviewer) {
if (isWhitelist) {
const body = context.payload.comment.body
core.info(`body: ${body}`)
if (body.startsWith('/update-common')) {
Expand All @@ -47,6 +47,10 @@ jobs:
if (body.startsWith('/update-snapshot')) {
next_action='update-snapshot'
}
if (body.startsWith('/update-coverage')) {
next_action='update-coverage'
}
if(next_action){
await github.rest.reactions.createForIssueComment({
owner: context.repo.owner,
Expand Down Expand Up @@ -151,6 +155,21 @@ jobs:
GH_TOKEN: ${{ secrets.PERSONAL_TOKEN }}
run: gh pr checkout ${{ github.event.issue.number }} --recurse-submodules

- name: bot commtent
id: bot-comment
uses: actions/github-script@v7
with:
script: |
const url = `${context.serverUrl}//${context.repo.owner}/${context.repo.repo}/actions/runs/${context.runId}`
const urlLink = `[Open](${url})`
const { data: comment } = await github.rest.issues.createComment({
issue_number: context.issue.number,
owner: context.repo.owner,
repo: context.repo.repo,
body: `⏳ 正在运行快照更新。。。 CI: ${urlLink}`
})
return comment.id
- name: git config
run: |
git config --local user.email "github-actions[bot]@users.noreply.github.com"
Expand Down Expand Up @@ -225,7 +244,65 @@ jobs:
git commit -m "chore: update snapshot"
fi
git status
- name: git push
run: |
git status
git push || true
update-coverage:
needs: check
runs-on: ubuntu-latest
if: ${{ needs.check.outputs.next_action == 'update-coverage' }}
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
token: ${{ secrets.PERSONAL_TOKEN }}

- name: gh checkout pr
env:
GH_TOKEN: ${{ secrets.PERSONAL_TOKEN }}
run: gh pr checkout ${{ github.event.issue.number }} --recurse-submodules

- name: git config
run: |
git config --local user.email "github-actions[bot]@users.noreply.github.com"
git config --local user.name "github-actions[bot]"
- name: bot commtent
id: bot-comment
uses: actions/github-script@v7
with:
script: |
const url = `${context.serverUrl}//${context.repo.owner}/${context.repo.repo}/actions/runs/${context.runId}`
const urlLink = `[Open](${url})`
const { data: comment } = await github.rest.issues.createComment({
issue_number: context.issue.number,
owner: context.repo.owner,
repo: context.repo.repo,
body: `⏳ 正在运行 coverage badge 更新。。。 CI: ${urlLink}`
})
return comment.id
- uses: actions/setup-node@v4
with:
node-version: 18

- run: npm install

- run: npm run generate:coverage-badge

- name: commit coverage badge
run: |
git status
working_tree_clean=$(git status | grep -c 'nothing to commit, working tree clean') || true
if [ "$working_tree_clean" -eq "0" ]; then
git add .
git commit -m "chore: update coverage badge"
fi
git status
- name: git push
run: |
git status
Expand Down
34 changes: 34 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,40 @@ toc: false
spline: explain
---

## 🌈 0.7.0 `2024-09-20`
### ❗ Breaking Changes
- `Checkbox`: 组件重构,新增 `readonly` 属性 @epoll-j ([#504](https://github.com/Tencent/tdesign-mobile-react/pull/504))
- `Drawer`: 组件重构,新增 `attach``title``footer` 等属性,并支持函数式调用 @novlan1 ([#488](https://github.com/Tencent/tdesign-mobile-react/pull/488))
- `SwipeCell`: 组件重构,移除 `expanded` 属性,新增 `opened` 属性 @novlan1 ([#492](https://github.com/Tencent/tdesign-mobile-react/pull/492))
- `Indexes`: 组件重构,移除 `list`, `height` 属性,`select` 事件参数有变更,新增`indexList`, `sticky``stickyOffset` 等属性,新增 `change` 事件,新增`IndexesAnchor`子组件; @Lyan-u ([#513](https://github.com/Tencent/tdesign-mobile-react/pull/513))
- `Stepper`: 组件重构,新增 `integer``size` 属性,新增 `focus` 事件 @taninsist ([#525](https://github.com/Tencent/tdesign-mobile-react/pull/525))
- `Slider`: 组件重构,新增 `theme` 属性,`dragend` 事件参数有调整 @slatejack ([#522](https://github.com/Tencent/tdesign-mobile-react/pull/522))
- `Tabs`: 组件重构,新增`bottomLineMode ``spaceEvenly `属性,新增`onClick``onScroll `事件 @epoll-j ([#515](https://github.com/Tencent/tdesign-mobile-react/pull/515))
- `Toast`: 组件重构,新增 `style``className``showOverlay``overlayProps` 等属性,新增 `close` 事件 @novlan1 ([#494](https://github.com/Tencent/tdesign-mobile-react/pull/494))
### 🚀 Features
- `Empty`: 新增 `Empty` 组件 @epoll-j ([#505](https://github.com/Tencent/tdesign-mobile-react/pull/505))
- `Popover`: 新增 `Popover` 组件 @epoll-j ([#510](https://github.com/Tencent/tdesign-mobile-react/pull/510))


## 🌈 0.6.1 `2024-09-04`
### 🚀 Features
- `Icon`: 更新图标库版本到 `0.3.5``lock-on` 图标存在更新 @liweijie0812 ([#507](https://github.com/Tencent/tdesign-mobile-react/pull/507))

## 🌈 0.6.0 `2024-08-30`
### 🚀 Features
- `Table`: 新增 `Table` 组件 @TianlunXiong ([#472](https://github.com/Tencent/tdesign-mobile-react/pull/472))
- `SideBar`: 新增 `SideBar` 组件 @tobytovi ([#491](https://github.com/Tencent/tdesign-mobile-react/pull/491))
- `layout`: 新增 layout 组件 @jiasy1616 ([#452](https://github.com/Tencent/tdesign-mobile-react/pull/452))
- `NoticeBar`: 新增 `direction` 属性, `extra` 属性名称变更为 `operation`,废弃 `change` 事件 @slatejack ([#501](https://github.com/Tencent/tdesign-mobile-react/pull/501))
- `TabBar`: 新增 `children``split``shape` 等属性 @tobytovi ([#482](https://github.com/Tencent/tdesign-mobile-react/pull/482))
- `TabBarItem`: 新增 `children` 属性 @tobytovi ([#482](https://github.com/Tencent/tdesign-mobile-react/pull/482))
- `Collapse`: 新增 `children``theme` 属性 @tobytovi ([#500](https://github.com/Tencent/tdesign-mobile-react/pull/500))
- `CollapsePanel`: 新增 `placement``headerLeftIcon` 属性 @tobytovi ([#500](https://github.com/Tencent/tdesign-mobile-react/pull/500))

### 🐞 Bug Fixes
- `Badge`: 修复 `content``ReactNode` 类型时组件渲染异常 @anlyyao ([#499](https://github.com/Tencent/tdesign-mobile-react/pull/499))


## 🌈 0.5.0 `2024-08-23`
### ❗ Breaking Changes
- `Input`: 组件重构,新增 `allowInputOverMax``autocomplete``borderless``readonly``status``tips` 属性,新增 `onValidate` 事件 @slatejack ([#467](https://github.com/Tencent/tdesign-mobile-react/pull/467))
Expand Down
6 changes: 3 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "tdesign-mobile-react",
"version": "0.5.0",
"version": "0.7.0",
"description": "TDesign Component for Mobile React",
"title": "tdesign-mobile-react",
"main": "cjs/index.js",
Expand Down Expand Up @@ -44,7 +44,7 @@
"test:snap": "cross-env NODE_ENV=test-snap vitest run",
"test:snap-update": "cross-env NODE_ENV=test-snap vitest run -u",
"test:update": "vitest run -u && npm run test:snap-update",
"generate:coverage-badge": "node script/generate-coverage.js",
"generate:coverage-badge": "npm run test:unit-coverage && node script/generate-coverage.js",
"prebuild": "rimraf es/* lib/* dist/* esm/* cjs/*",
"build": "cross-env NODE_ENV=production rollup -c script/rollup.config.js && npm run build:tsc",
"build:tsc": "concurrently \"npm:build:tsc-*\"",
Expand Down Expand Up @@ -169,7 +169,7 @@
"react-spring": "9.6.1",
"react-transition-group": "^4.4.2",
"smoothscroll-polyfill": "^0.4.4",
"tdesign-icons-react": "^0.3.4"
"tdesign-icons-react": "^0.3.5"
},
"config": {
"commitizen": {
Expand Down
4 changes: 2 additions & 2 deletions site/mobile/components/DemoBlock.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,11 @@ import classNames from 'classnames';
import './style/index.less';

const TDemoBlock = (prop) => {
const { title, summary, padding, children } = prop;
const { title, summary, padding, children, style } = prop;

return (
<>
<div className={classNames('tdesign-mobile-demo-block', { 'tdesign-mobile-demo-block_subtitle': !title })}>
<div className={classNames('tdesign-mobile-demo-block', { 'tdesign-mobile-demo-block_subtitle': !title })} style={style}>
{(title || summary) && (
<div className="tdesign-mobile-demo-block__header">
{title && <h2 className="tdesign-mobile-demo-block__title">{title}</h2>}
Expand Down
11 changes: 10 additions & 1 deletion site/mobile/components/Header.jsx
Original file line number Diff line number Diff line change
@@ -1,13 +1,22 @@
import React from 'react';
import { ChevronLeftIcon } from 'tdesign-icons-react';
import { useSearchParams, useNavigate } from 'react-router-dom';

const THeader = (prop) => {
const { title } = prop;
const [searchParams] = useSearchParams();
const navigate = useNavigate();

const showNavBack = !!searchParams.get('showNavBack');

const navBack = () => navigate(-1);

return (
<>
{title ? (
<div className="tdesign-demo-topnav">
<div className="tdesign-demo-topnav-title">{title}</div>
{/* <chevron-left-icon className="tdesign-demo-topnav__back" name="chevron-left"/> */}
{showNavBack && <ChevronLeftIcon className="tdesign-demo-topnav__back" onClick={navBack} />}
</div>
) : null}
</>
Expand Down
64 changes: 52 additions & 12 deletions site/mobile/mobile.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,15 @@ export default {
name: 'icon',
component: () => import('tdesign-mobile-react/icon/_example/index.tsx'),
},
{
title: 'Layout 布局',
name: 'layout',
component: () => import('tdesign-mobile-react/layout/_example/index.tsx'),
},
{
title: 'Tabs 选项卡',
name: 'tabs',
component: () => import('tdesign-mobile-react/tabs/_example/index.jsx'),
component: () => import('tdesign-mobile-react/tabs/_example/index.tsx'),
},
{
title: 'Input 输入框',
Expand All @@ -45,6 +50,11 @@ export default {
name: 'overlay',
component: () => import('tdesign-mobile-react/overlay/_example/index.tsx'),
},
{
title: 'Popover 弹出气泡',
name: 'popover',
component: () => import('tdesign-mobile-react/popover/_example/index.tsx'),
},
{
title: 'Popup 弹出层',
name: 'popup',
Expand All @@ -58,7 +68,7 @@ export default {
{
title: 'Slider 滑动选择器',
name: 'slider',
component: () => import('tdesign-mobile-react/slider/_example/index.jsx'),
component: () => import('tdesign-mobile-react/slider/_example/index.tsx'),
},
{
title: 'Radio 单选框',
Expand Down Expand Up @@ -125,7 +135,7 @@ export default {
{
title: 'Checkbox 多选框',
name: 'checkbox',
component: () => import('tdesign-mobile-react/checkbox/_example/index.jsx'),
component: () => import('tdesign-mobile-react/checkbox/_example/index.tsx'),
},
{
title: 'Dialog 对话框',
Expand All @@ -147,10 +157,35 @@ export default {
name: 'navbar',
component: () => import('tdesign-mobile-react/navbar/_example/index.tsx'),
},
{
title: 'SideBar 侧边栏',
name: 'side-bar',
component: () => import('tdesign-mobile-react/side-bar/_example/index.tsx'),
},
{
title: 'SideBar 侧边栏',
name: 'side-bar-base',
component: () => import('tdesign-mobile-react/side-bar/_example/base.tsx'),
},
{
title: 'SideBar 侧边栏',
name: 'side-bar-switch',
component: () => import('tdesign-mobile-react/side-bar/_example/switch.tsx'),
},
{
title: 'SideBar 侧边栏',
name: 'side-bar-with-icon',
component: () => import('tdesign-mobile-react/side-bar/_example/with-icon.tsx'),
},
{
title: 'SideBar 侧边栏',
name: 'side-bar-custom',
component: () => import('tdesign-mobile-react/side-bar/_example/custom.tsx'),
},
{
title: 'SwipeCell 滑动单元格',
name: 'swipe-cell',
component: () => import('tdesign-mobile-react/swipe-cell/_example/index.jsx'),
component: () => import('tdesign-mobile-react/swipe-cell/_example/index.tsx'),
},
{
title: 'Tag 标签',
Expand All @@ -160,22 +195,22 @@ export default {
{
title: 'Toast 轻提示',
name: 'toast',
component: () => import('tdesign-mobile-react/toast/_example/index.jsx'),
component: () => import('tdesign-mobile-react/toast/_example/index.tsx'),
},
{
title: 'Drawer 抽屉',
name: 'drawer',
component: () => import('tdesign-mobile-react/drawer/_example/index.jsx'),
component: () => import('tdesign-mobile-react/drawer/_example/index.tsx'),
},
{
title: 'Collapse 折叠面板',
name: 'Collapse',
component: () => import('tdesign-mobile-react/collapse/_example/index.jsx'),
component: () => import('tdesign-mobile-react/collapse/_example/index.tsx'),
},
{
title: 'Stepper 步进器',
name: 'Stepper',
component: () => import('tdesign-mobile-react/stepper/_example/index.jsx'),
component: () => import('tdesign-mobile-react/stepper/_example/index.tsx'),
},
{
title: 'PullDownRefresh 下拉刷新',
Expand All @@ -190,7 +225,7 @@ export default {
{
title: 'Indexes 索引',
name: 'indexes',
component: () => import('tdesign-mobile-react/indexes/_example/index.jsx'),
component: () => import('tdesign-mobile-react/indexes/_example/index.tsx'),
},
{
title: 'Picker 选择器',
Expand All @@ -210,7 +245,7 @@ export default {
{
title: 'TabBar 标签栏',
name: 'tab-bar',
component: () => import('tdesign-mobile-react/tab-bar/_example/mobile.jsx'),
component: () => import('tdesign-mobile-react/tab-bar/_example/mobile.tsx'),
},
{
title: 'Fab 悬浮按钮',
Expand All @@ -220,7 +255,7 @@ export default {
{
title: 'NoticeBar 公告栏',
name: 'notice-bar',
component: () => import('tdesign-mobile-react/notice-bar/_example/mobile.jsx'),
component: () => import('tdesign-mobile-react/notice-bar/_example/mobile.tsx'),
},
{
title: 'Result 结果',
Expand All @@ -235,7 +270,12 @@ export default {
{
title: 'Table 表格',
name: 'table',
component: () => import('tdesign-mobile-react/table/_example/index.jsx'),
component: () => import('tdesign-mobile-react/table/_example/index.tsx'),
},
{
title: 'Empty 空状态',
name: 'empty',
component: () => import('tdesign-mobile-react/empty/_example/index.tsx'),
},
],
};
Loading

0 comments on commit 7491bcc

Please sign in to comment.