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 __());
    };
})();
import { AdvancedSearchView } from '@easyquery/ui';
import { EqServerBroker } from '@easyquery/broker-eqs';
import { JQueryColumnsPanelWidget } from '../widgets/jquery_columns_panel_widget';
import { JQueryQueryPanelWidget } from '../widgets/jquery_query_panel_widget';
import { JQueryEntitiesPanelWidget } from '../widgets/jquery_entities_panel_widget';
var AdvancedSearchViewJQuery = /** @class */ (function (_super) {
    __extends(AdvancedSearchViewJQuery, _super);
    function AdvancedSearchViewJQuery() {
        return _super.call(this) || this;
    }
    AdvancedSearchViewJQuery.prototype.initDone = function () {
        this.selectQueryMenu = jQuery('<div></div>')
            .hide()
            .insertAfter(this.loadQueryButton);
        var menuOptions = {
            items: [],
            multiselect: false
        };
        this.selectQueryMenu.PopupMenu(menuOptions);
    };
    AdvancedSearchViewJQuery.prototype.createDefaultBroker = function (context) {
        return new EqServerBroker(context);
    };
    AdvancedSearchViewJQuery.prototype.createEntitiesPanelWidget = function (entitiesPanelSlot) {
        return new JQueryEntitiesPanelWidget(entitiesPanelSlot);
    };
    AdvancedSearchViewJQuery.prototype.createColumnsPanelWidget = function (columnsPanelSlot) {
        return new JQueryColumnsPanelWidget(columnsPanelSlot);
    };
    AdvancedSearchViewJQuery.prototype.createQueryPanelWidget = function (queryPanelSlot) {
        return new JQueryQueryPanelWidget(queryPanelSlot);
    };
    AdvancedSearchViewJQuery.prototype.fillLoadQueryButtonMenu = function (queryList, onQuerySelect) {
        var options = {
            anchor: this.loadQueryButton,
            items: [],
            onMenuItemSelected: function (evt, data) {
                onQuerySelect(data.menuItem.id);
                return false;
            }
        };
        for (var _i = 0, queryList_1 = queryList; _i < queryList_1.length; _i++) {
            var item = queryList_1[_i];
            options.items.push({
                id: item.id,
                text: item.name
            });
        }
        this.selectQueryMenu.PopupMenu('showMenu', options);
    };
    return AdvancedSearchViewJQuery;
}(AdvancedSearchView));
export { AdvancedSearchViewJQuery };
//# sourceMappingURL=adv_search_view_jquery.js.map