Skip to content

Commit 4a6a55b

Browse files
committed
feat: Add input filter support to UITable
1 parent 9df65df commit 4a6a55b

3 files changed

Lines changed: 51 additions & 45 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
@@ -27,6 +27,7 @@ import {
2727
useTheme,
2828
viewStyleProps,
2929
} from '@deephaven/components';
30+
import { useGlobalFilters } from '@deephaven/dashboard-core-plugins';
3031
import { useApi } from '@deephaven/jsapi-bootstrap';
3132
import type { dh as DhType } from '@deephaven/jsapi-types';
3233
import Log from '@deephaven/log';
@@ -527,6 +528,8 @@ export function UITable({
527528
};
528529
}, [irisGridServerProps, initialHydratedState]);
529530

531+
const inputFilters = useGlobalFilters(model?.columns ?? EMPTY_ARRAY);
532+
530533
return model ? (
531534
<div
532535
// eslint-disable-next-line react/jsx-props-no-spreading
@@ -539,6 +542,7 @@ export function UITable({
539542
onStateChange={onStateChange}
540543
// eslint-disable-next-line react/jsx-props-no-spreading
541544
{...mergedIrisGridProps}
545+
inputFilters={inputFilters}
542546
/>
543547
</div>
544548
) : null;

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

Lines changed: 46 additions & 45 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ import { nanoid } from 'nanoid';
1010
import {
1111
LayoutUtils,
1212
PanelEvent,
13+
PanelIdContext,
1314
useLayoutManager,
1415
useListener,
1516
} from '@deephaven/dashboard';
@@ -218,52 +219,52 @@ function ReactPanel({
218219
return portal
219220
? ReactDOM.createPortal(
220221
<ReactPanelContext.Provider value={panelId}>
221-
<View
222-
height="100%"
223-
width="100%"
224-
backgroundColor={backgroundColor}
225-
padding={padding}
226-
paddingTop={paddingTop}
227-
paddingBottom={paddingBottom}
228-
paddingStart={paddingStart}
229-
paddingEnd={paddingEnd}
230-
paddingX={paddingX}
231-
paddingY={paddingY}
232-
overflow={overflow}
233-
UNSAFE_style={UNSAFE_style}
234-
UNSAFE_className={
235-
UNSAFE_className == null
236-
? 'dh-react-panel'
237-
: `${UNSAFE_className} dh-react-panel`
238-
}
239-
>
240-
<Flex
241-
UNSAFE_className="dh-inner-react-panel"
242-
wrap={wrap}
243-
direction={direction}
244-
justifyContent={justifyContent}
245-
alignContent={alignContent}
246-
alignItems={alignItems}
247-
gap={gap}
248-
rowGap={rowGap}
249-
columnGap={columnGap}
222+
<PanelIdContext.Provider value={panelId}>
223+
<View
224+
height="100%"
225+
width="100%"
226+
backgroundColor={backgroundColor}
227+
padding={padding}
228+
paddingTop={paddingTop}
229+
paddingBottom={paddingBottom}
230+
paddingStart={paddingStart}
231+
paddingEnd={paddingEnd}
232+
paddingX={paddingX}
233+
paddingY={paddingY}
234+
overflow={overflow}
235+
UNSAFE_style={UNSAFE_style}
236+
UNSAFE_className={
237+
UNSAFE_className == null
238+
? 'dh-react-panel'
239+
: `${UNSAFE_className} dh-react-panel`
240+
}
250241
>
251-
<ReactPanelErrorBoundary onReset={onErrorReset}>
252-
{/**
253-
* 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,
254-
* but we still want the panels to appear so things don't disappear/jump around.
255-
*/}
256-
<PersistentStateProvider
257-
initialState={initialData}
258-
onChange={onDataChange}
259-
>
260-
{React.Children.map(renderedChildren, child =>
261-
React.cloneElement(child as React.ReactElement)
262-
)}
263-
</PersistentStateProvider>
264-
</ReactPanelErrorBoundary>
265-
</Flex>
266-
</View>
242+
<Flex
243+
UNSAFE_className="dh-inner-react-panel"
244+
wrap={wrap}
245+
direction={direction}
246+
justifyContent={justifyContent}
247+
alignContent={alignContent}
248+
alignItems={alignItems}
249+
gap={gap}
250+
rowGap={rowGap}
251+
columnGap={columnGap}
252+
>
253+
<ReactPanelErrorBoundary onReset={onErrorReset}>
254+
{/**
255+
* 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,
256+
* but we still want the panels to appear so things don't disappear/jump around.
257+
*/}
258+
<PersistentStateProvider
259+
initialState={initialData}
260+
onChange={onDataChange}
261+
>
262+
{renderedChildren ?? null}
263+
</PersistentStateProvider>
264+
</ReactPanelErrorBoundary>
265+
</Flex>
266+
</View>
267+
</PanelIdContext.Provider>
267268
</ReactPanelContext.Provider>,
268269
portal,
269270
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)