@deephaven/storage 0.81.3-beta.0 → 0.81.3-beta.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.d.ts CHANGED
@@ -1,4 +1,3 @@
1
1
  export * from './Storage';
2
- export * from './StorageTableViewportUpdater';
3
2
  export * from './StorageUtils';
4
3
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,WAAW,CAAC;AAC1B,cAAc,+BAA+B,CAAC;AAC9C,cAAc,gBAAgB,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,WAAW,CAAC;AAC1B,cAAc,gBAAgB,CAAC"}
package/dist/index.js CHANGED
@@ -1,4 +1,3 @@
1
1
  export * from "./Storage.js";
2
- export * from "./StorageTableViewportUpdater.js";
3
2
  export * from "./StorageUtils.js";
4
3
  //# sourceMappingURL=index.js.map
package/dist/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","names":[],"sources":["../src/index.ts"],"sourcesContent":["export * from './Storage';\nexport * from './StorageTableViewportUpdater';\nexport * from './StorageUtils';\n"],"mappings":""}
1
+ {"version":3,"file":"index.js","names":[],"sources":["../src/index.ts"],"sourcesContent":["export * from './Storage';\nexport * from './StorageUtils';\n"],"mappings":""}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@deephaven/storage",
3
- "version": "0.81.3-beta.0+38c30df4",
3
+ "version": "0.81.3-beta.4+41233b5f",
4
4
  "description": "Deephaven Storage abstract classes for storing app data",
5
5
  "author": "Deephaven Data Labs LLC",
6
6
  "license": "Apache-2.0",
@@ -21,8 +21,8 @@
21
21
  "build:babel": "babel ./src --out-dir ./dist --extensions \".ts,.tsx,.js,.jsx\" --source-maps --root-mode upward"
22
22
  },
23
23
  "dependencies": {
24
- "@deephaven/filters": "^0.81.3-beta.0+38c30df4",
25
- "@deephaven/log": "^0.81.3-beta.0+38c30df4",
24
+ "@deephaven/filters": "^0.81.3-beta.4+41233b5f",
25
+ "@deephaven/log": "^0.81.3-beta.4+41233b5f",
26
26
  "lodash.throttle": "^4.1.1"
27
27
  },
28
28
  "peerDependencies": {
@@ -35,5 +35,5 @@
35
35
  "publishConfig": {
36
36
  "access": "public"
37
37
  },
38
- "gitHead": "38c30df41ced382ab14c6f720afc71479805d98d"
38
+ "gitHead": "41233b5f4ed49b8af63506ca5d2af6653ab5eb9c"
39
39
  }
