Skip to content

Commit 9e0df41

Browse files
tangjinzhouJohn60676sendyazkwolf
authored
refactor: Anchor、Alert、Avatar、Badge、BackTop、Col、Form、Layout、Menu、Space、Spin、Switch、Row、Result、Rate (#4171)
* chore: remove resize-observer-polyfill * refactor: align * refactor(v3/avatar): refactor using composition api (#4052) * refactor(avatar): refactor using composition api * refactor: update props define * fix: avatar src scale not update * refactor: resizeObserver * refactor: divider * refactor: localeProvider * refactor(v3/back-top): use composition api (#4060) * refactor: backtop * refactor: empty * refactor: transButton * feat(v3/avatar): add avatar group (#4062) * feat(avatar): add avatar group * refactor: update * refactor: update Co-authored-by: tangjinzhou <[email protected]> * refactor: avatar * refactor: avatar * style: rename useProvide * refactor: menu (#4110) * fix: menu * refactor: menu * refactor: remove rc-menu * fix: menu rtl error * style: lint * refactor(Anchor): use composition api (#4054) * refactor: anchor * refactor: anchor * refactor: anchor * feat: update * fix: icon class lose * refactor(v3/badge): use composition api (#4076) * refactor: badge * fix: badge inheritAttrs * refactor: grid * refactor: layout * fix: menu not close * refactor: space * refactor: result * refactor: affix * refactor: comment * refactor: form * feat: spin add rtl * feat: export spin type * refactor: pageHeader * refactor: page-header * refactor: skeleton * refactor: typography * refactor(v3/rate): use composition api * fix: add useRef hook * refactor: form * fix: menu not update * refactor: form * refactor: form * fix: slide animate not work * fix: menu mode error * fix: menu icon * refactor: rate * perf: remove rate * feat: add vc-overflow * refactor: menu * fix: remove flex check (#4165) * fix: dist locale file lose #3684 * release 2.2.0-beta.1 * dcos: update changelog * chore: update type * docs: update changelog Co-authored-by: John <[email protected]> Co-authored-by: 言肆 <[email protected]> Co-authored-by: zkwolf <[email protected]>
1 parent b91659e commit 9e0df41

File tree

211 files changed

+9360
-7482
lines changed

Some content is hidden

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

211 files changed

+9360
-7482
lines changed

CHANGELOG.en-US.md

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

1111
---
1212

13+
## 2.2.0-beta.1
14+
15+
`2021-06-17`
16+
17+
- 🔥🔥🔥 Virtual Table independent library released https://www.npmjs.com/package/@surely-vue/table, this component is an independent library, the document example is not yet complete, it is a completely ts-developed component , There are good type hints, there are API documents on npm, those who are in a hurry can explore and use it, here is an online experience example, https://store.antdv.com/pro/preview/list/big- table-list
18+
- 🔥🔥🔥 Refactored a large number of components, the source code is more readable, the performance is better, and the ts type is more comprehensive -Refactored components in this version Anchor, Alert, Avatar, Badge, BackTop, Col, Form, Layout, Menu, Space, Spin, Switch, Row, Result, Rate
19+
- 🎉 Menu
20+
21+
- Better performance [#3300](https://github.com/vueComponent/ant-design-vue/issues/3300)
22+
- Fix the problem of incorrect highlighting [#4053](https://github.com/vueComponent/ant-design-vue/issues/4053)
23+
- Fix console invalid warning [#4169](https://github.com/vueComponent/ant-design-vue/issues/4169)
24+
- Easier to use, simpler to use single file recursion [#4133](https://github.com/vueComponent/ant-design-vue/issues/4133)
25+
- 💄 icon icon needs to be passed through slot
26+
27+
- Skeleton
28+
29+
- 🌟 Support Skeleton.Avatar placeholder component.
30+
- 🌟 Support Skeleton.Button placeholder component.
31+
- 🌟 Support Skeleton.Input placeholder component.
32+
33+
- 💄 Destructive update
34+
35+
- The `a-menu-item` and `a-sub-menu` icons need to be passed through the slot, and the icon is not automatically obtained through the sub-node
36+
- row gutter supports row-wrap, no need to use multiple rows to divide col
37+
- `Menu` removes `defaultOpenKeys` and `defaultSelectedKeys`; `Switch` removes `defaultChecked`; `Rate` removes `defaultValue`; Please be cautious to use the defaultXxx-named attributes of other unrefactored components, and they will be removed in future versions.
38+
39+
- 🌟 Added Avatar.Group component
40+
- 🐞 Fix AutoComplete filterOptions not taking effect [#4170](https://github.com/vueComponent/ant-design-vue/issues/4170)
41+
- 🐞 Fix Select automatic width invalidation problem [#4118](https://github.com/vueComponent/ant-design-vue/issues/4118)
42+
- 🐞 Fix the lack of internationalized files in dist [#3684](https://github.com/vueComponent/ant-design-vue/issues/3684)
43+
1344
## 2.1.6
1445

1546
`2021-05-13`

CHANGELOG.zh-CN.md

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

1111
---
1212

13+
## 2.2.0-beta.1
14+
15+
`2021-06-17`
16+
17+
- 🔥🔥🔥 虚拟 Table 独立库发布 https://www.npmjs.com/package/@surely-vue/table , 该组件是一个独立的库,目前文档示例尚未完善,他是一个完全 ts 开发的组件,有较好的类型提示,npm 上已有 API 文档,着急使用的的可以摸索着用起来了,这里有个在线体验示例,https://store.antdv.com/pro/preview/list/big-table-list
18+
- 🔥🔥🔥 重构大量组件,源码更加易读,性能更优,ts 类型更加全面
19+
- 本版本重构组件 Anchor、Alert、Avatar、Badge、BackTop、Col、Form、Layout、Menu、Space、Spin、Switch、Row、Result、Rate
20+
- 🎉 Menu
21+
22+
- 性能更优 [#3300](https://github.com/vueComponent/ant-design-vue/issues/3300)
23+
- 修复高亮不正确问题 [#4053](https://github.com/vueComponent/ant-design-vue/issues/4053)
24+
- 修复控制台无效 warning [#4169](https://github.com/vueComponent/ant-design-vue/issues/4169)
25+
- 更加易用,更加简单的使用单文件递归 [#4133](https://github.com/vueComponent/ant-design-vue/issues/4133)
26+
- 💄 图标 icon 需要通过 slot 传递
27+
28+
- Skeleton
29+
30+
- 🌟 支持 Skeleton.Avatar 占位组件。
31+
- 🌟 支持 Skeleton.Button 占位组件。
32+
- 🌟 支持 Skeleton.Input 占位组件。
33+
34+
- 💄 破坏性更新
35+
36+
- `a-menu-item``a-sub-menu` 图标需要通过 slot 传递,不在通过子节点自动获取图标
37+
- row gutter 支持 row-wrap, 无需使用多个 row 划分 col
38+
- Menu 移除 defaultOpenKeys、defaultSelectedKeys; Switch 移除 defaultChecked; Rate 移除 defaultValue; 其它未重构组件的 defaultXxx 命名的属性请谨慎使用,在未来的版本中也会被移除。
39+
40+
- 🌟 新增 Avatar.Group 组件
41+
- 🐞 修复 AutoComplete filterOptions 不生效问题 [#4170](https://github.com/vueComponent/ant-design-vue/issues/4170)
42+
- 🐞 修复 Select 自动宽度失效问题 [#4118](https://github.com/vueComponent/ant-design-vue/issues/4118)
43+
- 🐞 修复 dist 缺少国际化文件问题 [#3684](https://github.com/vueComponent/ant-design-vue/issues/3684)
44+
1345
## 2.1.6
1446

1547
`2021-05-13`

antd-tools/gulpfile.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -294,7 +294,7 @@ gulp.task(
294294

295295
function publish(tagString, done) {
296296
let args = ['publish', '--with-antd-tools'];
297-
args = args.concat(['--tag', 'next']);
297+
// args = args.concat(['--tag', 'next']);
298298
if (tagString) {
299299
args = args.concat(['--tag', tagString]);
300300
}

components/_util/canUseDom.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
function canUseDom() {
2+
return !!(typeof window !== 'undefined' && window.document && window.document.createElement);
3+
}
4+
5+
export default canUseDom;

components/_util/getScroll.js

Lines changed: 0 additions & 17 deletions
This file was deleted.

components/_util/getScroll.ts

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
export function isWindow(obj: any) {
2+
return obj !== null && obj !== undefined && obj === obj.window;
3+
}
4+
5+
export default function getScroll(
6+
target: HTMLElement | Window | Document | null,
7+
top: boolean,
8+
): number {
9+
if (typeof window === 'undefined') {
10+
return 0;
11+
}
12+
const method = top ? 'scrollTop' : 'scrollLeft';
13+
let result = 0;
14+
if (isWindow(target)) {
15+
result = (target as Window)[top ? 'pageYOffset' : 'pageXOffset'];
16+
} else if (target instanceof Document) {
17+
result = target.documentElement[method];
18+
} else if (target) {
19+
result = (target as HTMLElement)[method];
20+
}
21+
if (target && !isWindow(target) && typeof result !== 'number') {
22+
result = ((target as HTMLElement).ownerDocument || (target as Document)).documentElement?.[
23+
method
24+
];
25+
}
26+
return result;
27+
}
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
import { onMounted, onUnmounted, Ref, ref } from 'vue';
2+
import ResponsiveObserve, { ScreenMap } from '../../_util/responsiveObserve';
3+
4+
function useBreakpoint(): Ref<ScreenMap> {
5+
const screens = ref<ScreenMap>({});
6+
let token = null;
7+
8+
onMounted(() => {
9+
token = ResponsiveObserve.subscribe(supportScreens => {
10+
screens.value = supportScreens;
11+
});
12+
});
13+
14+
onUnmounted(() => {
15+
ResponsiveObserve.unsubscribe(token);
16+
});
17+
18+
return screens;
19+
}
20+
21+
export default useBreakpoint;
Lines changed: 43 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,46 @@
1-
import { computed, inject } from 'vue';
2-
import { defaultConfigProvider } from '../../config-provider';
1+
import { RequiredMark } from '../../form/Form';
2+
import { computed, ComputedRef, inject, UnwrapRef } from 'vue';
3+
import {
4+
ConfigProviderProps,
5+
defaultConfigProvider,
6+
Direction,
7+
SizeType,
8+
} from '../../config-provider';
39

4-
export default (name: string, props: Record<any, any>) => {
5-
const configProvider = inject('configProvider', defaultConfigProvider);
10+
export default (
11+
name: string,
12+
props: Record<any, any>,
13+
): {
14+
configProvider: UnwrapRef<ConfigProviderProps>;
15+
prefixCls: ComputedRef<string>;
16+
direction: ComputedRef<Direction>;
17+
size: ComputedRef<SizeType>;
18+
getTargetContainer: ComputedRef<() => HTMLElement>;
19+
space: ComputedRef<{ size: SizeType | number }>;
20+
pageHeader: ComputedRef<{ ghost: boolean }>;
21+
form?: ComputedRef<{
22+
requiredMark?: RequiredMark;
23+
}>;
24+
} => {
25+
const configProvider = inject<UnwrapRef<ConfigProviderProps>>(
26+
'configProvider',
27+
defaultConfigProvider,
28+
);
629
const prefixCls = computed(() => configProvider.getPrefixCls(name, props.prefixCls));
7-
return { configProvider, prefixCls };
30+
const direction = computed(() => configProvider.direction);
31+
const space = computed(() => configProvider.space);
32+
const pageHeader = computed(() => configProvider.pageHeader);
33+
const form = computed(() => configProvider.form);
34+
const size = computed(() => props.size || configProvider.componentSize);
35+
const getTargetContainer = computed(() => props.getTargetContainer);
36+
return {
37+
configProvider,
38+
prefixCls,
39+
direction,
40+
size,
41+
getTargetContainer,
42+
space,
43+
pageHeader,
44+
form,
45+
};
846
};
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
import { onMounted, ref } from 'vue';
2+
import { detectFlexGapSupported } from '../styleChecker';
3+
4+
export default () => {
5+
const flexible = ref(false);
6+
onMounted(() => {
7+
flexible.value = detectFlexGapSupported();
8+
});
9+
10+
return flexible;
11+
};
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
import { computed, ComputedRef, inject } from 'vue';
2+
import { defaultConfigProvider } from '../../config-provider';
3+
4+
export default (name: string, props: Record<any, any>): ComputedRef<string> => {
5+
const configProvider = inject('configProvider', defaultConfigProvider);
6+
const prefixCls = computed(() => configProvider.getPrefixCls(name, props.prefixCls));
7+
return prefixCls;
8+
};

0 commit comments

Comments
 (0)