Skip to content

Commit 2ae4bf6

Browse files
feat(AnalyticalTable): Refactoring, add onRowExpandChange and placeholder loading (#207)
BREAKING CHANGE: Removed unused prop `cellHeight`, use `rowHeight` instead BREAKING CHANGE: Removed unused prop `reactTableProps` BREAKING CHANGE: Removed unused prop `getTableProps` BREAKING CHANGE: Removed unused prop `getHeaderGroupsProps` BREAKING CHANGE: Removed unused prop `getHeaderProps` BREAKING CHANGE: Removed unused prop `getRowProps` BREAKING CHANGE: Removed unused prop `getCellProps`
1 parent fe50a43 commit 2ae4bf6

File tree

25 files changed

+1269
-239
lines changed

25 files changed

+1269
-239
lines changed

packages/main/package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@
2222
"@ui5/webcomponents": "1.0.0-rc.4",
2323
"@ui5/webcomponents-react-base": "0.6.0",
2424
"lodash.debounce": "^4.0.8",
25+
"react-content-loader": "^4.3.2",
2526
"react-table": "7.0.0-beta.12",
2627
"react-toastify": "^5.0.1",
2728
"react-window": "^1.8.5",

packages/main/src/components/AnalyticalTable/AnalyticalTable.test.tsx

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -177,4 +177,20 @@ describe('AnalyticalTable', () => {
177177

178178
expect(wrapper.render()).toMatchSnapshot();
179179
});
180+
181+
test('Loading - Placeholder', () => {
182+
const wrapper = mountThemedComponent(
183+
<AnalyticalTable title="Table Title" data={[]} columns={columns} loading visibleRows={15} minRows={5} />
184+
);
185+
186+
expect(wrapper.render()).toMatchSnapshot();
187+
});
188+
189+
test('Loading - Loader', () => {
190+
const wrapper = mountThemedComponent(
191+
<AnalyticalTable title="Table Title" data={data} columns={columns} loading visibleRows={15} minRows={5} />
192+
);
193+
194+
expect(wrapper.render()).toMatchSnapshot();
195+
});
180196
});

packages/main/src/components/AnalyticalTable/AnayticalTable.jss.ts

Lines changed: 1 addition & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -134,16 +134,7 @@ const styles = ({ parameters }: JSSTheme) => ({
134134
}
135135
},
136136

137-
propRowHeight: {
138-
'&$tableContainer': {
139-
height: (props) => `calc(100% - ${props.rowHeight}px)`
140-
},
141-
'& $tableHeaderRow': {
142-
height: (theme) => (theme.contentDensity === 'Compact' ? '2rem' : '2.75rem')
143-
},
144-
'& $th': {
145-
height: (theme) => (theme.contentDensity === 'Compact' ? '2rem' : '2.75rem')
146-
},
137+
modifiedRowHeight: {
147138
'& $tableCell': {
148139
height: (props) => `${props.rowHeight}px`
149140
}

packages/main/src/components/AnalyticalTable/ColumnHeader/index.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ import { Icon } from '@ui5/webcomponents-react/lib/Icon';
44
import React, { CSSProperties, FC, ReactNode, ReactNodeArray, useMemo } from 'react';
55
import { createUseStyles } from 'react-jss';
66
import { JSSTheme } from '../../../interfaces/JSSTheme';
7-
import { Resizer } from '../Resizer';
7+
import { Resizer } from './Resizer';
88
import { ColumnType } from '../types/ColumnType';
99
import { ColumnHeaderModal } from './ColumnHeaderModal';
1010
import '@ui5/webcomponents/dist/icons/filter';

packages/main/src/components/AnalyticalTable/DefaultNoDataComponent/index.tsx

Lines changed: 0 additions & 12 deletions
This file was deleted.

packages/main/src/components/AnalyticalTable/LoadingComponent/index.tsx

Lines changed: 0 additions & 27 deletions
This file was deleted.

0 commit comments

Comments
 (0)