(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 });
    exports.AtomToggleButtonBar = void 0;
    const AtomToggleButtonBarStyle_1 = require("../styles/AtomToggleButtonBarStyle");
    const AtomControl_1 = require("./AtomControl");
    const AtomListBox_1 = require("./AtomListBox");
    class AtomToggleButtonBar extends AtomListBox_1.AtomListBox {
        constructor(app, e) {
            super(app, e || document.createElement("ul"));
        }
        preCreate() {
            super.preCreate();
            this.allowMultipleSelection = false;
            this.allowSelectFirst = true;
            this.itemTemplate = AtomToggleButtonBarItemTemplate;
            this.defaultControlStyle = AtomToggleButtonBarStyle_1.AtomToggleButtonBarStyle;
            this.registerItemClick();
            this.runAfterInit(() => this.setElementClass(this.element, {
                [this.controlStyle.name]: 1,
                "atom-toggle-button-bar": 1
            }, true));
        }
    }
    exports.AtomToggleButtonBar = AtomToggleButtonBar;
    class AtomToggleButtonBarItemTemplate extends AtomControl_1.AtomControl {
        constructor(app, e) {
            super(app, e || document.createElement("li"));
        }
        create() {
            this.bind(this.element, "text", [["data"]], false, (v) => {
                const p = this.parent;
                return v[p.labelPath];
            });
        }
    }
});
//# sourceMappingURL=AtomToggleButtonBar.js.map