Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion CHANGELOG.en-US.md
Original file line number Diff line number Diff line change
@@ -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

Expand Down
3 changes: 2 additions & 1 deletion CHANGELOG.zh-CN.md
Original file line number Diff line number Diff line change
@@ -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

Expand Down
20 changes: 17 additions & 3 deletions index.html
Original file line number Diff line number Diff line change
@@ -1,6 +1,20 @@
<!DOCTYPE html>
<!doctype html>
<html lang="en">
<head>
<!-- Google tag (gtag.js) -->
<script
async
src="https://www.googletagmanager.com/gtag/js?id=G-15QSS7T6SH"
></script>
<script>
window.dataLayer = window.dataLayer || []
function gtag() {
dataLayer.push(arguments)
}
gtag('js', new Date())

gtag('config', 'G-15QSS7T6SH')
</script>
<meta charset="utf-8" />
<meta
name="viewport"
Expand All @@ -21,8 +35,8 @@
const pathLocale = path.startsWith('/en-US')
? 'en-US'
: path.startsWith('/zh-CN')
? 'zh-CN'
: undefined
? 'zh-CN'
: undefined
function deriveTitleFromLocale(locale = navigator.language) {
if (locale === 'zh-CN') {
document.title = 'Naive UI: 一个 Vue 3 组件库'
Expand Down
7 changes: 5 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "naive-ui",
"version": "2.43.1",
"version": "2.43.2",
"packageManager": "[email protected]",
"description": "A Vue 3 Component Library. Fairly Complete, Theme Customizable, Uses TypeScript, Fast",
"author": "07akioni",
Expand Down Expand Up @@ -149,6 +149,9 @@
"vue-tsc": "^3.0.7"
},
"pnpm": {
"overrides": {
"cssstyle": "5.2.1"
},
"peerDependencyRules": {
"ignoreMissing": [
"@babel/core",
Expand Down Expand Up @@ -183,4 +186,4 @@
"eslint --fix"
]
}
}
}
2 changes: 1 addition & 1 deletion src/button/demos/zhCN/popover.demo.vue
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<markdown>
# 配合 Popover 的特殊情况

原生的 disabled button 不会触发鼠标,因此 `n-popover` 无法监听到相关的事件。如果你需要在这种情况下使用,可以使用 `tag` 属性来调整 button 的行为。
disabled 的原生 button 不会触发部分鼠标事件,因此 `n-popover` 无法监听到相关的事件。如果你需要在这种情况下使用,可以使用 `tag` 属性来调整 button 的行为。
</markdown>

<template>
Expand Down
16 changes: 8 additions & 8 deletions src/button/src/styles/index.cssr.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
2 changes: 1 addition & 1 deletion src/config-provider/demos/enUS/index.demo-entry.md
Original file line number Diff line number Diff line change
Expand Up @@ -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 |
Expand Down
2 changes: 1 addition & 1 deletion src/config-provider/demos/zhCN/index.demo-entry.md
Original file line number Diff line number Diff line change
Expand Up @@ -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 |
Expand Down
4 changes: 2 additions & 2 deletions src/date-picker/demos/enUS/index.demo-entry.md
Original file line number Diff line number Diff line change
Expand Up @@ -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. | |
Expand Down Expand Up @@ -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<string \| undefined> \| (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<string \| undefined> \| (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. | |
Expand Down
4 changes: 2 additions & 2 deletions src/date-picker/demos/zhCN/index.demo-entry.md
Original file line number Diff line number Diff line change
Expand Up @@ -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` | 时间禁用的校验函数 | |
Expand Down Expand Up @@ -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<string \| undefined> \| (timestamp: number, position: "start" \| "end", value: [number, number] \| null) => string` | `undefined` | 默认时间,可以接受一个参数为时间戳、时间位置、和当前值的函数,返回一个格式化字符串,格式为 `HH:mm:ss` | 2.22.0,从 NEXT_VERSION 支持函数 |
| default-time | `string \| Array<string \| undefined> \| (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` | 日期禁用的校验函数 | |
Expand Down
7 changes: 6 additions & 1 deletion src/date-picker/src/panel/use-calendar.ts
Original file line number Diff line number Diff line change
Expand Up @@ -506,16 +506,21 @@ 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')
return
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()
Expand Down
7 changes: 6 additions & 1 deletion src/date-picker/src/panel/use-dual-calendar.ts
Original file line number Diff line number Diff line change
Expand Up @@ -733,16 +733,21 @@ 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))
return
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()
Expand Down
16 changes: 14 additions & 2 deletions src/date-picker/src/panel/use-panel-common.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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'
Expand Down Expand Up @@ -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,
Expand All @@ -188,7 +199,8 @@ function usePanelCommon(props: UsePanelCommonProps) {
getShortcutValue,
handleShortcutMouseleave: restorePendingValue,
showMonthYearPanel,
handleOpenQuickSelectMonthPanel
handleOpenQuickSelectMonthPanel,
isShortcutClickInProgressRef
}
}

Expand Down
48 changes: 24 additions & 24 deletions src/dialog/src/styles/index.cssr.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
2 changes: 1 addition & 1 deletion src/steps/demos/enUS/index.demo-entry.md
Original file line number Diff line number Diff line change
Expand Up @@ -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. | |
Expand Down
2 changes: 1 addition & 1 deletion src/steps/demos/zhCN/index.demo-entry.md
Original file line number Diff line number Diff line change
Expand Up @@ -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'` | 步骤条状态 | |
Expand Down
2 changes: 1 addition & 1 deletion src/version.ts
Original file line number Diff line number Diff line change
@@ -1 +1 @@
export default '2.43.1'
export default '2.43.2'
2 changes: 1 addition & 1 deletion src/virtual-list/demos/enUS/index.demo-entry.md
Original file line number Diff line number Diff line change
Expand Up @@ -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<object>` | `[]` | Data to display. | 2.36.0 |
| item-resizable | `number` | `false` | Whether dynamic sizing is enabled, you don't have to care about the size of the item, it will be calculated automatically. | 2.36.0 |
| item-resizable | `boolean` | `false` | Whether dynamic sizing is enabled, you don't have to care about the size of the item, it will be calculated automatically. | 2.36.0 |
| item-size | `number` | required | Displays the minimum height of the item in pixels to calculate scroll size and position. | 2.36.0 |
| items-style | `string \| CSSProperties` | `undefined` | Items container style. | 2.36.0 |
| key-field | `string` | `'key'` | Field name of option key. | 2.36.0 |
Expand Down
2 changes: 1 addition & 1 deletion src/virtual-list/demos/zhCN/index.demo-entry.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ keep-alive.vue
| default-scroll-index | `number` | `undefined` | 默认滚动的 Index | 2.36.0 |
| ignore-item-resize | `boolean` | `false` | 忽略内容尺寸变化,可以让运行快一些(尽管应该很难感受到) | 2.36.0 |
| items | `Array<object>` | `[]` | 需要展示的数据 | 2.36.0 |
| item-resizable | `number` | `false` | 是否启用动态尺寸,你不必关心项目大小,它会自动计算 | 2.36.0 |
| item-resizable | `boolean` | `false` | 是否启用动态尺寸,你不必关心项目大小,它会自动计算 | 2.36.0 |
| item-size | `number` | required | 以像素为单位显示项目的最小高度,用于计算滚动大小和位置 | 2.36.0 |
| items-style | `string \| CSSProperties` | `undefined` | 全部内容的容器样式 | 2.36.0 |
| key-field | `string` | `'key'` | 选项 key 的字段名 | 2.36.0 |
Expand Down
Loading