"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
var tslib_1 = require("tslib");
var React = require("react");
var Checkbox_1 = require("office-ui-fabric-react/lib/Checkbox");
var Persona_1 = require("office-ui-fabric-react/lib/Persona");
var CheckboxImplementationExamples = /** @class */ (function (_super) {
    tslib_1.__extends(CheckboxImplementationExamples, _super);
    function CheckboxImplementationExamples(props) {
        var _this = _super.call(this, props) || this;
        _this._onControlledCheckboxChange = function (ev, checked) {
            _this.setState({ isChecked: checked });
        };
        _this.state = {
            isChecked: false
        };
        _this._onCheckboxChange = _this._onCheckboxChange.bind(_this);
        return _this;
    }
    CheckboxImplementationExamples.prototype.render = function () {
        var isChecked = this.state.isChecked;
        var checkboxStyles = function () {
            return {
                root: {
                    marginTop: '10px'
                }
            };
        };
        return (React.createElement("div", null,
            React.createElement(Checkbox_1.Checkbox, { label: "Uncontrolled checkbox", onChange: this._onCheckboxChange, inputProps: {
                    onFocus: function () {
                        console.log('Uncontrolled checkbox is focused');
                    },
                    onBlur: function () {
                        console.log('Uncontrolled checkbox is blured');
                    }
                }, styles: checkboxStyles, ariaDescribedBy: 'descriptionID' }),
            React.createElement("label", { id: "descriptionID", className: "screenReaderOnly" }, "Uncontroller checkbox description"),
            React.createElement(Checkbox_1.Checkbox, { label: "Uncontrolled checkbox with defaultChecked true", defaultChecked: true, onChange: this._onCheckboxChange, styles: checkboxStyles }),
            React.createElement(Checkbox_1.Checkbox, { label: "Disabled uncontrolled checkbox", disabled: true, styles: checkboxStyles }),
            React.createElement(Checkbox_1.Checkbox, { label: "Disabled uncontrolled checkbox with defaultChecked true", disabled: true, defaultChecked: true, onChange: this._onCheckboxChange, styles: checkboxStyles }),
            React.createElement(Checkbox_1.Checkbox, { label: "Controlled checkbox", checked: isChecked, onChange: this._onControlledCheckboxChange, styles: checkboxStyles }),
            React.createElement(Checkbox_1.Checkbox, { label: "Checkbox rendered with boxSide \"end\"", boxSide: "end", styles: checkboxStyles }),
            React.createElement(Checkbox_1.Checkbox, { label: "Persona Checkbox", styles: checkboxStyles, onRenderLabel: this._renderPersonaLabel })));
    };
    CheckboxImplementationExamples.prototype._onCheckboxChange = function (ev, isChecked) {
        console.log("The option has been changed to " + isChecked + ".");
    };
    CheckboxImplementationExamples.prototype._renderPersonaLabel = function (props) {
        var DEFAULT_IMAGE_URL = '/_layouts/15/userphoto.aspx?size=S&accountname=';
        return React.createElement(Persona_1.Persona, { text: props.label, imageUrl: DEFAULT_IMAGE_URL, size: Persona_1.PersonaSize.size32 });
    };
    return CheckboxImplementationExamples;
}(React.Component));
exports.CheckboxImplementationExamples = CheckboxImplementationExamples;
//# sourceMappingURL=Checkbox.ImplementationExamples.js.map