Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ import StatusBadge from "@/common/StatusBadge";
import reduced from "./examples/reduced";
import Link from "next/link";
import paginatorHidden from "./examples/paginatorHidden";
import virtualized from "./examples/virtualized";

const actionsType = `{
icon: string | SVG;
Expand Down Expand Up @@ -76,6 +77,24 @@ const sections = [
</td>
<td>-</td>
</tr>
<tr>
<td>
<DxcFlex direction="column" gap="var(--spacing-gap-xs)" alignItems="baseline">
<StatusBadge status="new" />
height
</DxcFlex>
</td>
<td>
<TableCode>string</TableCode>
</td>
<td>
A fixed height must be set to enable virtualization. If no height is provided, the table will
automatically adjust to the height of its content, and virtualization will not be applied.
</td>
<td>
<td>-</td>
</td>
</tr>
<tr>
<td>
<DxcFlex direction="column" gap="var(--spacing-gap-xs)" alignItems="baseline">
Expand All @@ -91,6 +110,21 @@ const sections = [
<TableCode>false</TableCode>
</td>
</tr>
<tr>
<td>
<DxcFlex direction="column" gap="var(--spacing-gap-xs)" alignItems="baseline">
<StatusBadge status="required" />
rows
</DxcFlex>
</td>
<td>
<TableCode>boolean</TableCode>
</td>
<td>If true, paginator will not be displayed.</td>
<td>
<TableCode>false</TableCode>
</td>
</tr>
<tr>
<td>itemsPerPage</td>
<td>
Expand Down Expand Up @@ -287,6 +321,10 @@ const sections = [
title: "No paginator",
content: <Example example={paginatorHidden} defaultIsVisible />,
},
{
title: "Virtualized",
content: <Example example={virtualized} defaultIsVisible />,
},
],
},
];
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ const code = `() => {
<DxcResultsetTable
columns={columns}
rows={rows}
></DxcResultsetTable>
/>
</DxcInset>
);
}`;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ const code = `() => {
columns={columns}
rows={rows}
hidePaginator={true}
></DxcResultsetTable>
/>
</DxcInset>
);
}`;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ const code = `() => {
columns={columns}
rows={rows}
mode="reduced"
></DxcResultsetTable>
/>
</DxcInset>
);
}`;
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
import { DxcButton } from "@dxc-technology/halstack-react";

const cities = ["London", "New York", "Madrid", "Berlin", "Paris", "Tokyo"];
const names = ["Alice", "Bob", "Charlie", "Diana", "Evan", "Fiona"];
export const rows = Array.from({ length: 100000 }, (_, index) => {
const id = String(index + 1).padStart(6, "0");
const name = names[index % names.length];
const city = cities[index % cities.length];
return [
{ displayValue: id, sortValue: id },
{ displayValue: name, sortValue: name },
{ displayValue: city, sortValue: city },
{ displayValue: <DxcButton icon="delete" /> },
];
});
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ const code = `() => {

return (
<DxcInset space="var(--spacing-padding-xl)">
<DxcResultsetTable columns={columns} rows={rows}></DxcResultsetTable>
<DxcResultsetTable columns={columns} rows={rows}/>
</DxcInset>
);
}`;
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
import { DxcResultsetTable, DxcButton, DxcInset } from "@dxc-technology/halstack-react";
import { rows } from "./rows";

const code = `() => {
const columns = [
{ displayValue: "Id", isSortable: true },
{ displayValue: "Name", isSortable: true },
{ displayValue: "City", isSortable: true },
{ displayValue: "Actions", isSortable: false },
];

return (
<DxcInset space="var(--spacing-padding-xl)">
<DxcResultsetTable columns={columns} rows={rows} height="500px" itemsPerPage={10000}/>
</DxcInset>
);
}`;

const scope = {
DxcResultsetTable,
DxcButton,
DxcInset,
rows,
};

export default { code, scope };
Loading