-
Notifications
You must be signed in to change notification settings - Fork 2.9k
FocusZone: Add the ability for directional no wrapping #3962
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
Merged
jspurlin
merged 26 commits into
microsoft:master
from
jspurlin:jspurlin/FocusZoneAddWrapProps
Feb 22, 2018
Merged
Changes from 7 commits
Commits
Show all changes
26 commits
Select commit
Hold shift + click to select a range
6aca76d
Add the ability for FocusZones to not wrap (vertically or horizontall…
jspurlin 968c74a
Merge branch 'master' of https://github.com/OfficeDev/office-ui-fabri…
jspurlin 3450460
update the example to make it more clear the changes I'm making
jspurlin 9beb6c0
rush change
jspurlin 3f4b516
remove unneeded resolution
jspurlin 46a18bc
Remove an extra change from a different issue I'm working on
jspurlin f7c07c8
merge
jspurlin f8e6dd5
Update jspurlin-FocusZoneAddWrapProps_2018-02-13-16-53.json
jspurlin 4b9902a
Update jspurlin-FocusZoneAddWrapProps_2018-02-13-16-53.json
jspurlin 85b4e1a
Address feedback
jspurlin 011f551
Update dom.ts
dzearing 7a3f90c
Merge branch 'master' of https://github.com/OfficeDev/office-ui-fabri…
jspurlin 6c7edea
Merge branch 'master' of https://github.com/OfficeDev/office-ui-fabri…
jspurlin f6cc8b9
change let to const
jspurlin ec4b935
Add FocusZoneProps for ContextualMenu
jspurlin 040ea3f
fix test and add missing semicolon
jspurlin 6cc9aec
update the max bundle size
jspurlin 8e6d61f
merge from master
jspurlin 1f1e385
update example to include key... must be a new rule
jspurlin b7be7a2
bumping the bundle size that went up due to the merge from master
jspurlin 633906c
add a missing line
jspurlin 2fbb4c9
Merge branch 'master' of https://github.com/OfficeDev/office-ui-fabri…
jspurlin 84319b9
Merge branch 'master' of https://github.com/OfficeDev/office-ui-fabri…
jspurlin b3e8b64
Update FocusZone.tsx
dzearing 2b28e22
update incorrectly cased variable
jspurlin ff23aad
Merge branch 'jspurlin/FocusZoneAddWrapProps' of https://github.com/j…
jspurlin File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
11 changes: 11 additions & 0 deletions
11
common/changes/@uifabric/utilities/jspurlin-FocusZoneAddWrapProps_2018-02-13-16-53.json
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,11 @@ | ||
| { | ||
| "changes": [ | ||
| { | ||
| "packageName": "@uifabric/utilities", | ||
| "comment": "Focus/DOM: add the ability to find if an element (or any ancestor) contians a given attribute; to the dom utility ; add a shouldrWapFocus function to the focus utility ", | ||
| "type": "minor" | ||
| } | ||
| ], | ||
| "packageName": "@uifabric/utilities", | ||
| "email": "jspurlin@microsoft.com" | ||
| } | ||
11 changes: 11 additions & 0 deletions
11
common/changes/office-ui-fabric-react/jspurlin-FocusZoneAddWrapProps_2018-02-13-16-53.json
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,11 @@ | ||
| { | ||
| "changes": [ | ||
| { | ||
| "packageName": "office-ui-fabric-react", | ||
| "comment": "FocusZone: Add the ability turn off directional wrapping on sections of a FocusZone", | ||
| "type": "minor" | ||
| } | ||
| ], | ||
| "packageName": "office-ui-fabric-react", | ||
| "email": "jspurlin@microsoft.com" | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
232 changes: 232 additions & 0 deletions
232
...src/components/ContextualMenu/examples/ContextualMenu.CustomizationWithNoWrap.Example.tsx
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,232 @@ | ||
| import * as React from 'react'; | ||
| import { DirectionalHint, ContextualMenuItemType } from 'office-ui-fabric-react/lib/ContextualMenu'; | ||
| import { DefaultButton, IconButton, IButton } from 'office-ui-fabric-react/lib/Button'; | ||
| import { FocusZoneDirection } from 'office-ui-fabric-react/lib/FocusZone'; | ||
| import { autobind } from 'office-ui-fabric-react/lib/Utilities'; | ||
| import './ContextualMenuExample.scss'; | ||
|
|
||
| export class ContextualMenuCustomizationWithNoWrapExample extends React.Component<{}, {}> { | ||
| public render() { | ||
| return ( | ||
| <DefaultButton | ||
| className='ContextualMenuButton3' | ||
| text='Click for ContextualMenu' | ||
| menuProps={ | ||
| { | ||
| shouldFocusOnMount: true, | ||
| directionalHint: DirectionalHint.bottomLeftEdge, | ||
| className: 'ms-ContextualMenu-customizationExample', | ||
| items: | ||
| [ | ||
| { | ||
| key: 'newItem', | ||
| name: 'New' | ||
| }, | ||
| { | ||
| key: 'upload', | ||
| name: 'Upload' | ||
| }, | ||
| { | ||
| key: 'divider_1', | ||
| itemType: ContextualMenuItemType.Divider | ||
| }, | ||
| { | ||
| key: 'charm', | ||
| name: 'Charm', | ||
| className: 'Charm-List', | ||
| subMenuProps: { | ||
| arrowDirection: FocusZoneDirection.bidirectional, | ||
| checkForNoWrap: true, | ||
| items: [ | ||
| { | ||
| key: 'bulb', | ||
| name: 'Lightbulb', | ||
| onRender: this._renderCharmMenuItem, | ||
| className: 'ms-ContextualMenu-customizationExample-item' | ||
| }, | ||
| { | ||
| key: 'run', | ||
| name: 'Running', | ||
| onRender: this._renderCharmMenuItem, | ||
| className: 'ms-ContextualMenu-customizationExample-item' | ||
| }, | ||
| { | ||
| key: 'plane', | ||
| name: 'Airplane', | ||
| onRender: this._renderCharmMenuItem, | ||
| className: 'ms-ContextualMenu-customizationExample-item' | ||
| }, | ||
| { | ||
| key: 'page', | ||
| name: 'Page', | ||
| onRender: this._renderCharmMenuItem, | ||
| className: 'ms-ContextualMenu-customizationExample-item' | ||
| }, | ||
| { | ||
| key: 'cake', | ||
| name: 'Cake', | ||
| onRender: this._renderCharmMenuItem, | ||
| className: 'ms-ContextualMenu-customizationExample-item' | ||
| }, | ||
| { | ||
| key: 'soccer', | ||
| name: 'Soccer', | ||
| onRender: this._renderCharmMenuItem, | ||
| className: 'ms-ContextualMenu-customizationExample-item' | ||
| }, | ||
| { | ||
| key: 'home', | ||
| name: 'Home', | ||
| onRender: this._renderCharmMenuItem, | ||
| className: 'ms-ContextualMenu-customizationExample-item' | ||
| }, | ||
| { | ||
| key: 'emoji', | ||
| name: 'Emoji2', | ||
| onRender: this._renderCharmMenuItem, | ||
| className: 'ms-ContextualMenu-customizationExample-item' | ||
| }, | ||
| { | ||
| key: 'work', | ||
| name: 'Work', | ||
| onRender: this._renderCharmMenuItem, | ||
| className: 'ms-ContextualMenu-customizationExample-item' | ||
| }, | ||
| { | ||
| key: 'coffee', | ||
| name: 'Coffee', | ||
| onRender: this._renderCharmMenuItem, | ||
| className: 'ms-ContextualMenu-customizationExample-item' | ||
| }, | ||
| { | ||
| key: 'people', | ||
| name: 'People', | ||
| onRender: this._renderCharmMenuItem, | ||
| className: 'ms-ContextualMenu-customizationExample-item' | ||
| }, | ||
| { | ||
| key: 'stopwatch', | ||
| name: 'Stopwatch', | ||
| onRender: this._renderCharmMenuItem, | ||
| className: 'ms-ContextualMenu-customizationExample-item' | ||
| }, | ||
| { | ||
| key: 'music', | ||
| name: 'MusicInCollectionFill', | ||
| onRender: this._renderCharmMenuItem, | ||
| className: 'ms-ContextualMenu-customizationExample-item' | ||
| }, | ||
| { | ||
| key: 'lock', | ||
| name: 'Lock', | ||
| onRender: this._renderCharmMenuItem, | ||
| className: 'ms-ContextualMenu-customizationExample-item' | ||
| }, | ||
| { | ||
| key: 'item3', | ||
| name: 'Item 3', | ||
| 'data-no-horizontal-wrap': true | ||
| }, | ||
| { | ||
| key: 'item4', | ||
| name: 'Item 4', | ||
| 'data-no-horizontal-wrap': true | ||
| }, | ||
| ] | ||
| }, | ||
| }, | ||
| { | ||
| key: 'categories', | ||
| name: 'Categorize', | ||
| subMenuProps: { | ||
| items: [ | ||
| { | ||
| key: 'categories', | ||
| name: 'categories', | ||
| categoryList: [ | ||
| { | ||
| name: 'Personal', | ||
| color: 'yellow' | ||
| }, | ||
| { | ||
| name: 'Work', | ||
| color: 'green' | ||
| }, | ||
| { | ||
| name: 'Birthday', | ||
| color: 'blue' | ||
| }, | ||
| { | ||
| name: 'Spam', | ||
| color: 'grey' | ||
| }, | ||
| { | ||
| name: 'Urgent', | ||
| color: 'red' | ||
| }, | ||
| { | ||
| name: 'Hobbies', | ||
| color: 'black' | ||
| }, | ||
| ], | ||
| onRender: this._renderCategoriesList | ||
| }, | ||
| { | ||
| key: 'divider_1', | ||
| itemType: ContextualMenuItemType.Divider | ||
| }, | ||
| { | ||
| key: 'clear', | ||
| name: 'Clear categories' | ||
| }, | ||
| { | ||
| key: 'manage', | ||
| name: 'Manage categories' | ||
| } | ||
| ] | ||
| }, | ||
| } | ||
| ] | ||
| } | ||
| } | ||
|
|
||
| /> | ||
| ); | ||
| } | ||
|
|
||
| @autobind | ||
| private _renderCharmMenuItem(item: any, dismissMenu: () => void) { | ||
| return ( | ||
| <IconButton | ||
| {...item} | ||
| iconProps={ { iconName: item.name } } | ||
| className='ms-ContextualMenu-customizationExample-icon ms-ContextualMenu-link' | ||
| data-is-focusable={ true } | ||
| onClick={ dismissMenu } | ||
| data-no-vertical-wrap={ true } | ||
| /> | ||
| ); | ||
| } | ||
|
|
||
| private _renderCategoriesList(item: any) { | ||
| return ( | ||
| <ul className='ms-ContextualMenu-customizationExample-categoriesList'> | ||
| <li className='ms-ContextualMenu-item'> | ||
| { item.categoryList.map((category: any) => | ||
| <button className='ms-ContextualMenu-link' role='menuitem'> | ||
| <div> | ||
| <span | ||
| className='ms-ContextualMenu-icon ms-ContextualMenu-customizationExample-categorySwatch' | ||
| style={ { backgroundColor: category.color } } | ||
| /> | ||
| <span className='ms-ContextualMenu-itemText'> | ||
| { category.name } | ||
| </span> | ||
| </div> | ||
| </button> | ||
| ) } | ||
| </li> | ||
| </ul> | ||
| ); | ||
| } | ||
| } |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
These go into the release notes, and you have some extra spaces and typos