UNPKG

@rtdui/datatable

Version:

React DataTable component based on Rtdui components

39 lines (35 loc) 1.57 kB
'use client'; 'use strict'; var jsxRuntime = require('react/jsx-runtime'); var core = require('@rtdui/core'); var iconsReact = require('@tabler/icons-react'); var getAllLeafOrderColumns = require('./utils/getAllLeafOrderColumns.cjs'); function ColumnsVisibility(props) { const { table } = props; const columns = getAllLeafOrderColumns.getAllLeafOrderColumns(table); return /* @__PURE__ */ jsxRuntime.jsxs(core.Popover, { position: "bottom", children: [ /* @__PURE__ */ jsxRuntime.jsx(core.Popover.Target, { children: /* @__PURE__ */ jsxRuntime.jsx(core.Button, { size: "sm", ghost: true, shape: "circle", children: /* @__PURE__ */ jsxRuntime.jsx(iconsReact.IconEyeCheck, {}) }) }), /* @__PURE__ */ jsxRuntime.jsx(core.Popover.Dropdown, { children: /* @__PURE__ */ jsxRuntime.jsx("ul", { className: "menu p-2", children: columns.map((column) => /* @__PURE__ */ jsxRuntime.jsx( "li", { className: !column.getCanHide() ? "menu-disabled" : void 0, children: /* @__PURE__ */ jsxRuntime.jsxs("label", { children: [ /* @__PURE__ */ jsxRuntime.jsx( "input", { type: "checkbox", disabled: !column.getCanHide(), checked: column.getIsVisible(), onChange: column.getToggleVisibilityHandler(), className: "checkbox checkbox-xs" } ), column.id ] }) }, column.id )) }) }) ] }); } exports.ColumnsVisibility = ColumnsVisibility; //# sourceMappingURL=ColumnsVisibility.cjs.map