var __extends = (this && this.__extends) || (function () {
    var extendStatics = function (d, b) {
        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 extendStatics(d, b);
    };
    return function (d, b) {
        extendStatics(d, b);
        function __() { this.constructor = d; }
        d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
    };
})();
(function (factory) {
    if (typeof module === "object" && typeof module.exports === "object") {
        var v = factory(require, exports);
        if (v !== undefined) module.exports = v;
    }
    else if (typeof define === "function" && define.amd) {
        define(["require", "exports", "../styles/AtomToggleButtonBarStyle", "./AtomControl", "./AtomListBox"], factory);
    }
})(function (require, exports) {
    "use strict";
    Object.defineProperty(exports, "__esModule", { value: true });
    var AtomToggleButtonBarStyle_1 = require("../styles/AtomToggleButtonBarStyle");
    var AtomControl_1 = require("./AtomControl");
    var AtomListBox_1 = require("./AtomListBox");
    var AtomToggleButtonBar = /** @class */ (function (_super) {
        __extends(AtomToggleButtonBar, _super);
        function AtomToggleButtonBar(app, e) {
            return _super.call(this, app, e || document.createElement("ul")) || this;
        }
        AtomToggleButtonBar.prototype.preCreate = function () {
            this.allowMultipleSelection = false;
            this.allowSelectFirst = true;
            this.itemTemplate = AtomToggleButtonBarItemTemplate;
            this.defaultControlStyle = AtomToggleButtonBarStyle_1.AtomToggleButtonBarStyle;
            this.registerItemClick();
        };
        return AtomToggleButtonBar;
    }(AtomListBox_1.AtomListBox));
    exports.AtomToggleButtonBar = AtomToggleButtonBar;
    var AtomToggleButtonBarItemTemplate = /** @class */ (function (_super) {
        __extends(AtomToggleButtonBarItemTemplate, _super);
        function AtomToggleButtonBarItemTemplate(app, e) {
            return _super.call(this, app, e || document.createElement("li")) || this;
        }
        AtomToggleButtonBarItemTemplate.prototype.create = function () {
            var _this = this;
            this.bind(this.element, "text", [["data"]], false, function (v) {
                var p = _this.parent;
                return v[p.labelPath];
            });
        };
        return AtomToggleButtonBarItemTemplate;
    }(AtomControl_1.AtomControl));
});
//# sourceMappingURL=AtomToggleButtonBar.js.map