Skip to content

Commit

Permalink
Revert "Merge branch 'select-all-items-row' into develop"
Browse files Browse the repository at this point in the history
This reverts commit a43f85a, reversing
changes made to de85ab2.
  • Loading branch information
mguellsegarra committed Oct 9, 2023
1 parent a6b4924 commit 89a7ec0
Show file tree
Hide file tree
Showing 7 changed files with 103 additions and 234 deletions.
4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 1 addition & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@gisce/react-formiga-table",
"version": "0.8.7-rc.0",
"version": "0.8.6",
"scripts": {
"build": "tsc && vite build",
"prepublishOnly": "npm run build",
Expand All @@ -11,7 +11,6 @@
"access": "public"
},
"dependencies": {
"start": "while :; do tsc && vite build --watch --force; done",
"react": "^16.8.0 || 17.x",
"react-dom": "^16.8.0 || 17.x",
"styled-components": "^5.0.0",
Expand Down
26 changes: 0 additions & 26 deletions src/Table.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ import { TableProps } from "./types";
import { Headers } from "./components/Headers";
import { Rows } from "./components/Rows";
import { useShiftSelected } from "./hooks/useShiftSelect";
import { SelectAllRecordsRow } from "./components/SelectAllRecordsRow";

export const Table = (props: TableProps) => {
const {
Expand All @@ -26,14 +25,6 @@ export const Table = (props: TableProps) => {
onCellRender,
readonly,
selectionRowKeys: selectionRowKeysProps,
translations = {
recordsSelected:
"{numberOfSelectedRows} records are selected from this page.",
selectAllRecords: "Select all {totalRecords} records.",
allRecordsSelected: "There are {totalRecords} records selected.",
},
onSelectAllRecords,
totalItems = 0,
} = props;

const {
Expand Down Expand Up @@ -92,11 +83,6 @@ export const Table = (props: TableProps) => {
return loadingComponent;
}

const numberOfColumns = 1 + columns.length + (!!onRowStatus ? 1 : 0);
const numberOfVisibleSelectedRows = dataSource
.filter((entry) => getLevelForKey(entry.id) === 0)
.filter((entry) => selectedRowKeys.includes(entry.id)).length;

return (
<Container
height={height}
Expand All @@ -121,18 +107,6 @@ export const Table = (props: TableProps) => {
</tr>
</thead>
<tbody>
{onSelectAllRecords && (
<SelectAllRecordsRow
numberOfColumns={numberOfColumns}
numberOfVisibleSelectedRows={numberOfVisibleSelectedRows}
numberOfRealSelectedRows={selectedRowKeys.length}
numberOfTotalRows={dataSource.length}
totalRecords={totalItems}
translations={translations}
onSelectAllRecords={onSelectAllRecords}
loadingComponent={loadingComponent}
/>
)}
<Rows
dataSource={dataSource}
columns={columns}
Expand Down
91 changes: 0 additions & 91 deletions src/components/SelectAllRecordsRow.tsx

This file was deleted.

Loading

0 comments on commit 89a7ec0

Please sign in to comment.