Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
40 commits
Select commit Hold shift + click to select a range
5b5e40b
fix(checkbox): fix checkbox props export name
slatejack May 22, 2026
f6f683b
feat(table): create primaryTable component, update table props
slatejack May 27, 2026
fe8c79e
feat(table): enable mobile table use pagination, create self paginati…
slatejack May 29, 2026
8182892
feat(table): enable data loading mode: pull-refresh
slatejack Jun 1, 2026
b0e0b2b
fix(table): fix usePullRefresh hook calculate hasMore without paginat…
slatejack Jun 1, 2026
2f6e0ed
feat(table): enable table drag sort
slatejack Jun 14, 2026
eb9618a
fix(table): fix table drag hooks
slatejack Jun 15, 2026
0a5ce5f
fix(table): fix table row select hooks, adjust export method for cert…
slatejack Jun 15, 2026
07a8157
fix(table): add table loading demo and select demo
slatejack Jun 15, 2026
9aa631f
fix(table): fix table loading container classname, enable external co…
slatejack Jun 17, 2026
578489f
fix(table): fix imported package path
slatejack Jun 17, 2026
b020ac8
chore(table): update snapshots
slatejack Jun 17, 2026
305bd06
fix(table): add missing global configuration properties for table
slatejack Jun 17, 2026
8de6562
fix(table): fix filterIcon usage
slatejack Jun 17, 2026
dd182c1
feat(table): remove listFilterConfig prop
slatejack Jun 24, 2026
e8e1536
fix(table): fix table loading demo miss rowKey
slatejack Jun 29, 2026
a7ebf62
perf(table): wrap newData with useMemo
slatejack Jun 29, 2026
7cfe944
fix(table): fix table pagination prop, remove default value
slatejack Jun 30, 2026
1f162c9
fix(table): fix usePagination and usePullRefresh only take effect whe…
slatejack Jun 30, 2026
b829b7c
fix(table): remove unused hooks, remove unused default props value
slatejack Jun 30, 2026
12040fe
fix(table): fix table dragging not working
slatejack Jun 30, 2026
c9ca012
fix(table): fix custom-row-style demo error props
slatejack Jun 30, 2026
692e806
fix(table): fix filtering and sorting were not working
slatejack Jun 30, 2026
c057a01
feat(table): adjust the interaction method for the sort button
slatejack Jul 1, 2026
5884922
fix(table): fix innerPaginateData error in selectRow
slatejack Jul 1, 2026
d78b380
chore(table): add filter-sort demo
slatejack Jul 1, 2026
1ee27ef
chore(table): update snapshots
slatejack Jul 1, 2026
e476501
fix(table): fix multi select checkbox icon
slatejack Jul 1, 2026
3d821fe
chore(table): update snapshots
slatejack Jul 1, 2026
cc4b20f
fix(table): fix code review suggestion include style and performance …
slatejack Jul 29, 2026
3fa63b8
chore(table): update snapshots
slatejack Jul 29, 2026
76fd00d
fix(table): fix table example style
slatejack Jul 29, 2026
09c3dd6
fix(table): change sort table demo default sort method
slatejack Jul 29, 2026
920ff1e
feat(table): change table sorter trigger method
slatejack Jul 29, 2026
7f71d67
feat(table): change pullUploadingText to use locale
slatejack Jul 29, 2026
76e8231
chore(table): update snapshots
slatejack Jul 29, 2026
18481b9
chore(table): update snapshots
slatejack Jul 29, 2026
5d76381
fix: fix package.json info change conflict
slatejack Jul 29, 2026
13833fa
chore: update test snapshots
slatejack Jul 29, 2026
32a549c
chore: update demos
anlyyao Jul 30, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -164,6 +164,7 @@
},
"dependencies": {
"@popperjs/core": "^2.11.8",
"@types/sortablejs": "^1.15.9",
"@use-gesture/react": "^10.2.10",
"ahooks": "^3.8.5",
"classnames": "^2.3.1",
Expand All @@ -173,6 +174,7 @@
"lodash-es": "^4.17.21",
"react-transition-group": "^4.4.2",
"smoothscroll-polyfill": "^0.4.4",
"sortablejs": "^1.15.7",
"tdesign-icons-react": "^0.6.6",
"tinycolor2": "^1.6.0",
"validator": "^13.15.15"
Expand Down
16 changes: 8 additions & 8 deletions src/checkbox/Checkbox.tsx
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
import React, { useContext, useMemo, Ref, forwardRef } from 'react';
import React, { forwardRef, Ref, useContext, useMemo } from 'react';
import classNames from 'classnames';
import {
CheckIcon,
MinusIcon,
CheckCircleFilledIcon,
CheckIcon,
CheckRectangleFilledIcon,
CircleIcon,
MinusCircleFilledIcon,
MinusIcon,
MinusRectangleFilledIcon,
CheckRectangleFilledIcon,
} from 'tdesign-icons-react';
import { TdCheckboxProps } from './type';
import forwardRefWithStatics from '../_util/forwardRefWithStatics';
Expand All @@ -20,15 +20,15 @@ import { usePrefixClass } from '../hooks/useClass';
import useDefaultProps from '../hooks/useDefaultProps';
import { checkboxDefaultProps } from './defaultProps';

export interface CheckBoxProps extends TdCheckboxProps, StyledProps {}
export interface CheckboxProps extends TdCheckboxProps, StyledProps {}

export interface CheckContextValue {
inject: (props: CheckBoxProps) => CheckBoxProps;
inject: (props: CheckboxProps) => CheckboxProps;
}

export const CheckContext = React.createContext<CheckContextValue>(null);

const Checkbox = forwardRef<HTMLDivElement, CheckBoxProps>((_props, ref) => {
const Checkbox = forwardRef<HTMLDivElement, CheckboxProps>((_props, ref) => {
const context = useContext(CheckContext);
const props = useDefaultProps(context ? context.inject(_props) : _props, checkboxDefaultProps);
const { classPrefix } = useConfig();
Expand Down Expand Up @@ -181,6 +181,6 @@ const Checkbox = forwardRef<HTMLDivElement, CheckBoxProps>((_props, ref) => {
Checkbox.displayName = 'Checkbox';

export default forwardRefWithStatics(
(props: CheckBoxProps, ref: Ref<HTMLDivElement>) => <Checkbox ref={ref} {...props} />,
(props: CheckboxProps, ref: Ref<HTMLDivElement>) => <Checkbox ref={ref} {...props} />,
{ Group: CheckboxGroup },
);
8 changes: 4 additions & 4 deletions src/checkbox/__tests__/checkbox.test.tsx
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
import React from 'react';
import { describe, it, expect, render, vi, act } from '@test/utils';
import { Checkbox, CheckboxGroup, CheckBoxProps } from '../index';
import { act, describe, expect, it, render, vi } from '@test/utils';
import { Checkbox, CheckboxGroup, CheckboxProps } from '../index';

type Shape = Extract<CheckBoxProps['icon'], 'circle' | 'rectangle' | 'line'>;
type Shape = Extract<CheckboxProps['icon'], 'circle' | 'rectangle' | 'line'>;

const prefix = 't';
const name = `.${prefix}-checkbox`;

const placements = ['left', 'right'] as Array<CheckBoxProps['placement']>;
const placements = ['left', 'right'] as Array<CheckboxProps['placement']>;
const iconShapes = ['circle', 'rectangle', 'line'] as Array<Shape>;

describe('Checkbox', () => {
Expand Down
2 changes: 1 addition & 1 deletion src/checkbox/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import _CheckboxGroup from './CheckboxGroup';

import './style';

export type { CheckBoxProps } from './Checkbox';
export type { CheckboxProps } from './Checkbox';
export type { CheckboxGroupProps } from './CheckboxGroup';

export * from './type';
Expand Down
62 changes: 39 additions & 23 deletions src/config-provider/config-provider.en-US.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,28 +6,29 @@

name | type | default | description | required
-- | -- | -- | -- | --
globalConfig | Object | - | global config。Typescript`GlobalConfigProvider` | N
globalConfig | Object | - | global config。Typescript: `GlobalConfigProvider` | N

### GlobalConfigProvider

name | type | default | description | required
-- | -- | -- | -- | --
actionSheet | Object | - | ActionSheet global configs。Typescript`ActionSheetConfig` | N
calendar | Object | - | Calendar global configs。Typescript`CalendarConfig` | N
cascader | Object | - | Cascader global configs。Typescript`CascaderConfig` | N
actionSheet | Object | - | ActionSheet global configs。Typescript: `ActionSheetConfig` | N
calendar | Object | - | Calendar global configs。Typescript: `CalendarConfig` | N
cascader | Object | - | Cascader global configs。Typescript: `CascaderConfig` | N
classPrefix | String | t | \- | N
dateTimePicker | Object | - | DateTimePicker global configs。Typescript:`DateTimePickerConfig` | N
dropdownMenu | Object | - | DropdownMenu global configs。Typescript:`DropdownMenuConfig` | N
form | Object | - | Form global configs。Typescript:`FormConfig` | N
guide | Object | - | Guide global configs。Typescript:`GuideConfig` | N
list | Object | - | List global configs。Typescript:`ListConfig` | N
picker | Object | - | Picker global configs。Typescript:`PickerConfig` | N
pullDownRefresh | Object | - | PullDownRefresh global configs。Typescript:`PullDownRefreshConfig` | N
qrcode | Object | - | QRCode global configs。Typescript:`QRCodeConfig` | N
rate | Object | - | Rate global configs。Typescript:`RateConfig` | N
tabBar | Object | - | TabBar global configs。Typescript:`TabBarConfig` | N
table | Object | - | Table global configs。Typescript:`TableConfig` | N
upload | Object | - | Upload global configs。Typescript:`UploadConfig` | N
dateTimePicker | Object | - | DateTimePicker global configs。Typescript: `DateTimePickerConfig` | N
dropdownMenu | Object | - | DropdownMenu global configs。Typescript: `DropdownMenuConfig` | N
form | Object | - | Form global configs。Typescript: `FormConfig` | N
guide | Object | - | Guide global configs。Typescript: `GuideConfig` | N
list | Object | - | List global configs。Typescript: `ListConfig` | N
picker | Object | - | Picker global configs。Typescript: `PickerConfig` | N
pullDownRefresh | Object | - | PullDownRefresh global configs。Typescript: `PullDownRefreshConfig` | N
qrcode | Object | - | QRCode global configs。Typescript: `QRCodeConfig` | N
rate | Object | - | Rate global configs。Typescript: `RateConfig` | N
tabBar | Object | - | TabBar global configs。Typescript: `TabBarConfig` | N
table | Object | - | Table global configs。Typescript: `TableConfig` | N
typography | Object | - | Typography global configs。Typescript: `TypographyConfig` | N
upload | Object | - | Upload global configs。Typescript: `UploadConfig` | N

### ActionSheetConfig

Expand All @@ -41,9 +42,9 @@ name | type | default | description | required
-- | -- | -- | -- | --
confirm | String | - | confirm text | N
monthTitle | String | - | \- | N
months | Array | - | Typescript`string[]` | N
months | Array | - | Typescript: `string[]` | N
title | String | - | \- | N
weekdays | Array | - | Typescript`string[]` | N
weekdays | Array | - | Typescript: `string[]` | N

### CascaderConfig

Expand Down Expand Up @@ -79,7 +80,7 @@ reset | String | - | reset text | N
name | type | default | description | required
-- | -- | -- | -- | --
colonText | String | - | colon on the right of label ":" | N
errorMessage | Object | - | Typescript`FormErrorMessage`,[Form API Documents](./form?tab=api)。[see more ts definition](https://github.com/Tencent/tdesign-mobile-react/tree/develop/src/config-provider/type.ts) | N
errorMessage | Object | - | Typescript: `FormErrorMessage`,[Form API Documents](./form?tab=api)。[see more ts definition](https://github.com/Tencent/tdesign-mobile-react/tree/develop/src/config-provider/type.ts) | N
requiredMark | Boolean | true | \- | N
requiredMarkPosition | String | left | Display position of required symbols。options: left/right | N

Expand All @@ -98,7 +99,7 @@ name | type | default | description | required
-- | -- | -- | -- | --
errorText | String | - | loading text, default value is "Error" | N
loadingText | String | - | loading text, default value is "loading" | N
replaceImageSrc | Function | - | replace all `src` attribute of images。Typescript`(params: ImageProps) => string`,[Image API Documents](./image?tab=api)。[see more ts definition](https://github.com/Tencent/tdesign-mobile-react/tree/develop/src/config-provider/type.ts) | N
replaceImageSrc | Function | - | replace all `src` attribute of images。Typescript: `(params: ImageProps) => string`,[Image API Documents](./image?tab=api)。[see more ts definition](https://github.com/Tencent/tdesign-mobile-react/tree/develop/src/config-provider/type.ts) | N

### InputConfig

Expand Down Expand Up @@ -127,7 +128,7 @@ confirm | String | - | confirm text | N

name | type | default | description | required
-- | -- | -- | -- | --
loadingTexts | Array | - | Typescript`string[]` | N
loadingTexts | Array | - | Typescript: `string[]` | N

### QRCodeConfig

Expand Down Expand Up @@ -157,13 +158,28 @@ newsAriaLabel | String | - | \- | N

name | type | default | description | required
-- | -- | -- | -- | --
empty | TNode | - | Typescript:`string \| TNode`。[see more ts definition](https://github.com/Tencent/tdesign-mobile-react/blob/develop/src/common.ts) | N
clearFilterResultButtonText | String | - | \- | N
confirmText | String | - | \- | N
empty | TNode | - | Typescript: `string \| TNode`。[see more ts definition](https://github.com/Tencent/tdesign-mobile-react/blob/develop/src/common.ts) | N
filterIcon | TElement | undefined | Typescript: `TNode`。[see more ts definition](https://github.com/Tencent/tdesign-mobile-react/blob/develop/src/common.ts) | N
hideSortTips | Boolean | false | hide sort tips | N
pullUpLoadingText | String | - | \- | N
resetText | String | - | \- | N
searchResultText | String | - | \- | N

### TypographyConfig

name | type | default | description | required
-- | -- | -- | -- | --
collapseText | String | - | collapse text | N
copiedText | String | - | copied text | N
expandText | String | - | expand text | N

### UploadConfig

name | type | default | description | required
-- | -- | -- | -- | --
progress | Object | - | Typescript`UploadConfigProgress` | N
progress | Object | - | Typescript: `UploadConfigProgress` | N

### UploadConfigProgress

Expand Down
16 changes: 16 additions & 0 deletions src/config-provider/config-provider.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ qrcode | Object | - | 二维码全局配置。TS 类型:`QRCodeConfig` | N
rate | Object | - | 评分全局配置。TS 类型:`RateConfig` | N
tabBar | Object | - | 标签栏全局配置。TS 类型:`TabBarConfig` | N
table | Object | - | 表格组件全局配置。TS 类型:`TableConfig` | N
typography | Object | - | 排版组件全局配置。TS 类型:`TypographyConfig` | N
upload | Object | - | 上传组件全局配置。TS 类型:`UploadConfig` | N

### ActionSheetConfig
Expand Down Expand Up @@ -157,7 +158,22 @@ newsAriaLabel | String | - | 语言配置,“有新的消息”描述文本 |

名称 | 类型 | 默认值 | 描述 | 必传
-- | -- | -- | -- | --
clearFilterResultButtonText | String | - | 语言配置,过滤功能中,“清空筛选” 描述文本 | N
confirmText | String | - | 语言配置,“确认” 描述文本 | N
empty | TNode | - | 语言配置,“暂无数据” 描述文本。TS 类型:`string \| TNode`。[通用类型定义](https://github.com/Tencent/tdesign-mobile-react/blob/develop/src/common.ts) | N
filterIcon | TElement | undefined | 过滤图标,如果没有配置,会使用组件内置的默认图标。TS 类型:`TNode`。[通用类型定义](https://github.com/Tencent/tdesign-mobile-react/blob/develop/src/common.ts) | N
hideSortTips | Boolean | false | 隐藏排序文本提示 | N
pullUpLoadingText | String | - | 语言配置,“加载中...” 描述文本 | N
resetText | String | - | 语言配置,“重置” 描述文本 | N
searchResultText | String | - | 语言配置,过滤功能中,过滤条件和结果描述文本,示例:'搜索“{result}”,找到 {count} 条结果' | N

### TypographyConfig

名称 | 类型 | 默认值 | 描述 | 必传
-- | -- | -- | -- | --
collapseText | String | - | 语言配置,“收起”描述文本 | N
copiedText | String | - | 语言配置,“复制成功”描述文本 | N
expandText | String | - | 语言配置,“展开”描述文本 | N

### UploadConfig

Expand Down
58 changes: 57 additions & 1 deletion src/config-provider/type.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

import { FormErrorMessage } from '../form';
import { ImageProps } from '../image';
import { TNode } from '../common';
import type { TNode, TElement } from '../common';

export interface TdConfigProviderProps {
/**
Expand Down Expand Up @@ -77,6 +77,10 @@ export interface GlobalConfigProvider {
* 表格组件全局配置
*/
table?: TableConfig;
/**
* 排版组件全局配置
*/
typography?: TypographyConfig;
/**
* 上传组件全局配置
*/
Expand Down Expand Up @@ -369,10 +373,62 @@ export interface TabBarConfig {
}

export interface TableConfig {
/**
* 语言配置,过滤功能中,“清空筛选” 描述文本
* @default ''
*/
clearFilterResultButtonText?: string;
/**
* 语言配置,“确认” 描述文本
* @default ''
*/
confirmText?: string;
/**
* 语言配置,“暂无数据” 描述文本
*/
empty?: TNode;
/**
* 过滤图标,如果没有配置,会使用组件内置的默认图标
*/
filterIcon?: TElement;
/**
* 隐藏排序文本提示
* @default false
*/
hideSortTips?: boolean;
/**
* 语言配置,“加载中...” 描述文本
* @default ''
*/
pullUpLoadingText?: string;
/**
* 语言配置,“重置” 描述文本
* @default ''
*/
resetText?: string;
/**
* 语言配置,过滤功能中,过滤条件和结果描述文本,示例:'搜索“{result}”,找到 {count} 条结果'
* @default ''
*/
searchResultText?: string;
}

export interface TypographyConfig {
/**
* 语言配置,“收起”描述文本
* @default ''
*/
collapseText?: string;
/**
* 语言配置,“复制成功”描述文本
* @default ''
*/
copiedText?: string;
/**
* 语言配置,“展开”描述文本
* @default ''
*/
expandText?: string;
}

export interface UploadConfig {
Expand Down
Loading
Loading