Skip to content

Commit 6c1d132

Browse files
committed
Merge remote-tracking branch 'origin' into rylan/feat/select/filterable
2 parents c075b15 + a9c3fed commit 6c1d132

29 files changed

Lines changed: 458 additions & 158 deletions

.github/workflows/auto-publish.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -35,15 +35,15 @@ jobs:
3535

3636
- uses: pnpm/action-setup@v6
3737

38-
- uses: actions/setup-node@v4
38+
- uses: actions/setup-node@v6
3939
with:
4040
node-version-file: .node-version
4141

4242
- run: pnpm install
4343

4444
- run: pnpm -C packages/tdesign-react/site run preview
4545

46-
- uses: actions/github-script@v7
46+
- uses: actions/github-script@v9
4747
id: domain
4848
with:
4949
script: |
@@ -68,15 +68,15 @@ jobs:
6868

6969
- uses: pnpm/action-setup@v6
7070

71-
- uses: actions/setup-node@v4
71+
- uses: actions/setup-node@v6
7272
with:
7373
node-version-file: .node-version
7474

7575
- run: pnpm install
7676

7777
- run: pnpm -C packages/tdesign-react-aigc/site run preview
7878

79-
- uses: actions/github-script@v7
79+
- uses: actions/github-script@v9
8080
id: domain
8181
with:
8282
script: |

.github/workflows/auto-release.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,15 +19,15 @@ jobs:
1919

2020
- uses: pnpm/action-setup@v6
2121

22-
- uses: actions/setup-node@v4
22+
- uses: actions/setup-node@v6
2323
with:
2424
node-version-file: .node-version
2525

2626
- run: pnpm install
2727

2828
- run: pnpm exec run-p build build:aigc
2929

30-
- uses: actions/setup-node@v4
30+
- uses: actions/setup-node@v6
3131
with:
3232
node-version: 24
3333

.github/workflows/pkg-pr-new.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ jobs:
1717

1818
- uses: pnpm/action-setup@v6
1919

20-
- uses: actions/setup-node@v4
20+
- uses: actions/setup-node@v6
2121
with:
2222
node-version-file: .node-version
2323

.github/workflows/pr-comment-ci.yml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ jobs:
2020
.github/.pr-comment-ci-whitelist
2121
sparse-checkout-cone-mode: false
2222

23-
- uses: actions/github-script@v7
23+
- uses: actions/github-script@v9
2424
id: get-action
2525
with:
2626
script: |
@@ -157,7 +157,7 @@ jobs:
157157

158158
- name: bot commtent
159159
id: bot-comment
160-
uses: actions/github-script@v7
160+
uses: actions/github-script@v9
161161
with:
162162
script: |
163163
const url = `${context.serverUrl}//${context.repo.owner}/${context.repo.repo}/actions/runs/${context.runId}`
@@ -229,7 +229,7 @@ jobs:
229229
230230
- uses: pnpm/action-setup@v6
231231

232-
- uses: actions/setup-node@v4
232+
- uses: actions/setup-node@v6
233233
with:
234234
node-version-file: .node-version
235235

@@ -274,7 +274,7 @@ jobs:
274274
275275
- name: bot commtent
276276
id: bot-comment
277-
uses: actions/github-script@v7
277+
uses: actions/github-script@v9
278278
with:
279279
script: |
280280
const url = `${context.serverUrl}//${context.repo.owner}/${context.repo.repo}/actions/runs/${context.runId}`
@@ -289,7 +289,7 @@ jobs:
289289
290290
- uses: pnpm/action-setup@v6
291291

292-
- uses: actions/setup-node@v4
292+
- uses: actions/setup-node@v6
293293
with:
294294
node-version-file: .node-version
295295

.github/workflows/pr-compressed-size.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,8 @@ jobs:
2121
- uses: preactjs/compressed-size-action@v2
2222
with:
2323
repo-token: "${{ secrets.GITHUB_TOKEN }}"
24-
install-script: "pnpm install"
25-
build-script: "build"
24+
install-script: pnpm install --no-frozen-lockfile
25+
build-script: build
2626
pattern: "packages/tdesign-react/dist/**/*.{js,css}"
2727
comment-key: tdesign-react
2828

@@ -42,7 +42,7 @@ jobs:
4242
- uses: preactjs/compressed-size-action@v2
4343
with:
4444
repo-token: "${{ secrets.GITHUB_TOKEN }}"
45-
install-script: "pnpm install"
46-
build-script: "build:aigc"
45+
install-script: pnpm install --no-frozen-lockfile
46+
build-script: build:aigc
4747
pattern: "packages/tdesign-react-aigc/es/**/*.{js,css}"
4848
comment-key: tdesign-react-chat

.github/workflows/preview-build.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ jobs:
2222

2323
- uses: pnpm/action-setup@v6
2424

25-
- uses: actions/setup-node@v4
25+
- uses: actions/setup-node@v6
2626
with:
2727
node-version-file: .node-version
2828

@@ -45,7 +45,7 @@ jobs:
4545

4646
- uses: pnpm/action-setup@v6
4747

48-
- uses: actions/setup-node@v4
48+
- uses: actions/setup-node@v6
4949
with:
5050
node-version-file: .node-version
5151

.github/workflows/preview-publish.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ jobs:
7373
steps:
7474
- name: jobs report
7575
id: report
76-
uses: actions/github-script@v7
76+
uses: actions/github-script@v9
7777
with:
7878
script: |
7979
const pr_id = ${{ needs.preview-context.outputs.pr_id }};

.github/workflows/pull-request.yml

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ jobs:
5252
submodules: recursive
5353
- uses: pnpm/action-setup@v6
5454

