@mhmdaljefri/revogrid
Version:
Virtual reactive data grid component - RevoGrid.
28 lines (24 loc) • 1.03 kB
JavaScript
;
const index = require('./index-d3f67f2e.js');
const FILTER_BUTTON_CLASS = 'rv-filter';
const FILTER_BUTTON_ACTIVE = 'active';
const FILTER_PROP = 'hasFilter';
const FilterButton = ({ column }) => {
return (index.h("span", null,
index.h("button", { class: {
[FILTER_BUTTON_CLASS]: true,
[FILTER_BUTTON_ACTIVE]: column && !!column[FILTER_PROP],
} },
index.h("svg", { class: "filter-img", viewBox: "0 0 64 64" },
index.h("g", { stroke: "none", "stroke-width": "1", fill: "none", "fill-rule": "evenodd" },
index.h("path", { d: "M43,48 L43,56 L21,56 L21,48 L43,48 Z M53,28 L53,36 L12,36 L12,28 L53,28 Z M64,8 L64,16 L0,16 L0,8 L64,8 Z", fill: "currentColor" }))))));
};
function isFilterBtn(e) {
if (e.classList.contains(FILTER_BUTTON_CLASS)) {
return true;
}
return e === null || e === void 0 ? void 0 : e.closest(`.${FILTER_BUTTON_CLASS}`);
}
exports.FILTER_PROP = FILTER_PROP;
exports.FilterButton = FilterButton;
exports.isFilterBtn = isFilterBtn;