diff --git a/CHANGELOG.en-US.md b/CHANGELOG.en-US.md index d1e60657d..5a87db68c 100644 --- a/CHANGELOG.en-US.md +++ b/CHANGELOG.en-US.md @@ -12,7 +12,7 @@ ## 3.3.0-beta.1 -`2022-05-22` +`2022-06-13` - 💄 优化部分组件箭头样式。 @@ -44,7 +44,35 @@ - 💄 优化 Upload 操作按钮的样式细节。 - 🐞 修复 Switch 在暗黑主题下关闭时的颜色问题。 -##3.2.4 +## 3.2.7 + +`2022-06-13` + +- 🌟 `Checkbox` supports adding extra properties [#5678](https://github.com/vueComponent/ant-design-vue/issues/5678) +- 🌟 `RadioGroup` support global size [#5690](https://github.com/vueComponent/ant-design-vue/issues/5690) +- 🌟 `Table` expandedRowKeys support v-model [#5695](https://github.com/vueComponent/ant-design-vue/issues/5695) +- 🐞 Fix global Form message not taking effect [#5693](https://github.com/vueComponent/ant-design-vue/issues/5693) +- 🐞 Fix `Typography` Enter key triggers end event twice, end is no longer triggered when blur [#5696](https://github.com/vueComponent/ant-design-vue/issues/5696) + +## 3.2.6 + +`2022-06-07` + +- 🌟 `Cascader` custom trigger supports custom components [#5677](https://github.com/vueComponent/ant-design-vue/issues/5677) +- 🐞 Fix `DateRangePicker` `TimeRangePicker` arrow not following the movement issue [#71c619](https://github.com/vueComponent/ant-design-vue/commit/71c6195771c0b9ddffadd294ce01f7515c5adc40) +- 🐞 Fix `TimeRangePicker` minSteps, hourSteps, secondStep not taking effect [#5671](https://github.com/vueComponent/ant-design-vue/issues/5671) + +## 3.2.5 + +`2022-05-26` + +- 🌟 Image Added left and right arrow switching function [#5642](https://github.com/vueComponent/ant-design-vue/issues/5642) +- 🐞 Fix Steps progressDot slot failure [#5648](https://github.com/vueComponent/ant-design-vue/issues/5648) +- 🐞 Fix Tooltip global getPopupContainer invalid problem [#5636](https://github.com/vueComponent/ant-design-vue/issues/5636) +- 🐞 Fix useForm help style issue [#5635](https://github.com/vueComponent/ant-design-vue/issues/5635) +- 🐞 Fix Table, Tree drag and drop style conflict [#5644](https://github.com/vueComponent/ant-design-vue/issues/5644) + +## 3.2.4 `2022-05-23` @@ -588,7 +616,7 @@ Github:[https://github.com/surely-vue/table] You can reference [Customized Form Controls](#components-form-demo-customized-form-controls), but it also has some disadvantages: - 1. If the custom component wants Form.Item to be verified and displayed, you need to inject `const {id, onFieldChange, onFieldBlur} = useFormItemContext()` and call the corresponding method. + 1. If the custom component wants Form.Item to be verified and displayed, you need to inject `const {id, onFieldChange, onFieldBlur} = useInjectFormItemContext()` and call the corresponding method. 2. A Form.Item can only collect the data of one form item. If there are multiple form items, it will cause collection confusion. For example, @@ -610,7 +638,7 @@ Github:[https://github.com/surely-vue/table] ``` - The second way is to wrap it with a custom component and call `useFormItemContext` in the custom component, It is equivalent to merging multiple form items into one. + The second way is to wrap it with a custom component and call `useInjectFormItemContext` in the custom component, It is equivalent to merging multiple form items into one. ```html diff --git a/CHANGELOG.zh-CN.md b/CHANGELOG.zh-CN.md index c0b61ee7c..a0cc7938e 100644 --- a/CHANGELOG.zh-CN.md +++ b/CHANGELOG.zh-CN.md @@ -12,7 +12,7 @@ ## 3.3.0-beta.1 -`2022-05-22` +`2022-06-13` - 💄 优化部分组件箭头样式。 @@ -44,6 +44,34 @@ - 💄 优化 Upload 操作按钮的样式细节。 - 🐞 修复 Switch 在暗黑主题下关闭时的颜色问题。 +## 3.2.7 + +`2022-06-13` + +- 🌟 `Checkbox` 支持添加额外属性 [#5678](https://github.com/vueComponent/ant-design-vue/issues/5678) +- 🌟 `RadioGroup` 支持全局 size [#5690](https://github.com/vueComponent/ant-design-vue/issues/5690) +- 🌟 `Table` expandedRowKeys 支持 v-model [#5695](https://github.com/vueComponent/ant-design-vue/issues/5695) +- 🐞 修复全局 Form message 未生效问题 [#5693](https://github.com/vueComponent/ant-design-vue/issues/5693) +- 🐞 修复 `Typography` 回车键触发两次 end 事件问题,blur 时不再触发 end [#5696](https://github.com/vueComponent/ant-design-vue/issues/5696) + +## 3.2.6 + +`2022-06-07` + +- 🌟 `Cascader` 自定义 trigger 支持自定义组件 [#5677](https://github.com/vueComponent/ant-design-vue/issues/5677) +- 🐞 修复 `DateRangePicker` `TimeRangePicker` 箭头没有跟随移动问题 [#71c619](https://github.com/vueComponent/ant-design-vue/commit/71c6195771c0b9ddffadd294ce01f7515c5adc40) +- 🐞 修复 `TimeRangePicker` minSteps、hourSteps、secondStep 未生效问题 [#5671](https://github.com/vueComponent/ant-design-vue/issues/5671) + +## 3.2.5 + +`2022-05-26` + +- 🌟 Image 新增左右箭头切换功能 [#5642](https://github.com/vueComponent/ant-design-vue/issues/5642) +- 🐞 修复 Steps progressDot 插槽失效问题 [#5648](https://github.com/vueComponent/ant-design-vue/issues/5648) +- 🐞 修复 Tooltip 全局 getPopupContainer 失效问题 [#5636](https://github.com/vueComponent/ant-design-vue/issues/5636) +- 🐞 修复 useForm help 样式问题 [#5635](https://github.com/vueComponent/ant-design-vue/issues/5635) +- 🐞 修复 Table、Tree 拖拽样式冲突问题 [#5644](https://github.com/vueComponent/ant-design-vue/issues/5644) + ## 3.2.4 `2022-05-23` @@ -585,7 +613,7 @@ Github:[https://github.com/surely-vue/table] - 自 3.0 版本以后,Form.Item 不再劫持子元素,而是通过 provider / inject 依赖注入的方式进行自动校验,这种方式可以提高组件性能,子元素也不会限制个数,同样子元素也可以是进一步封装的高级组件。你可以参考[自定义表单控件示例](#components-form-demo-customized-form-controls),但它同样会有一些缺点: - 1、自定义组件如果希望 Form.Item 进行校验展示,你需要 `const {id, onFieldChange, onFieldBlur} = useFormItemContext()` 注入,并调用相应的方法。 + 1、自定义组件如果希望 Form.Item 进行校验展示,你需要 `const {id, onFieldChange, onFieldBlur} = useInjectFormItemContext()` 注入,并调用相应的方法。 2、一个 Form.Item 只能收集一个表单项的数据,如果有多个表单项,会导致收集错乱。例如: @@ -607,7 +635,7 @@ Github:[https://github.com/surely-vue/table] ``` - 第二种,使用自定义组件包裹,并在自定义组件中调用 `useFormItemContext`,相当于把多个表单项合并成了一个。 + 第二种,使用自定义组件包裹,并在自定义组件中调用 `useInjectFormItemContext`,相当于把多个表单项合并成了一个。 ```html diff --git a/components/button/__tests__/__snapshots__/demo.test.js.snap b/components/button/__tests__/__snapshots__/demo.test.js.snap index 7ccd06064..25dbe2644 100644 --- a/components/button/__tests__/__snapshots__/demo.test.js.snap +++ b/components/button/__tests__/__snapshots__/demo.test.js.snap @@ -228,7 +228,7 @@ exports[`renders ./components/button/demo/multiple.vue correctly 1`] = ` `; exports[`renders ./components/button/demo/size.vue correctly 1`] = ` -
+


