Updated Table Component

This commit is contained in:
2025-11-16 22:36:14 +05:30
parent fd9fe2ca5c
commit 1a753e59a6
2 changed files with 4 additions and 1 deletions
+3 -1
View File
@@ -18,6 +18,7 @@ const {
tableClassNames = "",
hideHeader = false,
rowClick = "",
defaultSort = {},
} = Astro.props as TableProps<any>;
const id = `table-${Math.random().toString(36).slice(2, 9)}`;
@@ -155,6 +156,7 @@ const id = `table-${Math.random().toString(36).slice(2, 9)}`;
columnsRendererKey,
classInfos,
rowClick,
defaultSort,
}}
>
const start = () => {
@@ -173,7 +175,7 @@ const id = `table-${Math.random().toString(36).slice(2, 9)}`;
let rowsPerPage = pagignations
? parseInt(pageSizeSelector.value)
: 9999;
let sort = {}; // { key: "asc" | "desc" }
let sort = defaultSort; // { key: "asc" | "desc" }
let totalRows = data.length;
let currentData = [...data];
+1
View File
@@ -38,6 +38,7 @@ export interface TableProps<T> {
tableClassNames?: string;
hideHeader?: boolean;
rowClick?: string;
defaultSort?: Record<string, string>
}
export type Sort = {