diff --git a/packages/components/src/context-actions/ContextActions.tsx b/packages/components/src/context-actions/ContextActions.tsx index 285ad45d2..1840124d9 100644 --- a/packages/components/src/context-actions/ContextActions.tsx +++ b/packages/components/src/context-actions/ContextActions.tsx @@ -61,7 +61,7 @@ class ContextActions extends Component< * Items within groups are ordered by their order property, then by their title. */ static groups = { - default: null, + default: undefined, high: 100, medium: 5000, low: 10000, diff --git a/packages/storage/src/Storage.ts b/packages/storage/src/Storage.ts index 71b8e387b..a580a1713 100644 --- a/packages/storage/src/Storage.ts +++ b/packages/storage/src/Storage.ts @@ -1,4 +1,4 @@ -export type FilterValue = number | string; +export type FilterValue = number | string | string[]; export type FilterConfigItem = { columnName: string; diff --git a/packages/storage/src/StorageTableViewportUpdater.ts b/packages/storage/src/StorageTableViewportUpdater.ts index 529b4abec..6c15601f3 100644 --- a/packages/storage/src/StorageTableViewportUpdater.ts +++ b/packages/storage/src/StorageTableViewportUpdater.ts @@ -11,15 +11,15 @@ import { ViewportUpdateCallback, } from './Storage'; -export type StorageTableViewportUpdaterProps = { - table: StorageTable; +export type StorageTableViewportUpdaterProps = { + table: StorageTable; columns?: string[]; top?: number; bottom?: number; filters?: FilterConfig[]; sorts?: SortConfig[]; isReversed?: boolean; - onUpdate: ViewportUpdateCallback; + onUpdate: ViewportUpdateCallback; }; const UPDATE_DELAY = 150; @@ -28,7 +28,9 @@ const ROW_BUFFER_PAGES = 3; const log = Log.module('StorageTableViewportUpdater'); -export function StorageTableViewportUpdater({ +export function StorageTableViewportUpdater< + T extends StorageItem = StorageItem +>({ table, columns, top = 0, @@ -37,7 +39,7 @@ export function StorageTableViewportUpdater({ sorts, isReversed = false, onUpdate, -}: StorageTableViewportUpdaterProps): null { +}: StorageTableViewportUpdaterProps): null { const throttledUpdateViewport = useMemo( () => throttle((viewport: StorageTableViewport) => { @@ -59,14 +61,12 @@ export function StorageTableViewportUpdater({ useEffect( function updateViewportAndReturnCleanup() { - const cleanup = table.onUpdate( - (viewportData: ViewportData) => { - onUpdate({ - items: viewportData.items ?? [], - offset: viewportData.offset ?? 0, - }); - } - ); + const cleanup = table.onUpdate((viewportData: ViewportData) => { + onUpdate({ + items: viewportData.items ?? [], + offset: viewportData.offset ?? 0, + }); + }); return () => { log.debug('onUpdate cleanup');