define(["require", "exports", "tslib", "react", "office-ui-fabric-react/lib/Button", "office-ui-fabric-react/lib/FocusTrapZone", "office-ui-fabric-react/lib/Link", "office-ui-fabric-react/lib/TextField", "office-ui-fabric-react/lib/Toggle", "./FocusTrapZone.Box.Example.scss"], function (require, exports, tslib_1, React, Button_1, FocusTrapZone_1, Link_1, TextField_1, Toggle_1) {
    "use strict";
    Object.defineProperty(exports, "__esModule", { value: true });
    var BoxNoClickExample = /** @class */ (function (_super) {
        tslib_1.__extends(BoxNoClickExample, _super);
        function BoxNoClickExample(props) {
            var _this = _super.call(this, props) || this;
            _this._onButtonClickHandler = function () {
                _this.setState({
                    isToggled: true
                });
            };
            _this._onExitButtonClickHandler = function () {
                _this.setState({
                    isToggled: false
                });
            };
            _this._onFocusTrapZoneToggleChanged = function (isToggled) {
                _this.setState({
                    isToggled: isToggled
                }, function () { return _this._toggle.focus(); });
            };
            _this._setRef = function (toggle) {
                _this._toggle = toggle;
            };
            _this.state = {
                isToggled: false
            };
            return _this;
        }
        BoxNoClickExample.prototype.render = function () {
            var _this = this;
            var isToggled = this.state.isToggled;
            return (React.createElement("div", null,
                React.createElement(Button_1.DefaultButton, { secondaryText: "Focuses inside the FocusTrapZone", onClick: this._onButtonClickHandler, text: "Go to Trap Zone" }),
                (function () {
                    if (isToggled) {
                        return (React.createElement(FocusTrapZone_1.FocusTrapZone, { isClickableOutsideFocusTrap: true, forceFocusInsideTrap: false }, _this._internalContents()));
                    }
                    else {
                        return React.createElement("div", null, _this._internalContents());
                    }
                })()));
        };
        BoxNoClickExample.prototype._internalContents = function () {
            var _this = this;
            var isToggled = this.state.isToggled;
            return (React.createElement("div", { className: "ms-FocusTrapZoneBoxExample" },
                React.createElement(TextField_1.TextField, { label: "Default TextField", placeholder: "Input inside Focus Trap Zone", className: "" }),
                React.createElement(Link_1.Link, { href: "", className: "" }, "Hyperlink inside FocusTrapZone"),
                React.createElement("br", null),
                React.createElement("br", null),
                React.createElement(Toggle_1.Toggle, { componentRef: this._setRef, checked: isToggled, onChanged: this._onFocusTrapZoneToggleChanged, label: "Focus Trap Zone", onText: "On", offText: "Off" }),
                (function () {
                    if (isToggled) {
                        return (React.createElement(Button_1.DefaultButton, { secondaryText: "Exit Focus Trap Zone", onClick: _this._onExitButtonClickHandler, text: "Exit Focus Trap Zone" }));
                    }
                })()));
        };
        return BoxNoClickExample;
    }(React.Component));
    exports.default = BoxNoClickExample;
});
//# sourceMappingURL=FocusTrapZone.Box.Click.Example.js.map