Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
40 commits
Select commit Hold shift + click to select a range
6d18606
Add ComboBox functionality
jspurlin Jun 2, 2017
3cc47d2
Merge branch 'master' into jspurlin/ComboBox
jspurlin Jun 2, 2017
ec78224
Make a fix for IE where non-allowFreeform is showing the keypresses...
jspurlin Jun 2, 2017
3399566
Update the PR with code review feedback. Simplified the code a lot, d…
jspurlin Jun 8, 2017
e43ac7b
Fixing some build warnings
jspurlin Jun 8, 2017
ac35bdc
Update my example page to explicitly not use two mutually exclusive p…
jspurlin Jun 8, 2017
d4c84ec
Merge branch 'master' into jspurlin/ComboBox
jspurlin Jun 8, 2017
6b2ef29
The npm-shrinkwrap.json file automatically updated... commiting
jspurlin Jun 8, 2017
aad70fb
Had a bad copy paste, fixing up the incorrectly logic
jspurlin Jun 8, 2017
1c6b74b
Merge branch 'master' of https://github.com/OfficeDev/office-ui-fabri…
jspurlin Jun 9, 2017
1612bcc
Removing the fontFamily aspect of the comboBox and utilizing the onRe…
jspurlin Jun 9, 2017
3941b20
Update based on feedback
jspurlin Jun 9, 2017
d52e4e3
Merge branch 'master' into jspurlin/ComboBox
jspurlin Jun 9, 2017
4b779c6
Jspurlin jspurlin/combo box (#2)
christiango Jun 12, 2017
ba63a49
merge
jspurlin Jun 12, 2017
8a0a24c
New Component: Stepper (#1759)
Boris-Em Jun 8, 2017
8db368f
merge some changes
jspurlin Jun 12, 2017
b1a1f6e
merge changes
jspurlin Jun 12, 2017
2be2043
merge
jspurlin Jun 12, 2017
f61ce25
Fix a new tslint warning after npm installing
jspurlin Jun 12, 2017
51e4e21
Fixing some casing warnings npm start was angry about
jspurlin Jun 12, 2017
f8e0956
Removing an extra line that got added with the last push
jspurlin Jun 12, 2017
b312e36
Create SelectableOption.ts
dzearing Jun 12, 2017
97c208f
Create SelectableOption.ts
dzearing Jun 12, 2017
80f901e
Create ComboBox.Props.ts
dzearing Jun 12, 2017
2670a5d
Create ComboBox.test.tsx
dzearing Jun 12, 2017
d02daaa
Create ComboBox.Basic.Example.tsx
dzearing Jun 12, 2017
398bdd1
Create Dropdown.Props.ts
dzearing Jun 12, 2017
12b7b7b
Fix the case sensitivity issue
jspurlin Jun 12, 2017
3536017
one more casing issue
jspurlin Jun 12, 2017
55e2ad7
changing the reference of utilities in the test file
jspurlin Jun 13, 2017
c6b98ed
Actually it look like it has to be pascalCase here
jspurlin Jun 13, 2017
460f3de
... really... what's going on with the casing here
jspurlin Jun 13, 2017
5bd6c64
Merge branch 'master' of https://github.com/OfficeDev/office-ui-fabri…
jspurlin Jun 15, 2017
3022036
Address feedback from in person review with David
jspurlin Jun 15, 2017
358d025
A few minor updated to remove uneeded comment and unneeded try/finall…
jspurlin Jun 19, 2017
705a852
Merge branch 'master' into jspurlin/ComboBox
jspurlin Jun 19, 2017
2634c1b
Merge branch 'master' of https://github.com/OfficeDev/office-ui-fabri…
jspurlin Jun 19, 2017
6b0e678
Merge branch 'jspurlin/ComboBox' of https://github.com/jspurlin/offic…
jspurlin Jun 19, 2017
9039ab4
Fix up a typo and fix up to use consistent syntax on a few lines
jspurlin Jun 19, 2017
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
9 changes: 8 additions & 1 deletion apps/fabric-website/src/components/App/AppState.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -129,6 +129,13 @@ export const AppState: IAppState = {
component: () => <LoadingComponent title='ColorPicker' />,
getComponent: cb => require.ensure([], (require) => cb(require<any>('../../pages/Components/ColorPickerComponentPage').ColorPickerComponentPage))
},
{
title: 'ComboBox',
url: '#/components/ComboBox',
component: () => <LoadingComponent title='ComboBox' />,
getComponent: cb => require.ensure([], (require) => cb(require<any>('../../pages/Components/ComboBoxComponentPage').ComboBoxComponentPage))

},
{
title: 'CommandBar',
url: '#/components/commandbar',
Expand Down Expand Up @@ -401,4 +408,4 @@ export const AppState: IAppState = {
getComponent: cb => require.ensure([], (require) => cb(require<any>('../../pages/Interstitials/FabricIOSPage').FabricIOSPage))
}
]
};
};
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
import * as React from 'react';
import { ComboBoxPage } from 'office-ui-fabric-react/lib/components/ComboBox/ComboBoxPage';
import { PageHeader } from '../../components/PageHeader/PageHeader';
import { ComponentPage } from '../../components/ComponentPage/ComponentPage';

