define(["require", "exports", "tslib", "react", "../../../Checkbox", "../Layer", "../LayerHost", "../../../Toggle", "../../../Styling", "../../../common/_exampleStyles.scss", "./Layer.Example.scss"], function (require, exports, tslib_1, React, Checkbox_1, Layer_1, LayerHost_1, Toggle_1, Styling_1, exampleStylesImport) {
    "use strict";
    Object.defineProperty(exports, "__esModule", { value: true });
    var exampleStyles = exampleStylesImport;
    var LayerHostedExample = /** @class */ (function (_super) {
        tslib_1.__extends(LayerHostedExample, _super);
        function LayerHostedExample(props) {
            var _this = _super.call(this, props) || this;
            _this._onChangeCheckbox = function (ev, checked) {
                _this.setState({ showLayer: checked });
            };
            _this._onChangeCheckboxNoId = function (ev, checked) {
                _this.setState({ showLayerNoId: checked });
            };
            _this._onChangeToggle = function (checked) {
                _this.setState({ showHost: checked });
            };
            _this.state = {
                showLayer: false,
                showLayerNoId: false,
                showHost: true
            };
            return _this;
        }
        LayerHostedExample.prototype.render = function () {
            var _a = this.state, showLayer = _a.showLayer, showLayerNoId = _a.showLayerNoId, showHost = _a.showHost;
            var content = (React.createElement("div", { className: 'LayerExample-content ' + Styling_1.AnimationClassNames.scaleUpIn100 }, "This is example layer content."));
            return (React.createElement("div", null,
                React.createElement(Toggle_1.Toggle, { label: "Show host", checked: showHost, onChanged: this._onChangeToggle }),
                showHost && React.createElement(LayerHost_1.LayerHost, { id: "layerhost1", className: "LayerExample-customHost" }),
                React.createElement("p", { id: "foo" }, "In some cases, you may need to contain layered content within an area. Create an instance of a LayerHost along with an id, and provide a hostId on the layer to render it within the specific host. (Note that it's important that you don't include children within the LayerHost. It's meant to contain Layered content only.)"),
                React.createElement(Checkbox_1.Checkbox, { className: exampleStyles.exampleCheckbox, label: "Render the box below in a Layer and target it at hostId=layerhost1", checked: showLayer, onChange: this._onChangeCheckbox }),
                showLayer ? (React.createElement(Layer_1.Layer, { hostId: "layerhost1", onLayerDidMount: this._log('didmount'), onLayerWillUnmount: this._log('willunmount'), className: 'exampleLayerClassName' }, content)) : (content),
                React.createElement("div", { className: "LayerExample-nonLayered" }, "I am normally below the content."),
                React.createElement("p", null, "If you do not specify a hostId then the hosted layer will default to being fixed to the page by default."),
                React.createElement(Checkbox_1.Checkbox, { className: exampleStyles.exampleCheckbox, label: "Render the box below in a Layer without specifying a host, fixing it to the top of the page", checked: showLayerNoId, onChange: this._onChangeCheckboxNoId }),
                showLayerNoId ? (React.createElement(Layer_1.Layer, { onLayerDidMount: this._log('didmount'), onLayerWillUnmount: this._log('willunmount') }, content)) : (content)));
        };
        LayerHostedExample.prototype._log = function (text) {
            return function () {
                console.log(text);
            };
        };
        return LayerHostedExample;
    }(React.Component));
    exports.LayerHostedExample = LayerHostedExample;
});
//# sourceMappingURL=Layer.Hosted.Example.js.map