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

Updating fork #1

Merged
merged 67 commits into from
Feb 1, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
67 commits
Select commit Hold shift + click to select a range
2f247ff
Minor visual alignment for FolderCover (#3641)
ThomasMichon Jan 20, 2018
60225fb
Add post reduce grow callbacks (#3752)
staylo8 Jan 20, 2018
f381105
MessageBar: New prop for text truncation with singleline text (#3751)
lynamemi Jan 20, 2018
8b2e9c3
[ExpandingCard] fix for null content ref (#3628)
lambertwang Jan 20, 2018
04bf3df
Theming: Fix listText semantic slot name (#3403)
phkuo Jan 20, 2018
a9d0f70
Website: Left navigation scroll implementation (#3749)
lynamemi Jan 20, 2018
c7b183a
Applying package updates.
Jan 22, 2018
a541f4e
[hover card] fix bug for quickly enter/leave card cannot dismiss card…
MirandaGe Jan 22, 2018
8fcd40a
[FocusTrapZone]: Fix text selection within FocusTrapZone (#3759)
Jan 22, 2018
f7899b2
Applying package updates.
Jan 22, 2018
e49507c
Fix basePicker createGenericItem handling. (#3519)
ohritz Jan 22, 2018
7e9f89a
Applying package updates.
Jan 23, 2018
b311324
TextField & SearchBox: Specified placeholder colors (#3762)
lynamemi Jan 23, 2018
f2dcf91
Dropdown: Align error message style to TextField and ComboBox (#3760)
lynamemi Jan 23, 2018
2a57fb1
In Panel component, allow user to override all focus zone props. (#3568)
SpencerLynn Jan 23, 2018
5270872
ResizeGroup: Add the ability for ResizeGroup to take divProps (#3775)
jspurlin Jan 23, 2018
ee2299a
DatePicker: Fix datePicker overlap with week numbers for RTL (#3772)
srikanthreddyk Jan 23, 2018
09c29d1
BaseAutoFill: Fix a bug where BaseAutoFill would not work with compos…
joschect Jan 23, 2018
13911ac
Fix "isntance"/"instance" typo in positioning.types.ts (#3779)
Jan 23, 2018
e3f2856
Prevent default to avoid setting focus on SplitButton menu button (#3…
manueldosal Jan 24, 2018
2c37e80
Applying package updates.
Jan 24, 2018
79ea899
[SearchBox] onChange and flex layout fix for IE (#3664)
htryggva Jan 24, 2018
bd19b42
Addressing Issue #999 - [Accessibility] PeoplePicker doesn't have foc…
Jan 24, 2018
c0d264e
Async: Cancel should set timeoutId to null (#3782)
abettadapur Jan 24, 2018
5911103
Fixing some broken links in documentation pages (#3792)
kristoferbrown Jan 24, 2018
3b5b375
Fixing Picker suggestions RTL alignment (#3795)
kristoferbrown Jan 24, 2018
194ce4e
Picker header (#3737)
amyngu Jan 24, 2018
1f86b53
Spin Button - Removing aria-hidden and adding aria-labels for up/down…
chang47 Jan 25, 2018
1da9cd3
Minor README.md update for styling (#3768)
Jahnp Jan 25, 2018
a2864f8
CalloutContent: Convert CalloutContent to JS Styling (#3745)
montselozanod Jan 25, 2018
325c15a
V krbrow/limited picker blur error (#3798)
kristoferbrown Jan 25, 2018
9aefcc5
Applying package updates.
Jan 25, 2018
c8a644b
Dropdown: Fix disabled options (#3618)
erichdev Jan 25, 2018
9432151
Persona: Increased heights to account for double diacriticals and pre…
lynamemi Jan 25, 2018
ec38e5b
Split Button - Adding aria support for all buttons including the over…
chang47 Jan 25, 2018
ecd9ec7
Homogenizing TextField and Picker inputs (#3791)
kristoferbrown Jan 25, 2018
46ca980
TypeScript strict mode fix (#3808)
dzearing Jan 26, 2018
0ab4471
Applying package updates.
Jan 26, 2018
489029c
feat(pkg): add sideEffects false field (#3805)
TheLarkInn Jan 26, 2018
58615e5
Combo Box - Adding title and Improved aria-activedescendant for acces…
chang47 Jan 26, 2018
9d785c7
Fix peoplepicker coin (#3816)
Jan 26, 2018
da8f81e
Fixing height on picker input (#3814)
gokunymbus Jan 26, 2018
25129e7
Fabric icons update (#3797)
srideshpande Jan 26, 2018
e2487c7
Add overflow menu props to command bar (#3819)
staylo8 Jan 26, 2018
4b472ac
Fix teaching bubble overriding all default callout props (#3811)
jordandrako Jan 26, 2018
071a6da
Addressing Issue #1094 - Persona - onRenderCoin prop (#3799)
Jan 26, 2018
048cf3a
Callout: Fix scrollbar (#3820)
joschect Jan 27, 2018
c91e289
Jolore/adding work week date range (#3784)
Jan 27, 2018
d00fd3f
Applying package updates.
Jan 29, 2018
b53aad1
Fix TeachingBubble dismiss on scroll (#3810)
jordandrako Jan 29, 2018
d64535e
Addressing issue #3793 - Can't set ComboBox's button to aria-hidden="…
Jan 29, 2018
7bfa07a
Applying package updates.
Jan 30, 2018
e6136d1
ComboBox: Fix auto expand for allowFreeform (#3817)
jspurlin Jan 30, 2018
88066a8
Fix DatePicker prev and next arrows in RTL (#3822)
srikanthreddyk Jan 30, 2018
0bcc287
BaseSelectedListMake selection optional, Change render to any (#3839)
amyngu Jan 30, 2018
b6a301e
ContextualMenu: Remove the list inside the menu and move aria labelin…
jspurlin Jan 30, 2018
2a554f6
SwatchColorPicker: Adding Aria Label Text (#3765)
chang47 Jan 30, 2018
2a9d790
Prefix suffix whitespace (#3840)
sbalentine Jan 30, 2018
f803269
ChoiceGroup: Wrap long text for icon and image types. (#3761)
lynamemi Jan 30, 2018
7d5b46f
removed unused scss file (#3842)
Jan 31, 2018
7df5be2
Adding check to DatePicker componentWillReceiveProps to prevent unnec…
Jan 31, 2018
7794372
Applying package updates.
Jan 31, 2018
b17a45f
Controlled TextFields (#3796)
jordandrako Jan 31, 2018
66a91aa
Adding new WOFF files to the @uifabric/icons/fonts folder (#3848)
srideshpande Jan 31, 2018
c304b01
Fix issue in modal Selection handling (#3836)
ThomasMichon Jan 31, 2018
ddc5440
Addressing Issue #3776 - Sticky component loops forever if background…
Jan 31, 2018
952ad79
Updating config files in @uifabric/icons package (#3851)
srideshpande Jan 31, 2018
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 19 additions & 0 deletions apps/fabric-website/CHANGELOG.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,25 @@
{
"name": "@uifabric/fabric-website",
"entries": [
{
"version": "5.3.0",
"tag": "@uifabric/fabric-website_v5.3.0",
"date": "Mon, 22 Jan 2018 11:14:27 GMT",
"comments": {
"minor": [
{
"author": "lynamemi <lynam.emily@gmail.com>",
"commit": "a9d0f70495f315998a5dad78699ffd2349436420",
"comment": "Adding left nav scroll functionality, including fixing the left nav with the header. Other layout refactoring to accommodate."
}
],
"dependency": [
{
"comment": "Updating dependency \"office-ui-fabric-react\" from `>=5.40.1 <6.0.0` to `>=5.41.0 <6.0.0`"
}
]
}
},
{
"version": "5.2.1",
"tag": "@uifabric/fabric-website_v5.2.1",
Expand Down
9 changes: 8 additions & 1 deletion apps/fabric-website/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,13 @@
# Change Log - @uifabric/fabric-website

This log was last generated on Fri, 22 Dec 2017 11:10:56 GMT and should not be manually modified.
This log was last generated on Mon, 22 Jan 2018 11:14:27 GMT and should not be manually modified.

## 5.3.0
Mon, 22 Jan 2018 11:14:27 GMT

### Minor changes

- Adding left nav scroll functionality, including fixing the left nav with the header. Other layout refactoring to accommodate.

## 5.2.1
Fri, 22 Dec 2017 11:10:56 GMT
Expand Down
4 changes: 2 additions & 2 deletions apps/fabric-website/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@uifabric/fabric-website",
"version": "5.2.1",
"version": "5.3.0",
"description": "Reusable React components for building experiences for Office 365.",
"main": "lib/index.js",
"typings": "lib/index.d.ts",
Expand Down Expand Up @@ -39,7 +39,7 @@
"@microsoft/load-themed-styles": "^1.7.13",
"color-functions": "1.1.0",
"json-loader": "^0.5.7",
"office-ui-fabric-react": ">=5.40.1 <6.0.0",
"office-ui-fabric-react": ">=5.45.1 <6.0.0",
"tslib": "^1.7.1"
}
}
60 changes: 14 additions & 46 deletions apps/fabric-website/src/components/App/App.scss
Original file line number Diff line number Diff line change
Expand Up @@ -13,14 +13,12 @@
// Nav is hidden off screen by default
.App-nav {
-webkit-overflow-scrolling: touch; // Improves scrolling performance
bottom: 0;
@include ms-left(-$Nav-width);
overflow-y: auto;
position: fixed;
top: $Header-height;
transition: $ms-animation-duration-2 $ms-animation-ease-1;
@include ms-transition-property(left);
width: $Nav-width;
@include ms-float(left);
z-index: $ms-zIndex-1;
}

.App-content {
Expand All @@ -39,31 +37,6 @@
}
}

// When the nav is open (smaller screens only) push the content over and prevent app from scrolling
@media screen and (max-width: $uhf-screen-min-mobile) {
.App {
padding: 0;
}

.App.is-navOpen {
bottom: 0;
left: 0;
overflow: hidden;
position: fixed;
right: 0;
top: 0;

.App-nav {
@include ms-left(0);
}

.App-content {
@include ms-left($Nav-width);
opacity: 0.5; // Dim the content
}
}
}

// Show the nav at all times, to the left of the content
@media screen and (min-width: $uhf-screen-min-mobile) {
.App {
Expand All @@ -78,27 +51,17 @@
}

.App-nav {
@include ms-left(auto);
top: auto; // Mobile nav bar is no longer there
position: relative;
overflow-y: visible
top: $Header-height*2;
bottom: 0;
overflow-y: auto;
overflow-x: hidden;
}

.App-content {
margin-top: 0;
flex-grow: unset;
max-width: calc(100% - #{$Nav-width}); // IE needs max-width, it was ignoring width
width: calc(100% - #{$Nav-width});
}

// Reset values for the nav and content if opened on larger screens
.App.is-navOpen {
.App-nav {
@include ms-left(auto);
}

.App-content {
@include ms-left(auto);
}
@include ms-left($Nav-width);
}
}

Expand All @@ -111,11 +74,16 @@
.App-nav {
@include ms-margin-left(18px);
}

.App-content {
width: calc(100% - #{$Nav-width});
@include ms-left($Nav-width + 18px);
}
}
}

@media only screen and (max-width: $uhf-screen-min-mobile) {
.App {
padding: 0;
}
}
}
88 changes: 75 additions & 13 deletions apps/fabric-website/src/components/App/App.tsx
Original file line number Diff line number Diff line change
@@ -1,55 +1,117 @@
import * as React from 'react';
import './App.scss';
import { AppState } from './AppState';
import { css } from 'office-ui-fabric-react/lib/Utilities';
import { autobind } from 'office-ui-fabric-react/lib/Utilities';
import AttachedScrollUtility from '../../utilities/AttachedScrollUtility';
import { Fabric } from 'office-ui-fabric-react/lib/Fabric';
import { Nav } from '../Nav/Nav';

export interface IAppProps extends React.Props<App> {
}

export interface IAppState {
isNavOpen: boolean;
isAttached: boolean;
navHeight: number;
}

export class App extends React.Component<IAppProps, any> {

private _attachedScrollThreshold: number;
private _appContent: HTMLDivElement;
private _appContentRect: ClientRect;

constructor(props: IAppProps) {
super(props);

this.state = {
isNavOpen: false
isAttached: false
};
}

public componentDidMount() {
window.addEventListener('scroll', this._handleNavPositioning);
window.addEventListener('resize', this._handleNavPositioning);

this._attachedScrollThreshold = AttachedScrollUtility.calculateAttachedScrollThreshold();
this._handleNavPositioning();
}

public componentWillUnmount() {
window.removeEventListener('scroll', this._handleNavPositioning);
window.removeEventListener('resize', this._handleNavPositioning);
}

public render() {
let { isNavOpen } = this.state;
let { navHeight } = this.state;
let appContentTop = this._appContentRect ? this._appContentRect.top : 100;
// Using appContentTop as a reference to match instead of 'unset' because it does not work in IE.
let navTop: string = this.state.isAttached ? '0' : appContentTop.toString();
let navStyle = {
top: navTop,
height: navHeight
};

return (
<Fabric
className={ css(
'App',
isNavOpen && 'is-navOpen'
) }
className='App'
>
<div className='App-wrapper'>
<div className='App-nav'>
<div
className='App-nav'
style={ navStyle }
>
<Nav
pages={ AppState.pages }
onLinkClick={ this._onNavItemClicked.bind(this) }
/>
</div>
<div className='App-content' data-is-scrollable='true'>
<div
className='App-content'
data-is-scrollable='true'
ref={ (el) => this._appContent = el }
data-app-content-div='true'
>
{ this.props.children }
</div>
</div>
</Fabric>
);
}

private _onNavItemClicked(ev: MouseEvent) {
@autobind
private _handleNavPositioning() {
let { isAttached, navHeight } = this.state;
this._appContentRect = this._appContent.getBoundingClientRect();
const viewPortHeight = window.innerHeight;
isAttached = AttachedScrollUtility.shouldComponentAttach(isAttached, this._attachedScrollThreshold);
navHeight = this._calculateNavHeight(viewPortHeight, this._appContentRect, navHeight);
this.setState({
isNavOpen: false
isAttached: isAttached,
navHeight: navHeight
});
}

private _calculateNavHeight(viewPortHeight: number, appContentRect: ClientRect, height: number): number {
if (!appContentRect) {
return height;
}
if (appContentRect.top >= 0) {
// This case accounts for space taken up by the UHF header in the viewport.
height = viewPortHeight - appContentRect.top;
if (appContentRect.height < appContentRect.bottom && viewPortHeight > appContentRect.bottom) {
// This case might only exist in the UHF testing environment, when content isn't rendering properly and its height is weird.
height = appContentRect.height;
}
} else if (viewPortHeight < appContentRect.bottom && appContentRect.top < 0) {
// For pages with content that's longer than the viewport, the viewport is the height.
// Takes effect when you scroll past the header.
height = viewPortHeight;
} else if (appContentRect.bottom < 0) {
// In smaller screens when you scroll till the footer takes the whole page, collapse the nav.
height = 0;
} else {
// Once the footer is in view, match nav bottom to content bottom.
height = appContentRect.bottom;
}
return height;
}
}
9 changes: 6 additions & 3 deletions apps/fabric-website/src/components/Nav/Nav.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import * as React from 'react';
import { css } from 'office-ui-fabric-react/lib/Utilities';
import { FocusZone } from 'office-ui-fabric-react/lib/FocusZone';
import * as stylesImport from './Nav.module.scss';
const styles: any = stylesImport;
import {
Expand All @@ -24,9 +25,11 @@ export class Nav extends React.Component<INavProps, INavState> {
: null;

return (
<nav className={ styles.nav } role='navigation'>
{ links }
</nav>
<FocusZone>
<nav className={ styles.nav } role='navigation'>
{ links }
</nav>
</FocusZone>
);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,6 @@
box-shadow: 0 10px 30px -10px rgba(0,0,0,.2);
max-width: $App-maximumWidth - $Nav-width;
position: fixed;
top: 0;
width: calc(100% - #{$Nav-width} - #{$App-padding-left-lg} - #{$App-padding-right-lg});
z-index: $ms-zIndex-1;
height: $PageHeader-attachedTitleHeight + $PageHeader-navHeight;
Expand Down Expand Up @@ -131,7 +130,7 @@
.pageHeader {
&.isAttached {
.content {
width: calc(100% - #{$Nav-width} - #{$App-padding-right-sm} - #{$App-padding-left-sm} - 13px);
width: calc(100% - #{$Nav-width} - #{$App-padding-right-sm} - #{$App-padding-left-sm});
}
}
}
Expand Down
Loading