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: Migrate Table to fiori3 #1042

Merged
merged 26 commits into from
Jun 3, 2020
Merged

feat: Migrate Table to fiori3 #1042

merged 26 commits into from
Jun 3, 2020

Conversation

JKMarkowski
Copy link
Contributor

@JKMarkowski JKMarkowski commented May 20, 2020

Related Issue

Related to #914

Descriptions

There are included

  • Base Table Component - Header, Body, Footer + sizes
  • Interactive states(hover, active, selected)
  • Table with checkboxes + sizes
  • Highlight Row
  • Table with pagination
  • Responsive table + pop-in mode
  • Filter / Sort of table
  • Navigation indicator inside table
  • Fixed Column

Breaking Changes

Added Class:
Modifiers:

  • fd-fable + (__header/__body/__cell) + (--no-vertical-borders/--no-horizontal-borders)

  • fd-table + (__row/_cell) + (--activable/--hoverable)

  • fd-table__cell--checkbox

  • fd-table__cell + (--success/--error/--warning--information)

  • fd-table__cell--status-indicator+ (--success/--error/--warning--information)

Responsive:

  • fd-table__row--main
  • fd-table__row--secondary

Removed Classes:
Elements:

  • fd-table__sort-column(--asc/--desc)
  • fd-table__context-menu
  • fd-table__context-menu-label
    Modifiers:
  • fd-table__row(--success/--error/--warning/--information)

Screenshots

NOTE: If you've made any style changes, please provide appropriate screenshots (before and after) to help reviewers.

To see examples of which screenshots to include, go to Screenshot Examples.

Before:

image
image

After:

image

image

Please check whether the PR fulfills the following requirements

@netlify
Copy link

netlify bot commented May 20, 2020

Deploy preview for fundamental-styles ready!

Built with commit 0765802

https://deploy-preview-1042--fundamental-styles.netlify.app

@mikerodonnell89 mikerodonnell89 mentioned this pull request May 21, 2020
6 tasks
@JKMarkowski JKMarkowski changed the title WIP feat/tables fiori3 feat: Migrate Table to fiori3 May 21, 2020
@droshev droshev requested a review from a team May 21, 2020 16:30
@droshev droshev added this to the Sprint 37 - Shenzhen milestone May 21, 2020
Copy link
Member

@mikerodonnell89 mikerodonnell89 left a comment

Choose a reason for hiding this comment

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

The entire table should have an outer border, 1px solid @sapUiListBorderColor

@mikerodonnell89
Copy link
Member

mikerodonnell89 commented May 21, 2020

Too many cells in the footer on this example
Screen Shot 2020-05-21 at 1 25 26 PM

@mikerodonnell89
Copy link
Member

mikerodonnell89 commented May 21, 2020

Strange focus outline for condensed checkboxes
Screen Shot 2020-05-21 at 1 33 04 PM

@mikerodonnell89
Copy link
Member

Table cell contents aligned left in RTL
Screen Shot 2020-05-21 at 1 38 31 PM

src/table.scss Outdated
--fd-table-header-background-color: var(--fd-color-neutral-1);

$fd-table-cell-padding: 0.5rem;
$fd-table-header-height: 2.75rem;
Copy link
Member

@mikerodonnell89 mikerodonnell89 May 21, 2020

Choose a reason for hiding this comment

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

Weird name for these variables because they are only used in cell selectors

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Naming changed

Copy link
Contributor

@InnaAtanasova InnaAtanasova left a comment

Choose a reason for hiding this comment

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

  1. I don't think the cells should have active state. They have hover, selected, hover+selected but didn't see the active (I might have missed it). The cells get focus tho (seen in the demo app)
    Screen Shot 2020-05-21 at 5 18 29 PM

  2. The RTL support is "missing" - the text should not be left-aligned and the first column padding (1rem) should go to the other side
    Screen Shot 2020-05-21 at 5 19 26 PM
    Screen Shot 2020-05-21 at 5 18 46 PM

  3. Items that are navigatable have different color
    Screen Shot 2020-05-21 at 5 18 46 PM
    Specs:

Screen Shot 2020-05-21 at 5 25 13 PM

  1. Freeze - shouldn't we have a horizontal/vertical scroll when we freeze a certain row or column? For example, if we freeze the first column, we will be able to horizontally scroll in order to see all the columns (this is usually when we can't fit all the columns in the vw)

src/table.scss Outdated
padding: 0 $fd-table-cell-padding;
font-family: var(--sapFontFamily);
font-size: var(--sapFontSize);
font-weight: normal;
Copy link
Contributor

Choose a reason for hiding this comment

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

normal font-weight is coming with the fd-reset