55-
- uses: actions/setup-node@v4
55+
- uses: actions/setup-node@v6
5656
with:
5757
node-version-file: .node-version
5858

@@ -61,7 +61,7 @@ jobs:
6161
run: |
6262
echo "pnpm_cache_dir=$(pnpm store path)" >> $GITHUB_OUTPUT
6363
64-
- uses: actions/cache@v4
64+
- uses: actions/cache@v6
6565
with:
6666
# 缓存路径
6767
path: ${{ steps.pnpm-cache.outputs.pnpm_cache_dir }}
@@ -89,15 +89,15 @@ jobs:
8989

9090
- uses: pnpm/action-setup@v6
9191

92-
- uses: actions/setup-node@v4
92+
- uses: actions/setup-node@v6
9393
with:
9494
node-version-file: .node-version
9595
- name: Get pnpm store directory
9696
id: pnpm-cache
9797
run: |
9898
echo "pnpm_cache_dir=$(pnpm store path)" >> $GITHUB_OUTPUT
9999
100-
- uses: actions/cache@v4
100+
- uses: actions/cache@v6
101101
with:
102102
# 缓存路径
103103
path: ${{ steps.pnpm-cache.outputs.pnpm_cache_dir }}
@@ -122,15 +122,15 @@ jobs:
122122

123123
- uses: pnpm/action-setup@v6
124124

125-
- uses: actions/setup-node@v4
125+
- uses: actions/setup-node@v6
126126
with:
127127
node-version-file: .node-version
128128
- name: Get pnpm store directory
129129
id: pnpm-cache
130130
run: |
131131
echo "pnpm_cache_dir=$(pnpm store path)" >> $GITHUB_OUTPUT
132132
133-
- uses: actions/cache@v4
133+
- uses: actions/cache@v6
134134
with:
135135
# 缓存路径
136136
path: ${{ steps.pnpm-cache.outputs.pnpm_cache_dir }}

package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,7 @@
103103
"esbuild": "^0.14.9",
104104
"eslint": "^7.32.0",
105105
"eslint-config-airbnb-base": "^14.2.1",
106-
"eslint-config-prettier": "^8.3.0",
106+
"eslint-plugin-prettier": "^5.2.1",
107107
"eslint-plugin-react": "~7.28.0",
108108
"eslint-plugin-react-hooks": "^4.0.0",
109109
"eslint-plugin-simple-import-sort": "^13.0.0",
@@ -119,7 +119,7 @@
119119
"msw": "^1.0.0",
120120
"npm-run-all2": "^8.0.4",
121121
"postcss": "^8.3.11",
122-
"prettier": "^2.3.2",
122+
"prettier": "^3.8.4",
123123
"prismjs": "^1.28.0",
124124
"prop-types": "^15.7.2",
125125
"react": "^18.2.0",

packages/components/tag-input/TagInput.tsx

Lines changed: 15 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ import useControlled from '../hooks/useControlled';
88
import useDefaultProps from '../hooks/useDefaultProps';
99
import useDragSorter from '../hooks/useDragSorter';
1010
import useGlobalIcon from '../hooks/useGlobalIcon';
11+
import useUpdateLayoutEffect from '../hooks/useUpdateLayoutEffect';
1112
import TInput from '../input';
1213
import { tagInputDefaultProps } from './defaultProps';
1314
import useHover from './useHover';
@@ -80,16 +81,24 @@ const TagInput = forwardRef<InputRef, TagInputProps>((originalProps, ref) => {
8081
getDragProps,
8182
});
8283

84+
useUpdateLayoutEffect(() => {
85+
if (excessTagsDisplayType === 'scroll') {
86+
scrollToRight();
87+
}
88+
}, [tagValue]);
89+
8390
const NAME_CLASS = `${prefix}-tag-input`;
8491
const WITH_SUFFIX_ICON_CLASS = `${prefix}-tag-input__with-suffix-icon`;
8592
const CLEAR_CLASS = `${prefix}-tag-input__suffix-clear`;
8693
const BREAK_LINE_CLASS = `${prefix}-tag-input--break-line`;
8794

8895
const tagInputPlaceholder = !tagValue?.length ? placeholder : '';
8996

90-
const showClearIcon = Boolean(!readOnly && !disabled && clearable && isHover && tagValue?.length);
97+
const showClearIcon = Boolean(!readOnly && !disabled && clearable && isHover && (tagValue?.length || tInputValue));
9198

92-
useImperativeHandle(ref as InputRef, () => ({ ...(tagInputRef.current || {}) }));
99+
useImperativeHandle(ref as InputRef, () => ({
100+
...(tagInputRef.current || {}),
101+
}));
93102

94103
const updateSuffixWidth = (selector: string, cssVar: string, widthRef: React.MutableRefObject<number>) => {
95104
const wrapperEl = tagInputRef.current?.currentElement as HTMLElement;
@@ -140,9 +149,11 @@ const TagInput = forwardRef<InputRef, TagInputProps>((originalProps, ref) => {
140149
};
141150

142151
const onInputEnter = (value: InputValue, context: { e: KeyboardEvent<HTMLInputElement> }) => {
152+
context.e?.preventDefault?.();
143153
setTInputValue('', { e: context.e, trigger: 'enter' });
144-
!isCompositionRef.current && onInnerEnter(value, context);
145-
scrollToRight();
154+
if (!isCompositionRef.current) {
155+
onInnerEnter(value, context);
156+
}
146157
};
147158

148159
const onInnerClick = (context: { e: MouseEvent<HTMLDivElement> }) => {

0 commit comments

Comments
 (0)