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): create table child element helper components, plus new `sort-null-last` and `table-variant` props. #3808

Merged
merged 185 commits into from Aug 7, 2019

Conversation

@tmorehouse
Copy link
Member

commented Aug 2, 2019

Describe the PR

Creates table child element helper components, which will be used internally by <b-table> and <b-table-lite>, and can be used directly by consumers when using <b-table-simple>. or in the slots top-row, bottom-row and thead-top

The helper components simplify handling row and cell variants, as well as providing accessible aria roles, scopes, and other aria-* attributes. role and scope and some aria-* can be overridden if the users set the attributes on the component.

The child components receive injections from the parent components for feature sniffing and detection.

Generated accessibility markup is improved via automated roles and scope attribute generation.

Additional features:

  • Added in table-variant support, to colorize the table with one of the theme colors. This feature was available before by manually placing a table-* or bg-* variant class on the table root element. The new table-variant prop simplifies this, and automatically adjusts to which variant class prefix to use, based on the tables dark mode.
  • Added in support for sorting null/undefined/empty-string last via the new sort-null-last prop. By default null/undefined/empty-string are considered less than any other value. setting this pro to true makes them appear greater than any other value. (closes #3816)

New child components:

  • b-td - functional wrapper for private helper component BTableCell
  • b-th - functional wrapper private helper component BTableCell
  • b-tr
  • b-thead
  • b-tbody
  • b-tfoot

To Do:

  • convert helper mixins use new child helper components
  • documentation updates, new examples
  • unit tests (if required, as new child components will be used by b-table, which has tests checking for child elements)
  • update top-level named exports of new components
  • update TypeScript declaration with the new components

PR checklist

What kind of change does this PR introduce? (check at least one)

  • Bugfix
  • Feature
  • Enhancement
  • ARIA accessibility
  • Documentation update
  • Other (please describe) code refactor / optimization

Does this PR introduce a breaking change? (check one)

  • No
  • Yes (please describe)

The PR fulfills these requirements:

  • It's submitted to the dev branch, not the master branch
  • When resolving a specific issue, it's referenced in the PR's title (i.e. [...] (fixes #xxx[,#xxx]), where "xxx" is the issue number)
  • It should address only one issue or feature. If adding multiple features or fixing a bug and adding a new feature, break them into separate PRs if at all possible.
  • The title should follow the Conventional Commits naming convention (i.e. fix(alert): not alerting during SSR render, docs(badge): update pill examples, fix typos, chore: fix typo in README, etc). This is very important, as the CHANGELOG is generated from these messages.

If new features/enhancement/fixes are added or changed:

  • Includes documentation updates (including updating the component's package.json for slot and event changes)
  • Includes any needed TypeScript declaration file updates
  • New/updated tests are included and passing (if required)
  • Existing test suites are passing
  • The changes have not impacted the functionality of other components or directives
  • ARIA Accessibility has been taken into consideration (Does it affect screen reader users or keyboard only users? Clickable items should be in the tab index, etc.)

If adding a new feature, or changing the functionality of an existing feature, the PR's
description above includes:

  • A convincing reason for adding this feature (to avoid wasting your time, it's best to open a suggestion issue first and wait for approval before working on it)

@tmorehouse tmorehouse changed the title feat(table): create table child element components feat(table): create table child element helper components Aug 2, 2019

tmorehouse added some commits Aug 2, 2019

@codecov

This comment has been minimized.

Copy link

commented Aug 2, 2019

Codecov Report

Merging #3808 into dev will increase coverage by <.01%.
The diff coverage is 100%.

Impacted file tree graph

@@            Coverage Diff            @@
##              dev   #3808      +/-   ##
=========================================
+ Coverage   99.29%   99.3%   +<.01%     
=========================================
  Files         226     233       +7     
  Lines        4401    4433      +32     
  Branches     1251    1257       +6     
=========================================
+ Hits         4370    4402      +32     
  Misses         25      25              
  Partials        6       6
Impacted Files Coverage Δ
src/components/table/helpers/mixin-caption.js 100% <ø> (ø) ⬆️
src/components/table/table-simple.js 100% <ø> (ø) ⬆️
src/components/input-group/input-group.js 100% <ø> (ø) ⬆️
src/components/index.esm.js 100% <ø> (ø) ⬆️
src/components/table/helpers/mixin-tfoot.js 100% <ø> (ø) ⬆️
src/components/table/helpers/mixin-thead.js 100% <100%> (ø) ⬆️
src/components/table/th.js 100% <100%> (ø)
src/components/table/helpers/mixin-tbody-row.js 100% <100%> (ø) ⬆️
src/components/table/helpers/mixin-empty.js 100% <100%> (ø) ⬆️
src/components/table/index.js 100% <100%> (ø) ⬆️
... and 21 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 195554f...e819a06. Read the comment docs.

tmorehouse added some commits Aug 2, 2019

tmorehouse and others added some commits Aug 4, 2019

tmorehouse added some commits Aug 5, 2019

jackmu95 and others added some commits Aug 5, 2019

@tmorehouse tmorehouse marked this pull request as ready for review Aug 7, 2019

@tmorehouse tmorehouse removed the Status: WIP label Aug 7, 2019

@tmorehouse tmorehouse merged commit 981114b into dev Aug 7, 2019

9 checks passed

License Compliance All checks passed.
Details
ci/circleci: build Your tests passed on CircleCI!
Details
ci/circleci: lint Your tests passed on CircleCI!
Details
ci/circleci: setup Your tests passed on CircleCI!
Details
ci/circleci: test Your tests passed on CircleCI!
Details
codecov/patch 100% of diff hit (target 99.29%)
Details
codecov/project 99.3% (+<.01%) compared to 195554f
Details
deploy/netlify Deploy preview ready!
Details
security/snyk - package.json (pi0) No manifest changes detected

@tmorehouse tmorehouse deleted the tmorehouse/table-components branch Aug 7, 2019

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
2 participants
You can’t perform that action at this time.