|
2 | 2 | // Licensed under the MIT License. |
3 | 3 |
|
4 | 4 | import { InputRendererOptions, Omit, ReactWrapperComponent } from '@angular-react/core'; |
5 | | -import { AfterContentInit, ChangeDetectionStrategy, ChangeDetectorRef, Component, ContentChild, ElementRef, EventEmitter, Input, OnDestroy, Output, QueryList, Renderer2, ViewChild } from '@angular/core'; |
| 5 | +import { |
| 6 | + AfterContentInit, |
| 7 | + ChangeDetectionStrategy, |
| 8 | + ChangeDetectorRef, |
| 9 | + Component, |
| 10 | + ContentChild, |
| 11 | + ElementRef, |
| 12 | + EventEmitter, |
| 13 | + Input, |
| 14 | + OnDestroy, |
| 15 | + Output, |
| 16 | + QueryList, |
| 17 | + Renderer2, |
| 18 | + ViewChild, |
| 19 | +} from '@angular/core'; |
6 | 20 | import { ICommandBarItemProps, ICommandBarProps } from 'office-ui-fabric-react/lib/CommandBar'; |
7 | 21 | import { IContextualMenuItem } from 'office-ui-fabric-react/lib/ContextualMenu'; |
8 | 22 | import { Subscription } from 'rxjs'; |
9 | 23 | import { OnChanges, TypedChanges } from '../../declarations/angular/typed-changes'; |
10 | 24 | import omit from '../../utils/omit'; |
11 | 25 | import { mergeItemChanges } from '../core/declarative/item-changed'; |
12 | 26 | import { CommandBarItemChangedPayload, CommandBarItemDirective } from './directives/command-bar-item.directives'; |
13 | | -import { CommandBarFarItemsDirective, CommandBarItemsDirective, CommandBarItemsDirectiveBase, CommandBarOverflowItemsDirective } from './directives/command-bar-items.directives'; |
| 27 | +import { |
| 28 | + CommandBarFarItemsDirective, |
| 29 | + CommandBarItemsDirective, |
| 30 | + CommandBarItemsDirectiveBase, |
| 31 | + CommandBarOverflowItemsDirective, |
| 32 | +} from './directives/command-bar-items.directives'; |
14 | 33 |
|
15 | 34 | @Component({ |
16 | 35 | selector: 'fab-command-bar', |
@@ -195,17 +214,17 @@ export class FabCommandBarComponent extends ReactWrapperComponent<ICommandBarPro |
195 | 214 | return Object.assign( |
196 | 215 | {}, |
197 | 216 | sharedProperties, |
198 | | - iconRenderer && { |
199 | | - onRenderIcon: (item: IContextualMenuItem) => iconRenderer({ contextualMenuItem: item }), |
200 | | - } as any /* NOTE: Fix for wrong typings of `onRenderIcon` in office-ui-fabric-react */, |
| 217 | + iconRenderer && |
| 218 | + ({ |
| 219 | + onRenderIcon: (item: IContextualMenuItem) => iconRenderer({ contextualMenuItem: item }), |
| 220 | + } as any) /* NOTE: Fix for wrong typings of `onRenderIcon` in office-ui-fabric-react */, |
201 | 221 | renderer && |
202 | 222 | ({ onRender: (item, dismissMenu) => renderer({ item, dismissMenu }) } as Pick<ICommandBarItemProps, 'onRender'>) |
203 | 223 | ) as ICommandBarItemProps; |
204 | 224 | } |
205 | 225 | } |
206 | 226 |
|
207 | 227 | export interface ICommandBarItemOptions<TData = any> extends Omit<ICommandBarItemProps, 'onRender' | 'onRenderIcon'> { |
208 | | - readonly [propertyName: string]: any; |
209 | 228 | readonly renderIcon?: InputRendererOptions<ICommandBarItemOptionsRenderIconContext>; |
210 | 229 | readonly render?: InputRendererOptions<ICommandBarItemOptionsRenderContext>; |
211 | 230 | readonly data?: TData; |
|
0 commit comments