Skip to content

Commit 87863d9

Browse files
bengryBen Grynhaus
authored andcommitted
[Fabric] upgrade office-ui-fabric-react (#96)
Upgrade `office-ui-fabric-react` to latest version as of this PR. Notice this is a **breaking change**: * `office-ui-fabric-react` has deprecated some props - as usual - `@angular-react/fabric` doesn't support deprecated APIs and thus these were removed completely. Expect a new minor version (0.6.0) in the release following this PR's merge, in accordance with semver.
1 parent a2578b0 commit 87863d9

21 files changed

+295
-137
lines changed

libs/fabric/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@
4949
"@angular/core": "^7.0.3",
5050
"@angular/platform-browser-dynamic": "^7.0.3",
5151
"@angular/platform-browser": "^7.0.3",
52-
"office-ui-fabric-react": "6.110.0",
52+
"office-ui-fabric-react": "6.151.0",
5353
"react-dom": "^16.6.3",
5454
"react": "^16.6.3"
5555
}

libs/fabric/src/lib/components/calendar/calendar.component.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,8 @@ import { ICalendarProps } from 'office-ui-fabric-react/lib/Calendar';
4141
[dateTimeFormatter]="dateTimeFormatter"
4242
[minDate]="minDate"
4343
[maxDate]="maxDate"
44+
[maxDate]="restrictedDates"
45+
[restrictedDates]="restrictedDates"
4446
[showSixWeeksByDefault]="showSixWeeksByDefault"
4547
[workWeekDays]="workWeekDays"
4648
[selectDateOnClick]="selectDateOnClick"
@@ -78,6 +80,7 @@ export class FabCalendarComponent extends ReactWrapperComponent<ICalendarProps>
7880
@Input() dateTimeFormatter?: ICalendarProps['dateTimeFormatter'];
7981
@Input() minDate?: ICalendarProps['minDate'];
8082
@Input() maxDate?: ICalendarProps['maxDate'];
83+
@Input() restrictedDates?: ICalendarProps['restrictedDates'];
8184
@Input() showSixWeeksByDefault?: ICalendarProps['showSixWeeksByDefault'];
8285
@Input() workWeekDays?: ICalendarProps['workWeekDays'];
8386
@Input() selectDateOnClick?: ICalendarProps['selectDateOnClick'];

