Skip to content

Commit 19273e0

Browse files
2 parents 169ca11 + c4f6b3a commit 19273e0

File tree

4 files changed

+12
-25
lines changed

4 files changed

+12
-25
lines changed

src/controls/treeView/DropdownTreeItemAction.tsx

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,9 @@
11
import * as React from 'react';
22
import { IContextualMenuItem, IContextualMenuProps } from 'office-ui-fabric-react/lib/ContextualMenu';
3-
import { IconButton, IIconProps } from 'office-ui-fabric-react';
4-
3+
import { IconButton } from 'office-ui-fabric-react/lib/Button';
54
import { ITreeItem } from './ITreeItem';
65
import { ITreeItemAction, IConcreteTreeItemActionProps } from './ITreeItemActions';
76
import styles from './TreeView.module.scss';
8-
import { DefaultButton } from 'office-ui-fabric-react/lib/Button';
97

108
/**
119
* Renders the controls for Dropdown TreeItem action component
@@ -93,7 +91,7 @@ export class DropdownTreeItemAction extends React.Component<IConcreteTreeItemAct
9391

9492
return (
9593
<div>
96-
<DefaultButton
94+
<IconButton
9795
menuProps={contextualMenuProps}
9896
menuIconProps={{ iconName: 'MoreVertical' }}
9997
className={styles.actionMore}

src/controls/treeView/ITreeViewProps.ts

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -28,23 +28,19 @@ export interface ITreeViewProps {
2828
* By default this is set to Single.
2929
*/
3030
selectionMode?: TreeViewSelectionMode;
31-
3231
/**
3332
* Specify if the childrens should be selected when parent is selected.
3433
* By default this is set to false.
3534
*/
3635
selectChildrenIfParentSelected?: boolean;
37-
3836
/**
3937
* Specify if the checkboxes should be displayed for selection.
4038
*/
4139
showCheckboxes?: boolean;
42-
4340
/**
4441
* Display mode of the tree item actions.
4542
*/
4643
treeItemActionsDisplayMode?: TreeItemActionsDisplayMode;
47-
4844
/**
4945
* Keys of items selected by default
5046
*/
@@ -56,13 +52,11 @@ export interface ITreeViewProps {
5652
* @argument isExpanded The status of item (expanded / collapsed).
5753
*/
5854
onExpandCollapse?: (item: ITreeItem, isExpanded: boolean) => void;
59-
6055
/**
6156
* Callback function called after an item is selected.
6257
* @argument items The selected items.
6358
*/
6459
onSelect?: (items: ITreeItem[]) => void;
65-
6660
/**
6761
* Customize how items are rendered.
6862
* @argument item The tree item.

src/controls/treeView/TreeItem.tsx

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,6 @@ export interface ITreeItemProps {
4242
* Stores the selected tree items
4343
*/
4444
activeItems: ITreeItem[];
45-
4645
/**
4746
* Display mode of the tree item actions.
4847
*/
@@ -169,7 +168,7 @@ export default class TreeItem extends React.Component<ITreeItemProps, ITreeItemS
169168
}
170169
}}}>
171170
{
172-
this.props.showCheckboxes && item.selectable == false && !item.children &&
171+
this.props.showCheckboxes && item.selectable == false && !item.children &&
173172
<span className={styles.blankspace}>&nbsp;</span>
174173
}
175174
{
@@ -283,11 +282,12 @@ export default class TreeItem extends React.Component<ITreeItemProps, ITreeItemS
283282
style={contentStyles}
284283
onClick={(e) => {
285284
if (this.props.selectionMode != TreeViewSelectionMode.None && treeItem.selectable != false) {
286-
e.stopPropagation();
287-
if (!treeItem.disabled && e.currentTarget === e.target) {
288-
this._itemSelected(e, !this.state.selected);
285+
e.stopPropagation();
286+
if (!treeItem.disabled && e.currentTarget === e.target) {
287+
this._itemSelected(e, !this.state.selected);
288+
}
289289
}
290-
}}}
290+
}}
291291
>
292292
{
293293
// Render checkbox (if item is selectable, Selection mode is not None, and showCheckboxes property is set to true)
@@ -325,7 +325,7 @@ export default class TreeItem extends React.Component<ITreeItemProps, ITreeItemS
325325
: null
326326
}
327327
</div>
328-
</div>
328+
</div>
329329
);
330330
}
331331
}

src/webparts/controlsTest/components/ControlsTest.tsx

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -37,11 +37,8 @@ import { Carousel, CarouselButtonsLocation, CarouselButtonsDisplay } from '../..
3737
import { TimeDisplayControlType } from '../../../controls/dateTimePicker/TimeDisplayControlType';
3838
import { GridLayout } from '../../../GridLayout';
3939
import { ComboBoxListItemPicker } from '../../../';
40-
import {TreeView,ITreeItem,TreeItemActionsDisplayMode,TreeViewSelectionMode} from '../../../controls/treeView';
41-
//import { ITreeItem } from '../../../controls/treeView/ITreeItem';
40+
import { TreeView, ITreeItem, TreeItemActionsDisplayMode, TreeViewSelectionMode } from '../../../controls/treeView';
4241
import { IIconProps } from 'office-ui-fabric-react/lib/Icon';
43-
44-
4542
import { ISize } from 'office-ui-fabric-react/lib/Utilities';
4643

4744
// Used to render document cards
@@ -962,10 +959,8 @@ export default class ControlsTest extends React.Component<IControlsTestProps, IC
962959
console.log("items selected: " + items.length);
963960
}
964961

965-
966-
967962
private skypeCheckIcon: IIconProps = { iconName: 'SkypeCheck' };
968-
private treeitems = [
963+
private treeitems = [
969964
{
970965
key: "R1",
971966
label: "Root",
@@ -995,7 +990,7 @@ export default class ControlsTest extends React.Component<IControlsTestProps, IC
995990
label: "Child 1",
996991
subLabel: "This is a sub label for node",
997992
actions: [{
998-
title:"Share",
993+
title: "Share",
999994
iconProps: {
1000995
iconName: 'Share'
1001996
},

0 commit comments

Comments
 (0)