Skip to content

Commit

Permalink
refactor(cell): 解决冲突
Browse files Browse the repository at this point in the history
  • Loading branch information
dexterdai committed Aug 1, 2024
2 parents 7f72eae + 002c70b commit 9979052
Show file tree
Hide file tree
Showing 60 changed files with 700 additions and 530 deletions.
2 changes: 1 addition & 1 deletion .github/ISSUE_TEMPLATE/bug-report.zh-CN.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ body:
tdesign-mobile-react 的 Issue 列表接受 bug 报告或是新功能请求。也可加入官方社区:<img width="80px" src="https://user-images.githubusercontent.com/15634204/157386871-bf84c2ea-a02f-4c1c-b6fd-577450cdbcf7.png" />
在发布一个 Issue 前,请确保:
- 在 [常见问题](https://tdesign.tencent.com/about/faq)、[更新日志](https://tdesign.tencent.com/about/release) 和 [旧Issue列表](https://github.com/TDesignOteam/tdesign-mobile-react/issues?q=is%3Aissue) 中搜索过你的问题。(你的问题可能已有人提出,也可能已在最新版本中被修正)
- 在 [常见问题](https://tdesign.tencent.com/about/faq)、[更新日志](https://tdesign.tencent.com/about/release) 和 [旧Issue列表](https://github.com/Tencent/tdesign-mobile-react/issues?q=is%3Aissue) 中搜索过你的问题。(你的问题可能已有人提出,也可能已在最新版本中被修正)
- 如果你发现一个已经关闭的旧 Issue 在最新版本中仍然存在,不要在旧 Issue 下面留言,请建一个新的 issue。
- type: input
Expand Down
2 changes: 1 addition & 1 deletion .github/ISSUE_TEMPLATE/feature-report.zh-CN.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ body:
tdesign-mobile-react 的 Issue 列表接受 bug 报告或是新功能请求。也可加入官方社区:<img width="80px" src="https://user-images.githubusercontent.com/15634204/157386871-bf84c2ea-a02f-4c1c-b6fd-577450cdbcf7.png" />
在发布一个 Issue 前,请确保:
- 在 [常见问题](https://tdesign.tencent.com/about/faq)、[更新日志](https://tdesign.tencent.com/about/release) 和 [旧Issue列表](https://github.com/TDesignOteam/tdesign-mobile-react/issues?q=is%3Aissue) 中搜索过你的问题。(你的问题可能已有人提出,也可能已在最新版本中被修正)
- 在 [常见问题](https://tdesign.tencent.com/about/faq)、[更新日志](https://tdesign.tencent.com/about/release) 和 [旧Issue列表](https://github.com/Tencent/tdesign-mobile-react/issues?q=is%3Aissue) 中搜索过你的问题。(你的问题可能已有人提出,也可能已在最新版本中被修正)
- 如果你发现一个已经关闭的旧 Issue 在最新版本中仍然存在,不要在旧 Issue 下面留言,请建一个新的 issue。
- type: textarea
Expand Down
1 change: 1 addition & 0 deletions .husky/commit-msg
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
#!/bin/sh
[ -n "$CI" ] && exit 0
. "$(dirname "$0")/_/husky.sh"

npx commitlint -e $HUSKY_GIT_PARAMS
Expand Down
1 change: 1 addition & 0 deletions .husky/pre-commit
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
#!/bin/sh
[ -n "$CI" ] && exit 0
. "$(dirname "$0")/_/husky.sh"

npm run lint:fix
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@
},
"repository": {
"type": "git",
"url": "git+https://github.com/TDesignOteam/tdesign-mobile-react.git"
"url": "git+https://github.com/Tencent/tdesign-mobile-react.git"
},
"keywords": [
"tdesign",
Expand All @@ -71,7 +71,7 @@
"react-dom": ">=16.13.1"
},
"bugs": {
"url": "https://github.com/TDesignOteam/tdesign-mobile-react/issues"
"url": "https://github.com/Tencent/tdesign-mobile-react/issues"
},
"homepage": "https://tdesign.tencent.com/mobile-react",
"devDependencies": {
Expand Down
4 changes: 2 additions & 2 deletions site/doc/getting-started.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ import 'tdesign-mobile-react/dist/tdesign.css'; // 如需样式请添加这行

由于原始样式基于 less 编写,需要自行处理 less 文件的编译(例如安装 less、less-loader)

更多 less 变量定义 [查看这里](https://github.com/TDesignOteam/tdesign-common/blob/main/style/mobile/_variables.less)
更多 less 变量定义 [查看这里](https://github.com/Tencent/tdesign-common/blob/main/style/mobile/_variables.less)

```javascript
import { Button } from 'tdesign-mobile-react/esm/';
Expand Down Expand Up @@ -80,7 +80,7 @@ module.exports = {
}
```

npm package 中提供了多种构建产物,可以阅读 [这里](https://github.com/TDesignOteam/tdesign-common/blob/develop/develop-install.md) 了解不同目录下产物的差别。
npm package 中提供了多种构建产物,可以阅读 [这里](https://github.com/Tencent/tdesign-common/blob/develop/develop-install.md) 了解不同目录下产物的差别。

## 浏览器兼容性

Expand Down
2 changes: 1 addition & 1 deletion site/mobile/mobile.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ export default {
{
title: 'Divider 分割符',
name: 'divider',
component: () => import('tdesign-mobile-react/divider/_example/index.jsx'),
component: () => import('tdesign-mobile-react/divider/_example/index.tsx'),
},
{
title: 'Icon 图标',
Expand Down
7 changes: 6 additions & 1 deletion site/plugin-tdoc/transforms.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,14 @@ export default {

// 替换成对应 demo 文件
source = source.replace(/\{\{\s+(.+)\s+\}\}/g, (demoStr, demoFileName) => {
const tsDemoPath = path.resolve(resourceDir, `./_example/${demoFileName}.tsx`);
if (fs.existsSync(tsDemoPath)) {
return `\n::: demo _example/${demoFileName} ${name}\n:::\n`;
}

const demoPath = path.resolve(resourceDir, `./_example/${demoFileName}.jsx`);
if (!fs.existsSync(demoPath)) {
console.log('\x1B[36m%s\x1B[0m', `${name} 组件需要实现 _example/${demoFileName}.jsx 示例!`);
console.log('\x1B[36m%s\x1B[0m', `${name} 组件需要实现 _example/${demoFileName}.tsx 示例!`);
return '\n<h3>DEMO (🚧建设中)...</h3>';
}

Expand Down
10 changes: 5 additions & 5 deletions src/avatar/avatar.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,11 @@
className | String | - | 类名 | N
style | Object | - | 样式,TS 类型:`React.CSSProperties` | N
alt | String | - | 头像替换文本,仅当图片加载失败时有效 | N
badgeProps | Object | - | 头像右上角提示信息,继承 Badge 组件的全部特性。如:小红点,或者数字。TS 类型:`TdBadgeProps`[Badge API Documents](./badge?tab=api)[详细类型定义](https://github.com/TDesignOteam/tdesign-mobile-react/tree/develop/src/avatar/type.ts) | N
badgeProps | Object | - | 头像右上角提示信息,继承 Badge 组件的全部特性。如:小红点,或者数字。TS 类型:`TdBadgeProps`[Badge API Documents](./badge?tab=api)[详细类型定义](https://github.com/Tencent/tdesign-mobile-react/tree/develop/src/avatar/type.ts) | N
hideOnLoadFailed | Boolean | false | 加载失败时隐藏图片 | N
icon | TElement | - | 图标。TS 类型:`TNode`[通用类型定义](https://github.com/TDesignOteam/tdesign-mobile-react/blob/develop/src/common.ts) | N
icon | TElement | - | 图标。TS 类型:`TNode`[通用类型定义](https://github.com/Tencent/tdesign-mobile-react/blob/develop/src/common.ts) | N
image | String | - | 图片地址 | N
shape | String | circle | 形状。可选项:circle/round。TS 类型:`ShapeEnum ` `type ShapeEnum = 'circle' | 'round'`[详细类型定义](https://github.com/TDesignOteam/tdesign-mobile-react/tree/develop/src/avatar/type.ts) | N
shape | String | circle | 形状。可选项:circle/round。TS 类型:`ShapeEnum ` `type ShapeEnum = 'circle' | 'round'`[详细类型定义](https://github.com/Tencent/tdesign-mobile-react/tree/develop/src/avatar/type.ts) | N
size | String | - | 尺寸,示例值:small/medium/large/24px/38px 等,默认为 large | N
onError | Function | | TS 类型:`() => void`<br/>图片加载失败时触发 | N

Expand All @@ -22,7 +22,7 @@ onError | Function | | TS 类型:`() => void`<br/>图片加载失败时触发
-- | -- | -- | -- | --
className | String | - | 类名 | N
style | Object | - | 样式,TS 类型:`React.CSSProperties` | N
cascading | String | 'right-up' | 图片之间的层叠关系,可选值:左侧图片在上和右侧图片在上。可选项:left-up/right-up。TS 类型:`CascadingValue` `type CascadingValue = 'left-up' | 'right-up'`[详细类型定义](https://github.com/TDesignOteam/tdesign-mobile-react/tree/develop/src/avatar/type.ts) | N
collapseAvatar | TNode | - | 头像数量超出时,会出现一个头像折叠元素。该元素内容可自定义。默认为 `+N`。示例:`+5``...`, `更多`。TS 类型:`string | TNode`[通用类型定义](https://github.com/TDesignOteam/tdesign-mobile-react/blob/develop/src/common.ts) | N
cascading | String | 'right-up' | 图片之间的层叠关系,可选值:左侧图片在上和右侧图片在上。可选项:left-up/right-up。TS 类型:`CascadingValue` `type CascadingValue = 'left-up' | 'right-up'`[详细类型定义](https://github.com/Tencent/tdesign-mobile-react/tree/develop/src/avatar/type.ts) | N
collapseAvatar | TNode | - | 头像数量超出时,会出现一个头像折叠元素。该元素内容可自定义。默认为 `+N`。示例:`+5``...`, `更多`。TS 类型:`string | TNode`[通用类型定义](https://github.com/Tencent/tdesign-mobile-react/blob/develop/src/common.ts) | N
max | Number | - | 能够同时显示的最多头像数量 | N
size | String | medium | 尺寸,示例值:small/medium/large/24px/38px 等。优先级低于 Avatar.size | N
2 changes: 1 addition & 1 deletion src/back-top/back-top.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
className | String | - | 类名 | N
style | Object | - | 样式,TS 类型:`React.CSSProperties` | N
fixed | Boolean | true | 是否绝对定位固定到屏幕右下方 | N
icon | TNode | 'backtop' | 图标。TS 类型:`string | TNode`[通用类型定义](https://github.com/TDesignOteam/tdesign-mobile-react/blob/develop/src/common.ts) | N
icon | TNode | 'backtop' | 图标。TS 类型:`string | TNode`[通用类型定义](https://github.com/Tencent/tdesign-mobile-react/blob/develop/src/common.ts) | N
target | Object | () => window | 定位滚动到指定对象。TS 类型:`() => HTMLElement` | N
text | String | '' | 文案 | N
theme | String | round | 预设的样式类型。可选项:round/half-round/round-dark/half-round-dark | N
6 changes: 3 additions & 3 deletions src/badge/badge.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,10 @@
-- | -- | -- | -- | --
className | String | - | 类名 | N
style | Object | - | 样式,TS 类型:`React.CSSProperties` | N
children | TNode | - | 徽标内容,同 content。TS 类型:`string | TNode`[通用类型定义](https://github.com/TDesignOteam/tdesign-mobile-react/blob/develop/src/common.ts) | N
children | TNode | - | 徽标内容,同 content。TS 类型:`string | TNode`[通用类型定义](https://github.com/Tencent/tdesign-mobile-react/blob/develop/src/common.ts) | N
color | String | - | 颜色 | N
content | TNode | - | 徽标内容。TS 类型:`string | TNode`[通用类型定义](https://github.com/TDesignOteam/tdesign-mobile-react/blob/develop/src/common.ts) | N
count | TNode | 0 | 徽标右上角内容。可以是数字,也可以是文字。如:'new'/3/99+。TS 类型:`string | number | TNode`[通用类型定义](https://github.com/TDesignOteam/tdesign-mobile-react/blob/develop/src/common.ts) | N
content | TNode | - | 徽标内容。TS 类型:`string | TNode`[通用类型定义](https://github.com/Tencent/tdesign-mobile-react/blob/develop/src/common.ts) | N
count | TNode | 0 | 徽标右上角内容。可以是数字,也可以是文字。如:'new'/3/99+。TS 类型:`string | number | TNode`[通用类型定义](https://github.com/Tencent/tdesign-mobile-react/blob/develop/src/common.ts) | N
dot | Boolean | false | 是否为红点 | N
maxCount | Number | 99 | 封顶的数字值 | N
offset | Array | - | 设置状态点的位置偏移,示例:[-10, 20]['10em', '8rem']。TS 类型:`Array<string | number>` | N
Expand Down
8 changes: 4 additions & 4 deletions src/button/button.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,14 +8,14 @@
className | String | - | 类名 | N
style | Object | - | 样式,TS 类型:`React.CSSProperties` | N
block | Boolean | false | 是否为块级元素 | N
children | TNode | - | 按钮内容,同 content。TS 类型:`string | TNode`[通用类型定义](https://github.com/TDesignOteam/tdesign-mobile-react/blob/develop/src/common.ts) | N
content | TNode | - | 按钮内容。TS 类型:`string | TNode`[通用类型定义](https://github.com/TDesignOteam/tdesign-mobile-react/blob/develop/src/common.ts) | N
children | TNode | - | 按钮内容,同 content。TS 类型:`string | TNode`[通用类型定义](https://github.com/Tencent/tdesign-mobile-react/blob/develop/src/common.ts) | N
content | TNode | - | 按钮内容。TS 类型:`string | TNode`[通用类型定义](https://github.com/Tencent/tdesign-mobile-react/blob/develop/src/common.ts) | N
disabled | Boolean | false | 是否禁用按钮 | N
ghost | Boolean | false | 是否为幽灵按钮(镂空按钮) | N
icon | TElement | - | 按钮内部图标,可完全自定义。TS 类型:`TNode`[通用类型定义](https://github.com/TDesignOteam/tdesign-mobile-react/blob/develop/src/common.ts) | N
icon | TElement | - | 按钮内部图标,可完全自定义。TS 类型:`TNode`[通用类型定义](https://github.com/Tencent/tdesign-mobile-react/blob/develop/src/common.ts) | N
loading | Boolean | false | 是否显示为加载状态 | N
shape | String | rectangle | 按钮形状,有 4 种:长方形、正方形、圆角长方形、圆形。可选项:rectangle/square/round/circle | N
size | String | medium | 组件尺寸。可选项:small/medium/large。TS 类型:`SizeEnum`[通用类型定义](https://github.com/TDesignOteam/tdesign-mobile-react/blob/develop/src/common.ts) | N
size | String | medium | 组件尺寸。可选项:small/medium/large。TS 类型:`SizeEnum`[通用类型定义](https://github.com/Tencent/tdesign-mobile-react/blob/develop/src/common.ts) | N
theme | String | default | 组件风格,依次为品牌色、危险色。可选项:default/primary/danger | N
type | String | button | 按钮类型。可选项:submit/reset/button | N
variant | String | base | 按钮形式,基础、线框、文字。可选项:base/outline/text | N
Expand Down
16 changes: 8 additions & 8 deletions src/checkbox/checkbox.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,13 +11,13 @@ align | String | left | 多选框和内容相对位置。可选项:left/right
checkAll | Boolean | false | 用于标识是否为「全选选项」。单独使用无效,需在 CheckboxGroup 中使用 | N
checked | Boolean | false | 是否选中 | N
defaultChecked | Boolean | false | 是否选中。非受控属性 | N
children | TNode | - | 多选框内容,同 label。TS 类型:`string | TNode`[通用类型定义](https://github.com/TDesignOteam/tdesign-mobile-react/blob/develop/src/common.ts) | N
content | TNode | - | 多选框内容。TS 类型:`string | TNode`[通用类型定义](https://github.com/TDesignOteam/tdesign-mobile-react/blob/develop/src/common.ts) | N
children | TNode | - | 多选框内容,同 label。TS 类型:`string | TNode`[通用类型定义](https://github.com/Tencent/tdesign-mobile-react/blob/develop/src/common.ts) | N
content | TNode | - | 多选框内容。TS 类型:`string | TNode`[通用类型定义](https://github.com/Tencent/tdesign-mobile-react/blob/develop/src/common.ts) | N
contentDisabled | Boolean | - | 是否禁用组件内容(content)触发选中 | N
disabled | Boolean | undefined | 是否禁用组件 | N
icon | Array | - | 自定义选中图标和非选中图标。示例:[选中态图标,非选中态图标]。TS 类型:`Array<TNode>`[通用类型定义](https://github.com/TDesignOteam/tdesign-mobile-react/blob/develop/src/common.ts) | N
icon | Array | - | 自定义选中图标和非选中图标。示例:[选中态图标,非选中态图标]。TS 类型:`Array<TNode>`[通用类型定义](https://github.com/Tencent/tdesign-mobile-react/blob/develop/src/common.ts) | N
indeterminate | Boolean | false | 是否为半选 | N
label | TNode | - | 主文案。TS 类型:`string | TNode`[通用类型定义](https://github.com/TDesignOteam/tdesign-mobile-react/blob/develop/src/common.ts) | N
label | TNode | - | 主文案。TS 类型:`string | TNode`[通用类型定义](https://github.com/Tencent/tdesign-mobile-react/blob/develop/src/common.ts) | N
maxContentRow | Number | 5 | 内容最大行数限制 | N
maxLabelRow | Number | 3 | 主文案最大行数限制 | N
name | String | - | HTML 元素原生属性 | N
Expand All @@ -34,7 +34,7 @@ style | Object | - | 样式,TS 类型:`React.CSSProperties` | N
disabled | Boolean | false | 是否禁用组件 | N
max | Number | undefined | 支持最多选中的数量 | N
name | String | - | 统一设置内部复选框 HTML 属性 | N
options | Array | [] | 以配置形式设置子元素。示例1:`['北京', '上海']` ,示例2: `[{ label: '全选', checkAll: true }, { label: '上海', value: 'shanghai' }]`。checkAll 值为 true 表示当前选项为「全选选项」。TS 类型:`Array<CheckboxOption>` `type CheckboxOption = string | number | CheckboxOptionObj` `interface CheckboxOptionObj { label?: string | TNode; value?: string | number; disabled?: boolean; name?: string; checkAll?: true }`[通用类型定义](https://github.com/TDesignOteam/tdesign-mobile-react/blob/develop/src/common.ts)[详细类型定义](https://github.com/TDesignOteam/tdesign-mobile-react/tree/develop/src/checkbox/type.ts) | N
value | Array | [] | 选中值。TS 类型:`CheckboxGroupValue` `type CheckboxGroupValue = Array<string | number>`[详细类型定义](https://github.com/TDesignOteam/tdesign-mobile-react/tree/develop/src/checkbox/type.ts) | N
defaultValue | Array | [] | 选中值。非受控属性。TS 类型:`CheckboxGroupValue` `type CheckboxGroupValue = Array<string | number>`[详细类型定义](https://github.com/TDesignOteam/tdesign-mobile-react/tree/develop/src/checkbox/type.ts) | N
onChange | Function | | TS 类型:`(value: CheckboxGroupValue, context: CheckboxGroupChangeContext) => void`<br/>值变化时触发,`context.current` 表示当前变化的数据项,如果是全选则为空;`context.type` 表示引起选中数据变化的是选中或是取消选中。[详细类型定义](https://github.com/TDesignOteam/tdesign-mobile-react/tree/develop/src/checkbox/type.ts)。<br/>`interface CheckboxGroupChangeContext { e: ChangeEvent; current: CheckboxOption | TdCheckboxProps; type: 'check' | 'uncheck' }`<br/> | N
options | Array | [] | 以配置形式设置子元素。示例1:`['北京', '上海']` ,示例2: `[{ label: '全选', checkAll: true }, { label: '上海', value: 'shanghai' }]`。checkAll 值为 true 表示当前选项为「全选选项」。TS 类型:`Array<CheckboxOption>` `type CheckboxOption = string | number | CheckboxOptionObj` `interface CheckboxOptionObj { label?: string | TNode; value?: string | number; disabled?: boolean; name?: string; checkAll?: true }`[通用类型定义](https://github.com/Tencent/tdesign-mobile-react/blob/develop/src/common.ts)[详细类型定义](https://github.com/Tencent/tdesign-mobile-react/tree/develop/src/checkbox/type.ts) | N
value | Array | [] | 选中值。TS 类型:`CheckboxGroupValue` `type CheckboxGroupValue = Array<string | number>`[详细类型定义](https://github.com/Tencent/tdesign-mobile-react/tree/develop/src/checkbox/type.ts) | N
defaultValue | Array | [] | 选中值。非受控属性。TS 类型:`CheckboxGroupValue` `type CheckboxGroupValue = Array<string | number>`[详细类型定义](https://github.com/Tencent/tdesign-mobile-react/tree/develop/src/checkbox/type.ts) | N
onChange | Function | | TS 类型:`(value: CheckboxGroupValue, context: CheckboxGroupChangeContext) => void`<br/>值变化时触发,`context.current` 表示当前变化的数据项,如果是全选则为空;`context.type` 表示引起选中数据变化的是选中或是取消选中。[详细类型定义](https://github.com/Tencent/tdesign-mobile-react/tree/develop/src/checkbox/type.ts)。<br/>`interface CheckboxGroupChangeContext { e: ChangeEvent; current: CheckboxOption | TdCheckboxProps; type: 'check' | 'uncheck' }`<br/> | N
Loading

0 comments on commit 9979052

Please sign in to comment.