Skip to content

Commit 52afd03

Browse files
committed
feat: Add input filter support to UITable
1 parent ad330b6 commit 52afd03

3 files changed

Lines changed: 46 additions & 38 deletions

File tree

plugins/ui/src/js/src/elements/UITable/UITable.tsx

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ import {
1717
useTheme,
1818
viewStyleProps,
1919
} from '@deephaven/components';
20+
import { useGlobalFilters } from '@deephaven/dashboard-core-plugins';
2021
import { useApi } from '@deephaven/jsapi-bootstrap';
2122
import { TableUtils } from '@deephaven/jsapi-utils';
2223
import type { dh as DhType } from '@deephaven/jsapi-types';
@@ -455,6 +456,8 @@ export function UITable({
455456
]
456457
);
457458

459+
const inputFilters = useGlobalFilters(model?.columns ?? EMPTY_ARRAY);
460+
458461
return model ? (
459462
<div
460463
// eslint-disable-next-line react/jsx-props-no-spreading
@@ -466,6 +469,7 @@ export function UITable({
466469
model={model}
467470
// eslint-disable-next-line react/jsx-props-no-spreading
468471
{...irisGridProps}
472+
inputFilters={inputFilters}
469473
/>
470474
</div>
471475
) : null;

plugins/ui/src/js/src/layout/ReactPanel.tsx

Lines changed: 41 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ import { nanoid } from 'nanoid';
44
import {
55
LayoutUtils,
66
PanelEvent,
7+
PanelIdContext,
78
useLayoutManager,
89
useListener,
910
} from '@deephaven/dashboard';
@@ -204,45 +205,47 @@ function ReactPanel({
204205
return portal
205206
? ReactDOM.createPortal(
206207
<ReactPanelContext.Provider value={panelId}>
207-
<View
208-
height="100%"
209-
width="100%"
210-
backgroundColor={backgroundColor}
211-
padding={padding}
212-
paddingTop={paddingTop}
213-
paddingBottom={paddingBottom}
214-
paddingStart={paddingStart}
215-
paddingEnd={paddingEnd}
216-
paddingX={paddingX}
217-
paddingY={paddingY}
218-
overflow={overflow}
219-
UNSAFE_style={UNSAFE_style}
220-
UNSAFE_className={
221-
UNSAFE_className == null
222-
? 'dh-react-panel'
223-
: `${UNSAFE_className} dh-react-panel`
224-
}
225-
>
226-
<Flex
227-
UNSAFE_className="dh-inner-react-panel"
228-
wrap={wrap}
229-
direction={direction}
230-
justifyContent={justifyContent}
231-
alignContent={alignContent}
232-
alignItems={alignItems}
233-
gap={gap}
234-
rowGap={rowGap}
235-
columnGap={columnGap}
208+
<PanelIdContext.Provider value={panelId}>
209+
<View
210+
height="100%"
211+
width="100%"
212+
backgroundColor={backgroundColor}
213+
padding={padding}
214+
paddingTop={paddingTop}
215+
paddingBottom={paddingBottom}
216+
paddingStart={paddingStart}
217+
paddingEnd={paddingEnd}
218+
paddingX={paddingX}
219+
paddingY={paddingY}
220+
overflow={overflow}
221+
UNSAFE_style={UNSAFE_style}
222+
UNSAFE_className={
223+
UNSAFE_className == null
224+
? 'dh-react-panel'
225+
: `${UNSAFE_className} dh-react-panel`
226+
}
236227
>
237-
<ReactPanelErrorBoundary>
238-
{/**
239-
* Don't render the children if there's an error with the widget. If there's an error with the widget, we can assume the children won't render properly,
240-
* but we still want the panels to appear so things don't disappear/jump around.
241-
*/}
242-
{renderedChildren ?? null}
243-
</ReactPanelErrorBoundary>
244-
</Flex>
245-
</View>
228+
<Flex
229+
UNSAFE_className="dh-inner-react-panel"
230+
wrap={wrap}
231+
direction={direction}
232+
justifyContent={justifyContent}
233+
alignContent={alignContent}
234+
alignItems={alignItems}
235+
gap={gap}
236+
rowGap={rowGap}
237+
columnGap={columnGap}
238+
>
239+
<ReactPanelErrorBoundary>
240+
{/**
241+
* Don't render the children if there's an error with the widget. If there's an error with the widget, we can assume the children won't render properly,
242+
* but we still want the panels to appear so things don't disappear/jump around.
243+
*/}
244+
{renderedChildren ?? null}
245+
</ReactPanelErrorBoundary>
246+
</Flex>
247+
</View>
248+
</PanelIdContext.Provider>
246249
</ReactPanelContext.Provider>,
247250
portal,
248251
contentKey

plugins/ui/src/js/vite.config.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ export default defineConfig(({ mode }) => ({
2121
'@deephaven/components',
2222
'@deephaven/console',
2323
'@deephaven/dashboard',
24+
'@deephaven/dashboard-core-plugins',
2425
'@deephaven/icons',
2526
'@deephaven/iris-grid',
2627
'@deephaven/jsapi-bootstrap',

0 commit comments

Comments
 (0)