Commit cca88806 authored by Sonia Vidal Gonzalez's avatar Sonia Vidal Gonzalez

Añadiendo panel derecho.

parent 7dff800b
...@@ -6,7 +6,9 @@ import { DetailsList, DetailsListLayoutMode, Selection, IColumn } from 'office-u ...@@ -6,7 +6,9 @@ import { DetailsList, DetailsListLayoutMode, Selection, IColumn } from 'office-u
import { MarqueeSelection } from 'office-ui-fabric-react/lib/MarqueeSelection'; import { MarqueeSelection } from 'office-ui-fabric-react/lib/MarqueeSelection';
import { Fabric } from 'office-ui-fabric-react/lib/Fabric'; import { Fabric } from 'office-ui-fabric-react/lib/Fabric';
import { mergeStyles } from 'office-ui-fabric-react/lib/Styling'; import { mergeStyles } from 'office-ui-fabric-react/lib/Styling';
import { PrimaryButton } from '@microsoft/office-ui-fabric-react-bundle'; import { DefaultButton, PrimaryButton } from '@microsoft/office-ui-fabric-react-bundle';
import { Panel, PanelType } from 'office-ui-fabric-react';
const exampleChildClass = mergeStyles({ const exampleChildClass = mergeStyles({
...@@ -27,6 +29,7 @@ export interface IDetailsListBasicExampleState { ...@@ -27,6 +29,7 @@ export interface IDetailsListBasicExampleState {
items: IDetailsListBasicExampleItem[]; items: IDetailsListBasicExampleItem[];
selectionDetails: string; selectionDetails: string;
itemsAux: IDetailsListBasicExampleItem[]; itemsAux: IDetailsListBasicExampleItem[];
showPanel: boolean;
} }
export default class HomeDetailsList extends React.Component<IHomeDetailsListProps, IDetailsListBasicExampleState> { export default class HomeDetailsList extends React.Component<IHomeDetailsListProps, IDetailsListBasicExampleState> {
...@@ -34,7 +37,7 @@ export default class HomeDetailsList extends React.Component<IHomeDetailsListPro ...@@ -34,7 +37,7 @@ export default class HomeDetailsList extends React.Component<IHomeDetailsListPro
private _allItems: IDetailsListBasicExampleItem[]; private _allItems: IDetailsListBasicExampleItem[];
private _columns: IColumn[]; private _columns: IColumn[];
constructor(props: IHomeDetailsListProps) { constructor(props: IHomeDetailsListProps) {
super(props); super(props);
...@@ -68,7 +71,8 @@ export default class HomeDetailsList extends React.Component<IHomeDetailsListPro ...@@ -68,7 +71,8 @@ export default class HomeDetailsList extends React.Component<IHomeDetailsListPro
], ],
selectionDetails: '', selectionDetails: '',
itemsAux: [] itemsAux: [],
showPanel: false
}; };
this._selection = new Selection({ this._selection = new Selection({
...@@ -90,12 +94,13 @@ export default class HomeDetailsList extends React.Component<IHomeDetailsListPro ...@@ -90,12 +94,13 @@ export default class HomeDetailsList extends React.Component<IHomeDetailsListPro
public render(): React.ReactElement<IHomeDetailsListProps> { public render(): React.ReactElement<IHomeDetailsListProps> {
const { items, itemsAux, selectionDetails } = this.state; const { items, itemsAux, selectionDetails } = this.state;
const {disabled, checked} = this.props
function _alertClicked(): void { function _alertClicked(): void {
alert('Clicked'); alert('Clicked');
} }
return ( return (
<Fabric> <Fabric>
...@@ -122,14 +127,55 @@ export default class HomeDetailsList extends React.Component<IHomeDetailsListPro ...@@ -122,14 +127,55 @@ export default class HomeDetailsList extends React.Component<IHomeDetailsListPro
onItemInvoked={this._onItemInvoked} onItemInvoked={this._onItemInvoked}
/> />
<br /> <br />
<PrimaryButton text="Añadir Productos" onClick={_alertClicked} allowDisabledFocus disabled={disabled} checked={checked} />
<div> <div>
<PrimaryButton
secondaryText='Opens the Sample Panel'
onClick={ this._onShowPanel }
text='Open Panel'
/>
<Panel
isOpen={ this.state.showPanel }
type={ PanelType.smallFixedFar }
onDismiss={ this._onClosePanel }
isFooterAtBottom={ true }
headerText='Panel with footer at bottom'
closeButtonAriaLabel='Close'
onRenderFooterContent={ this._onRenderFooterContent }
>
<span>Content goes here.</span>
</Panel>
</div> </div>
</MarqueeSelection> </MarqueeSelection>
</Fabric> </Fabric>
); );
} }
private _onShowPanel = () => {
this.setState({ showPanel: true });
}
private _onClosePanel = () => {
this.setState({ showPanel: false });
}
private _onRenderFooterContent = (): JSX.Element => {
return (
<div>
<PrimaryButton
onClick={ this._onClosePanel }
style={ { 'marginRight': '8px' } }
>
Save
</PrimaryButton>
<DefaultButton
onClick={ this._onClosePanel }
>
Cancel
</DefaultButton>
</div>
);
}
private _getSelectionDetails(): string { private _getSelectionDetails(): string {
const selectionCount = this._selection.getSelectedCount(); const selectionCount = this._selection.getSelectedCount();
......
export interface IHomeDetailsListProps { export interface IHomeDetailsListProps {
description: string; description: string;
disabled?: boolean;
checked?: boolean;
} }
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment