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

Remove use of classes in table variants #1744

Merged
merged 5 commits into from
Nov 5, 2021
Merged

Conversation

jrbarnes9
Copy link
Contributor

@jrbarnes9 jrbarnes9 commented Nov 4, 2021

Breaking change

What is the context of this PR?

  • In line with changes made in Remove manual classes for variations #1684 this PR applies the same work to the table component, which was missed.
  • Classes and boolean parameters are now replaced with a single variants parameter which can take an array to set the different variations of tables.
    Also...
  • Updated some of the variant examples with real content to help show how they work
  • The Sass has been amended to use the parent selector where applicable
  • The colour of row-hover has been changed to use the same variable for highlighting other elements: $color-highlight
  • The dense variant has been changed to compact
  • Documentation updated

What is the breaking change?

  • Developers using the onsTable() macro will need to replace the use of table_class, class, sortable and scrollable parameters with a new single parameter variants which can be set with an array of values or a single string e.g. "variants": ['scrollable', 'row-hover']
  • Utility classes etc can still be added to <table>, <th>, and <td>, but the params have changed to: tableClasses, thClasses and tdClasses, for consistency with other components.

How to review

Check all table variants work as expected and check docs

@jrbarnes9 jrbarnes9 added the Breaking changes This PR contains at least one breaking change label Nov 4, 2021
@jrbarnes9 jrbarnes9 linked an issue Nov 4, 2021 that may be closed by this pull request
boxadesign
boxadesign previously approved these changes Nov 4, 2021
rmccar
rmccar previously approved these changes Nov 4, 2021
@jrbarnes9 jrbarnes9 dismissed stale reviews from rmccar and boxadesign via ea63d6a November 5, 2021 12:57
@codecov
Copy link

codecov bot commented Nov 5, 2021

Codecov Report

Merging #1744 (ea63d6a) into master (2b35af0) will not change coverage.
The diff coverage is n/a.

Impacted file tree graph

@@           Coverage Diff           @@
##           master    #1744   +/-   ##
=======================================
  Coverage   96.40%   96.40%           
=======================================
  Files          62       62           
  Lines        2640     2640           
=======================================
  Hits         2545     2545           
  Misses         95       95           
Impacted Files Coverage Δ
src/tests/spec/table/table-scrollable.spec.js 100.00% <ø> (ø)
src/tests/spec/table/table-sortable.spec.js 98.80% <ø> (ø)

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 2b35af0...ea63d6a. Read the comment docs.

@jrbarnes9 jrbarnes9 merged commit cb0a909 into master Nov 5, 2021
@jrbarnes9 jrbarnes9 deleted the 1725-table-variants branch November 5, 2021 16:53
boxadesign pushed a commit that referenced this pull request Feb 17, 2023
* improved sass and changed row highlight colour

* added new param to macros table

* updated docs

* replaced classes and bools with singel variants array

* updated tests
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Breaking changes This PR contains at least one breaking change
Projects
None yet
3 participants