dgz-ui-shared 1.2.45 → 1.2.46
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/components/datatable/index.cjs.js +1 -1
- package/dist/components/datatable/index.cjs.js.map +1 -1
- package/dist/components/datatable/index.es.js +45 -44
- package/dist/components/datatable/index.es.js.map +1 -1
- package/dist/types/components/datatable/DataTable.d.ts.map +1 -1
- package/package.json +1 -1
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react/jsx-runtime"),J=require("../../chunks/index-ClQFzqcq.cjs.js"),_=require("dgz-ui/button"),z=require("dgz-ui/dropdown"),
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react/jsx-runtime"),J=require("../../chunks/index-ClQFzqcq.cjs.js"),_=require("dgz-ui/button"),z=require("dgz-ui/dropdown"),u=require("dgz-ui/utils"),y=require("../../chunks/MyInput-mL2G5h2s.cjs.js"),v=require("../../chunks/useSortable-BZKLpg8U.cjs.js"),b=require("lucide-react"),L=require("react"),Z=require("react-i18next"),S=require("../../chunks/Actions-bpMDyl5M.cjs.js"),V=require("../../chunks/ExportData-DJE0jOHc.cjs.js"),Q=require("../../chunks/Search-kbkeTeSI.cjs.js"),C=require("dgz-ui"),P=require("../../chunks/Loader-D_jX_Wgx.cjs.js"),B=require("../../chunks/MyPagination-CnF3468f.cjs.js"),U=require("dgz-ui/form"),T=require("dgz-ui/table"),Y=require("../../chunks/SortOrder-81BrXp3i.cjs.js"),ee=require("../../chunks/Empty-BYOOFAab.cjs.js"),se=L.memo(function({filters:g,params:p,onFilter:j,className:N,...A}){const{t:s}=Z.useTranslation(),n=L.useMemo(()=>Object.fromEntries((g==null?void 0:g.map(r=>{var i;return[r.name,Object.fromEntries(((i=r.options)==null?void 0:i.map(({label:E,value:c})=>[c,E]))||[])]}))||[]),[g]),D=L.useMemo(()=>Object.entries(p||{}).filter(([r,i])=>!!(n!=null&&n[r])&&!v.isEmpty(i)),[n,p]);return!v.isEmpty(D)&&e.jsx("div",{...A,className:u.cn("flex flex-wrap gap-2",N),children:D.map(([r,i])=>{var E;return Array.isArray(i)?e.jsx(C.ButtonGroup,{children:i.filter(c=>{var l;return((l=n==null?void 0:n[r])==null?void 0:l[c])&&c}).map((c,l)=>{var k;return e.jsxs(_.Button,{size:"sm",onClick:()=>{j==null||j({...p,[r]:i.filter(M=>M!==c)})},children:[s(String(((k=n==null?void 0:n[r])==null?void 0:k[c])||""))," ",e.jsx(b.XIcon,{})]},l)})},r):e.jsxs(_.Button,{size:"sm",onClick:()=>{const c={...p};delete c[r],j==null||j(c)},children:[s(String(((E=n==null?void 0:n[r])==null?void 0:E[i])||""))," ",e.jsx(b.XIcon,{})]})})})}),O=({rows:t=[],columns:g,onRowClick:p,rowKey:j,params:N={page:1,limit:B.DEFAULT_LIMIT},hasNumbers:A=!1,hasCheckbox:s=!1,selectedItems:n,onSelectedItemsChange:D,onSortOrderChange:r,isStickyHeader:i,className:E,...c})=>{const{sortObject:l,handleSort:k}=v.useSortable({sortField:N==null?void 0:N.sortField,sortOrder:N==null?void 0:N.sortOrder,onSortOrderChange:r}),{selectedRows:M,isRowSelected:o,isAllRowsSelected:$,handleSelectAllRows:h,handleSelectRow:H}=v.useDataTable({rows:t,defaultSelectedRows:n});return L.useEffect(()=>{D==null||D(M)},[M,D]),e.jsxs(T.Table,{...c,children:[e.jsx(T.TableHeader,{className:u.cn("bg-bg",i&&"sticky top-0 z-1"),children:e.jsxs(T.TableRow,{children:[s&&e.jsx(T.TableHead,{className:"w-12 p-3",children:e.jsx(U.Checkbox,{className:"mt-1",checked:$(j),onCheckedChange:d=>h(j,!!d),"aria-label":"Select all"})}),A&&e.jsx(T.TableHead,{className:"w-12 p-2",children:"#"}),g.filter(d=>!d.hidden).map(d=>e.jsx(T.TableHead,{style:d.styles,className:u.cn("p-2",d.sortable&&"cursor-pointer"),onClick:()=>d.sortable&&k(d.dataIndex),children:e.jsxs("div",{className:"flex items-center gap-2",children:[d.name," ",d.sortable&&((l==null?void 0:l.sortField)===d.key?e.jsxs(e.Fragment,{children:[(l==null?void 0:l.sortOrder)===Y.SortOrder.DESC&&e.jsx(b.ArrowDownWideNarrow,{size:15}),(l==null?void 0:l.sortOrder)===Y.SortOrder.ASC&&e.jsx(b.ArrowUpWideNarrow,{size:15})]}):e.jsx(b.ArrowUpDown,{size:15}))]})},d.key))]})}),e.jsx(T.TableBody,{className:"[&>tr:nth-child(even)]:bg-bg-secondary",children:t.length?t.map((d,f)=>e.jsxs(T.TableRow,{onClick:()=>p==null?void 0:p(d),className:u.cn(p&&"cursor-pointer"),"data-state":o(d[j])&&"selected",children:[s&&e.jsx(T.TableCell,{className:"w-12 p-3",onClick:w=>w.stopPropagation(),children:e.jsx(U.Checkbox,{className:"mt-1",checked:o(d[j]),onCheckedChange:w=>H(d[j],!!w),"aria-label":"Select row"})}),A&&e.jsx(T.TableCell,{className:"w-12 p-2",children:(N.page-1)*(N.limit||B.DEFAULT_LIMIT)+f+1}),g.filter(w=>!w.hidden).map(w=>e.jsx(T.TableCell,{className:"text-body-xs-medium max-w-xs p-2",style:w.styles,children:w.render?w.render(y.get(d,w.dataIndex),d):y.get(d,w.dataIndex,"")},`${f}-${w.key}`))]},`${d[j]}`)):e.jsx(T.TableRow,{children:e.jsx(T.TableCell,{colSpan:A?s?g.length+2:g.length+1:g.length,children:e.jsx(ee.Empty,{})})})})]})},te=({dataSource:t,columns:g,rowKey:p,hasSearch:j,exportOptions:N,hasPagination:A,onParamChange:s,dataKey:n="docs",loading:D,tableKey:r,filters:i,actions:E,handleFilterChange:c,params:l,exportLoading:k=!1,onColumnsUpdate:M,hasColumnsVisibilityDropdown:o,showAppliedFilters:$=!1,actionProps:h,filterWrapperProps:H,exportOptionsProps:d,columnsVisibilityProps:f,paginationProps:w,searchProps:q,className:a,...m})=>{var X,G;const{t:W}=Z.useTranslation(),{formattedColumns:R,handleColumnsChange:F,resetColumns:K}=v.useColumns({key:r,columns:g});return L.useEffect(()=>{M==null||M(R)},[R,M]),e.jsxs("div",{className:u.cn("border-border-alpha-light relative flex grow flex-col overflow-auto rounded-xl border shadow-xs",a),children:[e.jsxs("div",{className:"flex shrink-0 flex-col gap-4 p-4",children:[(j||o&&r||!v.isEmpty(N)||!v.isEmpty(i))&&e.jsxs("div",{className:"flex flex-col justify-between gap-3 lg:flex-row lg:items-center",children:[e.jsx("div",{className:"grow",children:j&&e.jsx(Q.Search,{...q,inputProps:{...q==null?void 0:q.inputProps,className:u.cn("h-8 grow",(X=q==null?void 0:q.inputProps)==null?void 0:X.className)},className:u.cn("max-w-full lg:max-w-80! [&_button]:-top-1",q==null?void 0:q.className),defaultValue:y.get(l,"search",""),onSearchChange:x=>s==null?void 0:s({...l,search:x,page:1})})}),e.jsxs("div",{className:"flex items-center justify-end gap-3",children:[N&&e.jsx(V.ExportData,{...d,options:N,loading:k}),o&&r&&e.jsxs(z.DropdownMenu,{modal:!1,children:[e.jsx(z.DropdownMenuTrigger,{asChild:!0,className:"grow",...f==null?void 0:f.triggerProps,children:e.jsx(_.Button,{variant:"secondary",size:"sm",className:"ml-auto rounded-lg px-3",children:(f==null?void 0:f.title)||e.jsxs(e.Fragment,{children:[e.jsx(J.yn,{})," ",e.jsx("span",{className:"hidden md:inline!",children:W("Customize columns")}),e.jsx(J.f1,{})]})})}),e.jsxs(z.DropdownMenuContent,{align:"end",...f==null?void 0:f.contentProps,children:[e.jsxs(z.DropdownMenuItem,{"data-testid":"reset-columns-button",onSelect:x=>x.preventDefault(),className:"capitalize",onClick:K,children:[e.jsx(b.RefreshCw,{})," ",(f==null?void 0:f.resetText)||W("Reset columns")]}),e.jsx(z.DropdownMenuSeparator,{}),R.map(x=>e.jsx(z.DropdownMenuCheckboxItem,{"data-testid":x.key,onSelect:I=>I.preventDefault(),className:"capitalize",checked:!x.hidden,onCheckedChange:I=>F(x,!I),children:x.name},x.key))]})]}),E&&e.jsx(S.Actions,{...h,actions:E}),i&&e.jsx(Q.FilterWrapper,{...H,filters:i,params:l,onChange:c,onFilter:x=>{s==null||s({...x,page:1}),c==null||c(x)}})]})]}),$&&!v.isEmpty(i)&&e.jsx(se,{filters:i,params:l,onFilter:x=>{s==null||s({...x,page:1}),c==null||c(x)}})]}),e.jsx("div",{className:u.cn("flex grow flex-col overflow-auto border-y"),children:D?e.jsx(P.Loader,{}):e.jsx(O,{...m,params:{page:(t==null?void 0:t.page)||1,limit:t==null?void 0:t.limit,...l},rows:y.get(t,n,[]),rowKey:p,columns:R,onSortOrderChange:({sortField:x,sortOrder:I})=>{s==null||s({...l,sortField:x,sortOrder:I})}})}),A&&e.jsxs("div",{className:"flex shrink-0 flex-wrap items-center justify-center gap-3 p-4 lg:justify-between",children:[e.jsx("div",{className:"text-sm",children:e.jsx(B.MyLimitSelect,{onLimitChange:x=>s==null?void 0:s({...l,limit:x,page:1}),defaultValue:t==null?void 0:t.limit})}),e.jsx("div",{className:"text-muted-foreground text-sm",children:W("{{selectedCount}} of {{total}} row(s) selected",{selectedCount:((G=m.selectedItems)==null?void 0:G.length)??0,total:(t==null?void 0:t.total)||0})}),e.jsx("div",{children:e.jsx(B.MyPagination,{...w,onPageChange:x=>s==null?void 0:s({...l,page:x}),currentPage:t==null?void 0:t.page,totalPages:t==null?void 0:t.totalPages})})]})]})};exports.DataTable=te;exports.MyTable=O;
|
|
2
2
|
//# sourceMappingURL=index.cjs.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.cjs.js","sources":["../../../src/components/filters/AppliedFilters.tsx","../../../src/components/datatable/MyTable.tsx","../../../src/components/datatable/DataTable.tsx"],"sourcesContent":["import { ButtonGroup } from 'dgz-ui';\nimport { Button } from 'dgz-ui/button';\nimport type { CardProps } from 'dgz-ui/card';\nimport { cn } from 'dgz-ui/utils';\nimport isEmpty from 'lodash.isempty';\nimport { XIcon } from 'lucide-react';\nimport { memo, useMemo } from 'react';\nimport { useTranslation } from 'react-i18next';\nimport type { FilterInterface } from './FilterWrapper.tsx';\n\n/**\n * Props for the AppliedFilters component.\n */\nexport interface AppliedFiltersProps extends CardProps {\n /** Array of filter definitions to render. */\n filters?: FilterInterface[];\n /** Current active parameters/filters. */\n params?: Record<string, unknown>;\n /** Callback fired when filters are applied. */\n onFilter?: (filters: Record<string, unknown>) => void;\n}\n\n/**\n * AppliedFilters displays active filter values as removable buttons/tags.\n *\n * @param props.filters - Array of filter definitions to map values to labels.\n * @param props.params - Current active filter parameters.\n * @param props.onFilter - Callback fired when a filter is removed.\n * @param props.className - Additional CSS classes.\n * @returns {JSX.Element | false} A list of active filter buttons or false if no filters are active\n */\nexport const AppliedFilters = memo(function FilterWrapper({\n filters,\n params,\n onFilter,\n className,\n ...props\n}: AppliedFiltersProps) {\n const { t } = useTranslation();\n\n const filterObject = useMemo(\n () =>\n Object.fromEntries(\n filters?.map((filter) => [\n filter.name,\n Object.fromEntries(\n filter.options?.map(({ label, value }) => [value, label]) || []\n ),\n ]) || []\n ),\n [filters]\n );\n\n const paramsArr = useMemo(\n () =>\n Object.entries(params || {}).filter(\n ([key, value]) => !!filterObject?.[key] && !isEmpty(value)\n ),\n [filterObject, params]\n );\n\n return (\n !isEmpty(paramsArr) && (\n <div {...props} className={cn('flex flex-wrap gap-2', className)}>\n {paramsArr.map(([key, value]) =>\n Array.isArray(value) ? (\n <ButtonGroup key={key}>\n {value\n .filter((val) => filterObject?.[key]?.[val] && val)\n .map((val, index) => (\n <Button\n size={'sm'}\n key={index}\n onClick={() => {\n onFilter?.({\n ...params,\n [key]: value.filter((v) => v !== val),\n });\n }}\n >\n {t(String(filterObject?.[key]?.[val] || ''))} <XIcon />\n </Button>\n ))}\n </ButtonGroup>\n ) : (\n <Button\n size={'sm'}\n onClick={() => {\n const paramValues = { ...params };\n\n delete paramValues[key];\n onFilter?.(paramValues);\n }}\n >\n {t(String(filterObject?.[key]?.[value as string] || ''))}{' '}\n <XIcon />\n </Button>\n )\n )}\n </div>\n )\n );\n});\n","import { Checkbox } from 'dgz-ui/form';\nimport {\n Table,\n TableBody,\n TableCell,\n TableHead,\n TableHeader,\n TableRow,\n} from 'dgz-ui/table';\nimport { cn } from 'dgz-ui/utils';\nimport get from 'lodash.get';\nimport {\n ArrowDownWideNarrow,\n ArrowUpDown,\n ArrowUpWideNarrow,\n} from 'lucide-react';\nimport { type ComponentProps, useEffect } from 'react';\nimport { SortOrder } from '../../enums';\nimport { useDataTable, useSortable, type UseSortableProps } from '../../hooks';\nimport type { ColumnType } from '../../types';\nimport { Empty } from '../empty';\nimport { DEFAULT_LIMIT } from '../pagination/MyLimitSelect';\n\n/**\n * Props for the MyTable component.\n * @template TData - The type of data in the table.\n */\nexport interface MyTableProps<TData> extends ComponentProps<'table'> {\n /** Array of data rows to display. */\n rows?: TData[];\n /** Column definitions. */\n columns: ColumnType<TData>[];\n /** Callback when a row is clicked. */\n onRowClick?: (row: TData) => void;\n /** Whether to show row numbers. */\n hasNumbers?: boolean;\n /** Whether to show selection checkboxes. */\n hasCheckbox?: boolean;\n /** Unique key for each row. */\n rowKey: keyof TData;\n /** Current table parameters (page, limit, sort). */\n params?: Record<string, unknown>;\n /** Total number of items (optional, often used with pagination context). */\n total?: number;\n /** Array of currently selected item keys. */\n selectedItems?: TData[keyof TData][];\n /** Callback when selected items change. */\n onSelectedItemsChange?: (selectedItems?: TData[keyof TData][]) => void;\n /** Callback when sort order changes. */\n onSortOrderChange?: (\n params: Omit<UseSortableProps<TData>, 'onSortOrderChange'>\n ) => void;\n /** Whether the header should stick to the top. */\n isStickyHeader?: true;\n}\n\n/**\n * MyTable renders a generic data table with optional numbering, selection checkboxes,\n * sortable columns and sticky header. It is a presentational component and delegates\n * sorting/selection state via hooks and callbacks.\n *\n * @template TData - The row data type.\n * @param rows - Array of data rows.\n * @param columns - Column definitions.\n * @param onRowClick - Callback when a row is clicked.\n * @param rowKey - Unique key for each row.\n * @param params - Current table parameters.\n * @param hasNumbers - Whether to show row numbers.\n * @param hasCheckbox - Whether to show selection checkboxes.\n * @param selectedItems - Array of currently selected item keys.\n * @param onSelectedItemsChange - Callback when selected items change.\n * @param onSortOrderChange - Callback when sort order changes.\n * @param isStickyHeader - Whether the header should stick to the top.\n * @param className - Additional CSS classes.\n * @param props - Component props.\n * @returns {JSX.Element} React element containing the table.\n */\nexport const MyTable = <TData,>({\n rows = [],\n columns,\n onRowClick,\n rowKey,\n params = {\n page: 1,\n limit: DEFAULT_LIMIT,\n },\n hasNumbers = false,\n hasCheckbox = false,\n selectedItems,\n onSelectedItemsChange,\n onSortOrderChange,\n isStickyHeader,\n className,\n ...props\n}: MyTableProps<TData>) => {\n const { sortObject, handleSort } = useSortable<TData>({\n sortField: params?.sortField as keyof TData | undefined,\n sortOrder: params?.sortOrder as SortOrder | undefined,\n onSortOrderChange,\n });\n const {\n selectedRows,\n isRowSelected,\n isAllRowsSelected,\n handleSelectAllRows,\n handleSelectRow,\n } = useDataTable<TData>({ rows, defaultSelectedRows: selectedItems });\n\n useEffect(() => {\n onSelectedItemsChange?.(selectedRows);\n }, [selectedRows, onSelectedItemsChange]);\n\n return (\n <Table {...props}>\n <TableHeader\n className={cn('bg-bg', isStickyHeader && 'sticky top-0 z-1')}\n >\n <TableRow>\n {hasCheckbox && (\n <TableHead className={'w-12 p-3'}>\n <Checkbox\n className={'mt-1'}\n checked={isAllRowsSelected(rowKey)}\n onCheckedChange={(value) =>\n handleSelectAllRows(rowKey, !!value)\n }\n aria-label=\"Select all\"\n />\n </TableHead>\n )}\n {hasNumbers && <TableHead className={'w-12 p-2'}>#</TableHead>}\n {columns\n .filter((column) => !column.hidden)\n .map((column) => (\n <TableHead\n key={column.key}\n style={column.styles}\n className={cn('p-2', column.sortable && 'cursor-pointer')}\n onClick={() => column.sortable && handleSort(column.dataIndex)}\n >\n <div className={'flex items-center gap-2'}>\n {column.name}{' '}\n {column.sortable &&\n (sortObject?.sortField === column.key ? (\n <>\n {sortObject?.sortOrder === SortOrder.DESC && (\n <ArrowDownWideNarrow size={15} />\n )}\n {sortObject?.sortOrder === SortOrder.ASC && (\n <ArrowUpWideNarrow size={15} />\n )}\n </>\n ) : (\n <ArrowUpDown size={15} />\n ))}\n </div>\n </TableHead>\n ))}\n </TableRow>\n </TableHeader>\n <TableBody className={'[&>tr:nth-child(even)]:bg-bg-secondary'}>\n {rows.length ? (\n rows.map((row, index) => (\n <TableRow\n key={`${row[rowKey]}`}\n onClick={() => onRowClick?.(row)}\n className={cn(onRowClick && 'cursor-pointer')}\n data-state={isRowSelected(row[rowKey]) && 'selected'}\n >\n {hasCheckbox && (\n <TableCell\n className={'w-12 p-3'}\n onClick={(evt) => evt.stopPropagation()}\n >\n <Checkbox\n className={'mt-1'}\n checked={isRowSelected(row[rowKey])}\n onCheckedChange={(value) =>\n handleSelectRow(row[rowKey], !!value)\n }\n aria-label=\"Select row\"\n />\n </TableCell>\n )}\n {hasNumbers && (\n <TableCell className={'w-12 p-2'}>\n {((params.page as number) - 1) *\n ((params.limit || DEFAULT_LIMIT) as number) +\n index +\n 1}\n </TableCell>\n )}\n {columns\n .filter((column) => !column.hidden)\n .map((column) => (\n <TableCell\n className={'text-body-xs-medium max-w-xs p-2'}\n style={column.styles}\n key={`${index}-${column.key}`}\n >\n {column.render\n ? column.render(get(row, column.dataIndex), row)\n : get(row, column.dataIndex, '')}\n </TableCell>\n ))}\n </TableRow>\n ))\n ) : (\n <TableRow>\n <TableCell\n colSpan={\n hasNumbers\n ? hasCheckbox\n ? columns.length + 2\n : columns.length + 1\n : columns.length\n }\n >\n <Empty />\n </TableCell>\n </TableRow>\n )}\n </TableBody>\n </Table>\n );\n};\n","import { RiArrowDownSLine, RiLayoutColumnLine } from '@remixicon/react';\nimport { Button } from 'dgz-ui/button';\nimport {\n type DropdownContainerProps,\n DropdownMenu,\n DropdownMenuCheckboxItem,\n DropdownMenuContent,\n DropdownMenuItem,\n DropdownMenuSeparator,\n DropdownMenuTrigger,\n} from 'dgz-ui/dropdown';\nimport { cn } from 'dgz-ui/utils';\nimport get from 'lodash.get';\nimport isEmpty from 'lodash.isempty';\nimport { RefreshCw } from 'lucide-react';\nimport { type ReactNode, useEffect } from 'react';\nimport { useTranslation } from 'react-i18next';\nimport { useColumns } from '../../hooks';\nimport type { ColumnType } from '../../types';\nimport { type ActionInterface, Actions, type ActionsProps } from '../actions';\nimport {\n ExportData,\n type ExportDataInterface,\n type ExportDataProps,\n} from '../export';\nimport {\n type FilterInterface,\n FilterWrapper,\n type FilterWrapperProps,\n Search,\n type SearchProps,\n} from '../filters';\nimport { AppliedFilters } from '../filters/AppliedFilters.tsx';\nimport { Loader } from '../loader';\nimport { MyLimitSelect, MyPagination } from '../pagination';\nimport type { MyPaginationProps } from '../pagination/MyPagination.tsx';\nimport { MyTable, type MyTableProps } from './MyTable';\n\n/**\n * Minimal pagination wrapper contract used by `DataTable`.\n *\n * Notes\n * - Only `page`, `limit`, and `totalPages` are required. Other fields are optional and\n * may be provided by your API for convenience.\n * - The actual rows array can be stored in any key, controlled via `dataKey` prop\n * (defaults to `\"docs\"`).\n */\nexport interface PaginationInterface<TData> {\n /** Array of rows for the current page. Used when `dataKey` is set to `\"docs\"`. */\n docs?: TData[];\n /** Zero-based index of the first item on the current page (if provided by API). */\n offset?: number;\n /** Page size (items per page). */\n limit: number;\n /** Total number of pages available. */\n totalPages: number;\n /** Total number of items across all pages (if available). */\n total?: number;\n /** Current page number (1-based). */\n page: number;\n /** Convenience counter for the first item index on the page (if provided). */\n pagingCounter?: number;\n /** Whether a previous page exists. */\n hasPrevPage?: boolean;\n /** Whether a next page exists. */\n hasNextPage?: boolean;\n /** Previous page number, if available. */\n prevPage?: number;\n /** Next page number, if available. */\n nextPage?: number;\n}\n\n/**\n * Props for the DataTable component.\n *\n * @template TData - Row data type.\n * @template TPaginationData - Pagination wrapper type.\n */\nexport interface DataTableProps<\n TData,\n TPaginationData extends PaginationInterface<TData>,\n> extends Omit<MyTableProps<TData>, 'rows'> {\n /** Pagination data source. */\n dataSource?: TPaginationData;\n /** Callback for parameter changes (pagination, sorting, filtering). */\n onParamChange?: (param: Record<string, unknown>) => void;\n /** Whether to enable pagination. */\n hasPagination?: true;\n /** Options for the export data dropdown. */\n exportOptions?: ExportDataInterface[];\n /** Whether to enable search functionality. */\n hasSearch?: true;\n /** Whether the table data is loading. */\n loading?: boolean;\n /** Array of filters to display. */\n filters?: FilterInterface[];\n /** Array of actions to display. */\n actions?: ActionInterface[];\n /** Callback for filter changes. */\n handleFilterChange?: (filters: Record<string, unknown>) => void;\n /** Unique key for the table, used for column persistence. */\n tableKey: string;\n /** The key in dataSource where the data array is located. Defaults to \"docs\". */\n dataKey?: keyof TPaginationData;\n /** Whether to show the columns visibility dropdown. */\n hasColumnsVisibilityDropdown?: true;\n /** Whether to show the columns visibility dropdown. */\n showAppliedFilters?: boolean;\n /** Callback when columns are updated (e.g., visibility toggled). */\n onColumnsUpdate?: (columns: ColumnType<TData>[]) => void;\n /** Whether the export action is loading. */\n exportLoading?: boolean;\n /** Props for the Actions component. */\n actionProps?: Partial<ActionsProps>;\n /** Props for the FilterWrapper component. */\n filterWrapperProps?: Partial<FilterWrapperProps>;\n /** Props for the ExportData component. */\n exportOptionsProps?: Partial<ExportDataProps>;\n searchProps?: Partial<SearchProps>;\n paginationProps?: Partial<MyPaginationProps>;\n /** Props for the columns visibility dropdown. */\n columnsVisibilityProps?: DropdownContainerProps & {\n title?: ReactNode;\n resetText?: ReactNode;\n };\n}\n\n/**\n * DataTable is a composable, high-level table that brings together search, filters,\n * column visibility management, header actions, exporting, and pagination.\n * It renders `MyTable` for rows and, when enabled, shows header controls and a footer with pagination.\n *\n * Generic Types\n * - `TData` — Row data shape (type of each item in the rows array).\n * - `TPaginationData` — Pagination wrapper type containing rows and pagination meta; defaults to\n * `PaginationInterface<TData>`.\n *\n * Key Behaviors\n * - Emits `onParamChange` when search text, filters, page, limit, or sort order change.\n * - Persists column visibility per `tableKey` via `useColumns` and informs parent with `onColumnsUpdate`.\n * - Renders header controls only when the related feature is enabled/has content.\n *\n * Accessibility\n * - Header controls and dropdowns reuse shared primitives that include keyboard and ARIA support.\n *\n * Internationalization\n * - Text such as \"Export\", \"Customize columns\", and \"Reset columns\" are resolved via `react-i18next`.\n *\n * Usage Examples\n * 1) Minimal paginated table (uses default `dataKey = \"docs\"`)\n * ```tsx\n * type User = { id: string; name: string };\n * const data = { docs: [{ id: '1', name: 'Ada' }], page: 1, limit: 10, totalPages: 1 };\n *\n * <DataTable<User>\n * tableKey=\"users-table\"\n * columns={[{ key: 'name', name: 'Name' }]}\n * rowKey=\"id\"\n * dataSource={data}\n * hasPagination\n * />\n * ```\n *\n * 2) Custom `dataKey` and column visibility persistence\n * ```tsx\n * type Row = { id: number; title: string };\n * const payload = { items: [{ id: 1, title: 'Hello' }], page: 1, limit: 20, totalPages: 1 };\n *\n * <DataTable<Row>\n * tableKey=\"posts\"\n * columns={[{ key: 'title', name: 'Title' }]}\n * rowKey=\"id\"\n * dataSource={payload}\n * dataKey=\"items\"\n * hasColumnsVisibilityDropdown\n * />\n * ```\n *\n * 3) Responding to user interactions via `onParamChange`\n * ```tsx\n * const [params, setParams] = useState({ page: 1, limit: 10 });\n *\n * <DataTable\n * tableKey=\"logs\"\n * columns={[{ key: 'message', name: 'Message' }]}\n * rowKey=\"id\"\n * params={params}\n * onParamChange={setParams}\n * hasSearch\n * hasPagination\n * />\n * ```\n *\n * Notes and Best Practices\n * - Ensure `rowKey` points to a stable unique field in `TData` to avoid key collisions.\n * - When arrays like `exportOptions`, `filters`, or `actions` are empty, their sections are not rendered.\n * - Sorting emits `{ sortField, sortOrder }` through `onParamChange` when the user toggles a column sort.\n *\n * @template TData - Row data type.\n * @template TPaginationData - Pagination wrapper type.\n * @param dataSource - Paginated data source object.\n * @param columns - Column definitions.\n * @param rowKey - Property name used as a unique row key.\n * @param hasSearch - Whether to display the search input.\n * @param exportOptions - Export menu options.\n * @param hasPagination - Whether to render the pagination footer.\n * @param onParamChange - Emits parameter changes for pagination/sorting/search/filters.\n * @param dataKey - Key within `dataSource` that contains the row array.\n * @param loading - Whether the table data is loading.\n * @param tableKey - Unique key for persisting column visibility state.\n * @param filters - Filter configurations to render.\n * @param actions - Header actions.\n * @param handleFilterChange - Callback executed when filter values change.\n * @param params - Current list parameters.\n * @param exportLoading - Whether the export action is loading.\n * @param onColumnsUpdate - Notifies parent whenever columns state changes.\n * @param hasColumnsVisibilityDropdown - Whether to show columns customize dropdown.\n * @param showAppliedFilters - Whether to show applied filters.\n * @param onSelectedItemsChange - Callback when selected rows change.\n * @param actionProps - Props for the Actions component.\n * @param filterWrapperProps - Props for the FilterWrapper component.\n * @param exportOptionsProps - Props for the ExportData component.\n * @param columnsVisibilityProps - Props for columns visibility dropdown.\n * @param paginationProps - Props for the MyPagination component.\n * @param searchProps - Props for the Search component.\n * @param className - Additional CSS classes.\n * @param props - Additional props passed to MyTable.\n * @returns {JSX.Element} React element that renders a complete data table experience.\n */\nexport const DataTable = <\n TData,\n TPaginationData extends PaginationInterface<TData> =\n PaginationInterface<TData>,\n>({\n dataSource,\n columns,\n rowKey,\n hasSearch,\n exportOptions,\n hasPagination,\n onParamChange,\n dataKey = 'docs',\n loading,\n tableKey,\n filters,\n actions,\n handleFilterChange,\n params,\n exportLoading = false,\n onColumnsUpdate,\n hasColumnsVisibilityDropdown,\n showAppliedFilters = false,\n actionProps,\n filterWrapperProps,\n exportOptionsProps,\n columnsVisibilityProps,\n paginationProps,\n searchProps,\n className,\n ...props\n}: DataTableProps<TData, TPaginationData>) => {\n const { t } = useTranslation();\n const { formattedColumns, handleColumnsChange, resetColumns } =\n useColumns<TData>({ key: tableKey, columns });\n\n useEffect(() => {\n onColumnsUpdate?.(formattedColumns);\n }, [formattedColumns, onColumnsUpdate]);\n\n return (\n <div\n className={cn(\n 'border-border-alpha-light relative flex grow flex-col overflow-auto rounded-xl border shadow-xs',\n className\n )}\n >\n <div className={'flex shrink-0 flex-col gap-4 p-4'}>\n {(hasSearch ||\n (hasColumnsVisibilityDropdown && tableKey) ||\n !isEmpty(exportOptions) ||\n !isEmpty(filters)) && (\n <div className=\"flex flex-col justify-between gap-3 lg:flex-row lg:items-center\">\n <div className={'grow'}>\n {hasSearch && (\n <Search\n {...searchProps}\n inputProps={{\n ...searchProps?.inputProps,\n className: cn(\n 'h-8 grow',\n searchProps?.inputProps?.className\n ),\n }}\n className={cn(\n 'max-w-full lg:max-w-80! [&_button]:-top-1',\n searchProps?.className\n )}\n defaultValue={get(params, 'search', '') as string}\n onSearchChange={(search) =>\n onParamChange?.({ ...params, search, page: 1 })\n }\n />\n )}\n </div>\n <div className={'flex items-center justify-end gap-3'}>\n {exportOptions && (\n <ExportData\n {...exportOptionsProps}\n options={exportOptions}\n loading={exportLoading}\n />\n )}\n {hasColumnsVisibilityDropdown && tableKey && (\n <DropdownMenu modal={false}>\n <DropdownMenuTrigger\n asChild\n className={'grow'}\n {...columnsVisibilityProps?.triggerProps}\n >\n <Button\n variant=\"secondary\"\n size={'sm'}\n className={'ml-auto rounded-lg px-3'}\n >\n {columnsVisibilityProps?.title || (\n <>\n <RiLayoutColumnLine />{' '}\n <span className={'hidden md:inline!'}>\n {t('Customize columns')}\n </span>\n <RiArrowDownSLine />\n </>\n )}\n </Button>\n </DropdownMenuTrigger>\n <DropdownMenuContent\n align=\"end\"\n {...columnsVisibilityProps?.contentProps}\n >\n <DropdownMenuItem\n onSelect={(e) => e.preventDefault()}\n className=\"capitalize\"\n onClick={resetColumns}\n >\n <RefreshCw />{' '}\n {columnsVisibilityProps?.resetText || t('Reset columns')}\n </DropdownMenuItem>\n <DropdownMenuSeparator />\n {formattedColumns.map((column) => {\n return (\n <DropdownMenuCheckboxItem\n key={column.key}\n data-testid={column.key}\n onSelect={(e) => e.preventDefault()}\n className=\"capitalize\"\n checked={!column.hidden}\n onCheckedChange={(value) =>\n handleColumnsChange(column, !value)\n }\n >\n {column.name}\n </DropdownMenuCheckboxItem>\n );\n })}\n </DropdownMenuContent>\n </DropdownMenu>\n )}\n {actions && <Actions {...actionProps} actions={actions} />}\n {filters && (\n <FilterWrapper\n {...filterWrapperProps}\n filters={filters}\n params={params}\n onChange={handleFilterChange}\n onFilter={(filter) => {\n onParamChange?.({ ...filter, page: 1 });\n handleFilterChange?.(filter);\n }}\n />\n )}\n </div>\n </div>\n )}\n {showAppliedFilters && !isEmpty(filters) && (\n <AppliedFilters\n filters={filters}\n params={params}\n onFilter={(filter) => {\n onParamChange?.({ ...filter, page: 1 });\n handleFilterChange?.(filter);\n }}\n />\n )}\n </div>\n\n <div className={cn('flex grow flex-col overflow-auto border-y')}>\n {!loading ? (\n <MyTable<TData>\n {...props}\n params={{\n page: dataSource?.page || 1,\n limit: dataSource?.limit,\n ...params,\n }}\n rows={get(dataSource, dataKey, []) as TData[]}\n rowKey={rowKey}\n columns={formattedColumns}\n onSortOrderChange={({ sortField, sortOrder }) => {\n onParamChange?.({ ...params, sortField, sortOrder });\n }}\n />\n ) : (\n <Loader />\n )}\n </div>\n {hasPagination && (\n <div className=\"flex shrink-0 flex-wrap items-center justify-center gap-3 p-4 lg:justify-between\">\n <div className=\"text-sm\">\n <MyLimitSelect\n onLimitChange={(limit) =>\n onParamChange?.({ ...params, limit, page: 1 })\n }\n defaultValue={dataSource?.limit}\n />\n </div>\n <div className=\"text-muted-foreground text-sm\">\n {t('{{selectedCount}} of {{total}} row(s) selected', {\n selectedCount: props.selectedItems?.length ?? 0,\n total: dataSource?.total || 0,\n })}\n </div>\n <div>\n <MyPagination\n {...paginationProps}\n onPageChange={(page) => onParamChange?.({ ...params, page })}\n currentPage={dataSource?.page}\n totalPages={dataSource?.totalPages}\n />\n </div>\n </div>\n )}\n </div>\n );\n};\n"],"names":["AppliedFilters","memo","filters","params","onFilter","className","props","t","useTranslation","filterObject","useMemo","filter","_a","label","value","paramsArr","key","isEmpty","jsx","cn","ButtonGroup","val","index","jsxs","Button","v","XIcon","paramValues","MyTable","rows","columns","onRowClick","rowKey","DEFAULT_LIMIT","hasNumbers","hasCheckbox","selectedItems","onSelectedItemsChange","onSortOrderChange","isStickyHeader","sortObject","handleSort","useSortable","selectedRows","isRowSelected","isAllRowsSelected","handleSelectAllRows","handleSelectRow","useDataTable","useEffect","Table","TableHeader","TableRow","TableHead","Checkbox","column","Fragment","SortOrder","ArrowDownWideNarrow","ArrowUpWideNarrow","ArrowUpDown","TableBody","row","TableCell","evt","get","Empty","DataTable","dataSource","hasSearch","exportOptions","hasPagination","onParamChange","dataKey","loading","tableKey","actions","handleFilterChange","exportLoading","onColumnsUpdate","hasColumnsVisibilityDropdown","showAppliedFilters","actionProps","filterWrapperProps","exportOptionsProps","columnsVisibilityProps","paginationProps","searchProps","formattedColumns","handleColumnsChange","resetColumns","useColumns","Search","search","ExportData","DropdownMenu","DropdownMenuTrigger","RiLayoutColumnLine","RiArrowDownSLine","DropdownMenuContent","DropdownMenuItem","e","RefreshCw","DropdownMenuSeparator","DropdownMenuCheckboxItem","Actions","FilterWrapper","Loader","sortField","sortOrder","MyLimitSelect","limit","_b","MyPagination","page"],"mappings":"m1BA+BaA,GAAiBC,EAAAA,KAAK,SAAuB,CACxD,QAAAC,EACA,OAAAC,EACA,SAAAC,EACA,UAAAC,EACA,GAAGC,CACL,EAAwB,CACtB,KAAM,CAAA,EAAEC,CAAA,EAAMC,iBAAA,EAERC,EAAeC,EAAAA,QACnB,IACE,OAAO,aACLR,GAAA,YAAAA,EAAS,IAAKS,GAAA,OAAW,OACvBA,EAAO,KACP,OAAO,cACLC,EAAAD,EAAO,UAAP,YAAAC,EAAgB,IAAI,CAAC,CAAE,MAAAC,EAAO,MAAAC,CAAA,IAAY,CAACA,EAAOD,CAAK,KAAM,CAAA,CAAC,CAChE,MACI,CAAA,CAAC,EAEX,CAACX,CAAO,CAAA,EAGJa,EAAYL,EAAAA,QAChB,IACE,OAAO,QAAQP,GAAU,CAAA,CAAE,EAAE,OAC3B,CAAC,CAACa,EAAKF,CAAK,IAAM,CAAC,EAACL,GAAA,MAAAA,EAAeO,KAAQ,CAACC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AAE,GAAGrE,EAAQ,KAAA+G,IACrD,YAAa9C,GAAA,YAAAA,EAAY,KACzB,WAAYA,GAAA,YAAAA,EAAY,UAAA,CAAA,CAC1B,CACF,CAAA,CAAA,CACF,CAAA,CAAA,CAAA,CAIR"}
|
|
1
|
+
{"version":3,"file":"index.cjs.js","sources":["../../../src/components/filters/AppliedFilters.tsx","../../../src/components/datatable/MyTable.tsx","../../../src/components/datatable/DataTable.tsx"],"sourcesContent":["import { ButtonGroup } from 'dgz-ui';\nimport { Button } from 'dgz-ui/button';\nimport type { CardProps } from 'dgz-ui/card';\nimport { cn } from 'dgz-ui/utils';\nimport isEmpty from 'lodash.isempty';\nimport { XIcon } from 'lucide-react';\nimport { memo, useMemo } from 'react';\nimport { useTranslation } from 'react-i18next';\nimport type { FilterInterface } from './FilterWrapper.tsx';\n\n/**\n * Props for the AppliedFilters component.\n */\nexport interface AppliedFiltersProps extends CardProps {\n /** Array of filter definitions to render. */\n filters?: FilterInterface[];\n /** Current active parameters/filters. */\n params?: Record<string, unknown>;\n /** Callback fired when filters are applied. */\n onFilter?: (filters: Record<string, unknown>) => void;\n}\n\n/**\n * AppliedFilters displays active filter values as removable buttons/tags.\n *\n * @param props.filters - Array of filter definitions to map values to labels.\n * @param props.params - Current active filter parameters.\n * @param props.onFilter - Callback fired when a filter is removed.\n * @param props.className - Additional CSS classes.\n * @returns {JSX.Element | false} A list of active filter buttons or false if no filters are active\n */\nexport const AppliedFilters = memo(function FilterWrapper({\n filters,\n params,\n onFilter,\n className,\n ...props\n}: AppliedFiltersProps) {\n const { t } = useTranslation();\n\n const filterObject = useMemo(\n () =>\n Object.fromEntries(\n filters?.map((filter) => [\n filter.name,\n Object.fromEntries(\n filter.options?.map(({ label, value }) => [value, label]) || []\n ),\n ]) || []\n ),\n [filters]\n );\n\n const paramsArr = useMemo(\n () =>\n Object.entries(params || {}).filter(\n ([key, value]) => !!filterObject?.[key] && !isEmpty(value)\n ),\n [filterObject, params]\n );\n\n return (\n !isEmpty(paramsArr) && (\n <div {...props} className={cn('flex flex-wrap gap-2', className)}>\n {paramsArr.map(([key, value]) =>\n Array.isArray(value) ? (\n <ButtonGroup key={key}>\n {value\n .filter((val) => filterObject?.[key]?.[val] && val)\n .map((val, index) => (\n <Button\n size={'sm'}\n key={index}\n onClick={() => {\n onFilter?.({\n ...params,\n [key]: value.filter((v) => v !== val),\n });\n }}\n >\n {t(String(filterObject?.[key]?.[val] || ''))} <XIcon />\n </Button>\n ))}\n </ButtonGroup>\n ) : (\n <Button\n size={'sm'}\n onClick={() => {\n const paramValues = { ...params };\n\n delete paramValues[key];\n onFilter?.(paramValues);\n }}\n >\n {t(String(filterObject?.[key]?.[value as string] || ''))}{' '}\n <XIcon />\n </Button>\n )\n )}\n </div>\n )\n );\n});\n","import { Checkbox } from 'dgz-ui/form';\nimport {\n Table,\n TableBody,\n TableCell,\n TableHead,\n TableHeader,\n TableRow,\n} from 'dgz-ui/table';\nimport { cn } from 'dgz-ui/utils';\nimport get from 'lodash.get';\nimport {\n ArrowDownWideNarrow,\n ArrowUpDown,\n ArrowUpWideNarrow,\n} from 'lucide-react';\nimport { type ComponentProps, useEffect } from 'react';\nimport { SortOrder } from '../../enums';\nimport { useDataTable, useSortable, type UseSortableProps } from '../../hooks';\nimport type { ColumnType } from '../../types';\nimport { Empty } from '../empty';\nimport { DEFAULT_LIMIT } from '../pagination/MyLimitSelect';\n\n/**\n * Props for the MyTable component.\n * @template TData - The type of data in the table.\n */\nexport interface MyTableProps<TData> extends ComponentProps<'table'> {\n /** Array of data rows to display. */\n rows?: TData[];\n /** Column definitions. */\n columns: ColumnType<TData>[];\n /** Callback when a row is clicked. */\n onRowClick?: (row: TData) => void;\n /** Whether to show row numbers. */\n hasNumbers?: boolean;\n /** Whether to show selection checkboxes. */\n hasCheckbox?: boolean;\n /** Unique key for each row. */\n rowKey: keyof TData;\n /** Current table parameters (page, limit, sort). */\n params?: Record<string, unknown>;\n /** Total number of items (optional, often used with pagination context). */\n total?: number;\n /** Array of currently selected item keys. */\n selectedItems?: TData[keyof TData][];\n /** Callback when selected items change. */\n onSelectedItemsChange?: (selectedItems?: TData[keyof TData][]) => void;\n /** Callback when sort order changes. */\n onSortOrderChange?: (\n params: Omit<UseSortableProps<TData>, 'onSortOrderChange'>\n ) => void;\n /** Whether the header should stick to the top. */\n isStickyHeader?: true;\n}\n\n/**\n * MyTable renders a generic data table with optional numbering, selection checkboxes,\n * sortable columns and sticky header. It is a presentational component and delegates\n * sorting/selection state via hooks and callbacks.\n *\n * @template TData - The row data type.\n * @param rows - Array of data rows.\n * @param columns - Column definitions.\n * @param onRowClick - Callback when a row is clicked.\n * @param rowKey - Unique key for each row.\n * @param params - Current table parameters.\n * @param hasNumbers - Whether to show row numbers.\n * @param hasCheckbox - Whether to show selection checkboxes.\n * @param selectedItems - Array of currently selected item keys.\n * @param onSelectedItemsChange - Callback when selected items change.\n * @param onSortOrderChange - Callback when sort order changes.\n * @param isStickyHeader - Whether the header should stick to the top.\n * @param className - Additional CSS classes.\n * @param props - Component props.\n * @returns {JSX.Element} React element containing the table.\n */\nexport const MyTable = <TData,>({\n rows = [],\n columns,\n onRowClick,\n rowKey,\n params = {\n page: 1,\n limit: DEFAULT_LIMIT,\n },\n hasNumbers = false,\n hasCheckbox = false,\n selectedItems,\n onSelectedItemsChange,\n onSortOrderChange,\n isStickyHeader,\n className,\n ...props\n}: MyTableProps<TData>) => {\n const { sortObject, handleSort } = useSortable<TData>({\n sortField: params?.sortField as keyof TData | undefined,\n sortOrder: params?.sortOrder as SortOrder | undefined,\n onSortOrderChange,\n });\n const {\n selectedRows,\n isRowSelected,\n isAllRowsSelected,\n handleSelectAllRows,\n handleSelectRow,\n } = useDataTable<TData>({ rows, defaultSelectedRows: selectedItems });\n\n useEffect(() => {\n onSelectedItemsChange?.(selectedRows);\n }, [selectedRows, onSelectedItemsChange]);\n\n return (\n <Table {...props}>\n <TableHeader\n className={cn('bg-bg', isStickyHeader && 'sticky top-0 z-1')}\n >\n <TableRow>\n {hasCheckbox && (\n <TableHead className={'w-12 p-3'}>\n <Checkbox\n className={'mt-1'}\n checked={isAllRowsSelected(rowKey)}\n onCheckedChange={(value) =>\n handleSelectAllRows(rowKey, !!value)\n }\n aria-label=\"Select all\"\n />\n </TableHead>\n )}\n {hasNumbers && <TableHead className={'w-12 p-2'}>#</TableHead>}\n {columns\n .filter((column) => !column.hidden)\n .map((column) => (\n <TableHead\n key={column.key}\n style={column.styles}\n className={cn('p-2', column.sortable && 'cursor-pointer')}\n onClick={() => column.sortable && handleSort(column.dataIndex)}\n >\n <div className={'flex items-center gap-2'}>\n {column.name}{' '}\n {column.sortable &&\n (sortObject?.sortField === column.key ? (\n <>\n {sortObject?.sortOrder === SortOrder.DESC && (\n <ArrowDownWideNarrow size={15} />\n )}\n {sortObject?.sortOrder === SortOrder.ASC && (\n <ArrowUpWideNarrow size={15} />\n )}\n </>\n ) : (\n <ArrowUpDown size={15} />\n ))}\n </div>\n </TableHead>\n ))}\n </TableRow>\n </TableHeader>\n <TableBody className={'[&>tr:nth-child(even)]:bg-bg-secondary'}>\n {rows.length ? (\n rows.map((row, index) => (\n <TableRow\n key={`${row[rowKey]}`}\n onClick={() => onRowClick?.(row)}\n className={cn(onRowClick && 'cursor-pointer')}\n data-state={isRowSelected(row[rowKey]) && 'selected'}\n >\n {hasCheckbox && (\n <TableCell\n className={'w-12 p-3'}\n onClick={(evt) => evt.stopPropagation()}\n >\n <Checkbox\n className={'mt-1'}\n checked={isRowSelected(row[rowKey])}\n onCheckedChange={(value) =>\n handleSelectRow(row[rowKey], !!value)\n }\n aria-label=\"Select row\"\n />\n </TableCell>\n )}\n {hasNumbers && (\n <TableCell className={'w-12 p-2'}>\n {((params.page as number) - 1) *\n ((params.limit || DEFAULT_LIMIT) as number) +\n index +\n 1}\n </TableCell>\n )}\n {columns\n .filter((column) => !column.hidden)\n .map((column) => (\n <TableCell\n className={'text-body-xs-medium max-w-xs p-2'}\n style={column.styles}\n key={`${index}-${column.key}`}\n >\n {column.render\n ? column.render(get(row, column.dataIndex), row)\n : get(row, column.dataIndex, '')}\n </TableCell>\n ))}\n </TableRow>\n ))\n ) : (\n <TableRow>\n <TableCell\n colSpan={\n hasNumbers\n ? hasCheckbox\n ? columns.length + 2\n : columns.length + 1\n : columns.length\n }\n >\n <Empty />\n </TableCell>\n </TableRow>\n )}\n </TableBody>\n </Table>\n );\n};\n","import { RiArrowDownSLine, RiLayoutColumnLine } from '@remixicon/react';\nimport { Button } from 'dgz-ui/button';\nimport {\n type DropdownContainerProps,\n DropdownMenu,\n DropdownMenuCheckboxItem,\n DropdownMenuContent,\n DropdownMenuItem,\n DropdownMenuSeparator,\n DropdownMenuTrigger,\n} from 'dgz-ui/dropdown';\nimport { cn } from 'dgz-ui/utils';\nimport get from 'lodash.get';\nimport isEmpty from 'lodash.isempty';\nimport { RefreshCw } from 'lucide-react';\nimport { type ReactNode, useEffect } from 'react';\nimport { useTranslation } from 'react-i18next';\nimport { useColumns } from '../../hooks';\nimport type { ColumnType } from '../../types';\nimport { type ActionInterface, Actions, type ActionsProps } from '../actions';\nimport {\n ExportData,\n type ExportDataInterface,\n type ExportDataProps,\n} from '../export';\nimport {\n type FilterInterface,\n FilterWrapper,\n type FilterWrapperProps,\n Search,\n type SearchProps,\n} from '../filters';\nimport { AppliedFilters } from '../filters/AppliedFilters.tsx';\nimport { Loader } from '../loader';\nimport { MyLimitSelect, MyPagination } from '../pagination';\nimport type { MyPaginationProps } from '../pagination/MyPagination.tsx';\nimport { MyTable, type MyTableProps } from './MyTable';\n\n/**\n * Minimal pagination wrapper contract used by `DataTable`.\n *\n * Notes\n * - Only `page`, `limit`, and `totalPages` are required. Other fields are optional and\n * may be provided by your API for convenience.\n * - The actual rows array can be stored in any key, controlled via `dataKey` prop\n * (defaults to `\"docs\"`).\n */\nexport interface PaginationInterface<TData> {\n /** Array of rows for the current page. Used when `dataKey` is set to `\"docs\"`. */\n docs?: TData[];\n /** Zero-based index of the first item on the current page (if provided by API). */\n offset?: number;\n /** Page size (items per page). */\n limit: number;\n /** Total number of pages available. */\n totalPages: number;\n /** Total number of items across all pages (if available). */\n total?: number;\n /** Current page number (1-based). */\n page: number;\n /** Convenience counter for the first item index on the page (if provided). */\n pagingCounter?: number;\n /** Whether a previous page exists. */\n hasPrevPage?: boolean;\n /** Whether a next page exists. */\n hasNextPage?: boolean;\n /** Previous page number, if available. */\n prevPage?: number;\n /** Next page number, if available. */\n nextPage?: number;\n}\n\n/**\n * Props for the DataTable component.\n *\n * @template TData - Row data type.\n * @template TPaginationData - Pagination wrapper type.\n */\nexport interface DataTableProps<\n TData,\n TPaginationData extends PaginationInterface<TData>,\n> extends Omit<MyTableProps<TData>, 'rows'> {\n /** Pagination data source. */\n dataSource?: TPaginationData;\n /** Callback for parameter changes (pagination, sorting, filtering). */\n onParamChange?: (param: Record<string, unknown>) => void;\n /** Whether to enable pagination. */\n hasPagination?: true;\n /** Options for the export data dropdown. */\n exportOptions?: ExportDataInterface[];\n /** Whether to enable search functionality. */\n hasSearch?: true;\n /** Whether the table data is loading. */\n loading?: boolean;\n /** Array of filters to display. */\n filters?: FilterInterface[];\n /** Array of actions to display. */\n actions?: ActionInterface[];\n /** Callback for filter changes. */\n handleFilterChange?: (filters: Record<string, unknown>) => void;\n /** Unique key for the table, used for column persistence. */\n tableKey: string;\n /** The key in dataSource where the data array is located. Defaults to \"docs\". */\n dataKey?: keyof TPaginationData;\n /** Whether to show the columns visibility dropdown. */\n hasColumnsVisibilityDropdown?: true;\n /** Whether to show the columns visibility dropdown. */\n showAppliedFilters?: boolean;\n /** Callback when columns are updated (e.g., visibility toggled). */\n onColumnsUpdate?: (columns: ColumnType<TData>[]) => void;\n /** Whether the export action is loading. */\n exportLoading?: boolean;\n /** Props for the Actions component. */\n actionProps?: Partial<ActionsProps>;\n /** Props for the FilterWrapper component. */\n filterWrapperProps?: Partial<FilterWrapperProps>;\n /** Props for the ExportData component. */\n exportOptionsProps?: Partial<ExportDataProps>;\n searchProps?: Partial<SearchProps>;\n paginationProps?: Partial<MyPaginationProps>;\n /** Props for the columns visibility dropdown. */\n columnsVisibilityProps?: DropdownContainerProps & {\n title?: ReactNode;\n resetText?: ReactNode;\n };\n}\n\n/**\n * DataTable is a composable, high-level table that brings together search, filters,\n * column visibility management, header actions, exporting, and pagination.\n * It renders `MyTable` for rows and, when enabled, shows header controls and a footer with pagination.\n *\n * Generic Types\n * - `TData` — Row data shape (type of each item in the rows array).\n * - `TPaginationData` — Pagination wrapper type containing rows and pagination meta; defaults to\n * `PaginationInterface<TData>`.\n *\n * Key Behaviors\n * - Emits `onParamChange` when search text, filters, page, limit, or sort order change.\n * - Persists column visibility per `tableKey` via `useColumns` and informs parent with `onColumnsUpdate`.\n * - Renders header controls only when the related feature is enabled/has content.\n *\n * Accessibility\n * - Header controls and dropdowns reuse shared primitives that include keyboard and ARIA support.\n *\n * Internationalization\n * - Text such as \"Export\", \"Customize columns\", and \"Reset columns\" are resolved via `react-i18next`.\n *\n * Usage Examples\n * 1) Minimal paginated table (uses default `dataKey = \"docs\"`)\n * ```tsx\n * type User = { id: string; name: string };\n * const data = { docs: [{ id: '1', name: 'Ada' }], page: 1, limit: 10, totalPages: 1 };\n *\n * <DataTable<User>\n * tableKey=\"users-table\"\n * columns={[{ key: 'name', name: 'Name' }]}\n * rowKey=\"id\"\n * dataSource={data}\n * hasPagination\n * />\n * ```\n *\n * 2) Custom `dataKey` and column visibility persistence\n * ```tsx\n * type Row = { id: number; title: string };\n * const payload = { items: [{ id: 1, title: 'Hello' }], page: 1, limit: 20, totalPages: 1 };\n *\n * <DataTable<Row>\n * tableKey=\"posts\"\n * columns={[{ key: 'title', name: 'Title' }]}\n * rowKey=\"id\"\n * dataSource={payload}\n * dataKey=\"items\"\n * hasColumnsVisibilityDropdown\n * />\n * ```\n *\n * 3) Responding to user interactions via `onParamChange`\n * ```tsx\n * const [params, setParams] = useState({ page: 1, limit: 10 });\n *\n * <DataTable\n * tableKey=\"logs\"\n * columns={[{ key: 'message', name: 'Message' }]}\n * rowKey=\"id\"\n * params={params}\n * onParamChange={setParams}\n * hasSearch\n * hasPagination\n * />\n * ```\n *\n * Notes and Best Practices\n * - Ensure `rowKey` points to a stable unique field in `TData` to avoid key collisions.\n * - When arrays like `exportOptions`, `filters`, or `actions` are empty, their sections are not rendered.\n * - Sorting emits `{ sortField, sortOrder }` through `onParamChange` when the user toggles a column sort.\n *\n * @template TData - Row data type.\n * @template TPaginationData - Pagination wrapper type.\n * @param dataSource - Paginated data source object.\n * @param columns - Column definitions.\n * @param rowKey - Property name used as a unique row key.\n * @param hasSearch - Whether to display the search input.\n * @param exportOptions - Export menu options.\n * @param hasPagination - Whether to render the pagination footer.\n * @param onParamChange - Emits parameter changes for pagination/sorting/search/filters.\n * @param dataKey - Key within `dataSource` that contains the row array.\n * @param loading - Whether the table data is loading.\n * @param tableKey - Unique key for persisting column visibility state.\n * @param filters - Filter configurations to render.\n * @param actions - Header actions.\n * @param handleFilterChange - Callback executed when filter values change.\n * @param params - Current list parameters.\n * @param exportLoading - Whether the export action is loading.\n * @param onColumnsUpdate - Notifies parent whenever columns state changes.\n * @param hasColumnsVisibilityDropdown - Whether to show columns customize dropdown.\n * @param showAppliedFilters - Whether to show applied filters.\n * @param onSelectedItemsChange - Callback when selected rows change.\n * @param actionProps - Props for the Actions component.\n * @param filterWrapperProps - Props for the FilterWrapper component.\n * @param exportOptionsProps - Props for the ExportData component.\n * @param columnsVisibilityProps - Props for columns visibility dropdown.\n * @param paginationProps - Props for the MyPagination component.\n * @param searchProps - Props for the Search component.\n * @param className - Additional CSS classes.\n * @param props - Additional props passed to MyTable.\n * @returns {JSX.Element} React element that renders a complete data table experience.\n */\nexport const DataTable = <\n TData,\n TPaginationData extends PaginationInterface<TData> =\n PaginationInterface<TData>,\n>({\n dataSource,\n columns,\n rowKey,\n hasSearch,\n exportOptions,\n hasPagination,\n onParamChange,\n dataKey = 'docs',\n loading,\n tableKey,\n filters,\n actions,\n handleFilterChange,\n params,\n exportLoading = false,\n onColumnsUpdate,\n hasColumnsVisibilityDropdown,\n showAppliedFilters = false,\n actionProps,\n filterWrapperProps,\n exportOptionsProps,\n columnsVisibilityProps,\n paginationProps,\n searchProps,\n className,\n ...props\n}: DataTableProps<TData, TPaginationData>) => {\n const { t } = useTranslation();\n const { formattedColumns, handleColumnsChange, resetColumns } =\n useColumns<TData>({ key: tableKey, columns });\n\n useEffect(() => {\n onColumnsUpdate?.(formattedColumns);\n }, [formattedColumns, onColumnsUpdate]);\n\n return (\n <div\n className={cn(\n 'border-border-alpha-light relative flex grow flex-col overflow-auto rounded-xl border shadow-xs',\n className\n )}\n >\n <div className={'flex shrink-0 flex-col gap-4 p-4'}>\n {(hasSearch ||\n (hasColumnsVisibilityDropdown && tableKey) ||\n !isEmpty(exportOptions) ||\n !isEmpty(filters)) && (\n <div className=\"flex flex-col justify-between gap-3 lg:flex-row lg:items-center\">\n <div className={'grow'}>\n {hasSearch && (\n <Search\n {...searchProps}\n inputProps={{\n ...searchProps?.inputProps,\n className: cn(\n 'h-8 grow',\n searchProps?.inputProps?.className\n ),\n }}\n className={cn(\n 'max-w-full lg:max-w-80! [&_button]:-top-1',\n searchProps?.className\n )}\n defaultValue={get(params, 'search', '') as string}\n onSearchChange={(search) =>\n onParamChange?.({ ...params, search, page: 1 })\n }\n />\n )}\n </div>\n <div className={'flex items-center justify-end gap-3'}>\n {exportOptions && (\n <ExportData\n {...exportOptionsProps}\n options={exportOptions}\n loading={exportLoading}\n />\n )}\n {hasColumnsVisibilityDropdown && tableKey && (\n <DropdownMenu modal={false}>\n <DropdownMenuTrigger\n asChild\n className={'grow'}\n {...columnsVisibilityProps?.triggerProps}\n >\n <Button\n variant=\"secondary\"\n size={'sm'}\n className={'ml-auto rounded-lg px-3'}\n >\n {columnsVisibilityProps?.title || (\n <>\n <RiLayoutColumnLine />{' '}\n <span className={'hidden md:inline!'}>\n {t('Customize columns')}\n </span>\n <RiArrowDownSLine />\n </>\n )}\n </Button>\n </DropdownMenuTrigger>\n <DropdownMenuContent\n align=\"end\"\n {...columnsVisibilityProps?.contentProps}\n >\n <DropdownMenuItem\n data-testid={'reset-columns-button'}\n onSelect={(e) => e.preventDefault()}\n className=\"capitalize\"\n onClick={resetColumns}\n >\n <RefreshCw />{' '}\n {columnsVisibilityProps?.resetText || t('Reset columns')}\n </DropdownMenuItem>\n <DropdownMenuSeparator />\n {formattedColumns.map((column) => {\n return (\n <DropdownMenuCheckboxItem\n key={column.key}\n data-testid={column.key}\n onSelect={(e) => e.preventDefault()}\n className=\"capitalize\"\n checked={!column.hidden}\n onCheckedChange={(value) =>\n handleColumnsChange(column, !value)\n }\n >\n {column.name}\n </DropdownMenuCheckboxItem>\n );\n })}\n </DropdownMenuContent>\n </DropdownMenu>\n )}\n {actions && <Actions {...actionProps} actions={actions} />}\n {filters && (\n <FilterWrapper\n {...filterWrapperProps}\n filters={filters}\n params={params}\n onChange={handleFilterChange}\n onFilter={(filter) => {\n onParamChange?.({ ...filter, page: 1 });\n handleFilterChange?.(filter);\n }}\n />\n )}\n </div>\n </div>\n )}\n {showAppliedFilters && !isEmpty(filters) && (\n <AppliedFilters\n filters={filters}\n params={params}\n onFilter={(filter) => {\n onParamChange?.({ ...filter, page: 1 });\n handleFilterChange?.(filter);\n }}\n />\n )}\n </div>\n\n <div className={cn('flex grow flex-col overflow-auto border-y')}>\n {!loading ? (\n <MyTable<TData>\n {...props}\n params={{\n page: dataSource?.page || 1,\n limit: dataSource?.limit,\n ...params,\n }}\n rows={get(dataSource, dataKey, []) as TData[]}\n rowKey={rowKey}\n columns={formattedColumns}\n onSortOrderChange={({ sortField, sortOrder }) => {\n onParamChange?.({ ...params, sortField, sortOrder });\n }}\n />\n ) : (\n <Loader />\n )}\n </div>\n {hasPagination && (\n <div className=\"flex shrink-0 flex-wrap items-center justify-center gap-3 p-4 lg:justify-between\">\n <div className=\"text-sm\">\n <MyLimitSelect\n onLimitChange={(limit) =>\n onParamChange?.({ ...params, limit, page: 1 })\n }\n defaultValue={dataSource?.limit}\n />\n </div>\n <div className=\"text-muted-foreground text-sm\">\n {t('{{selectedCount}} of {{total}} row(s) selected', {\n selectedCount: props.selectedItems?.length ?? 0,\n total: dataSource?.total || 0,\n })}\n </div>\n <div>\n <MyPagination\n {...paginationProps}\n onPageChange={(page) => onParamChange?.({ ...params, page })}\n currentPage={dataSource?.page}\n totalPages={dataSource?.totalPages}\n />\n </div>\n </div>\n )}\n </div>\n );\n};\n"],"names":["AppliedFilters","memo","filters","params","onFilter","className","props","t","useTranslation","filterObject","useMemo","filter","_a","label","value","paramsArr","key","isEmpty","jsx","cn","ButtonGroup","val","index","jsxs","Button","v","XIcon","paramValues","MyTable","rows","columns","onRowClick","rowKey","DEFAULT_LIMIT","hasNumbers","hasCheckbox","selectedItems","onSelectedItemsChange","onSortOrderChange","isStickyHeader","sortObject","handleSort","useSortable","selectedRows","isRowSelected","isAllRowsSelected","handleSelectAllRows","handleSelectRow","useDataTable","useEffect","Table","TableHeader","TableRow","TableHead","Checkbox","column","Fragment","SortOrder","ArrowDownWideNarrow","ArrowUpWideNarrow","ArrowUpDown","TableBody","row","TableCell","evt","get","Empty","DataTable","dataSource","hasSearch","exportOptions","hasPagination","onParamChange","dataKey","loading","tableKey","actions","handleFilterChange","exportLoading","onColumnsUpdate","hasColumnsVisibilityDropdown","showAppliedFilters","actionProps","filterWrapperProps","exportOptionsProps","columnsVisibilityProps","paginationProps","searchProps","formattedColumns","handleColumnsChange","resetColumns","useColumns","Search","search","ExportData","DropdownMenu","DropdownMenuTrigger","RiLayoutColumnLine","RiArrowDownSLine","DropdownMenuContent","DropdownMenuItem","e","RefreshCw","DropdownMenuSeparator","DropdownMenuCheckboxItem","Actions","FilterWrapper","Loader","sortField","sortOrder","MyLimitSelect","limit","_b","MyPagination","page"],"mappings":"m1BA+BaA,GAAiBC,EAAAA,KAAK,SAAuB,CACxD,QAAAC,EACA,OAAAC,EACA,SAAAC,EACA,UAAAC,EACA,GAAGC,CACL,EAAwB,CACtB,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MAAA,CAAI,UAAU,UACb,SAAAA,EAAAA,IAAC4F,EAAAA,cAAA,CACC,cAAgBC,GACdvC,GAAA,YAAAA,EAAgB,CAAE,GAAGrE,EAAQ,MAAA4G,EAAO,KAAM,IAE5C,aAAc3C,GAAA,YAAAA,EAAY,KAAA,CAAA,EAE9B,EACAlD,EAAAA,IAAC,MAAA,CAAI,UAAU,gCACZ,WAAE,iDAAkD,CACnD,gBAAe8F,EAAA1G,EAAM,gBAAN,YAAA0G,EAAqB,SAAU,EAC9C,OAAO5C,GAAA,YAAAA,EAAY,QAAS,CAAA,CAC7B,EACH,QACC,MAAA,CACC,SAAAlD,EAAAA,IAAC+F,EAAAA,aAAA,CACE,GAAG3B,EACJ,aAAe4B,GAAS1C,GAAA,YAAAA,EAAgB,CAAE,GAAGrE,EAAQ,KAAA+G,IACrD,YAAa9C,GAAA,YAAAA,EAAY,KACzB,WAAYA,GAAA,YAAAA,EAAY,UAAA,CAAA,CAC1B,CACF,CAAA,CAAA,CACF,CAAA,CAAA,CAAA,CAIR"}
|
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
import { jsx as e, jsxs as
|
|
1
|
+
import { jsx as e, jsxs as x, Fragment as O } from "react/jsx-runtime";
|
|
2
2
|
import { y as u, f as C } from "../../chunks/index-E1NtSoNr.es.js";
|
|
3
3
|
import { Button as q } from "dgz-ui/button";
|
|
4
4
|
import { DropdownMenu as P, DropdownMenuTrigger as ee, DropdownMenuContent as te, DropdownMenuItem as le, DropdownMenuSeparator as de, DropdownMenuCheckboxItem as se } from "dgz-ui/dropdown";
|
|
5
5
|
import { cn as k } from "dgz-ui/utils";
|
|
6
6
|
import { g as B } from "../../chunks/MyInput-ByJ5vTAN.es.js";
|
|
7
7
|
import { i as I, u as fe, a as re, b as ie } from "../../chunks/useSortable-B1BtakAy.es.js";
|
|
8
|
-
import { XIcon as Z, ArrowDownWideNarrow as ce, ArrowUpWideNarrow as pe, ArrowUpDown as
|
|
9
|
-
import { memo as
|
|
8
|
+
import { XIcon as Z, ArrowDownWideNarrow as ce, ArrowUpWideNarrow as pe, ArrowUpDown as me, RefreshCw as xe } from "lucide-react";
|
|
9
|
+
import { memo as Ne, useMemo as U, useEffect as K } from "react";
|
|
10
10
|
import { useTranslation as F } from "react-i18next";
|
|
11
11
|
import { A as ne } from "../../chunks/Actions-Du8iQ3WR.es.js";
|
|
12
12
|
import { E as we } from "../../chunks/ExportData-CwotVgye.es.js";
|
|
@@ -18,10 +18,10 @@ import { Checkbox as y } from "dgz-ui/form";
|
|
|
18
18
|
import { Table as ke, TableHeader as ze, TableRow as G, TableHead as X, TableBody as Ee, TableCell as W } from "dgz-ui/table";
|
|
19
19
|
import { S as b } from "../../chunks/SortOrder-CwuehjY1.es.js";
|
|
20
20
|
import { E as oe } from "../../chunks/Empty-BReVQKje.es.js";
|
|
21
|
-
const Le =
|
|
21
|
+
const Le = Ne(function({
|
|
22
22
|
filters: g,
|
|
23
23
|
params: D,
|
|
24
|
-
onFilter:
|
|
24
|
+
onFilter: m,
|
|
25
25
|
className: n,
|
|
26
26
|
...z
|
|
27
27
|
}) {
|
|
@@ -52,12 +52,12 @@ const Le = me(function({
|
|
|
52
52
|
return ((d = i == null ? void 0 : i[c]) == null ? void 0 : d[r]) && r;
|
|
53
53
|
}).map((r, d) => {
|
|
54
54
|
var E;
|
|
55
|
-
return /* @__PURE__ */
|
|
55
|
+
return /* @__PURE__ */ x(
|
|
56
56
|
q,
|
|
57
57
|
{
|
|
58
58
|
size: "sm",
|
|
59
59
|
onClick: () => {
|
|
60
|
-
|
|
60
|
+
m == null || m({
|
|
61
61
|
...D,
|
|
62
62
|
[c]: p.filter((A) => A !== r)
|
|
63
63
|
});
|
|
@@ -70,13 +70,13 @@ const Le = me(function({
|
|
|
70
70
|
},
|
|
71
71
|
d
|
|
72
72
|
);
|
|
73
|
-
}) }, c) : /* @__PURE__ */
|
|
73
|
+
}) }, c) : /* @__PURE__ */ x(
|
|
74
74
|
q,
|
|
75
75
|
{
|
|
76
76
|
size: "sm",
|
|
77
77
|
onClick: () => {
|
|
78
78
|
const r = { ...D };
|
|
79
|
-
delete r[c],
|
|
79
|
+
delete r[c], m == null || m(r);
|
|
80
80
|
},
|
|
81
81
|
children: [
|
|
82
82
|
t(String(((M = i == null ? void 0 : i[c]) == null ? void 0 : M[p]) || "")),
|
|
@@ -91,7 +91,7 @@ const Le = me(function({
|
|
|
91
91
|
rows: l = [],
|
|
92
92
|
columns: g,
|
|
93
93
|
onRowClick: D,
|
|
94
|
-
rowKey:
|
|
94
|
+
rowKey: m,
|
|
95
95
|
params: n = {
|
|
96
96
|
page: 1,
|
|
97
97
|
limit: j
|
|
@@ -118,18 +118,18 @@ const Le = me(function({
|
|
|
118
118
|
} = re({ rows: l, defaultSelectedRows: i });
|
|
119
119
|
return K(() => {
|
|
120
120
|
T == null || T(A);
|
|
121
|
-
}, [A, T]), /* @__PURE__ */
|
|
121
|
+
}, [A, T]), /* @__PURE__ */ x(ke, { ...r, children: [
|
|
122
122
|
/* @__PURE__ */ e(
|
|
123
123
|
ze,
|
|
124
124
|
{
|
|
125
125
|
className: k("bg-bg", p && "sticky top-0 z-1"),
|
|
126
|
-
children: /* @__PURE__ */
|
|
126
|
+
children: /* @__PURE__ */ x(G, { children: [
|
|
127
127
|
t && /* @__PURE__ */ e(X, { className: "w-12 p-3", children: /* @__PURE__ */ e(
|
|
128
128
|
y,
|
|
129
129
|
{
|
|
130
130
|
className: "mt-1",
|
|
131
|
-
checked: $(
|
|
132
|
-
onCheckedChange: (s) => h(
|
|
131
|
+
checked: $(m),
|
|
132
|
+
onCheckedChange: (s) => h(m, !!s),
|
|
133
133
|
"aria-label": "Select all"
|
|
134
134
|
}
|
|
135
135
|
) }),
|
|
@@ -140,13 +140,13 @@ const Le = me(function({
|
|
|
140
140
|
style: s.styles,
|
|
141
141
|
className: k("p-2", s.sortable && "cursor-pointer"),
|
|
142
142
|
onClick: () => s.sortable && E(s.dataIndex),
|
|
143
|
-
children: /* @__PURE__ */
|
|
143
|
+
children: /* @__PURE__ */ x("div", { className: "flex items-center gap-2", children: [
|
|
144
144
|
s.name,
|
|
145
145
|
" ",
|
|
146
|
-
s.sortable && ((d == null ? void 0 : d.sortField) === s.key ? /* @__PURE__ */
|
|
146
|
+
s.sortable && ((d == null ? void 0 : d.sortField) === s.key ? /* @__PURE__ */ x(O, { children: [
|
|
147
147
|
(d == null ? void 0 : d.sortOrder) === b.DESC && /* @__PURE__ */ e(ce, { size: 15 }),
|
|
148
148
|
(d == null ? void 0 : d.sortOrder) === b.ASC && /* @__PURE__ */ e(pe, { size: 15 })
|
|
149
|
-
] }) : /* @__PURE__ */ e(
|
|
149
|
+
] }) : /* @__PURE__ */ e(me, { size: 15 }))
|
|
150
150
|
] })
|
|
151
151
|
},
|
|
152
152
|
s.key
|
|
@@ -154,12 +154,12 @@ const Le = me(function({
|
|
|
154
154
|
] })
|
|
155
155
|
}
|
|
156
156
|
),
|
|
157
|
-
/* @__PURE__ */ e(Ee, { className: "[&>tr:nth-child(even)]:bg-bg-secondary", children: l.length ? l.map((s,
|
|
157
|
+
/* @__PURE__ */ e(Ee, { className: "[&>tr:nth-child(even)]:bg-bg-secondary", children: l.length ? l.map((s, N) => /* @__PURE__ */ x(
|
|
158
158
|
G,
|
|
159
159
|
{
|
|
160
160
|
onClick: () => D == null ? void 0 : D(s),
|
|
161
161
|
className: k(D && "cursor-pointer"),
|
|
162
|
-
"data-state": o(s[
|
|
162
|
+
"data-state": o(s[m]) && "selected",
|
|
163
163
|
children: [
|
|
164
164
|
t && /* @__PURE__ */ e(
|
|
165
165
|
W,
|
|
@@ -170,14 +170,14 @@ const Le = me(function({
|
|
|
170
170
|
y,
|
|
171
171
|
{
|
|
172
172
|
className: "mt-1",
|
|
173
|
-
checked: o(s[
|
|
174
|
-
onCheckedChange: (w) => H(s[
|
|
173
|
+
checked: o(s[m]),
|
|
174
|
+
onCheckedChange: (w) => H(s[m], !!w),
|
|
175
175
|
"aria-label": "Select row"
|
|
176
176
|
}
|
|
177
177
|
)
|
|
178
178
|
}
|
|
179
179
|
),
|
|
180
|
-
z && /* @__PURE__ */ e(W, { className: "w-12 p-2", children: (n.page - 1) * (n.limit || j) +
|
|
180
|
+
z && /* @__PURE__ */ e(W, { className: "w-12 p-2", children: (n.page - 1) * (n.limit || j) + N + 1 }),
|
|
181
181
|
g.filter((w) => !w.hidden).map((w) => /* @__PURE__ */ e(
|
|
182
182
|
W,
|
|
183
183
|
{
|
|
@@ -185,11 +185,11 @@ const Le = me(function({
|
|
|
185
185
|
style: w.styles,
|
|
186
186
|
children: w.render ? w.render(B(s, w.dataIndex), s) : B(s, w.dataIndex, "")
|
|
187
187
|
},
|
|
188
|
-
`${
|
|
188
|
+
`${N}-${w.key}`
|
|
189
189
|
))
|
|
190
190
|
]
|
|
191
191
|
},
|
|
192
|
-
`${s[
|
|
192
|
+
`${s[m]}`
|
|
193
193
|
)) : /* @__PURE__ */ e(G, { children: /* @__PURE__ */ e(
|
|
194
194
|
W,
|
|
195
195
|
{
|
|
@@ -202,7 +202,7 @@ const Le = me(function({
|
|
|
202
202
|
dataSource: l,
|
|
203
203
|
columns: g,
|
|
204
204
|
rowKey: D,
|
|
205
|
-
hasSearch:
|
|
205
|
+
hasSearch: m,
|
|
206
206
|
exportOptions: n,
|
|
207
207
|
hasPagination: z,
|
|
208
208
|
onParamChange: t,
|
|
@@ -220,27 +220,27 @@ const Le = me(function({
|
|
|
220
220
|
actionProps: h,
|
|
221
221
|
filterWrapperProps: H,
|
|
222
222
|
exportOptionsProps: s,
|
|
223
|
-
columnsVisibilityProps:
|
|
223
|
+
columnsVisibilityProps: N,
|
|
224
224
|
paginationProps: w,
|
|
225
225
|
searchProps: v,
|
|
226
|
-
className:
|
|
226
|
+
className: a,
|
|
227
227
|
...J
|
|
228
228
|
}) => {
|
|
229
229
|
var Q, Y;
|
|
230
|
-
const { t: _ } = F(), { formattedColumns: R, handleColumnsChange:
|
|
230
|
+
const { t: _ } = F(), { formattedColumns: R, handleColumnsChange: S, resetColumns: V } = ie({ key: c, columns: g });
|
|
231
231
|
return K(() => {
|
|
232
232
|
A == null || A(R);
|
|
233
|
-
}, [R, A]), /* @__PURE__ */
|
|
233
|
+
}, [R, A]), /* @__PURE__ */ x(
|
|
234
234
|
"div",
|
|
235
235
|
{
|
|
236
236
|
className: k(
|
|
237
237
|
"border-border-alpha-light relative flex grow flex-col overflow-auto rounded-xl border shadow-xs",
|
|
238
|
-
|
|
238
|
+
a
|
|
239
239
|
),
|
|
240
240
|
children: [
|
|
241
|
-
/* @__PURE__ */
|
|
242
|
-
(
|
|
243
|
-
/* @__PURE__ */ e("div", { className: "grow", children:
|
|
241
|
+
/* @__PURE__ */ x("div", { className: "flex shrink-0 flex-col gap-4 p-4", children: [
|
|
242
|
+
(m || o && c || !I(n) || !I(p)) && /* @__PURE__ */ x("div", { className: "flex flex-col justify-between gap-3 lg:flex-row lg:items-center", children: [
|
|
243
|
+
/* @__PURE__ */ e("div", { className: "grow", children: m && /* @__PURE__ */ e(
|
|
244
244
|
ge,
|
|
245
245
|
{
|
|
246
246
|
...v,
|
|
@@ -259,7 +259,7 @@ const Le = me(function({
|
|
|
259
259
|
onSearchChange: (f) => t == null ? void 0 : t({ ...d, search: f, page: 1 })
|
|
260
260
|
}
|
|
261
261
|
) }),
|
|
262
|
-
/* @__PURE__ */
|
|
262
|
+
/* @__PURE__ */ x("div", { className: "flex items-center justify-end gap-3", children: [
|
|
263
263
|
n && /* @__PURE__ */ e(
|
|
264
264
|
we,
|
|
265
265
|
{
|
|
@@ -268,20 +268,20 @@ const Le = me(function({
|
|
|
268
268
|
loading: E
|
|
269
269
|
}
|
|
270
270
|
),
|
|
271
|
-
o && c && /* @__PURE__ */
|
|
271
|
+
o && c && /* @__PURE__ */ x(P, { modal: !1, children: [
|
|
272
272
|
/* @__PURE__ */ e(
|
|
273
273
|
ee,
|
|
274
274
|
{
|
|
275
275
|
asChild: !0,
|
|
276
276
|
className: "grow",
|
|
277
|
-
...
|
|
277
|
+
...N == null ? void 0 : N.triggerProps,
|
|
278
278
|
children: /* @__PURE__ */ e(
|
|
279
279
|
q,
|
|
280
280
|
{
|
|
281
281
|
variant: "secondary",
|
|
282
282
|
size: "sm",
|
|
283
283
|
className: "ml-auto rounded-lg px-3",
|
|
284
|
-
children: (
|
|
284
|
+
children: (N == null ? void 0 : N.title) || /* @__PURE__ */ x(O, { children: [
|
|
285
285
|
/* @__PURE__ */ e(u, {}),
|
|
286
286
|
" ",
|
|
287
287
|
/* @__PURE__ */ e("span", { className: "hidden md:inline!", children: _("Customize columns") }),
|
|
@@ -291,22 +291,23 @@ const Le = me(function({
|
|
|
291
291
|
)
|
|
292
292
|
}
|
|
293
293
|
),
|
|
294
|
-
/* @__PURE__ */
|
|
294
|
+
/* @__PURE__ */ x(
|
|
295
295
|
te,
|
|
296
296
|
{
|
|
297
297
|
align: "end",
|
|
298
|
-
...
|
|
298
|
+
...N == null ? void 0 : N.contentProps,
|
|
299
299
|
children: [
|
|
300
|
-
/* @__PURE__ */
|
|
300
|
+
/* @__PURE__ */ x(
|
|
301
301
|
le,
|
|
302
302
|
{
|
|
303
|
+
"data-testid": "reset-columns-button",
|
|
303
304
|
onSelect: (f) => f.preventDefault(),
|
|
304
305
|
className: "capitalize",
|
|
305
306
|
onClick: V,
|
|
306
307
|
children: [
|
|
307
|
-
/* @__PURE__ */ e(
|
|
308
|
+
/* @__PURE__ */ e(xe, {}),
|
|
308
309
|
" ",
|
|
309
|
-
(
|
|
310
|
+
(N == null ? void 0 : N.resetText) || _("Reset columns")
|
|
310
311
|
]
|
|
311
312
|
}
|
|
312
313
|
),
|
|
@@ -318,7 +319,7 @@ const Le = me(function({
|
|
|
318
319
|
onSelect: (L) => L.preventDefault(),
|
|
319
320
|
className: "capitalize",
|
|
320
321
|
checked: !f.hidden,
|
|
321
|
-
onCheckedChange: (L) =>
|
|
322
|
+
onCheckedChange: (L) => S(f, !L),
|
|
322
323
|
children: f.name
|
|
323
324
|
},
|
|
324
325
|
f.key
|
|
@@ -370,7 +371,7 @@ const Le = me(function({
|
|
|
370
371
|
}
|
|
371
372
|
}
|
|
372
373
|
) }),
|
|
373
|
-
z && /* @__PURE__ */
|
|
374
|
+
z && /* @__PURE__ */ x("div", { className: "flex shrink-0 flex-wrap items-center justify-center gap-3 p-4 lg:justify-between", children: [
|
|
374
375
|
/* @__PURE__ */ e("div", { className: "text-sm", children: /* @__PURE__ */ e(
|
|
375
376
|
Ae,
|
|
376
377
|
{
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.es.js","sources":["../../../src/components/filters/AppliedFilters.tsx","../../../src/components/datatable/MyTable.tsx","../../../src/components/datatable/DataTable.tsx"],"sourcesContent":["import { ButtonGroup } from 'dgz-ui';\nimport { Button } from 'dgz-ui/button';\nimport type { CardProps } from 'dgz-ui/card';\nimport { cn } from 'dgz-ui/utils';\nimport isEmpty from 'lodash.isempty';\nimport { XIcon } from 'lucide-react';\nimport { memo, useMemo } from 'react';\nimport { useTranslation } from 'react-i18next';\nimport type { FilterInterface } from './FilterWrapper.tsx';\n\n/**\n * Props for the AppliedFilters component.\n */\nexport interface AppliedFiltersProps extends CardProps {\n /** Array of filter definitions to render. */\n filters?: FilterInterface[];\n /** Current active parameters/filters. */\n params?: Record<string, unknown>;\n /** Callback fired when filters are applied. */\n onFilter?: (filters: Record<string, unknown>) => void;\n}\n\n/**\n * AppliedFilters displays active filter values as removable buttons/tags.\n *\n * @param props.filters - Array of filter definitions to map values to labels.\n * @param props.params - Current active filter parameters.\n * @param props.onFilter - Callback fired when a filter is removed.\n * @param props.className - Additional CSS classes.\n * @returns {JSX.Element | false} A list of active filter buttons or false if no filters are active\n */\nexport const AppliedFilters = memo(function FilterWrapper({\n filters,\n params,\n onFilter,\n className,\n ...props\n}: AppliedFiltersProps) {\n const { t } = useTranslation();\n\n const filterObject = useMemo(\n () =>\n Object.fromEntries(\n filters?.map((filter) => [\n filter.name,\n Object.fromEntries(\n filter.options?.map(({ label, value }) => [value, label]) || []\n ),\n ]) || []\n ),\n [filters]\n );\n\n const paramsArr = useMemo(\n () =>\n Object.entries(params || {}).filter(\n ([key, value]) => !!filterObject?.[key] && !isEmpty(value)\n ),\n [filterObject, params]\n );\n\n return (\n !isEmpty(paramsArr) && (\n <div {...props} className={cn('flex flex-wrap gap-2', className)}>\n {paramsArr.map(([key, value]) =>\n Array.isArray(value) ? (\n <ButtonGroup key={key}>\n {value\n .filter((val) => filterObject?.[key]?.[val] && val)\n .map((val, index) => (\n <Button\n size={'sm'}\n key={index}\n onClick={() => {\n onFilter?.({\n ...params,\n [key]: value.filter((v) => v !== val),\n });\n }}\n >\n {t(String(filterObject?.[key]?.[val] || ''))} <XIcon />\n </Button>\n ))}\n </ButtonGroup>\n ) : (\n <Button\n size={'sm'}\n onClick={() => {\n const paramValues = { ...params };\n\n delete paramValues[key];\n onFilter?.(paramValues);\n }}\n >\n {t(String(filterObject?.[key]?.[value as string] || ''))}{' '}\n <XIcon />\n </Button>\n )\n )}\n </div>\n )\n );\n});\n","import { Checkbox } from 'dgz-ui/form';\nimport {\n Table,\n TableBody,\n TableCell,\n TableHead,\n TableHeader,\n TableRow,\n} from 'dgz-ui/table';\nimport { cn } from 'dgz-ui/utils';\nimport get from 'lodash.get';\nimport {\n ArrowDownWideNarrow,\n ArrowUpDown,\n ArrowUpWideNarrow,\n} from 'lucide-react';\nimport { type ComponentProps, useEffect } from 'react';\nimport { SortOrder } from '../../enums';\nimport { useDataTable, useSortable, type UseSortableProps } from '../../hooks';\nimport type { ColumnType } from '../../types';\nimport { Empty } from '../empty';\nimport { DEFAULT_LIMIT } from '../pagination/MyLimitSelect';\n\n/**\n * Props for the MyTable component.\n * @template TData - The type of data in the table.\n */\nexport interface MyTableProps<TData> extends ComponentProps<'table'> {\n /** Array of data rows to display. */\n rows?: TData[];\n /** Column definitions. */\n columns: ColumnType<TData>[];\n /** Callback when a row is clicked. */\n onRowClick?: (row: TData) => void;\n /** Whether to show row numbers. */\n hasNumbers?: boolean;\n /** Whether to show selection checkboxes. */\n hasCheckbox?: boolean;\n /** Unique key for each row. */\n rowKey: keyof TData;\n /** Current table parameters (page, limit, sort). */\n params?: Record<string, unknown>;\n /** Total number of items (optional, often used with pagination context). */\n total?: number;\n /** Array of currently selected item keys. */\n selectedItems?: TData[keyof TData][];\n /** Callback when selected items change. */\n onSelectedItemsChange?: (selectedItems?: TData[keyof TData][]) => void;\n /** Callback when sort order changes. */\n onSortOrderChange?: (\n params: Omit<UseSortableProps<TData>, 'onSortOrderChange'>\n ) => void;\n /** Whether the header should stick to the top. */\n isStickyHeader?: true;\n}\n\n/**\n * MyTable renders a generic data table with optional numbering, selection checkboxes,\n * sortable columns and sticky header. It is a presentational component and delegates\n * sorting/selection state via hooks and callbacks.\n *\n * @template TData - The row data type.\n * @param rows - Array of data rows.\n * @param columns - Column definitions.\n * @param onRowClick - Callback when a row is clicked.\n * @param rowKey - Unique key for each row.\n * @param params - Current table parameters.\n * @param hasNumbers - Whether to show row numbers.\n * @param hasCheckbox - Whether to show selection checkboxes.\n * @param selectedItems - Array of currently selected item keys.\n * @param onSelectedItemsChange - Callback when selected items change.\n * @param onSortOrderChange - Callback when sort order changes.\n * @param isStickyHeader - Whether the header should stick to the top.\n * @param className - Additional CSS classes.\n * @param props - Component props.\n * @returns {JSX.Element} React element containing the table.\n */\nexport const MyTable = <TData,>({\n rows = [],\n columns,\n onRowClick,\n rowKey,\n params = {\n page: 1,\n limit: DEFAULT_LIMIT,\n },\n hasNumbers = false,\n hasCheckbox = false,\n selectedItems,\n onSelectedItemsChange,\n onSortOrderChange,\n isStickyHeader,\n className,\n ...props\n}: MyTableProps<TData>) => {\n const { sortObject, handleSort } = useSortable<TData>({\n sortField: params?.sortField as keyof TData | undefined,\n sortOrder: params?.sortOrder as SortOrder | undefined,\n onSortOrderChange,\n });\n const {\n selectedRows,\n isRowSelected,\n isAllRowsSelected,\n handleSelectAllRows,\n handleSelectRow,\n } = useDataTable<TData>({ rows, defaultSelectedRows: selectedItems });\n\n useEffect(() => {\n onSelectedItemsChange?.(selectedRows);\n }, [selectedRows, onSelectedItemsChange]);\n\n return (\n <Table {...props}>\n <TableHeader\n className={cn('bg-bg', isStickyHeader && 'sticky top-0 z-1')}\n >\n <TableRow>\n {hasCheckbox && (\n <TableHead className={'w-12 p-3'}>\n <Checkbox\n className={'mt-1'}\n checked={isAllRowsSelected(rowKey)}\n onCheckedChange={(value) =>\n handleSelectAllRows(rowKey, !!value)\n }\n aria-label=\"Select all\"\n />\n </TableHead>\n )}\n {hasNumbers && <TableHead className={'w-12 p-2'}>#</TableHead>}\n {columns\n .filter((column) => !column.hidden)\n .map((column) => (\n <TableHead\n key={column.key}\n style={column.styles}\n className={cn('p-2', column.sortable && 'cursor-pointer')}\n onClick={() => column.sortable && handleSort(column.dataIndex)}\n >\n <div className={'flex items-center gap-2'}>\n {column.name}{' '}\n {column.sortable &&\n (sortObject?.sortField === column.key ? (\n <>\n {sortObject?.sortOrder === SortOrder.DESC && (\n <ArrowDownWideNarrow size={15} />\n )}\n {sortObject?.sortOrder === SortOrder.ASC && (\n <ArrowUpWideNarrow size={15} />\n )}\n </>\n ) : (\n <ArrowUpDown size={15} />\n ))}\n </div>\n </TableHead>\n ))}\n </TableRow>\n </TableHeader>\n <TableBody className={'[&>tr:nth-child(even)]:bg-bg-secondary'}>\n {rows.length ? (\n rows.map((row, index) => (\n <TableRow\n key={`${row[rowKey]}`}\n onClick={() => onRowClick?.(row)}\n className={cn(onRowClick && 'cursor-pointer')}\n data-state={isRowSelected(row[rowKey]) && 'selected'}\n >\n {hasCheckbox && (\n <TableCell\n className={'w-12 p-3'}\n onClick={(evt) => evt.stopPropagation()}\n >\n <Checkbox\n className={'mt-1'}\n checked={isRowSelected(row[rowKey])}\n onCheckedChange={(value) =>\n handleSelectRow(row[rowKey], !!value)\n }\n aria-label=\"Select row\"\n />\n </TableCell>\n )}\n {hasNumbers && (\n <TableCell className={'w-12 p-2'}>\n {((params.page as number) - 1) *\n ((params.limit || DEFAULT_LIMIT) as number) +\n index +\n 1}\n </TableCell>\n )}\n {columns\n .filter((column) => !column.hidden)\n .map((column) => (\n <TableCell\n className={'text-body-xs-medium max-w-xs p-2'}\n style={column.styles}\n key={`${index}-${column.key}`}\n >\n {column.render\n ? column.render(get(row, column.dataIndex), row)\n : get(row, column.dataIndex, '')}\n </TableCell>\n ))}\n </TableRow>\n ))\n ) : (\n <TableRow>\n <TableCell\n colSpan={\n hasNumbers\n ? hasCheckbox\n ? columns.length + 2\n : columns.length + 1\n : columns.length\n }\n >\n <Empty />\n </TableCell>\n </TableRow>\n )}\n </TableBody>\n </Table>\n );\n};\n","import { RiArrowDownSLine, RiLayoutColumnLine } from '@remixicon/react';\nimport { Button } from 'dgz-ui/button';\nimport {\n type DropdownContainerProps,\n DropdownMenu,\n DropdownMenuCheckboxItem,\n DropdownMenuContent,\n DropdownMenuItem,\n DropdownMenuSeparator,\n DropdownMenuTrigger,\n} from 'dgz-ui/dropdown';\nimport { cn } from 'dgz-ui/utils';\nimport get from 'lodash.get';\nimport isEmpty from 'lodash.isempty';\nimport { RefreshCw } from 'lucide-react';\nimport { type ReactNode, useEffect } from 'react';\nimport { useTranslation } from 'react-i18next';\nimport { useColumns } from '../../hooks';\nimport type { ColumnType } from '../../types';\nimport { type ActionInterface, Actions, type ActionsProps } from '../actions';\nimport {\n ExportData,\n type ExportDataInterface,\n type ExportDataProps,\n} from '../export';\nimport {\n type FilterInterface,\n FilterWrapper,\n type FilterWrapperProps,\n Search,\n type SearchProps,\n} from '../filters';\nimport { AppliedFilters } from '../filters/AppliedFilters.tsx';\nimport { Loader } from '../loader';\nimport { MyLimitSelect, MyPagination } from '../pagination';\nimport type { MyPaginationProps } from '../pagination/MyPagination.tsx';\nimport { MyTable, type MyTableProps } from './MyTable';\n\n/**\n * Minimal pagination wrapper contract used by `DataTable`.\n *\n * Notes\n * - Only `page`, `limit`, and `totalPages` are required. Other fields are optional and\n * may be provided by your API for convenience.\n * - The actual rows array can be stored in any key, controlled via `dataKey` prop\n * (defaults to `\"docs\"`).\n */\nexport interface PaginationInterface<TData> {\n /** Array of rows for the current page. Used when `dataKey` is set to `\"docs\"`. */\n docs?: TData[];\n /** Zero-based index of the first item on the current page (if provided by API). */\n offset?: number;\n /** Page size (items per page). */\n limit: number;\n /** Total number of pages available. */\n totalPages: number;\n /** Total number of items across all pages (if available). */\n total?: number;\n /** Current page number (1-based). */\n page: number;\n /** Convenience counter for the first item index on the page (if provided). */\n pagingCounter?: number;\n /** Whether a previous page exists. */\n hasPrevPage?: boolean;\n /** Whether a next page exists. */\n hasNextPage?: boolean;\n /** Previous page number, if available. */\n prevPage?: number;\n /** Next page number, if available. */\n nextPage?: number;\n}\n\n/**\n * Props for the DataTable component.\n *\n * @template TData - Row data type.\n * @template TPaginationData - Pagination wrapper type.\n */\nexport interface DataTableProps<\n TData,\n TPaginationData extends PaginationInterface<TData>,\n> extends Omit<MyTableProps<TData>, 'rows'> {\n /** Pagination data source. */\n dataSource?: TPaginationData;\n /** Callback for parameter changes (pagination, sorting, filtering). */\n onParamChange?: (param: Record<string, unknown>) => void;\n /** Whether to enable pagination. */\n hasPagination?: true;\n /** Options for the export data dropdown. */\n exportOptions?: ExportDataInterface[];\n /** Whether to enable search functionality. */\n hasSearch?: true;\n /** Whether the table data is loading. */\n loading?: boolean;\n /** Array of filters to display. */\n filters?: FilterInterface[];\n /** Array of actions to display. */\n actions?: ActionInterface[];\n /** Callback for filter changes. */\n handleFilterChange?: (filters: Record<string, unknown>) => void;\n /** Unique key for the table, used for column persistence. */\n tableKey: string;\n /** The key in dataSource where the data array is located. Defaults to \"docs\". */\n dataKey?: keyof TPaginationData;\n /** Whether to show the columns visibility dropdown. */\n hasColumnsVisibilityDropdown?: true;\n /** Whether to show the columns visibility dropdown. */\n showAppliedFilters?: boolean;\n /** Callback when columns are updated (e.g., visibility toggled). */\n onColumnsUpdate?: (columns: ColumnType<TData>[]) => void;\n /** Whether the export action is loading. */\n exportLoading?: boolean;\n /** Props for the Actions component. */\n actionProps?: Partial<ActionsProps>;\n /** Props for the FilterWrapper component. */\n filterWrapperProps?: Partial<FilterWrapperProps>;\n /** Props for the ExportData component. */\n exportOptionsProps?: Partial<ExportDataProps>;\n searchProps?: Partial<SearchProps>;\n paginationProps?: Partial<MyPaginationProps>;\n /** Props for the columns visibility dropdown. */\n columnsVisibilityProps?: DropdownContainerProps & {\n title?: ReactNode;\n resetText?: ReactNode;\n };\n}\n\n/**\n * DataTable is a composable, high-level table that brings together search, filters,\n * column visibility management, header actions, exporting, and pagination.\n * It renders `MyTable` for rows and, when enabled, shows header controls and a footer with pagination.\n *\n * Generic Types\n * - `TData` — Row data shape (type of each item in the rows array).\n * - `TPaginationData` — Pagination wrapper type containing rows and pagination meta; defaults to\n * `PaginationInterface<TData>`.\n *\n * Key Behaviors\n * - Emits `onParamChange` when search text, filters, page, limit, or sort order change.\n * - Persists column visibility per `tableKey` via `useColumns` and informs parent with `onColumnsUpdate`.\n * - Renders header controls only when the related feature is enabled/has content.\n *\n * Accessibility\n * - Header controls and dropdowns reuse shared primitives that include keyboard and ARIA support.\n *\n * Internationalization\n * - Text such as \"Export\", \"Customize columns\", and \"Reset columns\" are resolved via `react-i18next`.\n *\n * Usage Examples\n * 1) Minimal paginated table (uses default `dataKey = \"docs\"`)\n * ```tsx\n * type User = { id: string; name: string };\n * const data = { docs: [{ id: '1', name: 'Ada' }], page: 1, limit: 10, totalPages: 1 };\n *\n * <DataTable<User>\n * tableKey=\"users-table\"\n * columns={[{ key: 'name', name: 'Name' }]}\n * rowKey=\"id\"\n * dataSource={data}\n * hasPagination\n * />\n * ```\n *\n * 2) Custom `dataKey` and column visibility persistence\n * ```tsx\n * type Row = { id: number; title: string };\n * const payload = { items: [{ id: 1, title: 'Hello' }], page: 1, limit: 20, totalPages: 1 };\n *\n * <DataTable<Row>\n * tableKey=\"posts\"\n * columns={[{ key: 'title', name: 'Title' }]}\n * rowKey=\"id\"\n * dataSource={payload}\n * dataKey=\"items\"\n * hasColumnsVisibilityDropdown\n * />\n * ```\n *\n * 3) Responding to user interactions via `onParamChange`\n * ```tsx\n * const [params, setParams] = useState({ page: 1, limit: 10 });\n *\n * <DataTable\n * tableKey=\"logs\"\n * columns={[{ key: 'message', name: 'Message' }]}\n * rowKey=\"id\"\n * params={params}\n * onParamChange={setParams}\n * hasSearch\n * hasPagination\n * />\n * ```\n *\n * Notes and Best Practices\n * - Ensure `rowKey` points to a stable unique field in `TData` to avoid key collisions.\n * - When arrays like `exportOptions`, `filters`, or `actions` are empty, their sections are not rendered.\n * - Sorting emits `{ sortField, sortOrder }` through `onParamChange` when the user toggles a column sort.\n *\n * @template TData - Row data type.\n * @template TPaginationData - Pagination wrapper type.\n * @param dataSource - Paginated data source object.\n * @param columns - Column definitions.\n * @param rowKey - Property name used as a unique row key.\n * @param hasSearch - Whether to display the search input.\n * @param exportOptions - Export menu options.\n * @param hasPagination - Whether to render the pagination footer.\n * @param onParamChange - Emits parameter changes for pagination/sorting/search/filters.\n * @param dataKey - Key within `dataSource` that contains the row array.\n * @param loading - Whether the table data is loading.\n * @param tableKey - Unique key for persisting column visibility state.\n * @param filters - Filter configurations to render.\n * @param actions - Header actions.\n * @param handleFilterChange - Callback executed when filter values change.\n * @param params - Current list parameters.\n * @param exportLoading - Whether the export action is loading.\n * @param onColumnsUpdate - Notifies parent whenever columns state changes.\n * @param hasColumnsVisibilityDropdown - Whether to show columns customize dropdown.\n * @param showAppliedFilters - Whether to show applied filters.\n * @param onSelectedItemsChange - Callback when selected rows change.\n * @param actionProps - Props for the Actions component.\n * @param filterWrapperProps - Props for the FilterWrapper component.\n * @param exportOptionsProps - Props for the ExportData component.\n * @param columnsVisibilityProps - Props for columns visibility dropdown.\n * @param paginationProps - Props for the MyPagination component.\n * @param searchProps - Props for the Search component.\n * @param className - Additional CSS classes.\n * @param props - Additional props passed to MyTable.\n * @returns {JSX.Element} React element that renders a complete data table experience.\n */\nexport const DataTable = <\n TData,\n TPaginationData extends PaginationInterface<TData> =\n PaginationInterface<TData>,\n>({\n dataSource,\n columns,\n rowKey,\n hasSearch,\n exportOptions,\n hasPagination,\n onParamChange,\n dataKey = 'docs',\n loading,\n tableKey,\n filters,\n actions,\n handleFilterChange,\n params,\n exportLoading = false,\n onColumnsUpdate,\n hasColumnsVisibilityDropdown,\n showAppliedFilters = false,\n actionProps,\n filterWrapperProps,\n exportOptionsProps,\n columnsVisibilityProps,\n paginationProps,\n searchProps,\n className,\n ...props\n}: DataTableProps<TData, TPaginationData>) => {\n const { t } = useTranslation();\n const { formattedColumns, handleColumnsChange, resetColumns } =\n useColumns<TData>({ key: tableKey, columns });\n\n useEffect(() => {\n onColumnsUpdate?.(formattedColumns);\n }, [formattedColumns, onColumnsUpdate]);\n\n return (\n <div\n className={cn(\n 'border-border-alpha-light relative flex grow flex-col overflow-auto rounded-xl border shadow-xs',\n className\n )}\n >\n <div className={'flex shrink-0 flex-col gap-4 p-4'}>\n {(hasSearch ||\n (hasColumnsVisibilityDropdown && tableKey) ||\n !isEmpty(exportOptions) ||\n !isEmpty(filters)) && (\n <div className=\"flex flex-col justify-between gap-3 lg:flex-row lg:items-center\">\n <div className={'grow'}>\n {hasSearch && (\n <Search\n {...searchProps}\n inputProps={{\n ...searchProps?.inputProps,\n className: cn(\n 'h-8 grow',\n searchProps?.inputProps?.className\n ),\n }}\n className={cn(\n 'max-w-full lg:max-w-80! [&_button]:-top-1',\n searchProps?.className\n )}\n defaultValue={get(params, 'search', '') as string}\n onSearchChange={(search) =>\n onParamChange?.({ ...params, search, page: 1 })\n }\n />\n )}\n </div>\n <div className={'flex items-center justify-end gap-3'}>\n {exportOptions && (\n <ExportData\n {...exportOptionsProps}\n options={exportOptions}\n loading={exportLoading}\n />\n )}\n {hasColumnsVisibilityDropdown && tableKey && (\n <DropdownMenu modal={false}>\n <DropdownMenuTrigger\n asChild\n className={'grow'}\n {...columnsVisibilityProps?.triggerProps}\n >\n <Button\n variant=\"secondary\"\n size={'sm'}\n className={'ml-auto rounded-lg px-3'}\n >\n {columnsVisibilityProps?.title || (\n <>\n <RiLayoutColumnLine />{' '}\n <span className={'hidden md:inline!'}>\n {t('Customize columns')}\n </span>\n <RiArrowDownSLine />\n </>\n )}\n </Button>\n </DropdownMenuTrigger>\n <DropdownMenuContent\n align=\"end\"\n {...columnsVisibilityProps?.contentProps}\n >\n <DropdownMenuItem\n onSelect={(e) => e.preventDefault()}\n className=\"capitalize\"\n onClick={resetColumns}\n >\n <RefreshCw />{' '}\n {columnsVisibilityProps?.resetText || t('Reset columns')}\n </DropdownMenuItem>\n <DropdownMenuSeparator />\n {formattedColumns.map((column) => {\n return (\n <DropdownMenuCheckboxItem\n key={column.key}\n data-testid={column.key}\n onSelect={(e) => e.preventDefault()}\n className=\"capitalize\"\n checked={!column.hidden}\n onCheckedChange={(value) =>\n handleColumnsChange(column, !value)\n }\n >\n {column.name}\n </DropdownMenuCheckboxItem>\n );\n })}\n </DropdownMenuContent>\n </DropdownMenu>\n )}\n {actions && <Actions {...actionProps} actions={actions} />}\n {filters && (\n <FilterWrapper\n {...filterWrapperProps}\n filters={filters}\n params={params}\n onChange={handleFilterChange}\n onFilter={(filter) => {\n onParamChange?.({ ...filter, page: 1 });\n handleFilterChange?.(filter);\n }}\n />\n )}\n </div>\n </div>\n )}\n {showAppliedFilters && !isEmpty(filters) && (\n <AppliedFilters\n filters={filters}\n params={params}\n onFilter={(filter) => {\n onParamChange?.({ ...filter, page: 1 });\n handleFilterChange?.(filter);\n }}\n />\n )}\n </div>\n\n <div className={cn('flex grow flex-col overflow-auto border-y')}>\n {!loading ? (\n <MyTable<TData>\n {...props}\n params={{\n page: dataSource?.page || 1,\n limit: dataSource?.limit,\n ...params,\n }}\n rows={get(dataSource, dataKey, []) as TData[]}\n rowKey={rowKey}\n columns={formattedColumns}\n onSortOrderChange={({ sortField, sortOrder }) => {\n onParamChange?.({ ...params, sortField, sortOrder });\n }}\n />\n ) : (\n <Loader />\n )}\n </div>\n {hasPagination && (\n <div className=\"flex shrink-0 flex-wrap items-center justify-center gap-3 p-4 lg:justify-between\">\n <div className=\"text-sm\">\n <MyLimitSelect\n onLimitChange={(limit) =>\n onParamChange?.({ ...params, limit, page: 1 })\n }\n defaultValue={dataSource?.limit}\n />\n </div>\n <div className=\"text-muted-foreground text-sm\">\n {t('{{selectedCount}} of {{total}} row(s) selected', {\n selectedCount: props.selectedItems?.length ?? 0,\n total: dataSource?.total || 0,\n })}\n </div>\n <div>\n <MyPagination\n {...paginationProps}\n onPageChange={(page) => onParamChange?.({ ...params, page })}\n currentPage={dataSource?.page}\n totalPages={dataSource?.totalPages}\n />\n </div>\n </div>\n )}\n </div>\n );\n};\n"],"names":["AppliedFilters","memo","filters","params","onFilter","className","props","useTranslation","filterObject","useMemo","filter","_a","label","value","paramsArr","key","isEmpty","jsx","cn","ButtonGroup","val","index","jsxs","Button","v","XIcon","paramValues","MyTable","rows","columns","onRowClick","rowKey","DEFAULT_LIMIT","hasNumbers","hasCheckbox","selectedItems","onSelectedItemsChange","onSortOrderChange","isStickyHeader","sortObject","handleSort","useSortable","selectedRows","isRowSelected","isAllRowsSelected","handleSelectAllRows","handleSelectRow","useDataTable","useEffect","Table","TableHeader","TableRow","TableHead","Checkbox","column","Fragment","SortOrder","ArrowDownWideNarrow","ArrowUpWideNarrow","ArrowUpDown","TableBody","row","TableCell","evt","get","Empty","DataTable","dataSource","hasSearch","exportOptions","hasPagination","onParamChange","dataKey","loading","tableKey","actions","handleFilterChange","exportLoading","onColumnsUpdate","hasColumnsVisibilityDropdown","showAppliedFilters","actionProps","filterWrapperProps","exportOptionsProps","columnsVisibilityProps","paginationProps","searchProps","t","formattedColumns","handleColumnsChange","resetColumns","useColumns","Search","search","ExportData","DropdownMenu","DropdownMenuTrigger","RiLayoutColumnLine","RiArrowDownSLine","DropdownMenuContent","DropdownMenuItem","e","RefreshCw","DropdownMenuSeparator","DropdownMenuCheckboxItem","Actions","FilterWrapper","Loader","sortField","sortOrder","MyLimitSelect","limit","_b","MyPag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,gBAAAA,EAAgB,EAAE,GAAGpE,GAAQ,MAAA+G;cACrD,aAAa/C,KAAA,gBAAAA,EAAY;AAAA,cACzB,YAAYA,KAAA,gBAAAA,EAAY;AAAA,YAAA;AAAA,UAAA,EAC1B,CACF;AAAA,QAAA,EAAA,CACF;AAAA,MAAA;AAAA,IAAA;AAAA,EAAA;AAIR;"}
|
|
1
|
+
{"version":3,"file":"index.es.js","sources":["../../../src/components/filters/AppliedFilters.tsx","../../../src/components/datatable/MyTable.tsx","../../../src/components/datatable/DataTable.tsx"],"sourcesContent":["import { ButtonGroup } from 'dgz-ui';\nimport { Button } from 'dgz-ui/button';\nimport type { CardProps } from 'dgz-ui/card';\nimport { cn } from 'dgz-ui/utils';\nimport isEmpty from 'lodash.isempty';\nimport { XIcon } from 'lucide-react';\nimport { memo, useMemo } from 'react';\nimport { useTranslation } from 'react-i18next';\nimport type { FilterInterface } from './FilterWrapper.tsx';\n\n/**\n * Props for the AppliedFilters component.\n */\nexport interface AppliedFiltersProps extends CardProps {\n /** Array of filter definitions to render. */\n filters?: FilterInterface[];\n /** Current active parameters/filters. */\n params?: Record<string, unknown>;\n /** Callback fired when filters are applied. */\n onFilter?: (filters: Record<string, unknown>) => void;\n}\n\n/**\n * AppliedFilters displays active filter values as removable buttons/tags.\n *\n * @param props.filters - Array of filter definitions to map values to labels.\n * @param props.params - Current active filter parameters.\n * @param props.onFilter - Callback fired when a filter is removed.\n * @param props.className - Additional CSS classes.\n * @returns {JSX.Element | false} A list of active filter buttons or false if no filters are active\n */\nexport const AppliedFilters = memo(function FilterWrapper({\n filters,\n params,\n onFilter,\n className,\n ...props\n}: AppliedFiltersProps) {\n const { t } = useTranslation();\n\n const filterObject = useMemo(\n () =>\n Object.fromEntries(\n filters?.map((filter) => [\n filter.name,\n Object.fromEntries(\n filter.options?.map(({ label, value }) => [value, label]) || []\n ),\n ]) || []\n ),\n [filters]\n );\n\n const paramsArr = useMemo(\n () =>\n Object.entries(params || {}).filter(\n ([key, value]) => !!filterObject?.[key] && !isEmpty(value)\n ),\n [filterObject, params]\n );\n\n return (\n !isEmpty(paramsArr) && (\n <div {...props} className={cn('flex flex-wrap gap-2', className)}>\n {paramsArr.map(([key, value]) =>\n Array.isArray(value) ? (\n <ButtonGroup key={key}>\n {value\n .filter((val) => filterObject?.[key]?.[val] && val)\n .map((val, index) => (\n <Button\n size={'sm'}\n key={index}\n onClick={() => {\n onFilter?.({\n ...params,\n [key]: value.filter((v) => v !== val),\n });\n }}\n >\n {t(String(filterObject?.[key]?.[val] || ''))} <XIcon />\n </Button>\n ))}\n </ButtonGroup>\n ) : (\n <Button\n size={'sm'}\n onClick={() => {\n const paramValues = { ...params };\n\n delete paramValues[key];\n onFilter?.(paramValues);\n }}\n >\n {t(String(filterObject?.[key]?.[value as string] || ''))}{' '}\n <XIcon />\n </Button>\n )\n )}\n </div>\n )\n );\n});\n","import { Checkbox } from 'dgz-ui/form';\nimport {\n Table,\n TableBody,\n TableCell,\n TableHead,\n TableHeader,\n TableRow,\n} from 'dgz-ui/table';\nimport { cn } from 'dgz-ui/utils';\nimport get from 'lodash.get';\nimport {\n ArrowDownWideNarrow,\n ArrowUpDown,\n ArrowUpWideNarrow,\n} from 'lucide-react';\nimport { type ComponentProps, useEffect } from 'react';\nimport { SortOrder } from '../../enums';\nimport { useDataTable, useSortable, type UseSortableProps } from '../../hooks';\nimport type { ColumnType } from '../../types';\nimport { Empty } from '../empty';\nimport { DEFAULT_LIMIT } from '../pagination/MyLimitSelect';\n\n/**\n * Props for the MyTable component.\n * @template TData - The type of data in the table.\n */\nexport interface MyTableProps<TData> extends ComponentProps<'table'> {\n /** Array of data rows to display. */\n rows?: TData[];\n /** Column definitions. */\n columns: ColumnType<TData>[];\n /** Callback when a row is clicked. */\n onRowClick?: (row: TData) => void;\n /** Whether to show row numbers. */\n hasNumbers?: boolean;\n /** Whether to show selection checkboxes. */\n hasCheckbox?: boolean;\n /** Unique key for each row. */\n rowKey: keyof TData;\n /** Current table parameters (page, limit, sort). */\n params?: Record<string, unknown>;\n /** Total number of items (optional, often used with pagination context). */\n total?: number;\n /** Array of currently selected item keys. */\n selectedItems?: TData[keyof TData][];\n /** Callback when selected items change. */\n onSelectedItemsChange?: (selectedItems?: TData[keyof TData][]) => void;\n /** Callback when sort order changes. */\n onSortOrderChange?: (\n params: Omit<UseSortableProps<TData>, 'onSortOrderChange'>\n ) => void;\n /** Whether the header should stick to the top. */\n isStickyHeader?: true;\n}\n\n/**\n * MyTable renders a generic data table with optional numbering, selection checkboxes,\n * sortable columns and sticky header. It is a presentational component and delegates\n * sorting/selection state via hooks and callbacks.\n *\n * @template TData - The row data type.\n * @param rows - Array of data rows.\n * @param columns - Column definitions.\n * @param onRowClick - Callback when a row is clicked.\n * @param rowKey - Unique key for each row.\n * @param params - Current table parameters.\n * @param hasNumbers - Whether to show row numbers.\n * @param hasCheckbox - Whether to show selection checkboxes.\n * @param selectedItems - Array of currently selected item keys.\n * @param onSelectedItemsChange - Callback when selected items change.\n * @param onSortOrderChange - Callback when sort order changes.\n * @param isStickyHeader - Whether the header should stick to the top.\n * @param className - Additional CSS classes.\n * @param props - Component props.\n * @returns {JSX.Element} React element containing the table.\n */\nexport const MyTable = <TData,>({\n rows = [],\n columns,\n onRowClick,\n rowKey,\n params = {\n page: 1,\n limit: DEFAULT_LIMIT,\n },\n hasNumbers = false,\n hasCheckbox = false,\n selectedItems,\n onSelectedItemsChange,\n onSortOrderChange,\n isStickyHeader,\n className,\n ...props\n}: MyTableProps<TData>) => {\n const { sortObject, handleSort } = useSortable<TData>({\n sortField: params?.sortField as keyof TData | undefined,\n sortOrder: params?.sortOrder as SortOrder | undefined,\n onSortOrderChange,\n });\n const {\n selectedRows,\n isRowSelected,\n isAllRowsSelected,\n handleSelectAllRows,\n handleSelectRow,\n } = useDataTable<TData>({ rows, defaultSelectedRows: selectedItems });\n\n useEffect(() => {\n onSelectedItemsChange?.(selectedRows);\n }, [selectedRows, onSelectedItemsChange]);\n\n return (\n <Table {...props}>\n <TableHeader\n className={cn('bg-bg', isStickyHeader && 'sticky top-0 z-1')}\n >\n <TableRow>\n {hasCheckbox && (\n <TableHead className={'w-12 p-3'}>\n <Checkbox\n className={'mt-1'}\n checked={isAllRowsSelected(rowKey)}\n onCheckedChange={(value) =>\n handleSelectAllRows(rowKey, !!value)\n }\n aria-label=\"Select all\"\n />\n </TableHead>\n )}\n {hasNumbers && <TableHead className={'w-12 p-2'}>#</TableHead>}\n {columns\n .filter((column) => !column.hidden)\n .map((column) => (\n <TableHead\n key={column.key}\n style={column.styles}\n className={cn('p-2', column.sortable && 'cursor-pointer')}\n onClick={() => column.sortable && handleSort(column.dataIndex)}\n >\n <div className={'flex items-center gap-2'}>\n {column.name}{' '}\n {column.sortable &&\n (sortObject?.sortField === column.key ? (\n <>\n {sortObject?.sortOrder === SortOrder.DESC && (\n <ArrowDownWideNarrow size={15} />\n )}\n {sortObject?.sortOrder === SortOrder.ASC && (\n <ArrowUpWideNarrow size={15} />\n )}\n </>\n ) : (\n <ArrowUpDown size={15} />\n ))}\n </div>\n </TableHead>\n ))}\n </TableRow>\n </TableHeader>\n <TableBody className={'[&>tr:nth-child(even)]:bg-bg-secondary'}>\n {rows.length ? (\n rows.map((row, index) => (\n <TableRow\n key={`${row[rowKey]}`}\n onClick={() => onRowClick?.(row)}\n className={cn(onRowClick && 'cursor-pointer')}\n data-state={isRowSelected(row[rowKey]) && 'selected'}\n >\n {hasCheckbox && (\n <TableCell\n className={'w-12 p-3'}\n onClick={(evt) => evt.stopPropagation()}\n >\n <Checkbox\n className={'mt-1'}\n checked={isRowSelected(row[rowKey])}\n onCheckedChange={(value) =>\n handleSelectRow(row[rowKey], !!value)\n }\n aria-label=\"Select row\"\n />\n </TableCell>\n )}\n {hasNumbers && (\n <TableCell className={'w-12 p-2'}>\n {((params.page as number) - 1) *\n ((params.limit || DEFAULT_LIMIT) as number) +\n index +\n 1}\n </TableCell>\n )}\n {columns\n .filter((column) => !column.hidden)\n .map((column) => (\n <TableCell\n className={'text-body-xs-medium max-w-xs p-2'}\n style={column.styles}\n key={`${index}-${column.key}`}\n >\n {column.render\n ? column.render(get(row, column.dataIndex), row)\n : get(row, column.dataIndex, '')}\n </TableCell>\n ))}\n </TableRow>\n ))\n ) : (\n <TableRow>\n <TableCell\n colSpan={\n hasNumbers\n ? hasCheckbox\n ? columns.length + 2\n : columns.length + 1\n : columns.length\n }\n >\n <Empty />\n </TableCell>\n </TableRow>\n )}\n </TableBody>\n </Table>\n );\n};\n","import { RiArrowDownSLine, RiLayoutColumnLine } from '@remixicon/react';\nimport { Button } from 'dgz-ui/button';\nimport {\n type DropdownContainerProps,\n DropdownMenu,\n DropdownMenuCheckboxItem,\n DropdownMenuContent,\n DropdownMenuItem,\n DropdownMenuSeparator,\n DropdownMenuTrigger,\n} from 'dgz-ui/dropdown';\nimport { cn } from 'dgz-ui/utils';\nimport get from 'lodash.get';\nimport isEmpty from 'lodash.isempty';\nimport { RefreshCw } from 'lucide-react';\nimport { type ReactNode, useEffect } from 'react';\nimport { useTranslation } from 'react-i18next';\nimport { useColumns } from '../../hooks';\nimport type { ColumnType } from '../../types';\nimport { type ActionInterface, Actions, type ActionsProps } from '../actions';\nimport {\n ExportData,\n type ExportDataInterface,\n type ExportDataProps,\n} from '../export';\nimport {\n type FilterInterface,\n FilterWrapper,\n type FilterWrapperProps,\n Search,\n type SearchProps,\n} from '../filters';\nimport { AppliedFilters } from '../filters/AppliedFilters.tsx';\nimport { Loader } from '../loader';\nimport { MyLimitSelect, MyPagination } from '../pagination';\nimport type { MyPaginationProps } from '../pagination/MyPagination.tsx';\nimport { MyTable, type MyTableProps } from './MyTable';\n\n/**\n * Minimal pagination wrapper contract used by `DataTable`.\n *\n * Notes\n * - Only `page`, `limit`, and `totalPages` are required. Other fields are optional and\n * may be provided by your API for convenience.\n * - The actual rows array can be stored in any key, controlled via `dataKey` prop\n * (defaults to `\"docs\"`).\n */\nexport interface PaginationInterface<TData> {\n /** Array of rows for the current page. Used when `dataKey` is set to `\"docs\"`. */\n docs?: TData[];\n /** Zero-based index of the first item on the current page (if provided by API). */\n offset?: number;\n /** Page size (items per page). */\n limit: number;\n /** Total number of pages available. */\n totalPages: number;\n /** Total number of items across all pages (if available). */\n total?: number;\n /** Current page number (1-based). */\n page: number;\n /** Convenience counter for the first item index on the page (if provided). */\n pagingCounter?: number;\n /** Whether a previous page exists. */\n hasPrevPage?: boolean;\n /** Whether a next page exists. */\n hasNextPage?: boolean;\n /** Previous page number, if available. */\n prevPage?: number;\n /** Next page number, if available. */\n nextPage?: number;\n}\n\n/**\n * Props for the DataTable component.\n *\n * @template TData - Row data type.\n * @template TPaginationData - Pagination wrapper type.\n */\nexport interface DataTableProps<\n TData,\n TPaginationData extends PaginationInterface<TData>,\n> extends Omit<MyTableProps<TData>, 'rows'> {\n /** Pagination data source. */\n dataSource?: TPaginationData;\n /** Callback for parameter changes (pagination, sorting, filtering). */\n onParamChange?: (param: Record<string, unknown>) => void;\n /** Whether to enable pagination. */\n hasPagination?: true;\n /** Options for the export data dropdown. */\n exportOptions?: ExportDataInterface[];\n /** Whether to enable search functionality. */\n hasSearch?: true;\n /** Whether the table data is loading. */\n loading?: boolean;\n /** Array of filters to display. */\n filters?: FilterInterface[];\n /** Array of actions to display. */\n actions?: ActionInterface[];\n /** Callback for filter changes. */\n handleFilterChange?: (filters: Record<string, unknown>) => void;\n /** Unique key for the table, used for column persistence. */\n tableKey: string;\n /** The key in dataSource where the data array is located. Defaults to \"docs\". */\n dataKey?: keyof TPaginationData;\n /** Whether to show the columns visibility dropdown. */\n hasColumnsVisibilityDropdown?: true;\n /** Whether to show the columns visibility dropdown. */\n showAppliedFilters?: boolean;\n /** Callback when columns are updated (e.g., visibility toggled). */\n onColumnsUpdate?: (columns: ColumnType<TData>[]) => void;\n /** Whether the export action is loading. */\n exportLoading?: boolean;\n /** Props for the Actions component. */\n actionProps?: Partial<ActionsProps>;\n /** Props for the FilterWrapper component. */\n filterWrapperProps?: Partial<FilterWrapperProps>;\n /** Props for the ExportData component. */\n exportOptionsProps?: Partial<ExportDataProps>;\n searchProps?: Partial<SearchProps>;\n paginationProps?: Partial<MyPaginationProps>;\n /** Props for the columns visibility dropdown. */\n columnsVisibilityProps?: DropdownContainerProps & {\n title?: ReactNode;\n resetText?: ReactNode;\n };\n}\n\n/**\n * DataTable is a composable, high-level table that brings together search, filters,\n * column visibility management, header actions, exporting, and pagination.\n * It renders `MyTable` for rows and, when enabled, shows header controls and a footer with pagination.\n *\n * Generic Types\n * - `TData` — Row data shape (type of each item in the rows array).\n * - `TPaginationData` — Pagination wrapper type containing rows and pagination meta; defaults to\n * `PaginationInterface<TData>`.\n *\n * Key Behaviors\n * - Emits `onParamChange` when search text, filters, page, limit, or sort order change.\n * - Persists column visibility per `tableKey` via `useColumns` and informs parent with `onColumnsUpdate`.\n * - Renders header controls only when the related feature is enabled/has content.\n *\n * Accessibility\n * - Header controls and dropdowns reuse shared primitives that include keyboard and ARIA support.\n *\n * Internationalization\n * - Text such as \"Export\", \"Customize columns\", and \"Reset columns\" are resolved via `react-i18next`.\n *\n * Usage Examples\n * 1) Minimal paginated table (uses default `dataKey = \"docs\"`)\n * ```tsx\n * type User = { id: string; name: string };\n * const data = { docs: [{ id: '1', name: 'Ada' }], page: 1, limit: 10, totalPages: 1 };\n *\n * <DataTable<User>\n * tableKey=\"users-table\"\n * columns={[{ key: 'name', name: 'Name' }]}\n * rowKey=\"id\"\n * dataSource={data}\n * hasPagination\n * />\n * ```\n *\n * 2) Custom `dataKey` and column visibility persistence\n * ```tsx\n * type Row = { id: number; title: string };\n * const payload = { items: [{ id: 1, title: 'Hello' }], page: 1, limit: 20, totalPages: 1 };\n *\n * <DataTable<Row>\n * tableKey=\"posts\"\n * columns={[{ key: 'title', name: 'Title' }]}\n * rowKey=\"id\"\n * dataSource={payload}\n * dataKey=\"items\"\n * hasColumnsVisibilityDropdown\n * />\n * ```\n *\n * 3) Responding to user interactions via `onParamChange`\n * ```tsx\n * const [params, setParams] = useState({ page: 1, limit: 10 });\n *\n * <DataTable\n * tableKey=\"logs\"\n * columns={[{ key: 'message', name: 'Message' }]}\n * rowKey=\"id\"\n * params={params}\n * onParamChange={setParams}\n * hasSearch\n * hasPagination\n * />\n * ```\n *\n * Notes and Best Practices\n * - Ensure `rowKey` points to a stable unique field in `TData` to avoid key collisions.\n * - When arrays like `exportOptions`, `filters`, or `actions` are empty, their sections are not rendered.\n * - Sorting emits `{ sortField, sortOrder }` through `onParamChange` when the user toggles a column sort.\n *\n * @template TData - Row data type.\n * @template TPaginationData - Pagination wrapper type.\n * @param dataSource - Paginated data source object.\n * @param columns - Column definitions.\n * @param rowKey - Property name used as a unique row key.\n * @param hasSearch - Whether to display the search input.\n * @param exportOptions - Export menu options.\n * @param hasPagination - Whether to render the pagination footer.\n * @param onParamChange - Emits parameter changes for pagination/sorting/search/filters.\n * @param dataKey - Key within `dataSource` that contains the row array.\n * @param loading - Whether the table data is loading.\n * @param tableKey - Unique key for persisting column visibility state.\n * @param filters - Filter configurations to render.\n * @param actions - Header actions.\n * @param handleFilterChange - Callback executed when filter values change.\n * @param params - Current list parameters.\n * @param exportLoading - Whether the export action is loading.\n * @param onColumnsUpdate - Notifies parent whenever columns state changes.\n * @param hasColumnsVisibilityDropdown - Whether to show columns customize dropdown.\n * @param showAppliedFilters - Whether to show applied filters.\n * @param onSelectedItemsChange - Callback when selected rows change.\n * @param actionProps - Props for the Actions component.\n * @param filterWrapperProps - Props for the FilterWrapper component.\n * @param exportOptionsProps - Props for the ExportData component.\n * @param columnsVisibilityProps - Props for columns visibility dropdown.\n * @param paginationProps - Props for the MyPagination component.\n * @param searchProps - Props for the Search component.\n * @param className - Additional CSS classes.\n * @param props - Additional props passed to MyTable.\n * @returns {JSX.Element} React element that renders a complete data table experience.\n */\nexport const DataTable = <\n TData,\n TPaginationData extends PaginationInterface<TData> =\n PaginationInterface<TData>,\n>({\n dataSource,\n columns,\n rowKey,\n hasSearch,\n exportOptions,\n hasPagination,\n onParamChange,\n dataKey = 'docs',\n loading,\n tableKey,\n filters,\n actions,\n handleFilterChange,\n params,\n exportLoading = false,\n onColumnsUpdate,\n hasColumnsVisibilityDropdown,\n showAppliedFilters = false,\n actionProps,\n filterWrapperProps,\n exportOptionsProps,\n columnsVisibilityProps,\n paginationProps,\n searchProps,\n className,\n ...props\n}: DataTableProps<TData, TPaginationData>) => {\n const { t } = useTranslation();\n const { formattedColumns, handleColumnsChange, resetColumns } =\n useColumns<TData>({ key: tableKey, columns });\n\n useEffect(() => {\n onColumnsUpdate?.(formattedColumns);\n }, [formattedColumns, onColumnsUpdate]);\n\n return (\n <div\n className={cn(\n 'border-border-alpha-light relative flex grow flex-col overflow-auto rounded-xl border shadow-xs',\n className\n )}\n >\n <div className={'flex shrink-0 flex-col gap-4 p-4'}>\n {(hasSearch ||\n (hasColumnsVisibilityDropdown && tableKey) ||\n !isEmpty(exportOptions) ||\n !isEmpty(filters)) && (\n <div className=\"flex flex-col justify-between gap-3 lg:flex-row lg:items-center\">\n <div className={'grow'}>\n {hasSearch && (\n <Search\n {...searchProps}\n inputProps={{\n ...searchProps?.inputProps,\n className: cn(\n 'h-8 grow',\n searchProps?.inputProps?.className\n ),\n }}\n className={cn(\n 'max-w-full lg:max-w-80! [&_button]:-top-1',\n searchProps?.className\n )}\n defaultValue={get(params, 'search', '') as string}\n onSearchChange={(search) =>\n onParamChange?.({ ...params, search, page: 1 })\n }\n />\n )}\n </div>\n <div className={'flex items-center justify-end gap-3'}>\n {exportOptions && (\n <ExportData\n {...exportOptionsProps}\n options={exportOptions}\n loading={exportLoading}\n />\n )}\n {hasColumnsVisibilityDropdown && tableKey && (\n <DropdownMenu modal={false}>\n <DropdownMenuTrigger\n asChild\n className={'grow'}\n {...columnsVisibilityProps?.triggerProps}\n >\n <Button\n variant=\"secondary\"\n size={'sm'}\n className={'ml-auto rounded-lg px-3'}\n >\n {columnsVisibilityProps?.title || (\n <>\n <RiLayoutColumnLine />{' '}\n <span className={'hidden md:inline!'}>\n {t('Customize columns')}\n </span>\n <RiArrowDownSLine />\n </>\n )}\n </Button>\n </DropdownMenuTrigger>\n <DropdownMenuContent\n align=\"end\"\n {...columnsVisibilityProps?.contentProps}\n >\n <DropdownMenuItem\n data-testid={'reset-columns-button'}\n onSelect={(e) => e.preventDefault()}\n className=\"capitalize\"\n onClick={resetColumns}\n >\n <RefreshCw />{' '}\n {columnsVisibilityProps?.resetText || t('Reset columns')}\n </DropdownMenuItem>\n <DropdownMenuSeparator />\n {formattedColumns.map((column) => {\n return (\n <DropdownMenuCheckboxItem\n key={column.key}\n data-testid={column.key}\n onSelect={(e) => e.preventDefault()}\n className=\"capitalize\"\n checked={!column.hidden}\n onCheckedChange={(value) =>\n handleColumnsChange(column, !value)\n }\n >\n {column.name}\n </DropdownMenuCheckboxItem>\n );\n })}\n </DropdownMenuContent>\n </DropdownMenu>\n )}\n {actions && <Actions {...actionProps} actions={actions} />}\n {filters && (\n <FilterWrapper\n {...filterWrapperProps}\n filters={filters}\n params={params}\n onChange={handleFilterChange}\n onFilter={(filter) => {\n onParamChange?.({ ...filter, page: 1 });\n handleFilterChange?.(filter);\n }}\n />\n )}\n </div>\n </div>\n )}\n {showAppliedFilters && !isEmpty(filters) && (\n <AppliedFilters\n filters={filters}\n params={params}\n onFilter={(filter) => {\n onParamChange?.({ ...filter, page: 1 });\n handleFilterChange?.(filter);\n }}\n />\n )}\n </div>\n\n <div className={cn('flex grow flex-col overflow-auto border-y')}>\n {!loading ? (\n <MyTable<TData>\n {...props}\n params={{\n page: dataSource?.page || 1,\n limit: dataSource?.limit,\n ...params,\n }}\n rows={get(dataSource, dataKey, []) as TData[]}\n rowKey={rowKey}\n columns={formattedColumns}\n onSortOrderChange={({ sortField, sortOrder }) => {\n onParamChange?.({ ...params, sortField, sortOrder });\n }}\n />\n ) : (\n <Loader />\n )}\n </div>\n {hasPagination && (\n <div className=\"flex shrink-0 flex-wrap items-center justify-center gap-3 p-4 lg:justify-between\">\n <div className=\"text-sm\">\n <MyLimitSelect\n onLimitChange={(limit) =>\n onParamChange?.({ ...params, limit, page: 1 })\n }\n defaultValue={dataSource?.limit}\n />\n </div>\n <div className=\"text-muted-foreground text-sm\">\n {t('{{selectedCount}} of {{total}} row(s) selected', {\n selectedCount: props.selectedItems?.length ?? 0,\n total: dataSource?.total || 0,\n })}\n </div>\n <div>\n <MyPagination\n {...paginationProps}\n onPageChange={(page) => onParamChange?.({ ...params, page })}\n currentPage={dataSource?.page}\n totalPages={dataSource?.totalPages}\n />\n </div>\n </div>\n )}\n </div>\n );\n};\n"],"names":["AppliedFilters","memo","filters","params","onFilter","className","props","useTranslation","filterObject","useMemo","filter","_a","label","value","paramsArr","key","isEmpty","jsx","cn","ButtonGroup","val","index","jsxs","Button","v","XIcon","paramValues","MyTable","rows","columns","onRowClick","rowKey","DEFAULT_LIMIT","hasNumbers","hasCheckbox","selectedItems","onSelectedItemsChange","onSortOrderChange","isStickyHeader","sortObject","handleSort","useSortable","selectedRows","isRowSelected","isAllRowsSelected","handleSelectAllRows","handleSelectRow","useDataTable","useEffect","Table","TableHeader","TableRow","TableHead","Checkbox","column","Fragment","SortOrder","ArrowDownWideNarrow","ArrowUpWideNarrow","ArrowUpDown","TableBody","row","TableCell","evt","get","Empty","DataTable","dataSource","hasSearch","exportOptions","hasPagination","onParamChange","dataKey","loading","tableKey","actions","handleFilterChange","exportLoading","onColumnsUpdate","hasColumnsVisibilityDropdown","showAppliedFilters","actionProps","filterWrapperProps","exportOptionsProps","columnsVisibilityProps","paginationProps","searchProps","t","formattedColumns","handleColumnsChange","resetColumns","useColumns","Search","search","ExportData","DropdownMenu","DropdownMenuTrigger","RiLayoutColumnLine","RiArrowDownSLine","DropdownMenuContent","DropdownMenuItem","e","RefreshCw","DropdownMenuSeparator","DropdownMenuCheckboxItem","Actions","FilterWrapper","Loader","sortField","sortOrder","MyLimitSelect","limit","_b","MyPagination","page"],"mappings":";;;;;;;;;;;;;;;;;;;;AA+BO,MAAMA,KAAiBC,GAAK,SAAuB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