diff --git a/CHANGELOG.en-US.md b/CHANGELOG.en-US.md
index f67b6c48486..f6f9f7912ad 100644
--- a/CHANGELOG.en-US.md
+++ b/CHANGELOG.en-US.md
@@ -1,12 +1,13 @@
# CHANGELOG
-## NEXT_VERSION
+## 2.43.2
### Fixes
- Fix seemly dependency version range allows incompatible versions.
- Fix `n-progress` style is incorrect after using the dashboard mode exceeding 100%, closes [#6627](https://github.com/tusen-ai/naive-ui/issues/6627)
- Fix `n-modal`'s outside content can't be interacted with `show-mask` is set to `false`.
+- Fix `n-date-picker`'s shortcut button misfires the click event, closes [#7315](https://github.com/tusen-ai/naive-ui/issues/7315)
### Feats
diff --git a/CHANGELOG.zh-CN.md b/CHANGELOG.zh-CN.md
index 2d9976d2a57..b4f8c5e7ece 100644
--- a/CHANGELOG.zh-CN.md
+++ b/CHANGELOG.zh-CN.md
@@ -1,12 +1,13 @@
# CHANGELOG
-## NEXT_VERSION
+## 2.43.2
### Fixes
- 修复 seemly 依赖的版本未更新到最新
- 修复 `n-progress` 使用仪表盘模式超过 100% 之后样式不正确,关闭 [#6627](https://github.com/tusen-ai/naive-ui/issues/6627)
- 修复 `n-modal` 在 `show-mask` 为 `false` 的情况下,外部内容不能被操作
+- 修复 `n-date-picker` 的快捷按钮在点击后误触发的问题,关闭 [#7315](https://github.com/tusen-ai/naive-ui/issues/7315)
### Feats
diff --git a/index.html b/index.html
index 6484b24042e..4fbc4546cb7 100644
--- a/index.html
+++ b/index.html
@@ -1,6 +1,20 @@
-
+
+
+
+
# 配合 Popover 的特殊情况
-原生的 disabled 的 button 不会触发鼠标,因此 `n-popover` 无法监听到相关的事件。如果你需要在这种情况下使用,可以使用 `tag` 属性来调整 button 的行为。
+disabled 的原生 button 不会触发部分鼠标事件,因此 `n-popover` 无法监听到相关的事件。如果你需要在这种情况下使用,可以使用 `tag` 属性来调整 button 的行为。
diff --git a/src/button/src/styles/index.cssr.ts b/src/button/src/styles/index.cssr.ts
index 804ab429d4e..d40275bf324 100644
--- a/src/button/src/styles/index.cssr.ts
+++ b/src/button/src/styles/index.cssr.ts
@@ -175,14 +175,14 @@ export default c([
transition: border-color .3s var(--n-bezier);
pointer-events: none;
`),
- cE('border', {
- border: 'var(--n-border)'
- }),
- cE('state-border', {
- border: 'var(--n-border)',
- borderColor: '#0000',
- zIndex: 1
- }),
+ cE('border', `
+ border: var(--n-border);
+ `),
+ cE('state-border', `
+ border: var(--n-border);
+ border-color: #0000;
+ z-index: 1;
+ `),
cE('icon', `
margin: var(--n-icon-margin);
margin-left: 0;
diff --git a/src/config-provider/demos/enUS/index.demo-entry.md b/src/config-provider/demos/enUS/index.demo-entry.md
index 2624b15e007..a18903645d0 100644
--- a/src/config-provider/demos/enUS/index.demo-entry.md
+++ b/src/config-provider/demos/enUS/index.demo-entry.md
@@ -23,7 +23,7 @@ inline-theme-disabled.vue
| Name | Type | Default | Description | Version |
| --- | --- | --- | --- | --- |
| abstract | `boolean` | `false` | If `n-config-provider` has no wrapper DOM | |
-| breakpoints | `{ [k: string]: number }` | `{ xs: 0, s: 640, m: 1024, l: 1280, xl: 1536, xxl: 1920 }` | Responsive breakpoints, it will be used in `n-grid`. The prop is not responsive, you need to set it on its first mount. | |
+| breakpoints | `{ [k: string]: number }` | `{ xs: <640, s: ≥640, m: ≥1024, l: ≥1280, xl: ≥1536, xxl: ≥1920 }` | Responsive breakpoints, it will be used in `n-grid`. The prop is not responsive, you need to set it on its first mount. | |
| cls-prefix | `string` | `undefined` | The class prefix of all inner components. (Since `2.40.0`) If you don't set the `cls-prefix` prop of `n-config-provider`, it will inherit the class prefix from its parent by default. Note that this prop is not reactive. | |
| date-locale | `DateLocale \| null` | `undefined` | The date locale object to be consumed by its child. If set to `null` it will use the default `dateEnUS` locale. If set to `undefined` it will inherit its parent `n-config-provider`. | |
| inline-theme-disabled | `boolean` | `false` | Whether to disabled inline theme CSS variables. If you won't change theme overrides frequently in client side, and need SSR or make devtools looks clear. You can enable the prop. Note that the prop is not responsive. | 2.26.0 |
diff --git a/src/config-provider/demos/zhCN/index.demo-entry.md b/src/config-provider/demos/zhCN/index.demo-entry.md
index 31c3d70fcfe..b7d894dc12a 100644
--- a/src/config-provider/demos/zhCN/index.demo-entry.md
+++ b/src/config-provider/demos/zhCN/index.demo-entry.md
@@ -23,7 +23,7 @@ inline-theme-disabled.vue
| 名称 | 类型 | 默认值 | 说明 | 版本 |
| --- | --- | --- | --- | --- |
| abstract | `boolean` | `false` | 是否不存在 DOM 包裹 | |
-| breakpoints | `{ [k: string]: number }` | `{ xs: 0, s: 640, m: 1024, l: 1280, xl: 1536, xxl: 1920 }` | 屏幕响应式断点,对 `n-grid` 生效。这个属性不是响应式的,你需要在组件第一次挂载时就设定好 | |
+| breakpoints | `{ [k: string]: number }` | `{ xs: <640, s: ≥640, m: ≥1024, l: ≥1280, xl: ≥1536, xxl: ≥1920 }` | 屏幕响应式断点,对 `n-grid` 生效。这个属性不是响应式的,你需要在组件第一次挂载时就设定好 | |
| cls-prefix | `string` | `undefined` | 内部所有组件的类的前缀。(从 `2.40.0` 开始)如果不设置 `n-config-provider` 的类前缀 `cls-prefix`,则默认继承父级的类前缀。注意,该属性不是响应式的。 | |
| date-locale | `DateLocale \| null` | `undefined` | 对后代组件生效的日期语言对象,为 `null` 时会使用默认 `dateEnUS`,为 `undefined` 时会继承上级 `n-config-provider` | |
| inline-theme-disabled | `boolean` | `false` | 是否禁用 inline css 主题变量,如果你不会频繁调整主题变量,并且需要 SSR 或者想让 devtools 看起来更干净,可以打开这个选项。注意,这个属性不是响应式的 | 2.26.0 |
diff --git a/src/date-picker/demos/enUS/index.demo-entry.md b/src/date-picker/demos/enUS/index.demo-entry.md
index 2d97dff2e97..e68abac9d7f 100644
--- a/src/date-picker/demos/enUS/index.demo-entry.md
+++ b/src/date-picker/demos/enUS/index.demo-entry.md
@@ -94,7 +94,7 @@ panel.vue
| --- | --- | --- | --- | --- |
| actions | `Array<'clear' \| 'now' \| 'confirm'> \| null` | `['clear', 'now', 'confirm']` | Operations supported for the `datetime` type date picker. | |
| default-calendar-start-time | `number` | `undefined` | Default panel calendar start month timestamp. | 2.38.1 |
-| default-time | `string \| (timestamp: number) => string` | `undefined` | Default time of the selected date. Can accept a function with a timestamp argument that returns a formatted string. It's format is `HH:mm:ss`. | 2.22.0, functional since NEXT_VERSION |
+| default-time | `string \| (timestamp: number) => string` | `undefined` | Default time of the selected date. Can accept a function with a timestamp argument that returns a formatted string. It's format is `HH:mm:ss`. | 2.22.0, functional since 2.43.2 |
| format | `string` | `'yyyy-MM-dd HH:mm:ss'` | Format of the input. For detail please see [format](https://date-fns.org/v2.23.0/docs/format). | |
| is-date-disabled | `(current: number, detail: { type: 'date', year: number, month: number, date: number } \| { type: 'month', year: number, month: number } \| { type: 'year', year: number } \| { type: 'quarter', year: number, quarter: number } \| { type: 'input' }) => boolean` | `() => false` | Validator of the date. | `detail` 2.37.1 |
| is-time-disabled | `(current: number) => { isHourDisabled?: () => boolean, isMinuteDisabled?: () => boolean, isSecondDisabled?: () => boolean }` | `undefined` | Validator of the time. | |
@@ -131,7 +131,7 @@ panel.vue
| bind-calendar-months | `boolean` | `false` | Whether months in panel calendar are consecutive. | 2.28.3 |
| default-calendar-start-time | `number` | `undefined` | Default panel calendar start month timestamp. | 2.28.3 |
| default-calendar-end-time | `number` | `undefined` | Default panel calendar end month timestamp. | 2.28.3 |
-| default-time | `string \| Array \| (timestamp: number, position: "start" \| "end", value: [number, number] \| null) => string` | `undefined` | Default time of the selected date. Can accept a function with timestamp, position and value arguments that returns a formatted string. It's format is `HH:mm:ss`. | 2.22.0, functional since NEXT_VERSION |
+| default-time | `string \| Array \| (timestamp: number, position: "start" \| "end", value: [number, number] \| null) => string` | `undefined` | Default time of the selected date. Can accept a function with timestamp, position and value arguments that returns a formatted string. It's format is `HH:mm:ss`. | 2.22.0, functional since 2.43.2 |
| end-placeholder | `string` | `'End Date and Time'` | Placeholder at end part of the input. | |
| format | `string` | `'yyyy-MM-dd HH:mm:ss'` | Format of the input. For detail please see [format](https://date-fns.org/v2.23.0/docs/format). | |
| is-date-disabled | `(current: number, phase: 'start' \| 'end', value: [number, number] \| null) => boolean` | `undefined` | Validator of the date. | |
diff --git a/src/date-picker/demos/zhCN/index.demo-entry.md b/src/date-picker/demos/zhCN/index.demo-entry.md
index 47de63e9fd6..f79200a5e99 100644
--- a/src/date-picker/demos/zhCN/index.demo-entry.md
+++ b/src/date-picker/demos/zhCN/index.demo-entry.md
@@ -95,7 +95,7 @@ form-debug.vue
| --- | --- | --- | --- | --- |
| actions | `Array<'clear' \| 'now' \| 'confirm'> \| null` | `['clear', 'now', 'confirm']` | DateTime 类型的 Date Picker 中支持的操作 | |
| default-calendar-start-time | `number` | `undefined` | 面板日历默认开始的月份时间戳 | 2.38.1 |
-| default-time | `string \| (timestamp: number) => string` | `undefined` | 默认时间,可以接受一个参数为时间戳的函数,返回格式化的字符串,格式为 `HH:mm:ss` | 2.22.0,从 NEXT_VERSION 支持函数 |
+| default-time | `string \| (timestamp: number) => string` | `undefined` | 默认时间,可以接受一个参数为时间戳的函数,返回格式化的字符串,格式为 `HH:mm:ss` | 2.22.0,从 2.43.2 支持函数 |
| format | `string` | `'yyyy-MM-dd HH:mm:ss'` | 时间格式化字符串,详情见 [format](https://date-fns.org/v2.23.0/docs/format) | |
| is-date-disabled | `(current: number, detail: { type: 'date', year: number, month: number, date: number } \| { type: 'month', year: number, month: number } \| { type: 'year', year: number } \| { type: 'quarter', year: number, quarter: number } \| { type: 'input' }) => boolean` | `undefined` | 日期禁用的校验函数 | `detail` 2.37.1 |
| is-time-disabled | `(current: number) => { isHourDisabled: boolean, isMinuteDisabled: boolean, isSecondDisabled: boolean }` | `undefined` | 时间禁用的校验函数 | |
@@ -131,7 +131,7 @@ form-debug.vue
| bind-calendar-months | `boolean` | `false` | 面板月份是否连续 | 2.28.3 |
| default-calendar-start-time | `number` | `undefined` | 面板日历默认开始的月份时间戳 | 2.28.3 |
| default-calendar-end-time | `number` | `undefined` | 面板日历默认结束的月份时间戳 | 2.28.3 |
-| default-time | `string \| Array \| (timestamp: number, position: "start" \| "end", value: [number, number] \| null) => string` | `undefined` | 默认时间,可以接受一个参数为时间戳、时间位置、和当前值的函数,返回一个格式化字符串,格式为 `HH:mm:ss` | 2.22.0,从 NEXT_VERSION 支持函数 |
+| default-time | `string \| Array \| (timestamp: number, position: "start" \| "end", value: [number, number] \| null) => string` | `undefined` | 默认时间,可以接受一个参数为时间戳、时间位置、和当前值的函数,返回一个格式化字符串,格式为 `HH:mm:ss` | 2.22.0,从 2.43.2 支持函数 |
| end-placeholder | `string` | `'结束日期时间'` | DateTimeRange 中 end 选框的提示信息 | |
| format | `string` | `'yyyy-MM-dd HH:mm:ss'` | 时间格式化字符串,详情见 [format](https://date-fns.org/v2.23.0/docs/format) | |
| is-date-disabled | `(current: number, phase: 'start' \| 'end', value: [number, number] \| null) => boolean` | `undefined` | 日期禁用的校验函数 | |
diff --git a/src/date-picker/src/panel/use-calendar.ts b/src/date-picker/src/panel/use-calendar.ts
index 3873180a909..738d928983b 100644
--- a/src/date-picker/src/panel/use-calendar.ts
+++ b/src/date-picker/src/panel/use-calendar.ts
@@ -506,6 +506,8 @@ function useCalendar(
panelCommon.doUpdateValue(value, props.panel)
}
function handleSingleShortcutMouseenter(shortcut: Shortcuts[string]): void {
+ if (panelCommon.isShortcutClickInProgressRef.value)
+ return
panelCommon.cachePendingValue()
const shortcutValue = panelCommon.getShortcutValue(shortcut)
if (typeof shortcutValue !== 'number')
@@ -513,9 +515,12 @@ function useCalendar(
panelCommon.doUpdateValue(shortcutValue, false)
}
function handleSingleShortcutClick(shortcut: Shortcuts[string]): void {
+ panelCommon.isShortcutClickInProgressRef.value = true
const shortcutValue = panelCommon.getShortcutValue(shortcut)
- if (typeof shortcutValue !== 'number')
+ if (typeof shortcutValue !== 'number') {
+ panelCommon.isShortcutClickInProgressRef.value = false
return
+ }
panelCommon.doUpdateValue(shortcutValue, props.panel)
panelCommon.clearPendingValue()
handleConfirmClick()
diff --git a/src/date-picker/src/panel/use-dual-calendar.ts b/src/date-picker/src/panel/use-dual-calendar.ts
index eba2c349806..5983c0c50f1 100644
--- a/src/date-picker/src/panel/use-dual-calendar.ts
+++ b/src/date-picker/src/panel/use-dual-calendar.ts
@@ -733,6 +733,8 @@ function useDualCalendar(
changeEndDateTime(value)
}
function handleRangeShortcutMouseenter(shortcut: Shortcuts[string]): void {
+ if (panelCommon.isShortcutClickInProgressRef.value)
+ return
panelCommon.cachePendingValue()
const shortcutValue = panelCommon.getShortcutValue(shortcut)
if (!Array.isArray(shortcutValue))
@@ -740,9 +742,12 @@ function useDualCalendar(
changeStartEndTime(shortcutValue[0], shortcutValue[1], 'shortcutPreview')
}
function handleRangeShortcutClick(shortcut: Shortcuts[string]): void {
+ panelCommon.isShortcutClickInProgressRef.value = true
const shortcutValue = panelCommon.getShortcutValue(shortcut)
- if (!Array.isArray(shortcutValue))
+ if (!Array.isArray(shortcutValue)) {
+ panelCommon.isShortcutClickInProgressRef.value = false
return
+ }
changeStartEndTime(shortcutValue[0], shortcutValue[1], 'shortcutDone')
panelCommon.clearPendingValue()
handleConfirmClick()
diff --git a/src/date-picker/src/panel/use-panel-common.ts b/src/date-picker/src/panel/use-panel-common.ts
index 32103b1775e..422977c2c33 100644
--- a/src/date-picker/src/panel/use-panel-common.ts
+++ b/src/date-picker/src/panel/use-panel-common.ts
@@ -8,7 +8,7 @@ import type {
Value
} from '../interface'
import { useKeyboard } from 'vooks'
-import { computed, inject, nextTick, ref } from 'vue'
+import { computed, inject, nextTick, ref, watch } from 'vue'
import { datePickerInjectionKey } from '../interface'
const TIME_FORMAT = 'HH:mm:ss'
@@ -165,6 +165,17 @@ function usePanelCommon(props: UsePanelCommonProps) {
function handleOpenQuickSelectMonthPanel(): void {
showMonthYearPanel.value = !showMonthYearPanel.value
}
+
+ const isShortcutClickInProgressRef = ref(false)
+ watch(
+ () => props.active,
+ (show) => {
+ if (!show) {
+ isShortcutClickInProgressRef.value = false
+ }
+ }
+ )
+
return {
mergedTheme: mergedThemeRef,
mergedClsPrefix: mergedClsPrefixRef,
@@ -188,7 +199,8 @@ function usePanelCommon(props: UsePanelCommonProps) {
getShortcutValue,
handleShortcutMouseleave: restorePendingValue,
showMonthYearPanel,
- handleOpenQuickSelectMonthPanel
+ handleOpenQuickSelectMonthPanel,
+ isShortcutClickInProgressRef
}
}
diff --git a/src/dialog/src/styles/index.cssr.ts b/src/dialog/src/styles/index.cssr.ts
index 7a19718af50..3603bca6b62 100644
--- a/src/dialog/src/styles/index.cssr.ts
+++ b/src/dialog/src/styles/index.cssr.ts
@@ -44,33 +44,33 @@ export default c([
background-color .3s var(--n-bezier),
color .3s var(--n-bezier);
`, [
- cE('icon', {
- color: 'var(--n-icon-color)'
- }),
- cM('bordered', {
- border: 'var(--n-border)'
- }),
+ cE('icon', `
+ color: var(--n-icon-color);
+ `),
+ cM('bordered', `
+ border: var(--n-border);
+ `),
cM('icon-top', [
- cE('close', {
- margin: 'var(--n-close-margin)'
- }),
- cE('icon', {
- margin: 'var(--n-icon-margin)'
- }),
- cE('content', {
- textAlign: 'center'
- }),
- cE('title', {
- justifyContent: 'center'
- }),
- cE('action', {
- justifyContent: 'center'
- })
+ cE('close', `
+ margin: var(--n-close-margin);
+ `),
+ cE('icon', `
+ margin: var(--n-icon-margin);
+ `),
+ cE('content', `
+ text-align: center;
+ `),
+ cE('title', `
+ justify-content: center;
+ `),
+ cE('action', `
+ justify-content: center;
+ `)
]),
cM('icon-left', [
- cE('icon', {
- margin: 'var(--n-icon-margin)'
- }),
+ cE('icon', `
+ margin: var(--n-icon-margin);
+ `),
cM('closable', [
cE('title', `
padding-right: calc(var(--n-close-size) + 6px);
diff --git a/src/steps/demos/enUS/index.demo-entry.md b/src/steps/demos/enUS/index.demo-entry.md
index 1794b99b6e6..9e1a7a9641d 100644
--- a/src/steps/demos/enUS/index.demo-entry.md
+++ b/src/steps/demos/enUS/index.demo-entry.md
@@ -22,7 +22,7 @@ click.vue
| Name | Type | Default | Description | Version |
| --- | --- | --- | --- | --- |
-| content-placement | `'right' \| 'bottom'` | `right` | Steps content placement, only can be used in horizontal mode. | NEXT_VERSION |
+| content-placement | `'right' \| 'bottom'` | `right` | Steps content placement, only can be used in horizontal mode. | 2.43.2 |
| current | `number` | `undefined` | Currently active step index. | |
| size | `'small' \| 'medium'` | `'medium'` | Steps size. | |
| status | `'process' \| 'finish' \| 'error' \| 'wait'` | `'process'` | Steps status. | |
diff --git a/src/steps/demos/zhCN/index.demo-entry.md b/src/steps/demos/zhCN/index.demo-entry.md
index 84f88173d3e..86475ee9907 100644
--- a/src/steps/demos/zhCN/index.demo-entry.md
+++ b/src/steps/demos/zhCN/index.demo-entry.md
@@ -24,7 +24,7 @@ rtl-debug.vue
| 名称 | 类型 | 默认值 | 说明 | 版本 |
| --- | --- | --- | --- | --- |
-| content-placement | `'right' \| 'bottom'` | `right` | 步骤条内容位置,仅在横向模式下生效 | NEXT_VERSION |
+| content-placement | `'right' \| 'bottom'` | `right` | 步骤条内容位置,仅在横向模式下生效 | 2.43.2 |
| current | `number` | `undefined` | 当前选中在第几步 | |
| size | `'small' \| 'medium'` | `'medium'` | 步骤条大小 | |
| status | `'process' \| 'finish' \| 'error' \| 'wait'` | `'process'` | 步骤条状态 | |
diff --git a/src/version.ts b/src/version.ts
index 4592402cff1..e047a13fa50 100644
--- a/src/version.ts
+++ b/src/version.ts
@@ -1 +1 @@
-export default '2.43.1'
+export default '2.43.2'
diff --git a/src/virtual-list/demos/enUS/index.demo-entry.md b/src/virtual-list/demos/enUS/index.demo-entry.md
index 2c64dc3f2a8..deccb8e6814 100644
--- a/src/virtual-list/demos/enUS/index.demo-entry.md
+++ b/src/virtual-list/demos/enUS/index.demo-entry.md
@@ -25,7 +25,7 @@ keep-alive.vue
| default-scroll-index | `number` | `undefined` | Default scroll index. | 2.36.0 |
| ignore-item-resize | `boolean` | `false` | Ignore item resize. It can make runtime slightly faster, although it's hard to feel. | 2.36.0 |
| items | `Array