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(tab): Add MDCTabDimensions computation method #3122

Merged
merged 2 commits into from
Jul 18, 2018

Conversation

patrickrodee
Copy link
Contributor

Add computeDimensions method to MDCTab and MDCTabFoundation. Add MDCTabDimensions type to adapter file. Add getOffsetWidth, getOffsetLeft, getContentOffsetWidth, and getContentOffsetLeft to MDCTabAdapter. Add tests for new adapter, foundation, and component methods. Update readme. Add periods to the end of JSDoc lines with no periods. Closes #3121

@codecov-io
Copy link

codecov-io commented Jul 18, 2018

Codecov Report

Merging #3122 into feat/tabs/tabs will increase coverage by <.01%.
The diff coverage is 100%.

Impacted file tree graph

@@                Coverage Diff                 @@
##           feat/tabs/tabs    #3122      +/-   ##
==================================================
+ Coverage           98.41%   98.41%   +<.01%     
==================================================
  Files                 113      113              
  Lines                4790     4808      +18     
  Branches              600      600              
==================================================
+ Hits                 4714     4732      +18     
  Misses                 76       76
Impacted Files Coverage Δ
packages/mdc-tab/constants.js 100% <ø> (ø) ⬆️
packages/mdc-tab/index.js 100% <100%> (ø) ⬆️
packages/mdc-tab/foundation.js 100% <100%> (ø) ⬆️

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 e6f7349...eb57510. Read the comment docs.

@@ -127,6 +135,24 @@ class MDCTabFoundation extends MDCFoundation {
computeIndicatorClientRect() {
return this.adapter_.computeIndicatorClientRect();
}

Copy link
Contributor

Choose a reason for hiding this comment

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

Is there a reason the foundation actually needs this (thus necessitating additions to foundation, adapter, and component), or could it actually just be done entirely at the component level? This is basically just doing straight-up DOM math. I'm not sure I'd even qualify that as "business logic".

@patrickrodee
Copy link
Contributor Author

patrickrodee commented Jul 18, 2018 via email

Copy link
Contributor

@kfranqueiro kfranqueiro left a comment

Choose a reason for hiding this comment

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

Discussed with Pat; leaving in foundation and adapter to attempt to make it less complex to write framework wrappers.

@patrickrodee patrickrodee merged commit 1d51c75 into feat/tabs/tabs Jul 18, 2018
kfranqueiro pushed a commit that referenced this pull request Jul 27, 2018
WIP fixed bg coloring of icons

fix(tab-indicator): Use absolute positioning (#2547)

WIP start of tab scroller

WIP fixed transition duration

WIP progress on scroller

WIP added demos back

chore(tabs): Removed tab scroller

feat(tabs): Add tab indicator inside tab (#2565)

feat(tab-scroller): Add tab scroller (#2577)

Merge master into feat/tabs/tabs (#3096)

feat(tab): Update tab color and typography (#3108)

docs(tabs): Update metadata and synopses (#3117)

feat(tab): Add MDCTabDimensions computation (#3122)

feat(tab): Emit selection and activation events (#3139)

docs(tabs): Update new READMEs to match standard (#3142)

feat(tab): Give focus to tab when activated (#3164)

feat(tab): Add mixin for parent positioning; Use mixin in tab scroller (#3179)

fix(tabs): Suppress area occupied by scrollbar on platforms that show it (#3149)

fix(tab): Remove extraneous padding from the stacked text label in LTR (#3193)

feat(tabs): Add missing docs and create helper util API (#3194)

Merge master into feat/tabs/tabs (#3227)

feat(tab): Update layout; Add fixed-width mixin; Add min-width class (#3220)

fix(tab-scroller): Fix incorrect animation stopping scroll value in RTL (#3237)

feat(tab-scroller): Add scroll content width method for use in tab bar (#3222)

feat(tab): Remove activation event emitting (#3242)

feat(tab-bar): Add tab bar (#3229)
@kfranqueiro kfranqueiro deleted the feat/tabs/tab-compute-dimensions1 branch August 1, 2018 16:19
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.

3 participants