var __extends = (this && this.__extends) || (function () {
    var extendStatics = Object.setPrototypeOf ||
        ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
        function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
    return function (d, b) {
        extendStatics(d, b);
        function __() { this.constructor = d; }
        d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
    };
})();
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
    var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
    if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
    else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
    return c > 3 && r && Object.defineProperty(target, key, r), r;
};
define(["require", "exports", "react", "office-ui-fabric-react/lib/Button", "office-ui-fabric-react/lib/Callout", "office-ui-fabric-react/lib/Dropdown", "office-ui-fabric-react/lib/Checkbox", "office-ui-fabric-react/lib/Slider", "office-ui-fabric-react/lib/Utilities", "./CalloutExample.scss"], function (require, exports, React, Button_1, Callout_1, Dropdown_1, Checkbox_1, Slider_1, Utilities_1) {
    "use strict";
    Object.defineProperty(exports, "__esModule", { value: true });
    var DIRECTION_OPTIONS = [
        { key: Callout_1.DirectionalHint[Callout_1.DirectionalHint.topLeftEdge], text: 'Top Left Edge' },
        { key: Callout_1.DirectionalHint[Callout_1.DirectionalHint.topCenter], text: 'Top Center' },
        { key: Callout_1.DirectionalHint[Callout_1.DirectionalHint.topRightEdge], text: 'Top Right Edge' },
        { key: Callout_1.DirectionalHint[Callout_1.DirectionalHint.topAutoEdge], text: 'Top Auto Edge' },
        { key: Callout_1.DirectionalHint[Callout_1.DirectionalHint.bottomLeftEdge], text: 'Bottom Left Edge' },
        { key: Callout_1.DirectionalHint[Callout_1.DirectionalHint.bottomCenter], text: 'Bottom Center' },
        { key: Callout_1.DirectionalHint[Callout_1.DirectionalHint.bottomRightEdge], text: 'Bottom Right Edge' },
        { key: Callout_1.DirectionalHint[Callout_1.DirectionalHint.bottomAutoEdge], text: 'Bottom Auto Edge' },
        { key: Callout_1.DirectionalHint[Callout_1.DirectionalHint.leftTopEdge], text: 'Left Top Edge' },
        { key: Callout_1.DirectionalHint[Callout_1.DirectionalHint.leftCenter], text: 'Left Center' },
        { key: Callout_1.DirectionalHint[Callout_1.DirectionalHint.leftBottomEdge], text: 'Left Bottom Edge' },
        { key: Callout_1.DirectionalHint[Callout_1.DirectionalHint.rightTopEdge], text: 'Right Top Edge' },
        { key: Callout_1.DirectionalHint[Callout_1.DirectionalHint.rightCenter], text: 'Right Center' },
        { key: Callout_1.DirectionalHint[Callout_1.DirectionalHint.rightBottomEdge], text: 'Right Bottom Edge' },
    ];
    var CalloutDirectionalExample = (function (_super) {
        __extends(CalloutDirectionalExample, _super);
        function CalloutDirectionalExample() {
            var _this = _super.call(this) || this;
            _this.state = {
                isCalloutVisible: false,
                isBeakVisible: true,
                directionalHint: Callout_1.DirectionalHint.bottomLeftEdge
            };
            return _this;
        }
        CalloutDirectionalExample.prototype.render = function () {
            var _this = this;
            var _a = this.state, isCalloutVisible = _a.isCalloutVisible, isBeakVisible = _a.isBeakVisible, directionalHint = _a.directionalHint, gapSpace = _a.gapSpace, beakWidth = _a.beakWidth;
            //  ms-Callout-smallbeak is used in this directional example to reflect all the positions. Large beak will disable some position to avoid beak over the callout edge.
            return (React.createElement("div", { className: 'ms-CalloutExample' },
                React.createElement("div", { className: 'ms-CalloutExample-configArea' },
                    React.createElement(Checkbox_1.Checkbox, { label: 'Show beak', checked: isBeakVisible, onChange: this._onShowBeakChange }),
                    React.createElement(Slider_1.Slider, { max: 30, label: 'Gap Space', min: 0, defaultValue: 16, onChange: this._onGapSlider }),
                    isBeakVisible &&
                        (React.createElement(Slider_1.Slider, { max: 50, label: 'Beak Width', min: 10, defaultValue: 16, onChange: this._onBeakWidthSlider })),
                    React.createElement(Dropdown_1.Dropdown, { label: 'Directional hint', selectedKey: Callout_1.DirectionalHint[directionalHint], options: DIRECTION_OPTIONS, onChanged: this._onDirectionalChanged })),
                React.createElement("div", { className: 'ms-CalloutExample-buttonArea', ref: function (menuButton) { return _this._menuButtonElement = menuButton; } },
                    React.createElement(Button_1.DefaultButton, { onClick: this._onShowMenuClicked, text: isCalloutVisible ? 'Hide callout' : 'Show callout' })),
                isCalloutVisible ? (React.createElement(Callout_1.Callout, { className: 'ms-CalloutExample-callout', gapSpace: gapSpace, targetElement: this._menuButtonElement, isBeakVisible: isBeakVisible, beakWidth: beakWidth, onDismiss: this._onCalloutDismiss, directionalHint: directionalHint },
                    React.createElement("div", { className: 'ms-CalloutExample-header' },
                        React.createElement("p", { className: 'ms-CalloutExample-title' }, "All of your favorite people")),
                    React.createElement("div", { className: 'ms-CalloutExample-inner' },
                        React.createElement("div", { className: 'ms-CalloutExample-content' },
                            React.createElement("p", { className: 'ms-CalloutExample-subText' }, "Message body is optional. If help documentation is available, consider adding a link to learn more at the bottom."))))) : (null)));
        };
        CalloutDirectionalExample.prototype._onCalloutDismiss = function () {
            this.setState({
                isCalloutVisible: false
            });
        };
        CalloutDirectionalExample.prototype._onShowMenuClicked = function () {
            this.setState({
                isCalloutVisible: !this.state.isCalloutVisible
            });
        };
        CalloutDirectionalExample.prototype._onShowBeakChange = function (ev, isVisible) {
            this.setState({
                isBeakVisible: isVisible,
                beakWidth: 10
            });
        };
        CalloutDirectionalExample.prototype._onDirectionalChanged = function (option) {
            this.setState({
                directionalHint: Callout_1.DirectionalHint[option.key]
            });
        };
        CalloutDirectionalExample.prototype._onGapSlider = function (value) {
            this.setState({
                gapSpace: value
            });
        };
        CalloutDirectionalExample.prototype._onBeakWidthSlider = function (value) {
            this.setState({
                beakWidth: value
            });
        };
        return CalloutDirectionalExample;
    }(React.Component));
    __decorate([
        Utilities_1.autobind
    ], CalloutDirectionalExample.prototype, "_onCalloutDismiss", null);
    __decorate([
        Utilities_1.autobind
    ], CalloutDirectionalExample.prototype, "_onShowMenuClicked", null);
    __decorate([
        Utilities_1.autobind
    ], CalloutDirectionalExample.prototype, "_onShowBeakChange", null);
    __decorate([
        Utilities_1.autobind
    ], CalloutDirectionalExample.prototype, "_onDirectionalChanged", null);
    __decorate([
        Utilities_1.autobind
    ], CalloutDirectionalExample.prototype, "_onGapSlider", null);
    __decorate([
        Utilities_1.autobind
    ], CalloutDirectionalExample.prototype, "_onBeakWidthSlider", null);
    exports.CalloutDirectionalExample = CalloutDirectionalExample;
});

//# sourceMappingURL=Callout.Directional.Example.js.map
