@adaptabletools/adaptable
Version:
Powerful AG Grid extension which provides advanced, cutting-edge functionality to meet all DataGrid requirements
16 lines (15 loc) • 709 B
JavaScript
import { Fragment as _Fragment, jsx as _jsx } from "react/jsx-runtime";
import { useSelector } from 'react-redux';
export const GridFilterStatusbar = (props) => {
const queryMaxLength = 15;
const currentLayoutName = useSelector((state) => state.Layout.CurrentLayout);
const currentLayout = useSelector((state) => state.Layout.Layouts).find((layout) => layout.Name === currentLayoutName);
const query = currentLayout?.GridFilter?.Expression ?? '';
let text = query;
let popover = null;
if (query.length > queryMaxLength) {
text = query.substring(0, queryMaxLength - 3) + '...';
popover = query;
}
return _jsx(_Fragment, { children: text ?? 'No Query' });
};