@@ -22,7 +22,7 @@ exports[`renders ./components/drawer/demo/multi-level-drawer.vue correctly 1`] = `; exports[`renders ./components/drawer/demo/placement.vue correctly 1`] = ` -
+
diff --git a/components/form/Form.tsx b/components/form/Form.tsx index 36b00e835..ac33a8b5c 100755 --- a/components/form/Form.tsx +++ b/components/form/Form.tsx @@ -30,6 +30,7 @@ import useConfigInject from '../_util/hooks/useConfigInject'; import { useProvideForm } from './context'; import type { SizeType } from '../config-provider'; import useForm from './useForm'; +import { useInjectGlobalForm } from '../config-provider/context'; export type RequiredMark = boolean | 'optional'; export type FormLayout = 'horizontal' | 'inline' | 'vertical'; @@ -127,10 +128,11 @@ const Form = defineComponent({ return true; }); const mergedColon = computed(() => props.colon ?? contextForm.value?.colon); + const { validateMessages: globalValidateMessages } = useInjectGlobalForm(); const validateMessages = computed(() => { return { ...defaultValidateMessages, - ...contextForm.value?.validateMessages, + ...globalValidateMessages.value, ...props.validateMessages, }; }); diff --git a/components/form/__tests__/__snapshots__/demo.test.js.snap b/components/form/__tests__/__snapshots__/demo.test.js.snap index 0522e51e4..b7a52f139 100644 --- a/components/form/__tests__/__snapshots__/demo.test.js.snap +++ b/components/form/__tests__/__snapshots__/demo.test.js.snap @@ -660,7 +660,7 @@ exports[`renders ./components/form/demo/lable-width.vue correctly 1`] = `
-
+
@@ -705,7 +705,7 @@ exports[`renders ./components/form/demo/layout.vue correctly 1`] = `
-
+
@@ -1375,7 +1375,7 @@ exports[`renders ./components/form/demo/validate-other.vue correctly 1`] = `
-
+
@@ -1389,7 +1389,7 @@ exports[`renders ./components/form/demo/validate-other.vue correctly 1`] = `
-
+
@@ -1964,7 +1964,7 @@ exports[`renders ./components/form/demo/validation.vue correctly 1`] = `
-
+
diff --git a/components/form/index.en-US.md b/components/form/index.en-US.md index f40a1cedc..674b32243 100644 --- a/components/form/index.en-US.md +++ b/components/form/index.en-US.md @@ -100,7 +100,7 @@ You can reference [Customized Form Controls](#components-form-demo-customized-fo But it also has some disadvantages: -1. If the custom component wants Form.Item to be verified and displayed, you need to inject `const {id, onFieldChange, onFieldBlur} = useFormItemContext()` and call the corresponding method. +1. If the custom component wants Form.Item to be verified and displayed, you need to inject `const {id, onFieldChange, onFieldBlur} = useInjectFormItemContext()` and call the corresponding method. 2. A Form.Item can only collect the data of one form item. If there are multiple form items, it will cause collection confusion, for example, @@ -122,7 +122,7 @@ The first is to use multiple `a-form-item`: ``` -The second way is to wrap it with a custom component and call `useFormItemContext` in the custom component, It is equivalent to merging multiple form items into one. +The second way is to wrap it with a custom component and call `useInjectFormItemContext` in the custom component, It is equivalent to merging multiple form items into one. ```html diff --git a/components/form/index.zh-CN.md b/components/form/index.zh-CN.md index d2d3ec8ba..29f79c85e 100644 --- a/components/form/index.zh-CN.md +++ b/components/form/index.zh-CN.md @@ -99,7 +99,7 @@ cover: https://gw.alipayobjects.com/zos/alicdn/ORmcdeaoO/Form.svg 但它同样会有一些缺点: -1、自定义组件如果希望 Form.Item 进行校验展示,你需要 `const {id, onFieldChange, onFieldBlur} = useFormItemContext()` 注入,并调用相应的方法。 +1、自定义组件如果希望 Form.Item 进行校验展示,你需要 `const {id, onFieldChange, onFieldBlur} = useInjectFormItemContext()` 注入,并调用相应的方法。 2、一个 Form.Item 只能收集一个表单项的数据,如果有多个表单项,会导致收集错乱,例如, @@ -121,7 +121,7 @@ cover: https://gw.alipayobjects.com/zos/alicdn/ORmcdeaoO/Form.svg ``` -第二种,使用自定义组件包裹,并在自定义组件中调用 `useFormItemContext`,相当于把多个表单项合并成了一个 +第二种,使用自定义组件包裹,并在自定义组件中调用 `useInjectFormItemContext`,相当于把多个表单项合并成了一个 ```html diff --git a/components/form/useForm.ts b/components/form/useForm.ts index cf34170ee..43a72f288 100644 --- a/components/form/useForm.ts +++ b/components/form/useForm.ts @@ -252,7 +252,7 @@ function useForm( if (validateInfos[name].validateStatus === 'validating') { const res = results.filter(result => result && result.errors.length); validateInfos[name].validateStatus = res.length ? 'error' : 'success'; - validateInfos[name].help = res.length ? res.map(r => r.errors) : ''; + validateInfos[name].help = res.length ? res.map(r => r.errors) : null; options?.onValidate?.( name, !res.length, @@ -293,7 +293,7 @@ function useForm( validateInfos[key] && Object.assign(validateInfos[key], { validateStatus: '', - help: '', + help: null, }); }); }; diff --git a/components/radio/Group.tsx b/components/radio/Group.tsx index c05bccada..e10607af7 100644 --- a/components/radio/Group.tsx +++ b/components/radio/Group.tsx @@ -24,7 +24,7 @@ export type RadioGroupChildOption = { export const radioGroupProps = () => ({ prefixCls: String, value: PropTypes.any, - size: PropTypes.oneOf(RadioGroupSizeTypes).def('default'), + size: PropTypes.oneOf(RadioGroupSizeTypes), options: { type: Array as PropType>, }, diff --git a/components/radio/__tests__/__snapshots__/demo.test.js.snap b/components/radio/__tests__/__snapshots__/demo.test.js.snap index 436d25dfd..b4f2fd3ce 100644 --- a/components/radio/__tests__/__snapshots__/demo.test.js.snap +++ b/components/radio/__tests__/__snapshots__/demo.test.js.snap @@ -13,13 +13,13 @@ exports[`renders ./components/radio/demo/disabled.vue correctly 1`] = ` exports[`renders ./components/radio/demo/radioButton.vue correctly 1`] = `
-
+
-
+
-
+
`; @@ -27,52 +27,52 @@ exports[`renders ./components/radio/demo/radioButton.vue correctly 1`] = ` exports[`renders ./components/radio/demo/radioButton-solid.vue correctly 1`] = `
-
+
-
+
`; exports[`renders ./components/radio/demo/radioGroup.vue correctly 1`] = `
-
+
`; -exports[`renders ./components/radio/demo/radioGroup-more.vue correctly 1`] = `
`; +exports[`renders ./components/radio/demo/radioGroup-more.vue correctly 1`] = `
`; exports[`renders ./components/radio/demo/radioGroup-options.vue correctly 1`] = `
-
+
-
+
-
+
-
+
-
+
-
+
`; -exports[`renders ./components/radio/demo/radioGroup-with-name.vue correctly 1`] = `
`; +exports[`renders ./components/radio/demo/radioGroup-with-name.vue correctly 1`] = `
`; exports[`renders ./components/radio/demo/size.vue correctly 1`] = `
@@ -80,7 +80,7 @@ exports[`renders ./components/radio/demo/size.vue correctly 1`] = `
-
+
diff --git a/components/radio/__tests__/__snapshots__/group.test.js.snap b/components/radio/__tests__/__snapshots__/group.test.js.snap index 1cfc6747b..28a8170c5 100644 --- a/components/radio/__tests__/__snapshots__/group.test.js.snap +++ b/components/radio/__tests__/__snapshots__/group.test.js.snap @@ -1,9 +1,9 @@ // Jest Snapshot v1, https://goo.gl/fbAQLP -exports[`Radio all children should have a name property 1`] = `
`; +exports[`Radio all children should have a name property 1`] = `
`; -exports[`Radio fire change events when value changes 1`] = `
`; +exports[`Radio fire change events when value changes 1`] = `
`; -exports[`Radio fire change events when value changes 2`] = `
`; +exports[`Radio fire change events when value changes 2`] = `
`; -exports[`Radio passes prefixCls down to radio 1`] = `
`; +exports[`Radio passes prefixCls down to radio 1`] = `
`; diff --git a/components/select/__tests__/__snapshots__/demo.test.js.snap b/components/select/__tests__/__snapshots__/demo.test.js.snap index f55d393e0..7d7d61416 100644 --- a/components/select/__tests__/__snapshots__/demo.test.js.snap +++ b/components/select/__tests__/__snapshots__/demo.test.js.snap @@ -330,7 +330,7 @@ exports[`renders ./components/select/demo/option-label-prop.vue correctly 1`] = `; exports[`renders ./components/select/demo/placement.vue correctly 1`] = ` -
+


@@ -498,7 +498,7 @@ exports[`renders ./components/select/demo/select-users.vue correctly 1`] = ` `; exports[`renders ./components/select/demo/size.vue correctly 1`] = ` -
+


