Skip to content

Commit 1b110a5

Browse files
authored
feat(BaseTable): add qa prop (#152)
BaseTable: add support for the qa prop, mirroring the implementation in @gravity-ui/uikit.
1 parent 1448b43 commit 1b110a5

1 file changed

Lines changed: 5 additions & 1 deletion

File tree

src/components/BaseTable/BaseTable.tsx

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
import * as React from 'react';
22

3+
import type {QAProps} from '@gravity-ui/uikit';
34
import type {Row, Table} from '@tanstack/react-table';
45
import type {VirtualItem, Virtualizer} from '@tanstack/react-virtual';
56

@@ -19,7 +20,8 @@ import {b} from './BaseTable.classname';
1920

2021
import './BaseTable.scss';
2122

22-
export interface BaseTableProps<TData, TScrollElement extends Element | Window = HTMLDivElement> {
23+
export interface BaseTableProps<TData, TScrollElement extends Element | Window = HTMLDivElement>
24+
extends QAProps {
2325
/** The table instance returned from the `useTable` hook */
2426
table: Table<TData>;
2527
/** HTML attributes for the `<table>` element */
@@ -154,6 +156,7 @@ export const BaseTable = React.forwardRef(
154156
rowAttributes,
155157
rowClassName,
156158
rowVirtualizer,
159+
qa,
157160
sortIndicatorClassName,
158161
stickyFooter = false,
159162
stickyHeader = false,
@@ -272,6 +275,7 @@ export const BaseTable = React.forwardRef(
272275
aria-colcount={colCount > 0 ? colCount : undefined}
273276
aria-rowcount={rowCount > 0 ? rowCount : undefined}
274277
aria-multiselectable={getAriaMultiselectable(table)}
278+
data-qa={qa}
275279
{...attributes}
276280
>
277281
{withHeader && (

0 commit comments

Comments
 (0)