From d9304506d36cca6a8c0483a8e191992990d7fa92 Mon Sep 17 00:00:00 2001 From: tangjinzhou <415800467@qq.com> Date: Thu, 16 Jun 2022 10:08:04 +0800 Subject: [PATCH 1/9] doc: update doc --- components/upload/index.zh-CN.md | 1 - 1 file changed, 1 deletion(-) diff --git a/components/upload/index.zh-CN.md b/components/upload/index.zh-CN.md index 73c2e47f0..ea55e6603 100644 --- a/components/upload/index.zh-CN.md +++ b/components/upload/index.zh-CN.md @@ -25,7 +25,6 @@ cover: https://gw.alipayobjects.com/zos/alicdn/QaeBt_ZMg/Upload.svg | beforeUpload | 上传文件之前的钩子,参数为上传的文件,若返回 `false` 则停止上传。支持返回一个 Promise 对象,Promise 对象 reject 时则停止上传,resolve 时开始上传( resolve 传入 `File` 或 `Blob` 对象则上传 resolve 传入对象)。 | (file, fileList) => `boolean` \| `Promise` | 无 | | | customRequest | 通过覆盖默认的上传行为,可以自定义自己的上传实现 | Function | 无 | | | | data | 上传所需参数或返回上传参数的方法 | object\|(file) => object | 无 | | | -| directory | 支持上传文件夹([caniuse](https://caniuse.com/#feat=input-file-directory)) | boolean | false | | | | directory | 支持上传文件夹([caniuse](https://caniuse.com/#feat=input-file-directory)) | boolean | false | 3.0 | | | disabled | 是否禁用 | boolean | false | | | | downloadIcon | 自定义下载 icon | v-slot:iconRender="{file: UploadFile}" | - | 3.0 | | From 168626bfeb3f6bd8ad69c03a5fc70f7ec2df961e Mon Sep 17 00:00:00 2001 From: WD Date: Sat, 18 Jun 2022 11:14:59 +0800 Subject: [PATCH 2/9] feat(Image): Image support mouse wheel zoom in and out (#5703), close #5700 --- components/vc-image/src/Preview.tsx | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/components/vc-image/src/Preview.tsx b/components/vc-image/src/Preview.tsx index 58ab37877..14f041538 100644 --- a/components/vc-image/src/Preview.tsx +++ b/components/vc-image/src/Preview.tsx @@ -295,6 +295,14 @@ const Preview = defineComponent({ }, { flush: 'post', immediate: true }, ); + watch([lastWheelZoomDirection], () => { + const { wheelDirection } = lastWheelZoomDirection.value; + if (wheelDirection > 0) { + onZoomOut(); + } else if (wheelDirection < 0) { + onZoomIn(); + } + }); }); onUnmounted(() => { removeListeners(); From ab8457303e2e2e42e804c9dd1143e94d39e0d22f Mon Sep 17 00:00:00 2001 From: WD Date: Sat, 18 Jun 2022 21:48:00 +0800 Subject: [PATCH 3/9] fix(upload): inheritAttrs, close #5714 --- components/upload/Upload.tsx | 2 ++ 1 file changed, 2 insertions(+) diff --git a/components/upload/Upload.tsx b/components/upload/Upload.tsx index aff037846..3d7cb0902 100644 --- a/components/upload/Upload.tsx +++ b/components/upload/Upload.tsx @@ -342,11 +342,13 @@ export default defineComponent({ }; return () => { const { listType, disabled, type } = props; + const { class: className, style: styleName, ...transAttrs } = attrs; const rcUploadProps = { onBatchStart, onError, onProgress, onSuccess, + ...transAttrs, ...(props as RcUploadProps), id: props.id ?? formItemContext.id.value, prefixCls: prefixCls.value, From cbd9e6b6ce54d3d4b4ff9f4dc24a646df89cd6d0 Mon Sep 17 00:00:00 2001 From: tangjinzhou <415800467@qq.com> Date: Mon, 20 Jun 2022 09:09:03 +0800 Subject: [PATCH 4/9] fix: row gutter type error, close #5725 --- components/grid/Row.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/components/grid/Row.tsx b/components/grid/Row.tsx index 8b26150ce..857827ed0 100644 --- a/components/grid/Row.tsx +++ b/components/grid/Row.tsx @@ -22,7 +22,7 @@ export const rowProps = () => ({ justify: String as PropType, prefixCls: String, gutter: { - type: [Number, Array] as PropType, + type: [Number, Array, Object] as PropType, default: 0 as Gutter | [Gutter, Gutter], }, wrap: { type: Boolean, default: undefined }, From 9493dc224bbf0b5c938b9555e15718165d11c5ed Mon Sep 17 00:00:00 2001 From: tangjinzhou <415800467@qq.com> Date: Mon, 20 Jun 2022 09:26:56 +0800 Subject: [PATCH 5/9] fix: table resize trigger scrollbar --- components/table/style/resize.less | 1 + 1 file changed, 1 insertion(+) diff --git a/components/table/style/resize.less b/components/table/style/resize.less index 1ca091e1f..3dfcd71d4 100644 --- a/components/table/style/resize.less +++ b/components/table/style/resize.less @@ -24,6 +24,7 @@ } .@{table-prefix-cls}-resize-handle.dragging { + overflow: hidden; .@{table-prefix-cls}-resize-handle-line { opacity: 1; } From b3dafb92efdd1a20b80728b92b5f2e088d55d417 Mon Sep 17 00:00:00 2001 From: tangjinzhou <415800467@qq.com> Date: Mon, 20 Jun 2022 10:21:14 +0800 Subject: [PATCH 6/9] doc: update select suffix demo, close #5701 --- components/select/__tests__/__snapshots__/demo.test.js.snap | 4 ++-- components/select/demo/suffix.vue | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/components/select/__tests__/__snapshots__/demo.test.js.snap b/components/select/__tests__/__snapshots__/demo.test.js.snap index 08767c117..eeeb24b7f 100644 --- a/components/select/__tests__/__snapshots__/demo.test.js.snap +++ b/components/select/__tests__/__snapshots__/demo.test.js.snap @@ -537,7 +537,7 @@ exports[`renders ./components/select/demo/suffix.vue correctly 1`] = `
Lucy -
+ @@ -548,7 +548,7 @@ exports[`renders ./components/select/demo/suffix.vue correctly 1`] = `
Lucy -
+ diff --git a/components/select/demo/suffix.vue b/components/select/demo/suffix.vue index e9ba5cda1..2064f3ab8 100644 --- a/components/select/demo/suffix.vue +++ b/components/select/demo/suffix.vue @@ -24,10 +24,10 @@ Basic Usage :options="options1" @change="handleChange" > - + - + From 62dc2402f37c0ca0514f5b8fbb363247f0216bb2 Mon Sep 17 00:00:00 2001 From: tangjinzhou <415800467@qq.com> Date: Tue, 21 Jun 2022 14:51:23 +0800 Subject: [PATCH 7/9] feat: ConfigProvider.config add getPopupContainer --- components/config-provider/index.tsx | 1 + 1 file changed, 1 insertion(+) diff --git a/components/config-provider/index.tsx b/components/config-provider/index.tsx index a92bc2527..51f285672 100644 --- a/components/config-provider/index.tsx +++ b/components/config-provider/index.tsx @@ -62,6 +62,7 @@ watchEffect(() => { type GlobalConfigProviderProps = { prefixCls?: MaybeRef; + getPopupContainer?: ConfigProviderProps['getPopupContainer']; }; let stopWatchEffect: WatchStopHandle; From bddf64e0ada6d265e0159dbe4da11315096d98d8 Mon Sep 17 00:00:00 2001 From: Gin Date: Wed, 22 Jun 2022 09:26:41 +0800 Subject: [PATCH 8/9] fix(DirectoryTree): `selectedKeys` updating (#5732) - In `multiple` mode, it should emit single value instead of multiple values on single click. --- components/tree/DirectoryTree.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/components/tree/DirectoryTree.tsx b/components/tree/DirectoryTree.tsx index 749b2ab53..00632ebf5 100644 --- a/components/tree/DirectoryTree.tsx +++ b/components/tree/DirectoryTree.tsx @@ -239,7 +239,7 @@ export default defineComponent({ ); } else { // Single click - newSelectedKeys = keys; + newSelectedKeys = [key]; lastSelectedKey.value = key; cachedSelectedKeys.value = newSelectedKeys; newEvent.selectedNodes = convertDirectoryKeysToNodes( From 39ac6ed89e0da8c2beb63082a15a80fb5346a6fc Mon Sep 17 00:00:00 2001 From: tangjinzhou <415800467@qq.com> Date: Fri, 24 Jun 2022 10:41:15 +0800 Subject: [PATCH 9/9] fix: typography editing error, close #5743 --- components/typography/Base.tsx | 30 ++++++++++++++++++++---------- 1 file changed, 20 insertions(+), 10 deletions(-) diff --git a/components/typography/Base.tsx b/components/typography/Base.tsx index 2787ebe27..2650871ec 100644 --- a/components/typography/Base.tsx +++ b/components/typography/Base.tsx @@ -30,6 +30,7 @@ import useConfigInject from '../_util/hooks/useConfigInject'; import type { EventHandler } from '../_util/EventInterface'; import omit from '../_util/omit'; import type { AutoSizeType } from '../input/inputProps'; +import useMergedState from '../_util/hooks/useMergedState'; export type BaseType = 'secondary' | 'success' | 'warning' | 'danger'; @@ -130,7 +131,6 @@ const Base = defineComponent({ const { prefixCls, direction } = useConfigInject('typography', props); const state = reactive({ - edit: false, copied: false, ellipsisText: '', ellipsisContent: null, @@ -256,29 +256,39 @@ const Base = defineComponent({ }, 3000); }); } + const editable = computed(() => { const editable = props.editable; - if (!editable) return { editing: state.edit }; + if (!editable) return { editing: false }; return { - editing: state.edit, ...(typeof editable === 'object' ? editable : null), }; }); + const [editing, setEditing] = useMergedState(false, { + value: computed(() => { + return editable.value.editing; + }), + }); + function triggerEdit(edit: boolean) { const { onStart } = editable.value; if (edit && onStart) { onStart(); } - state.edit = edit; - nextTick(() => { - if (!edit) { + setEditing(edit); + } + watch( + editing, + val => { + if (!val) { editIcon.value?.focus(); } - }); - } + }, + { flush: 'post' }, + ); // ============== Ellipsis ============== function resizeOnNextFrame() { @@ -467,7 +477,7 @@ const Base = defineComponent({ } return () => { - const { editing, triggerType = ['icon'] } = editable.value; + const { triggerType = ['icon'] } = editable.value; const children = props.ellipsis || props.editable ? props.content !== undefined @@ -477,7 +487,7 @@ const Base = defineComponent({ ? slots.default() : props.content; - if (editing) { + if (editing.value) { return renderEditInput(); } return (