/**
 * DevExtreme (esm/__internal/ui/list/m_list.edit.search.js)
 * Version: 24.1.7-build-24272-1937
 * Build date: Sat Sep 28 2024
 *
 * Copyright (c) 2012 - 2024 Developer Express Inc. ALL RIGHTS RESERVED
 * Read about DevExtreme licensing here: https://js.devexpress.com/Licensing/
 */
import searchBoxMixin from "../../../ui/widget/ui.search_box_mixin";
import ListEdit from "./m_list.edit";
const ListSearch = ListEdit.inherit(searchBoxMixin).inherit({
    _addWidgetPrefix: className => `dx-list-${className}`,
    _getCombinedFilter() {
        const dataController = this._dataController;
        const storeLoadOptions = {
            filter: dataController.filter()
        };
        dataController.addSearchFilter(storeLoadOptions);
        const {
            filter: filter
        } = storeLoadOptions;
        return filter
    },
    _initDataSource() {
        const value = this.option("searchValue");
        const expr = this.option("searchExpr");
        const mode = this.option("searchMode");
        this.callBase();
        const dataController = this._dataController;
        value && value.length && dataController.searchValue(value);
        mode.length && dataController.searchOperation(searchBoxMixin.getOperationBySearchMode(mode));
        expr && dataController.searchExpr(expr)
    }
});
export default ListSearch;
