- {keyboardShortcutsControl && (
+ {Boolean(inTableSearchControl) && (
+
+ {inTableSearchControl}
+
+ )}
+ {Boolean(keyboardShortcutsControl) && (
{keyboardShortcutsControl}
)}
- {displayControl && (
+ {Boolean(displayControl) && (
{displayControl}
)}
- {fullScreenControl && (
+ {Boolean(fullScreenControl) && (
{fullScreenControl}
diff --git a/src/platform/packages/shared/kbn-unified-data-table/src/components/data_table.test.tsx b/src/platform/packages/shared/kbn-unified-data-table/src/components/data_table.test.tsx
index 3ee4e5a9e7a13..04b3d77ff2c43 100644
--- a/src/platform/packages/shared/kbn-unified-data-table/src/components/data_table.test.tsx
+++ b/src/platform/packages/shared/kbn-unified-data-table/src/components/data_table.test.tsx
@@ -9,6 +9,13 @@
import React, { useCallback, useState } from 'react';
import { ReactWrapper } from 'enzyme';
+import {
+ BUTTON_NEXT_TEST_SUBJ,
+ BUTTON_TEST_SUBJ,
+ COUNTER_TEST_SUBJ,
+ HIGHLIGHT_CLASS_NAME,
+ INPUT_TEST_SUBJ,
+} from '@kbn/data-grid-in-table-search';
import {
EuiButton,
EuiDataGrid,
@@ -38,7 +45,7 @@ import {
testTrailingControlColumns,
} from '../../__mocks__/external_control_columns';
import { DatatableColumnType } from '@kbn/expressions-plugin/common';
-import { render, screen, waitFor } from '@testing-library/react';
+import { fireEvent, render, screen, waitFor } from '@testing-library/react';
import userEvent from '@testing-library/user-event';
import { CELL_CLASS } from '../utils/get_render_cell_value';
import { defaultTimeColumnWidth } from '../constants';
@@ -1459,4 +1466,101 @@ describe('UnifiedDataTable', () => {
expect(onChangePageMock).toHaveBeenNthCalledWith(1, 0);
});
});
+
+ describe('enableInTableSearch', () => {
+ it(
+ 'should render find-button if enableInTableSearch is true and no custom toolbar specified',
+ async () => {
+ await renderDataTable({ enableInTableSearch: true, columns: ['bytes'] });
+
+ expect(screen.getByTestId(BUTTON_TEST_SUBJ)).toBeInTheDocument();
+ },
+ EXTENDED_JEST_TIMEOUT
+ );
+
+ it(
+ 'should render find-button if enableInTableSearch is true and renderCustomToolbar is provided',
+ async () => {
+ const renderCustomToolbarMock = jest.fn((props) => {
+ return (
+
+ Custom layout {props.gridProps.inTableSearchControl}
+
+ );
+ });
+
+ await renderDataTable({
+ enableInTableSearch: true,
+ columns: ['bytes'],
+ renderCustomToolbar: renderCustomToolbarMock,
+ });
+
+ expect(screen.getByTestId('custom-toolbar')).toBeInTheDocument();
+ expect(screen.getByTestId(BUTTON_TEST_SUBJ)).toBeInTheDocument();
+ },
+ EXTENDED_JEST_TIMEOUT
+ );
+
+ it(
+ 'should not render find-button if enableInTableSearch is false',
+ async () => {
+ await renderDataTable({ enableInTableSearch: false, columns: ['bytes'] });
+
+ expect(screen.queryByTestId(BUTTON_TEST_SUBJ)).not.toBeInTheDocument();
+ },
+ EXTENDED_JEST_TIMEOUT
+ );
+
+ it(
+ 'should find the search term in the table',
+ async () => {
+ await renderDataTable({ enableInTableSearch: true, columns: ['bytes'] });
+
+ expect(screen.getByTestId(BUTTON_TEST_SUBJ)).toBeInTheDocument();
+
+ screen.getByTestId(BUTTON_TEST_SUBJ).click();
+
+ expect(screen.getByTestId(INPUT_TEST_SUBJ)).toBeInTheDocument();
+
+ const searchTerm = '50';
+ const input = screen.getByTestId(INPUT_TEST_SUBJ);
+ fireEvent.change(input, { target: { value: searchTerm } });
+ expect(input).toHaveValue(searchTerm);
+
+ await waitFor(() => {
+ // 3 results for `bytes` column with value `50`
+ expect(screen.getByTestId(COUNTER_TEST_SUBJ)).toHaveTextContent('1/3');
+ });
+
+ await waitFor(() => {
+ const highlights = screen.getAllByText(searchTerm);
+ expect(highlights.length).toBeGreaterThan(0);
+ expect(
+ highlights.every(
+ (highlight) =>
+ highlight.tagName === 'MARK' && highlight.classList.contains(HIGHLIGHT_CLASS_NAME)
+ )
+ ).toBe(true);
+ });
+
+ screen.getByTestId(BUTTON_NEXT_TEST_SUBJ).click();
+
+ await waitFor(() => {
+ expect(screen.getByTestId(COUNTER_TEST_SUBJ)).toHaveTextContent('2/3');
+ });
+
+ const anotherSearchTerm = 'random';
+ fireEvent.change(screen.getByTestId(INPUT_TEST_SUBJ), {
+ target: { value: anotherSearchTerm },
+ });
+ expect(screen.getByTestId(INPUT_TEST_SUBJ)).toHaveValue(anotherSearchTerm);
+
+ await waitFor(() => {
+ // no results
+ expect(screen.getByTestId(COUNTER_TEST_SUBJ)).toHaveTextContent('0/0');
+ });
+ },
+ EXTENDED_JEST_TIMEOUT
+ );
+ });
});
diff --git a/src/platform/packages/shared/kbn-unified-data-table/src/components/data_table.tsx b/src/platform/packages/shared/kbn-unified-data-table/src/components/data_table.tsx
index 3a0378037e576..22229262441b7 100644
--- a/src/platform/packages/shared/kbn-unified-data-table/src/components/data_table.tsx
+++ b/src/platform/packages/shared/kbn-unified-data-table/src/components/data_table.tsx
@@ -51,6 +51,7 @@ import type { ThemeServiceStart } from '@kbn/react-kibana-context-common';
import { type DataPublicPluginStart } from '@kbn/data-plugin/public';
import type { DocViewFilterFn } from '@kbn/unified-doc-viewer/types';
import { AdditionalFieldGroups } from '@kbn/unified-field-list';
+import { useDataGridInTableSearch } from '@kbn/data-grid-in-table-search';
import { DATA_GRID_DENSITY_STYLE_MAP, useDataGridDensity } from '../hooks/use_data_grid_density';
import {
UnifiedDataTableSettings,
@@ -411,6 +412,10 @@ export interface UnifiedDataTableProps {
* Set to true to allow users to compare selected documents
*/
enableComparisonMode?: boolean;
+ /**
+ * Set to true to allow users to search in cell values
+ */
+ enableInTableSearch?: boolean;
/**
* Optional extra props passed to the renderCellValue function/component.
*/
@@ -494,6 +499,7 @@ export const UnifiedDataTable = ({
rowLineHeightOverride,
customGridColumnsConfiguration,
enableComparisonMode,
+ enableInTableSearch = false,
cellContext,
renderCellPopover,
getRowIndicator,
@@ -528,6 +534,14 @@ export const UnifiedDataTable = ({
const [currentPageIndex, setCurrentPageIndex] = useState(0);
+ const changeCurrentPageIndex = useCallback(
+ (value: number) => {
+ setCurrentPageIndex(value);
+ onUpdatePageIndex?.(value);
+ },
+ [setCurrentPageIndex, onUpdatePageIndex]
+ );
+
useEffect(() => {
if (!hasSelectedDocs && isFilterActive) {
setIsFilterActive(false);
@@ -632,15 +646,10 @@ export const UnifiedDataTable = ({
onUpdateRowsPerPage?.(pageSize);
};
- const onChangePage = (newPageIndex: number) => {
- setCurrentPageIndex(newPageIndex);
- onUpdatePageIndex?.(newPageIndex);
- };
-
return isPaginationEnabled
? {
onChangeItemsPerPage,
- onChangePage,
+ onChangePage: changeCurrentPageIndex,
pageIndex: currentPageIndex,
pageSize: currentPageSize,
pageSizeOptions: rowsPerPageOptions ?? getRowsPerPageOptions(currentPageSize),
@@ -652,7 +661,7 @@ export const UnifiedDataTable = ({
onUpdateRowsPerPage,
currentPageSize,
currentPageIndex,
- onUpdatePageIndex,
+ changeCurrentPageIndex,
]);
const unifiedDataTableContextValue = useMemo
(
@@ -738,6 +747,24 @@ export const UnifiedDataTable = ({
]
);
+ const { dataGridId, dataGridWrapper, setDataGridWrapper } = useFullScreenWatcher();
+
+ const {
+ inTableSearchTermCss,
+ inTableSearchControl,
+ cellContextWithInTableSearchSupport,
+ renderCellValueWithInTableSearchSupport,
+ } = useDataGridInTableSearch({
+ enableInTableSearch,
+ dataGridWrapper,
+ dataGridRef,
+ visibleColumns,
+ rows: displayedRows,
+ renderCellValue,
+ cellContext,
+ pagination: paginationObj,
+ });
+
const renderCustomPopover = useMemo(
() => renderCellPopover ?? getCustomCellPopoverRenderer(),
[renderCellPopover]
@@ -947,11 +974,11 @@ export const UnifiedDataTable = ({
]);
const additionalControls = useMemo(() => {
- if (!externalAdditionalControls && !selectedDocsCount) {
+ if (!externalAdditionalControls && !selectedDocsCount && !inTableSearchControl) {
return null;
}
- return (
+ const leftControls = (
<>
{Boolean(selectedDocsCount) && (
);
+
+ if (!renderCustomToolbar && inTableSearchControl) {
+ return {
+ left: leftControls,
+ right: inTableSearchControl,
+ };
+ }
+
+ return leftControls;
}, [
selectedDocsCount,
selectedDocsState,
@@ -986,6 +1022,8 @@ export const UnifiedDataTable = ({
unifiedDataTableContextValue.pageSize,
toastNotifications,
visibleColumns,
+ renderCustomToolbar,
+ inTableSearchControl,
]);
const renderCustomToolbarFn: EuiDataGridProps['renderCustomToolbar'] | undefined = useMemo(
@@ -995,11 +1033,15 @@ export const UnifiedDataTable = ({
renderCustomToolbar({
toolbarProps,
gridProps: {
- additionalControls,
+ additionalControls:
+ additionalControls && 'left' in additionalControls
+ ? additionalControls.left
+ : additionalControls,
+ inTableSearchControl,
},
})
: undefined,
- [renderCustomToolbar, additionalControls]
+ [renderCustomToolbar, additionalControls, inTableSearchControl]
);
const showDisplaySelector = useMemo(():
@@ -1080,8 +1122,6 @@ export const UnifiedDataTable = ({
rowLineHeight: rowLineHeightOverride,
});
- const { dataGridId, dataGridWrapper, setDataGridWrapper } = useFullScreenWatcher();
-
const isRenderComplete = loadingState !== DataLoadingState.loading;
if (!rowCount && loadingState === DataLoadingState.loading) {
@@ -1132,6 +1172,7 @@ export const UnifiedDataTable = ({
data-description={searchDescription}
data-document-number={displayedRows.length}
className={classnames(className, 'unifiedDataTable__table')}
+ css={inTableSearchTermCss}
>
{isCompareActive ? (
= ({
showColumnTokens
canDragAndDropColumns
enableComparisonMode
+ enableInTableSearch
renderCustomToolbar={renderCustomToolbar}
getRowIndicator={getRowIndicator}
rowAdditionalLeadingControls={rowAdditionalLeadingControls}
diff --git a/src/platform/plugins/shared/esql_datagrid/public/data_grid.tsx b/src/platform/plugins/shared/esql_datagrid/public/data_grid.tsx
index 58145627f139f..39bd976ebb209 100644
--- a/src/platform/plugins/shared/esql_datagrid/public/data_grid.tsx
+++ b/src/platform/plugins/shared/esql_datagrid/public/data_grid.tsx
@@ -155,6 +155,7 @@ const DataGrid: React.FC = (props) => {
hasRoomForGridControls: true,
},
gridProps: {
+ inTableSearchControl: customToolbarProps.gridProps.inTableSearchControl,
additionalControls: (
= (props) => {
rows={rows}
columnsMeta={columnsMeta}
services={services}
+ enableInTableSearch
isPlainRecord
isSortEnabled={false}
loadingState={DataLoadingState.loaded}
diff --git a/test/functional/apps/discover/group2_data_grid2/_data_grid_in_table_search.ts b/test/functional/apps/discover/group2_data_grid2/_data_grid_in_table_search.ts
new file mode 100644
index 0000000000000..5ea01974b47ec
--- /dev/null
+++ b/test/functional/apps/discover/group2_data_grid2/_data_grid_in_table_search.ts
@@ -0,0 +1,156 @@
+/*
+ * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
+ * or more contributor license agreements. Licensed under the "Elastic License
+ * 2.0", the "GNU Affero General Public License v3.0 only", and the "Server Side
+ * Public License v 1"; you may not use this file except in compliance with, at
+ * your election, the "Elastic License 2.0", the "GNU Affero General Public
+ * License v3.0 only", or the "Server Side Public License, v 1".
+ */
+
+import expect from '@kbn/expect';
+import { Key } from 'selenium-webdriver';
+import { INPUT_TEST_SUBJ } from '@kbn/data-grid-in-table-search';
+import { FtrProviderContext } from '../ftr_provider_context';
+
+export default function ({ getService, getPageObjects }: FtrProviderContext) {
+ const browser = getService('browser');
+ const esArchiver = getService('esArchiver');
+ const kibanaServer = getService('kibanaServer');
+ const dataGrid = getService('dataGrid');
+ const retry = getService('retry');
+ const testSubjects = getService('testSubjects');
+ const queryBar = getService('queryBar');
+ const monacoEditor = getService('monacoEditor');
+ const security = getService('security');
+ const { common, discover, timePicker, unifiedFieldList, header } = getPageObjects([
+ 'common',
+ 'discover',
+ 'timePicker',
+ 'unifiedFieldList',
+ 'header',
+ ]);
+ const defaultSettings = { defaultIndex: 'logstash-*' };
+
+ describe('discover data grid in-table search', function describeIndexTests() {
+ before(async () => {
+ await security.testUser.setRoles(['kibana_admin', 'test_logstash_reader']);
+ await browser.setWindowSize(1200, 2000);
+ await esArchiver.loadIfNeeded('test/functional/fixtures/es_archiver/logstash_functional');
+ await kibanaServer.importExport.load('test/functional/fixtures/kbn_archiver/discover');
+ });
+
+ after(async () => {
+ await kibanaServer.importExport.unload('test/functional/fixtures/kbn_archiver/discover');
+ await kibanaServer.uiSettings.replace({});
+ await kibanaServer.savedObjects.cleanStandardList();
+ });
+
+ beforeEach(async function () {
+ await timePicker.setDefaultAbsoluteRangeViaUiSettings();
+ await kibanaServer.uiSettings.update(defaultSettings);
+ await common.navigateToApp('discover');
+ await header.waitUntilLoadingHasFinished();
+ await discover.waitUntilSearchingHasFinished();
+ });
+
+ it('should show highlights for in-table search', async () => {
+ expect(await dataGrid.getCurrentPageNumber()).to.be('1');
+
+ await dataGrid.runInTableSearch('Sep 22, 2015 @ 18:16:13.025');
+ expect(await dataGrid.getInTableSearchMatchesCounter()).to.be('1/3');
+ expect(await dataGrid.getInTableSearchCellMatchesCount(1, '@timestamp')).to.be(1);
+ expect(await dataGrid.getInTableSearchCellMatchesCount(1, '_source')).to.be(2);
+ expect(await dataGrid.getInTableSearchCellMatchesCount(2, '@timestamp')).to.be(0);
+ expect(await dataGrid.getInTableSearchCellMatchesCount(2, '_source')).to.be(0);
+ expect(await dataGrid.getCurrentPageNumber()).to.be('3');
+
+ await dataGrid.runInTableSearch('http');
+ expect(await dataGrid.getInTableSearchMatchesCounter()).to.be('1/6386');
+ expect(await dataGrid.getInTableSearchCellMatchesCount(0, '@timestamp')).to.be(0);
+ expect(await dataGrid.getInTableSearchCellMatchesCount(0, '_source')).to.be(13);
+ expect(await dataGrid.getCurrentPageNumber()).to.be('1');
+
+ await dataGrid.exitInTableSearch();
+
+ await retry.waitFor('no highlights', async () => {
+ return (await dataGrid.getInTableSearchCellMatchesCount(0, '@timestamp')) === 0;
+ });
+ });
+
+ it('uses different colors for highlights in the table', async () => {
+ await discover.selectTextBaseLang();
+ await header.waitUntilLoadingHasFinished();
+ await discover.waitUntilSearchingHasFinished();
+ const testQuery = `from logstash-* | sort @timestamp | limit 10`;
+ await monacoEditor.setCodeEditorValue(testQuery);
+ await testSubjects.click('querySubmitButton');
+ await header.waitUntilLoadingHasFinished();
+ await discover.waitUntilSearchingHasFinished();
+
+ await dataGrid.runInTableSearch('2015 @');
+ expect(await dataGrid.getInTableSearchMatchesCounter()).to.be('1/30');
+ expect(await dataGrid.getInTableSearchCellMatchesCount(0, '@timestamp')).to.be(1);
+ expect(await dataGrid.getInTableSearchCellMatchesCount(0, '_source')).to.be(2);
+
+ const firstRowFirstCellMatches = await dataGrid.getInTableSearchCellMatchElements(
+ 0,
+ '@timestamp'
+ );
+ const secondRowRowFirstCellMatches = await dataGrid.getInTableSearchCellMatchElements(
+ 1,
+ '@timestamp'
+ );
+ const activeMatchBackgroundColor = await firstRowFirstCellMatches[0].getComputedStyle(
+ 'background-color'
+ );
+ const anotherMatchBackgroundColor = await secondRowRowFirstCellMatches[0].getComputedStyle(
+ 'background-color'
+ );
+ expect(activeMatchBackgroundColor).to.contain('rgba');
+ expect(anotherMatchBackgroundColor).to.contain('rgba');
+ expect(activeMatchBackgroundColor).not.to.be(anotherMatchBackgroundColor);
+ });
+
+ it('can navigate between matches', async () => {
+ await dataGrid.changeRowsPerPageTo(10);
+ await unifiedFieldList.clickFieldListItemAdd('extension');
+ await header.waitUntilLoadingHasFinished();
+ await discover.waitUntilSearchingHasFinished();
+ await queryBar.setQuery('response : 404 and @tags.raw : "info" and bytes < 1000');
+ await queryBar.submitQuery();
+ await header.waitUntilLoadingHasFinished();
+ await discover.waitUntilSearchingHasFinished();
+
+ await dataGrid.runInTableSearch('php');
+
+ expect(await dataGrid.getInTableSearchMatchesCounter()).to.be('1/4');
+ expect(await dataGrid.getCurrentPageNumber()).to.be('1');
+
+ await dataGrid.goToNextInTableSearchMatch();
+ expect(await dataGrid.getInTableSearchMatchesCounter()).to.be('2/4');
+ expect(await dataGrid.getCurrentPageNumber()).to.be('1');
+
+ await dataGrid.goToNextInTableSearchMatch();
+ expect(await dataGrid.getInTableSearchMatchesCounter()).to.be('3/4');
+ expect(await dataGrid.getCurrentPageNumber()).to.be('2');
+
+ await dataGrid.goToNextInTableSearchMatch();
+ expect(await dataGrid.getInTableSearchMatchesCounter()).to.be('4/4');
+ expect(await dataGrid.getCurrentPageNumber()).to.be('3');
+
+ await dataGrid.goToNextInTableSearchMatch();
+ expect(await dataGrid.getInTableSearchMatchesCounter()).to.be('1/4');
+ expect(await dataGrid.getCurrentPageNumber()).to.be('1');
+ });
+
+ it('overrides cmd+f if grid element was in focus', async () => {
+ const cell = await dataGrid.getCellElementByColumnName(0, '@timestamp');
+ await cell.click();
+
+ await browser.getActions().keyDown(Key.COMMAND).sendKeys('f').perform();
+ await retry.waitFor('in-table search input is visible', async () => {
+ return await testSubjects.exists(INPUT_TEST_SUBJ);
+ });
+ });
+ });
+}
diff --git a/test/functional/apps/discover/group2_data_grid2/index.ts b/test/functional/apps/discover/group2_data_grid2/index.ts
index 2a4f116ebb8e7..8e0b648051cf0 100644
--- a/test/functional/apps/discover/group2_data_grid2/index.ts
+++ b/test/functional/apps/discover/group2_data_grid2/index.ts
@@ -26,5 +26,6 @@ export default function ({ getService, loadTestFile }: FtrProviderContext) {
loadTestFile(require.resolve('./_data_grid_footer'));
loadTestFile(require.resolve('./_data_grid_field_data'));
loadTestFile(require.resolve('./_data_grid_field_tokens'));
+ loadTestFile(require.resolve('./_data_grid_in_table_search'));
});
}
diff --git a/test/functional/services/data_grid.ts b/test/functional/services/data_grid.ts
index 3b17a31d624b6..331038302a283 100644
--- a/test/functional/services/data_grid.ts
+++ b/test/functional/services/data_grid.ts
@@ -9,6 +9,14 @@
import { chunk } from 'lodash';
import { Key } from 'selenium-webdriver';
+import {
+ BUTTON_TEST_SUBJ,
+ INPUT_TEST_SUBJ,
+ BUTTON_PREV_TEST_SUBJ,
+ BUTTON_NEXT_TEST_SUBJ,
+ COUNTER_TEST_SUBJ,
+ HIGHLIGHT_CLASS_NAME,
+} from '@kbn/data-grid-in-table-search';
import { WebElementWrapper, CustomCheerioStatic } from '@kbn/ftr-common-functional-ui-services';
import { FtrService } from '../ftr_provider_context';
@@ -931,4 +939,66 @@ export class DataGridService extends FtrService {
public async exitComparisonMode() {
await this.testSubjects.click('unifiedDataTableExitDocumentComparison');
}
+
+ public async getCurrentPageNumber() {
+ const currentPage = await this.find.byCssSelector('.euiPaginationButton[aria-current="true"]');
+ return await currentPage.getVisibleText();
+ }
+
+ public async runInTableSearch(searchTerm: string) {
+ if (!(await this.testSubjects.exists(INPUT_TEST_SUBJ))) {
+ await this.testSubjects.click(BUTTON_TEST_SUBJ);
+ await this.retry.waitFor('input to appear', async () => {
+ return await this.testSubjects.exists(INPUT_TEST_SUBJ);
+ });
+ }
+ const prevCounter = await this.testSubjects.getVisibleText(COUNTER_TEST_SUBJ);
+ await this.testSubjects.setValue(INPUT_TEST_SUBJ, searchTerm);
+ await this.retry.waitFor('counter to change', async () => {
+ return (await this.testSubjects.getVisibleText(COUNTER_TEST_SUBJ)) !== prevCounter;
+ });
+ }
+
+ public async exitInTableSearch() {
+ if (!(await this.testSubjects.exists(INPUT_TEST_SUBJ))) {
+ return;
+ }
+ const input = await this.testSubjects.find(INPUT_TEST_SUBJ);
+ await input.pressKeys(this.browser.keys.ESCAPE);
+ await this.retry.waitFor('input to hide', async () => {
+ return (
+ !(await this.testSubjects.exists(INPUT_TEST_SUBJ)) &&
+ (await this.testSubjects.exists(BUTTON_TEST_SUBJ))
+ );
+ });
+ }
+
+ private async jumpToInTableSearchMatch(buttonTestSubj: string) {
+ const prevCounter = await this.testSubjects.getVisibleText(COUNTER_TEST_SUBJ);
+ await this.testSubjects.click(buttonTestSubj);
+ await this.retry.waitFor('counter to change', async () => {
+ return (await this.testSubjects.getVisibleText(COUNTER_TEST_SUBJ)) !== prevCounter;
+ });
+ }
+
+ public async goToPrevInTableSearchMatch() {
+ await this.jumpToInTableSearchMatch(BUTTON_PREV_TEST_SUBJ);
+ }
+
+ public async goToNextInTableSearchMatch() {
+ await this.jumpToInTableSearchMatch(BUTTON_NEXT_TEST_SUBJ);
+ }
+
+ public async getInTableSearchMatchesCounter() {
+ return (await this.testSubjects.getVisibleText(COUNTER_TEST_SUBJ)).trim();
+ }
+
+ public async getInTableSearchCellMatchElements(rowIndex: number, columnName: string) {
+ const cell = await this.getCellElementByColumnName(rowIndex, columnName);
+ return await cell.findAllByCssSelector(`.${HIGHLIGHT_CLASS_NAME}`);
+ }
+
+ public async getInTableSearchCellMatchesCount(rowIndex: number, columnName: string) {
+ return (await this.getInTableSearchCellMatchElements(rowIndex, columnName)).length;
+ }
}
diff --git a/test/tsconfig.json b/test/tsconfig.json
index d7e0de39d5e5e..7d4a23e791330 100644
--- a/test/tsconfig.json
+++ b/test/tsconfig.json
@@ -78,5 +78,6 @@
"@kbn/core-saved-objects-import-export-server-internal",
"@kbn/management-settings-ids",
"@kbn/core-deprecations-common",
+ "@kbn/data-grid-in-table-search",
]
}
diff --git a/tsconfig.base.json b/tsconfig.base.json
index 97896db9fc0f1..793665e7bc2d9 100644
--- a/tsconfig.base.json
+++ b/tsconfig.base.json
@@ -706,6 +706,8 @@
"@kbn/dashboard-plugin/*": ["src/platform/plugins/shared/dashboard/*"],
"@kbn/data-forge": ["x-pack/platform/packages/shared/kbn-data-forge"],
"@kbn/data-forge/*": ["x-pack/platform/packages/shared/kbn-data-forge/*"],
+ "@kbn/data-grid-in-table-search": ["src/platform/packages/shared/kbn-data-grid-in-table-search"],
+ "@kbn/data-grid-in-table-search/*": ["src/platform/packages/shared/kbn-data-grid-in-table-search/*"],
"@kbn/data-plugin": ["src/platform/plugins/shared/data"],
"@kbn/data-plugin/*": ["src/platform/plugins/shared/data/*"],
"@kbn/data-quality-plugin": ["x-pack/platform/plugins/shared/data_quality"],
diff --git a/yarn.lock b/yarn.lock
index 2728f6f9f191d..699c0a03e3203 100644
--- a/yarn.lock
+++ b/yarn.lock
@@ -5257,6 +5257,10 @@
version "0.0.0"
uid ""
+"@kbn/data-grid-in-table-search@link:src/platform/packages/shared/kbn-data-grid-in-table-search":
+ version "0.0.0"
+ uid ""
+
"@kbn/data-plugin@link:src/platform/plugins/shared/data":
version "0.0.0"
uid ""