1- import { ReactWrapperComponent , InputRendererOptions , JsxRenderFunc } from '@angular-react/core' ;
2- import {
3- ChangeDetectionStrategy ,
4- Component ,
5- ElementRef ,
6- Input ,
7- ViewChild ,
8- OnInit ,
9- Output ,
10- EventEmitter ,
11- ChangeDetectorRef ,
12- } from '@angular/core' ;
13- import { IBasePickerProps , BaseAutoFill } from 'office-ui-fabric-react/lib/Pickers' ;
1+ import { InputRendererOptions , JsxRenderFunc , ReactWrapperComponent } from '@angular-react/core' ;
2+ import { ChangeDetectorRef , ElementRef , EventEmitter , Input , OnInit , Output } from '@angular/core' ;
143import { IPersonaProps } from 'office-ui-fabric-react/lib/Persona' ;
15- import { IPickerItemProps , IBasePickerSuggestionsProps } from 'office-ui-fabric-react/lib/Pickers' ;
4+ import {
5+ BaseAutoFill ,
6+ IBasePickerProps ,
7+ IBasePickerSuggestionsProps ,
8+ IPickerItemProps ,
9+ } from 'office-ui-fabric-react/lib/Pickers' ;
10+ import { Omit } from '../../../declarations/omit' ;
1611import omit from '../../../utils/omit' ;
1712
1813export abstract class FabBasePickerComponent < T , TProps extends IBasePickerProps < T > >
1914 extends ReactWrapperComponent < TProps >
2015 implements OnInit {
21- @Input ( ) componentRef ?: IBasePickerProps < T > [ 'componentRef' ] ;
22- @Input ( ) resolveDelay ?: IBasePickerProps < T > [ 'resolveDelay' ] ;
23- @Input ( ) defaultSelectedItems ?: IBasePickerProps < T > [ 'defaultSelectedItems' ] ;
24- @Input ( ) getTextFromItem ?: IBasePickerProps < T > [ 'getTextFromItem' ] ;
25- @Input ( ) className ?: IBasePickerProps < T > [ 'className' ] ;
26- @Input ( ) searchingText ?: IBasePickerProps < T > [ 'searchingText' ] ;
27- @Input ( ) disabled ?: IBasePickerProps < T > [ 'disabled' ] ;
28- @Input ( ) itemLimit ?: IBasePickerProps < T > [ 'itemLimit' ] ;
29- @Input ( ) createGenericItem ?: IBasePickerProps < T > [ 'createGenericItem' ] ;
30- @Input ( ) removeButtonAriaLabel ?: IBasePickerProps < T > [ 'removeButtonAriaLabel' ] ;
31- @Input ( ) selectedItems ?: IBasePickerProps < T > [ 'selectedItems' ] ;
32- @Input ( ) enableSelectedSuggestionAlert ?: IBasePickerProps < T > [ 'enableSelectedSuggestionAlert' ] ;
33- @Input ( ) inputProps ?: IBasePickerProps < T > [ 'inputProps' ] ;
34- @Input ( 'itemSelected' ) onItemSelected ?: ( selectedItem ?: T ) => T | PromiseLike < T > | null ;
35- @Input ( 'inputChange' ) onInputChange ?: ( input : string ) => string ;
36- @Input ( 'emptyInputFocus' ) onEmptyInputFocus ?: IBasePickerProps < T > [ 'onEmptyInputFocus' ] ;
37- @Input ( 'resolveSuggestions' ) onResolveSuggestions : IBasePickerProps < T > [ 'onResolveSuggestions' ] ;
38- @Input ( 'getMoreResults' ) onGetMoreResults ?: IBasePickerProps < T > [ 'onGetMoreResults' ] ;
39- @Input ( 'validateInput' ) onValidateInput ?: IBasePickerProps < T > [ 'onValidateInput' ] ;
16+ @Input ( )
17+ componentRef ?: IBasePickerProps < T > [ 'componentRef' ] ;
18+ @Input ( )
19+ resolveDelay ?: IBasePickerProps < T > [ 'resolveDelay' ] ;
20+ @Input ( )
21+ defaultSelectedItems ?: IBasePickerProps < T > [ 'defaultSelectedItems' ] ;
22+ @Input ( )
23+ getTextFromItem ?: IBasePickerProps < T > [ 'getTextFromItem' ] ;
24+ @Input ( )
25+ className ?: IBasePickerProps < T > [ 'className' ] ;
26+ @Input ( )
27+ searchingText ?: IBasePickerProps < T > [ 'searchingText' ] ;
28+ @Input ( )
29+ disabled ?: IBasePickerProps < T > [ 'disabled' ] ;
30+ @Input ( )
31+ itemLimit ?: IBasePickerProps < T > [ 'itemLimit' ] ;
32+ @Input ( )
33+ createGenericItem ?: IBasePickerProps < T > [ 'createGenericItem' ] ;
34+ @Input ( )
35+ removeButtonAriaLabel ?: IBasePickerProps < T > [ 'removeButtonAriaLabel' ] ;
36+ @Input ( )
37+ selectedItems ?: IBasePickerProps < T > [ 'selectedItems' ] ;
38+ @Input ( )
39+ enableSelectedSuggestionAlert ?: IBasePickerProps < T > [ 'enableSelectedSuggestionAlert' ] ;
40+ @Input ( )
41+ inputProps ?: IBasePickerProps < T > [ 'inputProps' ] ;
42+ @Input ( 'itemSelected' )
43+ onItemSelected ?: ( selectedItem ?: T ) => T | PromiseLike < T > | null ;
44+ @Input ( 'inputChange' )
45+ onInputChange ?: ( input : string ) => string ;
46+ @Input ( 'emptyInputFocus' )
47+ onEmptyInputFocus ?: IBasePickerProps < T > [ 'onEmptyInputFocus' ] ;
48+ @Input ( 'resolveSuggestions' )
49+ onResolveSuggestions : IBasePickerProps < T > [ 'onResolveSuggestions' ] ;
50+ @Input ( 'getMoreResults' )
51+ onGetMoreResults ?: IBasePickerProps < T > [ 'onGetMoreResults' ] ;
52+ @Input ( 'validateInput' )
53+ onValidateInput ?: IBasePickerProps < T > [ 'onValidateInput' ] ;
4054
4155 @Input ( )
4256 set pickerSuggestionsOptions ( value : IBasePickerSuggestionsOptions ) {
@@ -51,14 +65,21 @@ export abstract class FabBasePickerComponent<T, TProps extends IBasePickerProps<
5165 return this . _pickerSuggestionsOptions ;
5266 }
5367
54- @Input ( ) renderItem ?: InputRendererOptions < IPickerItemProps < T > > ;
55- @Input ( ) renderSuggestionsItem ?: InputRendererOptions < IRenderSuggestionItemContext < T > > ;
56-
57- @Output ( ) readonly onChange = new EventEmitter < { items ?: T [ ] } > ( ) ;
58- @Output ( ) readonly onFocus = new EventEmitter < FocusEvent > ( ) ;
59- @Output ( ) readonly onBlur = new EventEmitter < FocusEvent > ( ) ;
60- @Output ( ) readonly onDismiss = new EventEmitter < { ev ?: any ; selectedItem ?: T } > ( ) ;
61- @Output ( ) readonly onRemoveSuggestion = new EventEmitter < { item : IPersonaProps } > ( ) ;
68+ @Input ( )
69+ renderItem ?: InputRendererOptions < IPickerItemProps < T > > ;
70+ @Input ( )
71+ renderSuggestionsItem ?: InputRendererOptions < IRenderSuggestionItemContext < T > > ;
72+
73+ @Output ( )
74+ readonly onChange = new EventEmitter < { items ?: T [ ] } > ( ) ;
75+ @Output ( )
76+ readonly onFocus = new EventEmitter < FocusEvent > ( ) ;
77+ @Output ( )
78+ readonly onBlur = new EventEmitter < FocusEvent > ( ) ;
79+ @Output ( )
80+ readonly onDismiss = new EventEmitter < { ev ?: any ; selectedItem ?: T } > ( ) ;
81+ @Output ( )
82+ readonly onRemoveSuggestion = new EventEmitter < { item : IPersonaProps } > ( ) ;
6283
6384 pickerSuggestionsProps : IBasePickerSuggestionsProps ;
6485 onRenderSuggestionsItem : (
@@ -140,23 +161,7 @@ export abstract class FabBasePickerComponent<T, TProps extends IBasePickerProps<
140161}
141162
142163export interface IBasePickerSuggestionsOptions
143- extends Pick <
144- IBasePickerSuggestionsProps ,
145- | 'suggestionsHeaderText'
146- | 'mostRecentlyUsedHeaderText'
147- | 'noResultsFoundText'
148- | 'className'
149- | 'suggestionsClassName'
150- | 'suggestionsItemClassName'
151- | 'searchForMoreText'
152- | 'forceResolveText'
153- | 'loadingText'
154- | 'searchingText'
155- | 'resultsMaximumNumber'
156- | 'showRemoveButtons'
157- | 'suggestionsAvailableAlertText'
158- | 'suggestionsContainerAriaLabel'
159- > {
164+ extends Omit < IBasePickerSuggestionsProps , 'onRenderNoResultFound' | 'resultsFooterFull' | 'resultsFooter' > {
160165 readonly renderNoResultFound : InputRendererOptions < { } > ;
161166 readonly renderResultsFooterFull : InputRendererOptions < { } > ;
162167 readonly renderResultsFooter : InputRendererOptions < { } > ;
0 commit comments