Skip to content

Commit e7ec210

Browse files
committed
Merge remote-tracking branch 'origin/main' into feat-4.3
2 parents db740c8 + b0d9309 commit e7ec210

File tree

86 files changed

+707
-610
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

86 files changed

+707
-610
lines changed

CHANGELOG.en-US.md

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,30 @@
1010

1111
---
1212

13+
## 4.2.5
14+
15+
- 🐞 Fix Empty component memory leak problem
16+
- 🐞 Fix Image width & height property not working problem
17+
18+
## 4.2.4
19+
20+
- 🐞 Fix Wave memory leak problem
21+
22+
## 4.2.3
23+
24+
- 🌟 TourStep custom Button, support function children [#7628](https://github.com/vueComponent/ant-design-vue/pull/7628)
25+
- 🐞 Fix the problem that the input value is hidden in Select and Cascader search multi-select mode [#7640](https://github.com/vueComponent/ant-design-vue/issues/7640)
26+
27+
## 4.2.2
28+
29+
- 🐞 Fix TreeSelect placeholder slot invalid [#7545](https://github.com/vueComponent/ant-design-vue/issues/7545)
30+
- 🐞 Fix Tree slot responsive invalid issue [40ad45](https://github.com/vueComponent/ant-design-vue/commit/40ad45bc05b2bf9d0a2445d9f6ff365468ba90b7)
31+
- 🐞 Fix FloatButton target type error issue [#7576](https://github.com/vueComponent/ant-design-vue/issues/7576)
32+
- 🐞 Fix FormItem className error issue [#7582](https://github.com/vueComponent/ant-design-vue/issues/7582)
33+
- 🐞 Fix Input Cannot input problem under lazy [#7543](https://github.com/vueComponent/ant-design-vue/issues/7543)
34+
- 🐞 Fix the problem that placeholder is not hidden when inputting Chinese in Select [#7611](https://github.com/vueComponent/ant-design-vue/issues/7611)
35+
- 🐞 Fix the problem that the pop-up window flashes when clicking the preset option in DatePicker [#7550](https://github.com/vueComponent/ant-design-vue/issues/7550)
36+
1337
## 4.2.1
1438

1539
- 🐞 fix Input clear action error [#7523](https://github.com/vueComponent/ant-design-vue/issues/7523)

CHANGELOG.zh-CN.md

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,30 @@
1010

1111
---
1212

13+
## 4.2.5
14+
15+
- 🐞 修复 Empty 组件内存泄漏问题
16+
- 🐞 修复 Image width & height 属性不生效问题
17+
18+
## 4.2.4
19+
20+
- 🐞 修复 Wave 内存泄漏问题
21+
22+
## 4.2.3
23+
24+
- 🌟 TourStep 自定义 Button,支持函数 children [#7628](https://github.com/vueComponent/ant-design-vue/pull/7628)
25+
- 🐞 修复 Select 和 Cascader 搜索多选模式下,输入值被隐藏问题 [#7640](https://github.com/vueComponent/ant-design-vue/issues/7640)
26+
27+
## 4.2.2
28+
29+
- 🐞 修复 TreeSelect placeholder 插槽无效 [#7545](https://github.com/vueComponent/ant-design-vue/issues/7545)
30+
- 🐞 修复 Tree 插槽响应式无效问题 [40ad45](https://github.com/vueComponent/ant-design-vue/commit/40ad45bc05b2bf9d0a2445d9f6ff365468ba90b7)
31+
- 🐞 修复 FloatButton target 类型错误问题 [#7576](https://github.com/vueComponent/ant-design-vue/issues/7576)
32+
- 🐞 修复 FormItem className 错误问题 [#7582](https://github.com/vueComponent/ant-design-vue/issues/7582)
33+
- 🐞 修复 Input lazy 下无法输入问题 [#7543](https://github.com/vueComponent/ant-design-vue/issues/7543)
34+
- 🐞 修复 Select 输入中文时,placeholder 未隐藏问题 [#7611](https://github.com/vueComponent/ant-design-vue/issues/7611)
35+
- 🐞 修复 DatePicker 点击预设选项时,弹窗闪动问题 [#7550](https://github.com/vueComponent/ant-design-vue/issues/7550)
36+
1337
## 4.2.1
1438

1539
- 🐞 修复 Input 清空操作才报错问题 [#7523](https://github.com/vueComponent/ant-design-vue/issues/7523)

README-zh_CN.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010

1111
<div align="center">
1212

13-
An enterprise-class UI components based on Ant Design and Vue 3.
13+
基于 Ant Design Vue 3 的企业级 UI 组件库。
1414

1515
![test](https://github.com/vueComponent/ant-design-vue/workflows/test/badge.svg) [![codecov](https://img.shields.io/codecov/c/github/vueComponent/ant-design-vue/master.svg?style=flat-square)](https://codecov.io/gh/vueComponent/ant-design-vue) [![npm package](https://img.shields.io/npm/v/ant-design-vue.svg?style=flat-square)](https://www.npmjs.org/package/ant-design-vue) [![NPM downloads](http://img.shields.io/npm/dm/ant-design-vue.svg?style=flat-square)](http://www.npmtrends.com/ant-design-vue) [![backers](https://opencollective.com/ant-design-vue/backers/badge.svg)](#backers) [![sponsors](https://opencollective.com/ant-design-vue/sponsors/badge.svg)](#sponsors) [![extension-for-VSCode](https://img.shields.io/badge/extension%20for-VSCode-blue.svg?style=flat-square)](https://marketplace.visualstudio.com/items?itemName=ant-design-vue.vscode-ant-design-vue-helper) [![issues-helper](https://img.shields.io/badge/Issues%20Manage%20By-issues--helper-orange?style=flat-square)](https://github.com/actions-cool/issues-helper)
1616

@@ -90,21 +90,21 @@ ant-design-vue 是 MIT 协议的开源项目。为了项目能够更好的持续
9090
- [支付宝或微信](https://aliyuncdn.antdv.com/alipay-and-wechat.png)
9191
- ETH: 0x30cc48515d8ae9fefa20ab87226ad7e8ab9c3bc2
9292

93-
## Sponsors
93+
## 赞助商
9494

95-
Become a sponsor and get your logo on our README on Github with a link to your site. [[Become a sponsor](https://opencollective.com/ant-design-vue#sponsor)]
95+
成为赞助商,并在 Github 上的自述文件上获得您的徽标,并链接到您的网站。 [[成为赞助商](https://opencollective.com/ant-design-vue#sponsor)]
9696

9797
<a href="http://www.jeecg.com/" target="_blank"><img src="https://aliyuncdn.antdv.com/jeecg-logo.png" height="64"></a> <a href="https://opencollective.com/ant-design-vue/sponsor/0/website" target="_blank"><img src="https://opencollective.com/ant-design-vue/sponsor/0/avatar.svg"></a> <a href="https://opencollective.com/ant-design-vue/sponsor/1/website" target="_blank"><img src="https://opencollective.com/ant-design-vue/sponsor/1/avatar.svg"></a> <a href="https://opencollective.com/ant-design-vue/sponsor/2/website" target="_blank"><img src="https://opencollective.com/ant-design-vue/sponsor/2/avatar.svg"></a> <a href="https://opencollective.com/ant-design-vue/sponsor/3/website" target="_blank"><img src="https://opencollective.com/ant-design-vue/sponsor/3/avatar.svg"></a> <a href="https://opencollective.com/ant-design-vue/sponsor/4/website" target="_blank"><img src="https://opencollective.com/ant-design-vue/sponsor/4/avatar.svg"></a> <a href="https://opencollective.com/ant-design-vue/sponsor/5/website" target="_blank"><img src="https://opencollective.com/ant-design-vue/sponsor/5/avatar.svg"></a> <a href="https://opencollective.com/ant-design-vue/sponsor/6/website" target="_blank"><img src="https://opencollective.com/ant-design-vue/sponsor/6/avatar.svg"></a> <a href="https://opencollective.com/ant-design-vue/sponsor/7/website" target="_blank"><img src="https://opencollective.com/ant-design-vue/sponsor/7/avatar.svg"></a> <a href="https://opencollective.com/ant-design-vue/sponsor/8/website" target="_blank"><img src="https://opencollective.com/ant-design-vue/sponsor/8/avatar.svg"></a> <a href="https://opencollective.com/ant-design-vue/sponsor/9/website" target="_blank"><img src="https://opencollective.com/ant-design-vue/sponsor/9/avatar.svg"></a> <a href="https://opencollective.com/ant-design-vue/sponsor/10/website" target="_blank"><img src="https://opencollective.com/ant-design-vue/sponsor/10/avatar.svg"></a>
9898

99-
## Backers
99+
## 支持者
100100

101-
Support us with a monthly donation and help us continue our activities. [[Become a backer](https://opencollective.com/ant-design-vue#backer)]
101+
每月捐款支持我们,帮助我们继续我们的活动。 [[成为支持者](https://opencollective.com/ant-design-vue#backer)]
102102

103103
<a href="https://github.com/chuzhixin/vue-admin-beautiful" target="_blank"><img width="64" style="border-radius: 50%;" src="https://gitee.com/chu1204505056/image/raw/master/vue-admin-beautiful.png" title="vue-admin-beautiful"></a> <a href="https://opencollective.com/ant-design-vue/backer/0/website" target="_blank"><img src="https://opencollective.com/ant-design-vue/backer/0/avatar.svg"></a> <a href="https://opencollective.com/ant-design-vue/backer/1/website" target="_blank"><img src="https://opencollective.com/ant-design-vue/backer/1/avatar.svg"></a> <a href="https://opencollective.com/ant-design-vue/backer/2/website" target="_blank"><img src="https://opencollective.com/ant-design-vue/backer/2/avatar.svg"></a> <a href="https://opencollective.com/ant-design-vue/backer/3/website" target="_blank"><img src="https://opencollective.com/ant-design-vue/backer/3/avatar.svg"></a> <a href="https://opencollective.com/ant-design-vue/backer/4/website" target="_blank"><img src="https://opencollective.com/ant-design-vue/backer/4/avatar.svg"></a> <a href="https://opencollective.com/ant-design-vue/backer/5/website" target="_blank"><img src="https://opencollective.com/ant-design-vue/backer/5/avatar.svg"></a> <a href="https://opencollective.com/ant-design-vue/backer/6/website" target="_blank"><img src="https://opencollective.com/ant-design-vue/backer/6/avatar.svg"></a> <a href="https://opencollective.com/ant-design-vue/backer/7/website" target="_blank"><img src="https://opencollective.com/ant-design-vue/backer/7/avatar.svg"></a> <a href="https://opencollective.com/ant-design-vue/backer/8/website" target="_blank"><img src="https://opencollective.com/ant-design-vue/backer/8/avatar.svg"></a> <a href="https://opencollective.com/ant-design-vue/backer/9/website" target="_blank"><img src="https://opencollective.com/ant-design-vue/backer/9/avatar.svg"></a> <a href="https://opencollective.com/ant-design-vue/backer/10/website" target="_blank"><img src="https://opencollective.com/ant-design-vue/backer/10/avatar.svg"></a>
104104

105105
## Patreon
106106

107-
Support us with a monthly donation and help us continue our activities. [[Become a backer](https://www.patreon.com/tangjinzhou)]
107+
每月捐款支持我们,帮助我们继续我们的活动。 [[成为支持者](https://www.patreon.com/tangjinzhou)]
108108

109109
<a href="https://www.mokeyjay.com" target="_blank"><img width="64" style="border-radius: 50%;" src="https://www.mokeyjay.com/headimg.png" title="donation by Patreon"></a>
110110

components/_util/BaseInput.tsx

Lines changed: 30 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,9 @@
11
import type { PropType } from 'vue';
2-
import { defineComponent, shallowRef, ref, watch } from 'vue';
2+
import { computed, defineComponent, shallowRef, ref, watch } from 'vue';
33
import PropTypes from './vue-types';
4+
import type { BaseInputInnerExpose } from './BaseInputInner';
5+
import BaseInputInner from './BaseInputInner';
6+
import { styleObjectToString } from '../vc-util/Dom/css';
47

58
export interface BaseInputExpose {
69
focus: () => void;
@@ -30,6 +33,8 @@ const BaseInput = defineComponent({
3033
default: 'input',
3134
},
3235
size: PropTypes.string,
36+
style: PropTypes.oneOfType([String, Object]),
37+
class: PropTypes.string,
3338
},
3439
emits: [
3540
'change',
@@ -40,9 +45,11 @@ const BaseInput = defineComponent({
4045
'compositionstart',
4146
'compositionend',
4247
'keyup',
48+
'paste',
49+
'mousedown',
4350
],
4451
setup(props, { emit, attrs, expose }) {
45-
const inputRef = shallowRef(null);
52+
const inputRef = shallowRef<BaseInputInnerExpose>(null);
4653
const renderValue = ref();
4754
const isComposing = ref(false);
4855
watch(
@@ -68,6 +75,7 @@ const BaseInput = defineComponent({
6875
const event = document.createEvent('HTMLEvents');
6976
event.initEvent('input', true, true);
7077
e.target.dispatchEvent(event);
78+
handleChange(e);
7179
};
7280
const handleInput = (e: Event) => {
7381
if (isComposing.value && props.lazy) {
@@ -114,19 +122,31 @@ const BaseInput = defineComponent({
114122
expose({
115123
focus,
116124
blur,
117-
input: inputRef,
125+
input: computed(() => inputRef.value?.input),
118126
setSelectionRange,
119127
select,
120-
getSelectionStart: () => inputRef.value?.selectionStart,
121-
getSelectionEnd: () => inputRef.value?.selectionEnd,
122-
getScrollTop: () => inputRef.value?.scrollTop,
128+
getSelectionStart: () => inputRef.value?.getSelectionStart(),
129+
getSelectionEnd: () => inputRef.value?.getSelectionEnd(),
130+
getScrollTop: () => inputRef.value?.getScrollTop(),
131+
});
132+
const handleMousedown = (e: MouseEvent) => {
133+
emit('mousedown', e);
134+
};
135+
const handlePaste = (e: ClipboardEvent) => {
136+
emit('paste', e);
137+
};
138+
const styleString = computed(() => {
139+
return props.style && typeof props.style !== 'string'
140+
? styleObjectToString(props.style)
141+
: props.style;
123142
});
124143
return () => {
125-
const { tag: Tag, ...restProps } = props;
144+
const { style, lazy, ...restProps } = props;
126145
return (
127-
<Tag
146+
<BaseInputInner
128147
{...restProps}
129148
{...attrs}
149+
style={styleString.value}
130150
onInput={handleInput}
131151
onChange={handleChange}
132152
onBlur={handleBlur}
@@ -137,6 +157,8 @@ const BaseInput = defineComponent({
137157
onCompositionend={onCompositionend}
138158
onKeyup={handleKeyUp}
139159
onKeydown={handleKeyDown}
160+
onPaste={handlePaste}
161+
onMousedown={handleMousedown}
140162
/>
141163
);
142164
};

components/_util/BaseInputInner.tsx

Lines changed: 96 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,96 @@
1+
import type { PropType } from 'vue';
2+
import { defineComponent, shallowRef } from 'vue';
3+
import PropTypes from './vue-types';
4+
5+
export interface BaseInputInnerExpose {
6+
focus: () => void;
7+
blur: () => void;
8+
input: HTMLInputElement | HTMLTextAreaElement | null;
9+
setSelectionRange: (
10+
start: number,
11+
end: number,
12+
direction?: 'forward' | 'backward' | 'none',
13+
) => void;
14+
select: () => void;
15+
getSelectionStart: () => number | null;
16+
getSelectionEnd: () => number | null;
17+
getScrollTop: () => number | null;
18+
setScrollTop: (scrollTop: number) => void;
19+
}
20+
const BaseInputInner = defineComponent({
21+
compatConfig: { MODE: 3 },
22+
// inheritAttrs: false,
23+
props: {
24+
disabled: PropTypes.looseBool,
25+
type: PropTypes.string,
26+
value: PropTypes.any,
27+
tag: {
28+
type: String as PropType<'input' | 'textarea'>,
29+
default: 'input',
30+
},
31+
size: PropTypes.string,
32+
onChange: Function as PropType<(e: Event) => void>,
33+
onInput: Function as PropType<(e: Event) => void>,
34+
onBlur: Function as PropType<(e: Event) => void>,
35+
onFocus: Function as PropType<(e: Event) => void>,
36+
onKeydown: Function as PropType<(e: Event) => void>,
37+
onCompositionstart: Function as PropType<(e: Event) => void>,
38+
onCompositionend: Function as PropType<(e: Event) => void>,
39+
onKeyup: Function as PropType<(e: Event) => void>,
40+
onPaste: Function as PropType<(e: Event) => void>,
41+
onMousedown: Function as PropType<(e: Event) => void>,
42+
},
43+
emits: [
44+
'change',
45+
'input',
46+
'blur',
47+
'keydown',
48+
'focus',
49+
'compositionstart',
50+
'compositionend',
51+
'keyup',
52+
'paste',
53+
'mousedown',
54+
],
55+
setup(props, { expose }) {
56+
const inputRef = shallowRef(null);
57+
58+
const focus = () => {
59+
if (inputRef.value) {
60+
inputRef.value.focus();
61+
}
62+
};
63+
const blur = () => {
64+
if (inputRef.value) {
65+
inputRef.value.blur();
66+
}
67+
};
68+
const setSelectionRange = (
69+
start: number,
70+
end: number,
71+
direction?: 'forward' | 'backward' | 'none',
72+
) => {
73+
inputRef.value?.setSelectionRange(start, end, direction);
74+
};
75+
76+
const select = () => {
77+
inputRef.value?.select();
78+
};
79+
expose({
80+
focus,
81+
blur,
82+
input: inputRef,
83+
setSelectionRange,
84+
select,
85+
getSelectionStart: () => inputRef.value?.selectionStart,
86+
getSelectionEnd: () => inputRef.value?.selectionEnd,
87+
getScrollTop: () => inputRef.value?.scrollTop,
88+
});
89+
return () => {
90+
const { tag: Tag, value, ...restProps } = props;
91+
return <Tag {...restProps} ref={inputRef} value={value} />;
92+
};
93+
},
94+
});
95+
96+
export default BaseInputInner;

0 commit comments

Comments
 (0)