boltdesignsystem / bolt

The Bolt Design System provides robust Twig and Web Component-powered UI components, reusable visual styles, and powerful tooling to help developers, designers, and content authors build, maintain, and scale best of class digital experiences.
https://boltdesignsystem.com
MIT License
291 stars 46 forks source link

DS 835: Table Element #2548

Closed MarcinMr closed 2 years ago

MarcinMr commented 2 years ago

Jira

https://pegadigitalit.atlassian.net/browse/DS-835

Summary

The new element table is created that can replace the basic functionalities of the current Table Component

Details

  1. Much of the props and functionality are taken from the old table component, for example:
  1. The following methods of display
  1. JavaScript creates a wrapper and wraps the <table> if needed
  2. There are props that set the first, second, or first two columns as fixed width
  3. There is now a full width prop that will changed the default behavior (inline-block) to be full width
  4. There are sticky header functionality now included

How to test

(Focus on testing in all browsers)

Release notes

There is a new Table Element that replaces the basic functionalities of the current Table Component

colbytcook commented 2 years ago

@cjwhitedev

  1. The caption styling came from this previous work regarding the table component, https://feature-ds-516-table-component-rework.boltdesignsystem.com/pattern-lab/?p=components-table-headers. Since Mike was apart of this work we decided to use the design found on this branch.
  2. I have not been able to reproduce this, it seems to be functioning correctly. One thing to note, the side sticky header behavior will only start working if the responsive behavior kicks in. Otherwise it will render and behave like normal.
  3. Good Idea, I will update that
colbytcook commented 2 years ago

@cjwhitedev Updated the "Fixed Width" page with the note.

colbytcook commented 2 years ago

@danielamorse I addressed the feedback you had

Full Width Prop I added a full_width prop into the schema that will do three things.

  1. It will add a e-bolt-table--full-width class to the <table>. This class will apply a width: 100%; to the table to help prevent flash.
  2. The table.twig will now apply a e-bolt-table-wrapper--full-width class to the e-bolt-table-wrapper that will make the wrapper display block (and forcing it to be full width).
  3. The table JS will now poll the <table> for the e-bolt-table--full-width class and add the e-bolt-table-wrapper--full-width class to the wrapper when it is being rendered.

For WYSIWYG support, we can simply add a class (e-bolt-table--full-width) to the table element to achieve the desired effect.

I updated the existing docs pages with these changes (where applicable) and created a new documentation page for the full width prop. Let me know if you have any other questions regarding this.

colbytcook commented 2 years ago

@cjwhitedev Updated the PR description and responded to your inline comment