dgz-ui-shared 1.2.27 → 1.2.28
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 +292 -268
- package/dist/components/datatable/index.es.js.map +1 -1
- package/dist/types/App.d.ts.map +1 -1
- package/dist/types/components/datatable/DataTable.d.ts.map +1 -1
- package/dist/types/components/filters/AppliedFilters.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"),
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react/jsx-runtime"),O=require("../../chunks/index-ClQFzqcq.cjs.js"),J=require("dgz-ui/button"),R=require("dgz-ui/dropdown"),h=require("dgz-ui/utils"),u=require("../../chunks/lodash-BjH0kD7j.cjs.js"),b=require("lucide-react"),L=require("react"),Z=require("react-i18next"),X=require("../../chunks/useSortable-B3LF1tg8.cjs.js"),se=require("../../chunks/Actions-bpMDyl5M.cjs.js"),te=require("../../chunks/ExportData-BjS0xAqH.cjs.js"),Q=require("../../chunks/Search-D0G4Mda4.cjs.js"),le=require("dgz-ui"),de=require("../../chunks/Loader-D_jX_Wgx.cjs.js"),H=require("../../chunks/MyPagination-CnF3468f.cjs.js"),U=require("dgz-ui/form"),f=require("dgz-ui/table"),Y=require("../../chunks/SortOrder-81BrXp3i.cjs.js"),xe=require("../../chunks/Empty-BYOOFAab.cjs.js"),ce=L.memo(function({filters:N,params:E,onFilter:n,className:w,...k}){const{t:o}=Z.useTranslation(),d=L.useMemo(()=>Object.fromEntries((N==null?void 0:N.map(x=>{var j;return[x.name,Object.fromEntries(((j=x.options)==null?void 0:j.map(({label:s,value:T})=>[T,s]))||[])]}))||[]),[N]);return e.jsx("div",{...k,className:h.cn("flex flex-wrap gap-2",w),children:Object.entries(E||{}).filter(([x,j])=>!!(d!=null&&d[x])&&!u.lodashExports.isEmpty(j)).map(([x,j])=>{var s;return Array.isArray(j)?e.jsx(le.ButtonGroup,{children:j.filter(T=>{var v;return((v=d==null?void 0:d[x])==null?void 0:v[T])&&T}).map((T,v)=>{var i;return e.jsxs(J.Button,{size:"sm",onClick:()=>{n==null||n({...E,[x]:j.filter(M=>M!==T)})},children:[o(String(((i=d==null?void 0:d[x])==null?void 0:i[T])||""))," ",e.jsx(b.XIcon,{})]},v)})},x):e.jsxs(J.Button,{size:"sm",onClick:()=>{n==null||n(u.lodashExports.omit(E,x))},children:[o(String(((s=d==null?void 0:d[x])==null?void 0:s[j])||""))," ",e.jsx(b.XIcon,{})]})})})}),a=({rows:t=[],columns:N,onRowClick:E,rowKey:n,params:w={page:1,limit:H.DEFAULT_LIMIT},hasNumbers:k=!1,hasCheckbox:o=!1,selectedItems:d,onSelectedItemsChange:x,onSortOrderChange:j,isStickyHeader:s,className:T,...v})=>{const{sortObject:i,handleSort:M}=X.useSortable({sortField:w==null?void 0:w.sortField,sortOrder:w==null?void 0:w.sortOrder,onSortOrderChange:j}),{selectedRows:A,isRowSelected:g,isAllRowsSelected:q,handleSelectAllRows:W,handleSelectRow:z}=X.useDataTable({rows:t,defaultSelectedRows:d});return L.useEffect(()=>{JSON.stringify(d)!==JSON.stringify(A)&&A&&(x==null||x(A))},[A,d,x]),e.jsxs(f.Table,{...v,className:h.cn("relative",T),children:[e.jsx(f.TableHeader,{className:h.cn("bg-bg",s&&"sticky top-0 z-1"),children:e.jsxs(f.TableRow,{children:[o&&e.jsx(f.TableHead,{className:"w-12 p-3",children:e.jsx(U.Checkbox,{className:"mt-1",checked:q(n),onCheckedChange:l=>W(n,!!l),"aria-label":"Select all"})}),k&&e.jsx(f.TableHead,{className:"w-12 p-2",children:"#"}),N.filter(l=>!l.hidden).map(l=>e.jsx(f.TableHead,{style:l.styles,className:h.cn("p-2",l.sortable&&"cursor-pointer"),onClick:()=>l.sortable&&M(l.dataIndex),children:e.jsxs("div",{className:"flex items-center gap-2",children:[l.name," ",l.sortable&&((i==null?void 0:i.sortField)===l.key?e.jsxs(e.Fragment,{children:[(i==null?void 0:i.sortOrder)===Y.SortOrder.DESC&&e.jsx(b.ArrowDownWideNarrow,{size:15}),(i==null?void 0:i.sortOrder)===Y.SortOrder.ASC&&e.jsx(b.ArrowUpWideNarrow,{size:15})]}):e.jsx(b.ArrowUpDown,{size:15}))]})},l.key))]})}),e.jsx(f.TableBody,{className:"[&>tr:nth-child(even)]:bg-bg-secondary",children:t.length?t.map((l,y)=>e.jsxs(f.TableRow,{onClick:()=>E==null?void 0:E(l),className:h.cn(E&&"cursor-pointer"),"data-state":g(l[n])&&"selected",children:[o&&e.jsx(f.TableCell,{className:"w-12 p-3",onClick:r=>r.stopPropagation(),children:e.jsx(U.Checkbox,{className:"mt-1",checked:g(l[n]),onCheckedChange:r=>z(l[n],!!r),"aria-label":"Select row"})}),k&&e.jsx(f.TableCell,{className:"w-12 p-2",children:(w.page-1)*(w.limit||H.DEFAULT_LIMIT)+y+1}),N.filter(r=>!r.hidden).map(r=>e.jsx(f.TableCell,{className:"text-body-xs-medium max-w-xs p-2",style:r.styles,children:r.render?r.render(u.lodashExports.get(l,r.dataIndex),l):u.lodashExports.get(l,r.dataIndex,"")},`${y}-${r.key}`))]},`${l[n]}`)):e.jsx(f.TableRow,{children:e.jsx(f.TableCell,{colSpan:k?o?N.length+2:N.length+1:N.length,children:e.jsx(xe.Empty,{})})})})]})},re=({dataSource:t,columns:N,onRowClick:E,rowKey:n,hasNumbers:w,hasSearch:k,exportOptions:o,hasCheckbox:d,hasPagination:x,isStickyHeader:j,onParamChange:s,dataKey:T="docs",loading:v,tableKey:i,filters:M,actions:A,handleFilterChange:g,params:q,exportLoading:W=!1,onColumnsUpdate:z,hasColumnsVisibilityDropdown:l,showAppliedFilters:y=!1,onSelectedItemsChange:r,actionProps:m,filterWrapperProps:F,exportOptionsProps:K,columnsVisibilityProps:p,paginationProps:S,searchProps:D,...V})=>{var G;const{t:_}=Z.useTranslation(),[B,C]=L.useState([]),{formattedColumns:$,handleColumnsChange:P,resetColumns:ee}=X.useColumns({key:i,columns:N});return L.useEffect(()=>{z==null||z($)},[$,z]),L.useEffect(()=>{r==null||r(B)},[B,r]),e.jsxs("div",{className:"border-border-alpha-light flex grow flex-col overflow-auto rounded-xl border shadow-xs",children:[e.jsxs("div",{className:"space-y-4 p-4",children:[(k||l&&i||!u.lodashExports.isEmpty(o)||!u.lodashExports.isEmpty(M))&&e.jsxs("div",{className:"flex shrink-0 flex-col items-center justify-between gap-3 lg:flex-row",children:[e.jsx("div",{className:"w-full shrink",children:k&&e.jsx(Q.Search,{...D,inputProps:{...D==null?void 0:D.inputProps,className:h.cn("h-8 grow",(G=D==null?void 0:D.inputProps)==null?void 0:G.className)},className:h.cn("max-w-full lg:max-w-78 [&_button]:-top-1",D==null?void 0:D.className),defaultValue:u.lodashExports.get(q,"search",""),onSearchChange:c=>s==null?void 0:s({...q,search:c,page:1})})}),e.jsxs("div",{className:"flex w-full shrink-0 items-center justify-end gap-3 lg:w-auto",children:[o&&e.jsx(te.ExportData,{...K,options:o,loading:W}),l&&i&&e.jsxs(R.DropdownMenu,{children:[e.jsx(R.DropdownMenuTrigger,{asChild:!0,className:"grow",...p==null?void 0:p.triggerProps,children:e.jsx(J.Button,{variant:"secondary",size:"sm",className:"ml-auto rounded-lg px-3",children:(p==null?void 0:p.title)||e.jsxs(e.Fragment,{children:[e.jsx(O.yn,{})," ",e.jsx("span",{className:"hidden md:inline!",children:_("Customize columns")}),e.jsx(O.f1,{})]})})}),e.jsxs(R.DropdownMenuContent,{align:"end",...p==null?void 0:p.contentProps,children:[e.jsxs(R.DropdownMenuItem,{className:"capitalize",onClick:ee,children:[e.jsx(b.RefreshCw,{})," ",(p==null?void 0:p.resetText)||_("Reset columns")]}),e.jsx(R.DropdownMenuSeparator,{}),$.map(c=>e.jsx(R.DropdownMenuCheckboxItem,{className:"capitalize",checked:!c.hidden,onCheckedChange:I=>P(c,!I),children:c.name},c.key))]})]}),A&&e.jsx(se.Actions,{...m,actions:A}),M&&e.jsx(Q.FilterWrapper,{...F,filters:M,params:q,onChange:g,onFilter:c=>{s==null||s({...c,page:1}),g==null||g(c)}})]})]}),y&&!u.lodashExports.isEmpty(M)&&e.jsx(ce,{filters:M,params:q,onFilter:c=>{s==null||s({...c,page:1}),g==null||g(c)}})]}),e.jsx("div",{className:"flex flex-col overflow-auto border-y",children:v?e.jsx(de.Loader,{}):e.jsx(a,{...V,params:{page:(t==null?void 0:t.page)||1,limit:t==null?void 0:t.limit,...q},rows:u.lodashExports.get(t,T,[]),rowKey:n,selectedItems:B,isStickyHeader:j,columns:$,hasCheckbox:d,hasNumbers:w,onRowClick:E,onSelectedItemsChange:C,onSortOrderChange:({sortField:c,sortOrder:I})=>{s==null||s({...q,sortField:c,sortOrder:I})}})}),x&&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(H.MyLimitSelect,{onLimitChange:c=>s==null?void 0:s({...q,limit:c,page:1}),defaultValue:t==null?void 0:t.limit})}),e.jsx("div",{className:"text-muted-foreground text-sm",children:_("{{selectedCount}} of {{total}} row(s) selected",{selectedCount:B.length,total:(t==null?void 0:t.total)||0})}),e.jsx("div",{children:e.jsx(H.MyPagination,{...S,onPageChange:c=>s==null?void 0:s({...q,page:c}),currentPage:t==null?void 0:t.page,totalPages:t==null?void 0:t.totalPages})})]})]})};exports.DataTable=re;exports.MyTable=a;
|
|
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, omit } from 'lodash';\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 FilterWrapper 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 * FilterWrapper shows a popover with a dynamic list of field filters and emits selected filter values.\n *\n * @param props.filters - Array of filter definitions to render.\n * @param props.params - Current params used to detect active filters.\n * @param props.onFilter - Callback fired when user applies filters.\n * @param props.onCancel - Callback fired on cancel.\n * @param props.onChange - Callback fired whenever filter form values change.\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(filters?.map((filter) => [filter.name, filter]) || []),\n [filters]\n );\n\n return (\n <div {...props} className={cn('flex flex-wrap gap-2', className)}>\n {Object.entries(params || {})\n .filter(([key, value]) => !!filterObject?.[key] && !isEmpty(value))\n .map(([key, value]) =>\n Array.isArray(value) ? (\n <ButtonGroup key={key}>\n {value.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(val)} <XIcon />\n </Button>\n ))}\n </ButtonGroup>\n ) : (\n <Button\n size={'sm'}\n onClick={() => {\n onFilter?.(omit(params, key));\n }}\n >\n {t(String(value || ''))} <XIcon />\n </Button>\n )\n )}\n </div>\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';\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 props - Component props.\n * @returns 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 if (\n JSON.stringify(selectedItems) !== JSON.stringify(selectedRows) &&\n selectedRows\n ) {\n onSelectedItemsChange?.(selectedRows);\n }\n }, [selectedRows, selectedItems, onSelectedItemsChange]);\n\n return (\n <Table {...props} className={cn('relative', className)}>\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, isEmpty } from 'lodash';\nimport { RefreshCw } from 'lucide-react';\nimport { type ReactNode, useEffect, useState } 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 * Props Overview\n * - `dataSource` — Paginated data source object that contains rows (see `dataKey`) and pagination metadata.\n * - `columns` — Column definitions passed to `MyTable`.\n * - `onRowClick` — Callback when a row is clicked.\n * - `rowKey` — Property name used as a unique row key.\n * - `hasNumbers` — Whether to show the row numbers column.\n * - `hasSearch` — Set to `true` to display the search input in the header.\n * - `exportOptions` — Export menu options shown by `ExportData` (see `ExportDataInterface[]`).\n * - `exportLoading` — When `true`, shows a spinner in the Export button to indicate an export action is in progress.\n * - `hasCheckbox` — Whether to show the selection checkbox column.\n * - `hasPagination` — Set to `true` to render the pagination footer.\n * - `isStickyHeader` — Whether to keep the table header sticky.\n * - `onParamChange` — Emits parameter changes for pagination/sorting/search/filters.\n * - `dataKey` — Key within `dataSource` that contains the row array. Defaults to `\"docs\"`.\n * - `loading` — If `true`, shows a loading state instead of the table rows.\n * - `tableKey` — Unique key for persisting column visibility state.\n * - `filters` — Filter configurations to render in the header.\n * - `actions` — Header actions independent of selected rows.\n * - `handleFilterChange` — Callback executed when filter values change.\n * - `params` — Current list parameters (pagination, sort, search, filters).\n * - `hasColumnsVisibilityDropdown` — Set to `true` to show the columns customize dropdown.\n * - `onColumnsUpdate` — Notifies parent whenever the internal columns state changes (after formatting/visibility).\n * - `actionProps` — Props passed to the `Actions` component.\n * - `filterWrapperProps` — Props passed to the `FilterWrapper` component.\n * - `exportOptionsProps` — Props passed to the `ExportData` component.\n * - `columnsVisibilityProps` — Props passed to the columns visibility dropdown.\n * - `onSelectedItemsChange` — Callback when selected rows change (requires `hasCheckbox`).\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 * Returns\n * - 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 onRowClick,\n rowKey,\n hasNumbers,\n hasSearch,\n exportOptions,\n hasCheckbox,\n hasPagination,\n isStickyHeader,\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 onSelectedItemsChange,\n actionProps,\n filterWrapperProps,\n exportOptionsProps,\n columnsVisibilityProps,\n paginationProps,\n searchProps,\n ...props\n}: DataTableProps<TData, TPaginationData>) => {\n const { t } = useTranslation();\n const [selectedRows, setSelectedRows] = useState<TData[keyof TData][]>([]);\n const { formattedColumns, handleColumnsChange, resetColumns } =\n useColumns<TData>({ key: tableKey, columns });\n\n useEffect(() => {\n onColumnsUpdate?.(formattedColumns);\n }, [formattedColumns, onColumnsUpdate]);\n\n useEffect(() => {\n onSelectedItemsChange?.(selectedRows);\n }, [selectedRows, onSelectedItemsChange]);\n\n return (\n <div\n className={\n 'border-border-alpha-light flex grow flex-col space-y-4 overflow-auto rounded-xl border p-4 shadow-xs'\n }\n >\n {(hasSearch ||\n (hasColumnsVisibilityDropdown && tableKey) ||\n !isEmpty(exportOptions) ||\n !isEmpty(filters)) && (\n <div className=\"flex shrink-0 flex-col items-center justify-between gap-3 lg:flex-row\">\n <div className={'w-full shrink'}>\n {hasSearch && (\n <Search\n {...searchProps}\n inputProps={{\n ...searchProps?.inputProps,\n className: cn('h-8 grow', searchProps?.inputProps?.className),\n }}\n className={cn(\n 'max-w-full lg:max-w-78 [&_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\n className={\n 'flex w-full shrink-0 items-center justify-end gap-3 lg:w-auto'\n }\n >\n {exportOptions && (\n <ExportData\n {...exportOptionsProps}\n options={exportOptions}\n loading={exportLoading}\n />\n )}\n {hasColumnsVisibilityDropdown && tableKey && (\n <DropdownMenu>\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 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 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 className={'flex 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 selectedItems={selectedRows}\n isStickyHeader={isStickyHeader}\n columns={formattedColumns}\n hasCheckbox={hasCheckbox}\n hasNumbers={hasNumbers}\n onRowClick={onRowClick}\n onSelectedItemsChange={setSelectedRows}\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: selectedRows.length,\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","jsx","cn","key","value","isEmpty","ButtonGroup","val","index","jsxs","Button","v","XIcon","omit","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","setSelectedRows","useState","formattedColumns","handleColumnsChange","resetColumns","useColumns","Search","_a","search","ExportData","DropdownMenu","DropdownMenuTrigger","RiLayoutColumnLine","RiArrowDownSLine","DropdownMenuContent","DropdownMenuItem","RefreshCw","DropdownMenuSeparator","DropdownMenuCheckboxItem","Actions","FilterWrapper","Loader","sortField","sortOrder","MyLimitSelect","limit","MyPagination","page"],"mappings":"s1BA+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,aAAYR,GAAA,YAAAA,EAAS,IAAKS,GAAW,CAACA,EAAO,KAAMA,CAAM,KAAM,CAAA,CAAE,EAC1E,CAACT,CAAO,CAAA,EAGV,OACEU,EAAAA,IAAC,MAAA,CAAK,GAAGN,EAAO,UAAWO,EAAAA,GAAG,uBAAwBR,CAAS,EAC5D,SAAA,OAAO,QAAQF,GAAU,EAAE,EACzB,OAAO,CAAC,CAACW,EAAKC,CAAK,IAAM,CAAC,EAACN,GAAA,MAAAA,EAAeK,KAAQ,CAACE,EAAAA,cAAAA,QAAQD,CAAK,CA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AA,CACE,GAAGnB,EACJ,OAAQ,CACN,MAAM2D,GAAA,YAAAA,EAAY,OAAQ,EAC1B,MAAOA,GAAA,YAAAA,EAAY,MACnB,GAAG9D,CAAA,EAEL,KAAM2D,EAAAA,cAAAA,IAAIG,EAAYK,EAAS,CAAA,CAAE,EACjC,OAAAzC,EACA,cAAeW,EACf,eAAAJ,EACA,QAASmD,EACT,YAAAvD,EACA,WAAAD,EACA,WAAAH,EACA,sBAAuByD,EACvB,kBAAmB,CAAC,CAAE,UAAAsB,EAAW,UAAAC,KAAgB,CAC/CvC,GAAA,MAAAA,EAAgB,CAAE,GAAGlE,EAAQ,UAAAwG,EAAW,UAAAC,GAC1C,CAAA,CAAA,EAKN,EACCxC,GACChD,EAAAA,KAAC,MAAA,CAAI,UAAU,mFACb,SAAA,CAAAR,EAAAA,IAAC,MAAA,CAAI,UAAU,UACb,SAAAA,EAAAA,IAACiG,EAAAA,cAAA,CACC,cAAgBC,GACdzC,GAAA,YAAAA,EAAgB,CAAE,GAAGlE,EAAQ,MAAA2G,EAAO,KAAM,IAE5C,aAAc7C,GAAA,YAAAA,EAAY,KAAA,CAAA,EAE9B,EACArD,EAAAA,IAAC,MAAA,CAAI,UAAU,gCACZ,WAAE,iDAAkD,CACnD,cAAe4B,EAAa,OAC5B,OAAOyB,GAAA,YAAAA,EAAY,QAAS,CAAA,CAC7B,EACH,QACC,MAAA,CACC,SAAArD,EAAAA,IAACmG,EAAAA,aAAA,CACE,GAAG5B,EACJ,aAAe6B,GAAS3C,GAAA,YAAAA,EAAgB,CAAE,GAAGlE,EAAQ,KAAA6G,IACrD,YAAa/C,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, omit } from 'lodash';\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 FilterWrapper 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 * FilterWrapper shows a popover with a dynamic list of field filters and emits selected filter values.\n *\n * @param props.filters - Array of filter definitions to render.\n * @param props.params - Current params used to detect active filters.\n * @param props.onFilter - Callback fired when user applies filters.\n * @param props.onCancel - Callback fired on cancel.\n * @param props.onChange - Callback fired whenever filter form values change.\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 return (\n <div {...props} className={cn('flex flex-wrap gap-2', className)}>\n {Object.entries(params || {})\n .filter(([key, value]) => !!filterObject?.[key] && !isEmpty(value))\n .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 onFilter?.(omit(params, key));\n }}\n >\n {t(String(filterObject?.[key]?.[value as string] || ''))}{' '}\n <XIcon />\n </Button>\n )\n )}\n </div>\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';\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 props - Component props.\n * @returns 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 if (\n JSON.stringify(selectedItems) !== JSON.stringify(selectedRows) &&\n selectedRows\n ) {\n onSelectedItemsChange?.(selectedRows);\n }\n }, [selectedRows, selectedItems, onSelectedItemsChange]);\n\n return (\n <Table {...props} className={cn('relative', className)}>\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, isEmpty } from 'lodash';\nimport { RefreshCw } from 'lucide-react';\nimport { type ReactNode, useEffect, useState } 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 * Props Overview\n * - `dataSource` — Paginated data source object that contains rows (see `dataKey`) and pagination metadata.\n * - `columns` — Column definitions passed to `MyTable`.\n * - `onRowClick` — Callback when a row is clicked.\n * - `rowKey` — Property name used as a unique row key.\n * - `hasNumbers` — Whether to show the row numbers column.\n * - `hasSearch` — Set to `true` to display the search input in the header.\n * - `exportOptions` — Export menu options shown by `ExportData` (see `ExportDataInterface[]`).\n * - `exportLoading` — When `true`, shows a spinner in the Export button to indicate an export action is in progress.\n * - `hasCheckbox` — Whether to show the selection checkbox column.\n * - `hasPagination` — Set to `true` to render the pagination footer.\n * - `isStickyHeader` — Whether to keep the table header sticky.\n * - `onParamChange` — Emits parameter changes for pagination/sorting/search/filters.\n * - `dataKey` — Key within `dataSource` that contains the row array. Defaults to `\"docs\"`.\n * - `loading` — If `true`, shows a loading state instead of the table rows.\n * - `tableKey` — Unique key for persisting column visibility state.\n * - `filters` — Filter configurations to render in the header.\n * - `actions` — Header actions independent of selected rows.\n * - `handleFilterChange` — Callback executed when filter values change.\n * - `params` — Current list parameters (pagination, sort, search, filters).\n * - `hasColumnsVisibilityDropdown` — Set to `true` to show the columns customize dropdown.\n * - `onColumnsUpdate` — Notifies parent whenever the internal columns state changes (after formatting/visibility).\n * - `actionProps` — Props passed to the `Actions` component.\n * - `filterWrapperProps` — Props passed to the `FilterWrapper` component.\n * - `exportOptionsProps` — Props passed to the `ExportData` component.\n * - `columnsVisibilityProps` — Props passed to the columns visibility dropdown.\n * - `onSelectedItemsChange` — Callback when selected rows change (requires `hasCheckbox`).\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 * Returns\n * - 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 onRowClick,\n rowKey,\n hasNumbers,\n hasSearch,\n exportOptions,\n hasCheckbox,\n hasPagination,\n isStickyHeader,\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 onSelectedItemsChange,\n actionProps,\n filterWrapperProps,\n exportOptionsProps,\n columnsVisibilityProps,\n paginationProps,\n searchProps,\n ...props\n}: DataTableProps<TData, TPaginationData>) => {\n const { t } = useTranslation();\n const [selectedRows, setSelectedRows] = useState<TData[keyof TData][]>([]);\n const { formattedColumns, handleColumnsChange, resetColumns } =\n useColumns<TData>({ key: tableKey, columns });\n\n useEffect(() => {\n onColumnsUpdate?.(formattedColumns);\n }, [formattedColumns, onColumnsUpdate]);\n\n useEffect(() => {\n onSelectedItemsChange?.(selectedRows);\n }, [selectedRows, onSelectedItemsChange]);\n\n return (\n <div\n className={\n 'border-border-alpha-light flex grow flex-col overflow-auto rounded-xl border shadow-xs'\n }\n >\n <div className={'space-y-4 p-4'}>\n {(hasSearch ||\n (hasColumnsVisibilityDropdown && tableKey) ||\n !isEmpty(exportOptions) ||\n !isEmpty(filters)) && (\n <div className=\"flex shrink-0 flex-col items-center justify-between gap-3 lg:flex-row\">\n <div className={'w-full shrink'}>\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-78 [&_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\n className={\n 'flex w-full shrink-0 items-center justify-end gap-3 lg:w-auto'\n }\n >\n {exportOptions && (\n <ExportData\n {...exportOptionsProps}\n options={exportOptions}\n loading={exportLoading}\n />\n )}\n {hasColumnsVisibilityDropdown && tableKey && (\n <DropdownMenu>\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 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 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={'flex 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 selectedItems={selectedRows}\n isStickyHeader={isStickyHeader}\n columns={formattedColumns}\n hasCheckbox={hasCheckbox}\n hasNumbers={hasNumbers}\n onRowClick={onRowClick}\n onSelectedItemsChange={setSelectedRows}\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: selectedRows.length,\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","jsx","cn","key","isEmpty","ButtonGroup","val","index","jsxs","Button","v","XIcon","omit","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","setSelectedRows","useState","formattedColumns","handleColumnsChange","resetColumns","useColumns","Search","search","ExportData","DropdownMenu","DropdownMenuTrigger","RiLayoutColumnLine","RiArrowDownSLine","DropdownMenuContent","DropdownMenuItem","RefreshCw","DropdownMenuSeparator","DropdownMenuCheckboxItem","Actions","FilterWrapper","Loader","sortField","sortOrder","MyLimitSelect","limit","MyPagination","page"],"mappings":"s1BA+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,MAA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AA,IAAC+F,EAAAA,cAAA,CACC,cAAgBC,GACdxC,GAAA,YAAAA,EAAgB,CAAE,GAAGpE,EAAQ,MAAA4G,EAAO,KAAM,IAE5C,aAAc5C,GAAA,YAAAA,EAAY,KAAA,CAAA,EAE9B,EACApD,EAAAA,IAAC,MAAA,CAAI,UAAU,gCACZ,WAAE,iDAAkD,CACnD,cAAe2B,EAAa,OAC5B,OAAOyB,GAAA,YAAAA,EAAY,QAAS,CAAA,CAC7B,EACH,QACC,MAAA,CACC,SAAApD,EAAAA,IAACiG,EAAAA,aAAA,CACE,GAAG3B,EACJ,aAAe4B,GAAS1C,GAAA,YAAAA,EAAgB,CAAE,GAAGpE,EAAQ,KAAA8G,IACrD,YAAa9C,GAAA,YAAAA,EAAY,KACzB,WAAYA,GAAA,YAAAA,EAAY,UAAA,CAAA,CAC1B,CACF,CAAA,CAAA,CACF,CAAA,CAAA,CAAA,CAIR"}
|
|
@@ -1,376 +1,400 @@
|
|
|
1
|
-
import { jsx as e, jsxs as
|
|
1
|
+
import { jsx as e, jsxs as N, Fragment as O } from "react/jsx-runtime";
|
|
2
2
|
import { y as ee, f as te } from "../../chunks/index-E1NtSoNr.es.js";
|
|
3
|
-
import { Button as
|
|
4
|
-
import { DropdownMenu as le, DropdownMenuTrigger as de, DropdownMenuContent as
|
|
5
|
-
import { cn as
|
|
6
|
-
import { l as
|
|
7
|
-
import { XIcon as
|
|
8
|
-
import { memo as
|
|
9
|
-
import { useTranslation as
|
|
10
|
-
import { u as ge, a as
|
|
3
|
+
import { Button as q } from "dgz-ui/button";
|
|
4
|
+
import { DropdownMenu as le, DropdownMenuTrigger as de, DropdownMenuContent as se, DropdownMenuItem as ie, DropdownMenuSeparator as fe, DropdownMenuCheckboxItem as re } from "dgz-ui/dropdown";
|
|
5
|
+
import { cn as W } from "dgz-ui/utils";
|
|
6
|
+
import { l as M } from "../../chunks/lodash-CRDOWzbs.es.js";
|
|
7
|
+
import { XIcon as Z, ArrowDownWideNarrow as pe, ArrowUpWideNarrow as Ne, ArrowUpDown as ce, RefreshCw as xe } from "lucide-react";
|
|
8
|
+
import { memo as me, useMemo as we, useEffect as Q, useState as ne } from "react";
|
|
9
|
+
import { useTranslation as b } from "react-i18next";
|
|
10
|
+
import { u as ge, a as Ee, b as Te } from "../../chunks/useSortable-BXNk8Wth.es.js";
|
|
11
11
|
import { A as De } from "../../chunks/Actions-Du8iQ3WR.es.js";
|
|
12
|
-
import { E as
|
|
12
|
+
import { E as ke } from "../../chunks/ExportData-DQzwB_yW.es.js";
|
|
13
13
|
import { S as ve, F as Ae } from "../../chunks/Search-CR54BX3a.es.js";
|
|
14
14
|
import { ButtonGroup as Me } from "dgz-ui";
|
|
15
15
|
import { L as ze } from "../../chunks/Loader-zvzAi0F6.es.js";
|
|
16
|
-
import { D as
|
|
17
|
-
import { Checkbox as
|
|
18
|
-
import { Table as
|
|
19
|
-
import { S as
|
|
16
|
+
import { D as I, M as Le, a as Re } from "../../chunks/MyPagination-B0czoGZK.es.js";
|
|
17
|
+
import { Checkbox as U } from "dgz-ui/form";
|
|
18
|
+
import { Table as We, TableHeader as oe, TableRow as G, TableHead as X, TableBody as Be, TableCell as H } from "dgz-ui/table";
|
|
19
|
+
import { S as j } from "../../chunks/SortOrder-CwuehjY1.es.js";
|
|
20
20
|
import { E as $e } from "../../chunks/Empty-BReVQKje.es.js";
|
|
21
|
-
const
|
|
22
|
-
filters:
|
|
23
|
-
params:
|
|
24
|
-
onFilter:
|
|
25
|
-
className:
|
|
26
|
-
...
|
|
21
|
+
const ye = me(function({
|
|
22
|
+
filters: m,
|
|
23
|
+
params: E,
|
|
24
|
+
onFilter: c,
|
|
25
|
+
className: w,
|
|
26
|
+
...z
|
|
27
27
|
}) {
|
|
28
|
-
const { t:
|
|
29
|
-
() => Object.fromEntries(
|
|
30
|
-
|
|
28
|
+
const { t: T } = b(), s = we(
|
|
29
|
+
() => Object.fromEntries(
|
|
30
|
+
(m == null ? void 0 : m.map((i) => {
|
|
31
|
+
var x;
|
|
32
|
+
return [
|
|
33
|
+
i.name,
|
|
34
|
+
Object.fromEntries(
|
|
35
|
+
((x = i.options) == null ? void 0 : x.map(({ label: t, value: g }) => [g, t])) || []
|
|
36
|
+
)
|
|
37
|
+
];
|
|
38
|
+
})) || []
|
|
39
|
+
),
|
|
40
|
+
[m]
|
|
31
41
|
);
|
|
32
|
-
return /* @__PURE__ */ e("div", { ...
|
|
33
|
-
([
|
|
34
|
-
|
|
35
|
-
{
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
42
|
+
return /* @__PURE__ */ e("div", { ...z, className: W("flex flex-wrap gap-2", w), children: Object.entries(E || {}).filter(([i, x]) => !!(s != null && s[i]) && !M.isEmpty(x)).map(
|
|
43
|
+
([i, x]) => {
|
|
44
|
+
var t;
|
|
45
|
+
return Array.isArray(x) ? /* @__PURE__ */ e(Me, { children: x.filter((g) => {
|
|
46
|
+
var L;
|
|
47
|
+
return ((L = s == null ? void 0 : s[i]) == null ? void 0 : L[g]) && g;
|
|
48
|
+
}).map((g, L) => {
|
|
49
|
+
var p;
|
|
50
|
+
return /* @__PURE__ */ N(
|
|
51
|
+
q,
|
|
52
|
+
{
|
|
53
|
+
size: "sm",
|
|
54
|
+
onClick: () => {
|
|
55
|
+
c == null || c({
|
|
56
|
+
...E,
|
|
57
|
+
[i]: x.filter((A) => A !== g)
|
|
58
|
+
});
|
|
59
|
+
},
|
|
60
|
+
children: [
|
|
61
|
+
T(String(((p = s == null ? void 0 : s[i]) == null ? void 0 : p[g]) || "")),
|
|
62
|
+
" ",
|
|
63
|
+
/* @__PURE__ */ e(Z, {})
|
|
64
|
+
]
|
|
65
|
+
},
|
|
66
|
+
L
|
|
67
|
+
);
|
|
68
|
+
}) }, i) : /* @__PURE__ */ N(
|
|
69
|
+
q,
|
|
70
|
+
{
|
|
71
|
+
size: "sm",
|
|
72
|
+
onClick: () => {
|
|
73
|
+
c == null || c(M.omit(E, i));
|
|
74
|
+
},
|
|
75
|
+
children: [
|
|
76
|
+
T(String(((t = s == null ? void 0 : s[i]) == null ? void 0 : t[x]) || "")),
|
|
77
|
+
" ",
|
|
78
|
+
/* @__PURE__ */ e(Z, {})
|
|
79
|
+
]
|
|
80
|
+
}
|
|
81
|
+
);
|
|
82
|
+
}
|
|
64
83
|
) });
|
|
65
84
|
}), He = ({
|
|
66
|
-
rows:
|
|
67
|
-
columns:
|
|
68
|
-
onRowClick:
|
|
69
|
-
rowKey:
|
|
70
|
-
params:
|
|
85
|
+
rows: l = [],
|
|
86
|
+
columns: m,
|
|
87
|
+
onRowClick: E,
|
|
88
|
+
rowKey: c,
|
|
89
|
+
params: w = {
|
|
71
90
|
page: 1,
|
|
72
|
-
limit:
|
|
91
|
+
limit: I
|
|
73
92
|
},
|
|
74
|
-
hasNumbers:
|
|
75
|
-
hasCheckbox:
|
|
76
|
-
selectedItems:
|
|
77
|
-
onSelectedItemsChange:
|
|
78
|
-
onSortOrderChange:
|
|
79
|
-
isStickyHeader:
|
|
80
|
-
className:
|
|
81
|
-
...
|
|
93
|
+
hasNumbers: z = !1,
|
|
94
|
+
hasCheckbox: T = !1,
|
|
95
|
+
selectedItems: s,
|
|
96
|
+
onSelectedItemsChange: i,
|
|
97
|
+
onSortOrderChange: x,
|
|
98
|
+
isStickyHeader: t,
|
|
99
|
+
className: g,
|
|
100
|
+
...L
|
|
82
101
|
}) => {
|
|
83
|
-
const { sortObject: p, handleSort:
|
|
84
|
-
sortField:
|
|
85
|
-
sortOrder:
|
|
86
|
-
onSortOrderChange:
|
|
102
|
+
const { sortObject: p, handleSort: A } = ge({
|
|
103
|
+
sortField: w == null ? void 0 : w.sortField,
|
|
104
|
+
sortOrder: w == null ? void 0 : w.sortOrder,
|
|
105
|
+
onSortOrderChange: x
|
|
87
106
|
}), {
|
|
88
|
-
selectedRows:
|
|
89
|
-
isRowSelected:
|
|
90
|
-
isAllRowsSelected:
|
|
107
|
+
selectedRows: R,
|
|
108
|
+
isRowSelected: D,
|
|
109
|
+
isAllRowsSelected: k,
|
|
91
110
|
handleSelectAllRows: J,
|
|
92
|
-
handleSelectRow:
|
|
93
|
-
} =
|
|
94
|
-
return
|
|
95
|
-
JSON.stringify(
|
|
96
|
-
}, [
|
|
111
|
+
handleSelectRow: o
|
|
112
|
+
} = Ee({ rows: l, defaultSelectedRows: s });
|
|
113
|
+
return Q(() => {
|
|
114
|
+
JSON.stringify(s) !== JSON.stringify(R) && R && (i == null || i(R));
|
|
115
|
+
}, [R, s, i]), /* @__PURE__ */ N(We, { ...L, className: W("relative", g), children: [
|
|
97
116
|
/* @__PURE__ */ e(
|
|
98
|
-
|
|
117
|
+
oe,
|
|
99
118
|
{
|
|
100
|
-
className:
|
|
101
|
-
children: /* @__PURE__ */
|
|
102
|
-
|
|
103
|
-
|
|
119
|
+
className: W("bg-bg", t && "sticky top-0 z-1"),
|
|
120
|
+
children: /* @__PURE__ */ N(G, { children: [
|
|
121
|
+
T && /* @__PURE__ */ e(X, { className: "w-12 p-3", children: /* @__PURE__ */ e(
|
|
122
|
+
U,
|
|
104
123
|
{
|
|
105
124
|
className: "mt-1",
|
|
106
|
-
checked:
|
|
107
|
-
onCheckedChange: (
|
|
125
|
+
checked: k(c),
|
|
126
|
+
onCheckedChange: (d) => J(c, !!d),
|
|
108
127
|
"aria-label": "Select all"
|
|
109
128
|
}
|
|
110
129
|
) }),
|
|
111
|
-
|
|
112
|
-
|
|
130
|
+
z && /* @__PURE__ */ e(X, { className: "w-12 p-2", children: "#" }),
|
|
131
|
+
m.filter((d) => !d.hidden).map((d) => /* @__PURE__ */ e(
|
|
113
132
|
X,
|
|
114
133
|
{
|
|
115
|
-
style:
|
|
116
|
-
className:
|
|
117
|
-
onClick: () =>
|
|
118
|
-
children: /* @__PURE__ */
|
|
119
|
-
|
|
134
|
+
style: d.styles,
|
|
135
|
+
className: W("p-2", d.sortable && "cursor-pointer"),
|
|
136
|
+
onClick: () => d.sortable && A(d.dataIndex),
|
|
137
|
+
children: /* @__PURE__ */ N("div", { className: "flex items-center gap-2", children: [
|
|
138
|
+
d.name,
|
|
120
139
|
" ",
|
|
121
|
-
|
|
122
|
-
(p == null ? void 0 : p.sortOrder) ===
|
|
123
|
-
(p == null ? void 0 : p.sortOrder) ===
|
|
124
|
-
] }) : /* @__PURE__ */ e(
|
|
140
|
+
d.sortable && ((p == null ? void 0 : p.sortField) === d.key ? /* @__PURE__ */ N(O, { children: [
|
|
141
|
+
(p == null ? void 0 : p.sortOrder) === j.DESC && /* @__PURE__ */ e(pe, { size: 15 }),
|
|
142
|
+
(p == null ? void 0 : p.sortOrder) === j.ASC && /* @__PURE__ */ e(Ne, { size: 15 })
|
|
143
|
+
] }) : /* @__PURE__ */ e(ce, { size: 15 }))
|
|
125
144
|
] })
|
|
126
145
|
},
|
|
127
|
-
|
|
146
|
+
d.key
|
|
128
147
|
))
|
|
129
148
|
] })
|
|
130
149
|
}
|
|
131
150
|
),
|
|
132
|
-
/* @__PURE__ */ e(Be, { className: "[&>tr:nth-child(even)]:bg-bg-secondary", children:
|
|
151
|
+
/* @__PURE__ */ e(Be, { className: "[&>tr:nth-child(even)]:bg-bg-secondary", children: l.length ? l.map((d, B) => /* @__PURE__ */ N(
|
|
133
152
|
G,
|
|
134
153
|
{
|
|
135
|
-
onClick: () =>
|
|
136
|
-
className:
|
|
137
|
-
"data-state":
|
|
154
|
+
onClick: () => E == null ? void 0 : E(d),
|
|
155
|
+
className: W(E && "cursor-pointer"),
|
|
156
|
+
"data-state": D(d[c]) && "selected",
|
|
138
157
|
children: [
|
|
139
|
-
|
|
158
|
+
T && /* @__PURE__ */ e(
|
|
140
159
|
H,
|
|
141
160
|
{
|
|
142
161
|
className: "w-12 p-3",
|
|
143
|
-
onClick: (
|
|
162
|
+
onClick: (r) => r.stopPropagation(),
|
|
144
163
|
children: /* @__PURE__ */ e(
|
|
145
|
-
|
|
164
|
+
U,
|
|
146
165
|
{
|
|
147
166
|
className: "mt-1",
|
|
148
|
-
checked:
|
|
149
|
-
onCheckedChange: (
|
|
167
|
+
checked: D(d[c]),
|
|
168
|
+
onCheckedChange: (r) => o(d[c], !!r),
|
|
150
169
|
"aria-label": "Select row"
|
|
151
170
|
}
|
|
152
171
|
)
|
|
153
172
|
}
|
|
154
173
|
),
|
|
155
|
-
|
|
156
|
-
|
|
174
|
+
z && /* @__PURE__ */ e(H, { className: "w-12 p-2", children: (w.page - 1) * (w.limit || I) + B + 1 }),
|
|
175
|
+
m.filter((r) => !r.hidden).map((r) => /* @__PURE__ */ e(
|
|
157
176
|
H,
|
|
158
177
|
{
|
|
159
178
|
className: "text-body-xs-medium max-w-xs p-2",
|
|
160
|
-
style:
|
|
161
|
-
children:
|
|
179
|
+
style: r.styles,
|
|
180
|
+
children: r.render ? r.render(M.get(d, r.dataIndex), d) : M.get(d, r.dataIndex, "")
|
|
162
181
|
},
|
|
163
|
-
`${B}-${
|
|
182
|
+
`${B}-${r.key}`
|
|
164
183
|
))
|
|
165
184
|
]
|
|
166
185
|
},
|
|
167
|
-
`${
|
|
186
|
+
`${d[c]}`
|
|
168
187
|
)) : /* @__PURE__ */ e(G, { children: /* @__PURE__ */ e(
|
|
169
188
|
H,
|
|
170
189
|
{
|
|
171
|
-
colSpan:
|
|
190
|
+
colSpan: z ? T ? m.length + 2 : m.length + 1 : m.length,
|
|
172
191
|
children: /* @__PURE__ */ e($e, {})
|
|
173
192
|
}
|
|
174
193
|
) }) })
|
|
175
194
|
] });
|
|
176
195
|
}, Ce = ({
|
|
177
|
-
dataSource:
|
|
178
|
-
columns:
|
|
179
|
-
onRowClick:
|
|
180
|
-
rowKey:
|
|
181
|
-
hasNumbers:
|
|
182
|
-
hasSearch:
|
|
183
|
-
exportOptions:
|
|
184
|
-
hasCheckbox:
|
|
185
|
-
hasPagination:
|
|
186
|
-
isStickyHeader:
|
|
187
|
-
onParamChange:
|
|
188
|
-
dataKey:
|
|
189
|
-
loading:
|
|
196
|
+
dataSource: l,
|
|
197
|
+
columns: m,
|
|
198
|
+
onRowClick: E,
|
|
199
|
+
rowKey: c,
|
|
200
|
+
hasNumbers: w,
|
|
201
|
+
hasSearch: z,
|
|
202
|
+
exportOptions: T,
|
|
203
|
+
hasCheckbox: s,
|
|
204
|
+
hasPagination: i,
|
|
205
|
+
isStickyHeader: x,
|
|
206
|
+
onParamChange: t,
|
|
207
|
+
dataKey: g = "docs",
|
|
208
|
+
loading: L,
|
|
190
209
|
tableKey: p,
|
|
191
|
-
filters:
|
|
192
|
-
actions:
|
|
193
|
-
handleFilterChange:
|
|
194
|
-
params:
|
|
210
|
+
filters: A,
|
|
211
|
+
actions: R,
|
|
212
|
+
handleFilterChange: D,
|
|
213
|
+
params: k,
|
|
195
214
|
exportLoading: J = !1,
|
|
196
|
-
onColumnsUpdate:
|
|
197
|
-
hasColumnsVisibilityDropdown:
|
|
215
|
+
onColumnsUpdate: o,
|
|
216
|
+
hasColumnsVisibilityDropdown: d,
|
|
198
217
|
showAppliedFilters: B = !1,
|
|
199
|
-
onSelectedItemsChange:
|
|
218
|
+
onSelectedItemsChange: r,
|
|
200
219
|
actionProps: K,
|
|
201
220
|
filterWrapperProps: F,
|
|
202
221
|
exportOptionsProps: S,
|
|
203
|
-
columnsVisibilityProps:
|
|
222
|
+
columnsVisibilityProps: n,
|
|
204
223
|
paginationProps: u,
|
|
205
|
-
searchProps:
|
|
224
|
+
searchProps: v,
|
|
206
225
|
...V
|
|
207
226
|
}) => {
|
|
208
|
-
var
|
|
209
|
-
const { t:
|
|
210
|
-
return
|
|
211
|
-
|
|
212
|
-
}, [
|
|
213
|
-
|
|
214
|
-
}, [$,
|
|
227
|
+
var Y;
|
|
228
|
+
const { t: _ } = b(), [$, a] = ne([]), { formattedColumns: y, handleColumnsChange: C, resetColumns: P } = Te({ key: p, columns: m });
|
|
229
|
+
return Q(() => {
|
|
230
|
+
o == null || o(y);
|
|
231
|
+
}, [y, o]), Q(() => {
|
|
232
|
+
r == null || r($);
|
|
233
|
+
}, [$, r]), /* @__PURE__ */ N(
|
|
215
234
|
"div",
|
|
216
235
|
{
|
|
217
|
-
className: "border-border-alpha-light flex grow flex-col
|
|
236
|
+
className: "border-border-alpha-light flex grow flex-col overflow-auto rounded-xl border shadow-xs",
|
|
218
237
|
children: [
|
|
219
|
-
|
|
220
|
-
/* @__PURE__ */
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
) }),
|
|
236
|
-
/* @__PURE__ */ c(
|
|
237
|
-
"div",
|
|
238
|
-
{
|
|
239
|
-
className: "flex w-full shrink-0 items-center justify-end gap-3 lg:w-auto",
|
|
240
|
-
children: [
|
|
241
|
-
k && /* @__PURE__ */ e(
|
|
242
|
-
Ee,
|
|
243
|
-
{
|
|
244
|
-
...S,
|
|
245
|
-
options: k,
|
|
246
|
-
loading: J
|
|
247
|
-
}
|
|
238
|
+
/* @__PURE__ */ N("div", { className: "space-y-4 p-4", children: [
|
|
239
|
+
(z || d && p || !M.isEmpty(T) || !M.isEmpty(A)) && /* @__PURE__ */ N("div", { className: "flex shrink-0 flex-col items-center justify-between gap-3 lg:flex-row", children: [
|
|
240
|
+
/* @__PURE__ */ e("div", { className: "w-full shrink", children: z && /* @__PURE__ */ e(
|
|
241
|
+
ve,
|
|
242
|
+
{
|
|
243
|
+
...v,
|
|
244
|
+
inputProps: {
|
|
245
|
+
...v == null ? void 0 : v.inputProps,
|
|
246
|
+
className: W(
|
|
247
|
+
"h-8 grow",
|
|
248
|
+
(Y = v == null ? void 0 : v.inputProps) == null ? void 0 : Y.className
|
|
249
|
+
)
|
|
250
|
+
},
|
|
251
|
+
className: W(
|
|
252
|
+
"max-w-full lg:max-w-78 [&_button]:-top-1",
|
|
253
|
+
v == null ? void 0 : v.className
|
|
248
254
|
),
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
255
|
+
defaultValue: M.get(k, "search", ""),
|
|
256
|
+
onSearchChange: (f) => t == null ? void 0 : t({ ...k, search: f, page: 1 })
|
|
257
|
+
}
|
|
258
|
+
) }),
|
|
259
|
+
/* @__PURE__ */ N(
|
|
260
|
+
"div",
|
|
261
|
+
{
|
|
262
|
+
className: "flex w-full shrink-0 items-center justify-end gap-3 lg:w-auto",
|
|
263
|
+
children: [
|
|
264
|
+
T && /* @__PURE__ */ e(
|
|
265
|
+
ke,
|
|
252
266
|
{
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
children: /* @__PURE__ */ e(
|
|
257
|
-
b,
|
|
258
|
-
{
|
|
259
|
-
variant: "secondary",
|
|
260
|
-
size: "sm",
|
|
261
|
-
className: "ml-auto rounded-lg px-3",
|
|
262
|
-
children: (w == null ? void 0 : w.title) || /* @__PURE__ */ c(I, { children: [
|
|
263
|
-
/* @__PURE__ */ e(ee, {}),
|
|
264
|
-
" ",
|
|
265
|
-
/* @__PURE__ */ e("span", { className: "hidden md:inline!", children: O("Customize columns") }),
|
|
266
|
-
/* @__PURE__ */ e(te, {})
|
|
267
|
-
] })
|
|
268
|
-
}
|
|
269
|
-
)
|
|
267
|
+
...S,
|
|
268
|
+
options: T,
|
|
269
|
+
loading: J
|
|
270
270
|
}
|
|
271
271
|
),
|
|
272
|
-
/* @__PURE__ */
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
272
|
+
d && p && /* @__PURE__ */ N(le, { children: [
|
|
273
|
+
/* @__PURE__ */ e(
|
|
274
|
+
de,
|
|
275
|
+
{
|
|
276
|
+
asChild: !0,
|
|
277
|
+
className: "grow",
|
|
278
|
+
...n == null ? void 0 : n.triggerProps,
|
|
279
|
+
children: /* @__PURE__ */ e(
|
|
280
|
+
q,
|
|
280
281
|
{
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
282
|
+
variant: "secondary",
|
|
283
|
+
size: "sm",
|
|
284
|
+
className: "ml-auto rounded-lg px-3",
|
|
285
|
+
children: (n == null ? void 0 : n.title) || /* @__PURE__ */ N(O, { children: [
|
|
286
|
+
/* @__PURE__ */ e(ee, {}),
|
|
285
287
|
" ",
|
|
286
|
-
|
|
287
|
-
|
|
288
|
+
/* @__PURE__ */ e("span", { className: "hidden md:inline!", children: _("Customize columns") }),
|
|
289
|
+
/* @__PURE__ */ e(te, {})
|
|
290
|
+
] })
|
|
288
291
|
}
|
|
289
|
-
)
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
292
|
+
)
|
|
293
|
+
}
|
|
294
|
+
),
|
|
295
|
+
/* @__PURE__ */ N(
|
|
296
|
+
se,
|
|
297
|
+
{
|
|
298
|
+
align: "end",
|
|
299
|
+
...n == null ? void 0 : n.contentProps,
|
|
300
|
+
children: [
|
|
301
|
+
/* @__PURE__ */ N(
|
|
302
|
+
ie,
|
|
303
|
+
{
|
|
304
|
+
className: "capitalize",
|
|
305
|
+
onClick: P,
|
|
306
|
+
children: [
|
|
307
|
+
/* @__PURE__ */ e(xe, {}),
|
|
308
|
+
" ",
|
|
309
|
+
(n == null ? void 0 : n.resetText) || _("Reset columns")
|
|
310
|
+
]
|
|
311
|
+
}
|
|
312
|
+
),
|
|
313
|
+
/* @__PURE__ */ e(fe, {}),
|
|
314
|
+
y.map((f) => /* @__PURE__ */ e(
|
|
315
|
+
re,
|
|
316
|
+
{
|
|
317
|
+
className: "capitalize",
|
|
318
|
+
checked: !f.hidden,
|
|
319
|
+
onCheckedChange: (h) => C(f, !h),
|
|
320
|
+
children: f.name
|
|
321
|
+
},
|
|
322
|
+
f.key
|
|
323
|
+
))
|
|
324
|
+
]
|
|
325
|
+
}
|
|
326
|
+
)
|
|
327
|
+
] }),
|
|
328
|
+
R && /* @__PURE__ */ e(De, { ...K, actions: R }),
|
|
329
|
+
A && /* @__PURE__ */ e(
|
|
330
|
+
Ae,
|
|
331
|
+
{
|
|
332
|
+
...F,
|
|
333
|
+
filters: A,
|
|
334
|
+
params: k,
|
|
335
|
+
onChange: D,
|
|
336
|
+
onFilter: (f) => {
|
|
337
|
+
t == null || t({ ...f, page: 1 }), D == null || D(f);
|
|
338
|
+
}
|
|
302
339
|
}
|
|
303
340
|
)
|
|
304
|
-
]
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
}
|
|
317
|
-
)
|
|
318
|
-
]
|
|
341
|
+
]
|
|
342
|
+
}
|
|
343
|
+
)
|
|
344
|
+
] }),
|
|
345
|
+
B && !M.isEmpty(A) && /* @__PURE__ */ e(
|
|
346
|
+
ye,
|
|
347
|
+
{
|
|
348
|
+
filters: A,
|
|
349
|
+
params: k,
|
|
350
|
+
onFilter: (f) => {
|
|
351
|
+
t == null || t({ ...f, page: 1 }), D == null || D(f);
|
|
352
|
+
}
|
|
319
353
|
}
|
|
320
354
|
)
|
|
321
355
|
] }),
|
|
322
|
-
|
|
323
|
-
je,
|
|
324
|
-
{
|
|
325
|
-
filters: M,
|
|
326
|
-
params: n,
|
|
327
|
-
onFilter: (f) => {
|
|
328
|
-
d == null || d({ ...f, page: 1 }), T == null || T(f);
|
|
329
|
-
}
|
|
330
|
-
}
|
|
331
|
-
),
|
|
332
|
-
/* @__PURE__ */ e("div", { className: "flex flex-col overflow-auto border-y", children: W ? /* @__PURE__ */ e(ze, {}) : /* @__PURE__ */ e(
|
|
356
|
+
/* @__PURE__ */ e("div", { className: "flex flex-col overflow-auto border-y", children: L ? /* @__PURE__ */ e(ze, {}) : /* @__PURE__ */ e(
|
|
333
357
|
He,
|
|
334
358
|
{
|
|
335
359
|
...V,
|
|
336
360
|
params: {
|
|
337
|
-
page: (
|
|
338
|
-
limit:
|
|
339
|
-
...
|
|
361
|
+
page: (l == null ? void 0 : l.page) || 1,
|
|
362
|
+
limit: l == null ? void 0 : l.limit,
|
|
363
|
+
...k
|
|
340
364
|
},
|
|
341
|
-
rows:
|
|
342
|
-
rowKey:
|
|
365
|
+
rows: M.get(l, g, []),
|
|
366
|
+
rowKey: c,
|
|
343
367
|
selectedItems: $,
|
|
344
|
-
isStickyHeader:
|
|
345
|
-
columns:
|
|
346
|
-
hasCheckbox:
|
|
347
|
-
hasNumbers:
|
|
348
|
-
onRowClick:
|
|
368
|
+
isStickyHeader: x,
|
|
369
|
+
columns: y,
|
|
370
|
+
hasCheckbox: s,
|
|
371
|
+
hasNumbers: w,
|
|
372
|
+
onRowClick: E,
|
|
349
373
|
onSelectedItemsChange: a,
|
|
350
|
-
onSortOrderChange: ({ sortField: f, sortOrder:
|
|
351
|
-
|
|
374
|
+
onSortOrderChange: ({ sortField: f, sortOrder: h }) => {
|
|
375
|
+
t == null || t({ ...k, sortField: f, sortOrder: h });
|
|
352
376
|
}
|
|
353
377
|
}
|
|
354
378
|
) }),
|
|
355
|
-
|
|
379
|
+
i && /* @__PURE__ */ N("div", { className: "flex shrink-0 flex-wrap items-center justify-center gap-3 p-4 lg:justify-between", children: [
|
|
356
380
|
/* @__PURE__ */ e("div", { className: "text-sm", children: /* @__PURE__ */ e(
|
|
357
381
|
Le,
|
|
358
382
|
{
|
|
359
|
-
onLimitChange: (f) =>
|
|
360
|
-
defaultValue:
|
|
383
|
+
onLimitChange: (f) => t == null ? void 0 : t({ ...k, limit: f, page: 1 }),
|
|
384
|
+
defaultValue: l == null ? void 0 : l.limit
|
|
361
385
|
}
|
|
362
386
|
) }),
|
|
363
|
-
/* @__PURE__ */ e("div", { className: "text-muted-foreground text-sm", children:
|
|
387
|
+
/* @__PURE__ */ e("div", { className: "text-muted-foreground text-sm", children: _("{{selectedCount}} of {{total}} row(s) selected", {
|
|
364
388
|
selectedCount: $.length,
|
|
365
|
-
total: (
|
|
389
|
+
total: (l == null ? void 0 : l.total) || 0
|
|
366
390
|
}) }),
|
|
367
391
|
/* @__PURE__ */ e("div", { children: /* @__PURE__ */ e(
|
|
368
392
|
Re,
|
|
369
393
|
{
|
|
370
394
|
...u,
|
|
371
|
-
onPageChange: (f) =>
|
|
372
|
-
currentPage:
|
|
373
|
-
totalPages:
|
|
395
|
+
onPageChange: (f) => t == null ? void 0 : t({ ...k, page: f }),
|
|
396
|
+
currentPage: l == null ? void 0 : l.page,
|
|
397
|
+
totalPages: l == null ? void 0 : l.totalPages
|
|
374
398
|
}
|
|
375
399
|
) })
|
|
376
400
|
] })
|
|
@@ -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, omit } from 'lodash';\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 FilterWrapper 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 * FilterWrapper shows a popover with a dynamic list of field filters and emits selected filter values.\n *\n * @param props.filters - Array of filter definitions to render.\n * @param props.params - Current params used to detect active filters.\n * @param props.onFilter - Callback fired when user applies filters.\n * @param props.onCancel - Callback fired on cancel.\n * @param props.onChange - Callback fired whenever filter form values change.\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(filters?.map((filter) => [filter.name, filter]) || []),\n [filters]\n );\n\n return (\n <div {...props} className={cn('flex flex-wrap gap-2', className)}>\n {Object.entries(params || {})\n .filter(([key, value]) => !!filterObject?.[key] && !isEmpty(value))\n .map(([key, value]) =>\n Array.isArray(value) ? (\n <ButtonGroup key={key}>\n {value.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(val)} <XIcon />\n </Button>\n ))}\n </ButtonGroup>\n ) : (\n <Button\n size={'sm'}\n onClick={() => {\n onFilter?.(omit(params, key));\n }}\n >\n {t(String(value || ''))} <XIcon />\n </Button>\n )\n )}\n </div>\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';\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 props - Component props.\n * @returns 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 if (\n JSON.stringify(selectedItems) !== JSON.stringify(selectedRows) &&\n selectedRows\n ) {\n onSelectedItemsChange?.(selectedRows);\n }\n }, [selectedRows, selectedItems, onSelectedItemsChange]);\n\n return (\n <Table {...props} className={cn('relative', className)}>\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, isEmpty } from 'lodash';\nimport { RefreshCw } from 'lucide-react';\nimport { type ReactNode, useEffect, useState } 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 * Props Overview\n * - `dataSource` — Paginated data source object that contains rows (see `dataKey`) and pagination metadata.\n * - `columns` — Column definitions passed to `MyTable`.\n * - `onRowClick` — Callback when a row is clicked.\n * - `rowKey` — Property name used as a unique row key.\n * - `hasNumbers` — Whether to show the row numbers column.\n * - `hasSearch` — Set to `true` to display the search input in the header.\n * - `exportOptions` — Export menu options shown by `ExportData` (see `ExportDataInterface[]`).\n * - `exportLoading` — When `true`, shows a spinner in the Export button to indicate an export action is in progress.\n * - `hasCheckbox` — Whether to show the selection checkbox column.\n * - `hasPagination` — Set to `true` to render the pagination footer.\n * - `isStickyHeader` — Whether to keep the table header sticky.\n * - `onParamChange` — Emits parameter changes for pagination/sorting/search/filters.\n * - `dataKey` — Key within `dataSource` that contains the row array. Defaults to `\"docs\"`.\n * - `loading` — If `true`, shows a loading state instead of the table rows.\n * - `tableKey` — Unique key for persisting column visibility state.\n * - `filters` — Filter configurations to render in the header.\n * - `actions` — Header actions independent of selected rows.\n * - `handleFilterChange` — Callback executed when filter values change.\n * - `params` — Current list parameters (pagination, sort, search, filters).\n * - `hasColumnsVisibilityDropdown` — Set to `true` to show the columns customize dropdown.\n * - `onColumnsUpdate` — Notifies parent whenever the internal columns state changes (after formatting/visibility).\n * - `actionProps` — Props passed to the `Actions` component.\n * - `filterWrapperProps` — Props passed to the `FilterWrapper` component.\n * - `exportOptionsProps` — Props passed to the `ExportData` component.\n * - `columnsVisibilityProps` — Props passed to the columns visibility dropdown.\n * - `onSelectedItemsChange` — Callback when selected rows change (requires `hasCheckbox`).\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 * Returns\n * - 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 onRowClick,\n rowKey,\n hasNumbers,\n hasSearch,\n exportOptions,\n hasCheckbox,\n hasPagination,\n isStickyHeader,\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 onSelectedItemsChange,\n actionProps,\n filterWrapperProps,\n exportOptionsProps,\n columnsVisibilityProps,\n paginationProps,\n searchProps,\n ...props\n}: DataTableProps<TData, TPaginationData>) => {\n const { t } = useTranslation();\n const [selectedRows, setSelectedRows] = useState<TData[keyof TData][]>([]);\n const { formattedColumns, handleColumnsChange, resetColumns } =\n useColumns<TData>({ key: tableKey, columns });\n\n useEffect(() => {\n onColumnsUpdate?.(formattedColumns);\n }, [formattedColumns, onColumnsUpdate]);\n\n useEffect(() => {\n onSelectedItemsChange?.(selectedRows);\n }, [selectedRows, onSelectedItemsChange]);\n\n return (\n <div\n className={\n 'border-border-alpha-light flex grow flex-col space-y-4 overflow-auto rounded-xl border p-4 shadow-xs'\n }\n >\n {(hasSearch ||\n (hasColumnsVisibilityDropdown && tableKey) ||\n !isEmpty(exportOptions) ||\n !isEmpty(filters)) && (\n <div className=\"flex shrink-0 flex-col items-center justify-between gap-3 lg:flex-row\">\n <div className={'w-full shrink'}>\n {hasSearch && (\n <Search\n {...searchProps}\n inputProps={{\n ...searchProps?.inputProps,\n className: cn('h-8 grow', searchProps?.inputProps?.className),\n }}\n className={cn(\n 'max-w-full lg:max-w-78 [&_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\n className={\n 'flex w-full shrink-0 items-center justify-end gap-3 lg:w-auto'\n }\n >\n {exportOptions && (\n <ExportData\n {...exportOptionsProps}\n options={exportOptions}\n loading={exportLoading}\n />\n )}\n {hasColumnsVisibilityDropdown && tableKey && (\n <DropdownMenu>\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 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 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 className={'flex 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 selectedItems={selectedRows}\n isStickyHeader={isStickyHeader}\n columns={formattedColumns}\n hasCheckbox={hasCheckbox}\n hasNumbers={hasNumbers}\n onRowClick={onRowClick}\n onSelectedItemsChange={setSelectedRows}\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: selectedRows.length,\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","jsx","cn","key","value","isEmpty","ButtonGroup","val","index","jsxs","Button","v","XIcon","omit","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","setSelectedRows","useState","formattedColumns","handleColumnsChange","resetColumns","useColumns","Search","_a","search","ExportData","DropdownMenu","DropdownMenuTrigger","RiLayoutColumnLine","RiArrowDownSLine","DropdownMenuContent","DropdownMenuItem","RefreshCw","DropdownMenuSeparator","DropdownMenuCheckboxItem","Actions","FilterWrapper","Loader","sortField","sortOrder","MyLimitSelect","limit","MyPagination","page"],"mappings":";;;;;;;;;;;;;;;;;;;;AA+BO,MAAMA,KAAiBC,GAAK,SAAuB;AAAA,EACxD,SAAAC;AAAA,EACA,QAAAC;AAAA,EACA,UAAAC;AAAA,EACA,WAAAC;AAAA,EACA,GAAGC;AACL,GAAwB;AACtB,QAAM,EAAE,GAAAC,EAAA,IAAMC,EAAA,GAERC,IAAeC;AAAA,IACnB,MACE,OAAO,aAAYR,KAAA,gBAAAA,EAAS,IAAI,CAACS,MAAW,CAACA,EAAO,MAAMA,CAAM,OAAM,CAAA,CAAE;AAAA,IAC1E,CAACT,CAAO;AAAA,EAAA;AAGV,SACE,gBAAAU,EAAC,OAAA,EAAK,GAAGN,GAAO,WAAWO,EAAG,wBAAwBR,CAAS,GAC5D,UAAA,OAAO,QAAQF,KAAU,EAAE,EACzB,OAAO,CAAC,CAACW,GAAKC,CAAK,MAAM,CAAC,EAACN,KAAA,QAAAA,EAAeK,OAAQ,CAACE,EAAAA,QAAQD,CAAK,CAAC,EACjE;AAAA,IAAI,CAAC,CAACD,GAAKC,CAAK,MACf,MAAM,QAAQA,CAAK,sBAChBE,IAAA,EACE,UAAAF,EAAM,IAAI,CAACG,GAAKC,MACf,gBAAAC;AAAA,MAACC;AAAA,MAAA;AAAA,QACC,MAAM;AAAA,QAEN,SAAS,MAAM;AACb,UAAAjB,KAAA,QAAAA,EAAW;AAAA,YACT,GAAGD;AAAA,YACH,CAACW,CAAG,GAAGC,EAAM,OA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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, omit } from 'lodash';\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 FilterWrapper 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 * FilterWrapper shows a popover with a dynamic list of field filters and emits selected filter values.\n *\n * @param props.filters - Array of filter definitions to render.\n * @param props.params - Current params used to detect active filters.\n * @param props.onFilter - Callback fired when user applies filters.\n * @param props.onCancel - Callback fired on cancel.\n * @param props.onChange - Callback fired whenever filter form values change.\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 return (\n <div {...props} className={cn('flex flex-wrap gap-2', className)}>\n {Object.entries(params || {})\n .filter(([key, value]) => !!filterObject?.[key] && !isEmpty(value))\n .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 onFilter?.(omit(params, key));\n }}\n >\n {t(String(filterObject?.[key]?.[value as string] || ''))}{' '}\n <XIcon />\n </Button>\n )\n )}\n </div>\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';\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 props - Component props.\n * @returns 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 if (\n JSON.stringify(selectedItems) !== JSON.stringify(selectedRows) &&\n selectedRows\n ) {\n onSelectedItemsChange?.(selectedRows);\n }\n }, [selectedRows, selectedItems, onSelectedItemsChange]);\n\n return (\n <Table {...props} className={cn('relative', className)}>\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, isEmpty } from 'lodash';\nimport { RefreshCw } from 'lucide-react';\nimport { type ReactNode, useEffect, useState } 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 * Props Overview\n * - `dataSource` — Paginated data source object that contains rows (see `dataKey`) and pagination metadata.\n * - `columns` — Column definitions passed to `MyTable`.\n * - `onRowClick` — Callback when a row is clicked.\n * - `rowKey` — Property name used as a unique row key.\n * - `hasNumbers` — Whether to show the row numbers column.\n * - `hasSearch` — Set to `true` to display the search input in the header.\n * - `exportOptions` — Export menu options shown by `ExportData` (see `ExportDataInterface[]`).\n * - `exportLoading` — When `true`, shows a spinner in the Export button to indicate an export action is in progress.\n * - `hasCheckbox` — Whether to show the selection checkbox column.\n * - `hasPagination` — Set to `true` to render the pagination footer.\n * - `isStickyHeader` — Whether to keep the table header sticky.\n * - `onParamChange` — Emits parameter changes for pagination/sorting/search/filters.\n * - `dataKey` — Key within `dataSource` that contains the row array. Defaults to `\"docs\"`.\n * - `loading` — If `true`, shows a loading state instead of the table rows.\n * - `tableKey` — Unique key for persisting column visibility state.\n * - `filters` — Filter configurations to render in the header.\n * - `actions` — Header actions independent of selected rows.\n * - `handleFilterChange` — Callback executed when filter values change.\n * - `params` — Current list parameters (pagination, sort, search, filters).\n * - `hasColumnsVisibilityDropdown` — Set to `true` to show the columns customize dropdown.\n * - `onColumnsUpdate` — Notifies parent whenever the internal columns state changes (after formatting/visibility).\n * - `actionProps` — Props passed to the `Actions` component.\n * - `filterWrapperProps` — Props passed to the `FilterWrapper` component.\n * - `exportOptionsProps` — Props passed to the `ExportData` component.\n * - `columnsVisibilityProps` — Props passed to the columns visibility dropdown.\n * - `onSelectedItemsChange` — Callback when selected rows change (requires `hasCheckbox`).\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 * Returns\n * - 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 onRowClick,\n rowKey,\n hasNumbers,\n hasSearch,\n exportOptions,\n hasCheckbox,\n hasPagination,\n isStickyHeader,\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 onSelectedItemsChange,\n actionProps,\n filterWrapperProps,\n exportOptionsProps,\n columnsVisibilityProps,\n paginationProps,\n searchProps,\n ...props\n}: DataTableProps<TData, TPaginationData>) => {\n const { t } = useTranslation();\n const [selectedRows, setSelectedRows] = useState<TData[keyof TData][]>([]);\n const { formattedColumns, handleColumnsChange, resetColumns } =\n useColumns<TData>({ key: tableKey, columns });\n\n useEffect(() => {\n onColumnsUpdate?.(formattedColumns);\n }, [formattedColumns, onColumnsUpdate]);\n\n useEffect(() => {\n onSelectedItemsChange?.(selectedRows);\n }, [selectedRows, onSelectedItemsChange]);\n\n return (\n <div\n className={\n 'border-border-alpha-light flex grow flex-col overflow-auto rounded-xl border shadow-xs'\n }\n >\n <div className={'space-y-4 p-4'}>\n {(hasSearch ||\n (hasColumnsVisibilityDropdown && tableKey) ||\n !isEmpty(exportOptions) ||\n !isEmpty(filters)) && (\n <div className=\"flex shrink-0 flex-col items-center justify-between gap-3 lg:flex-row\">\n <div className={'w-full shrink'}>\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-78 [&_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\n className={\n 'flex w-full shrink-0 items-center justify-end gap-3 lg:w-auto'\n }\n >\n {exportOptions && (\n <ExportData\n {...exportOptionsProps}\n options={exportOptions}\n loading={exportLoading}\n />\n )}\n {hasColumnsVisibilityDropdown && tableKey && (\n <DropdownMenu>\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 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 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={'flex 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 selectedItems={selectedRows}\n isStickyHeader={isStickyHeader}\n columns={formattedColumns}\n hasCheckbox={hasCheckbox}\n hasNumbers={hasNumbers}\n onRowClick={onRowClick}\n onSelectedItemsChange={setSelectedRows}\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: selectedRows.length,\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","jsx","cn","key","isEmpty","ButtonGroup","val","index","jsxs","Button","v","XIcon","omit","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","setSelectedRows","useState","formattedColumns","handleColumnsChange","resetColumns","useColumns","Search","search","ExportData","DropdownMenu","DropdownMenuTrigger","RiLayoutColumnLine","RiArrowDownSLine","DropdownMenuContent","DropdownMenuItem","RefreshCw","DropdownMenuSeparator","DropdownMenuCheckboxItem","Actions","FilterWrapper","Loader","sortField","sortOrder","MyLimitSelect","limit","MyPagination","page"],"mappings":";;;;;;;;;;;;;;;;;;;;AA+BO,MAAMA,KAAiBC,GAAK,S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AAA,CAC7B,GACH;AAAA,4BACC,OAAA,EACC,UAAA,gBAAApD;AAAA,YAACiG;AAAA,YAAA;AAAA,cACE,GAAG3B;AAAA,cACJ,cAAc,CAAC4B,MAAS1C,KAAA,gBAAAA,EAAgB,EAAE,GAAGpE,GAAQ,MAAA8G;cACrD,aAAa9C,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;"}
|
package/dist/types/App.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"App.d.ts","sourceRoot":"","sources":["../../src/App.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"App.d.ts","sourceRoot":"","sources":["../../src/App.tsx"],"names":[],"mappings":"AAIA,iBAAS,GAAG,4CAkGX;AAED,eAAe,GAAG,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DataTable.d.ts","sourceRoot":"","sources":["../../../../src/components/datatable/DataTable.tsx"],"names":[],"mappings":"AAEA,OAAO,EACL,KAAK,sBAAsB,EAO5B,MAAM,iBAAiB,CAAC;AAIzB,OAAO,EAAE,KAAK,SAAS,EAAuB,MAAM,OAAO,CAAC;AAG5D,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AAC9C,OAAO,EAAE,KAAK,eAAe,EAAW,KAAK,YAAY,EAAE,MAAM,YAAY,CAAC;AAC9E,OAAO,EAEL,KAAK,mBAAmB,EACxB,KAAK,eAAe,EACrB,MAAM,WAAW,CAAC;AACnB,OAAO,EACL,KAAK,eAAe,EAEpB,KAAK,kBAAkB,EAEvB,KAAK,WAAW,EACjB,MAAM,YAAY,CAAC;AAIpB,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,gCAAgC,CAAC;AACxE,OAAO,EAAW,KAAK,YAAY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AAO,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,KAAK,IAAI,CAAC;CACvD;AAED;;;;;;;;GAQG;AACH,eAAO,MAAM,cAAc,
|
|
1
|
+
{"version":3,"file":"AppliedFilters.d.ts","sourceRoot":"","sources":["../../../../src/components/filters/AppliedFilters.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AAM7C,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,qBAAqB,CAAC;AAE3D;;GAEG;AACH,MAAM,WAAW,mBAAoB,SAAQ,SAAS;IACpD,6CAA6C;IAC7C,OAAO,CAAC,EAAE,eAAe,EAAE,CAAC;IAC5B,yCAAyC;IACzC,MAAM,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IACjC,+CAA+C;IAC/C,QAAQ,CAAC,EAAE,CAAC,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,KAAK,IAAI,CAAC;CACvD;AAED;;;;;;;;GAQG;AACH,eAAO,MAAM,cAAc,2DA4DzB,CAAC"}
|