UNPKG

@konstructio/ui

Version:

A set of reusable and customizable React components built for konstruct.io

96 lines (95 loc) 3.79 kB
import { t as s } from "../../utils-COaoD3PI.js"; import { Actions as Y } from "./components/Actions/Actions.js"; import { t as Z } from "../../table.provider-BBlJgEJf.js"; import { sendCollapseRowEvent as _, sendExpandRowEvent as $, sendToggleRowEvent as D } from "./events/index.js"; import { Body as L } from "./components/Body/Body.js"; import { Filter as rr } from "./components/Filter/Filter.js"; import { Header as er } from "./components/Header/Header.js"; import { Pagination as ar } from "./components/Pagination/Pagination.js"; import { TruncateText as or } from "./components/TruncateText/TruncateText.js"; import { WrapperBody as tr } from "./components/WrapperBody/WrapperBody.js"; import { useMemo as ir } from "react"; import { jsx as r, jsxs as n } from "react/jsx-runtime"; var lr = ({ id: c, ariaLabel: p, columns: d, data: f, totalItems: u = -1 / 0, className: b, classNameHeaderActiveArrows: v, classNameHeaderArrows: T, classNameHeaderTable: x, classNameTable: E, classNameWrapperTable: N, isLoading: o, getRowId: w, fetchData: A, queryOptions: y, showPagination: h, showTotalItems: t, showDropdownPagination: i, showDotPagination: l, showFormPagination: m, pageSizes: z, showFilter: B = !1, showFilterInput: R, filterSearchPlaceholder: V = "", filters: g, multiSelectFilter: j, filterActions: k, showResetButton: P = !0, resetButtonClassName: C, closeOnApply: H = !0, enableHoverRow: I, classNameHoverRow: K, enableExpandedRow: M, expandedState: W, defaultExpanded: q, classNameExpandedRow: F, classNameExpandedCell: G, classNameExpandedContent: J, classNameExpandedHeader: O, classNameActiveExpandedRow: Q, onExpandedChange: S, renderExpandedRow: U, keepExpandColumnVisible: X }) => { const e = ir(() => h || [ t, i, l, m ].some(Boolean), []); return /* @__PURE__ */ r(Z, { id: c, columns: d, data: f, getRowId: w, fetchData: A, totalItems: u, queryOptions: y, isPaginationEnabled: e, enableExpandedRow: M, expandedState: W, onExpandedChange: S, defaultExpanded: q, classNameExpandedRow: F, classNameExpandedCell: G, classNameExpandedContent: J, classNameExpandedHeader: O, classNameActiveExpandedRow: Q, enableHoverRow: I, classNameHoverRow: K, renderExpandedRow: U, keepExpandColumnVisible: X, children: /* @__PURE__ */ n("section", { className: s("w-full min-w-fit", b), children: [ B && /* @__PURE__ */ r(rr, { actions: k, filters: g, multiSelectFilter: j, placeholder: V, showFilterInput: R, showResetButton: P, resetButtonClassName: C, closeOnApply: H }), /* @__PURE__ */ r(tr, { showPagination: e, classNameWrapperTable: N, isLoading: o, children: /* @__PURE__ */ n("table", { className: s("w-full border-collapse table-auto", "dark:border-separate dark:border-spacing-0", E), "aria-label": p, children: [/* @__PURE__ */ r(er, { className: x, classNameArrows: T, classNameActiveArrows: v }), /* @__PURE__ */ r(L, { isLoading: o, showPagination: e })] }) }), e && /* @__PURE__ */ r(ar, { showTotalItems: t, showDropdownPagination: i, showDotPagination: l, showFormPagination: m, pageSizes: z, isLoading: o }) ] }) }); }, a = lr; a.displayName = "KonstructVirtualizedTable"; a.TruncateText = or; a.Actions = Y; a.Events = { sendExpandRowEvent: $, sendCollapseRowEvent: _, sendToggleRowEvent: D }; export { or as TruncateText, a as VirtualizedTable };