Skip to content

Commit

Permalink
Merge branch 'Tencent:develop' into bugfixed/table-hooks-isFilterValu…
Browse files Browse the repository at this point in the history
…eExist
  • Loading branch information
2ue authored Dec 2, 2024
2 parents 6af56fe + 51d7123 commit cc76a2a
Show file tree
Hide file tree
Showing 85 changed files with 1,250 additions and 377 deletions.
43 changes: 43 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,49 @@ toc: false
spline: explain
---

## 🌈 1.10.1 `2024-11-28`
### 🚀 Features
- `DatePicker`: 新增`multiple` API,用于支持日期选择器多选功能,具体使用请参考示例 @HaixingOoO ([#3199](https://github.com/Tencent/tdesign-react/pull/3199))
- `DatePicker`: 新增`disableTime` API,用于更方便地设置禁用时间部分 @HaixingOoO ([#3226](https://github.com/Tencent/tdesign-react/pull/3226))
- `Dialog`: 新增 `beforeClose``beforeOpen` API,用于在打开和关闭弹窗时执行更多回调操作 @Wesley-0808 ([#3203](https://github.com/Tencent/tdesign-react/pull/3203))
- `Drawer`: 新增 `beforeClose``beforeOpen` API,用于在打开和关闭抽屉时执行更多回调操作 @Wesley-0808 ([#3203](https://github.com/Tencent/tdesign-react/pull/3203))
### 🐞 Bug Fixes

- `ColorPicker`: 修复 `colorMode` 部分文案没有支持国际化的问题 @l123wx ([#3221](https://github.com/Tencent/tdesign-react/pull/3221))
- `Form`: 修复`setFieldsValue``setFields` 没有触发`onValuesChange`的问题 @uyarn ([#3232](https://github.com/Tencent/tdesign-react/pull/3232))
- `Notification`: 修改 `NotificationPlugin``offset` 属性默认值,使其更符合常规习惯 @huangchen1031 ([#3231](https://github.com/Tencent/tdesign-react/pull/3231))
- `Select`: 修复 `collapsedItems` 的参数 `collapsedSelectedItems` 的错误 @RSS1102 ([#3214](https://github.com/Tencent/tdesign-react/pull/3214))
- `Select`: 修复多选下拉框全选功能失效的问题 @huangchen1031 ([#3216](https://github.com/Tencent/tdesign-react/pull/3216))
- `Table`: 修复可过滤表格在处理`null`类型的异常问题 @2ue ([#3197](https://github.com/Tencent/tdesign-react/pull/3197))
- `Table`: 修复单元格为数字 0 且开启省略时渲染异常的问题 @uyarn ([#3233](https://github.com/Tencent/tdesign-react/pull/3233))
- `Tree`: 修复`scrollTo`方法滚动的异常行为 @uyarn ([#3235](https://github.com/Tencent/tdesign-react/pull/3235))
### 📝 Documentation
- `Dialog`: 修复代码示例的错误 @RSS1102 ([#3229](https://github.com/Tencent/tdesign-react/pull/3229))
### 🚧 Others
- `TextArea`: 优化 `TextArea` 事件类型 @HaixingOoO ([#3211](https://github.com/Tencent/tdesign-react/pull/3211))

## 🌈 1.10.0 `2024-11-15`
### 🚀 Features
- `Select`: `collapsedItems` 方法的参数 `collapsedSelectedItems` 扩充为 `options`,使用`collapsedItems`请注意此变更 @RSS1102 ([#3185](https://github.com/Tencent/tdesign-react/pull/3185))
- `Icon`: 图标库发布 `0.4.0`版本,新增 907 个新图标;命名优化`blockchain` 重命名改为`transform-1`,`gesture-pray-1`重命名为`gesture-open`,`gesture-ranslation-1`重命名为`wave-bye`, `gesture-up-1`重命名为`gesture-typing`,`gesture-up-2`重命名为`gesture-right-slip`,`logo-wechat`重命名为`logo-wechat-stroke-filled`,移除`tree-list``logo-adobe-photoshop-1` 等错误图标 @uyarn ([#3194](https://github.com/Tencent/tdesign-react/pull/3194))
- `Cascader`: 单选模式下当`trigger``hover`时,选中选项后自动关闭面板 @uyarn ([#3188](https://github.com/Tencent/tdesign-react/pull/3188))
- `Checkbox`: 新增 `title` API, 用于在选项展示禁用原因等场景 @uyarn ([#3207](https://github.com/Tencent/tdesign-react/pull/3207))
- `Menu`: 新增`tooltipProps` API,作用于一级菜单收起聚焦出现的节点 @uyarn ([#3201](https://github.com/Tencent/tdesign-react/pull/3201))
- `Switch`: 新增 `before-change` API @centuryPark ([#3167](https://github.com/Tencent/tdesign-react/pull/3167))
- `Form`: 新增 `getValidateMessage` 实例方法 @moecasts ([#3180](https://github.com/Tencent/tdesign-react/pull/3180))

### 🐞 Bug Fixes
- `TagInput`: 修复在`readonly`模式下仍可以通过Backspace按键删除已选项的缺陷 @RSS1102 ([#3172](https://github.com/Tencent/tdesign-react/pull/3172))
- `Form`: 修复`1.9.3`版本 `FormItem``Form`外设置了`name`属性有异常的问题 @l123wx ([#3183](https://github.com/Tencent/tdesign-react/pull/3183))
- `Select`: 修复 valueType 为 object 时,点击全选按钮后 onChange 回调参数类型错误的问题 @l123wx ([#3193](https://github.com/Tencent/tdesign-react/pull/3193))
- `Table`: 修复动态设置`expandTreeNode`没有正常展示子节点的问题 @uyarn ([#3202](https://github.com/Tencent/tdesign-react/pull/3202))
- `Tree`: 修复动态切换`expandAll`的功能异常问题 @uyarn ([#3204](https://github.com/Tencent/tdesign-react/pull/3204))
- `Drawer`: 修复无法自定义`confirmBtn``closeBtn`内容的问题 @RSS1102 ([#3191](https://github.com/Tencent/tdesign-react/pull/3191))
### 📝 Documentation
- `Icon`: 优化图标检索功能,支持中英文搜索图标 @uyarn ([#3194](https://github.com/Tencent/tdesign-react/pull/3194))
- `Popup`: 新增`popperOption`使用示例 @HaixingOoO ([#3200](https://github.com/Tencent/tdesign-react/pull/3200))


## 🌈 1.9.3 `2024-10-31`
### 🐞 Bug Fixes
- `Select`: 修复`valueDisplay`下的`onClose`回调问题 @uyarn ([#3154](https://github.com/Tencent/tdesign-react/pull/3154))
Expand Down
5 changes: 3 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "tdesign-react",
"purename": "tdesign",
"version": "1.9.3",
"version": "1.10.1",
"description": "TDesign Component for React",
"title": "tdesign-react",
"main": "lib/index.js",
Expand Down Expand Up @@ -121,7 +121,7 @@
"@testing-library/user-event": "^14.4.3",
"@types/estree": "0.0.50",
"@types/hoist-non-react-statics": "^3.3.1",
"@types/lodash": "4.17.9",
"@types/lodash": "4.17.13",
"@types/node": "^22.7.0",
"@types/raf": "^3.4.0",
"@types/react": "~18.2.0",
Expand Down Expand Up @@ -183,6 +183,7 @@
"rollup-plugin-styles": "^4.0.0",
"rollup-plugin-terser": "^7.0.2",
"rollup-plugin-typescript2": "^0.31.2",
"semver": "^7.6.3",
"standard-changelog": "^2.0.27",
"start-server-and-test": "^1.14.0",
"tdesign-icons-view": "^0.3.0",
Expand Down
7 changes: 4 additions & 3 deletions site/src/App.jsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import React, { useEffect, useRef, useState, lazy, Suspense } from 'react';
import { BrowserRouter, Routes, Navigate, Route, useLocation, useNavigate, Outlet } from 'react-router-dom';
import semver from 'semver';
import Loading from 'tdesign-react/loading';
import ConfigProvider from 'tdesign-react/config-provider';
import zhConfig from 'tdesign-react/es/locale/zh_CN';
Expand All @@ -19,7 +20,7 @@ const docsMap = {
en: enDocs,
};

const registryUrl = 'https://mirrors.tencent.com/npm/tdesign-react';
const registryUrl = 'https://service-edbzjd6y-1257786608.hk.apigw.tencentcs.com/release/npm/versions/tdesign-react';
const currentVersion = packageJson.version.replace(/\./g, '_');

const docRoutes = [...getRoute(siteConfig.docs, []), ...getRoute(siteConfig.enDocs, [])];
Expand Down Expand Up @@ -65,7 +66,8 @@ function Components() {

options.unshift({ label: v, value: v.replace(/\./g, '_') });
});
tdSelectRef.current.options = options;

tdSelectRef.current.options = options.sort((a, b) => (semver.gt(a.label, b.label) ? -1 : 1));
});
}

Expand Down Expand Up @@ -95,7 +97,6 @@ function Components() {
};

initHistoryVersions();

}, []);

useEffect(() => {
Expand Down
5 changes: 2 additions & 3 deletions src/avatar/type.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,8 @@
import { MouseEvent } from 'react';
import { ImageProps } from '../image';
import { PopupProps } from '../popup';
import { TNode, TElement, ImageEvent } from '../common';

import { TNode, TElement, ImageEvent, ShapeEnum } from '../common';

export interface TdAvatarProps {
/**
Expand Down Expand Up @@ -94,6 +95,4 @@ export interface TdAvatarGroupProps {
size?: string;
}

export type ShapeEnum = 'circle' | 'round';

export type CascadingValue = 'left-up' | 'right-up';
1 change: 1 addition & 0 deletions src/checkbox/checkbox.en-US.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ indeterminate | Boolean | false | \- | N
label | TNode | - | Typescript:`string \| TNode`[see more ts definition](https://github.com/Tencent/tdesign-react/blob/develop/src/common.ts) | N
name | String | - | \- | N
readonly | Boolean | false | \- | N
title | String | - | html attribute | N
value | String / Number / Boolean | - | value of checkbox。Typescript:`string \| number \| boolean` | N
onChange | Function | | Typescript:`(checked: boolean, context: { e: ChangeEvent }) => void`<br/> | N
onClick | Function | | Typescript:`(context: { e: MouseEvent }) => void`<br/>trigger on click | N
Expand Down
1 change: 1 addition & 0 deletions src/checkbox/checkbox.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ indeterminate | Boolean | false | 是否为半选 | N
label | TNode | - | 主文案。TS 类型:`string \| TNode`[通用类型定义](https://github.com/Tencent/tdesign-react/blob/develop/src/common.ts) | N
name | String | - | HTML 元素原生属性 | N
readonly | Boolean | false | 只读状态 | N
title | String | - | HTML 原生属性 | N
value | String / Number / Boolean | - | 多选框的值。TS 类型:`string \| number \| boolean` | N
onChange | Function | | TS 类型:`(checked: boolean, context: { e: ChangeEvent }) => void`<br/>值变化时触发 | N
onClick | Function | | TS 类型:`(context: { e: MouseEvent }) => void`<br/>点击时触发,一般用于外层阻止冒泡场景 | N
Expand Down
5 changes: 5 additions & 0 deletions src/checkbox/type.ts
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,11 @@ export interface TdCheckboxProps {
* @default false
*/
readonly?: boolean;
/**
* HTML 原生属性
* @default ''
*/
title?: string;
/**
* 多选框的值
*/
Expand Down
6 changes: 2 additions & 4 deletions src/color-picker/components/panel/format/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import upperCase from 'lodash/upperCase';
import Select from '../../../../select';
import FormatInput from './inputs';
import Color from '../../../../_common/js/color-picker/color';
import { FORMATS } from '../../../const';
import { FORMATS } from '../../../../_common/js/color-picker/constants';
import { TdColorPickerProps } from '../../../type';

export interface TdColorFormatProps extends TdColorPickerProps {
Expand All @@ -21,8 +21,6 @@ const FormatPanel = (props: TdColorFormatProps) => {
onModeChange(v);
};

const formats: TdColorPickerProps['format'][] = [...FORMATS];

return (
<div className={`${baseClassName}__format`}>
<div className={`${baseClassName}__format--item`}>
Expand All @@ -37,7 +35,7 @@ const FormatPanel = (props: TdColorFormatProps) => {
value={formatMode}
onChange={handleModeChange}
>
{formats.map((item) => (
{FORMATS.map((item) => (
<Select.Option key={item} value={item} label={upperCase(item)} style={{ fontSize: '12px' }} />
))}
</Select>
Expand Down
23 changes: 11 additions & 12 deletions src/color-picker/components/panel/header.tsx
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
import React from 'react';
import { COLOR_MODES } from '../../const';
import { COLOR_MODES } from '../../../_common/js/color-picker/constants';
import Radio, { RadioValue } from '../../../radio';
import { TdColorModes } from '../../interface';
import { TdColorPickerProps } from '../../type';
import { useLocaleReceiver } from '../../../locale/LocalReceiver';

export interface ColorPanelHeaderProps extends TdColorPickerProps {
mode?: TdColorModes;
Expand All @@ -12,6 +13,8 @@ export interface ColorPanelHeaderProps extends TdColorPickerProps {
}

const Header = (props: ColorPanelHeaderProps) => {
const [local, t] = useLocaleReceiver('colorPicker');

const { baseClassName, mode = 'monochrome', colorModes, onModeChange } = props;

const isSingleMode = colorModes?.length === 1;
Expand All @@ -23,17 +26,13 @@ const Header = (props: ColorPanelHeaderProps) => {
return (
<div className={`${baseClassName}__head`}>
<div className={`${baseClassName}__mode`}>
{colorModes?.length === 1 ? (
COLOR_MODES[colorModes[0]]
) : (
<Radio.Group variant="default-filled" size="small" value={mode} onChange={onModeChange}>
{Object.keys(COLOR_MODES).map((key) => (
<Radio.Button key={key} value={key}>
{COLOR_MODES[key]}
</Radio.Button>
))}
</Radio.Group>
)}
<Radio.Group variant="default-filled" size="small" value={mode} onChange={onModeChange}>
{Object.keys(COLOR_MODES).map((key) => (
<Radio.Button key={key} value={key}>
{t(local[COLOR_MODES[key]])}
</Radio.Button>
))}
</Radio.Group>
</div>
</div>
);
Expand Down
2 changes: 1 addition & 1 deletion src/color-picker/components/panel/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ import {
DEFAULT_LINEAR_GRADIENT,
TD_COLOR_USED_COLORS_MAX_SIZE,
DEFAULT_SYSTEM_SWATCH_COLORS,
} from '../../const';
} from '../../../_common/js/color-picker/constants';
import { ColorPickerProps, TdColorModes, TdColorSaturationData } from '../../interface';
import { ColorPickerChangeTrigger, TdColorPickerProps } from '../../type';
import { colorPickerDefaultProps } from '../../defaultProps';
Expand Down
2 changes: 1 addition & 1 deletion src/color-picker/components/panel/linear-gradient.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import useClassName from '../../hooks/useClassNames';
import { genGradientPoint, gradientColors2string } from '../../../_common/js/color-picker/color';
import { GradientColorPoint } from '../../../_common/js/color-picker/gradient';
import useCommonClassName from '../../../hooks/useCommonClassName';
import { GRADIENT_SLIDER_DEFAULT_WIDTH } from '../../const';
import { GRADIENT_SLIDER_DEFAULT_WIDTH } from '../../../_common/js/color-picker/constants';
import InputNumber from '../../../input-number';

const DELETE_KEYS: string[] = ['delete', 'backspace'];
Expand Down
5 changes: 4 additions & 1 deletion src/color-picker/components/panel/saturation.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
import React, { useRef, useEffect, useCallback } from 'react';
import { SATURATION_PANEL_DEFAULT_HEIGHT, SATURATION_PANEL_DEFAULT_WIDTH } from '../../const';
import {
SATURATION_PANEL_DEFAULT_HEIGHT,
SATURATION_PANEL_DEFAULT_WIDTH,
} from '../../../_common/js/color-picker/constants';
import { TdColorBaseProps } from '../../interface';
import useDrag, { Coordinate } from '../../../hooks/useDrag';

Expand Down
2 changes: 1 addition & 1 deletion src/color-picker/components/panel/slider.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import React, { useRef, useEffect } from 'react';
import classnames from 'classnames';
import { SLIDER_DEFAULT_WIDTH } from '../../const';
import { SLIDER_DEFAULT_WIDTH } from '../../../_common/js/color-picker/constants';
import useDrag, { Coordinate } from '../../../hooks/useDrag';
import { TdColorBaseProps } from '../../interface';
import useStyles from '../../hooks/useStyles';
Expand Down
71 changes: 0 additions & 71 deletions src/color-picker/const.ts

This file was deleted.

2 changes: 2 additions & 0 deletions src/common.ts
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,8 @@ export type TreeOptionData<T = string | number> = {

export type SizeEnum = 'small' | 'medium' | 'large';

export type ShapeEnum = 'circle' | 'round';

export type HorizontalAlignEnum = 'left' | 'center' | 'right';

export type VerticalAlignEnum = 'top' | 'middle' | 'bottom';
Expand Down
Loading

0 comments on commit cc76a2a

Please sign in to comment.