UNPKG

office-ui-fabric-react

Version:

Reusable React components for building experiences for Office 365.

53 lines 3.12 kB
import * as tslib_1 from "tslib"; import * as React from 'react'; /* tslint:disable:no-string-literal */ import { DefaultButton } from 'office-ui-fabric-react/lib/Button'; import { Dialog, DialogType, DialogFooter } from 'office-ui-fabric-react/lib/Dialog'; import { PrimaryButton } from 'office-ui-fabric-react/lib/Button'; import { Panel, PanelType } from 'office-ui-fabric-react/lib/Panel'; var LayerNestedLayersExample = /** @class */ (function (_super) { tslib_1.__extends(LayerNestedLayersExample, _super); function LayerNestedLayersExample(props) { var _this = _super.call(this, props) || this; _this._showDialog = function () { _this.setState({ hideDialog: false }); }; _this._closeDialog = function () { _this.setState({ hideDialog: true }); }; _this._onClosePanel = function () { _this.setState({ showPanel: false }); }; _this._onShowPanel = function () { _this.setState({ showPanel: true }); }; _this.state = { hideDialog: true, showPanel: false }; return _this; } LayerNestedLayersExample.prototype.render = function () { return (React.createElement("div", null, React.createElement(DefaultButton, { secondaryText: "Opens the Sample Panel", onClick: this._onShowPanel, text: "Open Panel" }), React.createElement(Panel, { isOpen: this.state.showPanel, type: PanelType.smallFixedFar, onDismiss: this._onClosePanel, headerText: "This panel makes use of Layer and FocusTrapZone. Focus should be trapped in the panel.", closeButtonAriaLabel: "Close" }, React.createElement(DefaultButton, { secondaryText: "Opens the Sample Dialog", onClick: this._showDialog, text: "Open Dialog" }), React.createElement(Dialog, { hidden: this.state.hideDialog, onDismiss: this._closeDialog, isBlocking: true, dialogContentProps: { type: DialogType.normal, title: 'This dialog uses Modal, which also makes use of Layer and FocusTrapZone. Focus should be trapped in the dialog.', subText: "Focus will move back to the panel if you press 'OK' or 'Cancel'." }, modalProps: { titleAriaId: 'myLabelId', subtitleAriaId: 'mySubTextId', isBlocking: false, containerClassName: 'ms-dialogMainOverride' } }, null /** You can also include null values as the result of conditionals */, React.createElement(DialogFooter, null, React.createElement(PrimaryButton, { onClick: this._closeDialog, text: "OK" }), React.createElement(DefaultButton, { onClick: this._closeDialog, text: "Cancel" })))))); }; return LayerNestedLayersExample; }(React.Component)); export { LayerNestedLayersExample }; //# sourceMappingURL=Layer.NestedLayers.Example.js.map