Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: Add ui.table reverse prop #629

Merged
merged 1 commit into from
Jul 16, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
30 changes: 16 additions & 14 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 2 additions & 0 deletions plugins/ui/src/deephaven/ui/components/table.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ def table(
quick_filters: dict[ColumnName, QuickFilterExpression] | None = None,
show_quick_filters: bool = False,
show_search: bool = False,
reverse: bool = False,
front_columns: list[ColumnName] | None = None,
back_columns: list[ColumnName] | None = None,
frozen_columns: list[ColumnName] | None = None,
Expand Down Expand Up @@ -59,6 +60,7 @@ def table(
quick_filters: The quick filters to apply to the table. Dictionary of column name to filter value.
show_quick_filters: Whether to show the quick filter bar by default.
show_search: Whether to show the search bar by default.
reverse: Whether to reverse the table rows. Applied after any sorts.
front_columns: The columns to pin to the front of the table. These will not be movable by the user.
back_columns: The columns to pin to the back of the table. These will not be movable by the user.
frozen_columns: The columns to freeze by default at the front of the table.
Expand Down
1 change: 1 addition & 0 deletions plugins/ui/src/js/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@
"@deephaven/jsapi-bootstrap": "^0.85.1",
"@deephaven/jsapi-components": "^0.85.1",
"@deephaven/jsapi-types": "^1.0.0-dev0.35.0",
"@deephaven/jsapi-utils": "^0.85.2",
"@deephaven/log": "^0.85.0",
"@deephaven/plugin": "^0.85.1",
"@deephaven/react-hooks": "^0.85.0",
Expand Down
6 changes: 6 additions & 0 deletions plugins/ui/src/js/src/elements/UITable/UITable.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ import {
IrisGridUtils,
} from '@deephaven/iris-grid';
import { useApi } from '@deephaven/jsapi-bootstrap';
import { TableUtils } from '@deephaven/jsapi-utils';
import type { dh } from '@deephaven/jsapi-types';
import Log from '@deephaven/log';
import { getSettings, RootState } from '@deephaven/redux';
Expand All @@ -35,6 +36,7 @@ export function UITable({
table: exportedTable,
showSearch: showSearchBar,
showQuickFilters,
reverse,
frontColumns,
backColumns,
frozenColumns,
Expand Down Expand Up @@ -165,6 +167,9 @@ export function UITable({
sorts: hydratedSorts,
quickFilters: hydratedQuickFilters,
isFilterBarShown: showQuickFilters,
reverseType: reverse
? TableUtils.REVERSE_TYPE.POST_SORT
: TableUtils.REVERSE_TYPE.NONE,
settings,
onContextMenu,
}) satisfies Partial<IrisGridProps>,
Expand All @@ -175,6 +180,7 @@ export function UITable({
showQuickFilters,
hydratedSorts,
hydratedQuickFilters,
reverse,
settings,
onContextMenu,
]
Expand Down
1 change: 1 addition & 0 deletions plugins/ui/src/js/src/elements/UITable/UITableUtils.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,7 @@ export type UITableProps = {
sorts?: DehydratedSort[];
showSearch: boolean;
showQuickFilters: boolean;
reverse: boolean;
frontColumns?: string[];
backColumns?: string[];
frozenColumns?: string[];
Expand Down
Loading