Skip to content

Commit

Permalink
Merge branch 'main' into feat-Upload-method-abort
Browse files Browse the repository at this point in the history
  • Loading branch information
jizai1125 committed Oct 23, 2022
2 parents 6ac0a47 + 2472a01 commit cd59de9
Show file tree
Hide file tree
Showing 9 changed files with 41 additions and 25 deletions.
14 changes: 9 additions & 5 deletions CHANGELOG.en-US.md
Original file line number Diff line number Diff line change
@@ -1,16 +1,20 @@
# CHANGELOG

## 2.33.5

### Fixes

- Fix `n-data-table` throws error on tree data check action, closes [#3832](https://github.com/tusen-ai/naive-ui/issues/3832).
## NEXT_VERSION

### Feats

- `n-avatar` exports `AvatarOption` type, closes [#3879](https://github.com/tusen-ai/naive-ui/issues/3879).
- `n-transfer` adds `show-selected` prop, closes [#3711](https://github.com/tusen-ai/naive-ui/issues/3711).
- `n-data-table` adds `loading` slot, closes [#3865](https://github.com/tusen-ai/naive-ui/issues/3865).
- `n-upload` adds `abort` method, closes [#3881](https://github.com/tusen-ai/naive-ui/issues/3881)

## 2.33.5

### Fixes

- Fix `n-data-table` throws error on tree data check action, closes [#3832](https://github.com/tusen-ai/naive-ui/issues/3832).

## 2.33.4

### Fixes
Expand Down
14 changes: 9 additions & 5 deletions CHANGELOG.zh-CN.md
Original file line number Diff line number Diff line change
@@ -1,16 +1,20 @@
# CHANGELOG

## 2.33.5

### Fixes

- 修复 `n-data-table` 树形数据勾选时报错,关闭 [#3832](https://github.com/tusen-ai/naive-ui/issues/3832)
## NEXT_VERSION

### Feats

- `n-avatar` 导出 `AvatarOption` 类型,关闭 [#3879](https://github.com/tusen-ai/naive-ui/issues/3879)
- `n-transfer` 新增 `show-selected` 属性,关闭 [#3711](https://github.com/tusen-ai/naive-ui/issues/3711)
- `n-data-table` 新增 `loading` 插槽,关闭 [#3865](https://github.com/tusen-ai/naive-ui/issues/3865)
- `n-upload` 新增 `abort` 方法,关闭 [#3881](https://github.com/tusen-ai/naive-ui/issues/3881)

## 2.33.5

### Fixes

- 修复 `n-data-table` 树形数据勾选时报错,关闭 [#3832](https://github.com/tusen-ai/naive-ui/issues/3832)

## 2.33.4

### Fixes
Expand Down
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@
"@babel/preset-env": "^7.16.11",
"@babel/traverse": "^7.17.9",
"@rollup/plugin-babel": "^5.3.1",
"@rollup/plugin-commonjs": "^22.0.0",
"@rollup/plugin-commonjs": "^23.0.1",
"@rollup/plugin-node-resolve": "^14.0.1",
"@rollup/plugin-replace": "^4.0.0",
"@types/estree": "^1.0.0",
Expand All @@ -101,7 +101,7 @@
"codesandbox": "^2.2.3",
"cssnano": "^5.1.7",
"deepmerge": "^4.2.2",
"esbuild": "0.15.7",
"esbuild": "0.15.12",
"eslint": "^8.13.0",
"eslint-config-prettier": "^8.5.0",
"eslint-config-standard": "^17.0.0",
Expand Down
2 changes: 1 addition & 1 deletion src/avatar-group/index.ts
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
export { default as NAvatarGroup, avatarGroupProps } from './src/AvatarGroup'
export type { AvatarGroupProps } from './src/AvatarGroup'
export type { AvatarGroupProps, AvatarOption } from './src/AvatarGroup'
2 changes: 1 addition & 1 deletion src/avatar-group/src/AvatarGroup.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ export interface AvatarGroupInjection {
size?: Size | undefined
}

interface AvatarOption {
export interface AvatarOption {
src: string
}

Expand Down
1 change: 1 addition & 0 deletions src/back-top/tests/BackTop.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,5 +25,6 @@ describe('n-back-top', () => {
wrapper.element.scrollTop = 1000
await wrapper.trigger('scroll')
expect(wrapper.html()).toContain('teleport start')
wrapper.unmount()
})
})
7 changes: 4 additions & 3 deletions src/data-table/demos/enUS/index.demo-entry.md
Original file line number Diff line number Diff line change
Expand Up @@ -210,6 +210,7 @@ These methods can help you control table in an uncontrolled manner. However, it'
### DataTable Slots
| Name | Type | Description |
| ----- | ---- | ----------------------------------------------- |
| empty | `()` | Custom description when data of table is empty. |
| Name | Type | Description | Version |
| --- | --- | --- | --- |
| empty | `()` | Custom description when data of table is empty. | |
| loading | `()` | Custom description when data of table is loading. | NEXT_VERSION |
7 changes: 4 additions & 3 deletions src/data-table/demos/zhCN/index.demo-entry.md
Original file line number Diff line number Diff line change
Expand Up @@ -218,6 +218,7 @@ type DataTableCreateSummary = (pageData: RowData[]) =>
### DataTable Slots
| 名称 | 参数 | 说明 |
| ----- | ---- | -------------------- |
| empty | `()` | 表格数据为空时的展示 |
| 名称 | 参数 | 说明 | 版本 |
| ------- | ---- | --------------------- | ------------ |
| empty | `()` | 表格数据为空时的展示 | |
| loading | `()` | 表格 loading 时的展示 | NEXT_VERSION |
15 changes: 10 additions & 5 deletions src/data-table/src/DataTable.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ import { createId } from 'seemly'
import { useConfig, useLocale, useTheme, useThemeClass } from '../../_mixins'
import { NBaseLoading } from '../../_internal'
import { NPagination } from '../../pagination'
import { createKey, warnOnce } from '../../_utils'
import { createKey, resolveSlot, warnOnce } from '../../_utils'
import { dataTableLight } from '../styles'
import MainTable from './MainTable'
import { useCheck } from './use-check'
Expand Down Expand Up @@ -400,7 +400,7 @@ export default defineComponent({
}
},
render () {
const { mergedClsPrefix, themeClass, onRender } = this
const { mergedClsPrefix, themeClass, onRender, $slots } = this
onRender?.()
return (
<div
Expand Down Expand Up @@ -435,9 +435,14 @@ export default defineComponent({
<Transition name="fade-in-scale-up-transition">
{{
default: () => {
return this.loading ? (
<NBaseLoading clsPrefix={mergedClsPrefix} strokeWidth={20} />
) : null
return this.loading
? resolveSlot($slots.loading, () => [
<NBaseLoading
clsPrefix={mergedClsPrefix}
strokeWidth={20}
/>
])
: null
}
}}
</Transition>
Expand Down

0 comments on commit cd59de9

Please sign in to comment.