From f41fec26ba5b18e404b5a9cf5e823814c98e0c4c Mon Sep 17 00:00:00 2001 From: Carl Chen <71313168+cc-hearts@users.noreply.github.com> Date: Sun, 9 Jun 2024 09:56:45 +0800 Subject: [PATCH 01/36] fix[vc-util]: styleObjectToString filter invalid value (#7642) --- components/vc-util/Dom/css.ts | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/components/vc-util/Dom/css.ts b/components/vc-util/Dom/css.ts index 512a2609fd..7cb597dfe4 100644 --- a/components/vc-util/Dom/css.ts +++ b/components/vc-util/Dom/css.ts @@ -121,7 +121,13 @@ export function styleToString(style: CSSStyleDeclaration) { } export function styleObjectToString(style: Record) { - return Object.keys(style) - .map(name => `${name}: ${style[name]};`) - .join(''); + return Object.keys(style).reduce((acc, name) => { + const styleValue = style[name]; + if (typeof styleValue === 'undefined' || styleValue === null) { + return acc; + } + + acc += `${name}: ${style[name]};`; + return acc; + }, ''); } From 208b8d3085e66a977404ecb37698e9caee03fee7 Mon Sep 17 00:00:00 2001 From: Kylin <75473409+lxKylin@users.noreply.github.com> Date: Sun, 9 Jun 2024 22:08:30 +0800 Subject: [PATCH 02/36] docs: unify the default value of none to - (#7636) --- components/calendar/index.zh-CN.md | 16 ++++++++-------- components/collapse/index.zh-CN.md | 4 ++-- components/dropdown/index.zh-CN.md | 2 +- components/input-number/index.zh-CN.md | 2 +- components/modal/index.zh-CN.md | 16 ++++++++-------- components/popconfirm/index.zh-CN.md | 2 +- components/segmented/index.zh-CN.md | 2 +- components/select/index.zh-CN.md | 2 +- components/tabs/index.zh-CN.md | 8 ++++---- components/tooltip/index.zh-CN.md | 12 ++++++------ components/upload/index.zh-CN.md | 22 +++++++++++----------- 11 files changed, 44 insertions(+), 44 deletions(-) diff --git a/components/calendar/index.zh-CN.md b/components/calendar/index.zh-CN.md index 3d0f68d1fd..725f2d5731 100644 --- a/components/calendar/index.zh-CN.md +++ b/components/calendar/index.zh-CN.md @@ -28,16 +28,16 @@ coverDark: https://mdn.alipayobjects.com/huamei_7uahnr/afts/img/A*-p-wQLik200AAA | 参数 | 说明 | 类型 | 默认值 | 版本 | | --- | --- | --- | --- | --- | -| dateCellRender | 作用域插槽,用来自定义渲染日期单元格,返回内容会被追加到单元格, | v-slot:dateCellRender="{current: dayjs}" | 无 | | -| dateFullCellRender | 作用域插槽,自定义渲染日期单元格,返回内容覆盖单元格 | v-slot:dateFullCellRender="{current: dayjs}" | 无 | | -| disabledDate | 不可选择的日期 | (currentDate: dayjs) => boolean | 无 | | +| dateCellRender | 作用域插槽,用来自定义渲染日期单元格,返回内容会被追加到单元格, | v-slot:dateCellRender="{current: dayjs}" | - | | +| dateFullCellRender | 作用域插槽,自定义渲染日期单元格,返回内容覆盖单元格 | v-slot:dateFullCellRender="{current: dayjs}" | - | | +| disabledDate | 不可选择的日期 | (currentDate: dayjs) => boolean | - | | | fullscreen | 是否全屏显示 | boolean | true | | | headerRender | 自定义头部内容 | v-slot:headerRender="{value: dayjs, type: string, onChange: f(), onTypeChange: f()}" | - | | | locale | 国际化配置 | object | [默认配置](https://github.com/vueComponent/ant-design-vue/blob/main/components/date-picker/locale/example.json) | | | mode | 初始模式,`month/year` | string | month | | -| monthCellRender | 作用域插槽,自定义渲染月单元格,返回内容会被追加到单元格 | v-slot:monthCellRender="{current: dayjs}" | 无 | | -| monthFullCellRender | 作用域插槽,自定义渲染月单元格,返回内容覆盖单元格 | v-slot:monthFullCellRender="{current: dayjs}" | 无 | | -| validRange | 设置可以显示的日期 | \[[dayjs](https://day.js.org/), [dayjs](https://day.js.org/)] | 无 | | +| monthCellRender | 作用域插槽,自定义渲染月单元格,返回内容会被追加到单元格 | v-slot:monthCellRender="{current: dayjs}" | - | | +| monthFullCellRender | 作用域插槽,自定义渲染月单元格,返回内容覆盖单元格 | v-slot:monthFullCellRender="{current: dayjs}" | - | | +| validRange | 设置可以显示的日期 | \[[dayjs](https://day.js.org/), [dayjs](https://day.js.org/)] | - | | | value(v-model) | 展示日期 | [dayjs](https://day.js.org/) | 当前日期 | | | valueFormat | 可选,绑定值的格式,对 value、defaultValue 起作用。不指定则绑定值为 dayjs 对象 | string,[具体格式](https://day.js.org/docs/zh-CN/display/format) | - | | @@ -45,8 +45,8 @@ coverDark: https://mdn.alipayobjects.com/huamei_7uahnr/afts/img/A*-p-wQLik200AAA | 事件名称 | 说明 | 回调参数 | | | --- | --- | --- | --- | --- | -| change | 日期变化时的回调, 面板变化有可能导致日期变化 | function(date: dayjs \| string) | 无 | -| panelChange | 日期面板变化回调 | function(date: dayjs \| string, mode: string) | 无 | +| change | 日期变化时的回调, 面板变化有可能导致日期变化 | function(date: dayjs \| string) | - | +| panelChange | 日期面板变化回调 | function(date: dayjs \| string, mode: string) | - | | select | 选择日期回调,包含来源信息 | function(date: Dayjs, info: { source: 'year' \| 'month' \| 'date' \| 'customize' }) | - | | ### 如何仅获取来自面板点击的日期? diff --git a/components/collapse/index.zh-CN.md b/components/collapse/index.zh-CN.md index e9e1c042d7..ddae33295a 100644 --- a/components/collapse/index.zh-CN.md +++ b/components/collapse/index.zh-CN.md @@ -42,6 +42,6 @@ coverDark: https://mdn.alipayobjects.com/huamei_7uahnr/afts/img/A*sir-TK0HkWcAAA | collapsible | 是否可折叠或指定可折叠触发区域 | `header` \| `disabled` | - | 3.0 | | extra | 自定义渲染每个面板右上角的内容 | VNode \| slot | - | 1.5.0 | | forceRender | 被隐藏时是否渲染 DOM 结构 | boolean | false | | -| header | 面板头内容 | string\|slot | 无 | | -| key | 对应 activeKey | string \| number | 无 | | +| header | 面板头内容 | string\|slot | - | | +| key | 对应 activeKey | string \| number | - | | | showArrow | 是否展示当前面板上的箭头 | boolean | `true` | | diff --git a/components/dropdown/index.zh-CN.md b/components/dropdown/index.zh-CN.md index b66ae40489..1149da0a23 100644 --- a/components/dropdown/index.zh-CN.md +++ b/components/dropdown/index.zh-CN.md @@ -22,7 +22,7 @@ coverDark: https://mdn.alipayobjects.com/huamei_7uahnr/afts/img/A*5qm4S4Zgh2QAAA | 参数 | 说明 | 类型 | 默认值 | | | --- | --- | --- | --- | --- | -| align | 该值将合并到 placement 的配置中,设置参考 [dom-align](https://github.com/yiminghe/dom-align) | Object | 无 | | +| align | 该值将合并到 placement 的配置中,设置参考 [dom-align](https://github.com/yiminghe/dom-align) | Object | - | | | arrow | 下拉框箭头是否显示 | boolean \| { pointAtCenter: boolean } | false | 3.3.0 | | destroyPopupOnHide | 关闭后是否销毁 Dropdown | boolean | false | 3.0 | | disabled | 菜单是否禁用 | boolean | - | | diff --git a/components/input-number/index.zh-CN.md b/components/input-number/index.zh-CN.md index a603d4a705..3ce0b30946 100644 --- a/components/input-number/index.zh-CN.md +++ b/components/input-number/index.zh-CN.md @@ -34,7 +34,7 @@ coverDark: https://mdn.alipayobjects.com/huamei_7uahnr/afts/img/A*1uH-R5kLAMIAAA | parser | 指定从 formatter 里转换回数字的方式,和 formatter 搭配使用 | function( string): number | - | | | precision | 数值精度 | number | - | | | prefix | 带有前缀图标的 input | slot | - | 3.0 | -| size | 输入框大小 | string | 无 | | +| size | 输入框大小 | string | - | | | status | 设置校验状态 | 'error' \| 'warning' | - | 3.3.0 | | step | 每次改变步数,可以为小数 | number\|string | 1 | | | stringMode | 字符值模式,开启后支持高精度小数。同时 `change` 事件将返回 string 类型 | boolean | false | 3.0 | diff --git a/components/modal/index.zh-CN.md b/components/modal/index.zh-CN.md index 931649b1bc..103885923b 100644 --- a/components/modal/index.zh-CN.md +++ b/components/modal/index.zh-CN.md @@ -19,14 +19,14 @@ coverDark: https://mdn.alipayobjects.com/huamei_7uahnr/afts/img/A*fBrgSJBmavgAAA | 参数 | 说明 | 类型 | 默认值 | 版本 | | --- | --- | --- | --- | --- | -| afterClose | Modal 完全关闭后的回调 | function | 无 | | +| afterClose | Modal 完全关闭后的回调 | function | - | | | bodyStyle | Modal body 样式 | object | {} | | | cancelButtonProps | cancel 按钮 props | [ButtonProps](/components/button/#api) | - | | | cancelText | 取消按钮文字 | string\| slot | 取消 | | | centered | 垂直居中展示 Modal | boolean | `false` | | | closable | 是否显示右上角的关闭按钮 | boolean | true | | | closeIcon | 自定义关闭图标 | VNode \| slot | - | | -| confirmLoading | 确定按钮 loading | boolean | 无 | | +| confirmLoading | 确定按钮 loading | boolean | - | | | destroyOnClose | 关闭时销毁 Modal 里的子元素 | boolean | false | | | footer | 底部内容,当不需要默认底部按钮时,可以设为 `:footer="null"` | string\|slot | 确定取消按钮 | | | forceRender | 强制渲染 Modal | boolean | false | | @@ -38,8 +38,8 @@ coverDark: https://mdn.alipayobjects.com/huamei_7uahnr/afts/img/A*fBrgSJBmavgAAA | okButtonProps | ok 按钮 props | [ButtonProps](/components/button/#api) | - | | | okText | 确认按钮文字 | string\|slot | 确定 | | | okType | 确认按钮类型 | string | primary | | -| title | 标题 | string\|slot | 无 | | -| open(v-model) | 对话框是否可见 | boolean | 无 | | +| title | 标题 | string\|slot | - | | +| open(v-model) | 对话框是否可见 | boolean | - | | | width | 宽度 | string\|number | 520 | | | wrapClassName | 对话框外层容器的类名 | string | - | | | zIndex | 设置 Modal 的 `z-index` | number | 1000 | | @@ -76,7 +76,7 @@ coverDark: https://mdn.alipayobjects.com/huamei_7uahnr/afts/img/A*fBrgSJBmavgAAA | centered | 垂直居中展示 Modal | boolean | `false` | | | class | 容器类名 | string | - | | | closable | 是否显示右上角的关闭按钮 | boolean | `false` | | -| content | 内容 | string \|VNode \|function() | 无 | | +| content | 内容 | string \|VNode \|function() | - | | | footer | 底部内容,当不需要默认底部按钮时,可以设为 `footer: null` | string \|VNode \|function() | - | 4.0.0 | | icon | 自定义图标(1.14.0 新增) | VNode \| ()=>VNode | - | | | keyboard | 是否支持键盘 esc 关闭 | boolean | true | | @@ -85,12 +85,12 @@ coverDark: https://mdn.alipayobjects.com/huamei_7uahnr/afts/img/A*fBrgSJBmavgAAA | okButtonProps | ok 按钮 props | [ButtonProps](/components/button) | - | | | okText | 确认按钮文字 | string | 确定 | | | okType | 确认按钮类型 | string | primary | | -| title | 标题 | string\|VNode \|function() | 无 | | +| title | 标题 | string\|VNode \|function() | - | | | width | 宽度 | string\|number | 416 | | | wrapClassName | 对话框外层容器的类名 | string | - | 3.2.3 | | zIndex | 设置 Modal 的 `z-index` | number | 1000 | | -| onCancel | 取消回调,参数为关闭函数,返回 promise 时 resolve 后自动关闭 | function | 无 | | -| onOk | 点击确定回调,参数为关闭函数,返回 promise 时 resolve 后自动关闭 | function | 无 | | +| onCancel | 取消回调,参数为关闭函数,返回 promise 时 resolve 后自动关闭 | function | - | | +| onOk | 点击确定回调,参数为关闭函数,返回 promise 时 resolve 后自动关闭 | function | - | | 以上函数调用后,会返回一个引用,可以通过该引用更新和关闭弹窗。 diff --git a/components/popconfirm/index.zh-CN.md b/components/popconfirm/index.zh-CN.md index 22d4e23542..df402b00b7 100644 --- a/components/popconfirm/index.zh-CN.md +++ b/components/popconfirm/index.zh-CN.md @@ -27,7 +27,7 @@ coverDark: https://mdn.alipayobjects.com/huamei_7uahnr/afts/img/A*HrFtQ6jJJFQAAA | okText | 确认按钮文字 | string\|slot | 确定 | | | okType | 确认按钮类型 | string | primary | | | showCancel | 是否显示取消按钮 | boolean | true | 3.0 | -| title | 确认框的描述 | string\|slot | 无 | | +| title | 确认框的描述 | string\|slot | - | | | description | 确认内容的详细描述 | string\|slot | - | 4.0 | | open (v-model) | 是否显示 | boolean | - | 4.0 | diff --git a/components/segmented/index.zh-CN.md b/components/segmented/index.zh-CN.md index 91b1b03a5c..8d5068da5d 100644 --- a/components/segmented/index.zh-CN.md +++ b/components/segmented/index.zh-CN.md @@ -21,7 +21,7 @@ tag: New | 参数 | 说明 | 类型 | 默认值 | 版本 | | --- | --- | --- | --- | --- | -| block | 将宽度调整为父元素宽度的选项 | boolean | 无 | | +| block | 将宽度调整为父元素宽度的选项 | boolean | - | | | disabled | 是否禁用 | boolean | false | | | options | 数据化配置选项内容 | string[] \| number[] \| SegmentedOption[] | [] | | | size | 控件尺寸 | `large` \| `middle` \| `small` | - | | diff --git a/components/select/index.zh-CN.md b/components/select/index.zh-CN.md index 4de3bf8ae4..7f748d9b53 100644 --- a/components/select/index.zh-CN.md +++ b/components/select/index.zh-CN.md @@ -111,7 +111,7 @@ coverDark: https://mdn.alipayobjects.com/huamei_7uahnr/afts/img/A*5oPiTqPxGAUAAA | 参数 | 说明 | 类型 | 默认值 | | ----- | ---- | ------------------------- | ------ | | key | | string | - | -| label | 组名 | string\|function(h)\|slot | 无 | +| label | 组名 | string\|function(h)\|slot | - | ## FAQ diff --git a/components/tabs/index.zh-CN.md b/components/tabs/index.zh-CN.md index 006c000e0e..760dd2db07 100644 --- a/components/tabs/index.zh-CN.md +++ b/components/tabs/index.zh-CN.md @@ -25,13 +25,13 @@ Ant Design 依次提供了三级选项卡,分别用于不同的场景。 | 参数 | 说明 | 类型 | 默认值 | 版本 | | | --- | --- | --- | --- | --- | --- | -| activeKey(v-model) | 当前激活 tab 面板的 key | string | 无 | | | +| activeKey(v-model) | 当前激活 tab 面板的 key | string | - | | | | animated | 是否使用动画切换 Tabs,在 tabPosition=`"top"` \| `"bottom"` 时有效 | boolean \| {inkBar:boolean, tabPane:boolean} | true, 当 type="card" 时为 false | | | centered | 标签居中展示 | boolean | false | 3.0 | | | destroyInactiveTabPane | 被隐藏时是否销毁 DOM 结构 | boolean | false | | | | hideAdd | 是否隐藏加号图标,在 `type="editable-card"` 时有效 | boolean | false | | | | size | 大小,提供 `large` `middle` 和 `small` 三种大小 | string | `middle` | | | -| tabBarGutter | tabs 之间的间隙 | number | 无 | | | +| tabBarGutter | tabs 之间的间隙 | number | - | | | | tabBarStyle | tab bar 的样式对象 | CSSProperties | - | | | | tabPosition | 页签位置,可选值有 `top` `right` `bottom` `left` | string | `top` | | | | type | 页签的基本样式,可选 `line`、`card` `editable-card` 类型 | string | `line` | | | @@ -60,8 +60,8 @@ Ant Design 依次提供了三级选项卡,分别用于不同的场景。 | 参数 | 说明 | 类型 | 默认值 | | ----------- | ------------------------- | ------------ | ------ | | forceRender | 被隐藏时是否渲染 DOM 结构 | boolean | false | -| key | 对应 activeKey | string | 无 | -| tab | 选项卡头显示文字 | string\|slot | 无 | +| key | 对应 activeKey | string | - | +| tab | 选项卡头显示文字 | string\|slot | - | ### Tabs.TabPane 插槽 diff --git a/components/tooltip/index.zh-CN.md b/components/tooltip/index.zh-CN.md index d71e5a8e64..cc4830e442 100644 --- a/components/tooltip/index.zh-CN.md +++ b/components/tooltip/index.zh-CN.md @@ -18,7 +18,7 @@ coverDark: https://mdn.alipayobjects.com/huamei_7uahnr/afts/img/A*gwrhTozoTC4AAA | 参数 | 说明 | 类型 | 默认值 | | ----- | -------- | ------------ | ------ | -| title | 提示文字 | string\|slot | 无 | +| title | 提示文字 | string\|slot | - | ### 共同的 API @@ -26,18 +26,18 @@ coverDark: https://mdn.alipayobjects.com/huamei_7uahnr/afts/img/A*gwrhTozoTC4AAA | 参数 | 说明 | 类型 | 默认值 | 版本 | | --- | --- | --- | --- | --- | -| align | 该值将合并到 placement 的配置中,设置参考 [dom-align](https://github.com/yiminghe/dom-align) | Object | 无 | | +| align | 该值将合并到 placement 的配置中,设置参考 [dom-align](https://github.com/yiminghe/dom-align) | Object | - | | | arrowPointAtCenter | 箭头是否指向目标元素中心 | boolean | `false` | | | arrow | 修改箭头的显示状态以及修改箭头是否指向目标元素中心 | boolean \| { pointAtCenter: boolean} | `true` | 4.2.0 | | autoAdjustOverflow | 气泡被遮挡时自动调整位置 | boolean | `true` | | -| color | 背景颜色 | string | 无 | | +| color | 背景颜色 | string | - | | | destroyTooltipOnHide | 隐藏后是否销毁 tooltip | boolean | false | | | getPopupContainer | 浮层渲染父节点,默认渲染到 body 上 | (triggerNode: HTMLElement) => HTMLElement | () => document.body | | | mouseEnterDelay | 鼠标移入后延时多少才显示 Tooltip,单位:秒 | number | 0.1 | | | mouseLeaveDelay | 鼠标移出后延时多少才隐藏 Tooltip,单位:秒 | number | 0.1 | | -| overlayClassName | 卡片类名 | string | 无 | | -| overlayStyle | 卡片样式 | object | 无 | | -| overlayInnerStyle | 卡片内容区域样式 | object | 无 | 4.0 | +| overlayClassName | 卡片类名 | string | - | | +| overlayStyle | 卡片样式 | object | - | | +| overlayInnerStyle | 卡片内容区域样式 | object | - | 4.0 | | placement | 气泡框位置,可选 `top` `left` `right` `bottom` `topLeft` `topRight` `bottomLeft` `bottomRight` `leftTop` `leftBottom` `rightTop` `rightBottom` | string | top | | | trigger | 触发行为,可选 `hover/focus/click/contextmenu` | string | hover | | | open(v-model) | 用于手动控制浮层显隐, 小于 4.0.0 使用 `visible` | boolean | false | 4.0 | diff --git a/components/upload/index.zh-CN.md b/components/upload/index.zh-CN.md index 5d2f984061..eacdf8b647 100644 --- a/components/upload/index.zh-CN.md +++ b/components/upload/index.zh-CN.md @@ -21,16 +21,16 @@ coverDark: https://mdn.alipayobjects.com/huamei_7uahnr/afts/img/A*l1nlSryXib8AAA | 参数 | 说明 | 类型 | 默认值 | 版本 | | | --- | --- | --- | --- | --- | --- | -| accept | 接受上传的文件类型, 详见 [input accept Attribute](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input/file#accept) | string | 无 | | | -| action | 上传的地址 | string\|(file) => `Promise` | 无 | | | -| beforeUpload | 上传文件之前的钩子,参数为上传的文件,若返回 `false` 则停止上传。支持返回一个 Promise 对象,Promise 对象 reject 时则停止上传,resolve 时开始上传( resolve 传入 `File` 或 `Blob` 对象则上传 resolve 传入对象)。 | (file, fileList) => `boolean` \| `Promise` | 无 | | -| customRequest | 通过覆盖默认的上传行为,可以自定义自己的上传实现 | function | 无 | | | -| data | 上传所需参数或返回上传参数的方法 | object\|(file) => object | 无 | | | +| accept | 接受上传的文件类型, 详见 [input accept Attribute](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input/file#accept) | string | - | | | +| action | 上传的地址 | string\|(file) => `Promise` | - | | | +| 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 | 3.0 | | | disabled | 是否禁用 | boolean | - | | | | downloadIcon | 自定义下载 icon | v-slot:iconRender="{file: UploadFile}" | - | 3.0 | | -| fileList | 已经上传的文件列表(受控) | object\[] | 无 | | | -| headers | 设置上传的请求头部,IE10 以上有效 | object | 无 | | | +| fileList | 已经上传的文件列表(受控) | object\[] | - | | | +| headers | 设置上传的请求头部,IE10 以上有效 | object | - | | | | iconRender | 自定义显示 icon | v-slot:iconRender="{file: UploadFile, listType?: UploadListType}" | - | 3.0 | | | isImageUrl | 自定义缩略图是否使用 <img /> 标签进行显示 | (file: UploadFile) => boolean | - | 3.0 | | | itemRender | 自定义上传列表项 | v-slot:itemRender="{originNode: VNode, file: UploadFile, fileList: object\[], actions: { download: function, preview: function, remove: function }" | - | 3.0 | | @@ -40,7 +40,7 @@ coverDark: https://mdn.alipayobjects.com/huamei_7uahnr/afts/img/A*l1nlSryXib8AAA | multiple | 是否支持多选文件,`ie10+` 支持。开启后按住 ctrl 可选择多个文件。 | boolean | false | | | | name | 发到后台的文件参数名 | string | `file` | | | | openFileDialogOnClick | 点击打开文件对话框 | boolean | true | 3.0 | | -| previewFile | 自定义文件预览逻辑 | (file: File \| Blob) => Promise<dataURL: string> | 无 | 1.5.0 | | +| previewFile | 自定义文件预览逻辑 | (file: File \| Blob) => Promise<dataURL: string> | - | 1.5.0 | | | previewIcon | 自定义预览 icon | v-slot:iconRender="{file: UploadFile}" | - | 3.0 | | | progress | 自定义进度条样式 | [ProgressProps](/components/progress/#api)(仅支持 `type="line"`) | { strokeWidth: 2, showInfo: false } | 3.0 | | | removeIcon | 自定义删除 icon | v-slot:iconRender="{file: UploadFile}" | - | 3.0 | | @@ -52,11 +52,11 @@ coverDark: https://mdn.alipayobjects.com/huamei_7uahnr/afts/img/A*l1nlSryXib8AAA | 事件名称 | 说明 | 回调参数 | 版本 | | | --- | --- | --- | --- | --- | -| change | 上传文件改变时的状态,详见 [change](#change) | function | 无 | | +| change | 上传文件改变时的状态,详见 [change](#change) | function | - | | | download | 点击下载文件时的回调,如果没有指定,则默认跳转到文件 url 对应的标签页。 | function(file): void | 跳转新标签页 | 1.5.0 | | drop | 当文件被拖入上传区域时执行的回调功能 | (event: DragEvent) => void | - | 3.0 | -| preview | 点击文件链接或预览图标时的回调 | function(file) | 无 | | -| reject | 拖拽文件不符合 accept 类型时的回调 | function(fileList) | 无 | | +| preview | 点击文件链接或预览图标时的回调 | function(file) | - | | +| reject | 拖拽文件不符合 accept 类型时的回调 | function(fileList) | - | | | remove   | 点击移除文件时的回调,返回值为 false 时不移除。支持返回一个 Promise 对象,Promise 对象 resolve(false) 或 reject 时不移除 | function(file): boolean \| Promise | -   | 3.0 | ### UploadFile From 4b7c6ac02cafb4ffb83cb991f797f60a290d8a62 Mon Sep 17 00:00:00 2001 From: trry-hub <67309192+trry-hub@users.noreply.github.com> Date: Mon, 10 Jun 2024 09:14:27 +0800 Subject: [PATCH 03/36] feat: TourStep support fn children (#7628) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * Fix: [修复自定义按钮无渲染] * refactor(完善 Tour 自定义按钮代码健壮性): 🦄 --------- Co-authored-by: shizhu --- components/tour/panelRender.tsx | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/components/tour/panelRender.tsx b/components/tour/panelRender.tsx index 105a0dffd7..b245ed4357 100644 --- a/components/tour/panelRender.tsx +++ b/components/tour/panelRender.tsx @@ -1,5 +1,6 @@ import { computed, defineComponent, toRefs } from 'vue'; import classNames from '../_util/classNames'; +import { isFunction } from '../_util/util'; import CloseOutlined from '@ant-design/icons-vue/CloseOutlined'; import { tourStepProps } from './interface'; import type { TourBtnProps } from './interface'; @@ -119,7 +120,9 @@ const panelRender = defineComponent({ size="small" class={classNames(`${prefixCls}-prev-btn`, prevButtonProps?.className)} > - {prevButtonProps?.children ?? contextLocale.Previous} + {isFunction(prevButtonProps?.children) + ? prevButtonProps.children() + : prevButtonProps?.children ?? contextLocale.Previous} ) : null} From 4492086aac8dfc419b957b1c98ae3885ca8c2b6e Mon Sep 17 00:00:00 2001 From: tangjinzhou <415800467@qq.com> Date: Mon, 10 Jun 2024 09:20:15 +0800 Subject: [PATCH 04/36] release 4.2.3 --- CHANGELOG.en-US.md | 5 +++++ CHANGELOG.zh-CN.md | 5 +++++ package.json | 2 +- 3 files changed, 11 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.en-US.md b/CHANGELOG.en-US.md index e955042384..48c78706e3 100644 --- a/CHANGELOG.en-US.md +++ b/CHANGELOG.en-US.md @@ -10,6 +10,11 @@ --- +## 4.2.3 + +- 🌟 TourStep 自定义 Button,支持函数 children [#7628](https://github.com/vueComponent/ant-design-vue/pull/7628) +- 🐞 修复 Select 和 Cascader 搜索多选模式下,输入值被隐藏问题 [#7640](https://github.com/vueComponent/ant-design-vue/issues/7640) + ## 4.2.2 - 🐞 Fix TreeSelect placeholder slot invalid [#7545](https://github.com/vueComponent/ant-design-vue/issues/7545) diff --git a/CHANGELOG.zh-CN.md b/CHANGELOG.zh-CN.md index f4f51e14b9..8726b7caa6 100644 --- a/CHANGELOG.zh-CN.md +++ b/CHANGELOG.zh-CN.md @@ -10,6 +10,11 @@ --- +## 4.2.3 + +- 🌟 TourStep 自定义 Button,支持函数 children [#7628](https://github.com/vueComponent/ant-design-vue/pull/7628) +- 🐞 修复 Select 和 Cascader 搜索多选模式下,输入值被隐藏问题 [#7640](https://github.com/vueComponent/ant-design-vue/issues/7640) + ## 4.2.2 - 🐞 修复 TreeSelect placeholder 插槽无效 [#7545](https://github.com/vueComponent/ant-design-vue/issues/7545) diff --git a/package.json b/package.json index b4692587cc..a73b78c243 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "ant-design-vue", - "version": "4.2.2", + "version": "4.2.3", "title": "Ant Design Vue", "description": "An enterprise-class UI design language and Vue-based implementation", "keywords": [ From 35d518563480c0700a371df362a0508060ae6363 Mon Sep 17 00:00:00 2001 From: tangjinzhou <415800467@qq.com> Date: Mon, 10 Jun 2024 09:37:38 +0800 Subject: [PATCH 05/36] docs: update changelog --- CHANGELOG.en-US.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.en-US.md b/CHANGELOG.en-US.md index 48c78706e3..1759fad161 100644 --- a/CHANGELOG.en-US.md +++ b/CHANGELOG.en-US.md @@ -12,8 +12,8 @@ ## 4.2.3 -- 🌟 TourStep 自定义 Button,支持函数 children [#7628](https://github.com/vueComponent/ant-design-vue/pull/7628) -- 🐞 修复 Select 和 Cascader 搜索多选模式下,输入值被隐藏问题 [#7640](https://github.com/vueComponent/ant-design-vue/issues/7640) +- 🌟 TourStep custom Button, support function children [#7628](https://github.com/vueComponent/ant-design-vue/pull/7628) +- 🐞 Fix the problem that the input value is hidden in Select and Cascader search multi-select mode [#7640](https://github.com/vueComponent/ant-design-vue/issues/7640) ## 4.2.2 From 2666cb79abf9825872e37b55d6d9d4c1cf30e62a Mon Sep 17 00:00:00 2001 From: tangjinzhou <415800467@qq.com> Date: Fri, 21 Jun 2024 13:40:28 +0800 Subject: [PATCH 06/36] refactor: transition --- components/_util/transition.tsx | 6 ++---- components/alert/index.tsx | 4 ++-- components/badge/Badge.tsx | 4 ++-- components/button/LoadingIcon.tsx | 3 +-- components/collapse/CollapsePanel.tsx | 3 +-- components/float-button/BackTop.tsx | 3 ++- components/float-button/FloatButtonGroup.tsx | 4 ++-- components/menu/src/InlineSubMenuList.tsx | 3 +-- components/upload/UploadList/ListItem.tsx | 12 ++++++++++-- components/upload/UploadList/index.tsx | 3 ++- components/vc-dialog/Content.tsx | 4 ++-- components/vc-dialog/Mask.tsx | 4 ++-- 12 files changed, 29 insertions(+), 24 deletions(-) diff --git a/components/_util/transition.tsx b/components/_util/transition.tsx index fd6ebc4904..f4b69f31ed 100644 --- a/components/_util/transition.tsx +++ b/components/_util/transition.tsx @@ -5,7 +5,7 @@ import type { TransitionGroupProps, TransitionProps, } from 'vue'; -import { nextTick, Transition, TransitionGroup } from 'vue'; +import { nextTick } from 'vue'; import { tuple } from './type'; const SelectPlacements = tuple('bottomLeft', 'bottomRight', 'topLeft', 'topRight'); @@ -126,6 +126,4 @@ const getTransitionName = (rootPrefixCls: string, motion: string, transitionName return `${rootPrefixCls}-${motion}`; }; -export { Transition, TransitionGroup, collapseMotion, getTransitionName, getTransitionDirection }; - -export default Transition; +export { collapseMotion, getTransitionName, getTransitionDirection }; diff --git a/components/alert/index.tsx b/components/alert/index.tsx index 63a61aa6e0..f3dead2ba5 100644 --- a/components/alert/index.tsx +++ b/components/alert/index.tsx @@ -1,5 +1,5 @@ import type { CSSProperties, ExtractPropTypes, PropType } from 'vue'; -import { computed, defineComponent, shallowRef } from 'vue'; +import { computed, defineComponent, shallowRef, Transition } from 'vue'; import CloseOutlined from '@ant-design/icons-vue/CloseOutlined'; import CheckCircleOutlined from '@ant-design/icons-vue/CheckCircleOutlined'; import ExclamationCircleOutlined from '@ant-design/icons-vue/ExclamationCircleOutlined'; @@ -11,7 +11,7 @@ import InfoCircleFilled from '@ant-design/icons-vue/InfoCircleFilled'; import CloseCircleFilled from '@ant-design/icons-vue/CloseCircleFilled'; import classNames from '../_util/classNames'; import PropTypes from '../_util/vue-types'; -import { getTransitionProps, Transition } from '../_util/transition'; +import { getTransitionProps } from '../_util/transition'; import { isValidElement } from '../_util/props-util'; import { tuple, withInstall } from '../_util/type'; import { cloneElement } from '../_util/vnode'; diff --git a/components/badge/Badge.tsx b/components/badge/Badge.tsx index 30195d049b..a0363732f4 100644 --- a/components/badge/Badge.tsx +++ b/components/badge/Badge.tsx @@ -3,9 +3,9 @@ import ScrollNumber from './ScrollNumber'; import classNames from '../_util/classNames'; import { getPropsSlot, flattenChildren } from '../_util/props-util'; import { cloneElement } from '../_util/vnode'; -import { getTransitionProps, Transition } from '../_util/transition'; +import { getTransitionProps } from '../_util/transition'; import type { ExtractPropTypes, CSSProperties, PropType } from 'vue'; -import { defineComponent, computed, ref, watch } from 'vue'; +import { defineComponent, computed, ref, watch, Transition } from 'vue'; import Ribbon from './Ribbon'; import useConfigInject from '../config-provider/hooks/useConfigInject'; import isNumeric from '../_util/isNumeric'; diff --git a/components/button/LoadingIcon.tsx b/components/button/LoadingIcon.tsx index 391527fd45..f865e09078 100644 --- a/components/button/LoadingIcon.tsx +++ b/components/button/LoadingIcon.tsx @@ -1,6 +1,5 @@ -import { defineComponent, nextTick } from 'vue'; +import { defineComponent, nextTick, Transition } from 'vue'; import LoadingOutlined from '@ant-design/icons-vue/LoadingOutlined'; -import Transition from '../_util/transition'; const getCollapsedWidth = (node: HTMLSpanElement) => { if (node) { node.style.width = '0px'; diff --git a/components/collapse/CollapsePanel.tsx b/components/collapse/CollapsePanel.tsx index 4ff984dd74..95af0ec645 100644 --- a/components/collapse/CollapsePanel.tsx +++ b/components/collapse/CollapsePanel.tsx @@ -2,8 +2,7 @@ import PanelContent from './PanelContent'; import { initDefaultProps } from '../_util/props-util'; import { collapsePanelProps } from './commonProps'; import type { ExtractPropTypes } from 'vue'; -import { defineComponent } from 'vue'; -import Transition from '../_util/transition'; +import { defineComponent, Transition } from 'vue'; import classNames from '../_util/classNames'; import devWarning from '../vc-util/devWarning'; import useConfigInject from '../config-provider/hooks/useConfigInject'; diff --git a/components/float-button/BackTop.tsx b/components/float-button/BackTop.tsx index 6baa6daad4..7229059752 100644 --- a/components/float-button/BackTop.tsx +++ b/components/float-button/BackTop.tsx @@ -1,5 +1,5 @@ import VerticalAlignTopOutlined from '@ant-design/icons-vue/VerticalAlignTopOutlined'; -import { getTransitionProps, Transition } from '../_util/transition'; +import { getTransitionProps } from '../_util/transition'; import { defineComponent, nextTick, @@ -10,6 +10,7 @@ import { ref, watch, onDeactivated, + Transition, } from 'vue'; import FloatButton, { floatButtonPrefixCls } from './FloatButton'; import useConfigInject from '../config-provider/hooks/useConfigInject'; diff --git a/components/float-button/FloatButtonGroup.tsx b/components/float-button/FloatButtonGroup.tsx index 743d60e5ad..611646299d 100644 --- a/components/float-button/FloatButtonGroup.tsx +++ b/components/float-button/FloatButtonGroup.tsx @@ -1,8 +1,8 @@ -import { defineComponent, ref, computed, watch, onBeforeUnmount } from 'vue'; +import { defineComponent, ref, computed, watch, onBeforeUnmount, Transition } from 'vue'; import CloseOutlined from '@ant-design/icons-vue/CloseOutlined'; import FileTextOutlined from '@ant-design/icons-vue/FileTextOutlined'; import classNames from '../_util/classNames'; -import { getTransitionProps, Transition } from '../_util/transition'; +import { getTransitionProps } from '../_util/transition'; import FloatButton, { floatButtonPrefixCls } from './FloatButton'; import useConfigInject from '../config-provider/hooks/useConfigInject'; import { useProvideFloatButtonGroupContext } from './context'; diff --git a/components/menu/src/InlineSubMenuList.tsx b/components/menu/src/InlineSubMenuList.tsx index 29794e8be9..7b9cb1f33b 100644 --- a/components/menu/src/InlineSubMenuList.tsx +++ b/components/menu/src/InlineSubMenuList.tsx @@ -1,5 +1,4 @@ -import { computed, defineComponent, ref, watch } from 'vue'; -import Transition from '../../_util/transition'; +import { computed, Transition, defineComponent, ref, watch } from 'vue'; import { useInjectMenu, MenuContextProvider } from './hooks/useMenuContext'; import type { MenuMode } from './interface'; import SubMenuList from './SubMenuList'; diff --git a/components/upload/UploadList/ListItem.tsx b/components/upload/UploadList/ListItem.tsx index b7fcc2223f..d0dfb6afc3 100644 --- a/components/upload/UploadList/ListItem.tsx +++ b/components/upload/UploadList/ListItem.tsx @@ -1,4 +1,12 @@ -import { computed, defineComponent, onBeforeUnmount, onMounted, shallowRef, watch } from 'vue'; +import { + computed, + defineComponent, + onBeforeUnmount, + onMounted, + shallowRef, + watch, + Transition, +} from 'vue'; import type { ExtractPropTypes, CSSProperties } from 'vue'; import EyeOutlined from '@ant-design/icons-vue/EyeOutlined'; import DeleteOutlined from '@ant-design/icons-vue/DeleteOutlined'; @@ -15,7 +23,7 @@ import type { } from '../interface'; import type { VueNode } from '../../_util/type'; import useConfigInject from '../../config-provider/hooks/useConfigInject'; -import Transition, { getTransitionProps } from '../../_util/transition'; +import { getTransitionProps } from '../../_util/transition'; import { booleanType, stringType, functionType, arrayType, objectType } from '../../_util/type'; export const listItemProps = () => { diff --git a/components/upload/UploadList/index.tsx b/components/upload/UploadList/index.tsx index 25c58c50f8..ffb89a4b94 100644 --- a/components/upload/UploadList/index.tsx +++ b/components/upload/UploadList/index.tsx @@ -17,11 +17,12 @@ import { onMounted, shallowRef, watchEffect, + TransitionGroup, } from 'vue'; import { filterEmpty, initDefaultProps, isValidElement } from '../../_util/props-util'; import type { VueNode } from '../../_util/type'; import useConfigInject from '../../config-provider/hooks/useConfigInject'; -import { getTransitionGroupProps, TransitionGroup } from '../../_util/transition'; +import { getTransitionGroupProps } from '../../_util/transition'; import collapseMotion from '../../_util/collapseMotion'; const HackSlot = (_, { slots }) => { diff --git a/components/vc-dialog/Content.tsx b/components/vc-dialog/Content.tsx index 6cfa6ee27d..82ecda5c1e 100644 --- a/components/vc-dialog/Content.tsx +++ b/components/vc-dialog/Content.tsx @@ -1,7 +1,7 @@ import type { CSSProperties, PropType } from 'vue'; -import { computed, ref, defineComponent, nextTick } from 'vue'; +import { Transition, computed, ref, defineComponent, nextTick } from 'vue'; import type { MouseEventHandler } from '../_util/EventInterface'; -import Transition, { getTransitionProps } from '../_util/transition'; +import { getTransitionProps } from '../_util/transition'; import dialogPropTypes from './IDialogPropTypes'; import { offset } from './util'; const sentinelStyle = { width: 0, height: 0, overflow: 'hidden', outline: 'none' }; diff --git a/components/vc-dialog/Mask.tsx b/components/vc-dialog/Mask.tsx index 7ec2ced2d0..f9b5469442 100644 --- a/components/vc-dialog/Mask.tsx +++ b/components/vc-dialog/Mask.tsx @@ -1,5 +1,5 @@ -import { defineComponent } from 'vue'; -import Transition, { getTransitionProps } from '../_util/transition'; +import { defineComponent, Transition } from 'vue'; +import { getTransitionProps } from '../_util/transition'; export default defineComponent({ compatConfig: { MODE: 3 }, From c69a6d29b21dae52116ef6d734d0929cb591be50 Mon Sep 17 00:00:00 2001 From: Jason Ren <40999116+jasonren0403@users.noreply.github.com> Date: Thu, 5 Sep 2024 11:37:36 +0800 Subject: [PATCH 07/36] docs(zh-cn): finish translation of float-button (#7811) --- components/float-button/index.zh-CN.md | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/components/float-button/index.zh-CN.md b/components/float-button/index.zh-CN.md index 589c658653..284cd6842b 100644 --- a/components/float-button/index.zh-CN.md +++ b/components/float-button/index.zh-CN.md @@ -33,11 +33,11 @@ tag: New | target | 相当于 a 标签的 target 属性,href 存在时生效 | string | - | | | badge | 带徽标数字的悬浮按钮(不支持 status 以及相关属性) | [BadgeProps](/components/badge-cn#api) | - | | -### common events +### 共同的事件 -| 事件名称 | 说明 | 回调参数 | 版本 | -| -------- | --------------------------------------- | ----------------- | ---- | -| click | Set the handler to handle `click` event | `(event) => void` | - | +| 事件名称 | 说明 | 回调参数 | 版本 | +| -------- | ----------------------------- | ----------------- | ---- | +| click | 设置处理 `click` 事件的处理器 | `(event) => void` | - | ### FloatButton.Group @@ -47,7 +47,7 @@ tag: New | trigger | 触发方式(有触发方式为菜单模式) | `click` \| `hover` | - | | | open(v-model) | 受控展开 | boolean | - | | -### FloatButton.Group Events +### FloatButton.Group 事件 | 事件名称 | 说明 | 回调参数 | 版本 | | ---------- | ---------------- | ----------------------- | ---- | From 89eec071455c181102c17a11d90f4b3cd802d955 Mon Sep 17 00:00:00 2001 From: 5918vo <146824980+5918vo@users.noreply.github.com> Date: Thu, 5 Sep 2024 11:38:10 +0800 Subject: [PATCH 08/36] docs: event demo (#7699) (#7728) --- components/slider/demo/event.vue | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/components/slider/demo/event.vue b/components/slider/demo/event.vue index a1733cb72a..67b1f5df3a 100644 --- a/components/slider/demo/event.vue +++ b/components/slider/demo/event.vue @@ -17,8 +17,8 @@ The `onChange` callback function will fire when the user changes the slider's va