Skip to content

Commit 3959e76

Browse files
authored
Merge pull request #1831 from dxc-technology/Mil4n0r/small_table_variant-doc
Added small table variant website doc
2 parents b5ec444 + f1e1e57 commit 3959e76

File tree

9 files changed

+498
-49
lines changed

9 files changed

+498
-49
lines changed

lib/src/table/types.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -57,8 +57,8 @@ type Props = {
5757
margin?: Space | Margin;
5858
/**
5959
* Determines the visual style and layout
60-
* - "default": Table with big spacing, applicable to most cases.
61-
* - "reduced": Smaller table with minimal spacing for high density information.
60+
* - "default": Default table size.
61+
* - "reduced": More compact table with less spacing for high density information.
6262
*/
6363
mode?: "default" | "reduced";
6464
};

website/package-lock.json

Lines changed: 27 additions & 27 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

website/screens/components/resultset-table/code/ResultsetTableCodePage.tsx

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ import basicUsage from "./examples/basicUsage";
88
import sortable from "./examples/sortable";
99
import TableCode from "@/common/TableCode";
1010
import StatusTag from "@/common/StatusTag";
11+
import reduced from "./examples/reduced";
1112

1213
const sections = [
1314
{
@@ -77,6 +78,30 @@ const sections = [
7778
</td>
7879
<td>-</td>
7980
</tr>
81+
<tr>
82+
<td>
83+
<DxcFlex direction="column" gap="0.25rem" alignItems="baseline">
84+
<StatusTag status="Information">New</StatusTag>mode
85+
</DxcFlex>
86+
</td>
87+
<td>
88+
<TableCode>'default' | 'reduced'</TableCode>
89+
</td>
90+
<td>
91+
The available table modes:
92+
<ul>
93+
<li>
94+
<b>default</b>: Default table size.
95+
</li>
96+
<li>
97+
<b>reduced</b>: More compact table with less spacing for high density information.
98+
</li>
99+
</ul>
100+
</td>
101+
<td>
102+
<TableCode>'default'</TableCode>
103+
</td>
104+
</tr>
80105
<tr>
81106
<td>showGoToPage</td>
82107
<td>
@@ -160,6 +185,12 @@ const sections = [
160185
title: "Basic usage",
161186
content: <Example example={basicUsage} defaultIsVisible />,
162187
},
188+
{
189+
title: "Reduced usage",
190+
content: (
191+
<Example example={reduced} defaultIsVisible />
192+
),
193+
},
163194
{
164195
title: "Sortable",
165196
content: <Example example={sortable} defaultIsVisible />,
Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,9 @@
11
import React from "react";
22

33
export const deleteIcon = (
4-
<svg
5-
xmlns="http://www.w3.org/2000/svg"
6-
height="24"
7-
viewBox="0 0 24 24"
8-
width="24"
9-
fill="white"
10-
>
11-
<path d="M6 19c0 1.1.9 2 2 2h8c1.1 0 2-.9 2-2V7H6v12zM19 4h-3.5l-1-1h-5l-1 1H5v2h14V4z" />
4+
<svg xmlns="http://www.w3.org/2000/svg" height="24" viewBox="0 0 24 24" width="24">
5+
<path fill="currentColor" d="M6 19c0 1.1.9 2 2 2h8c1.1 0 2-.9 2-2V7H6v12zM19 4h-3.5l-1-1h-5l-1 1H5v2h14V4z" />
126
<path d="M0 0h24v24H0z" fill="none" />
137
</svg>
148
);
9+
Lines changed: 79 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,79 @@
1+
import {
2+
DxcResultsetTable,
3+
DxcInset,
4+
} from "@dxc-technology/halstack-react";
5+
import { deleteIcon } from "./Icons";
6+
7+
const code = `() => {
8+
const columns = [
9+
{ displayValue: "Id"},
10+
{ displayValue: "Name"},
11+
{ displayValue: "City"},
12+
{ displayValue: "Actions"},
13+
];
14+
15+
const actions = [
16+
{
17+
icon: deleteIcon,
18+
title: "icon",
19+
onClick: () => {},
20+
},
21+
];
22+
23+
const rows = [
24+
[
25+
{ displayValue: "001"},
26+
{ displayValue: "Peter"},
27+
{ displayValue: "Miami"},
28+
{ displayValue: <DxcResultsetTable.ActionsCell actions={actions} /> },
29+
],
30+
[
31+
{ displayValue: "002"},
32+
{ displayValue: "Louis"},
33+
{ displayValue: "London"},
34+
{ displayValue: <DxcResultsetTable.ActionsCell actions={actions} /> },
35+
],
36+
[
37+
{ displayValue: "003"},
38+
{ displayValue: "Lana"},
39+
{ displayValue: "Amsterdam"},
40+
{ displayValue: <DxcResultsetTable.ActionsCell actions={actions} /> },
41+
],
42+
[
43+
{ displayValue: "004"},
44+
{ displayValue: "Rick"},
45+
{ displayValue: "London"},
46+
{ displayValue: <DxcResultsetTable.ActionsCell actions={actions} /> },
47+
],
48+
[
49+
{ displayValue: "005"},
50+
{ displayValue: "Mark"},
51+
{ displayValue: "Miami"},
52+
{ displayValue: <DxcResultsetTable.ActionsCell actions={actions} /> },
53+
],
54+
[
55+
{ displayValue: "006"},
56+
{ displayValue: "Cris"},
57+
{ displayValue: "Paris"},
58+
{ displayValue: <DxcResultsetTable.ActionsCell actions={actions} /> },
59+
],
60+
];
61+
62+
return (
63+
<DxcInset space="2rem">
64+
<DxcResultsetTable
65+
columns={columns}
66+
rows={rows}
67+
mode="reduced"
68+
></DxcResultsetTable>
69+
</DxcInset>
70+
);
71+
}`;
72+
73+
const scope = {
74+
DxcResultsetTable,
75+
DxcInset,
76+
deleteIcon,
77+
};
78+
79+
export default { code, scope };

0 commit comments

Comments
 (0)