var __rest = (this && this.__rest) || function (s, e) {
    var t = {};
    for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
        t[p] = s[p];
    if (s != null && typeof Object.getOwnPropertySymbols === "function")
        for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
            if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
                t[p[i]] = s[p[i]];
        }
    return t;
};
import React, { memo } from 'react';
import classnames from 'classnames';
import { ReadOnlyLogicOperator } from './components/ReadOnlyLogicOperator';
import { ReadOnlyFilter } from './components/ReadOnlyFilter';
import styles from './QueryBuilderRow.module.css';
var QueryBuilderRow = function (_a) {
    var _b;
    var _c = _a.classes, classes = _c === void 0 ? {} : _c, rowData = _a.rowData, previousRowData = _a.previousRowData, _d = _a.LogicOperatorComponent, LogicOperatorComponent = _d === void 0 ? ReadOnlyLogicOperator : _d, AttributeSelectorComponent = _a.AttributeSelectorComponent, _e = _a.FilterSelectorComponent, FilterSelectorComponent = _e === void 0 ? ReadOnlyFilter : _e, ValuesEditorComponent = _a.ValuesEditorComponent, ActionsComponent = _a.ActionsComponent, filterSelectorRef = _a.filterSelectorRef, _f = _a.attributeSelectorProps, attributeSelectorProps = _f === void 0 ? {} : _f, rowContext = __rest(_a, ["classes", "rowData", "previousRowData", "LogicOperatorComponent", "AttributeSelectorComponent", "FilterSelectorComponent", "ValuesEditorComponent", "ActionsComponent", "filterSelectorRef", "attributeSelectorProps"]);
    return (React.createElement("div", { className: classnames(styles.row, classes.root), "data-reltio-id": "query-builder-row" },
        React.createElement(LogicOperatorComponent, { className: classes.logicOperatorContainer, rowContext: rowContext, rowData: previousRowData }),
        React.createElement("div", { className: classnames(styles.rowItem, classes.attributeSelectorContainer), "data-reltio-id": "query-builder-row-attribute-selector" },
            React.createElement(AttributeSelectorComponent, { attributeSelectorProps: attributeSelectorProps, rowContext: rowContext, rowData: rowData })),
        React.createElement("div", { className: classnames(styles.rowItem, classes.filterSelectorContainer), "data-reltio-id": "query-builder-row-filter-selector" },
            React.createElement(FilterSelectorComponent, { textFieldInputRef: filterSelectorRef, rowContext: rowContext, rowData: rowData })),
        React.createElement("div", { className: classnames(styles.rowItem, styles.fullWidth, classes.valuesEditorContainer), "data-reltio-id": "query-builder-row-values-editor" },
            React.createElement(ValuesEditorComponent, { rowContext: rowContext, rowData: rowData })),
        React.createElement("div", { className: classnames(styles.rowItem, classes.actionsContainer, classes.rowActions, (_b = {},
                _b[styles.hidden] = !rowData,
                _b)), "data-reltio-id": "query-builder-row-actions" },
            React.createElement(ActionsComponent, { rowContext: rowContext, rowData: rowData }))));
};
export default memo(QueryBuilderRow);
