Skip to content

Commit

Permalink
Merge branch 'main' into feat-descriptions-add-class
Browse files Browse the repository at this point in the history
  • Loading branch information
07akioni authored Nov 11, 2023
2 parents 4c5e541 + 098058c commit 9f3bd4e
Show file tree
Hide file tree
Showing 68 changed files with 431 additions and 160 deletions.
29 changes: 26 additions & 3 deletions CHANGELOG.en-US.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,28 @@

## NEXT_VERSION

### Fixes

- Fix `n-tree` unexposed line color variable `--n-line-color`, closes [#5339](https://github.com/tusen-ai/naive-ui/issues/5339).
- Fix `n-tree` The style of the selected node is not displayed in the case of 'disabled'.
- Fix `n-tree` on `virtual-scroll` empty data placeholder lost problem.
- Fix `n-watermark` won't clear it's content when `content` prop is set to empty.

### Features

- `n-tree` adds `treeGetClickTarget` method to get click target of node click event, closes [#5375](https://github.com/tusen-ai/naive-ui/issues/5375).
- `n-space` adds `item-class` prop.
- `n-layout` adds `content-class`, `collapsed-trigger-class` and `trigger-class` props.
- `n-spin` adds `content-class` and `content-style` props.
- `n-popover` adds `arrow-class`, `arrow-wrapper-class`, `arrow-wrapper-style`, `content-class`, `footer-class` and `header-class` props.
- `n-notification` adds `container-class` prop.
- `n-message` adds `container-class` prop.
- `n-loading-bar` adds `container-class` prop.
- `n-thing` adds `content-class` and `description-class` props.
- `n-card` adds `content-class`, `footer-class`, `header-class` and `header-extra-class` props.
- `n-descriptions` adds `content-class` and `label-class` props.
## 2.35.0

### Breaking Changes

- `n-input`'s `suffix` to the back of `loading`, close [#4685](https://github.com/tusen-ai/naive-ui/issues/4685).
Expand Down Expand Up @@ -33,6 +55,7 @@
- Fix rapid clicks on `n-date-input`'s buttons triggering a text select for the rest of the website.
- Fix `n-auto-complete`'s autocomplete menu's unexpected open when clicking the clear icon with the input not focused, closes [#4658](https://github.com/tusen-ai/naive-ui/issues/4658).
- Fix `n-input`'s `on-keyup` prop type, closes [#5101](https://github.com/tusen-ai/naive-ui/issues/5101)
- Fix `n-popconfirm`'s action button should not be triggered multiple times,closes [#4687](https://github.com/tusen-ai/naive-ui/issues/4687).

### Features

Expand All @@ -48,7 +71,9 @@
- `n-tree` adds node information for `render-switcher-icon` props, closes [#4815](https://github.com/tusen-ai/naive-ui/issues/4815).
- `n-input-number` export the `select` method.
- `n-data-table` adds `n-data-table-tr--expanded` class to expanded rows, and `n-data-table-tr n-data-table-tr--expand` class to the additional row, closes [#4420](https://github.com/tusen-ai/naive-ui/issues/4420).
- `n-descriptions` adds `content-class` `label-class` prop.
- `n-spin` adds `delay` prop.
- Adds `n-performant-ellipsis` component.
- `DataTableBaseColumn` adds `ellipsisComponent` prop.

### i18n

Expand All @@ -68,7 +93,6 @@
- Fix `n-upload` warning cause by extraneous non-props attributes were passed to vue component `TransitionGroup` but could not be automatically inherited, closes [#4447](https://github.com/tusen-ai/naive-ui/issues/4447).
- Fix `n-menu` `show` `default` attribute spelling problem, closes [#4750](https://github.com/tusen-ai/naive-ui/issues/4750).
- Fix `n-icon-wrapper`'s theme error, closes [#4768](https://github.com/tusen-ai/naive-ui/issues/4768).
- Fix `n-popconfirm`'s action button should not be triggered multiple times,closes [#4687](https://github.com/tusen-ai/naive-ui/issues/4687).

### Feats

Expand All @@ -81,7 +105,6 @@
- `n-tabs` adds `pane-wrapper-class` `pane-wrapper-style` prop.
- `n-collapse` adds `titlePadding` theme variable, closes [#4728](https://github.com/tusen-ai/naive-ui/issues/4728).
- `n-tabs` adds `placement` prop.
- `n-spin` adds `delay` prop.

### i18n

Expand Down
33 changes: 28 additions & 5 deletions CHANGELOG.zh-CN.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,29 @@

## NEXT_VERSION

### Fixes

- 修复 `n-tree` 未暴露连接线颜色变量 `--n-line-color`,关闭[#5339](https://github.com/tusen-ai/naive-ui/issues/5339)
- 修复 `n-tree``disabled` 的情况下不显示选中节点的样式
- 修复 `n-tree` `virtual-scroll` 空数据占位符丢失
- 修复 `n-watermark` 组件中的 `content` 属性为空时,无法清空水印内容

### Features

- `n-tree` 导出 `treeGetClickTarget` 函数,判断点击位置,关闭 [#5375](https://github.com/tusen-ai/naive-ui/issues/5375)
- `n-space` 新增 `item-class` 属性
- `n-layout` 新增 `content-class``collapsed-trigger-class``trigger-class` 属性
- `n-spin` 新增 `content-class``content-style` 属性
- `n-popover` 新增 `arrow-class``arrow-wraperr-class``arrow-wraperr-style``content-class``footer-class``header-class` 属性
- `n-notification` 新增 `container-class` 属性
- `n-message` 新增 `container-class` 属性
- `n-loading-bar` 新增 `container-class` 属性
- `n-thing` 新增 `content-class``description-class` 属性
- `n-card` 新增 `content-class``footer-class``header-class``header-extra-class` 属性
- `n-descriptions` 新增 `content-class``label-class` 属性

## 2.35.0

### Breaking Changes

- `n-input``suffix` 移动到 `loading` 之后,关闭 [#4685](https://github.com/tusen-ai/naive-ui/issues/4685)
Expand Down Expand Up @@ -33,6 +56,7 @@
- 修复 `n-date-input` 的按钮快速点击时网站其余文本会被选中
- 修复 `n-auto-complete` 在未聚焦状态下点击清除按钮时补全菜单意外打开的问题,关闭 [#4658](https://github.com/tusen-ai/naive-ui/issues/4658)
- 修复 `n-input` 属性 `on-keyup` 类型,关闭 [#5101](https://github.com/tusen-ai/naive-ui/issues/5101)
- 修复 `n-popconfirm` 操作按钮不应该被多次触发,关闭 [#4687](https://github.com/tusen-ai/naive-ui/issues/4687)

### Features

Expand All @@ -47,8 +71,10 @@
- `n-tree` 新增 `show-line` 属性,关闭 [#3796](https://github.com/tusen-ai/naive-ui/issues/3796)[#4554](https://github.com/tusen-ai/naive-ui/issues/4554)
- `n-tree``render-switcher-icon` 属性添加节点信息,关闭 [#4815](https://github.com/tusen-ai/naive-ui/issues/4815)
- `n-input-number` 导出 `select` 方法
- `n-data-table` 新增 `n-data-table-tr--expanded` class 到展开行,新增 `n-data-table-tr n-data-table-tr--expand` class 到附加行,关闭 [#4420](https://github.com/tusen-ai/naive-ui/issues/4420).
- `n-descriptions` 新增 `content-class` `label-class` 属性
- `n-data-table` 新增 `n-data-table-tr--expanded` class 到展开行,新增 `n-data-table-tr n-data-table-tr--expand` class 到附加行,关闭 [#4420](https://github.com/tusen-ai/naive-ui/issues/4420)
- `n-spin` 新增 `delay` 属性
- 新增 `n-performant-ellipsis` 组件
- `DataTableBaseColumn` 新增 `ellipsisComponent` 属性

### i18n

Expand All @@ -59,7 +85,6 @@

### Fixes

- 修复 `n-notification``description` 有英文时没有自动换行, closes [#4609](https://github.com/tusen-ai/naive-ui/issues/4609).
- 修复 `n-notification``description` 有英文时没有自动换行,关闭 [#4609](https://github.com/tusen-ai/naive-ui/issues/4609)
- 修复 `n-dynamic-input``on-remove` 方法返回被删除的数据下标 `index``value[index]` 已经不存在
- 修复 `n-dynamic-input` 在点击添加按钮后 `on-create` 返回的 `index` 不正确
Expand All @@ -69,7 +94,6 @@
- 修复 `n-upload` 内部使用 vue `TransitionGroup` 组件时,传递了未声明的 prop 且未被自动继承导致警告,关闭[#4447](https://github.com/tusen-ai/naive-ui/issues/4447)
- 修复 `n-menu` `show` `default` 属性拼写问题,关闭 [#4750](https://github.com/tusen-ai/naive-ui/issues/4750)
- 修复 `n-icon-wrapper` 的主题异常,关闭 [#4768](https://github.com/tusen-ai/naive-ui/issues/4768)
- 修复 `n-popconfirm` 操作按钮不应该被多次触发,关闭 [#4687][https://github.com/tusen-ai/naive-ui/issues/4687]

### Feats

Expand All @@ -83,7 +107,6 @@
- `n-tabs` 新增 `pane-wrapper-class` `pane-wrapper-style` 属性
- `n-collapse` 新增 `titlePadding` 主题变量,关闭 [#4728](https://github.com/tusen-ai/naive-ui/issues/4728)
- `n-tabs` 新增 `placement` 属性
- `n-spin` 新增 `delay` 属性,

### i18n

Expand Down
54 changes: 27 additions & 27 deletions demo/pages/docs/i18n/enUS/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -44,33 +44,33 @@ PRs are welcomed for locales that are not supported yet!

The following list is sorted by 'Config' column.

| Language | Config | Date config | Version |
| ------------------------- | ------ | ----------- | ------------ |
| Arabic (العربية) | arDZ | dateArDZ | 2.34.0 |
| German (Germany) | deDE | dateDeDE | |
| English (British) | enGB | dateEnGB | 2.25.1 |
| English | enUS | dateEnUS | |
| Esperanto | eo | dateEo | 2.25.2 |
| Spanish (Argentina) | esAR | dateEsAR | 2.24.2 |
| Persian | faIR | dateFaIR | 2.34.4 |
| French | frFR | dateFrFR | |
| Bahasa Indonesia | idID | dateIdID | |
| Italiano | itIT | dateItIT | 2.24.2 |
| Japanese | jaJP | dateJaJP | |
| Korean (South Korea) | koKR | dateKoKR | 2.28.1 |
| Norwegian Bokmål (Norway) | nbNO | dateNbNO | |
| Dutch (Netherlands) | nlNL | dateNlNL | 2.29.0 |
| Polish (Poland) | plPL | datePlPL | 2.25.2 |
| Portuguese (Brazil) | ptBR | datePtBR | 2.28.1 |
| Russian | ruRU | dateRuRU | |
| Slovak | skSK | dateSkSK | 2.25.3 |
| Swedish | svSE | dateSvSE | NEXT_VERSION |
| Thai (Thailand) | thTH | dateThTH | 2.27.0 |
| Turkish | trTR | dateTrTR | 2.34.0 |
| Ukrainian | ukUA | dateUkUA | |
| Vietnamese (Vietnam) | viVN | dateViVN | 2.30.7 |
| Chinese (Simplified) | zhCN | dateZhCN | |
| Chinese (Traditional) | zhTW | dateZhTW | |
| Language | Config | Date config | Version |
| ------------------------- | ------ | ----------- | ------- |
| Arabic (العربية) | arDZ | dateArDZ | 2.34.0 |
| German (Germany) | deDE | dateDeDE | |
| English (British) | enGB | dateEnGB | 2.25.1 |
| English | enUS | dateEnUS | |
| Esperanto | eo | dateEo | 2.25.2 |
| Spanish (Argentina) | esAR | dateEsAR | 2.24.2 |
| Persian | faIR | dateFaIR | 2.34.4 |
| French | frFR | dateFrFR | |
| Bahasa Indonesia | idID | dateIdID | |
| Italiano | itIT | dateItIT | 2.24.2 |
| Japanese | jaJP | dateJaJP | |
| Korean (South Korea) | koKR | dateKoKR | 2.28.1 |
| Norwegian Bokmål (Norway) | nbNO | dateNbNO | |
| Dutch (Netherlands) | nlNL | dateNlNL | 2.29.0 |
| Polish (Poland) | plPL | datePlPL | 2.25.2 |
| Portuguese (Brazil) | ptBR | datePtBR | 2.28.1 |
| Russian | ruRU | dateRuRU | |
| Slovak | skSK | dateSkSK | 2.25.3 |
| Swedish | svSE | dateSvSE | 2.35.0 |
| Thai (Thailand) | thTH | dateThTH | 2.27.0 |
| Turkish | trTR | dateTrTR | 2.34.0 |
| Ukrainian | ukUA | dateUkUA | |
| Vietnamese (Vietnam) | viVN | dateViVN | 2.30.7 |
| Chinese (Simplified) | zhCN | dateZhCN | |
| Chinese (Traditional) | zhTW | dateZhTW | |

## Customize the existing locale

Expand Down
54 changes: 27 additions & 27 deletions demo/pages/docs/i18n/zhCN/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -44,33 +44,33 @@ Naive-ui 通过使用 `n-config-provider` 调整语言,默认情况下所有

以下列表依据“配置”列排序。

| 语言 | 配置 | 日期配置 | 版本 |
| ------------------ | ---- | -------- | ------------ |
| 阿拉伯语 | arDZ | dateArDZ | 2.34.0 |
| 德语 | deDE | dateDeDE | |
| 英国英语 | enGB | dateEnGB | 2.25.1 |
| 英语 | enUS | dateEnUS | |
| 世界语 | eo | dateEo | 2.25.2 |
| 西班牙语(阿根廷) | esAR | dateEsAR | 2.24.2 |
| 波斯语 | faIR | dateFaIR | 2.34.4 |
| 法语 | frFR | dateFrFR | |
| 印度尼西亚语 | idID | dateIdID | |
| 意大利语 | itIT | dateItIT | 2.24.2 |
| 日语 | jaJP | dateJaJP | |
| 韩语 | koKR | dateKoKR | 2.28.1 |
| 书面挪威语 | nbNO | dateNbNO | |
| 荷兰语(荷兰) | nlNL | dateNlNL | 2.29.0 |
| 波兰语(波兰) | plPL | datePlPL | 2.25.2 |
| 葡萄牙语 (巴西) | ptBR | datePtBR | 2.28.1 |
| 俄罗斯语 | ruRU | dateRuRU | |
| 斯洛伐克语 | skSK | dateSkSK | 2.25.3 |
| 瑞典語 | svSE | dateSvSE | NEXT_VERSION |
| 泰语(泰国) | thTH | dateThTH | 2.27.0 |
| 土耳其语 | trTR | dateTrTR | 2.34.0 |
| 乌克兰语 | ukUA | dateUkUA | |
| 越南语(越南) | viVN | dateViVN | 2.30.7 |
| 简体中文 | zhCN | dateZhCN | |
| 繁体中文 | zhTW | dateZhTW | |
| 语言 | 配置 | 日期配置 | 版本 |
| ------------------ | ---- | -------- | ------ |
| 阿拉伯语 | arDZ | dateArDZ | 2.34.0 |
| 德语 | deDE | dateDeDE | |
| 英国英语 | enGB | dateEnGB | 2.25.1 |
| 英语 | enUS | dateEnUS | |
| 世界语 | eo | dateEo | 2.25.2 |
| 西班牙语(阿根廷) | esAR | dateEsAR | 2.24.2 |
| 波斯语 | faIR | dateFaIR | 2.34.4 |
| 法语 | frFR | dateFrFR | |
| 印度尼西亚语 | idID | dateIdID | |
| 意大利语 | itIT | dateItIT | 2.24.2 |
| 日语 | jaJP | dateJaJP | |
| 韩语 | koKR | dateKoKR | 2.28.1 |
| 书面挪威语 | nbNO | dateNbNO | |
| 荷兰语(荷兰) | nlNL | dateNlNL | 2.29.0 |
| 波兰语(波兰) | plPL | datePlPL | 2.25.2 |
| 葡萄牙语 (巴西) | ptBR | datePtBR | 2.28.1 |
| 俄罗斯语 | ruRU | dateRuRU | |
| 斯洛伐克语 | skSK | dateSkSK | 2.25.3 |
| 瑞典語 | svSE | dateSvSE | 2.35.0 |
| 泰语(泰国) | thTH | dateThTH | 2.27.0 |
| 土耳其语 | trTR | dateTrTR | 2.34.0 |
| 乌克兰语 | ukUA | dateUkUA | |
| 越南语(越南) | viVN | dateViVN | 2.30.7 |
| 简体中文 | zhCN | dateZhCN | |
| 繁体中文 | zhTW | dateZhTW | |

## 在现有国际化基础上调整

Expand Down
10 changes: 5 additions & 5 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "naive-ui",
"version": "2.34.4",
"version": "2.35.0",
"description": "A Vue 3 Component Library. Fairly Complete, Theme Customizable, Uses TypeScript, Fast",
"main": "lib/index.js",
"module": "es/index.js",
Expand Down Expand Up @@ -102,7 +102,7 @@
"codesandbox": "^2.2.3",
"cssnano": "^6.0.1",
"deepmerge": "^4.3.1",
"esbuild": "0.19.2",
"esbuild": "0.19.5",
"eslint": "^8.48.0",
"eslint-config-prettier": "^9.0.0",
"eslint-config-standard": "^17.1.0",
Expand All @@ -125,11 +125,11 @@
"katex": "^0.16.8",
"lint-staged": "^14.0.1",
"lyla": "^1.2.2",
"marked": "^8.0.0",
"marked": "^9.1.6",
"prettier": "^3.0.3",
"rimraf": "^5.0.1",
"rollup": "^3.29.0",
"rollup-plugin-esbuild": "^5.0.0",
"rollup": "^4.3.0",
"rollup-plugin-esbuild": "^6.1.0",
"superagent": "^8.1.2",
"ts-jest": "^29.1.1",
"typescript": "5.2.2",
Expand Down
2 changes: 1 addition & 1 deletion src/_utils/css/color-to-class.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
export function color2Class (color: string): string {
return color.replace(/#|\(|\)|,|\s/g, '_')
return color.replace(/#|\(|\)|,|\s/g, '_').replace(/./g, '')
}
6 changes: 1 addition & 5 deletions src/anchor/src/BaseAnchor.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -41,10 +41,6 @@ export const baseAnchorProps = {
type: Number,
default: 12
},
top: {
type: Number,
default: 0
},
internalScrollable: Boolean,
ignoreGap: Boolean,
offsetTarget: [String, Object, Function] as PropType<
Expand Down Expand Up @@ -199,7 +195,7 @@ export default defineComponent({
return prevLink
}
}
if (link.top <= bound + props.top) {
if (link.top <= bound) {
if (prevLink === null) {
return link
} else if (link.top === prevLink.top) {
Expand Down
2 changes: 1 addition & 1 deletion src/button/src/Button.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -654,7 +654,7 @@ type MergedProps = Partial<InternalButtonProps & NativeButtonProps>
export default Button

// XButton is for tsx type checking
// It's not compitable with render function `h`
// It's not compatible with render function `h`
// Currently we don't expose it as public
// If there's any issue about this, we may expose it
// Since most people use template, the type checking phase doesn't work as tsx
Expand Down
4 changes: 4 additions & 0 deletions src/card/demos/enUS/index.demo-entry.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,10 +27,14 @@ embedded.vue
| --- | --- | --- | --- | --- |
| bordered | `boolean` | `true` | Whether to show the card border. | |
| closable | `boolean` | `false` | Is it allowed to close. | |
| content-class | `string` | `undefined` | The class of the card content area. | NEXT_VERSION |
| content-style | `Object \| string` | `undefined` | The style of the card content area. | |
| embedded | `boolean` | `false` | Use a darker background color to show the embedding effect (only for bright themes) | |
| footer-class | `string` | `undefined` | The class of the bottom area of the card. | NEXT_VERSION |
| footer-style | `Object \| string` | `undefined` | The style of the bottom area of the card. | |
| header-class | `string` | `undefined` | The class of the card head area. | NEXT_VERSION |
| header-style | `Object \| string` | `undefined` | The style of the card head area. | |
| header-extra-class | `string` | `undefined` | The class of the card head extra area. | NEXT_VERSION |
| header-extra-style | `Object \| string` | `undefined` | The style of the card head extra area. | 2.25.0 |
| hoverable | `boolean` | `false` | Whether to show shadow when hovering on the card. | |
| segmented | `boolean \| { [part in 'content' \| 'footer' \| 'action']?: boolean \| 'soft' }` | `false` | Segment divider settings of the card. | |
Expand Down
4 changes: 4 additions & 0 deletions src/card/demos/zhCN/index.demo-entry.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,10 +29,14 @@ embedded-debug.vue
| --- | --- | --- | --- | --- |
| bordered | `boolean` | `true` | 是否显示卡片边框 | |
| closable | `boolean` | `false` | 是否允许关闭 | |
| content-class | `string` | `undefined` | 卡片内容区域的类名 | NEXT_VERSION |
| content-style | `Object \| string` | `undefined` | 卡片内容区域的样式 | |
| embedded | `boolean` | `false` | 使用更深的背景色展现嵌入效果,只对亮色主题生效 | |
| footer-class | `string` | `undefined` | 卡片底部区域的类名 | NEXT_VERSION |
| footer-style | `Object \| string` | `undefined` | 卡片底部区域的样式 | |
| header-class | `string` | `undefined` | 卡片头部区域的类名 | NEXT_VERSION |
| header-style | `Object \| string` | `undefined` | 卡片头部区域的样式 | |
| header-extra-class | `string` | `undefined` | 卡片头部额外内容的类名 | NEXT_VERSION |
| header-extra-style | `Object \| string` | `undefined` | 卡片头部额外内容的样式 | 2.25.0 |
| hoverable | `boolean` | `false` | 卡片是否可悬浮 | |
| segmented | `boolean \| { [part in 'content' \| 'footer' \| 'action']?: boolean \| 'soft' }` | `false` | 卡片的分段区域设置 | |
Expand Down
Loading

0 comments on commit 9f3bd4e

Please sign in to comment.