Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(table): modify table functions and style #672

Merged
merged 1 commit into from
Jan 5, 2022

Conversation

sallerli1
Copy link
Contributor

  1. add tree table indent support
  2. fix tree table sort function
  3. fix sort orderby(was't controlled previously)
  4. add filter function for table
  5. expandable column now extends base column(usual data column)
  6. add expandAll trigger for expandable column
  7. expose expandAll function for table bindings
  8. modify table style according to new design

PR Checklist

Please check if your PR fulfills the following requirements:

  • The commit message follows our guidelines
  • Tests for the changes have been added/updated or not needed
  • Docs and demo have been added/updated or not needed

PR Type

What kind of change does this PR introduce?

  • Bugfix
  • Feature
  • Component style update
  • Code style update (formatting, local variables)
  • Refactoring (no functional changes, no api changes)
  • Build related changes
  • CI related changes
  • Documentation content changes
  • Application (the showcase website) / infrastructure changes
  • Other... Please describe:

What is the current behavior?

  1. table currently doesn't support tree indent, and sort function
  2. table currently doesn't support filter
  3. table expandable column now can only be an in a standalone column, it cant contain any data

What is the new behavior?

see commit details for full info

Other information

@idux-bot
Copy link

idux-bot bot commented Dec 27, 2021

This preview will be available after the AzureCI is passed.

@codecov
Copy link

codecov bot commented Dec 27, 2021

Codecov Report

Merging #672 (4c7f62f) into main (1461a0e) will increase coverage by 1.52%.
The diff coverage is 100.00%.

Impacted file tree graph

@@            Coverage Diff             @@
##             main     #672      +/-   ##
==========================================
+ Coverage   83.82%   85.35%   +1.52%     
==========================================
  Files         396      396              
  Lines        9972     9940      -32     
  Branches     2301     2297       -4     
==========================================
+ Hits         8359     8484     +125     
+ Misses       1613     1456     -157     
Impacted Files Coverage Δ
packages/components/config/src/defaultConfig.ts 100.00% <ø> (ø)
packages/components/icon/src/dependencies.ts 100.00% <ø> (ø)
packages/components/icon/src/definitions.ts 100.00% <100.00%> (ø)
packages/components/pagination/src/token.ts 100.00% <0.00%> (ø)
packages/components/pagination/src/types.ts 100.00% <0.00%> (ø)
packages/components/pagination/src/Simple.tsx
packages/components/pagination/src/Jumper.tsx
packages/components/pagination/src/Total.tsx
packages/components/pagination/src/Item.tsx
... and 11 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 1461a0e...4c7f62f. Read the comment docs.

@@ -166,6 +166,7 @@ export const allIcons = [
'stop',
'swap',
'sync',
'table-filter',
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

这个就叫 filter 吧

@@ -840,6 +840,11 @@ export const Sync = {
svg: '<svg viewBox="64 64 896 896"><path d="M145.344 254.528 301.696 410.88a12.8 12.8 0 0 1-12.608 10.624h-150.4a384 384 0 0 0 588.48 408.576l46.016 45.888A448 448 0 0 1 73.152 421.504h-1.984l3.52-7.168a445.76 445.76 0 0 1 70.592-159.808zM512 64a448 448 0 0 1 353.472 723.328L712 633.792l-.64-.896a12.8 12.8 0 0 1 11.52-18.496h159.36a384 384 0 0 0-603.52-407.424l-45.568-45.632A446.08 446.08 0 0 1 512 64z"/></svg>',
}

export const TableFilter = {
name: 'table-filter',
svg: '<svg viewBox="0 0 16 16"><path fill-rule="evenodd" d="M1.659 3.259a.2.2 0 0 1-.059-.142V1.8c0-.11.09-.2.2-.2h12.4c.11 0 .2.09.2.2v1.317a.2.2 0 0 1-.059.142L9.6 8v6.276a.2.2 0 0 1-.11.18l-2.8 1.4a.2.2 0 0 1-.29-.18V8L1.659 3.259Z"/></svg>',
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

viewBox 不对?

@@ -16,6 +16,7 @@ order: 0
| --- | --- | --- | --- | --- | --- |
| `v-model:expandedRowKeys` | 展开行的 `key` 数组 | `(string \| number)[]` | - | - | - |
| `v-model:selectedRowKeys` | 选中行的 `key` 数组 | `(string \| number)[]` | - | - | - |
| `v-model:expandAllStatus` | 全部展开的状态 | `boolean` | - | - | - |
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
| `v-model:expandAllStatus` | 全部展开的状态 | `boolean` | - | - | - |
| `v-model:expandAll` | 是否全部展开 | `boolean` | - | - | - |

| --- | --- | --- | --- | --- | --- |
| `filters` | 筛选项 | `{ text: string, value: any }[]` | - | - | - |
| `filterBy` | 当前激活的筛选项 | `any[]` | - | - | - |
| `handleFilter` | 筛选处理函数 | `(currFilterBy: any[], record: T) => boolean` | - | - | - |
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
| `handleFilter` | 筛选处理函数 | `(currFilterBy: any[], record: T) => boolean` | - | - | - |
| `filter` | 本地模式下的筛选函数 | `(currFilterBy: any[], record: T) => boolean` | - | - | - |

@@ -41,6 +46,8 @@ export const tableProps = {
tags: IxPropTypes.object<TableTags>(),
virtual: IxPropTypes.bool.def(false),

overlayTarget: ɵPortalTargetDef,
Copy link
Member

@danranVm danranVm Dec 29, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

这个先不提供吧

@@ -53,15 +60,18 @@ export const tableProps = {
export type TableProps = IxInnerPropTypes<typeof tableProps>
export type TablePublicProps = IxPublicPropTypes<typeof tableProps>
export interface TableBindings {
scrollTo: VirtualScrollToFn
expandAll: ExpandAllContext['expandAll']
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

这个也先不提供吧,另外把 scrollTo 加来回来,应该是我之前漏写了。

1. add tree table indent support
2. fix tree table sort function
3. fix sort orderby(was't controlled previously)
4. add filter function for table
5. expandable column now extends base column(usual data column)
6. modify table style according to new design
@danranVm danranVm merged commit 05e6399 into IDuxFE:main Jan 5, 2022
@sallerli1 sallerli1 deleted the feat-table-saller branch February 20, 2023 06:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants