diff --git a/CHANGELOG.en-US.md b/CHANGELOG.en-US.md index 971d4039d..30b1976d8 100644 --- a/CHANGELOG.en-US.md +++ b/CHANGELOG.en-US.md @@ -1,10 +1,14 @@ # CHANGELOG -## 1.0.4 (2020-03-27) +## 1.0.5 (2020-03-27) ### Features - Change the data type of `n-data-table`'s filters from Array to Object. ### Fixes - `n-data-table` cannot be filtered correctly when there are multiple filtered columns. +## 1.0.4 (2020-03-26) +### Features +- Filter menu in `n-data-table` is scrollable when there are too many items. + ## 1.0.3 (2020-03-25) ### Features - `$NMessage`, `$NNotification`, `$NConfirm`'s theme will be applied on their children components. diff --git a/CHANGELOG.zh-CN.md b/CHANGELOG.zh-CN.md index e96d44ebd..ac9052d3a 100644 --- a/CHANGELOG.zh-CN.md +++ b/CHANGELOG.zh-CN.md @@ -1,10 +1,14 @@ # CHANGELOG -## 1.0.4 (2020-03-27) +## 1.0.5 (2020-03-27) ### Features - 改变 `n-data-table` 的 filters 的数据类型, 从数组改变成对象. ### Fixes - `n-data-table`在有多列筛选的情况下数据不能被正确筛选. +## 1.0.4 (2020-03-26) +### Features +- 当选项过多时,`n-data-table` 过滤菜单的内容可以滚动 + ## 1.0.3 (2020-03-25) ### Features - `$NMessage`, `$NNotification`, `$NConfirm` 的获取到的主题会应用到他们的内部组件 diff --git a/demo/documentation/components/dataTable/enUS/index.md b/demo/documentation/components/dataTable/enUS/index.md index b7739e5dd..2396d43ef 100644 --- a/demo/documentation/components/dataTable/enUS/index.md +++ b/demo/documentation/components/dataTable/enUS/index.md @@ -55,8 +55,8 @@ These methods can help you control table in an uncontrolled manner. However, it' |Name|Type|Description| |-|-|-| -|filters|`(filters: { (string \| number): Array })`|Key is the key of the column, value is the filterOptionValues.| -|sort|`(columnKey: string \| null, order: 'ascend' \| 'descend' \| false)`|If columnKey set to `null`, it is same as clearSorter| +|filters|`(filters: { [string \| number]: Array }) => void`|Key is the key of the column, value is the filterOptionValues.| +|sort|`(columnKey: string \| null, order: 'ascend' \| 'descend' \| false) => void`|If columnKey set to `null`, it is same as clearSorter| |page|`(page: number) => void`|| |clearFilters|`() => void`|| |clearSorter|`() => void`|| @@ -65,7 +65,7 @@ These methods can help you control table in an uncontrolled manner. However, it' ## Events |Name|Parameters|Description| |-|-|-| -|filters-change|`(filters: { (string \| number): Array }, initiatorColumn: object)`|| +|filters-change|`(filters: { [string \| number]: Array }, initiatorColumn: object)`|| |sorter-change|`({ columnKey: string \| number, sorter: 'default' \| function \| boolean, order: 'ascend' \| 'descend' \| false } \| null)`|If there won't be a active sorter after change, sorter-change will emit `null`| |page-change|`(page: number)`|| |page-size-change|`(pageSize: number)`|| diff --git a/demo/documentation/components/dataTable/zhCN/index.md b/demo/documentation/components/dataTable/zhCN/index.md index cf97bf379..993c3b56f 100644 --- a/demo/documentation/components/dataTable/zhCN/index.md +++ b/demo/documentation/components/dataTable/zhCN/index.md @@ -55,8 +55,8 @@ ajaxUsage |名称|参数|说明| |-|-|-| -|filters|`(filters: { (string \| number): Array })`| Key 是列的 key, value 是 filterOptionValues.| -|sort|`(columnKey: string \| null, order: 'ascend' \| 'descend' \| false)`|如果 columnKey 设为 `null`,那它和 clearSorter 效果一致| +|filters|`(filters: { [string \| number]: Array }) => void`| Key 是列的 key, value 是 filterOptionValues.| +|sort|`(columnKey: string \| null, order: 'ascend' \| 'descend' \| false) => void`|如果 columnKey 设为 `null`,那它和 clearSorter 效果一致| |page|`(page: number) => void`|| |clearFilters|`() => void`|| |clearSorter|`() => void`|| @@ -65,7 +65,7 @@ ajaxUsage ## Events |名称|参数|说明| |-|-|-| -|filters-change|`(filters: { (string \| number): Array }, initiatorColumn: object)`|| +|filters-change|`(filters: { [string \| number]: Array }, initiatorColumn: object)`|| |sorter-change|`({ columnKey: string \| number, sorter: 'default' \| function \| boolean, order: 'ascend' \| 'descend' \| false } \| null)`|如果在变动后没有激活的排序,那么 sorter-change 将发出 `null`| |page-change|`(page: number)`|| |page-size-change|`(pageSize: number)`|| diff --git a/src/DataTable/src/DataTable.vue b/src/DataTable/src/DataTable.vue index f33fd5d3c..51ddc1120 100644 --- a/src/DataTable/src/DataTable.vue +++ b/src/DataTable/src/DataTable.vue @@ -70,11 +70,6 @@ import NPagination from '../../Pagination' import formatLength from '../../_utils/css/formatLength' import isPlainObject from 'lodash-es/isPlainObject' -// function createShallowClonedArray (array) { -// if (Array.isArray(array)) return array.map(createShallowClonedObject) -// return array -// } - function createShallowClonedObject (object) { if (!object) return object if (typeof object === 'object') { @@ -495,7 +490,7 @@ export default { this.internalActiveFilters = filters this.$emit('filters-change', createShallowClonedObject(filters), createShallowClonedObject(sourceColumn)) } else { - console.error('[naive-ui/dataTable]: filters is not an Object') + console.error('[naive-ui/n-data-table]: filters is not an object') } }, scrollMainTableBodyToTop () {