libs/fabric/src/lib/components/callout/callout.component.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@ import { ICalloutPositionedInfo } from 'office-ui-fabric-react/lib/utilities/pos
3434
[minPagePadding]="minPagePadding"
3535
[isBeakVisible]="isBeakVisible"
3636
[preventDismissOnScroll]="preventDismissOnScroll"
37+
[preventDismissOnResize]="preventDismissOnResize"
3738
[preventDismissOnLostFocus]="preventDismissOnLostFocus"
3839
[coverTarget]="coverTarget"
3940
[alignTargetEdge]="alignTargetEdge"
@@ -78,6 +79,7 @@ export class FabCalloutComponent extends ReactWrapperComponent<ICalloutProps> {
7879
@Input() minPagePadding?: ICalloutProps['minPagePadding'];
7980
@Input() isBeakVisible?: ICalloutProps['isBeakVisible'];
8081
@Input() preventDismissOnScroll?: ICalloutProps['preventDismissOnScroll'];
82+
@Input() preventDismissOnResize?: ICalloutProps['preventDismissOnResize'];
8183
@Input() preventDismissOnLostFocus?: ICalloutProps['preventDismissOnLostFocus'];
8284
@Input() coverTarget?: ICalloutProps['coverTarget'];
8385
@Input() alignTargetEdge?: ICalloutProps['alignTargetEdge'];

libs/fabric/src/lib/components/callout/callout.module.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
import { registerElement } from '@angular-react/core';
55
import { CommonModule } from '@angular/common';
66
import { NgModule, NO_ERRORS_SCHEMA } from '@angular/core';
7-
import { Callout } from 'office-ui-fabric-react';
7+
import { Callout, FocusTrapCallout } from 'office-ui-fabric-react';
88
import { FabCalloutComponent } from './callout.component';
99

1010
const components = [FabCalloutComponent];
@@ -19,5 +19,6 @@ export class FabCalloutModule {
1919
constructor() {
2020
// Add any React elements to the registry (used by the renderer).
2121
registerElement('Callout', () => Callout);
22+
registerElement('FocusTrapCallout', () => FocusTrapCallout);
2223
}
2324
}
Lines changed: 113 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,113 @@
1+
// Copyright (c) Microsoft Corporation. All rights reserved.
2+
// Licensed under the MIT License.
3+
4+
import { ReactWrapperComponent } from '@angular-react/core';
5+
import {
6+
ChangeDetectionStrategy,
7+
ChangeDetectorRef,
8+
Component,
9+
ElementRef,
10+
EventEmitter,
11+
Input,
12+
Output,
13+
Renderer2,
14+
ViewChild,
15+
} from '@angular/core';
16+
import { IFocusTrapCalloutProps } from 'office-ui-fabric-react';
17+
import { ICalloutPositionedInfo } from 'office-ui-fabric-react/lib/utilities/positioning';
18+
19+
@Component({
20+
selector: 'fab-focus-trap-callout',
21+
exportAs: 'fabFocusTrapCallout',
22+
template: `
23+
<FocusTrapCallout
24+
#reactNode
25+
#reactNode
26+
[componentRef]="componentRef"
27+
[target]="target"
28+
[directionalHint]="directionalHint"
29+
[directionalHintForRTL]="directionalHintForRTL"
30+
[gapSpace]="gapSpace"
31+
[beakWidth]="beakWidth"
32+
[calloutWidth]="calloutWidth"
33+
[backgroundColor]="backgroundColor"
34+
[bounds]="bounds"
35+
[minPagePadding]="minPagePadding"
36+
[isBeakVisible]="isBeakVisible"
37+
[preventDismissOnScroll]="preventDismissOnScroll"
38+
[preventDismissOnResize]="preventDismissOnResize"
39+
[preventDismissOnLostFocus]="preventDismissOnLostFocus"
40+
[coverTarget]="coverTarget"
41+
[alignTargetEdge]="alignTargetEdge"
42+
[role]="role"
43+
[ariaLabel]="ariaLabel"
44+
[ariaLabelledBy]="ariaLabelledBy"
45+
[ariaDescribedBy]="ariaDescribedBy"
46+
[className]="className"
47+
[layerProps]="layerProps"
48+
[doNotLayer]="doNotLayer"
49+
[directionalHintFixed]="directionalHintFixed"
50+
[finalHeight]="finalHeight"
51+
[hideOverflow]="hideOverflow"
52+
[setInitialFocus]="setInitialFocus"
53+
[calloutMaxHeight]="calloutMaxHeight"
54+
[theme]="theme"
55+
[styles]="styles"
56+
[hidden]="hidden"
57+
[focusTrapProps]="focusTrapProps"
58+
(onLayerMounted)="onLayerMounted.emit()"
59+
(onPositioned)="onPositioned.emit($event)"
60+
(onDismiss)="onDismiss.emit($event)"
61+
(onScroll)="onScroll.emit()"
62+
>
63+
<ReactContent><ng-content></ng-content></ReactContent>
64+
</Callout>
65+
`,
66+
styles: ['react-renderer'],
67+
changeDetection: ChangeDetectionStrategy.OnPush,
68+
})
69+
export class FabFocusTrapCalloutComponent extends ReactWrapperComponent<IFocusTrapCalloutProps> {
70+
@ViewChild('reactNode') protected reactNodeRef: ElementRef;
71+
72+
@Input() componentRef?: IFocusTrapCalloutProps['componentRef'];
73+
@Input() target?: IFocusTrapCalloutProps['target'];
74+
@Input() directionalHint?: IFocusTrapCalloutProps['directionalHint'];
75+
@Input() directionalHintForRTL?: IFocusTrapCalloutProps['directionalHintForRTL'];
76+
@Input() gapSpace?: IFocusTrapCalloutProps['gapSpace'];
77+
@Input() beakWidth?: IFocusTrapCalloutProps['beakWidth'];
78+
@Input() calloutWidth?: IFocusTrapCalloutProps['calloutWidth'];
79+
@Input() backgroundColor?: IFocusTrapCalloutProps['backgroundColor'];
80+
@Input() bounds?: IFocusTrapCalloutProps['bounds'];
81+
@Input() minPagePadding?: IFocusTrapCalloutProps['minPagePadding'];
82+
@Input() isBeakVisible?: IFocusTrapCalloutProps['isBeakVisible'];
83+
@Input() preventDismissOnScroll?: IFocusTrapCalloutProps['preventDismissOnScroll'];
84+
@Input() preventDismissOnResize?: IFocusTrapCalloutProps['preventDismissOnResize'];
85+
@Input() preventDismissOnLostFocus?: IFocusTrapCalloutProps['preventDismissOnLostFocus'];
86+
@Input() coverTarget?: IFocusTrapCalloutProps['coverTarget'];
87+
@Input() alignTargetEdge?: IFocusTrapCalloutProps['alignTargetEdge'];
88+
@Input() role?: IFocusTrapCalloutProps['role'];
89+
@Input() ariaLabel?: IFocusTrapCalloutProps['ariaLabel'];
90+
@Input() ariaLabelledBy?: IFocusTrapCalloutProps['ariaLabelledBy'];
91+
@Input() ariaDescribedBy?: IFocusTrapCalloutProps['ariaDescribedBy'];
92+
@Input() className?: IFocusTrapCalloutProps['className'];
93+
@Input() layerProps?: IFocusTrapCalloutProps['layerProps'];
94+
@Input() doNotLayer?: IFocusTrapCalloutProps['doNotLayer'];
95+
@Input() directionalHintFixed?: IFocusTrapCalloutProps['directionalHintFixed'];
96+
@Input() finalHeight?: IFocusTrapCalloutProps['finalHeight'];
97+
@Input() hideOverflow?: IFocusTrapCalloutProps['hideOverflow'];
98+
@Input() setInitialFocus?: IFocusTrapCalloutProps['setInitialFocus'];
99+
@Input() calloutMaxHeight?: IFocusTrapCalloutProps['calloutMaxHeight'];
100+
@Input() theme?: IFocusTrapCalloutProps['theme'];
101+
@Input() styles?: IFocusTrapCalloutProps['styles'];
102+
@Input() hidden?: IFocusTrapCalloutProps['hidden'];
103+
@Input() focusTrapProps?: IFocusTrapCalloutProps['focusTrapProps'];
104+
105+
@Output() readonly onLayerMounted = new EventEmitter<void>();
106+
@Output() readonly onPositioned = new EventEmitter<{ positions?: ICalloutPositionedInfo }>();
107+
@Output() readonly onDismiss = new EventEmitter<{ ev?: any }>();
108+
@Output() readonly onScroll = new EventEmitter<void>();
109+
110+
constructor(elementRef: ElementRef, changeDetectorRef: ChangeDetectorRef, renderer: Renderer2) {
111+
super(elementRef, changeDetectorRef, renderer);
112+
}
113+
}

libs/fabric/src/lib/components/combo-box/base-combo-box.component.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ export abstract class FabBaseComboBoxComponent extends ReactWrapperComponent<ICo
1212
@Input() autoComplete?: IComboBoxProps['autoComplete'];
1313
@Input() text?: IComboBoxProps['text'];
1414
@Input() buttonIconProps?: IComboBoxProps['buttonIconProps'];
15+
@Input() autofill?: IComboBoxProps['autofill'];
1516
@Input() theme?: IComboBoxProps['theme'];
1617
@Input() styles?: IComboBoxProps['styles'];
1718
@Input() getClassNames?: IComboBoxProps['getClassNames'];
@@ -22,6 +23,7 @@ export abstract class FabBaseComboBoxComponent extends ReactWrapperComponent<ICo
2223
@Input() useComboBoxAsMenuWidth?: IComboBoxProps['useComboBoxAsMenuWidth'];
2324
@Input() multiSelect?: IComboBoxProps['multiSelect'];
2425
@Input() isButtonAriaHidden?: IComboBoxProps['isButtonAriaHidden'];
26+
@Input() ariaDescribedBy?: IComboBoxProps['ariaDescribedBy'];
2527
@Input() keytipProps?: IComboBoxProps['keytipProps'];
2628
@Input() resolveOptions?: (options: IComboBoxOption[]) => IComboBoxOption[] | PromiseLike<IComboBoxOption[]>;
2729

libs/fabric/src/lib/components/combo-box/combo-box.component.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ import { FabBaseComboBoxComponent } from './base-combo-box.component';
2424
[autoComplete]="autoComplete"
2525
[text]="text"
2626
[buttonIconProps]="buttonIconProps"
27+
[autofill]="autofill"
2728
[theme]="theme"
2829
[styles]="styles"
2930
[getClassNames]="getClassNames"
@@ -34,6 +35,7 @@ import { FabBaseComboBoxComponent } from './base-combo-box.component';
3435
[useComboBoxAsMenuWidth]="useComboBoxAsMenuWidth"
3536
[multiSelect]="multiSelect"
3637
[isButtonAriaHidden]="isButtonAriaHidden"
38+
[ariaDescribedBy]="ariaDescribedBy"
3739
[keytipProps]="keytipProps"
3840
[RenderLowerContent]="renderLowerContent && onRenderLowerContent"
3941
[ItemClick]="onItemClickHandler"

libs/fabric/src/lib/components/combo-box/virtualized-combo-box.component.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ import { FabBaseComboBoxComponent } from './base-combo-box.component';
2424
[autoComplete]="autoComplete"
2525
[text]="text"
2626
[buttonIconProps]="buttonIconProps"
27+
[autofill]="autofill"
2728
[theme]="theme"
2829
[styles]="styles"
2930
[getClassNames]="getClassNames"
@@ -34,6 +35,7 @@ import { FabBaseComboBoxComponent } from './base-combo-box.component';
3435
[useComboBoxAsMenuWidth]="useComboBoxAsMenuWidth"
3536
[multiSelect]="multiSelect"
3637
[isButtonAriaHidden]="isButtonAriaHidden"
38+
[ariaDescribedBy]="ariaDescribedBy"
3739
[keytipProps]="keytipProps"
3840
[RenderLowerContent]="renderLowerContent && onRenderLowerContent"
3941
[ItemClick]="onItemClickHandler"

libs/fabric/src/lib/components/date-picker/date-picker.component.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ import { IDatePickerProps } from 'office-ui-fabric-react';
2424
[componentRef]="componentRef"
2525
[theme]="theme"
2626
[calendarProps]="calendarProps"
27+
[textField]="textField"
2728
[calloutProps]="calloutProps"
2829
[calendarAs]="calendarAs"
2930
[label]="label"
@@ -71,6 +72,7 @@ export class FabDatePickerComponent extends ReactWrapperComponent<IDatePickerPro
7172
@Input() theme?: IDatePickerProps['theme'];
7273
@Input() calloutProps?: IDatePickerProps['calloutProps'];
7374
@Input() calendarProps?: IDatePickerProps['calendarProps'];
75+
@Input() textField?: IDatePickerProps['textField'];
7476
@Input() calendarAs?: IDatePickerProps['calendarAs'];
7577
@Input() label?: IDatePickerProps['label'];
7678
@Input() isRequired?: IDatePickerProps['isRequired'];
@@ -102,6 +104,7 @@ export class FabDatePickerComponent extends ReactWrapperComponent<IDatePickerPro
102104
@Input() initialPickerDate?: IDatePickerProps['initialPickerDate'];
103105
@Input() allFocusable?: IDatePickerProps['allFocusable'];
104106
@Input() showCloseButton?: IDatePickerProps['showCloseButton'];
107+
@Input() tabIndex?: IDatePickerProps['tabIndex'];
105108

106109
@Output() readonly onSelectDate = new EventEmitter<{ date: Date | null | undefined }>();
107110
@Output() readonly onAfterMenuDismiss = new EventEmitter<void>();

libs/fabric/src/lib/components/grouped-list/grouped-list.component.ts

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@ import { IListProps } from 'office-ui-fabric-react/lib/List';
2828
[theme]="theme"
2929
[styles]="styles"
3030
[className]="className"
31+
[compact]="compact"
3132
[dragDropEvents]="dragDropEvents"
3233
[dragDropHelper]="dragDropHelper"
3334
[eventsToRegister]="eventsToRegister"
@@ -53,9 +54,10 @@ export class FabGroupedListComponent extends ReactWrapperComponent<IGroupedListP
5354
@ViewChild('reactNode') protected reactNodeRef: ElementRef;
5455

5556
@Input() componentRef?: IGroupedListProps['componentRef'];
56-
@Input() theme?: IGroupedListProps['theme']
57-
@Input() styles?: IGroupedListProps['styles']
57+
@Input() theme?: IGroupedListProps['theme'];
58+
@Input() styles?: IGroupedListProps['styles'];
5859
@Input() className?: IGroupedListProps['className'];
60+
@Input() compact?: IGroupedListProps['compact'];
5961
@Input() dragDropEvents?: IGroupedListProps['dragDropEvents'];
6062
@Input() dragDropHelper?: IGroupedListProps['dragDropHelper'];
6163
@Input() eventsToRegister?: IGroupedListProps['eventsToRegister'];

0 commit comments

Comments
 (0)