Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[OBSDEF-46956] DataGrid Pagination Improvements : Updated version of clarity-react lib #65

Merged
merged 1 commit into from
Apr 30, 2024
Merged
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
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "@dellstorage/dell-design-react-common",
"description": "Override CSS of Clarity-React components to align it with Dell design standards",
"version": "0.2.9",
"version": "0.2.10",
"license": "Apache-2.0",
"private": false,
"outDir": "dist",
Expand All @@ -12,7 +12,7 @@
"node": ">=16.14.1"
},
"dependencies": {
"@dellstorage/clarity-react": "^1.2.12",
"@dellstorage/clarity-react": "^1.2.13",
"@types/node": "^12.14.1",
"bootstrap": "^5.2.0",
"react": "^17.0.2",
Expand Down
6 changes: 3 additions & 3 deletions src/components/dataGrid/DataGrid.stories.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ import {
sortFunction,
columnsForCustomRows,
paginationRowsWithLinks,
paginationDetailswithDefaultPageSizes
paginationDetailswithCustomPageSize,
} from "./DataGridStoriesData";

const datagridFilterRef = React.createRef<DataGrid>();
Expand Down Expand Up @@ -91,12 +91,12 @@ storiesOf("DataGrid", module)
/>
</div>
))
.add("Grid with pagination and default pageSizes dropdown", () => (
.add("Grid with pagination and custom pageSize", () => (
<div style={{width: "80%"}}>
<DataGrid
columns={normalColumns}
rows={paginationRows.slice(0, 10)}
pagination={paginationDetailswithDefaultPageSizes}
pagination={paginationDetailswithCustomPageSize}
itemText={"Items"}
footer={{showFooter: true}}
/>
Expand Down
14 changes: 11 additions & 3 deletions src/components/dataGrid/DataGridStoriesData.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,14 @@
*/

import React from "react";
import {DataGridRow, DataGridFilterResult, SortOrder, DataGridColumn} from "@dellstorage/clarity-react/datagrid";
import {
DataGridRow,
DataGridFilterResult,
SortOrder,
DataGridColumn,
DataGridPaginationProps,
CUSTOM_PAGE_SIZE_OPTION
} from "@dellstorage/clarity-react/datagrid";
import {Icon} from "@dellstorage/clarity-react/icon";
import {Button} from "@dellstorage/clarity-react/forms/button";
/**
Expand Down Expand Up @@ -280,17 +287,18 @@ export function getRowData() {
// Data for pagination rows
export const paginationRows = getRowData();

export const paginationDetails = {
export const paginationDetails: DataGridPaginationProps = {
totalItems: paginationRows.length,
getPageData: getPageData,
pageSize: 5,
pageSizes: ["5", "10"],
};

export const paginationDetailswithDefaultPageSizes = {
export const paginationDetailswithCustomPageSize: DataGridPaginationProps = {
totalItems: paginationRows.length,
getPageData: getPageDataForCustomPageSize,
pageSize: 10,
pageSizes: ["10", "20", "50", "100", CUSTOM_PAGE_SIZE_OPTION],
};

/**
Expand Down
8 changes: 4 additions & 4 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -1337,10 +1337,10 @@
resolved "https://registry.yarnpkg.com/@csstools/normalize.css/-/normalize.css-10.1.0.tgz#f0950bba18819512d42f7197e56c518aa491cf18"
integrity sha512-ij4wRiunFfaJxjB0BdrYHIH8FxBJpOwNPhhAcunlmPdXudL1WQV1qoP9un6JsEBAgQH+7UXyyjh0g7jTxXK6tg==

"@dellstorage/clarity-react@^1.2.12":
version "1.2.12"
resolved "https://registry.yarnpkg.com/@dellstorage/clarity-react/-/clarity-react-1.2.12.tgz#2fdb064f3fc98775d41c93f7e2927ece61194516"
integrity sha512-ueBMht6ZmF2lMmj7jBuMNivXVT5wfK2DEl2igDxzHo4NoCLKUn71nLsvIQxCskQFW8t250Y4p07jQDizYik+GA==
"@dellstorage/clarity-react@^1.2.13":
version "1.2.13"
resolved "https://registry.yarnpkg.com/@dellstorage/clarity-react/-/clarity-react-1.2.13.tgz#c5355efd6515d6875e9513cbd98b4fcadc469f45"
integrity sha512-IKu65gzeTNTUTWywP7enrOQ3SkSdym+gblbEYtXdV6B3iS5LmKxkehbRFIuzohxajGLilwftWDlwTLnC7welNw==
dependencies:
"@clr/icons" "12.0.8"
"@clr/ui" "12.0.8"
Expand Down
Loading