diff --git a/CHANGELOG.en-US.md b/CHANGELOG.en-US.md index a7d9dc626..df7b8b026 100644 --- a/CHANGELOG.en-US.md +++ b/CHANGELOG.en-US.md @@ -10,6 +10,39 @@ --- +## 2.1.4 + +`2021-05-09` + +- 🐞 Fix `Table` scrolling misalignment issue [#4045](https://github.com/vueComponent/ant-design-vue/issues/4045) +- 🐞 Fix `Typography` editable mode triggering link jump issue [#4105](https://github.com/vueComponent/ant-design-vue/issues/4105) +- 🐞 Fix the issue that `Carousel` variableWidth does not take effect [#3977](https://github.com/vueComponent/ant-design-vue/issues/3977) +- 🐞 Fix the problem that `TreeSelect` cannot delete parent and child nodes at the same time through the keyboard [#3508](https://github.com/vueComponent/ant-design-vue/issues/3508) +- 🐞 Fix some types of errors + +## 2.1.3 + +`2021-04-25` + +- 🎉🎉🎉 remove ads during npm installation +- 🐞 `Select` + - Fix the first issue of default activation [#3842](https://github.com/vueComponent/ant-design-vue/issues/3842) + - Fix group display abnormal problem [#3841](https://github.com/vueComponent/ant-design-vue/issues/3841) + - Fix scrolling abnormal issue after dynamically updating selections [#3972](https://github.com/vueComponent/ant-design-vue/issues/3972) +- 🐞 Fix the issue that `Checkbox` triggers twice `update:checked` [#3838](https://github.com/vueComponent/ant-design-vue/issues/3838) +- 🌟 `Table` column group supports fixed [#3882](https://github.com/vueComponent/ant-design-vue/issues/3882) +- 🌟 `Table` column supports v-for [#3934](https://github.com/vueComponent/ant-design-vue/issues/3934) +- 🐞 Fix the problem that `Table` displays horizontal scroll bar on windows [6d33d6](https://github.com/vueComponent/ant-design-vue/commit/6d33d60d2bca98825f274e48bcc3badd1857f742) +- 🌟 `Form` scrollToFirstError supports option parameter passing [#3918](https://github.com/vueComponent/ant-design-vue/issues/3918) +- 🐞 Fix the issue of `Calendar` month selector displaying wrong characters [#3915](https://github.com/vueComponent/ant-design-vue/issues/3915) +- 🌟 Refactor the `Switch` component and remove the defaultChecked attribute [#3885](https://github.com/vueComponent/ant-design-vue/issues/3885) +- 🐞 Fix the process exception when using Vite [#3930](https://github.com/vueComponent/ant-design-vue/issues/3930) +- 🐞 Fix `Radio` shadow occlusion problem [#3955](https://github.com/vueComponent/ant-design-vue/issues/3955) +- 🐞 Fix the issue that span does not take effect in `Form` inline mode [#3862](https://github.com/vueComponent/ant-design-vue/issues/3862) +- 🐞 Fix the issue that `Cascader` keydown selection does not take effect [#958](https://github.com/vueComponent/ant-design-vue/issues/958) +- 🐞 Fix `Image` preview function failure problem [#3701](https://github.com/vueComponent/ant-design-vue/issues/3701) +- 🐞 Fix some TS type issues + ## 2.1.2 `2021-03-28` diff --git a/CHANGELOG.zh-CN.md b/CHANGELOG.zh-CN.md index b6c1849b0..c3ddae7bf 100644 --- a/CHANGELOG.zh-CN.md +++ b/CHANGELOG.zh-CN.md @@ -10,6 +10,39 @@ --- +## 2.1.4 + +`2021-05-09` + +- 🐞 修复 `Table` 滚动错位问题 [#4045](https://github.com/vueComponent/ant-design-vue/issues/4045) +- 🐞 修复 `Typography` editable 模式触发链接跳转问题 [#4105](https://github.com/vueComponent/ant-design-vue/issues/4105) +- 🐞 修复 `Carousel` variableWidth 不生效问题 [#3977](https://github.com/vueComponent/ant-design-vue/issues/3977) +- 🐞 修复 `TreeSelect` 无法通过键盘同时删除父子节点问题 [#3508](https://github.com/vueComponent/ant-design-vue/issues/3508) +- 🐞 修复若干类型错误问题 + +## 2.1.3 + +`2021-04-25` + +- 🎉🎉🎉 移除 npm 安装时的广告 +- 🐞 `Select` + - 修复默认激活第一项问题 [#3842](https://github.com/vueComponent/ant-design-vue/issues/3842) + - 修复分组显示异常问题 [#3841](https://github.com/vueComponent/ant-design-vue/issues/3841) + - 修复动态更新选择项后滚动异常问题 [#3972](https://github.com/vueComponent/ant-design-vue/issues/3972) +- 🐞 修复 `Checkbox` 触发两次 `update:checked` 问题 [#3838](https://github.com/vueComponent/ant-design-vue/issues/3838) +- 🌟 `Table` column group 支持 fixed [#3882](https://github.com/vueComponent/ant-design-vue/issues/3882) +- 🌟 `Table` column 支持 v-for [#3934](https://github.com/vueComponent/ant-design-vue/issues/3934) +- 🐞 修复 `Table` 在 windows 显示横向滚动条问题 [6d33d6](https://github.com/vueComponent/ant-design-vue/commit/6d33d60d2bca98825f274e48bcc3badd1857f742) +- 🌟 `Form` scrollToFirstError 支持选项参数传递 [#3918](https://github.com/vueComponent/ant-design-vue/issues/3918) +- 🐞 修复 `Calendar` 月份选择器显示错误字符问题 [#3915](https://github.com/vueComponent/ant-design-vue/issues/3915) +- 🌟 重构 `Switch` 组件,移除 defaultChecked 属性 [#3885](https://github.com/vueComponent/ant-design-vue/issues/3885) +- 🐞 修复使用 Vite 时,抛出 process 异常问题 [#3930](https://github.com/vueComponent/ant-design-vue/issues/3930) +- 🐞 修复 `Radio` 阴影遮挡问题 [#3955](https://github.com/vueComponent/ant-design-vue/issues/3955) +- 🐞 修复 `Form` inline 模式下, span 不生效问题 [#3862](https://github.com/vueComponent/ant-design-vue/issues/3862) +- 🐞 修复 `Cascader` keydown 选择不生效问题 [#958](https://github.com/vueComponent/ant-design-vue/issues/958) +- 🐞 修复 `Image` 预览功能失败问题 [#3701](https://github.com/vueComponent/ant-design-vue/issues/3701) +- 🐞 修复一些 TS 类型问题 + ## 2.1.2 `2021-03-28` diff --git a/antd-tools/getBabelCommonConfig.js b/antd-tools/getBabelCommonConfig.js index 1f9a97cca..20f5fa70d 100644 --- a/antd-tools/getBabelCommonConfig.js +++ b/antd-tools/getBabelCommonConfig.js @@ -8,7 +8,7 @@ module.exports = function(modules) { isTSX: true, }, ], - [resolve('@vue/babel-plugin-jsx'), { mergeProps: false }], + [resolve('@vue/babel-plugin-jsx'), { mergeProps: false, enableObjectSlots: false }], resolve('@babel/plugin-proposal-optional-chaining'), resolve('@babel/plugin-transform-object-assign'), resolve('@babel/plugin-proposal-object-rest-spread'), diff --git a/antd-tools/getWebpackConfig.js b/antd-tools/getWebpackConfig.js index c3dee7af9..3ca2b4d8d 100644 --- a/antd-tools/getWebpackConfig.js +++ b/antd-tools/getWebpackConfig.js @@ -4,11 +4,9 @@ const path = require('path'); const webpack = require('webpack'); const WebpackBar = require('webpackbar'); const { merge } = require('webpack-merge'); -const TerserPlugin = require('terser-webpack-plugin'); const MiniCssExtractPlugin = require('mini-css-extract-plugin'); const OptimizeCSSAssetsPlugin = require('optimize-css-assets-webpack-plugin'); const CaseSensitivePathsPlugin = require('case-sensitive-paths-webpack-plugin'); -const postcssConfig = require('./postcssConfig'); const CleanUpStatsPlugin = require('./utils/CleanUpStatsPlugin'); // const BundleAnalyzerPlugin = require('webpack-bundle-analyzer').BundleAnalyzerPlugin; @@ -97,7 +95,10 @@ function getWebpackConfig(modules) { options: { presets: [resolve('@babel/preset-env')], plugins: [ - [resolve('@vue/babel-plugin-jsx'), { mergeProps: false }], + [ + resolve('@vue/babel-plugin-jsx'), + { mergeProps: false, enableObjectSlots: false }, + ], resolve('@babel/plugin-proposal-object-rest-spread'), ], }, @@ -138,7 +139,12 @@ function getWebpackConfig(modules) { }, { loader: 'postcss-loader', - options: Object.assign({}, postcssConfig, { sourceMap: true }), + options: { + postcssOptions: { + plugins: ['autoprefixer'], + }, + sourceMap: true, + }, }, ], }, @@ -154,7 +160,12 @@ function getWebpackConfig(modules) { }, { loader: 'postcss-loader', - options: Object.assign({}, postcssConfig, { sourceMap: true }), + options: { + postcssOptions: { + plugins: ['autoprefixer'], + }, + sourceMap: true, + }, }, { loader: 'less-loader', @@ -212,9 +223,17 @@ All rights reserved. config.output.libraryTarget = 'umd'; config.optimization = { minimizer: [ - new TerserPlugin({ - sourceMap: true, - }), + // eslint-disable-next-line no-unused-vars + compiler => { + return () => { + return { + parallel: true, + terserOptions: { + warnings: false, + }, + }; + }; + }, ], }; diff --git a/antd-tools/gulpfile.js b/antd-tools/gulpfile.js index 63501d449..c87d62fd3 100644 --- a/antd-tools/gulpfile.js +++ b/antd-tools/gulpfile.js @@ -288,6 +288,7 @@ gulp.task( function publish(tagString, done) { let args = ['publish', '--with-antd-tools']; + args = args.concat(['--tag', 'next']); if (tagString) { args = args.concat(['--tag', tagString]); } diff --git a/antd-tools/postcssConfig.js b/antd-tools/postcssConfig.js deleted file mode 100644 index d1aa0db9c..000000000 --- a/antd-tools/postcssConfig.js +++ /dev/null @@ -1,6 +0,0 @@ -const rucksack = require('rucksack-css'); -const autoprefixer = require('autoprefixer'); - -module.exports = { - plugins: [rucksack(), autoprefixer()], -}; diff --git a/antd-tools/transformLess.js b/antd-tools/transformLess.js index be6f1bd81..370ffc17b 100644 --- a/antd-tools/transformLess.js +++ b/antd-tools/transformLess.js @@ -3,7 +3,7 @@ const { readFileSync } = require('fs'); const path = require('path'); const postcss = require('postcss'); const NpmImportPlugin = require('less-plugin-npm-import'); -const postcssConfig = require('./postcssConfig'); +const autoprefixer = require('autoprefixer'); function transformLess(lessFile, config = {}) { const { cwd = process.cwd() } = config; @@ -21,10 +21,7 @@ function transformLess(lessFile, config = {}) { }; return less .render(data, lessOpts) - .then(result => { - const source = result.css; - return postcss(postcssConfig.plugins).process(source, { from: undefined }); - }) + .then(result => postcss([autoprefixer]).process(result.css, { from: undefined })) .then(r => { return r.css; }); diff --git a/babel.config.js b/babel.config.js index 0e9637473..8d79a58ea 100644 --- a/babel.config.js +++ b/babel.config.js @@ -3,7 +3,7 @@ module.exports = { test: { presets: [['@babel/preset-env', { targets: { node: true } }]], plugins: [ - ['@vue/babel-plugin-jsx', { mergeProps: false }], + ['@vue/babel-plugin-jsx', { mergeProps: false, enableObjectSlots: false }], '@babel/plugin-proposal-optional-chaining', '@babel/plugin-transform-object-assign', '@babel/plugin-proposal-object-rest-spread', diff --git a/components/descriptions/index.tsx b/components/descriptions/index.tsx index 4b6d357d8..64fd72765 100644 --- a/components/descriptions/index.tsx +++ b/components/descriptions/index.tsx @@ -42,7 +42,7 @@ export const DescriptionsItem = defineComponent({ }, }); -const DEFAULT_COLUMN_MAP: Record = { +const DEFAULT_COLUMN_MAP: Partial> = { xxl: 3, xl: 3, lg: 3, @@ -126,7 +126,7 @@ const descriptionsProps = { extra: PropTypes.VNodeChild, column: { type: [Number, Object] as PropType>>, - default: () => DEFAULT_COLUMN_MAP, + default: (): number | Partial> => DEFAULT_COLUMN_MAP, }, layout: PropTypes.oneOf(tuple('horizontal', 'vertical')), colon: PropTypes.looseBool, @@ -135,8 +135,9 @@ const descriptionsProps = { export type DescriptionsProps = HTMLAttributes & Partial>; -const Descriptions = defineComponent({ +const Descriptions = defineComponent({ name: 'ADescriptions', + props: descriptionsProps, Item: DescriptionsItem, setup(props, { slots }) { const { getPrefixCls } = inject('configProvider', defaultConfigProvider); @@ -215,8 +216,6 @@ const Descriptions = defineComponent({ }, }); -Descriptions.props = descriptionsProps; - Descriptions.install = function(app: App) { app.component(Descriptions.name, Descriptions); app.component(Descriptions.Item.name, Descriptions.Item); diff --git a/components/modal/Modal.tsx b/components/modal/Modal.tsx index a7f11b87e..6cf4412a2 100644 --- a/components/modal/Modal.tsx +++ b/components/modal/Modal.tsx @@ -79,8 +79,8 @@ const modalProps = { maskClosable: PropTypes.looseBool, /** 强制渲染 Modal*/ forceRender: PropTypes.looseBool, - okButtonProps: PropTypes.shape(buttonTypes), - cancelButtonProps: PropTypes.shape(buttonTypes), + okButtonProps: PropTypes.shape(buttonTypes).loose, + cancelButtonProps: PropTypes.shape(buttonTypes).loose, destroyOnClose: PropTypes.looseBool, wrapClassName: PropTypes.string, maskTransitionName: PropTypes.string, diff --git a/components/skeleton/Paragraph.tsx b/components/skeleton/Paragraph.tsx index c41df854b..a2441ef5d 100644 --- a/components/skeleton/Paragraph.tsx +++ b/components/skeleton/Paragraph.tsx @@ -9,7 +9,7 @@ const skeletonParagraphProps = { rows: PropTypes.number, }; -export const SkeletonParagraphProps = PropTypes.shape(skeletonParagraphProps); +export const SkeletonParagraphProps = PropTypes.shape(skeletonParagraphProps).loose; export type ISkeletonParagraphProps = Partial>; diff --git a/components/skeleton/Title.tsx b/components/skeleton/Title.tsx index b846afc84..16ea7b379 100644 --- a/components/skeleton/Title.tsx +++ b/components/skeleton/Title.tsx @@ -6,7 +6,7 @@ const skeletonTitleProps = { width: PropTypes.oneOfType([PropTypes.number, PropTypes.string]), }; -export const SkeletonTitleProps = PropTypes.shape(skeletonTitleProps); +export const SkeletonTitleProps = PropTypes.shape(skeletonTitleProps).loose; export type ISkeletonTitleProps = Partial>; diff --git a/components/style.ts b/components/style.ts index 12919efc2..88bd444b5 100644 --- a/components/style.ts +++ b/components/style.ts @@ -47,7 +47,6 @@ import './upload/style'; import './layout/style'; import './anchor/style'; import './list/style'; -import './carousel/style'; import './tree-select/style'; import './drawer/style'; import './skeleton/style'; diff --git a/components/switch/__tests__/index.test.js b/components/switch/__tests__/index.test.js index 0742de8e0..73061036f 100644 --- a/components/switch/__tests__/index.test.js +++ b/components/switch/__tests__/index.test.js @@ -3,6 +3,7 @@ import { mount } from '@vue/test-utils'; import focusTest from '../../../tests/shared/focusTest'; import { resetWarned } from '../../_util/warning'; import mountTest from '../../../tests/shared/mountTest'; +import { ref } from 'vue'; describe('Switch', () => { focusTest(Switch); @@ -10,8 +11,16 @@ describe('Switch', () => { it('should has click wave effect', async () => { const wrapper = mount({ - render() { - return ; + setup() { + const checked = ref(false); + return () => { + return ( + (checked.value = !checked.value)} + > + ); + }; }, }); wrapper.find('.ant-switch').trigger('click'); diff --git a/components/switch/index.tsx b/components/switch/index.tsx index 7827a8073..c668a8bd4 100644 --- a/components/switch/index.tsx +++ b/components/switch/index.tsx @@ -31,6 +31,11 @@ const switchProps = { autofocus: PropTypes.looseBool, loading: PropTypes.looseBool, checked: PropTypes.looseBool, + onChange: PropTypes.func, + onClick: PropTypes.func, + onKeydown: PropTypes.func, + onMouseup: PropTypes.func, + 'onUpdate:checked': PropTypes.func }; export type SwitchProps = Partial>; diff --git a/components/table/Table.tsx b/components/table/Table.tsx index 0987e2662..c2e238225 100755 --- a/components/table/Table.tsx +++ b/components/table/Table.tsx @@ -1144,7 +1144,7 @@ export default defineComponent({ getPopupContainer: contextGetPopupContainer, transformCellText, }) { - const { showHeader, locale, getPopupContainer, ...restProps } = { + const { showHeader, locale, getPopupContainer, style, ...restProps } = { ...getOptionProps(this), ...this.$attrs, } as any; diff --git a/components/table/index.tsx b/components/table/index.tsx index db88ac933..21dd7bde3 100644 --- a/components/table/index.tsx +++ b/components/table/index.tsx @@ -2,7 +2,13 @@ import { App, defineComponent, Plugin } from 'vue'; import T, { defaultTableProps } from './Table'; import Column from './Column'; import ColumnGroup from './ColumnGroup'; -import { getOptionProps, getKey, getPropsData, getSlot, flattenChildren } from '../_util/props-util'; +import { + getOptionProps, + getKey, + getPropsData, + getSlot, + flattenChildren, +} from '../_util/props-util'; const Table = defineComponent({ name: 'ATable', @@ -12,7 +18,7 @@ const Table = defineComponent({ props: defaultTableProps, methods: { normalize(elements = []) { - const flattenElements = flattenChildren(elements) + const flattenElements = flattenChildren(elements); const columns = []; flattenElements.forEach(element => { if (!element) { diff --git a/components/typography/Base.tsx b/components/typography/Base.tsx index 8c6c253fa..f29b6cb2a 100644 --- a/components/typography/Base.tsx +++ b/components/typography/Base.tsx @@ -189,7 +189,8 @@ const Base = defineComponent({ onExpand?.(e); } // ================ Edit ================ - function onEditClick() { + function onEditClick(e: MouseEvent) { + e.preventDefault(); state.originContent = props.content; triggerEdit(true); } diff --git a/components/typography/__tests__/index.test.js b/components/typography/__tests__/index.test.js index 61f77f4c2..762fddccf 100644 --- a/components/typography/__tests__/index.test.js +++ b/components/typography/__tests__/index.test.js @@ -253,7 +253,7 @@ describe('Typography', () => { describe('editable', async () => { function testStep(name, submitFunc, expectFunc) { - it(name, async () => { + fit(name, async () => { const onStart = jest.fn(); const onChange = jest.fn(); @@ -286,7 +286,7 @@ describe('Typography', () => { await sleep(20); wrapper.find('textarea').element.value = 'Bamboo'; - wrapper.find('textarea').trigger('change'); + //wrapper.find('textarea').trigger('change'); if (submitFunc) { submitFunc(wrapper); diff --git a/components/vc-image/src/Image.tsx b/components/vc-image/src/Image.tsx index 2885a4fff..8e99b5f31 100644 --- a/components/vc-image/src/Image.tsx +++ b/components/vc-image/src/Image.tsx @@ -50,7 +50,7 @@ export const ImageProps = { visible: PropTypes.bool, onVisibleChange: PropTypes.func, getContainer: PropTypes.oneOf([PropTypes.func, PropTypes.bool]), - }), + }).loose, ]).def(true), }; type ImageStatus = 'normal' | 'error' | 'loading'; diff --git a/components/vc-menu/Menu.jsx b/components/vc-menu/Menu.jsx index 55a47cb37..ae559e937 100644 --- a/components/vc-menu/Menu.jsx +++ b/components/vc-menu/Menu.jsx @@ -34,7 +34,7 @@ const Menu = { watch( () => props.selectedKeys, () => { - selectedKeys.value = props.selectedKeys; + selectedKeys.value = props.selectedKeys || []; }, ); watch( diff --git a/components/vc-resize-observer/index.jsx b/components/vc-resize-observer/index.jsx index 8083e3ef3..7c171f617 100644 --- a/components/vc-resize-observer/index.jsx +++ b/components/vc-resize-observer/index.jsx @@ -57,6 +57,7 @@ const VueResizeObserver = defineComponent({ handleResize(entries) { const { target } = entries[0]; const { width, height } = target.getBoundingClientRect(); + const { offsetWidth, offsetHeight } = target; /** * Resize observer trigger when content size changed. * In most case we just care about element size, @@ -66,7 +67,7 @@ const VueResizeObserver = defineComponent({ const fixedHeight = Math.floor(height); if (this.width !== fixedWidth || this.height !== fixedHeight) { - const size = { width: fixedWidth, height: fixedHeight }; + const size = { width: fixedWidth, height: fixedHeight, offsetWidth, offsetHeight }; this.width = fixedWidth; this.height = fixedHeight; this.__emit('resize', size); diff --git a/components/vc-select/Selector/index.tsx b/components/vc-select/Selector/index.tsx index be7497a8d..e0aaf70b7 100644 --- a/components/vc-select/Selector/index.tsx +++ b/components/vc-select/Selector/index.tsx @@ -17,7 +17,7 @@ import useLock from '../hooks/useLock'; import { defineComponent, VNodeChild } from 'vue'; import createRef, { RefObject } from '../../_util/createRef'; import PropTypes from '../../_util/vue-types'; -import { VueNode } from 'ant-design-vue/es/_util/type'; +import { VueNode } from '../../_util/type'; export interface InnerSelectorProps { prefixCls: string; diff --git a/components/vc-slick/src/inner-slider.js b/components/vc-slick/src/inner-slider.js index 8cb33072a..0eca15ae3 100644 --- a/components/vc-slick/src/inner-slider.js +++ b/components/vc-slick/src/inner-slider.js @@ -115,7 +115,7 @@ export default { slideCount: children.length, }); children.forEach(child => { - const childWidth = child.props.width.split('px')[0]; + const childWidth = child.props.style?.width?.split('px')[0] || 0; childrenWidths.push(childWidth); trackWidth += childWidth; }); diff --git a/components/vc-slick/src/slider.js b/components/vc-slick/src/slider.js index 6029fc9d7..07f77fa2c 100644 --- a/components/vc-slick/src/slider.js +++ b/components/vc-slick/src/slider.js @@ -155,7 +155,7 @@ export default defineComponent({ for (let j = i; j < i + settings.rows * settings.slidesPerRow; j += settings.slidesPerRow) { const row = []; for (let k = j; k < j + settings.slidesPerRow; k += 1) { - if (settings.variableWidth && children[k].props.style) { + if (settings.variableWidth && children[k].props?.style) { currentWidth = children[k].props.style.width; } if (k >= children.length) break; diff --git a/components/vc-table/src/Table.jsx b/components/vc-table/src/Table.jsx index 7318d293a..4ec9076b9 100644 --- a/components/vc-table/src/Table.jsx +++ b/components/vc-table/src/Table.jsx @@ -49,13 +49,13 @@ export default defineComponent({ wrapper: PropTypes.any, row: PropTypes.any, cell: PropTypes.any, - }), + }).loose, body: PropTypes.shape({ wrapper: PropTypes.any, row: PropTypes.any, cell: PropTypes.any, - }), - }), + }).loose, + }).loose, expandIconAsCell: PropTypes.looseBool, expandedRowKeys: PropTypes.array, expandedRowClassName: PropTypes.func, diff --git a/components/vc-tree-select/src/Select.jsx b/components/vc-tree-select/src/Select.jsx index 33edb0edb..df766976c 100644 --- a/components/vc-tree-select/src/Select.jsx +++ b/components/vc-tree-select/src/Select.jsx @@ -874,12 +874,28 @@ const Select = defineComponent({ }, onSearchInputKeyDown(event) { - const { _searchValue: searchValue, _valueList: valueList } = this.$data; + const { + _searchValue: searchValue, + _valueList: valueList, + _valueEntities: valueEntities, + } = this.$data; const { keyCode } = event; if (KeyCode.BACKSPACE === keyCode && this.isMultiple() && !searchValue && valueList.length) { - const lastValue = valueList[valueList.length - 1].value; + let lastValue = valueList[valueList.length - 1].value; + const { treeCheckStrictly } = this.$props; + if (!treeCheckStrictly) { + let cur = valueEntities[lastValue]; + while (cur) { + if (valueList.some(j => j.value === cur.value)) { + lastValue = cur.value; + cur = cur.parent; + } else { + cur = null; + } + } + } this.onMultipleSelectorRemove(event, lastValue); } }, diff --git a/components/vc-trigger/Popup.jsx b/components/vc-trigger/Popup.jsx index 0c64d1a14..7c49fa836 100644 --- a/components/vc-trigger/Popup.jsx +++ b/components/vc-trigger/Popup.jsx @@ -31,7 +31,7 @@ export default { point: PropTypes.shape({ pageX: PropTypes.number, pageY: PropTypes.number, - }), + }).loose, }, data() { this.domEl = null; diff --git a/components/vc-virtual-list/List.tsx b/components/vc-virtual-list/List.tsx index fd0317ebe..65a732f1a 100644 --- a/components/vc-virtual-list/List.tsx +++ b/components/vc-virtual-list/List.tsx @@ -134,10 +134,11 @@ const List = defineComponent({ // ================================ Height ================================ const [setInstance, collectHeight, heights] = useHeights(getKey, null, null); - // ========================== Visible Calculation ========================= - const calRes = computed(() => { + + const calRes = ref(); + watchEffect(() => { if (!useVirtual.value) { - return { + calRes.value = { scrollHeight: undefined, start: 0, end: state.mergedData.length - 1, @@ -147,7 +148,7 @@ const List = defineComponent({ // Always use virtual scroll bar in avoid shaking if (!inVirtual.value) { - return { + calRes.value = { scrollHeight: fillerInnerRef.value?.offsetHeight || 0, start: 0, end: state.mergedData.length - 1, @@ -193,13 +194,14 @@ const List = defineComponent({ // Give cache to improve scroll experience endIndex = Math.min(endIndex + 1, state.mergedData.length); - return { + calRes.value = { scrollHeight: itemTop, start: startIndex, end: endIndex, offset: startOffset, }; }); + // =============================== In Range =============================== const maxScrollHeight = computed(() => calRes.value.scrollHeight! - props.height!); diff --git a/package.json b/package.json index dcfb10780..a98b9320d 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "ant-design-vue", - "version": "2.1.2", + "version": "2.1.4", "title": "Ant Design Vue", "description": "An enterprise-class UI design language and Vue-based implementation", "keywords": [ @@ -39,7 +39,7 @@ "pre-publish": "node ./scripts/prepub && npm run generator-webtypes", "prettier": "prettier -c --write '**/*'", "pretty-quick": "pretty-quick", - "dist": "node --max_old_space_size=6144 antd-tools/cli/run.js dist", + "dist": "node --max_old_space_size=8192 antd-tools/cli/run.js dist", "lint": "eslint -c ./.eslintrc --fix --ext .jsx,.js,.vue,.ts,.tsx ./components", "lint:style": "stylelint \"{site,components}/**/*.less\" --syntax less", "codecov": "codecov" @@ -81,7 +81,7 @@ "@babel/preset-typescript": "^7.10.4", "@commitlint/cli": "^12.0.0", "@commitlint/config-conventional": "^12.0.0", - "@octokit/rest": "^16.0.0", + "@octokit/rest": "^18.0.0", "@types/fs-extra": "^9.0.8", "@types/lodash-es": "^4.17.3", "@types/raf": "^3.4.0", @@ -94,8 +94,8 @@ "@vue/eslint-config-typescript": "^7.0.0", "@vue/test-utils": "^2.0.0-0", "@webpack-cli/serve": "^1.3.1", - "acorn": "^7.0.0", - "autoprefixer": "^9.6.0", + "acorn": "^8.0.0", + "autoprefixer": "^10.2.0", "axios": "^0.21.0", "babel-eslint": "^10.0.1", "babel-jest": "^26.1.0", @@ -104,25 +104,25 @@ "babel-plugin-inline-import-data-uri": "^1.0.1", "babel-plugin-istanbul": "^6.0.0", "case-sensitive-paths-webpack-plugin": "^2.1.2", - "chalk": "^3.0.0", + "chalk": "^4.1.0", "cheerio": "^1.0.0-rc.2", "codecov": "^3.0.0", "colorful": "^2.1.0", - "commander": "^4.0.0", + "commander": "^7.2.0", "compare-versions": "^3.3.0", "cross-env": "^7.0.0", - "css-loader": "^3.0.0", - "deep-assign": "^2.0.0", + "css-loader": "^5.0.0", + "deep-assign": "^3.0.0", "docsearch.js": "^2.6.3", "enquire-js": "^0.2.1", - "eslint": "^6.8.0", + "eslint": "^7.25.0", "eslint-config-prettier": "^8.0.0", "eslint-plugin-html": "^6.0.0", "eslint-plugin-markdown": "^2.0.0-alpha.0", "eslint-plugin-prettier": "^3.1.4", "eslint-plugin-vue": "^7.1.0", "fetch-jsonp": "^1.1.3", - "fs-extra": "^8.0.0", + "fs-extra": "^10.0.0", "glob": "^7.1.2", "gulp": "^4.0.1", "gulp-babel": "^8.0.0", @@ -140,20 +140,20 @@ "json-templater": "^1.2.0", "jsonp": "^0.2.1", "less": "^4.0.0", - "less-loader": "^7.0.0", + "less-loader": "^8.0.0", "less-plugin-npm-import": "^2.1.0", "less-vars-to-js": "^1.3.0", - "lint-staged": "^10.0.0", + "lint-staged": "^11.0.0", "marked": "0.3.18", "merge2": "^1.2.1", - "mini-css-extract-plugin": "^0.10.0", + "mini-css-extract-plugin": "^1.5.0", "minimist": "^1.2.0", "mkdirp": "^0.5.1", "mockdate": "^2.0.2", "nprogress": "^0.2.0", "optimize-css-assets-webpack-plugin": "^5.0.1", - "postcss": "^7.0.6", - "postcss-loader": "^3.0.0", + "postcss": "^8.2.12", + "postcss-loader": "^5.0.0", "prettier": "^1.18.2", "pretty-quick": "^2.0.0", "prismjs": "^1.20.0", @@ -164,17 +164,16 @@ "rucksack-css": "^1.0.2", "selenium-server": "^3.0.1", "semver": "^7.0.0", - "style-loader": "^1.0.0", + "style-loader": "^2.0.0", "stylelint": "^13.0.0", "stylelint-config-prettier": "^8.0.0", "stylelint-config-rational-order": "^0.1.2", - "stylelint-config-standard": "^21.0.0", + "stylelint-config-standard": "^22.0.0", "stylelint-declaration-block-no-ignored-properties": "^2.1.0", "stylelint-order": "^4.0.0", - "terser-webpack-plugin": "^3.0.3", "through2": "^3.0.0", "ts-jest": "^26.4.1", - "ts-loader": "^8.1.0", + "ts-loader": "^9.1.0", "typescript": "^4.2.0", "umi-mock-middleware": "^1.0.0", "umi-request": "^1.3.5", diff --git a/v2-doc b/v2-doc index 31d85319d..4da56dac8 160000 --- a/v2-doc +++ b/v2-doc @@ -1 +1 @@ -Subproject commit 31d85319dcc0438b3c80957c99f57b931b047c11 +Subproject commit 4da56dac85f43ad7a288951cbf09d860ecf93bb4 diff --git a/webpack.config.js b/webpack.config.js index 0fbc8e475..edaaf436c 100644 --- a/webpack.config.js +++ b/webpack.config.js @@ -33,7 +33,7 @@ const babelConfig = { style: true, }, ], - ['@vue/babel-plugin-jsx', { mergeProps: false }], + ['@vue/babel-plugin-jsx', { mergeProps: false, enableObjectSlots: false }], '@babel/plugin-proposal-optional-chaining', '@babel/plugin-transform-object-assign', '@babel/plugin-proposal-object-rest-spread', @@ -118,9 +118,7 @@ module.exports = { use: [ { loader: MiniCssExtractPlugin.loader, - options: { - hmr: true, - }, + options: {}, }, 'css-loader', ],