Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
1 change: 1 addition & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
"messagebar",
"nrwl",
"renderprop",
"scrollable",
"submenu",
"uifabric",
"unmount",
Expand Down
2 changes: 1 addition & 1 deletion libs/fabric/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@
"@angular/core": "^6.1.0",
"@angular/platform-browser-dynamic": "^6.1.0",
"@angular/platform-browser": "^6.1.0",
"office-ui-fabric-react": "6.43.0",
"office-ui-fabric-react": "6.73.0",
"react-dom": "^16.4.1",
"react": "^16.4.1"
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ import { FabBaseButtonComponent } from './base-button.component';
[splitButtonAriaLabel]="splitButtonAriaLabel"
[menuAs]="menuAs"
[secondaryText]="secondaryText"
[toggled]="toggled"
[toggle]="toggle"
[data]="data"
[getClassNames]="getClassNames"
[getSplitButtonClassNames]="getSplitButtonClassNames"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ export abstract class FabBaseButtonComponent extends ReactWrapperComponent<IButt
@Input()
secondaryText?: IButtonProps['secondaryText'];
@Input()
toggled?: IButtonProps['toggled'];
toggled?: IButtonProps['toggle'];
@Input()
data?: IButtonProps['data'];
@Input()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ import { FabBaseButtonComponent } from './base-button.component';
[splitButtonAriaLabel]="splitButtonAriaLabel"
[menuAs]="menuAs"
[secondaryText]="secondaryText"
[toggled]="toggled"
[toggle]="toggle"
[data]="data"
[getClassNames]="getClassNames"
[getSplitButtonClassNames]="getSplitButtonClassNames"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ import { FabBaseButtonComponent } from './base-button.component';
[splitButtonAriaLabel]="splitButtonAriaLabel"
[menuAs]="menuAs"
[secondaryText]="secondaryText"
[toggled]="toggled"
[toggle]="toggle"
[data]="data"
[getClassNames]="getClassNames"
[getSplitButtonClassNames]="getSplitButtonClassNames"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ import { FabBaseButtonComponent } from './base-button.component';
[splitButtonAriaLabel]="splitButtonAriaLabel"
[menuAs]="menuAs"
[secondaryText]="secondaryText"
[toggled]="toggled"
[toggle]="toggle"
[data]="data"
[getClassNames]="getClassNames"
[getSplitButtonClassNames]="getSplitButtonClassNames"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ import { FabBaseButtonComponent } from './base-button.component';
[splitButtonAriaLabel]="splitButtonAriaLabel"
[menuAs]="menuAs"
[secondaryText]="secondaryText"
[toggled]="toggled"
[toggle]="toggle"
[data]="data"
[getClassNames]="getClassNames"
[getSplitButtonClassNames]="getSplitButtonClassNames"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ import { FabBaseButtonComponent } from './base-button.component';
[splitButtonAriaLabel]="splitButtonAriaLabel"
[menuAs]="menuAs"
[secondaryText]="secondaryText"
[toggled]="toggled"
[toggle]="toggle"
[data]="data"
[getClassNames]="getClassNames"
[getSplitButtonClassNames]="getSplitButtonClassNames"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ import { FabBaseButtonComponent } from './base-button.component';
[splitButtonAriaLabel]="splitButtonAriaLabel"
[menuAs]="menuAs"
[secondaryText]="secondaryText"
[toggled]="toggled"
[toggle]="toggle"
[data]="data"
[getClassNames]="getClassNames"
[getSplitButtonClassNames]="getSplitButtonClassNames"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ import { FabBaseButtonComponent } from './base-button.component';
[splitButtonAriaLabel]="splitButtonAriaLabel"
[menuAs]="menuAs"
[secondaryText]="secondaryText"
[toggled]="toggled"
[toggle]="toggle"
[data]="data"
[getClassNames]="getClassNames"
[getSplitButtonClassNames]="getSplitButtonClassNames"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,17 @@
// Licensed under the MIT License.

import { ReactWrapperComponent } from '@angular-react/core';
import { ChangeDetectionStrategy, ChangeDetectorRef, Component, ElementRef, EventEmitter, Input, Output, Renderer2, ViewChild } from '@angular/core';
import {
ChangeDetectionStrategy,
ChangeDetectorRef,
Component,
ElementRef,
EventEmitter,
Input,
Output,
Renderer2,
ViewChild,
} from '@angular/core';
import { IChoiceGroupOption, IChoiceGroupProps } from 'office-ui-fabric-react/lib/ChoiceGroup';

