Skip to content

Commit b797ecb

Browse files
chore: merge develop
2 parents e1afe0a + fe3cf8d commit b797ecb

15 files changed

Lines changed: 663 additions & 294 deletions

File tree

.github/dependabot.yml

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,10 +11,8 @@ updates:
1111
schedule:
1212
interval: 'monthly'
1313

14-
# Enable version updates for Docker
15-
- package-ecosystem: 'docker'
16-
# Look for a `Dockerfile` in the `root` directory
14+
# Enable version updates for github actions
15+
- package-ecosystem: 'github-actions'
1716
directory: '/'
18-
# Check for updates once a week
1917
schedule:
2018
interval: 'monthly'

.github/workflows/preview-publish.yml

Lines changed: 17 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ name: preview-publish
22

33
on:
44
workflow_run:
5-
workflows:
5+
workflows:
66
- preview-build
77
types:
88
- completed
@@ -11,7 +11,7 @@ jobs:
1111
preview-context:
1212
if: github.event.workflow_run.conclusion == 'success'
1313
runs-on: ubuntu-latest
14-
outputs:
14+
outputs:
1515
pr_id: ${{ steps.pr.outputs.id }}
1616
tdesign_react_domain: ${{ steps.tdesign-react-domain.outputs.tdesign_react_domain }}
1717
tdesign_react_chat_domain: ${{ steps.tdesign-react-chat-domain.outputs.tdesign_react_chat_domain }}
@@ -22,9 +22,9 @@ jobs:
2222
workflow: ${{ github.event.workflow_run.workflow_id }}
2323
run_id: ${{ github.event.workflow_run.id }}
2424
name: pr-id
25-
25+
2626
- name: Set pr id
27-
id : pr
27+
id: pr
2828
run: echo "id=$(cat pr-id.txt)" >> $GITHUB_OUTPUT
2929