&__row {
transition: background-color $fd-table-transition-params;
&__header {
Copy link
Contributor

Choose a reason for hiding this comment

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

I think your header is missing the border

src/table.scss Outdated
font-size: var(--sapFontSize);
font-weight: normal;
color: inherit;
vertical-align: middle;
Copy link
Contributor

Choose a reason for hiding this comment

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

I don't think this is doing anything

@JKMarkowski
Copy link
Contributor Author

JKMarkowski commented May 22, 2020

Hi @InnaAtanasova

  1. I don't think the cells should have active state. They have hover, selected, hover+selected but didn't see the active (I might have missed it). The cells get focus tho (seen in the demo app)
  • There is down state, which I understand as a active. You can take a look at activable cells/rows example on preview.
  1. The RTL support is "missing" - the text should not be left-aligned and the first column padding (1rem) should go to the other side
  • Fixed
  1. Items that are navigatable have different color
    Screen Shot 2020-05-21 at 5 18 46 PM
  • It's shown only on some images, I don't know what to do with links actually links got own colors. Maybe I should have something like fd-table__text to keep color inherited.
  1. Freeze - shouldn't we have a horizontal/vertical scroll when we freeze a certain row or column? For example, if we freeze the first column, we will be able to horizontally scroll in order to see all the columns (this is usually when we can't fit all the columns in the vw)

We have Fixed Column now. It's in last example, I would also add something like fixed row.

The rest is fixed. I think you had a little bit outdated documentation.

@salarenko
Copy link
Contributor

salarenko commented May 22, 2020

Nice work.
I'm not sure if this composition approach is correct in terms of interactivity and other features. Solid base should be a table with basic styles. Currently we bring with base table additional behaviors like:

  • Marking row on hover
  • Interactive table headers

I'd rather consider those as extensions of basic table.

@droshev droshev added the table label May 22, 2020
@droshev droshev requested a review from a team May 22, 2020 20:30
@prsdthkr
Copy link
Member

prsdthkr commented May 23, 2020

Great work :D
I noticed that the table here behaves like a responsive table. If we were to follow the spec for the grid table, the columns will not be responsive by default as seen in this example. Instead, a scrollable view is provided (in smaller viewports or at 200% zoom). Also there are 3 modes for column width behavior as seen here: static, flexible, and mixed.

I would understand if this is out of scope for this PR. Other than that LGTM.

@JKMarkowski
Copy link
Contributor Author

Hi @prsdthkr,

Those features with responsive behaviour are up to application specification. If user adds some min-width to cells and adds wrapper with overflow-x it's possible to achieve. I added example with fixed column, which actually shows how it can be used.

Also there is responsive table example with pop-in mode, which changes view of table(it has modified markup a little bit)
image

I'm not sure what about the static, flexible, and mixed. It's not mentioned anywhere in fiori3 specs. We can add this example with dummy cells in future. Thanks for taking a look at it.

@InnaAtanasova
Copy link
Contributor

Documentation:
The checkbox needs to be checked with selected state
Screen Shot 2020-05-28 at 3 12 46 PM

Responsive table:

  • missing border
    Screen Shot 2020-05-28 at 3 11 56 PM

  • prob not achievable with pure css but the whole item should get hover and selected state:
    Screen Shot 2020-05-28 at 3 11 08 PM
    Screen Shot 2020-05-28 at 3 10 46 PM

Navigation:

  • I think the button should not have states. The states should be applied to the cell
    Screen Shot 2020-05-28 at 3 08 19 PM

src/table.scss Outdated
Comment on lines 74 to 75
width: 2rem;
min-width: 2rem;
Copy link
Contributor

Choose a reason for hiding this comment

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

should be put in a variable

src/table.scss Outdated
}
}
&--checkbox {
width: 10px;
Copy link
Contributor

Choose a reason for hiding this comment

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

rem value

@stefanoScalzo
Copy link
Contributor

Screen Shot 2020-06-01 at 10 10 31 AM
The toolbar border is overlapping with the table border

@JKMarkowski
Copy link
Contributor Author

JKMarkowski commented Jun 1, 2020

@stefanoScalzo Should It be considered as an issue?

@stefanoScalzo
Copy link
Contributor

@stefanoScalzo Should I be considered as issue?

True, something to discuss because I think we need to give our components the option to not include the border for cases like this? either that or we use a class that positions the elements lower with a smaller z index to hide it, but this may not work due to some using box-shadow. We need to discuss it.

@stefanoScalzo
Copy link
Contributor

For: Responsive Table - Pop-in Mode with Checkboxes
When clicking on the checkbox the whole table gets highlighted but when clicking the table nothing gets checked.

@JKMarkowski
Copy link
Contributor Author

For: Responsive Table - Pop-in Mode with Checkboxes
When clicking on the checkbox the whole table gets highlighted but when clicking the table nothing gets checked.

there is no way to make it work on pure css, I can't wrap row/cell to label.

@stefanoScalzo
Copy link
Contributor

Can you include Navigated Item Indicator Bar in your responsive table example please

@stefanoScalzo
Copy link
Contributor

Screen Shot 2020-06-01 at 11 09 51 AM
Overflow property not working properly

@mikerodonnell89
Copy link
Member

Filter section has compact buttons but the rest of the table is cozy - intentional?

@JKMarkowski
Copy link
Contributor Author

@mikerodonnell89 It's done by accident, I will change it

@InnaAtanasova
Copy link
Contributor

Responsive table:

  • missing border
    Screen Shot 2020-05-28 at 3 11 56 PM

It shouldn't have border

image
image

Sorry, I meant the border on the right, half of it has a border, the other half doesn't

@InnaAtanasova
Copy link
Contributor

Impressive job with the table! Once Travis is happy you can go ahead and merge it

@salarenko
Copy link
Contributor

Looks good. I'm not sure about one visual thing. Shouldn't the checkbox in collapsed table be aligned to the top? The docs say nothing about it, but thats the case @InnaAtanasova had to cover in very similar List with checkbox layout and it looks much better.

This is how it looks now:
image

This is how it looks with checkbox aligned to the top: (vertical-align)
image

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.

9 participants