Merge remote-tracking branch 'origin/main' into feat-v4

pull/6518/head
tangjinzhou 2023-04-28 15:51:46 +08:00
commit 98be7071e5
8 changed files with 128 additions and 59 deletions

View File

@ -57,6 +57,31 @@
- ๐Ÿ’„ ไผ˜ๅŒ– Upload ๆ“ไฝœๆŒ‰้’ฎ็š„ๆ ทๅผ็ป†่Š‚ใ€‚ - ๐Ÿ’„ ไผ˜ๅŒ– Upload ๆ“ไฝœๆŒ‰้’ฎ็š„ๆ ทๅผ็ป†่Š‚ใ€‚
- ๐Ÿž ไฟฎๅค Switch ๅœจๆš—้ป‘ไธป้ข˜ไธ‹ๅ…ณ้—ญๆ—ถ็š„้ขœ่‰ฒ้—ฎ้ข˜ใ€‚ - ๐Ÿž ไฟฎๅค Switch ๅœจๆš—้ป‘ไธป้ข˜ไธ‹ๅ…ณ้—ญๆ—ถ็š„้ขœ่‰ฒ้—ฎ้ข˜ใ€‚
## 3.2.20
`2023-04-27`
- ๐ŸŒŸ Optimize the repeated instantiation of Space subcomponents [#6500](https://github.com/vueComponent/ant-design-vue/issues/6500)
- ๐Ÿž Fix RangePicker does not support null value problem [#6510](https://github.com/vueComponent/ant-design-vue/issues/6510)
## 3.2.19
`2023-04-23`
- ๐Ÿž Fix antd.min.js file error
## 3.2.18
`2023-04-23`
- ๐Ÿž Fix the style of input addonAfter when Form disabled [#6403](https://github.com/vueComponent/ant-design-vue/issues/6403)
- ๐Ÿž Fix Upload class name error [#6413](https://github.com/vueComponent/ant-design-vue/issues/6413)
- ๐Ÿž Fix date component's week, quarter does not support format problem [#6385](https://github.com/vueComponent/ant-design-vue/issues/6385)
- ๐Ÿž Fix the problem that Select scrolls under Firefox [#6470](https://github.com/vueComponent/ant-design-vue/issues/6470)
- ๐ŸŒŸ Button added focus and blur methods [#6483](https://github.com/vueComponent/ant-design-vue/issues/6483)
- ๐Ÿž Fix the problem that the container height changes after Select is selected [#6467](https://github.com/vueComponent/ant-design-vue/issues/6467)
- ๐Ÿž Fix Form name not taking effect [#6460](https://github.com/vueComponent/ant-design-vue/issues/6460)
## 3.2.17 ## 3.2.17
`2023-04-04` `2023-04-04`

View File

@ -57,6 +57,31 @@
- ๐Ÿ’„ ไผ˜ๅŒ– Upload ๆ“ไฝœๆŒ‰้’ฎ็š„ๆ ทๅผ็ป†่Š‚ใ€‚ - ๐Ÿ’„ ไผ˜ๅŒ– Upload ๆ“ไฝœๆŒ‰้’ฎ็š„ๆ ทๅผ็ป†่Š‚ใ€‚
- ๐Ÿž ไฟฎๅค Switch ๅœจๆš—้ป‘ไธป้ข˜ไธ‹ๅ…ณ้—ญๆ—ถ็š„้ขœ่‰ฒ้—ฎ้ข˜ใ€‚ - ๐Ÿž ไฟฎๅค Switch ๅœจๆš—้ป‘ไธป้ข˜ไธ‹ๅ…ณ้—ญๆ—ถ็š„้ขœ่‰ฒ้—ฎ้ข˜ใ€‚
## 3.2.20
`2023-04-27`
- ๐ŸŒŸ ไผ˜ๅŒ– Space ๅญ็ป„ไปถ้‡ๅคๅฎžไพ‹ๅŒ–้—ฎ้ข˜ [#6500](https://github.com/vueComponent/ant-design-vue/issues/6500)
- ๐Ÿž ไฟฎๅค RangePicker ไธๆ”ฏๆŒ็ฉบๅ€ผ้—ฎ้ข˜ [#6510](https://github.com/vueComponent/ant-design-vue/issues/6510)
## 3.2.19
`2023-04-23`
- ๐Ÿž ไฟฎๅค antd.min.js ๆ–‡ไปถ้”™่ฏฏ
## 3.2.18
`2023-04-23`
- ๐Ÿž ไฟฎๅค input addonAfter ๅœจ Form diabled ๆ—ถ็š„ๆ ทๅผ [#6403](https://github.com/vueComponent/ant-design-vue/issues/6403)
- ๐Ÿž ไฟฎๅค Upload ็ฑปๅ้”™่ฏฏ [#6413](https://github.com/vueComponent/ant-design-vue/issues/6413)
- ๐Ÿž ไฟฎๅคๆ—ฅๆœŸ็ป„ไปถ็š„ ๅ‘จใ€ๅญฃๅบฆ ไธๆ”ฏๆŒ format ้—ฎ้ข˜ [#6385](https://github.com/vueComponent/ant-design-vue/issues/6385)
- ๐Ÿž ไฟฎๅค Select ๅœจ Firefox ไธ‹ๆปšๅŠจๆ˜พ็คบๅผ‚ๅธธ้—ฎ้ข˜ [#6470](https://github.com/vueComponent/ant-design-vue/issues/6470)
- ๐ŸŒŸ Button ๆ–ฐๅขž focusใ€blur ๆ–นๆณ• [#6483](https://github.com/vueComponent/ant-design-vue/issues/6483)
- ๐Ÿž ไฟฎๅค Select ้€‰ไธญๅŽๅฏผ่‡ดๅฎนๅ™จ้ซ˜ๅบฆๅ˜ๅŒ–้—ฎ้ข˜ [#6467](https://github.com/vueComponent/ant-design-vue/issues/6467)
- ๐Ÿž ไฟฎๅค Form name ๆœช็”Ÿๆ•ˆ้—ฎ้ข˜ [#6460](https://github.com/vueComponent/ant-design-vue/issues/6460)
## 3.2.17 ## 3.2.17
`2023-04-04` `2023-04-04`

View File

@ -110,8 +110,18 @@ const Affix = defineComponent({
const newState = { const newState = {
status: AffixStatus.None, status: AffixStatus.None,
} as AffixState; } as AffixState;
const targetRect = getTargetRect(targetNode);
const placeholderRect = getTargetRect(placeholderNode.value as HTMLElement); const placeholderRect = getTargetRect(placeholderNode.value as HTMLElement);
if (
placeholderRect.top === 0 &&
placeholderRect.left === 0 &&
placeholderRect.width === 0 &&
placeholderRect.height === 0
) {
return;
}
const targetRect = getTargetRect(targetNode);
const fixedTop = getFixedTop(placeholderRect, targetRect, offsetTop.value); const fixedTop = getFixedTop(placeholderRect, targetRect, offsetTop.value);
const fixedBottom = getFixedBottom(placeholderRect, targetRect, offsetBottom.value); const fixedBottom = getFixedBottom(placeholderRect, targetRect, offsetBottom.value);
if ( if (
@ -122,27 +132,34 @@ const Affix = defineComponent({
) { ) {
return; return;
} }
if (fixedTop !== undefined) { if (fixedTop !== undefined) {
const width = `${placeholderRect.width}px`;
const height = `${placeholderRect.height}px`;
newState.affixStyle = { newState.affixStyle = {
position: 'fixed', position: 'fixed',
top: fixedTop, top: fixedTop,
width: placeholderRect.width + 'px', width,
height: placeholderRect.height + 'px', height,
}; };
newState.placeholderStyle = { newState.placeholderStyle = {
width: placeholderRect.width + 'px', width,
height: placeholderRect.height + 'px', height,
}; };
} else if (fixedBottom !== undefined) { } else if (fixedBottom !== undefined) {
const width = `${placeholderRect.width}px`;
const height = `${placeholderRect.height}px`;
newState.affixStyle = { newState.affixStyle = {
position: 'fixed', position: 'fixed',
bottom: fixedBottom, bottom: fixedBottom,
width: placeholderRect.width + 'px', width,
height: placeholderRect.height + 'px', height,
}; };
newState.placeholderStyle = { newState.placeholderStyle = {
width: placeholderRect.width + 'px', width,
height: placeholderRect.height + 'px', height,
}; };
} }

View File

@ -101,27 +101,27 @@ describe('Menu', () => {
}); });
}); });
it('should accept openKeys in mode vertical', async () => { // it('should accept openKeys in mode vertical', async () => {
mount( // mount(
{ // {
render() { // render() {
return ( // return (
<Menu openKeys={['1']} mode="vertical"> // <Menu openKeys={['1']} mode="vertical">
<SubMenu key="1" title="submenu1"> // <SubMenu key="1" title="submenu1">
<Menu.Item key="submenu1">Option 1</Menu.Item> // <Menu.Item key="submenu1">Option 1</Menu.Item>
<Menu.Item key="submenu2">Option 2</Menu.Item> // <Menu.Item key="submenu2">Option 2</Menu.Item>
</SubMenu> // </SubMenu>
<Menu.Item key="2">menu2</Menu.Item> // <Menu.Item key="2">menu2</Menu.Item>
</Menu> // </Menu>
); // );
}, // },
}, // },
{ attachTo: 'body', sync: false }, // { attachTo: 'body', sync: false },
); // );
await asyncExpect(() => { // await asyncExpect(() => {
expect($$('.ant-menu-submenu-popup')[0].style.display).not.toBe('none'); // expect($$('.ant-menu-submenu-popup')[0].style.display).not.toBe('none');
}, 100); // }, 100);
}); // });
it('horizontal', async () => { it('horizontal', async () => {
mount( mount(

View File

@ -1,5 +1,5 @@
import type { PropType, ExtractPropTypes, CSSProperties, Plugin, App } from 'vue'; import type { PropType, ExtractPropTypes, CSSProperties, Plugin, App } from 'vue';
import { defineComponent, computed, ref, watch } from 'vue'; import { defineComponent, computed, ref, watch, Fragment } from 'vue';
import PropTypes from '../_util/vue-types'; import PropTypes from '../_util/vue-types';
import { filterEmpty } from '../_util/props-util'; import { filterEmpty } from '../_util/props-util';
import type { SizeType } from '../config-provider'; import type { SizeType } from '../config-provider';
@ -85,8 +85,8 @@ const Space = defineComponent({
}); });
return () => { return () => {
const { wrap, direction = 'horizontal' } = props; const { wrap, direction = 'horizontal' } = props;
const children = slots.default?.();
const items = filterEmpty(slots.default?.()); const items = filterEmpty(children);
const len = items.length; const len = items.length;
if (len === 0) { if (len === 0) {
@ -99,6 +99,7 @@ const Space = defineComponent({
return ( return (
<div {...attrs} class={cn.value} style={[style.value, attrs.style as any]}> <div {...attrs} class={cn.value} style={[style.value, attrs.style as any]}>
{items.map((child, index) => { {items.map((child, index) => {
const originIndex = children.indexOf(child);
let itemStyle: CSSProperties = {}; let itemStyle: CSSProperties = {};
if (!supportFlexGap.value) { if (!supportFlexGap.value) {
if (direction === 'vertical') { if (direction === 'vertical') {
@ -116,7 +117,7 @@ const Space = defineComponent({
} }
return wrapSSR( return wrapSSR(
<> <Fragment key={originIndex}>
<div class={itemClassName} style={itemStyle}> <div class={itemClassName} style={itemStyle}>
{child} {child}
</div> </div>
@ -125,7 +126,7 @@ const Space = defineComponent({
{split} {split}
</span> </span>
)} )}
</>, </Fragment>,
); );
})} })}
</div> </div>

View File

@ -67,32 +67,32 @@ describe('Typography', () => {
const fullStr = const fullStr =
'Bamboo is Little Light Bamboo is Little Light Bamboo is Little Light Bamboo is Little Light Bamboo is Little Light'; 'Bamboo is Little Light Bamboo is Little Light Bamboo is Little Light Bamboo is Little Light Bamboo is Little Light';
it('should trigger update', async () => { // xit('should trigger update', async () => {
const onEllipsis = jest.fn(); // const onEllipsis = jest.fn();
const wrapper = mount(Base, { // const wrapper = mount(Base, {
props: { // props: {
ellipsis: { onEllipsis }, // ellipsis: { onEllipsis },
component: 'p', // component: 'p',
editable: true, // editable: true,
content: fullStr, // content: fullStr,
}, // },
}); // });
await sleep(20); // await sleep(20);
expect(wrapper.text()).toEqual('Bamboo is Little ...'); // expect(wrapper.text()).toEqual('Bamboo is Little ...');
expect(onEllipsis).toHaveBeenCalledWith(true); // expect(onEllipsis).toHaveBeenCalledWith(true);
onEllipsis.mockReset(); // onEllipsis.mockReset();
wrapper.setProps({ ellipsis: { rows: 2, onEllipsis } }); // wrapper.setProps({ ellipsis: { rows: 2, onEllipsis } });
await sleep(300); // await sleep(300);
expect(wrapper.text()).toEqual('Bamboo is Little Light Bamboo is Litt...'); // expect(wrapper.text()).toEqual('Bamboo is Little Light Bamboo is Litt...');
expect(onEllipsis).not.toHaveBeenCalled(); // expect(onEllipsis).not.toHaveBeenCalled();
wrapper.setProps({ ellipsis: { rows: 99, onEllipsis } }); // wrapper.setProps({ ellipsis: { rows: 99, onEllipsis } });
await sleep(20); // await sleep(20);
expect(wrapper.find('p').text()).toEqual(fullStr); // expect(wrapper.find('p').text()).toEqual(fullStr);
expect(onEllipsis).toHaveBeenCalledWith(false); // expect(onEllipsis).toHaveBeenCalledWith(false);
}); // });
it('should middle ellipsis', async () => { it('should middle ellipsis', async () => {
const suffix = '--suffix'; const suffix = '--suffix';

View File

@ -123,6 +123,7 @@ function findTargetStr(val: string, index: number, segmentation: string) {
} }
const toDateWithValueFormat = (val: string | Dayjs, valueFormat: string) => { const toDateWithValueFormat = (val: string | Dayjs, valueFormat: string) => {
if (!val) return null;
if (dayjs.isDayjs(val)) { if (dayjs.isDayjs(val)) {
return val; return val;
} }

View File

@ -1,4 +1,4 @@
// base rc-virtual-list 3.4.2 // base rc-virtual-list 3.4.13
import List from './List'; import List from './List';
export default List; export default List;