Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[WIP] mobile-react升级swiper组件 #556

Closed
wants to merge 35 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
35 commits
Select commit Hold shift + click to select a range
35fa74b
chore: update pr-comment-ci (#519)
liweijie0812 Sep 13, 2024
888fadf
fix: fix api doc parsing failure (#521)
anlyyao Sep 14, 2024
c0f72e1
Refactor/tabs Tabs组件对齐vue (#515)
epoll-j Sep 18, 2024
335272c
Checkbox组件样式及功能对齐Vue (#504)
epoll-j Sep 18, 2024
0a81b26
新增Empty组件 (#505)
epoll-j Sep 18, 2024
55cb32d
Feat/popover 新增Popover组件 (#510)
epoll-j Sep 18, 2024
9521869
refactor toast (#494)
novlan1 Sep 19, 2024
0786bb5
feat(drawer): update api (#488)
novlan1 Sep 19, 2024
204a560
feat(swipe-cell): update api (#492)
novlan1 Sep 19, 2024
db4e311
feat(indexes): 组件对齐 mobile-vue (#513)
Lyan-u Sep 19, 2024
804b5d6
feat(stepper): 对齐 mobile-vue (#525)
taninsist Sep 19, 2024
4c45fc1
feat(slider): 组件对齐 mobile-vue (#522)
slatejack Sep 19, 2024
c8512cf
chore: publish v0.7.0 (#529)
anlyyao Sep 20, 2024
d2ab974
refactor(pull-down-refresh): update api (#479)
novlan1 Oct 9, 2024
aaa3db6
refactor(message): refactor message (#477)
novlan1 Oct 9, 2024
61c6afd
chore(Switch): complete refactoring (#527)
anlyyao Oct 9, 2024
7790ebf
feat(Input): support format props (#533)
anlyyao Oct 17, 2024
6227300
fix(Checkbox): fix console warning (#538)
anlyyao Oct 17, 2024
76090c8
fix(Stepper): fix the problem of not supporting direct input (#537)
anlyyao Oct 17, 2024
bdca4ab
chore: publish v0.8.0 (#539)
anlyyao Oct 17, 2024
547dc7e
Feat/cell style (#543)
liweijie0812 Oct 28, 2024
53b3676
chore(Textarea): complete refactoring (#526)
anlyyao Nov 8, 2024
4c21361
fix(count-down): use raf not setInterval (#542)
novlan1 Nov 8, 2024
2afac8f
feat(avatar): 组件对齐 mobile-vue (#541)
slatejack Nov 8, 2024
649b2f5
add guide component (#535)
novlan1 Nov 8, 2024
e8f7af9
chore: make sure that the package can be imported normally in ssr (#544)
anlyyao Nov 11, 2024
de1c433
chore: publish v0.9.0 (#547)
anlyyao Nov 11, 2024
4b92263
feat(radio): 重构radio dom接口,补充对应文档和适配样式 (#468)
byq1213 Nov 11, 2024
b7535d4
feat(rate): rate组件升级 (#493)
ming680 Nov 11, 2024
a81341e
style: test code style
xifanTT Nov 27, 2024
518ddaf
feat:升级swiper组件
xifanTT Dec 16, 2024
e25a8a5
feat:添加本地测试样式
xifanTT Dec 16, 2024
eb1bcaf
feat:添加本地测试样式
xifanTT Dec 16, 2024
a2b1469
fix:修改本地测试样式
xifanTT Dec 16, 2024
a5e7b4a
添加效果用例pagination-type
xifanTT Dec 16, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
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.9.0 `2024-11-11`
### ❗ Breaking Changes
- `Textarea`: 组件重构,新增 `allowInputOverMax`,`bordered` 与 `readonly` 等属性 @anlyyao ([#526](https://github.com/Tencent/tdesign-mobile-react/pull/526))
- `Avatar`: 组件重构,新增 `imageProps` 属性 @slatejack ([#541](https://github.com/Tencent/tdesign-mobile-react/pull/541))
### 🚀 Features
- `Guide`: 新增 `Guide` 组件 @novlan1 ([#535](https://github.com/Tencent/tdesign-mobile-react/pull/535))
### 🐞 Bug Fixes
- `CountDown`: 修复毫秒级计算器计算错误 @novlan1 ([#542](https://github.com/Tencent/tdesign-mobile-react/pull/542))

## 🌈 0.8.0 `2024-10-17`
### ❗ Breaking Changes
- `Switch`: 组件重构,移除 `colors` 属性,`change` 事件参数有调整 @anlyyao ([#527](https://github.com/Tencent/tdesign-mobile-react/pull/527))
- `PullDownRefresh`: 组件重构,`maxBarHeight` 与 `loadingBarHeight` 属性扩展支持 `string` 类型,并新增 `onRefresh`、`onScrolltolower` 和 `onTimeout` 等属性 @novlan1 ([#479](https://github.com/Tencent/tdesign-mobile-react/pull/479))
- `Message`: 组件重构,新增 `align`、`link`、`marquee`、`offset`、`onCloseBtnClick`、`onDurationEnd` 以及 `onLinkClick` 等属性,并移除 `onClose`、`onClosed`、`onOpen`、`onOpened` 与 `onVisibleChange` 等属性 @novlan1 ([#477](https://github.com/Tencent/tdesign-mobile-react/pull/477))
### 🚀 Features
- `Input`: 支持 `format` 属性 @anlyyao ([#533](https://github.com/Tencent/tdesign-mobile-react/pull/533))
### 🐞 Bug Fixes
- `Stepper`: 修复无法直接输入的问题 @anlyyao ([#537](https://github.com/Tencent/tdesign-mobile-react/pull/537))

## 🌈 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))
Expand Down
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "tdesign-mobile-react",
"version": "0.6.1",
"version": "0.9.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
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
49 changes: 32 additions & 17 deletions site/mobile/mobile.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,12 +23,12 @@ export default {
{
title: 'Tabs 选项卡',
name: 'tabs',
component: () => import('tdesign-mobile-react/tabs/_example/index.jsx'),
component: () => import('tdesign-mobile-react/tabs/_example/index.tsx'),
},
{
title: 'Input 输入框',
name: 'input',
component: () => import('tdesign-mobile-react/input/_example/index.jsx'),
component: () => import('tdesign-mobile-react/input/_example/index.tsx'),
},
{
title: 'Grid 宫格',
Expand All @@ -45,6 +45,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,17 +63,17 @@ 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 单选框',
name: 'radio',
component: () => import('tdesign-mobile-react/radio/_example/index.jsx'),
component: () => import('tdesign-mobile-react/radio/_example/index.tsx'),
},
{
title: 'Rate 评分',
name: 'rate',
component: () => import('tdesign-mobile-react/rate/_example/index.jsx'),
component: () => import('tdesign-mobile-react/rate/_example/index.tsx'),
},
{
title: 'Search 搜索框',
Expand All @@ -88,13 +93,13 @@ export default {
{
title: 'Message 消息通知',
name: 'message',
component: () => import('tdesign-mobile-react/message/_example/base.jsx'),
component: () => import('tdesign-mobile-react/message/_example/index.tsx'),
},
{
title: 'Switch 开关',
name: 'switch',
path: '/switch',
component: () => import('tdesign-mobile-react/switch/_example/index.jsx'),
component: () => import('tdesign-mobile-react/switch/_example/index.tsx'),
},
{
title: 'Cell 单元格',
Expand Down Expand Up @@ -125,7 +130,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 @@ -140,7 +145,7 @@ export default {
{
title: 'Swiper 轮播',
name: 'swiper',
component: () => import('tdesign-mobile-react/swiper/_example/index.jsx'),
component: () => import('tdesign-mobile-react/swiper/_example/index.tsx'),
},
{
title: 'Navbar 导航栏',
Expand Down Expand Up @@ -175,7 +180,7 @@ export default {
{
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 @@ -185,12 +190,12 @@ 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 折叠面板',
Expand All @@ -200,22 +205,22 @@ export default {
{
title: 'Stepper 步进器',
name: 'Stepper',
component: () => import('tdesign-mobile-react/stepper/_example/index.jsx'),
component: () => import('tdesign-mobile-react/stepper/_example/index.tsx'),
},
{
title: 'PullDownRefresh 下拉刷新',
name: 'pull-down-refresh',
component: () => import('tdesign-mobile-react/pull-down-refresh/_example/index.jsx'),
component: () => import('tdesign-mobile-react/pull-down-refresh/_example/index.tsx'),
},
{
title: 'Avatar 头像',
name: 'avatar',
component: () => import('tdesign-mobile-react/avatar/_example/index.jsx'),
component: () => import('tdesign-mobile-react/avatar/_example/index.tsx'),
},
{
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 @@ -225,7 +230,7 @@ export default {
{
title: 'Textarea 多行文本框',
name: 'textarea',
component: () => import('tdesign-mobile-react/textarea/_example/index.jsx'),
component: () => import('tdesign-mobile-react/textarea/_example/index.tsx'),
},
{
title: 'Steps 步骤条',
Expand Down Expand Up @@ -262,5 +267,15 @@ export default {
name: 'table',
component: () => import('tdesign-mobile-react/table/_example/index.tsx'),
},
{
title: 'Empty 空状态',
name: 'empty',
component: () => import('tdesign-mobile-react/empty/_example/index.tsx'),
},
{
title: 'Guide 引导',
name: 'guide',
component: () => import('tdesign-mobile-react/guide/_example/index.tsx'),
},
],
};
Loading