Skip to content

Commit

Permalink
Merge pull request #1407 from joaojmendes/dev
Browse files Browse the repository at this point in the history
Add Styles property to ListItemPicker and ComboBoxListItemPicker
  • Loading branch information
joelfmrodrigues authored Jan 4, 2023
2 parents 9dbd5ae + 784e4ca commit 2222c83
Show file tree
Hide file tree
Showing 6 changed files with 39 additions and 4 deletions.
14 changes: 14 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,19 @@
# Releases

## 3.13.0

### Enhancements

- `ListItemPicker`: use list name as well as GUID to point to list [#1355](https://github.com/pnp/sp-dev-fx-controls-react/issues/1355)

### Fixes

- `DateTimePicker`: broken link for `getErrorMessage` property fixed [#1277](https://github.com/pnp/sp-dev-fx-controls-react/pull/1381)

### Contributors

Special thanks to our contributors (in alphabetical order): [Edin Kapic](https://github.com/ekapic), [Harminder Singh](https://github.com/HarminderSethi).

## 3.12.0

### Enhancements
Expand Down
14 changes: 14 additions & 0 deletions docs/documentation/docs/about/release-notes.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,19 @@
# Releases

## 3.13.0

### Enhancements

- `ListItemPicker`: use list name as well as GUID to point to list [#1355](https://github.com/pnp/sp-dev-fx-controls-react/issues/1355)

### Fixes

- `DateTimePicker`: broken link for `getErrorMessage` property fixed [#1277](https://github.com/pnp/sp-dev-fx-controls-react/pull/1381)

### Contributors

Special thanks to our contributors (in alphabetical order): [Edin Kapic](https://github.com/ekapic), [Harminder Singh](https://github.com/HarminderSethi).

## 3.12.0

### Enhancements
Expand Down
5 changes: 3 additions & 2 deletions src/controls/listItemPicker/ComboBoxListItemPicker.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -41,9 +41,9 @@ export class ComboBoxListItemPicker extends React.Component<IComboBoxListItemPic
.then((value) => {
this.setState({...this.state,
safeListId: value });
this.loadOptions(this.props).then(() => { /* no-op; */}).catch(() => { /* no-op; */});
this.loadOptions(this.props).then(() => { /* no-op; */}).catch(() => { /* no-op; */});
})
.catch(() => { /* no-op; */ });
.catch(() => { /* no-op; */ });
} else {
this.loadOptions(this.props).then(() => { /* no-op; */}).catch(() => { /* no-op; */});
}
Expand Down Expand Up @@ -151,6 +151,7 @@ export class ComboBoxListItemPicker extends React.Component<IComboBoxListItemPic
return (
<div className={styles.comboBoxListItemPickerWrapper}>
<ComboBox label={this.props.label}
styles={this.props.styles}
options={this.state.availableOptions}
autoComplete={this.props.autoComplete}
comboBoxOptionStyles={this.props.comboBoxOptionStyles}
Expand Down
4 changes: 3 additions & 1 deletion src/controls/listItemPicker/IComboBoxListItemPickerProps.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import { IComboBoxOptionStyles } from "office-ui-fabric-react/lib/components/ComboBox";
import { IComboBoxOptionStyles, IComboBoxStyles } from "office-ui-fabric-react/lib/components/ComboBox";

import { IAutofillProps } from "office-ui-fabric-react/lib/components/Autofill";
import { IKeytipProps } from "office-ui-fabric-react/lib/components/Keytip";
import { SPHttpClient } from '@microsoft/sp-http';
Expand Down Expand Up @@ -30,4 +31,5 @@ export interface IComboBoxListItemPickerProps {
onSelectedItem: (item: any) => void; // eslint-disable-line @typescript-eslint/no-explicit-any
label?: string;
orderBy?:string;
styles?: IComboBoxStyles;
}
3 changes: 3 additions & 0 deletions src/controls/listItemPicker/IListItemPickerProps.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
import { IBasePickerStyles } from 'office-ui-fabric-react';

import { BaseComponentContext } from '@microsoft/sp-component-base';

export interface IListItemPickerProps {
Expand Down Expand Up @@ -32,5 +34,6 @@ export interface IListItemPickerProps {
* Enable default suggestions. All options are displayed by default when clicking on the control
*/
enableDefaultSuggestions?: boolean;
styles? : IBasePickerStyles;

}
3 changes: 2 additions & 1 deletion src/controls/listItemPicker/ListItemPicker.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ export class ListItemPicker extends React.Component<IListItemPickerProps, IListI
safeListId: value });
this.ensureLoadField();
})
.catch(() => { /* no-op; */ });
.catch(() => { /* no-op; */ });
} else {
this.ensureLoadField();
}
Expand Down Expand Up @@ -93,6 +93,7 @@ export class ListItemPicker extends React.Component<IListItemPickerProps, IListI
}
<div id={this._tagPickerId}>
<TagPicker onResolveSuggestions={this.onFilterChanged}
styles={this.props.styles}
onEmptyResolveSuggestions={(selectLists) => {
if (this.props.enableDefaultSuggestions) {
return this.onFilterChanged("", selectLists);
Expand Down

0 comments on commit 2222c83

Please sign in to comment.