3030
- name: tdesign-react-domain
@@ -34,7 +34,7 @@ jobs:
3434
- name: tdesign-react-chat-domain
3535
id: tdesign-react-chat-domain
3636
run: echo "tdesign_react_chat_domain=https://preview-pr-${{ steps.pr.outputs.id }}-tdesign-react-chat.surge.sh" >> $GITHUB_OUTPUT
37-
37+
3838
tdesign-react:
3939
if: github.event.workflow_run.conclusion == 'success'
4040
runs-on: ubuntu-latest
@@ -47,8 +47,8 @@ jobs:
4747
name: tdesign-react-site
4848
- run: |
4949
export DEPLOY_DOMAIN=${{ needs.preview-context.outputs.tdesign_react_domain }}
50-
npx surge --project ./ --domain $DEPLOY_DOMAIN --token ${{ secrets.TDESIGN_SURGE_TOKEN }}
51-
50+
npx surge --project ./ --domain $DEPLOY_DOMAIN --token ${{ secrets.TDESIGN_SURGE_TOKEN }}
51+
5252
tdesign-react-chat:
5353
if: github.event.workflow_run.conclusion == 'success'
5454
runs-on: ubuntu-latest
@@ -61,8 +61,8 @@ jobs:
6161
name: tdesign-react-chat-site
6262
- run: |
6363
export DEPLOY_DOMAIN=${{ needs.preview-context.outputs.tdesign_react_chat_domain }}
64-
npx surge --project ./ --domain $DEPLOY_DOMAIN --token ${{ secrets.TDESIGN_SURGE_TOKEN }}
65-
64+
npx surge --project ./ --domain $DEPLOY_DOMAIN --token ${{ secrets.TDESIGN_SURGE_TOKEN }}
65+
6666
preview-comment:
6767
if: always()
6868
needs:
@@ -86,7 +86,7 @@ jobs:
8686
run_id: context.runId,
8787
per_page: 100
8888
})
89-
89+
9090
const tdesign = {
9191
"tdesign-react": { status: "", report_url: "" },
9292
"tdesign-react-chat": { status: "", report_url: "" },
@@ -131,13 +131,13 @@ jobs:
131131
132132
<!-- AUTO_PREVIEW_HOOK -->
133133
`;
134-
134+
135135
core.setOutput('comment', comment);
136-
136+
137137
- name: comment
138-
uses:TDesignOteam/workflows/actions/maintain-one-comment@main
138+
uses: TDesignOteam/workflows/actions/maintain-one-comment@main
139139
with:
140-
token: ${{ secrets.TDESIGN_BOT_TOKEN }}
141-
number: ${{needs.preview-context.outputs.pr_id}}
142-
body: ${{ steps.report.outputs.comment }}
143-
body-include: '<!-- AUTO_PREVIEW_HOOK -->'
140+
token: ${{ secrets.TDESIGN_BOT_TOKEN }}
141+
number: ${{needs.preview-context.outputs.pr_id}}
142+
body: ${{ steps.report.outputs.comment }}
143+
body-include: '<!-- AUTO_PREVIEW_HOOK -->'

.vscode/settings.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
},
88
"[typescriptreact]": {
99
"editor.formatOnSave": true,
10-
"editor.defaultFormatter": "rvest.vs-code-prettier-eslint"
10+
"editor.defaultFormatter": "esbenp.prettier-vscode"
1111
},
1212
"[javascriptreact]": {
1313
"editor.formatOnSave": true,

packages/components/select-input/useMultiple.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -118,6 +118,7 @@ export default function useMultiple(props: SelectInputProps) {
118118
tagProps={{ ...props.tagProps, ...props.tagInputProps?.tagProps }}
119119
inputProps={{
120120
...props.inputProps,
121+
autocomplete: 'off',
121122
readOnly: !props.allowInput || readOnly,
122123
readonly: !props.allowInput || readOnly,
123124
inputClass: classNames(props.tagInputProps?.className, {

packages/components/select-input/useSingle.tsx

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -225,9 +225,19 @@ export default function useSingle(props: SelectInputProps) {
225225
// 当 valueDisplay 为 自定义元素时,选中内容时 input 依旧为空,确保此时 clear icon 可见
226226
showClearIconOnEmpty={props.clearable && showCustomElement}
227227
{...commonInputProps}
228+
<<<<<<< HEAD
228229
suffix={
229230
labelNode ||
230231
(commonInputProps.suffix && (
232+
=======
233+
autocomplete="off"
234+
autoWidth={props.autoWidth}
235+
allowInput={props.allowInput}
236+
placeholder={singleValueDisplay ? '' : props.placeholder}
237+
value={singleValueDisplay ? ' ' : displayedValue}
238+
label={
239+
(props.label || singleValueDisplay) && (
240+
>>>>>>> develop
231241
<>
232242
{labelNode}
233243
{commonInputProps.suffix}

packages/components/table/__tests__/__snapshots__/pagination.test.tsx.snap

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -296,6 +296,7 @@ exports[`BaseTable Pagination > locale data pagination controlled > pagination.c
296296
class="t-input t-align-left t-input--suffix"
297297
>
298298
<input
299+
autocomplete="off"
299300
class="t-input__inner"
300301
placeholder="请选择"
301302
readonly=""

packages/components/tabs/TabNavItem.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ const TabNavItem: React.FC<TabNavItemProps> = (props) => {
5454

5555
// 斜八度动画
5656
const [navItemDom, setRefCurrent] = useDomRefCallback();
57-
useRipple(navItemDom);
57+
useRipple(disabled ? null : navItemDom);
5858
return (
5959
<div
6060
{...dragProps}

packages/components/tabs/Tabs.tsx

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ import { useTabClass } from './useTabClass';
1313
import type { StyledProps } from '../common';
1414
import type { TabValue, TdTabsProps } from './type';
1515

16-
export interface TabsProps extends TdTabsProps, StyledProps {
16+
export interface TabsProps<T extends TabValue = TabValue> extends TdTabsProps<T>, StyledProps {
1717
children?: React.ReactNode;
1818
}
1919

@@ -94,4 +94,8 @@ const Tabs = forwardRefWithStatics(
9494

9595
Tabs.displayName = 'Tabs';
9696

97-
export default Tabs;
97+
export default Tabs as (<T extends TabValue = TabValue>(
98+
props: TabsProps<T> & React.RefAttributes<HTMLDivElement>,
99+
) => React.ReactElement) & {
100+
TabPanel: typeof TabPanel;
101+
};

packages/components/tabs/type.ts

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
import { TNode } from '../common';
88
import { MouseEvent } from 'react';
99

10-
export interface TdTabsProps {
10+
export interface TdTabsProps<T extends TabValue = TabValue> {
1111
/**
1212
* 选项卡右侧的操作区域
1313
*/
@@ -30,7 +30,7 @@ export interface TdTabsProps {
3030
/**
3131
* 选项卡列表
3232
*/
33-
list?: Array<TdTabPanelProps>;
33+
list?: Array<TdTabPanelProps<T>>;
3434
/**
3535
* 选项卡位置
3636
* @default top
@@ -54,30 +54,30 @@ export interface TdTabsProps {
5454
/**
5555
* 激活的选项卡值
5656
*/
57-
value?: TabValue;
57+
value?: T;
5858
/**
5959
* 激活的选项卡值,非受控属性
6060
*/
61-
defaultValue?: TabValue;
61+
defaultValue?: T;
6262
/**
6363
* 添加选项卡时触发
6464
*/
6565
onAdd?: (context: { e: MouseEvent<HTMLDivElement> }) => void;
6666
/**
6767
* 激活的选项卡发生变化时触发
6868
*/
69-
onChange?: (value: TabValue) => void;
69+
onChange?: (value: T) => void;
7070
/**
7171
* 拖拽排序时触发
7272
*/
73-
onDragSort?: (context: TabsDragSortContext) => void;
73+
onDragSort?: (context: TabsDragSortContext<T>) => void;
7474
/**
7575
* 删除选项卡时触发
7676
*/
77-
onRemove?: (options: { value: TabValue; index: number; e: MouseEvent<HTMLSpanElement> }) => void;
77+
onRemove?: (options: { value: T; index: number; e: MouseEvent<HTMLSpanElement> }) => void;
7878
}
7979

80-
export interface TdTabPanelProps {
80+
export interface TdTabPanelProps<T extends TabValue = TabValue> {
8181
/**
8282
* 选项卡内容隐藏时是否销毁
8383
* @default true
@@ -114,18 +114,18 @@ export interface TdTabPanelProps {
114114
/**
115115
* 选项卡的值,唯一标识
116116
*/
117-
value?: TabValue;
117+
value?: T;
118118
/**
119119
* 点击删除按钮时触发
120120
*/
121-
onRemove?: (options: { value: TabValue; e: MouseEvent<HTMLSpanElement> }) => void;
121+
onRemove?: (options: { value: T; e: MouseEvent<HTMLSpanElement> }) => void;
122122
}
123123

124124
export type TabValue = string | number;
125125

126-
export interface TabsDragSortContext {
126+
export interface TabsDragSortContext<T extends TabValue = TabValue> {
127127
currentIndex: number;
128-
current: TabValue;
128+
current: T;
129129
targetIndex: number;
130-
target: TabValue;
130+
target: T;
131131
}

packages/components/tag-input/useTagList.tsx

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
import React, { Fragment, useState } from 'react';
22
import { isFunction } from 'lodash-es';
3+
import log from '@tdesign/common-js/log/index';
34

45
import useConfig from '../hooks/useConfig';
56
import useControlled from '../hooks/useControlled';
@@ -23,7 +24,20 @@ export default function useTagList(props: TagInputProps) {
2324
const readOnly = props.readOnly || props.readonly;
2425

2526
// handle controlled property and uncontrolled property
26-
const [tagValue, setTagValue] = useControlled(props, 'value', props.onChange);
27+
const [innerTagValue, setTagValue] = useControlled(props, 'value', props.onChange);
28+
let tagValue: TagInputValue;
29+
if (Array.isArray(innerTagValue)) {
30+
tagValue = innerTagValue;
31+
} else {
32+
if (innerTagValue !== undefined && innerTagValue !== null) {
33+
log.warnOnce(
34+
'TagInput',
35+
`\`value\` is expected to be an array, but got ${typeof innerTagValue}. It will be treated as an empty array.`,
36+
);
37+
}
38+
tagValue = [];
39+
}
40+
2741
// eslint-disable-next-line @typescript-eslint/no-unused-vars
2842
const [oldInputValue, setOldInputValue] = useState<InputValue>();
2943

0 commit comments

Comments
 (0)