@@ -1,14 +0,0 @@
1
- import { FilterConfig, SortConfig, StorageItem, StorageTable, ViewportUpdateCallback } from './Storage';
2
- export type StorageTableViewportUpdaterProps<T extends StorageItem> = {
3
- table: StorageTable<T>;
4
- columns?: string[];
5
- top?: number;
6
- bottom?: number;
7
- filters?: FilterConfig[];
8
- sorts?: SortConfig[];
9
- isReversed?: boolean;
10
- onUpdate: ViewportUpdateCallback<T>;
11
- };
12
- export declare function StorageTableViewportUpdater<T extends StorageItem = StorageItem>({ table, columns, top, bottom, filters, sorts, isReversed, onUpdate, }: StorageTableViewportUpdaterProps<T>): null;
13
- export default StorageTableViewportUpdater;
14
- //# sourceMappingURL=StorageTableViewportUpdater.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"StorageTableViewportUpdater.d.ts","sourceRoot":"","sources":["../src/StorageTableViewportUpdater.ts"],"names":[],"mappings":"AAGA,OAAO,EACL,YAAY,EACZ,UAAU,EACV,WAAW,EACX,YAAY,EAGZ,sBAAsB,EACvB,MAAM,WAAW,CAAC;AAEnB,MAAM,MAAM,gCAAgC,CAAC,CAAC,SAAS,WAAW,IAAI;IACpE,KAAK,EAAE,YAAY,CAAC,CAAC,CAAC,CAAC;IACvB,OAAO,CAAC,EAAE,MAAM,EAAE,CAAC;IACnB,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,OAAO,CAAC,EAAE,YAAY,EAAE,CAAC;IACzB,KAAK,CAAC,EAAE,UAAU,EAAE,CAAC;IACrB,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,QAAQ,EAAE,sBAAsB,CAAC,CAAC,CAAC,CAAC;CACrC,CAAC;AAQF,wBAAgB,2BAA2B,CACzC,CAAC,SAAS,WAAW,GAAG,WAAW,EACnC,EACA,KAAK,EACL,OAAO,EACP,GAAO,EACP,MAAU,EACV,OAAO,EACP,KAAK,EACL,UAAkB,EAClB,QAAQ,GACT,EAAE,gCAAgC,CAAC,CAAC,CAAC,GAAG,IAAI,CAyE5C;AAED,eAAe,2BAA2B,CAAC"}
@@ -1,63 +0,0 @@
1
- import { useEffect, useMemo } from 'react';
2
- import Log from '@deephaven/log';
3
- import throttle from 'lodash.throttle';
4
- var UPDATE_DELAY = 150;
5
- var ROW_BUFFER_PAGES = 3;
6
- var log = Log.module('StorageTableViewportUpdater');
7
- export function StorageTableViewportUpdater(_ref) {
8
- var {
9
- table,
10
- columns,
11
- top = 0,
12
- bottom = 0,
13
- filters,
14
- sorts,
15
- isReversed = false,
16
- onUpdate
17
- } = _ref;
18
- var throttledUpdateViewport = useMemo(() => throttle(viewport => {
19
- var viewHeight = viewport.bottom - viewport.top;
20
- var bufferedTop = Math.max(0, viewport.top - viewHeight * ROW_BUFFER_PAGES);
21
- var bufferedBottom = viewport.bottom + viewHeight * ROW_BUFFER_PAGES;
22
- table.setViewport({
23
- top: bufferedTop,
24
- bottom: bufferedBottom,
25
- columns: viewport.columns
26
- });
27
- }, UPDATE_DELAY), [table]);
28
- useEffect(function updateViewportAndReturnCleanup() {
29
- var cleanup = table.onUpdate(viewportData => {
30
- var _viewportData$items, _viewportData$offset;
31
- onUpdate({
32
- items: (_viewportData$items = viewportData.items) !== null && _viewportData$items !== void 0 ? _viewportData$items : [],
33
- offset: (_viewportData$offset = viewportData.offset) !== null && _viewportData$offset !== void 0 ? _viewportData$offset : 0
34
- });
35
- });
36
- return () => {
37
- log.debug('onUpdate cleanup');
38
- cleanup();
39
- };
40
- }, [table, onUpdate]);
41
- useEffect(function updateFilters() {
42
- table.setFilters(filters !== null && filters !== void 0 ? filters : null);
43
- }, [table, filters]);
44
- useEffect(function updateSorts() {
45
- table.setSorts(sorts !== null && sorts !== void 0 ? sorts : null);
46
- }, [table, sorts]);
47
- useEffect(function updateViewport() {
48
- throttledUpdateViewport({
49
- top,
50
- bottom,
51
- columns
52
- });
53
- }, [throttledUpdateViewport, top, bottom, columns, filters, sorts, isReversed]);
54
- useEffect(function cleanupUpdateViewport() {
55
- return () => {
56
- log.debug2('Cancel throttledUpdateViewport');
57
- throttledUpdateViewport.cancel();
58
- };
59
- }, [throttledUpdateViewport]);
60
- return null;
61
- }
62
- export default StorageTableViewportUpdater;
63
- //# sourceMappingURL=StorageTableViewportUpdater.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"StorageTableViewportUpdater.js","names":["useEffect","useMemo","Log","throttle","UPDATE_DELAY","ROW_BUFFER_PAGES","log","module","StorageTableViewportUpdater","_ref","table","columns","top","bottom","filters","sorts","isReversed","onUpdate","throttledUpdateViewport","viewport","viewHeight","bufferedTop","Math","max","bufferedBottom","setViewport","updateViewportAndReturnCleanup","cleanup","viewportData","_viewportData$items","_viewportData$offset","items","offset","debug","updateFilters","setFilters","updateSorts","setSorts","updateViewport","cleanupUpdateViewport","debug2","cancel"],"sources":["../src/StorageTableViewportUpdater.ts"],"sourcesContent":["import { useEffect, useMemo } from 'react';\nimport Log from '@deephaven/log';\nimport throttle from 'lodash.throttle';\nimport {\n FilterConfig,\n SortConfig,\n StorageItem,\n StorageTable,\n StorageTableViewport,\n ViewportData,\n ViewportUpdateCallback,\n} from './Storage';\n\nexport type StorageTableViewportUpdaterProps<T extends StorageItem> = {\n table: StorageTable<T>;\n columns?: string[];\n top?: number;\n bottom?: number;\n filters?: FilterConfig[];\n sorts?: SortConfig[];\n isReversed?: boolean;\n onUpdate: ViewportUpdateCallback<T>;\n};\n\nconst UPDATE_DELAY = 150;\n\nconst ROW_BUFFER_PAGES = 3;\n\nconst log = Log.module('StorageTableViewportUpdater');\n\nexport function StorageTableViewportUpdater<\n T extends StorageItem = StorageItem,\n>({\n table,\n columns,\n top = 0,\n bottom = 0,\n filters,\n sorts,\n isReversed = false,\n onUpdate,\n}: StorageTableViewportUpdaterProps<T>): null {\n const throttledUpdateViewport = useMemo(\n () =>\n throttle((viewport: StorageTableViewport) => {\n const viewHeight = viewport.bottom - viewport.top;\n const bufferedTop = Math.max(\n 0,\n viewport.top - viewHeight * ROW_BUFFER_PAGES\n );\n const bufferedBottom = viewport.bottom + viewHeight * ROW_BUFFER_PAGES;\n\n table.setViewport({\n top: bufferedTop,\n bottom: bufferedBottom,\n columns: viewport.columns,\n });\n }, UPDATE_DELAY),\n [table]\n );\n\n useEffect(\n function updateViewportAndReturnCleanup() {\n const cleanup = table.onUpdate((viewportData: ViewportData<T>) => {\n onUpdate({\n items: viewportData.items ?? [],\n offset: viewportData.offset ?? 0,\n });\n });\n\n return () => {\n log.debug('onUpdate cleanup');\n cleanup();\n };\n },\n [table, onUpdate]\n );\n\n useEffect(\n function updateFilters() {\n table.setFilters(filters ?? null);\n },\n [table, filters]\n );\n\n useEffect(\n function updateSorts() {\n table.setSorts(sorts ?? null);\n },\n [table, sorts]\n );\n\n useEffect(\n function updateViewport() {\n throttledUpdateViewport({\n top,\n bottom,\n columns,\n });\n },\n [throttledUpdateViewport, top, bottom, columns, filters, sorts, isReversed]\n );\n\n useEffect(\n function cleanupUpdateViewport() {\n return () => {\n log.debug2('Cancel throttledUpdateViewport');\n throttledUpdateViewport.cancel();\n };\n },\n [throttledUpdateViewport]\n );\n\n return null;\n}\n\nexport default StorageTableViewportUpdater;\n"],"mappings":"AAAA,SAASA,SAAS,EAAEC,OAAO,QAAQ,OAAO;AAC1C,OAAOC,GAAG,MAAM,gBAAgB;AAChC,OAAOC,QAAQ,MAAM,iBAAiB;AAsBtC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