Skip to content

Commit d82d2d9

Browse files
feat(AnalyticalTable): Add prop alternateRowColor (#212)
1 parent b289749 commit d82d2d9

File tree

8 files changed

+1214
-331
lines changed

8 files changed

+1214
-331
lines changed

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

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import { mountThemedComponent } from '@shared/tests/utils';
2-
import React from 'react';
32
import { AnalyticalTable } from '@ui5/webcomponents-react/lib/AnalyticalTable';
3+
import React from 'react';
44

55
const columns = [
66
{
@@ -193,4 +193,20 @@ describe('AnalyticalTable', () => {
193193

194194
expect(wrapper.render()).toMatchSnapshot();
195195
});
196+
197+
test('Alternate Row Color', () => {
198+
const wrapper = mountThemedComponent(
199+
<AnalyticalTable title="Table Title" data={data} columns={columns} alternateRowColor />
200+
);
201+
202+
expect(wrapper.render()).toMatchSnapshot();
203+
});
204+
205+
test('custom row height', () => {
206+
const wrapper = mountThemedComponent(
207+
<AnalyticalTable title="Table Title" data={data} columns={columns} rowHeight={60} />
208+
);
209+
210+
expect(wrapper.render()).toMatchSnapshot();
211+
});
196212
});

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

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,9 @@ const styles = ({ parameters }: JSSTheme) => ({
6363
backgroundColor: parameters.sapUiListBackground,
6464
color: parameters.sapUiListTextColor
6565
},
66+
alternateRowColor: {
67+
backgroundColor: parameters.sapUiListHeaderBackground
68+
},
6669
tableGroupHeader: {
6770
'&$tr': {
6871
backgroundColor: `${parameters.sapUiListTableGroupHeaderBackground} !important`,

0 commit comments

Comments
 (0)