@Component({
Expand All @@ -19,6 +29,7 @@ import { IChoiceGroupOption, IChoiceGroupProps } from 'office-ui-fabric-react/li
[required]="required"
[theme]="theme"
[styles]="styles"
[ariaLabelledBy]="ariaLabelledBy"
[Changed]="onChangedHandler"
[Change]="onChangeHandler"
>
Expand All @@ -45,6 +56,8 @@ export class FabChoiceGroupComponent extends ReactWrapperComponent<IChoiceGroupP
theme?: IChoiceGroupProps['theme'];
@Input()
styles?: IChoiceGroupProps['styles'];
@Input()
ariaLabelledBy?: IChoiceGroupProps['ariaLabelledBy'];

/** HTML Input props */
@Input()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

import { InputRendererOptions, JsxRenderFunc, ReactWrapperComponent } from '@angular-react/core';
import { ChangeDetectorRef, ElementRef, EventEmitter, Input, OnInit, Output, Renderer2 } from '@angular/core';
import { IComboBoxOption, IComboBoxProps } from 'office-ui-fabric-react/lib/ComboBox';
import { IComboBox, IComboBoxOption, IComboBoxProps } from 'office-ui-fabric-react/lib/ComboBox';

export abstract class FabBaseComboBoxComponent extends ReactWrapperComponent<IComboBoxProps> implements OnInit {
@Input()
Expand Down Expand Up @@ -47,11 +47,11 @@ export abstract class FabBaseComboBoxComponent extends ReactWrapperComponent<ICo
renderLowerContent?: InputRendererOptions<IComboBoxProps>;

@Output()
readonly onChanged = new EventEmitter<{
readonly onChange = new EventEmitter<{
event: Event;
option?: IComboBoxOption;
index?: number;
value?: string;
submitPendingValueEvent?: any;
}>();
@Output()
readonly onPendingValueChanged = new EventEmitter<{ option?: IComboBoxOption; index?: number; value?: string }>();
Expand All @@ -68,7 +68,7 @@ export abstract class FabBaseComboBoxComponent extends ReactWrapperComponent<ICo
super(elementRef, changeDetectorRef, renderer);

// coming from React context - we need to bind to this so we can access the Angular Component properties
this.onChangedHandler = this.onChangedHandler.bind(this);
this.onChangeHandler = this.onChangeHandler.bind(this);
this.onPendingValueChangedHandler = this.onPendingValueChangedHandler.bind(this);
this.onScrollToItemHandler = this.onScrollToItemHandler.bind(this);
}
Expand All @@ -77,12 +77,12 @@ export abstract class FabBaseComboBoxComponent extends ReactWrapperComponent<ICo
this.onRenderLowerContent = this.createRenderPropHandler(this.renderLowerContent);
}

onChangedHandler(option?: IComboBoxOption, index?: number, value?: string, submitPendingValueEvent?: any) {
this.onChanged.emit({
onChangeHandler(event: React.FormEvent<IComboBox>, option?: IComboBoxOption, index?: number, value?: string) {
this.onChange.emit({
event: event.nativeEvent,
option,
index,
value,
submitPendingValueEvent,
});
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ import { FabBaseComboBoxComponent } from './base-combo-box.component';
[isButtonAriaHidden]="isButtonAriaHidden"
[keytipProps]="keytipProps"
[RenderLowerContent]="renderLowerContent && onRenderLowerContent"
[Changed]="onChangedHandler"
[Change]="onChangeHandler"
[PendingValueChanged]="onPendingValueChangedHandler"
[ResolveOptions]="resolveOptions"
[ScrollToItem]="onScrollToItemHandler"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ import { FabBaseComboBoxComponent } from './base-combo-box.component';
[isButtonAriaHidden]="isButtonAriaHidden"
[keytipProps]="keytipProps"
[RenderLowerContent]="renderLowerContent && onRenderLowerContent"
[Changed]="onChangedHandler"
[Change]="onChangeHandler"
[PendingValueChanged]="onPendingValueChangedHandler"
[ResolveOptions]="resolveOptions"
[ScrollToItem]="onScrollToItemHandler"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ import { IDatePickerProps } from 'office-ui-fabric-react';
[isRequired]="isRequired"
[disabled]="disabled"
[ariaLabel]="ariaLabel"
[underlined]="underlined"
[pickerAriaLabel]="pickerAriaLabel"
[isMonthPickerVisible]="isMonthPickerVisible"
[showMonthPickerAsOverlay]="showMonthPickerAsOverlay"
Expand All @@ -50,6 +51,8 @@ import { IDatePickerProps } from 'office-ui-fabric-react';
[minDate]="minDate"
[maxDate]="maxDate"
[initialPickerDate]="initialPickerDate"
[allFocusable]="allFocusable"
[showCloseButton]="showCloseButton"
[SelectDate]="onSelectDateHandler"
(onAfterMenuDismiss)="onAfterMenuDismiss.emit()">
</DatePicker>
Expand All @@ -74,6 +77,8 @@ export class FabDatePickerComponent extends ReactWrapperComponent<IDatePickerPro
@Input()
ariaLabel?: IDatePickerProps['ariaLabel'];
@Input()
underlined?: IDatePickerProps['underlined'];
@Input()
pickerAriaLabel?: IDatePickerProps['pickerAriaLabel'];
@Input()
isMonthPickerVisible?: IDatePickerProps['isMonthPickerVisible'];
Expand Down Expand Up @@ -119,6 +124,10 @@ export class FabDatePickerComponent extends ReactWrapperComponent<IDatePickerPro
maxDate?: IDatePickerProps['maxDate'];
@Input()
initialPickerDate?: IDatePickerProps['initialPickerDate'];
@Input()
allFocusable?: IDatePickerProps['allFocusable'];
@Input()
showCloseButton?: IDatePickerProps['showCloseButton'];

@Output()
readonly onSelectDate = new EventEmitter<{ date: Date | null | undefined }>();
Expand Down
18 changes: 17 additions & 1 deletion libs/fabric/src/lib/components/dialog/dialog.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,17 @@
// Licensed under the MIT License.

import { ReactWrapperComponent } from '@angular-react/core';
import { ChangeDetectionStrategy, ChangeDetectorRef, Component, ElementRef, EventEmitter, Input, Output, Renderer2, ViewChild } from '@angular/core';
import {
ChangeDetectionStrategy,
ChangeDetectorRef,
Component,
ElementRef,
EventEmitter,
Input,
Output,
Renderer2,
ViewChild,
} from '@angular/core';
import { IDialogContentProps, IDialogFooterProps, IDialogProps } from 'office-ui-fabric-react/lib/Dialog';

@Component({
Expand All @@ -24,6 +34,8 @@ import { IDialogContentProps, IDialogFooterProps, IDialogProps } from 'office-ui
[dialogContentProps]="dialogContentProps"
[hidden]="hidden"
[modalProps]="modalProps"
[minWidth]="minWidth"
[maxWidth]="maxWidth"
(onDismiss)="onDismissHandler($event)">
<ReactContent><ng-content></ng-content></ReactContent>
</Dialog>
Expand Down Expand Up @@ -61,6 +73,10 @@ export class FabDialogComponent extends ReactWrapperComponent<IDialogProps> {
hidden?: IDialogProps['hidden'];
@Input()
modalProps?: IDialogProps['modalProps'];
@Input()
minWidth?: IDialogProps['minWidth'];
@Input()
maxWidth?: IDialogProps['maxWidth'];

@Output()
readonly onDismiss = new EventEmitter<MouseEvent>();
Expand Down
15 changes: 14 additions & 1 deletion libs/fabric/src/lib/components/modal/modal.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,17 @@
// Licensed under the MIT License.

import { ReactWrapperComponent } from '@angular-react/core';
import { ChangeDetectionStrategy, ChangeDetectorRef, Component, ElementRef, EventEmitter, Input, Output, Renderer2, ViewChild } from '@angular/core';
import {
ChangeDetectionStrategy,
ChangeDetectorRef,
Component,
ElementRef,
EventEmitter,
Input,
Output,
Renderer2,
ViewChild,
} from '@angular/core';
import { IAccessiblePopupProps } from 'office-ui-fabric-react/lib/common/IAccessiblePopupProps';
import { IModalProps } from 'office-ui-fabric-react/lib/Modal';
import { IWithResponsiveModeState } from 'office-ui-fabric-react/lib/utilities/decorators/withResponsiveMode';
Expand All @@ -29,6 +39,7 @@ import { IWithResponsiveModeState } from 'office-ui-fabric-react/lib/utilities/d
[isBlocking]="isBlocking"
[className]="className"
[containerClassName]="containerClassName"
[scrollableContentClassName]="scrollableContentClassName"
[titleAriaId]="titleAriaId"
[subtitleAriaId]="subtitleAriaId"
[Dismiss]="onDismissHandler"
Expand Down Expand Up @@ -74,6 +85,8 @@ export class FabModalComponent extends ReactWrapperComponent<IModalProps>
@Input()
containerClassName?: IModalProps['containerClassName'];
@Input()
scrollableContentClassName?: IModalProps['scrollableContentClassName'];
@Input()
titleAriaId?: IModalProps['titleAriaId'];
@Input()
subtitleAriaId?: IModalProps['subtitleAriaId'];
Expand Down
30 changes: 27 additions & 3 deletions libs/fabric/src/lib/components/panel/panel.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,18 @@
// Licensed under the MIT License.

import { InputRendererOptions, JsxRenderFunc, ReactWrapperComponent } from '@angular-react/core';
import { ChangeDetectionStrategy, ChangeDetectorRef, Component, ElementRef, EventEmitter, Input, OnInit, Output, Renderer2, ViewChild } from '@angular/core';
import {
ChangeDetectionStrategy,
ChangeDetectorRef,
Component,
ElementRef,
EventEmitter,
Input,
OnInit,
Output,
Renderer2,
ViewChild,
} from '@angular/core';
import { IPanelHeaderRenderer, IPanelProps } from 'office-ui-fabric-react/lib/Panel';

@Component({
Expand All @@ -19,6 +30,8 @@ import { IPanelHeaderRenderer, IPanelProps } from 'office-ui-fabric-react/lib/Pa
[isBlocking]="isBlocking"
[isFooterAtBottom]="isFooterAtBottom"
[headerText]="headerText"
[styles]="styles"
[theme]="theme"
[className]="className"
[type]="type"
[customWidth]="customWidth"
Expand All @@ -36,7 +49,7 @@ import { IPanelHeaderRenderer, IPanelProps } from 'office-ui-fabric-react/lib/Pa
[RenderBody]="renderBody && onRenderBody"
[RenderFooter]="renderFooter && onRenderFooter"
[RenderFooterContent]="renderFooterContent && onRenderFooterContent"
(onDismiss)="onDismiss.emit($event)"
[Dismiss]="onDismissHandler"
(onDismissed)="onDismissed.emit($event)"
(onLightDismissClick)="onLightDismissClick.emit($event)">
<ReactContent><ng-content></ng-content></ReactContent>
Expand Down Expand Up @@ -66,6 +79,10 @@ export class FabPanelComponent extends ReactWrapperComponent<IPanelProps> implem
@Input()
headerText?: IPanelProps['headerText'];
@Input()
styles?: IPanelProps['styles'];
@Input()
theme?: IPanelProps['theme'];
@Input()
className?: IPanelProps['className'];
@Input()
type?: IPanelProps['type'];
Expand Down Expand Up @@ -104,7 +121,7 @@ export class FabPanelComponent extends ReactWrapperComponent<IPanelProps> implem
@Output()
readonly onLightDismissClick = new EventEmitter<void>();
@Output()
readonly onDismiss = new EventEmitter<void>();
readonly onDismiss = new EventEmitter<{ ev?: Event }>();
@Output()
readonly onDismissed = new EventEmitter<void>();

Expand All @@ -119,6 +136,7 @@ export class FabPanelComponent extends ReactWrapperComponent<IPanelProps> implem

// coming from React context - we need to bind to this so we can access the Angular Component properties
this.onRenderHeader = this.onRenderHeader.bind(this);
this.onDismissHandler = this.onDismissHandler.bind(this);
}

ngOnInit() {
Expand All @@ -140,6 +158,12 @@ export class FabPanelComponent extends ReactWrapperComponent<IPanelProps> implem

return this._renderHeader({ props, headerTextId });
}

onDismissHandler(ev?: React.SyntheticEvent<HTMLElement>) {
this.onDismiss.emit({
ev: ev && ev.nativeEvent,
});
}
}

/**
Expand Down
Loading