Add power search config to data table column config

Summary: Doc: https://docs.google.com/document/d/1miofxds9DJgWScj0zFyBbdpRH5Rj0T9FqiCapof5-vU/edit#heading=h.pg8svtdjlx7

Reviewed By: lblasa

Differential Revision: D48866308

fbshipit-source-id: 72ed7eb1401e44722d9bb9e680d6fa5d558b8eed
This commit is contained in:
Andrey Goncharov
2023-09-14 04:48:12 -07:00
committed by Facebook GitHub Bot
parent cb5b3d9f28
commit af73cbb669
3 changed files with 11 additions and 11 deletions

View File

@@ -116,6 +116,7 @@ test('Correct top level API exposed', () => {
"ElementSearchResultSet",
"ElementsInspectorElement",
"ElementsInspectorProps",
"FieldConfig",
"FileDescriptor",
"FileEncoding",
"FlipperLib",
@@ -129,9 +130,11 @@ test('Correct top level API exposed', () => {
"MenuEntry",
"NormalizedMenuEntry",
"Notification",
"OperatorConfig",
"PluginClient",
"PowerSearchConfig",
"RemoteServerContext",
"SearchExpressionTerm",
"ServerAddOn",
"ServerAddOnPluginConnection",
]

View File

@@ -9,7 +9,11 @@
import * as React from 'react';
import {Space} from 'antd';
import {PowerSearchConfig} from './PowerSearchConfig';
import {
PowerSearchConfig,
FieldConfig,
OperatorConfig,
} from './PowerSearchConfig';
import {PowerSearchContainer} from './PowerSearchContainer';
import {
PowerSearchTermFinder,
@@ -25,7 +29,7 @@ import {useLatestRef} from '../../utils/useLatestRef';
import {useUpdateEffect} from 'react-use';
import {theme} from '../theme';
export {PowerSearchConfig};
export {PowerSearchConfig, OperatorConfig, FieldConfig, SearchExpressionTerm};
type PowerSearchProps = {
config: PowerSearchConfig;

View File

@@ -57,7 +57,7 @@ import {
} from 'flipper-plugin-core';
import {HighlightProvider} from '../Highlight';
import {useLatestRef} from '../../utils/useLatestRef';
import {PowerSearch} from '../PowerSearch';
import {PowerSearch, OperatorConfig} from '../PowerSearch';
import {powerSearchExampleConfig} from '../PowerSearch/PowerSearchExampleConfig';
type DataTableBaseProps<T = any> = {
@@ -115,16 +115,9 @@ export type DataTableColumn<T = any> = {
wrap?: boolean;
align?: 'left' | 'right' | 'center';
visible?: boolean;
filters?: {
label: string;
value: string;
enabled: boolean;
predefined?: boolean;
strict?: boolean;
exact?: boolean;
}[];
inversed?: boolean;
sortable?: boolean;
powerSearchConfig?: {[key: string]: OperatorConfig};
};
export interface TableRowRenderContext<T = any> {