export class ComboBoxComponentPage extends React.Component<any, any> {
public render() {
return (
<div ref='pageElement'>
<ComponentPage>
<PageHeader pageTitle='ComboBox' backgroundColor='#038387'
links={
[
{
'text': 'Overview',
'location': 'Overview'
},
{
'text': 'Variants',
'location': 'Variants'
},
{
'text': 'Implementation',
'location': 'Implementation'
}
]
} />
<ComboBoxPage isHeaderVisible={ false } />
</ComponentPage>
</div>
);
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
{
"changes": [
{
"packageName": "@uifabric/fabric-website",
"comment": "Fix issues with dev.office.com header",
"type": "patch"
}
],
"packageName": "@uifabric/fabric-website",
"email": "[email protected]"
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
{
"changes": [
{
"packageName": "@uifabric/fabric-website",
"comment": "Fix issues with dev.office.com header",
"type": "patch"
}
],
"packageName": "@uifabric/fabric-website",
"email": "[email protected]"
}
78 changes: 45 additions & 33 deletions common/config/rush/npm-shrinkwrap.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions packages/office-ui-fabric-react/src/ComboBox.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export * from './components/ComboBox/index';
1 change: 1 addition & 0 deletions packages/office-ui-fabric-react/src/SelectableOption.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export * from './utilities/selectableOption/index';
1 change: 1 addition & 0 deletions packages/office-ui-fabric-react/src/VisualTestState.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ export const VisualTestState: IVisualTestState = {
'./Button/ButtonPage.visualtest',
'./Checkbox/CheckboxPage.visualtest',
'./ChoiceGroup/ChoiceGroupPage.visualtest',
'./ComboBox/ComboBoxPage.visualtest',
'./CommandBar/CommandBarPage.visualtest',
'./ContextualMenu/ContextualMenuPage.visualtest',
'./DetailsList/DetailsListPage.visualtest',
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
import { IIconProps } from '../../Icon';
import { ISelectableOption } from '../../utilities/selectableOption/SelectableOption.Props';
import { ISelectableDroppableTextProps } from '../../utilities/selectableOption/SelectableDroppableText.Props';

export interface IComboBox {
/**
* Sets focus to the input in the comboBox
* @returns True if focus could be set, false if no operation was taken.
*/
focus(): boolean;
}

export interface IComboBoxProps extends ISelectableDroppableTextProps<IComboBox> {
/**
* Optional callback to access the IComboBox interface. Use this instead of ref for accessing
* the public methods and properties of the component.
*/
componentRef?: (component: IComboBox) => void;

/**
* Collection of options for this ComboBox
*/
options?: ISelectableOption[];

/**
* Callback issues when either:
* 1) the selected option changes
* 2) a manually edited value is submitted. In this case there may not be a matched option if allowFreeform is also true
* (and hence only value would be true, the other parameter would be null in this case)
*/
onChanged?: (option?: ISelectableOption, index?: number, value?: string) => void;

/**
* Callback issued when the options should be resolved, if they have been updated or
* if they need to be passed in the first time
*/
onResolveOptions?: (options: ISelectableOption[]) => ISelectableOption[] | PromiseLike<ISelectableOption[]>;

/**
* Whether the ComboBox is free form, meaning that the user input is not bound to provided items. Defaults to false.
*/
allowFreeform?: boolean;

Choose a reason for hiding this comment

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

Can this be renamed to something like unconstrainedInput?

Copy link
Contributor Author

Choose a reason for hiding this comment

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


/**
* Whether the ComboBox auto completes. As the user is inputing text, it will be suggested potential matches from the list of items. If
* the combo box is expanded, this will also scroll to the suggested item, and give it a selected style. Defaults to false.
*/
autoComplete?: boolean;

/**
* Value to show in the input, does not have to map to a combobox option
*/
value?: string;

Choose a reason for hiding this comment

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

should be mutually exclusive with defaultSelectedKey and selectedKey?

Choose a reason for hiding this comment

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

What's the scenario that requires this extra prop?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Sure, I'll add the mutually exclusive warning. Really, you could have a selectedKey and a default value to show if desired, but I can't think of a case where you would not want to use the selected options value if it was known

Copy link
Contributor Author

Choose a reason for hiding this comment

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

The scenario that requires this prop is the font size combobox, it allows freeform and will allow for input like "11.5" as valid, but will not add that value as an option in the menu.

Another case where is could be needed is when all the options are gotten at a later time than when the component is rendered. This allows the creator pass in the value to show without having 1) have any other info, 2) duplicate data just to make the rendering work

Choose a reason for hiding this comment

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

thanks, that make sense. I wonder if renaming the variable can make that clearer.


/**
* The IconProps to use for the button aspect of the combobox
*/
buttonIconProps?: IIconProps;
}
Loading