diff --git a/components/skeleton/__tests__/__snapshots__/demo.test.js.snap b/components/skeleton/__tests__/__snapshots__/demo.test.js.snap index a1f681b82..2f70399bc 100644 --- a/components/skeleton/__tests__/__snapshots__/demo.test.js.snap +++ b/components/skeleton/__tests__/__snapshots__/demo.test.js.snap @@ -122,7 +122,7 @@ exports[`renders ./components/skeleton/demo/element.vue correctly 1`] = `
-
+
@@ -136,7 +136,7 @@ exports[`renders ./components/skeleton/demo/element.vue correctly 1`] = `
-
+
@@ -150,7 +150,7 @@ exports[`renders ./components/skeleton/demo/element.vue correctly 1`] = `
-
+
diff --git a/components/space/__tests__/__snapshots__/demo.test.js.snap b/components/space/__tests__/__snapshots__/demo.test.js.snap index b9a1b8aa9..cdba29120 100644 --- a/components/space/__tests__/__snapshots__/demo.test.js.snap +++ b/components/space/__tests__/__snapshots__/demo.test.js.snap @@ -109,7 +109,7 @@ exports[`renders ./components/space/demo/customize.vue correctly 1`] = ` exports[`renders ./components/space/demo/size.vue correctly 1`] = `
-


+