@deephaven/jsapi-components 0.70.0 → 0.70.1-alpha-picker-table.35
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 +2 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +2 -0
- package/dist/index.js.map +1 -1
- package/dist/spectrum/Picker/Picker.d.ts +11 -0
- package/dist/spectrum/Picker/Picker.d.ts.map +1 -0
- package/dist/spectrum/Picker/Picker.js +75 -0
- package/dist/spectrum/Picker/Picker.js.map +1 -0
- package/dist/spectrum/Picker/PickerUtils.d.ts +17 -0
- package/dist/spectrum/Picker/PickerUtils.d.ts.map +1 -0
- package/dist/spectrum/Picker/PickerUtils.js +21 -0
- package/dist/spectrum/Picker/PickerUtils.js.map +1 -0
- package/dist/spectrum/Picker/index.d.ts +3 -0
- package/dist/spectrum/Picker/index.d.ts.map +1 -0
- package/dist/spectrum/Picker/index.js +3 -0
- package/dist/spectrum/Picker/index.js.map +1 -0
- package/dist/spectrum/Picker/usePickerItemRowDeserializer.d.ts +18 -0
- package/dist/spectrum/Picker/usePickerItemRowDeserializer.d.ts.map +1 -0
- package/dist/spectrum/Picker/usePickerItemRowDeserializer.js +40 -0
- package/dist/spectrum/Picker/usePickerItemRowDeserializer.js.map +1 -0
- package/dist/spectrum/index.d.ts +2 -0
- package/dist/spectrum/index.d.ts.map +1 -0
- package/dist/spectrum/index.js +2 -0
- package/dist/spectrum/index.js.map +1 -0
- package/dist/useGetItemIndexByValue.d.ts +17 -0
- package/dist/useGetItemIndexByValue.d.ts.map +1 -0
- package/dist/useGetItemIndexByValue.js +32 -0
- package/dist/useGetItemIndexByValue.js.map +1 -0
- package/dist/useInitializeViewportData.d.ts +12 -1
- package/dist/useInitializeViewportData.d.ts.map +1 -1
- package/dist/useInitializeViewportData.js +59 -11
- package/dist/useInitializeViewportData.js.map +1 -1
- package/dist/useViewportData.d.ts +4 -1
- package/dist/useViewportData.d.ts.map +1 -1
- package/dist/useViewportData.js +5 -2
- package/dist/useViewportData.js.map +1 -1
- package/package.json +9 -9
package/dist/index.d.ts
CHANGED
|
@@ -2,6 +2,7 @@ export * from './HookTestUtils';
|
|
|
2
2
|
export { default as TableInput } from './TableInput';
|
|
3
3
|
export * from './RefreshTokenBootstrap';
|
|
4
4
|
export * from './RefreshTokenUtils';
|
|
5
|
+
export * from './spectrum';
|
|
5
6
|
export * from './TableDropdown';
|
|
6
7
|
export { default as useBroadcastChannel } from './useBroadcastChannel';
|
|
7
8
|
export { default as useBroadcastLoginListener } from './useBroadcastLoginListener';
|
|
@@ -10,6 +11,7 @@ export { default as useDebouncedViewportSearch } from './useDebouncedViewportSea
|
|
|
10
11
|
export * from './useDebouncedViewportSelectionFilter';
|
|
11
12
|
export * from './useFilterConditionFactories';
|
|
12
13
|
export * from './useFilteredItemsWithDefaultValue';
|
|
14
|
+
export * from './useGetItemIndexByValue';
|
|
13
15
|
export * from './useGetItemPosition';
|
|
14
16
|
export { default as useInitializeViewportData } from './useInitializeViewportData';
|
|
15
17
|
export * from './useSearchableViewportData';
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,iBAAiB,CAAC;AAChC,OAAO,EAAE,OAAO,IAAI,UAAU,EAAE,MAAM,cAAc,CAAC;AACrD,cAAc,yBAAyB,CAAC;AACxC,cAAc,qBAAqB,CAAC;AACpC,cAAc,iBAAiB,CAAC;AAChC,OAAO,EAAE,OAAO,IAAI,mBAAmB,EAAE,MAAM,uBAAuB,CAAC;AACvE,OAAO,EAAE,OAAO,IAAI,yBAAyB,EAAE,MAAM,6BAA6B,CAAC;AACnF,cAAc,yBAAyB,CAAC;AACxC,OAAO,EAAE,OAAO,IAAI,0BAA0B,EAAE,MAAM,8BAA8B,CAAC;AACrF,cAAc,uCAAuC,CAAC;AACtD,cAAc,+BAA+B,CAAC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CAAC;AAC/D,cAAc,qBAAqB,CAAC"}
|
package/dist/index.js
CHANGED
|
@@ -2,6 +2,7 @@ export * from "./HookTestUtils.js";
|
|
|
2
2
|
export { default as TableInput } from "./TableInput.js";
|
|
3
3
|
export * from "./RefreshTokenBootstrap.js";
|
|
4
4
|
export * from "./RefreshTokenUtils.js";
|
|
5
|
+
export * from "./spectrum/index.js";
|
|
5
6
|
export * from "./TableDropdown.js";
|
|
6
7
|
export { default as useBroadcastChannel } from "./useBroadcastChannel.js";
|
|
7
8
|
export { default as useBroadcastLoginListener } from "./useBroadcastLoginListener.js";
|
|
@@ -10,6 +11,7 @@ export { default as useDebouncedViewportSearch } from "./useDebouncedViewportSea
|
|
|
10
11
|
export * from "./useDebouncedViewportSelectionFilter.js";
|
|
11
12
|
export * from "./useFilterConditionFactories.js";
|
|
12
13
|
export * from "./useFilteredItemsWithDefaultValue.js";
|
|
14
|
+
export * from "./useGetItemIndexByValue.js";
|
|
13
15
|
export * from "./useGetItemPosition.js";
|
|
14
16
|
export { default as useInitializeViewportData } from "./useInitializeViewportData.js";
|
|
15
17
|
export * from "./useSearchableViewportData.js";
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","names":["default","TableInput","useBroadcastChannel","useBroadcastLoginListener","useDebouncedViewportSearch","useInitializeViewportData","useSelectDistinctTable","useSetPaddedViewportCallback","useTable","useTableColumn","useTableListener","useTableClose","useTableSize","useTableUtils","useViewportData"],"sources":["../src/index.ts"],"sourcesContent":["export * from './HookTestUtils';\nexport { default as TableInput } from './TableInput';\nexport * from './RefreshTokenBootstrap';\nexport * from './RefreshTokenUtils';\nexport * from './TableDropdown';\nexport { default as useBroadcastChannel } from './useBroadcastChannel';\nexport { default as useBroadcastLoginListener } from './useBroadcastLoginListener';\nexport * from './useCheckIfExistsValue';\nexport { default as useDebouncedViewportSearch } from './useDebouncedViewportSearch';\nexport * from './useDebouncedViewportSelectionFilter';\nexport * from './useFilterConditionFactories';\nexport * from './useFilteredItemsWithDefaultValue';\nexport * from './useGetItemPosition';\nexport { default as useInitializeViewportData } from './useInitializeViewportData';\nexport * from './useSearchableViewportData';\nexport * from './useNotNullOrEmptyFilter';\nexport * from './usePickerWithSelectedValues';\nexport { default as useSelectDistinctTable } from './useSelectDistinctTable';\nexport { default as useSetPaddedViewportCallback } from './useSetPaddedViewportCallback';\nexport * from './useShowOnlyEmptyFilter';\nexport { default as useTable } from './useTable';\nexport { default as useTableColumn } from './useTableColumn';\nexport { default as useTableListener } from './useTableListener';\nexport { default as useTableClose } from './useTableClose';\nexport { default as useTableSize } from './useTableSize';\nexport { default as useTableUtils } from './useTableUtils';\nexport * from './useValueFilter';\nexport { default as useViewportData } from './useViewportData';\nexport type { UseSelectDistinctTableResult } from './useSelectDistinctTable';\nexport type { UseViewportDataResult } from './useViewportData';\nexport * from './useViewportFilter';\n"],"mappings":";SACSA,OAAO,IAAIC,UAAU;AAAA;AAAA;AAAA;AAAA,
|
|
1
|
+
{"version":3,"file":"index.js","names":["default","TableInput","useBroadcastChannel","useBroadcastLoginListener","useDebouncedViewportSearch","useInitializeViewportData","useSelectDistinctTable","useSetPaddedViewportCallback","useTable","useTableColumn","useTableListener","useTableClose","useTableSize","useTableUtils","useViewportData"],"sources":["../src/index.ts"],"sourcesContent":["export * from './HookTestUtils';\nexport { default as TableInput } from './TableInput';\nexport * from './RefreshTokenBootstrap';\nexport * from './RefreshTokenUtils';\nexport * from './spectrum';\nexport * from './TableDropdown';\nexport { default as useBroadcastChannel } from './useBroadcastChannel';\nexport { default as useBroadcastLoginListener } from './useBroadcastLoginListener';\nexport * from './useCheckIfExistsValue';\nexport { default as useDebouncedViewportSearch } from './useDebouncedViewportSearch';\nexport * from './useDebouncedViewportSelectionFilter';\nexport * from './useFilterConditionFactories';\nexport * from './useFilteredItemsWithDefaultValue';\nexport * from './useGetItemIndexByValue';\nexport * from './useGetItemPosition';\nexport { default as useInitializeViewportData } from './useInitializeViewportData';\nexport * from './useSearchableViewportData';\nexport * from './useNotNullOrEmptyFilter';\nexport * from './usePickerWithSelectedValues';\nexport { default as useSelectDistinctTable } from './useSelectDistinctTable';\nexport { default as useSetPaddedViewportCallback } from './useSetPaddedViewportCallback';\nexport * from './useShowOnlyEmptyFilter';\nexport { default as useTable } from './useTable';\nexport { default as useTableColumn } from './useTableColumn';\nexport { default as useTableListener } from './useTableListener';\nexport { default as useTableClose } from './useTableClose';\nexport { default as useTableSize } from './useTableSize';\nexport { default as useTableUtils } from './useTableUtils';\nexport * from './useValueFilter';\nexport { default as useViewportData } from './useViewportData';\nexport type { UseSelectDistinctTableResult } from './useSelectDistinctTable';\nexport type { UseViewportDataResult } from './useViewportData';\nexport * from './useViewportFilter';\n"],"mappings":";SACSA,OAAO,IAAIC,UAAU;AAAA;AAAA;AAAA;AAAA;AAAA,SAKrBD,OAAO,IAAIE,mBAAmB;AAAA,SAC9BF,OAAO,IAAIG,yBAAyB;AAAA;AAAA,SAEpCH,OAAO,IAAII,0BAA0B;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,SAMrCJ,OAAO,IAAIK,yBAAyB;AAAA;AAAA;AAAA;AAAA,SAIpCL,OAAO,IAAIM,sBAAsB;AAAA,SACjCN,OAAO,IAAIO,4BAA4B;AAAA;AAAA,SAEvCP,OAAO,IAAIQ,QAAQ;AAAA,SACnBR,OAAO,IAAIS,cAAc;AAAA,SACzBT,OAAO,IAAIU,gBAAgB;AAAA,SAC3BV,OAAO,IAAIW,aAAa;AAAA,SACxBX,OAAO,IAAIY,YAAY;AAAA,SACvBZ,OAAO,IAAIa,aAAa;AAAA;AAAA,SAExBb,OAAO,IAAIc,eAAe;AAAA"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import { PickerProps as PickerPropsBase } from '@deephaven/components';
|
|
3
|
+
import { dh } from '@deephaven/jsapi-types';
|
|
4
|
+
export interface PickerProps extends Omit<PickerPropsBase, 'children'> {
|
|
5
|
+
table: dh.Table;
|
|
6
|
+
keyColumn?: string;
|
|
7
|
+
labelColumn?: string;
|
|
8
|
+
}
|
|
9
|
+
export declare function Picker({ table, keyColumn: keyColumnName, labelColumn: labelColumnName, selectedKey, ...props }: PickerProps): JSX.Element;
|
|
10
|
+
export default Picker;
|
|
11
|
+
//# sourceMappingURL=Picker.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Picker.d.ts","sourceRoot":"","sources":["../../../src/spectrum/Picker/Picker.tsx"],"names":[],"mappings":";AAAA,OAAO,EAGL,WAAW,IAAI,eAAe,EAC/B,MAAM,uBAAuB,CAAC;AAC/B,OAAO,EAAE,EAAE,EAAE,MAAM,wBAAwB,CAAC;AAQ5C,MAAM,WAAW,WAAY,SAAQ,IAAI,CAAC,eAAe,EAAE,UAAU,CAAC;IACpE,KAAK,EAAE,EAAE,CAAC,KAAK,CAAC;IAEhB,SAAS,CAAC,EAAE,MAAM,CAAC;IAEnB,WAAW,CAAC,EAAE,MAAM,CAAC;CACtB;AAED,wBAAgB,MAAM,CAAC,EACrB,KAAK,EACL,SAAS,EAAE,aAAa,EACxB,WAAW,EAAE,eAAe,EAC5B,WAAW,EACX,GAAG,KAAK,EACT,EAAE,WAAW,GAAG,GAAG,CAAC,OAAO,CA8D3B;AAED,eAAe,MAAM,CAAC"}
|
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
var _excluded = ["table", "keyColumn", "labelColumn", "selectedKey"];
|
|
2
|
+
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
3
|
+
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
4
|
+
function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
5
|
+
function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return typeof key === "symbol" ? key : String(key); }
|
|
6
|
+
function _toPrimitive(input, hint) { if (typeof input !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (typeof res !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); }
|
|
7
|
+
function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) { try { var info = gen[key](arg); var value = info.value; } catch (error) { reject(error); return; } if (info.done) { resolve(value); } else { Promise.resolve(value).then(_next, _throw); } }
|
|
8
|
+
function _asyncToGenerator(fn) { return function () { var self = this, args = arguments; return new Promise(function (resolve, reject) { var gen = fn.apply(self, args); function _next(value) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value); } function _throw(err) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err); } _next(undefined); }); }; }
|
|
9
|
+
function _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }
|
|
10
|
+
function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }
|
|
11
|
+
import { Picker as PickerBase } from '@deephaven/components';
|
|
12
|
+
import { PICKER_ITEM_HEIGHT, PICKER_TOP_OFFSET } from '@deephaven/utils';
|
|
13
|
+
import { useCallback, useEffect, useMemo } from 'react';
|
|
14
|
+
import useGetItemIndexByValue from "../../useGetItemIndexByValue.js";
|
|
15
|
+
import { useViewportData } from "../../useViewportData.js";
|
|
16
|
+
import { getPickerKeyColumn } from "./PickerUtils.js";
|
|
17
|
+
import { usePickerItemRowDeserializer } from "./usePickerItemRowDeserializer.js";
|
|
18
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
19
|
+
export function Picker(_ref) {
|
|
20
|
+
var {
|
|
21
|
+
table,
|
|
22
|
+
keyColumn: keyColumnName,
|
|
23
|
+
labelColumn: labelColumnName,
|
|
24
|
+
selectedKey
|
|
25
|
+
} = _ref,
|
|
26
|
+
props = _objectWithoutProperties(_ref, _excluded);
|
|
27
|
+
var keyColumn = useMemo(() => getPickerKeyColumn(table, keyColumnName), [keyColumnName, table]);
|
|
28
|
+
var deserializeRow = usePickerItemRowDeserializer({
|
|
29
|
+
table,
|
|
30
|
+
keyColumnName,
|
|
31
|
+
labelColumnName
|
|
32
|
+
});
|
|
33
|
+
var getItemIndexByValue = useGetItemIndexByValue({
|
|
34
|
+
table,
|
|
35
|
+
columnName: keyColumn.name,
|
|
36
|
+
value: selectedKey
|
|
37
|
+
});
|
|
38
|
+
var getInitialScrollPosition = useCallback( /*#__PURE__*/_asyncToGenerator(function* () {
|
|
39
|
+
var index = yield getItemIndexByValue();
|
|
40
|
+
if (index == null) {
|
|
41
|
+
return null;
|
|
42
|
+
}
|
|
43
|
+
return index * PICKER_ITEM_HEIGHT + PICKER_TOP_OFFSET;
|
|
44
|
+
}), [getItemIndexByValue]);
|
|
45
|
+
var {
|
|
46
|
+
viewportData,
|
|
47
|
+
onScroll,
|
|
48
|
+
setViewport
|
|
49
|
+
} = useViewportData({
|
|
50
|
+
reuseItemsOnTableResize: true,
|
|
51
|
+
table,
|
|
52
|
+
itemHeight: PICKER_ITEM_HEIGHT,
|
|
53
|
+
deserializeRow
|
|
54
|
+
});
|
|
55
|
+
useEffect(
|
|
56
|
+
// Set viewport to include the selected item so that its data will load and
|
|
57
|
+
// the real `key` will be available to show the selection in the UI.
|
|
58
|
+
function setViewportFromSelectedKey() {
|
|
59
|
+
getItemIndexByValue().then(index => {
|
|
60
|
+
if (index != null) {
|
|
61
|
+
setViewport(index);
|
|
62
|
+
}
|
|
63
|
+
});
|
|
64
|
+
}, [getItemIndexByValue, setViewport]);
|
|
65
|
+
return /*#__PURE__*/_jsx(PickerBase
|
|
66
|
+
// eslint-disable-next-line react/jsx-props-no-spreading
|
|
67
|
+
, _objectSpread(_objectSpread({}, props), {}, {
|
|
68
|
+
getInitialScrollPosition: getInitialScrollPosition,
|
|
69
|
+
selectedKey: selectedKey,
|
|
70
|
+
onScroll: onScroll,
|
|
71
|
+
children: viewportData.items
|
|
72
|
+
}));
|
|
73
|
+
}
|
|
74
|
+
export default Picker;
|
|
75
|
+
//# sourceMappingURL=Picker.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Picker.js","names":["Picker","PickerBase","PICKER_ITEM_HEIGHT","PICKER_TOP_OFFSET","useCallback","useEffect","useMemo","useGetItemIndexByValue","useViewportData","getPickerKeyColumn","usePickerItemRowDeserializer","jsx","_jsx","_ref","table","keyColumn","keyColumnName","labelColumn","labelColumnName","selectedKey","props","_objectWithoutProperties","_excluded","deserializeRow","getItemIndexByValue","columnName","name","value","getInitialScrollPosition","_asyncToGenerator","index","viewportData","onScroll","setViewport","reuseItemsOnTableResize","itemHeight","setViewportFromSelectedKey","then","_objectSpread","children","items"],"sources":["../../../src/spectrum/Picker/Picker.tsx"],"sourcesContent":["import {\n NormalizedPickerItemData,\n Picker as PickerBase,\n PickerProps as PickerPropsBase,\n} from '@deephaven/components';\nimport { dh } from '@deephaven/jsapi-types';\nimport { PICKER_ITEM_HEIGHT, PICKER_TOP_OFFSET } from '@deephaven/utils';\nimport { useCallback, useEffect, useMemo } from 'react';\nimport useGetItemIndexByValue from '../../useGetItemIndexByValue';\nimport { useViewportData } from '../../useViewportData';\nimport { getPickerKeyColumn } from './PickerUtils';\nimport { usePickerItemRowDeserializer } from './usePickerItemRowDeserializer';\n\nexport interface PickerProps extends Omit<PickerPropsBase, 'children'> {\n table: dh.Table;\n /* The column of values to use as item keys. Defaults to the first column. */\n keyColumn?: string;\n /* The column of values to display as primary text. Defaults to the `keyColumn` value. */\n labelColumn?: string;\n}\n\nexport function Picker({\n table,\n keyColumn: keyColumnName,\n labelColumn: labelColumnName,\n selectedKey,\n ...props\n}: PickerProps): JSX.Element {\n const keyColumn = useMemo(\n () => getPickerKeyColumn(table, keyColumnName),\n [keyColumnName, table]\n );\n\n const deserializeRow = usePickerItemRowDeserializer({\n table,\n keyColumnName,\n labelColumnName,\n });\n\n const getItemIndexByValue = useGetItemIndexByValue({\n table,\n columnName: keyColumn.name,\n value: selectedKey,\n });\n\n const getInitialScrollPosition = useCallback(async () => {\n const index = await getItemIndexByValue();\n\n if (index == null) {\n return null;\n }\n\n return index * PICKER_ITEM_HEIGHT + PICKER_TOP_OFFSET;\n }, [getItemIndexByValue]);\n\n const { viewportData, onScroll, setViewport } = useViewportData<\n NormalizedPickerItemData,\n dh.Table\n >({\n reuseItemsOnTableResize: true,\n table,\n itemHeight: PICKER_ITEM_HEIGHT,\n deserializeRow,\n });\n\n useEffect(\n // Set viewport to include the selected item so that its data will load and\n // the real `key` will be available to show the selection in the UI.\n function setViewportFromSelectedKey() {\n getItemIndexByValue().then(index => {\n if (index != null) {\n setViewport(index);\n }\n });\n },\n [getItemIndexByValue, setViewport]\n );\n\n return (\n <PickerBase\n // eslint-disable-next-line react/jsx-props-no-spreading\n {...props}\n getInitialScrollPosition={getInitialScrollPosition}\n selected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Q;IAAEC;EAAY,CAAC,GAAGzB,eAAe,CAG7D;IACA0B,uBAAuB,EAAE,IAAI;IAC7BpB,KAAK;IACLqB,UAAU,EAAEjC,kBAAkB;IAC9BqB;EACF,CAAC,CAAC;EAEFlB,SAAS;EACP;EACA;EACA,SAAS+B,0BAA0BA,CAAA,EAAG;IACpCZ,mBAAmB,CAAC,CAAC,CAACa,IAAI,CAACP,KAAK,IAAI;MAClC,IAAIA,KAAK,IAAI,IAAI,EAAE;QACjBG,WAAW,CAACH,KAAK,CAAC;MACpB;IACF,CAAC,CAAC;EACJ,CAAC,EACD,CAACN,mBAAmB,EAAES,WAAW,CACnC,CAAC;EAED,oBACErB,IAAA,CAACX;EACC;EAAA,EAAAqC,aAAA,CAAAA,aAAA,KACIlB,KAAK;IACTQ,wBAAwB,EAAEA,wBAAyB;IACnDT,WAAW,EAAEA,WAAY;IACzBa,QAAQ,EAAEA,QAAS;IAAAO,QAAA,EAElBR,YAAY,CAACS;EAAK,EACT,CAAC;AAEjB;AAEA,eAAexC,MAAM"}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { dh } from '@deephaven/jsapi-types';
|
|
2
|
+
/**
|
|
3
|
+
* Get the key column if column name is provided, otherwise use the first column.
|
|
4
|
+
* @param table The table to get the key column from
|
|
5
|
+
* @param keyColumnName The name of the column to use for key data
|
|
6
|
+
* @returns DH Column containing the key values
|
|
7
|
+
*/
|
|
8
|
+
export declare function getPickerKeyColumn(table: dh.Table, keyColumnName?: string): dh.Column;
|
|
9
|
+
/**
|
|
10
|
+
* Get the label column if column name is provided, otherwise use the key column.
|
|
11
|
+
* @param table The table to get the label column from
|
|
12
|
+
* @param keyColumn The key column to fallback to if the label column name is not provided
|
|
13
|
+
* @param labelColumnName The name of the column to use for label data
|
|
14
|
+
* @returns DH Column containing the label values
|
|
15
|
+
*/
|
|
16
|
+
export declare function getPickerLabelColumn(table: dh.Table, keyColumn: dh.Column, labelColumnName?: string): dh.Column;
|
|
17
|
+
//# sourceMappingURL=PickerUtils.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"PickerUtils.d.ts","sourceRoot":"","sources":["../../../src/spectrum/Picker/PickerUtils.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,EAAE,EAAE,MAAM,wBAAwB,CAAC;AAE5C;;;;;GAKG;AACH,wBAAgB,kBAAkB,CAChC,KAAK,EAAE,EAAE,CAAC,KAAK,EACf,aAAa,CAAC,EAAE,MAAM,GACrB,EAAE,CAAC,MAAM,CAIX;AAED;;;;;;GAMG;AACH,wBAAgB,oBAAoB,CAClC,KAAK,EAAE,EAAE,CAAC,KAAK,EACf,SAAS,EAAE,EAAE,CAAC,MAAM,EACpB,eAAe,CAAC,EAAE,MAAM,GACvB,EAAE,CAAC,MAAM,CAIX"}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Get the key column if column name is provided, otherwise use the first column.
|
|
3
|
+
* @param table The table to get the key column from
|
|
4
|
+
* @param keyColumnName The name of the column to use for key data
|
|
5
|
+
* @returns DH Column containing the key values
|
|
6
|
+
*/
|
|
7
|
+
export function getPickerKeyColumn(table, keyColumnName) {
|
|
8
|
+
return keyColumnName == null ? table.columns[0] : table.findColumn(keyColumnName);
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
/**
|
|
12
|
+
* Get the label column if column name is provided, otherwise use the key column.
|
|
13
|
+
* @param table The table to get the label column from
|
|
14
|
+
* @param keyColumn The key column to fallback to if the label column name is not provided
|
|
15
|
+
* @param labelColumnName The name of the column to use for label data
|
|
16
|
+
* @returns DH Column containing the label values
|
|
17
|
+
*/
|
|
18
|
+
export function getPickerLabelColumn(table, keyColumn, labelColumnName) {
|
|
19
|
+
return labelColumnName == null ? keyColumn : table.findColumn(labelColumnName);
|
|
20
|
+
}
|
|
21
|
+
//# sourceMappingURL=PickerUtils.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"PickerUtils.js","names":["getPickerKeyColumn","table","keyColumnName","columns","findColumn","getPickerLabelColumn","keyColumn","labelColumnName"],"sources":["../../../src/spectrum/Picker/PickerUtils.ts"],"sourcesContent":["import { dh } from '@deephaven/jsapi-types';\n\n/**\n * Get the key column if column name is provided, otherwise use the first column.\n * @param table The table to get the key column from\n * @param keyColumnName The name of the column to use for key data\n * @returns DH Column containing the key values\n */\nexport function getPickerKeyColumn(\n table: dh.Table,\n keyColumnName?: string\n): dh.Column {\n return keyColumnName == null\n ? table.columns[0]\n : table.findColumn(keyColumnName);\n}\n\n/**\n * Get the label column if column name is provided, otherwise use the key column.\n * @param table The table to get the label column from\n * @param keyColumn The key column to fallback to if the label column name is not provided\n * @param labelColumnName The name of the column to use for label data\n * @returns DH Column containing the label values\n */\nexport function getPickerLabelColumn(\n table: dh.Table,\n keyColumn: dh.Column,\n labelColumnName?: string\n): dh.Column {\n return labelColumnName == null\n ? keyColumn\n : table.findColumn(labelColumnName);\n}\n"],"mappings":"AAEA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,SAASA,kBAAkBA,CAChCC,KAAe,EACfC,aAAsB,EACX;EACX,OAAOA,aAAa,IAAI,IAAI,GACxBD,KAAK,CAACE,OAAO,CAAC,CAAC,CAAC,GAChBF,KAAK,CAACG,UAAU,CAACF,aAAa,CAAC;AACrC;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,SAASG,oBAAoBA,CAClCJ,KAAe,EACfK,SAAoB,EACpBC,eAAwB,EACb;EACX,OAAOA,eAAe,IAAI,IAAI,GAC1BD,SAAS,GACTL,KAAK,CAACG,UAAU,CAACG,eAAe,CAAC;AACvC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/spectrum/Picker/index.ts"],"names":[],"mappings":"AAAA,cAAc,UAAU,CAAC;AACzB,cAAc,eAAe,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","names":[],"sources":["../../../src/spectrum/Picker/index.ts"],"sourcesContent":["export * from './Picker';\nexport * from './PickerUtils';\n"],"mappings":""}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { NormalizedPickerItemData } from '@deephaven/components';
|
|
2
|
+
import { dh } from '@deephaven/jsapi-types';
|
|
3
|
+
/**
|
|
4
|
+
* Returns a function that deserializes a row into a normalized picker item data
|
|
5
|
+
* object.
|
|
6
|
+
* @param table The table to get the key and label columns from
|
|
7
|
+
* @param keyColumnName The name of the column to use for key data
|
|
8
|
+
* @param labelColumnName The name of the column to use for label data
|
|
9
|
+
* @returns A function that deserializes a row into a normalized picker item
|
|
10
|
+
* data object
|
|
11
|
+
*/
|
|
12
|
+
export declare function usePickerItemRowDeserializer({ table, keyColumnName, labelColumnName, }: {
|
|
13
|
+
table: dh.Table;
|
|
14
|
+
keyColumnName?: string;
|
|
15
|
+
labelColumnName?: string;
|
|
16
|
+
}): (row: dh.Row) => NormalizedPickerItemData;
|
|
17
|
+
export default usePickerItemRowDeserializer;
|
|
18
|
+
//# sourceMappingURL=usePickerItemRowDeserializer.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"usePickerItemRowDeserializer.d.ts","sourceRoot":"","sources":["../../../src/spectrum/Picker/usePickerItemRowDeserializer.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,wBAAwB,EAAE,MAAM,uBAAuB,CAAC;AACjE,OAAO,EAAE,EAAE,EAAE,MAAM,wBAAwB,CAAC;AAgB5C;;;;;;;;GAQG;AACH,wBAAgB,4BAA4B,CAAC,EAC3C,KAAK,EACL,aAAa,EACb,eAAe,GAChB,EAAE;IACD,KAAK,EAAE,EAAE,CAAC,KAAK,CAAC;IAChB,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,eAAe,CAAC,EAAE,MAAM,CAAC;CAC1B,GAAG,CAAC,GAAG,EAAE,EAAE,CAAC,GAAG,KAAK,wBAAwB,CAyB5C;AAED,eAAe,4BAA4B,CAAC"}
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import { useCallback, useMemo } from 'react';
|
|
2
|
+
import { getPickerKeyColumn, getPickerLabelColumn } from "./PickerUtils.js";
|
|
3
|
+
function formatValue(value) {
|
|
4
|
+
if (typeof value === 'string' || typeof value === 'number' || typeof value === 'boolean') {
|
|
5
|
+
return value;
|
|
6
|
+
}
|
|
7
|
+
|
|
8
|
+
// TODO: #1889 Add better support for different data types.
|
|
9
|
+
return String(value);
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
/**
|
|
13
|
+
* Returns a function that deserializes a row into a normalized picker item data
|
|
14
|
+
* object.
|
|
15
|
+
* @param table The table to get the key and label columns from
|
|
16
|
+
* @param keyColumnName The name of the column to use for key data
|
|
17
|
+
* @param labelColumnName The name of the column to use for label data
|
|
18
|
+
* @returns A function that deserializes a row into a normalized picker item
|
|
19
|
+
* data object
|
|
20
|
+
*/
|
|
21
|
+
export function usePickerItemRowDeserializer(_ref) {
|
|
22
|
+
var {
|
|
23
|
+
table,
|
|
24
|
+
keyColumnName,
|
|
25
|
+
labelColumnName
|
|
26
|
+
} = _ref;
|
|
27
|
+
var keyColumn = useMemo(() => getPickerKeyColumn(table, keyColumnName), [keyColumnName, table]);
|
|
28
|
+
var labelColumn = useMemo(() => getPickerLabelColumn(table, keyColumn, labelColumnName), [keyColumn, labelColumnName, table]);
|
|
29
|
+
var deserializeRow = useCallback(row => {
|
|
30
|
+
var key = formatValue(row.get(keyColumn));
|
|
31
|
+
var content = formatValue(row.get(labelColumn));
|
|
32
|
+
return {
|
|
33
|
+
key,
|
|
34
|
+
content
|
|
35
|
+
};
|
|
36
|
+
}, [keyColumn, labelColumn]);
|
|
37
|
+
return deserializeRow;
|
|
38
|
+
}
|
|
39
|
+
export default usePickerItemRowDeserializer;
|
|
40
|
+
//# sourceMappingURL=usePickerItemRowDeserializer.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"usePickerItemRowDeserializer.js","names":["useCallback","useMemo","getPickerKeyColumn","getPickerLabelColumn","formatValue","value","String","usePickerItemRowDeserializer","_ref","table","keyColumnName","labelColumnName","keyColumn","labelColumn","deserializeRow","row","key","get","content"],"sources":["../../../src/spectrum/Picker/usePickerItemRowDeserializer.ts"],"sourcesContent":["import { useCallback, useMemo } from 'react';\nimport { NormalizedPickerItemData } from '@deephaven/components';\nimport { dh } from '@deephaven/jsapi-types';\nimport { getPickerKeyColumn, getPickerLabelColumn } from './PickerUtils';\n\nfunction formatValue(value: unknown): string | number | boolean {\n if (\n typeof value === 'string' ||\n typeof value === 'number' ||\n typeof value === 'boolean'\n ) {\n return value;\n }\n\n // TODO: #1889 Add better support for different data types.\n return String(value);\n}\n\n/**\n * Returns a function that deserializes a row into a normalized picker item data\n * object.\n * @param table The table to get the key and label columns from\n * @param keyColumnName The name of the column to use for key data\n * @param labelColumnName The name of the column to use for label data\n * @returns A function that deserializes a row into a normalized picker item\n * data object\n */\nexport function usePickerItemRowDeserializer({\n table,\n keyColumnName,\n labelColumnName,\n}: {\n table: dh.Table;\n keyColumnName?: string;\n labelColumnName?: string;\n}): (row: dh.Row) => NormalizedPickerItemData {\n const keyColumn = useMemo(\n () => getPickerKeyColumn(table, keyColumnName),\n [keyColumnName, table]\n );\n\n const labelColumn = useMemo(\n () => getPickerLabelColumn(table, keyColumn, labelColumnName),\n [keyColumn, labelColumnName, table]\n );\n\n const deserializeRow = useCallback(\n (row: dh.Row): NormalizedPickerItemData => {\n const key = formatValue(row.get(keyColumn));\n const content = formatValue(row.get(labelColumn));\n\n return {\n key,\n content,\n };\n },\n [keyColumn, labelColumn]\n );\n\n return deserializeRow;\n}\n\nexport default usePickerItemRowDeserializer;\n"],"mappings":"AAAA,SAASA,WAAW,EAAEC,OAAO,QAAQ,OAAO;AAAC,SAGpCC,kBAAkB,EAAEC,oBAAoB;AAEjD,SAASC,WAAWA,CAACC,KAAc,EAA6B;EAC9D,IACE,OAAOA,KAAK,KAAK,QAAQ,IACzB,OAAOA,KAAK,KAAK,QAAQ,IACzB,OAAOA,KAAK,KAAK,SAAS,EAC1B;IACA,OAAOA,KAAK;EACd;;EAEA;EACA,OAAOC,MAAM,CAACD,KAAK,CAAC;AACtB;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,SAASE,4BAA4BA,CAAAC,IAAA,EAQE;EAAA,IARD;IAC3CC,KAAK;IACLC,aAAa;IACbC;EAKF,CAAC,GAAAH,IAAA;EACC,IAAMI,SAAS,GAAGX,OAAO,CACvB,MAAMC,kBAAkB,CAACO,KAAK,EAAEC,aAAa,CAAC,EAC9C,CAACA,aAAa,EAAED,KAAK,CACvB,CAAC;EAED,IAAMI,WAAW,GAAGZ,OAAO,CACzB,MAAME,oBAAoB,CAACM,KAAK,EAAEG,SAAS,EAAED,eAAe,CAAC,EAC7D,CAACC,SAAS,EAAED,eAAe,EAAEF,KAAK,CACpC,CAAC;EAED,IAAMK,cAAc,GAAGd,WAAW,CAC/Be,GAAW,IAA+B;IACzC,IAAMC,GAAG,GAAGZ,WAAW,CAACW,GAAG,CAACE,GAAG,CAACL,SAAS,CAAC,CAAC;IAC3C,IAAMM,OAAO,GAAGd,WAAW,CAACW,GAAG,CAACE,GAAG,CAACJ,WAAW,CAAC,CAAC;IAEjD,OAAO;MACLG,GAAG;MACHE;IACF,CAAC;EACH,CAAC,EACD,CAACN,SAAS,EAAEC,WAAW,CACzB,CAAC;EAED,OAAOC,cAAc;AACvB;AAEA,eAAeP,4BAA4B"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/spectrum/index.ts"],"names":[],"mappings":"AAAA,cAAc,UAAU,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","names":[],"sources":["../../src/spectrum/index.ts"],"sourcesContent":["export * from './Picker';\n"],"mappings":""}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { dh } from '@deephaven/jsapi-types';
|
|
2
|
+
/**
|
|
3
|
+
* Returns a function that gets the index of the first row containing a column
|
|
4
|
+
* value.
|
|
5
|
+
* @param columnName The name of the column to search
|
|
6
|
+
* @param value The value to search for
|
|
7
|
+
* @param table The table to search in
|
|
8
|
+
* @returns A function that returns the index of the first row containing the
|
|
9
|
+
* matching value, or `null` if no match is found
|
|
10
|
+
*/
|
|
11
|
+
export declare function useGetItemIndexByValue<TValue>({ columnName, value, table, }: {
|
|
12
|
+
columnName: string;
|
|
13
|
+
table: dh.Table | null;
|
|
14
|
+
value: TValue | null | undefined;
|
|
15
|
+
}): () => Promise<number | null>;
|
|
16
|
+
export default useGetItemIndexByValue;
|
|
17
|
+
//# sourceMappingURL=useGetItemIndexByValue.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useGetItemIndexByValue.d.ts","sourceRoot":"","sources":["../src/useGetItemIndexByValue.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,EAAE,EAAE,MAAM,wBAAwB,CAAC;AAG5C;;;;;;;;GAQG;AACH,wBAAgB,sBAAsB,CAAC,MAAM,EAAE,EAC7C,UAAU,EACV,KAAK,EACL,KAAK,GACN,EAAE;IACD,UAAU,EAAE,MAAM,CAAC;IACnB,KAAK,EAAE,EAAE,CAAC,KAAK,GAAG,IAAI,CAAC;IACvB,KAAK,EAAE,MAAM,GAAG,IAAI,GAAG,SAAS,CAAC;CAClC,GAAG,MAAM,OAAO,CAAC,MAAM,GAAG,IAAI,CAAC,CAe/B;AAED,eAAe,sBAAsB,CAAC"}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) { try { var info = gen[key](arg); var value = info.value; } catch (error) { reject(error); return; } if (info.done) { resolve(value); } else { Promise.resolve(value).then(_next, _throw); } }
|
|
2
|
+
function _asyncToGenerator(fn) { return function () { var self = this, args = arguments; return new Promise(function (resolve, reject) { var gen = fn.apply(self, args); function _next(value) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value); } function _throw(err) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err); } _next(undefined); }); }; }
|
|
3
|
+
import { useCallback } from 'react';
|
|
4
|
+
import { useTableUtils } from "./useTableUtils.js";
|
|
5
|
+
/**
|
|
6
|
+
* Returns a function that gets the index of the first row containing a column
|
|
7
|
+
* value.
|
|
8
|
+
* @param columnName The name of the column to search
|
|
9
|
+
* @param value The value to search for
|
|
10
|
+
* @param table The table to search in
|
|
11
|
+
* @returns A function that returns the index of the first row containing the
|
|
12
|
+
* matching value, or `null` if no match is found
|
|
13
|
+
*/
|
|
14
|
+
export function useGetItemIndexByValue(_ref) {
|
|
15
|
+
var {
|
|
16
|
+
columnName,
|
|
17
|
+
value,
|
|
18
|
+
table
|
|
19
|
+
} = _ref;
|
|
20
|
+
var tableUtils = useTableUtils();
|
|
21
|
+
return useCallback( /*#__PURE__*/_asyncToGenerator(function* () {
|
|
22
|
+
if (table == null || value == null) {
|
|
23
|
+
return null;
|
|
24
|
+
}
|
|
25
|
+
var column = table.findColumn(columnName);
|
|
26
|
+
var columnValueType = tableUtils.getValueType(column.type);
|
|
27
|
+
var index = yield table.seekRow(0, column, columnValueType, value);
|
|
28
|
+
return index === -1 ? null : index;
|
|
29
|
+
}), [columnName, table, tableUtils, value]);
|
|
30
|
+
}
|
|
31
|
+
export default useGetItemIndexByValue;
|
|
32
|
+
//# sourceMappingURL=useGetItemIndexByValue.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useGetItemIndexByValue.js","names":["useCallback","useTableUtils","useGetItemIndexByValue","_ref","columnName","value","table","tableUtils","_asyncToGenerator","column","findColumn","columnValueType","getValueType","type","index","seekRow"],"sources":["../src/useGetItemIndexByValue.ts"],"sourcesContent":["import { useCallback } from 'react';\nimport { dh } from '@deephaven/jsapi-types';\nimport { useTableUtils } from './useTableUtils';\n\n/**\n * Returns a function that gets the index of the first row containing a column\n * value.\n * @param columnName The name of the column to search\n * @param value The value to search for\n * @param table The table to search in\n * @returns A function that returns the index of the first row containing the\n * matching value, or `null` if no match is found\n */\nexport function useGetItemIndexByValue<TValue>({\n columnName,\n value,\n table,\n}: {\n columnName: string;\n table: dh.Table | null;\n value: TValue | null | undefined;\n}): () => Promise<number | null> {\n const tableUtils = useTableUtils();\n\n return useCallback(async () => {\n if (table == null || value == null) {\n return null;\n }\n\n const column = table.findColumn(columnName);\n const columnValueType = tableUtils.getValueType(column.type);\n\n const index = await table.seekRow(0, column, columnValueType, value);\n\n return index === -1 ? null : index;\n }, [columnName, table, tableUtils, value]);\n}\n\nexport default useGetItemIndexByValue;\n"],"mappings":";;AAAA,SAASA,WAAW,QAAQ,OAAO;AAAC,SAE3BC,aAAa;AAEtB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,SAASC,sBAAsBA,CAAAC,IAAA,EAQL;EAAA,IARc;IAC7CC,UAAU;IACVC,KAAK;IACLC;EAKF,CAAC,GAAAH,IAAA;EACC,IAAMI,UAAU,GAAGN,aAAa,CAAC,CAAC;EAElC,OAAOD,WAAW,eAAAQ,iBAAA,CAAC,aAAY;IAC7B,IAAIF,KAAK,IAAI,IAAI,IAAID,KAAK,IAAI,IAAI,EAAE;MAClC,OAAO,IAAI;IACb;IAEA,IAAMI,MAAM,GAAGH,KAAK,CAACI,UAAU,CAACN,UAAU,CAAC;IAC3C,IAAMO,eAAe,GAAGJ,UAAU,CAACK,YAAY,CAACH,MAAM,CAACI,IAAI,CAAC;IAE5D,IAAMC,KAAK,SAASR,KAAK,CAACS,OAAO,CAAC,CAAC,EAAEN,MAAM,EAAEE,eAAe,EAAEN,KAAK,CAAC;IAEpE,OAAOS,KAAK,KAAK,CAAC,CAAC,GAAG,IAAI,GAAGA,KAAK;EACpC,CAAC,GAAE,CAACV,UAAU,EAAEE,KAAK,EAAEC,UAAU,EAAEF,KAAK,CAAC,CAAC;AAC5C;AAEA,eAAeH,sBAAsB"}
|
|
@@ -11,8 +11,19 @@ import { KeyedItem } from '@deephaven/utils';
|
|
|
11
11
|
* source table. This is intended for "human" sized tables such as those used in
|
|
12
12
|
* admin panels. This is not suitable for "machine" scale with millions+ rows.
|
|
13
13
|
* @param table The table that will be used to determine the list size.
|
|
14
|
+
* @param reuseItemsOnTableResize Whether to reuse existing items when the table
|
|
15
|
+
* size changes (defaults to false).
|
|
16
|
+
* - If true, existing items will be reused when the table resizes. This is
|
|
17
|
+
* recommended for ticking tables where the data is frequently updated in order
|
|
18
|
+
* to avoid UI flicker.
|
|
19
|
+
* - If false, all of the items will be replaced when the table resizes. This is
|
|
20
|
+
* recommnded for tables that don't change size frequently but may change size
|
|
21
|
+
* due to a user interaction. e.g. Filter via a search input. This avoids a
|
|
22
|
+
* different kind of flicker, where the item values will shift around as the
|
|
23
|
+
* user types. It is less jarring for the items to all reset to empty and then
|
|
24
|
+
* show the new results all at once.
|
|
14
25
|
* @returns a WindowedListData object.
|
|
15
26
|
*/
|
|
16
|
-
export declare function useInitializeViewportData<T>(table: dh.Table | dh.TreeTable | null): WindowedListData<KeyedItem<T>>;
|
|
27
|
+
export declare function useInitializeViewportData<T>(table: dh.Table | dh.TreeTable | null, reuseItemsOnTableResize?: boolean): WindowedListData<KeyedItem<T>>;
|
|
17
28
|
export default useInitializeViewportData;
|
|
18
29
|
//# sourceMappingURL=useInitializeViewportData.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useInitializeViewportData.d.ts","sourceRoot":"","sources":["../src/useInitializeViewportData.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,EAAE,EAAE,MAAM,wBAAwB,CAAC;AAEjD,OAAO,EAAuB,gBAAgB,EAAE,MAAM,wBAAwB,CAAC;AAC/E,OAAO,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAC;
|
|
1
|
+
{"version":3,"file":"useInitializeViewportData.d.ts","sourceRoot":"","sources":["../src/useInitializeViewportData.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,EAAE,EAAE,MAAM,wBAAwB,CAAC;AAEjD,OAAO,EAAuB,gBAAgB,EAAE,MAAM,wBAAwB,CAAC;AAC/E,OAAO,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAC;AAgD7C;;;;;;;;;;;;;;;;;;;;;;GAsBG;AACH,wBAAgB,yBAAyB,CAAC,CAAC,EACzC,KAAK,EAAE,EAAE,CAAC,KAAK,GAAG,EAAE,CAAC,SAAS,GAAG,IAAI,EACrC,uBAAuB,UAAQ,GAC9B,gBAAgB,CAAC,SAAS,CAAC,CAAC,CAAC,CAAC,CAqBhC;AAED,eAAe,yBAAyB,CAAC"}
|
|
@@ -5,6 +5,47 @@ import Log from '@deephaven/log';
|
|
|
5
5
|
import useTableSize from "./useTableSize.js";
|
|
6
6
|
var log = Log.module('useInitializeViewportData');
|
|
7
7
|
|
|
8
|
+
/**
|
|
9
|
+
* Given an array of items, returns a new array containing the target number of
|
|
10
|
+
* items. If reuseExistingItems is true, existing items will be re-used. If
|
|
11
|
+
* false, all items will be replaced with new, empty items.
|
|
12
|
+
* @param items The array of items to resize.
|
|
13
|
+
* @param targetSize The desired size of the array.
|
|
14
|
+
* @param reuseExistingItems If true, existing items will be re-used. If false,
|
|
15
|
+
* all items will be replaced with new, empty items.
|
|
16
|
+
* @returns The resized array of items.
|
|
17
|
+
*/
|
|
18
|
+
function resizeItemsArray(_ref) {
|
|
19
|
+
var {
|
|
20
|
+
items,
|
|
21
|
+
targetSize,
|
|
22
|
+
reuseExistingItems
|
|
23
|
+
} = _ref;
|
|
24
|
+
var currentSize = items.length;
|
|
25
|
+
|
|
26
|
+
// If size isn't changing, do nothing
|
|
27
|
+
if (currentSize === targetSize) {
|
|
28
|
+
return items;
|
|
29
|
+
}
|
|
30
|
+
log.debug('size changed:', {
|
|
31
|
+
currentSize,
|
|
32
|
+
targetSize
|
|
33
|
+
});
|
|
34
|
+
|
|
35
|
+
// Re-create entire array with empty items
|
|
36
|
+
if (!reuseExistingItems) {
|
|
37
|
+
return Array.from(generateEmptyKeyedItems(0, targetSize - 1));
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
// Drop extra items
|
|
41
|
+
if (currentSize > targetSize) {
|
|
42
|
+
return items.slice(0, targetSize);
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
// Add missing items
|
|
46
|
+
return [...items, ...generateEmptyKeyedItems(currentSize, targetSize - 1)];
|
|
47
|
+
}
|
|
48
|
+
|
|
8
49
|
/**
|
|
9
50
|
* Initializes a ListData instance that can be used for windowed views of a
|
|
10
51
|
* Table. The list must always contain a KeyedItem for every record in the table,
|
|
@@ -15,26 +56,33 @@ var log = Log.module('useInitializeViewportData');
|
|
|
15
56
|
* source table. This is intended for "human" sized tables such as those used in
|
|
16
57
|
* admin panels. This is not suitable for "machine" scale with millions+ rows.
|
|
17
58
|
* @param table The table that will be used to determine the list size.
|
|
59
|
+
* @param reuseItemsOnTableResize Whether to reuse existing items when the table
|
|
60
|
+
* size changes (defaults to false).
|
|
61
|
+
* - If true, existing items will be reused when the table resizes. This is
|
|
62
|
+
* recommended for ticking tables where the data is frequently updated in order
|
|
63
|
+
* to avoid UI flicker.
|
|
64
|
+
* - If false, all of the items will be replaced when the table resizes. This is
|
|
65
|
+
* recommnded for tables that don't change size frequently but may change size
|
|
66
|
+
* due to a user interaction. e.g. Filter via a search input. This avoids a
|
|
67
|
+
* different kind of flicker, where the item values will shift around as the
|
|
68
|
+
* user types. It is less jarring for the items to all reset to empty and then
|
|
69
|
+
* show the new results all at once.
|
|
18
70
|
* @returns a WindowedListData object.
|
|
19
71
|
*/
|
|
20
72
|
export function useInitializeViewportData(table) {
|
|
73
|
+
var reuseItemsOnTableResize = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;
|
|
21
74
|
var viewportData = useWindowedListData({});
|
|
22
75
|
|
|
23
76
|
// If the table changes size, we need to re-initialize it.
|
|
24
77
|
var targetSize = Math.max(0, useTableSize(table));
|
|
25
78
|
|
|
26
|
-
// Whenever the table reference or size changes,
|
|
27
|
-
// items. This is preferred over updating items in place to avoid the user
|
|
28
|
-
// seeing items shift around multiple times.
|
|
79
|
+
// Whenever the table reference or size changes, resize the list.
|
|
29
80
|
useEffect(() => {
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
});
|
|
36
|
-
viewportData.setItems(Array.from(generateEmptyKeyedItems(0, targetSize - 1)));
|
|
37
|
-
}
|
|
81
|
+
viewportData.setItems(resizeItemsArray({
|
|
82
|
+
items: viewportData.items,
|
|
83
|
+
targetSize,
|
|
84
|
+
reuseExistingItems: reuseItemsOnTableResize
|
|
85
|
+
}));
|
|
38
86
|
|
|
39
87
|
// Intentionally excluding viewportData since it changes on every render.
|
|
40
88
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useInitializeViewportData.js","names":["useEffect","generateEmptyKeyedItems","useWindowedListData","Log","useTableSize","log","module","
|
|
1
|
+
{"version":3,"file":"useInitializeViewportData.js","names":["useEffect","generateEmptyKeyedItems","useWindowedListData","Log","useTableSize","log","module","resizeItemsArray","_ref","items","targetSize","reuseExistingItems","currentSize","length","debug","Array","from","slice","useInitializeViewportData","table","reuseItemsOnTableResize","arguments","undefined","viewportData","Math","max","setItems"],"sources":["../src/useInitializeViewportData.ts"],"sourcesContent":["import { useEffect } from 'react';\nimport type { dh } from '@deephaven/jsapi-types';\nimport { generateEmptyKeyedItems } from '@deephaven/jsapi-utils';\nimport { useWindowedListData, WindowedListData } from '@deephaven/react-hooks';\nimport { KeyedItem } from '@deephaven/utils';\nimport Log from '@deephaven/log';\nimport useTableSize from './useTableSize';\n\nconst log = Log.module('useInitializeViewportData');\n\n/**\n * Given an array of items, returns a new array containing the target number of\n * items. If reuseExistingItems is true, existing items will be re-used. If\n * false, all items will be replaced with new, empty items.\n * @param items The array of items to resize.\n * @param targetSize The desired size of the array.\n * @param reuseExistingItems If true, existing items will be re-used. If false,\n * all items will be replaced with new, empty items.\n * @returns The resized array of items.\n */\nfunction resizeItemsArray<T>({\n items,\n targetSize,\n reuseExistingItems,\n}: {\n items: KeyedItem<T, string>[];\n reuseExistingItems: boolean;\n targetSize: number;\n}): KeyedItem<T, string>[] {\n const currentSize = items.length;\n\n // If size isn't changing, do nothing\n if (currentSize === targetSize) {\n return items;\n }\n\n log.debug('size changed:', { currentSize, targetSize });\n\n // Re-create entire array with empty items\n if (!reuseExistingItems) {\n return Array.from(generateEmptyKeyedItems<T>(0, targetSize - 1));\n }\n\n // Drop extra items\n if (currentSize > targetSize) {\n return items.slice(0, targetSize);\n }\n\n // Add missing items\n return [...items, ...generateEmptyKeyedItems<T>(currentSize, targetSize - 1)];\n}\n\n/**\n * Initializes a ListData instance that can be used for windowed views of a\n * Table. The list must always contain a KeyedItem for every record in the table,\n * so it is pre-populated with empty items that can be updated with real data as\n * the window changes.\n *\n * IMPORTANT: this will create an empty KeyedItem object for every row in the\n * source table. This is intended for \"human\" sized tables such as those used in\n * admin panels. This is not suitable for \"machine\" scale with millions+ rows.\n * @param table The table that will be used to determine the list size.\n * @param reuseItemsOnTableResize Whether to reuse existing items when the table\n * size changes (defaults to false).\n * - If true, existing items will be reused when the table resizes. This is\n * recommended for ticking tables where the data is frequently updated in order\n * to avoid UI flicker.\n * - If false, all of the items will be replaced when the table resizes. This is\n * recommnded for tables that don't change size frequently but may change size\n * due to a user interaction. e.g. Filter via a search input. This avoids a\n * different kind of flicker, where the item values will shift around as the\n * user types. It is less jarring for the items to all reset to empty and then\n * show the new results all at once.\n * @returns a WindowedListData object.\n */\nexport function useInitializeViewportData<T>(\n table: dh.Table | dh.TreeTable | null,\n reuseItemsOnTableResize = false\n): WindowedListData<KeyedItem<T>> {\n const viewportData = useWindowedListData<KeyedItem<T>>({});\n\n // If the table changes size, we need to re-initialize it.\n const targetSize = Math.max(0, useTableSize(table));\n\n // Whenever the table reference or size changes, resize the list.\n useEffect(() => {\n viewportData.setItems(\n resizeItemsArray({\n items: viewportData.items,\n targetSize,\n reuseExistingItems: reuseItemsOnTableResize,\n })\n );\n\n // Intentionally excluding viewportData since it changes on every render.\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, [targetSize, table]);\n\n return viewportData;\n}\n\nexport default useInitializeViewportData;\n"],"mappings":"AAAA,SAASA,SAAS,QAAQ,OAAO;AAEjC,SAASC,uBAAuB,QAAQ,wBAAwB;AAChE,SAASC,mBAAmB,QAA0B,wBAAwB;AAE9E,OAAOC,GAAG,MAAM,gBAAgB;AAAC,OAC1BC,YAAY;AAEnB,IAAMC,GAAG,GAAGF,GAAG,CAACG,MAAM,CAAC,2BAA2B,CAAC;;AAEnD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAASC,gBAAgBA,CAAAC,IAAA,EAQE;EAAA,IARE;IAC3BC,KAAK;IACLC,UAAU;IACVC;EAKF,CAAC,GAAAH,IAAA;EACC,IAAMI,WAAW,GAAGH,KAAK,CAACI,MAAM;;EAEhC;EACA,IAAID,WAAW,KAAKF,UAAU,EAAE;IAC9B,OAAOD,KAAK;EACd;EAEAJ,GAAG,CAACS,KAAK,CAAC,eAAe,EAAE;IAAEF,WAAW;IAAEF;EAAW,CAAC,CAAC;;EAEvD;EACA,IAAI,CAACC,kBAAkB,EAAE;IACvB,OAAOI,KAAK,CAACC,IAAI,CAACf,uBAAuB,CAAI,CAAC,EAAES,UAAU,GAAG,CAAC,CAAC,CAAC;EAClE;;EAEA;EACA,IAAIE,WAAW,GAAGF,UAAU,EAAE;IAC5B,OAAOD,KAAK,CAACQ,KAAK,CAAC,CAAC,EAAEP,UAAU,CAAC;EACnC;;EAEA;EACA,OAAO,CAAC,GAAGD,KAAK,EAAE,GAAGR,uBAAuB,CAAIW,WAAW,EAAEF,UAAU,GAAG,CAAC,CAAC,CAAC;AAC/E;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,SAASQ,yBAAyBA,CACvCC,KAAqC,EAEL;EAAA,IADhCC,uBAAuB,GAAAC,SAAA,CAAAR,MAAA,QAAAQ,SAAA,QAAAC,SAAA,GAAAD,SAAA,MAAG,KAAK;EAE/B,IAAME,YAAY,GAAGrB,mBAAmB,CAAe,CAAC,CAAC,CAAC;;EAE1D;EACA,IAAMQ,UAAU,GAAGc,IAAI,CAACC,GAAG,CAAC,CAAC,EAAErB,YAAY,CAACe,KAAK,CAAC,CAAC;;EAEnD;EACAnB,SAAS,CAAC,MAAM;IACduB,YAAY,CAACG,QAAQ,CACnBnB,gBAAgB,CAAC;MACfE,KAAK,EAAEc,YAAY,CAACd,KAAK;MACzBC,UAAU;MACVC,kBAAkB,EAAES;IACtB,CAAC,CACH,CAAC;;IAED;IACA;EACF,CAAC,EAAE,CAACV,UAAU,EAAES,KAAK,CAAC,CAAC;EAEvB,OAAOI,YAAY;AACrB;AAEA,eAAeL,yBAAyB"}
|
|
@@ -3,6 +3,7 @@ import { RowDeserializer } from '@deephaven/jsapi-utils';
|
|
|
3
3
|
import { WindowedListData } from '@deephaven/react-hooks';
|
|
4
4
|
import { KeyedItem } from '@deephaven/utils';
|
|
5
5
|
export interface UseViewportDataProps<TItem, TTable extends dh.Table | dh.TreeTable> {
|
|
6
|
+
reuseItemsOnTableResize?: boolean;
|
|
6
7
|
table: TTable | null;
|
|
7
8
|
itemHeight?: number;
|
|
8
9
|
scrollDebounce?: number;
|
|
@@ -37,8 +38,10 @@ export interface UseViewportDataResult<TItem, TTable extends dh.Table | dh.TreeT
|
|
|
37
38
|
* @param viewportSize The number of items to display in the viewport.
|
|
38
39
|
* @param viewportPadding The number of items to fetch at start and end of the viewport.
|
|
39
40
|
* @param deserializeRow A function to deserialize a row from the Table.
|
|
41
|
+
* @param reuseItemsOnTableResize If true, existing items will be re-used when
|
|
42
|
+
* the table size changes.
|
|
40
43
|
* @returns An object for managing Table viewport state.
|
|
41
44
|
*/
|
|
42
|
-
export declare function useViewportData<TItem, TTable extends dh.Table | dh.TreeTable>({ table, itemHeight, scrollDebounce, viewportSize, viewportPadding, deserializeRow, }: UseViewportDataProps<TItem, TTable>): UseViewportDataResult<TItem, TTable>;
|
|
45
|
+
export declare function useViewportData<TItem, TTable extends dh.Table | dh.TreeTable>({ table, itemHeight, scrollDebounce, viewportSize, viewportPadding, deserializeRow, reuseItemsOnTableResize, }: UseViewportDataProps<TItem, TTable>): UseViewportDataResult<TItem, TTable>;
|
|
43
46
|
export default useViewportData;
|
|
44
47
|
//# sourceMappingURL=useViewportData.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useViewportData.d.ts","sourceRoot":"","sources":["../src/useViewportData.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,EAAE,EAAE,MAAM,wBAAwB,CAAC;AACjD,OAAO,EACL,eAAe,EAIhB,MAAM,wBAAwB,CAAC;AAGhC,OAAO,EAEL,gBAAgB,EACjB,MAAM,wBAAwB,CAAC;AAChC,OAAO,EAAE,SAAS,EAAsB,MAAM,kBAAkB,CAAC;AAQjE,MAAM,WAAW,oBAAoB,CACnC,KAAK,EACL,MAAM,SAAS,EAAE,CAAC,KAAK,GAAG,EAAE,CAAC,SAAS;IAEtC,KAAK,EAAE,MAAM,GAAG,IAAI,CAAC;IACrB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,cAAc,CAAC,EAAE,eAAe,CAAC,KAAK,CAAC,CAAC;CACzC;AAED,MAAM,WAAW,qBAAqB,CACpC,KAAK,EACL,MAAM,SAAS,EAAE,CAAC,KAAK,GAAG,EAAE,CAAC,SAAS;IAEtC,gEAAgE;IAChE,YAAY,EAAE,g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AK,CAAC,CAAC,CAAC;IACjD,mCAAmC;IACnC,IAAI,EAAE,MAAM,CAAC;IAEb,KAAK,EAAE,MAAM,GAAG,IAAI,CAAC;IACrB,0CAA0C;IAC1C,sBAAsB,EAAE,CAAC,OAAO,EAAE,EAAE,CAAC,eAAe,EAAE,KAAK,IAAI,CAAC;IAChE,oCAAoC;IACpC,WAAW,EAAE,CAAC,QAAQ,EAAE,MAAM,KAAK,IAAI,CAAC;IACxC,mDAAmD;IACnD,QAAQ,EAAE,CAAC,KAAK,EAAE,KAAK,KAAK,IAAI,CAAC;CAClC;AAED;;;;;;;;;;;;;;;;;GAiBG;AACH,wBAAgB,eAAe,CAAC,KAAK,EAAE,MAAM,SAAS,EAAE,CAAC,KAAK,GAAG,EAAE,CAAC,SAAS,EAAE,EAC7E,KAAK,EACL,UAAc,EACd,cAAmC,EACnC,YAAiB,EACjB,eAAoB,EACpB,cAAuC,EACvC,uBAA+B,GAChC,EAAE,oBAAoB,CAAC,KAAK,EAAE,MAAM,CAAC,GAAG,qBAAqB,CAAC,KAAK,EAAE,MAAM,CAAC,CAqE5E;AAED,eAAe,eAAe,CAAC"}
|
package/dist/useViewportData.js
CHANGED
|
@@ -23,6 +23,8 @@ var log = Log.module('useViewportData');
|
|
|
23
23
|
* @param viewportSize The number of items to display in the viewport.
|
|
24
24
|
* @param viewportPadding The number of items to fetch at start and end of the viewport.
|
|
25
25
|
* @param deserializeRow A function to deserialize a row from the Table.
|
|
26
|
+
* @param reuseItemsOnTableResize If true, existing items will be re-used when
|
|
27
|
+
* the table size changes.
|
|
26
28
|
* @returns An object for managing Table viewport state.
|
|
27
29
|
*/
|
|
28
30
|
export function useViewportData(_ref) {
|
|
@@ -32,9 +34,10 @@ export function useViewportData(_ref) {
|
|
|
32
34
|
scrollDebounce = SCROLL_DEBOUNCE_MS,
|
|
33
35
|
viewportSize = 10,
|
|
34
36
|
viewportPadding = 50,
|
|
35
|
-
deserializeRow = defaultRowDeserializer
|
|
37
|
+
deserializeRow = defaultRowDeserializer,
|
|
38
|
+
reuseItemsOnTableResize = false
|
|
36
39
|
} = _ref;
|
|
37
|
-
var viewportData = useInitializeViewportData(table);
|
|
40
|
+
var viewportData = useInitializeViewportData(table, reuseItemsOnTableResize);
|
|
38
41
|
var setPaddedViewport = useSetPaddedViewportCallback(table, viewportSize, viewportPadding);
|
|
39
42
|
var setViewport = useCallback(firstRow => {
|
|
40
43
|
if (table && !isClosed(table)) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useViewportData.js","names":["useCallback","useEffect","useMemo","defaultRowDeserializer","isClosed","createOnTableUpdatedHandler","Log","useApi","useOnScrollOffsetChangeCallback","SCROLL_DEBOUNCE_MS","useInitializeViewportData","useSetPaddedViewportCallback","useTableSize","useTableListener","log","module","useViewportData","_ref","table","itemHeight","scrollDebounce","viewportSize","viewportPadding","deserializeRow","viewportData","setPaddedViewport","setViewport","firstRow","debug","applyFiltersAndRefresh","filters","applyFilter","dh","onTableUpdated","Table","EVENT_UPDATED","size","onScroll"],"sources":["../src/useViewportData.ts"],"sourcesContent":["import { useCallback, useEffect, useMemo } from 'react';\nimport type { dh } from '@deephaven/jsapi-types';\nimport {\n RowDeserializer,\n defaultRowDeserializer,\n isClosed,\n createOnTableUpdatedHandler,\n} from '@deephaven/jsapi-utils';\nimport Log from '@deephaven/log';\nimport { useApi } from '@deephaven/jsapi-bootstrap';\nimport {\n useOnScrollOffsetChangeCallback,\n WindowedListData,\n} from '@deephaven/react-hooks';\nimport { KeyedItem, SCROLL_DEBOUNCE_MS } from '@deephaven/utils';\nimport useInitializeViewportData from './useInitializeViewportData';\nimport useSetPaddedViewportCallback from './useSetPaddedViewportCallback';\nimport useTableSize from './useTableSize';\nimport useTableListener from './useTableListener';\n\nconst log = Log.module('useViewportData');\n\nexport interface UseViewportDataProps<\n TItem,\n TTable extends dh.Table | dh.TreeTable,\n> {\n table: TTable | null;\n itemHeight?: number;\n scrollDebounce?: number;\n viewportSize?: number;\n viewportPadding?: number;\n deserializeRow?: RowDeserializer<TItem>;\n}\n\nexport interface UseViewportDataResult<\n TItem,\n TTable extends dh.Table | dh.TreeTable,\n> {\n /** Manages deserialized row items associated with a DH Table */\n viewportData: WindowedListData<KeyedItem<TItem>>;\n /** Size of the underlying Table */\n size: number;\n\n table: TTable | null;\n /** Apply filters and refresh viewport. */\n applyFiltersAndRefresh: (filters: dh.FilterCondition[]) => void;\n /** Set the viewport of the Table */\n setViewport: (firstRow: number) => void;\n /** Handler for scroll events to update viewport */\n onScroll: (event: Event) => void;\n}\n\n/**\n * Sets up state management for windowed Table viewports. Returns a ListData\n * instance for managing items associated with the Table + a `setViewport`\n * callback for changing the current viewport.\n *\n * IMPORTANT: this will create an empty KeyedItem object for every row in the\n * source table. This is intended for \"human\" sized tables such as those used in\n * admin panels. This is not suitable for \"machine\" scale with millions+ rows.\n * @param table The Table to viewport.\n * @param itemHeight The height of each item in the viewport.\n * @param scrollDebounce The number of milliseconds to debounce scroll events.\n * @param viewportSize The number of items to display in the viewport.\n * @param viewportPadding The number of items to fetch at start and end of the viewport.\n * @param deserializeRow A function to deserialize a row from the Table.\n * @returns An object for managing Table viewport state.\n */\nexport function useViewportData<TItem, TTable extends dh.Table | dh.TreeTable>({\n table,\n itemHeight = 1,\n scrollDebounce = SCROLL_DEBOUNCE_MS,\n viewportSize = 10,\n viewportPadding = 50,\n deserializeRow = defaultRowDeserializer,\n}: UseViewportDataProps<TItem, TTable>): UseViewportDataResult<TItem, TTable> {\n const viewportData = useInitializeViewportData<TItem>(table);\n\n const setPaddedViewport = useSetPaddedViewportCallback(\n table,\n viewportSize,\n viewportPadding\n );\n\n const setViewport = useCallback(\n (firstRow: number) => {\n if (table && !isClosed(table)) {\n setPaddedViewport(firstRow);\n } else {\n log.debug('setViewport called on closed table.', table);\n }\n },\n [table, setPaddedViewport]\n );\n\n const applyFiltersAndRefresh = useCallback(\n (filters: dh.FilterCondition[]) => {\n if (table && !isClosed(table)) {\n table.applyFilter(filters);\n setViewport(0);\n } else {\n log.debug('applyFiltersAndRefresh called on closed table.', table);\n }\n },\n [setViewport, table]\n );\n\n const dh = useApi();\n\n const onTableUpdated = useMemo(\n () => createOnTableUpdatedHandler(viewportData, deserializeRow),\n [deserializeRow, viewportData]\n );\n\n useTableListener(table, dh.Table.EVENT_UPDATED, onTableUpdated);\n\n const size = useTableSize(table);\n\n useEffect(() => {\n // Hydrate the viewport with real data. This will fetch data from index\n // 0 to the end of the viewport + padding.\n setViewport(0);\n }, [table, setViewport, size]);\n\n const onScroll = useOnScrollOffsetChangeCallback(\n itemHeight,\n setViewport,\n scrollDebounce\n );\n\n return useMemo(\n () => ({\n viewportData,\n size,\n table,\n applyFiltersAndRefresh,\n setViewport,\n onScroll,\n }),\n [applyFiltersAndRefresh, onScroll, setViewport, size, table, viewportData]\n );\n}\n\nexport default useViewportData;\n"],"mappings":"AAAA,SAASA,WAAW,EAAEC,SAAS,EAAEC,OAAO,QAAQ,OAAO;AAEvD,SAEEC,sBAAsB,EACtBC,QAAQ,EACRC,2BAA2B,QACtB,wBAAwB;AAC/B,OAAOC,GAAG,MAAM,gBAAgB;AAChC,SAASC,MAAM,QAAQ,4BAA4B;AACnD,SACEC,+BAA+B,QAE1B,wBAAwB;AAC/B,SAAoBC,kBAAkB,QAAQ,kBAAkB;AAAC,OAC1DC,yBAAyB;AAAA,OACzBC,4BAA4B;AAAA,OAC5BC,YAAY;AAAA,OACZC,gBAAgB;AAEvB,IAAMC,GAAG,GAAGR,GAAG,CAACS,MAAM,CAAC,iBAAiB,CAAC;
|
|
1
|
+
{"version":3,"file":"useViewportData.js","names":["useCallback","useEffect","useMemo","defaultRowDeserializer","isClosed","createOnTableUpdatedHandler","Log","useApi","useOnScrollOffsetChangeCallback","SCROLL_DEBOUNCE_MS","useInitializeViewportData","useSetPaddedViewportCallback","useTableSize","useTableListener","log","module","useViewportData","_ref","table","itemHeight","scrollDebounce","viewportSize","viewportPadding","deserializeRow","reuseItemsOnTableResize","viewportData","setPaddedViewport","setViewport","firstRow","debug","applyFiltersAndRefresh","filters","applyFilter","dh","onTableUpdated","Table","EVENT_UPDATED","size","onScroll"],"sources":["../src/useViewportData.ts"],"sourcesContent":["import { useCallback, useEffect, useMemo } from 'react';\nimport type { dh } from '@deephaven/jsapi-types';\nimport {\n RowDeserializer,\n defaultRowDeserializer,\n isClosed,\n createOnTableUpdatedHandler,\n} from '@deephaven/jsapi-utils';\nimport Log from '@deephaven/log';\nimport { useApi } from '@deephaven/jsapi-bootstrap';\nimport {\n useOnScrollOffsetChangeCallback,\n WindowedListData,\n} from '@deephaven/react-hooks';\nimport { KeyedItem, SCROLL_DEBOUNCE_MS } from '@deephaven/utils';\nimport useInitializeViewportData from './useInitializeViewportData';\nimport useSetPaddedViewportCallback from './useSetPaddedViewportCallback';\nimport useTableSize from './useTableSize';\nimport useTableListener from './useTableListener';\n\nconst log = Log.module('useViewportData');\n\nexport interface UseViewportDataProps<\n TItem,\n TTable extends dh.Table | dh.TreeTable,\n> {\n reuseItemsOnTableResize?: boolean;\n table: TTable | null;\n itemHeight?: number;\n scrollDebounce?: number;\n viewportSize?: number;\n viewportPadding?: number;\n deserializeRow?: RowDeserializer<TItem>;\n}\n\nexport interface UseViewportDataResult<\n TItem,\n TTable extends dh.Table | dh.TreeTable,\n> {\n /** Manages deserialized row items associated with a DH Table */\n viewportData: WindowedListData<KeyedItem<TItem>>;\n /** Size of the underlying Table */\n size: number;\n\n table: TTable | null;\n /** Apply filters and refresh viewport. */\n applyFiltersAndRefresh: (filters: dh.FilterCondition[]) => void;\n /** Set the viewport of the Table */\n setViewport: (firstRow: number) => void;\n /** Handler for scroll events to update viewport */\n onScroll: (event: Event) => void;\n}\n\n/**\n * Sets up state management for windowed Table viewports. Returns a ListData\n * instance for managing items associated with the Table + a `setViewport`\n * callback for changing the current viewport.\n *\n * IMPORTANT: this will create an empty KeyedItem object for every row in the\n * source table. This is intended for \"human\" sized tables such as those used in\n * admin panels. This is not suitable for \"machine\" scale with millions+ rows.\n * @param table The Table to viewport.\n * @param itemHeight The height of each item in the viewport.\n * @param scrollDebounce The number of milliseconds to debounce scroll events.\n * @param viewportSize The number of items to display in the viewport.\n * @param viewportPadding The number of items to fetch at start and end of the viewport.\n * @param deserializeRow A function to deserialize a row from the Table.\n * @param reuseItemsOnTableResize If true, existing items will be re-used when\n * the table size changes.\n * @returns An object for managing Table viewport state.\n */\nexport function useViewportData<TItem, TTable extends dh.Table | dh.TreeTable>({\n table,\n itemHeight = 1,\n scrollDebounce = SCROLL_DEBOUNCE_MS,\n viewportSize = 10,\n viewportPadding = 50,\n deserializeRow = defaultRowDeserializer,\n reuseItemsOnTableResize = false,\n}: UseViewportDataProps<TItem, TTable>): UseViewportDataResult<TItem, TTable> {\n const viewportData = useInitializeViewportData<TItem>(\n table,\n reuseItemsOnTableResize\n );\n\n const setPaddedViewport = useSetPaddedViewportCallback(\n table,\n viewportSize,\n viewportPadding\n );\n\n const setViewport = useCallback(\n (firstRow: number) => {\n if (table && !isClosed(table)) {\n setPaddedViewport(firstRow);\n } else {\n log.debug('setViewport called on closed table.', table);\n }\n },\n [table, setPaddedViewport]\n );\n\n const applyFiltersAndRefresh = useCallback(\n (filters: dh.FilterCondition[]) => {\n if (table && !isClosed(table)) {\n table.applyFilter(filters);\n setViewport(0);\n } else {\n log.debug('applyFiltersAndRefresh called on closed table.', table);\n }\n },\n [setViewport, table]\n );\n\n const dh = useApi();\n\n const onTableUpdated = useMemo(\n () => createOnTableUpdatedHandler(viewportData, deserializeRow),\n [deserializeRow, viewportData]\n );\n\n useTableListener(table, dh.Table.EVENT_UPDATED, onTableUpdated);\n\n const size = useTableSize(table);\n\n useEffect(() => {\n // Hydrate the viewport with real data. This will fetch data from index\n // 0 to the end of the viewport + padding.\n setViewport(0);\n }, [table, setViewport, size]);\n\n const onScroll = useOnScrollOffsetChangeCallback(\n itemHeight,\n setViewport,\n scrollDebounce\n );\n\n return useMemo(\n () => ({\n viewportData,\n size,\n table,\n applyFiltersAndRefresh,\n setViewport,\n onScroll,\n }),\n [applyFiltersAndRefresh, onScroll, setViewport, size, table, viewportData]\n );\n}\n\nexport default useViewportData;\n"],"mappings":"AAAA,SAASA,WAAW,EAAEC,SAAS,EAAEC,OAAO,QAAQ,OAAO;AAEvD,SAEEC,sBAAsB,EACtBC,QAAQ,EACRC,2BAA2B,QACtB,wBAAwB;AAC/B,OAAOC,GAAG,MAAM,gBAAgB;AAChC,SAASC,MAAM,QAAQ,4BAA4B;AACnD,SACEC,+BAA+B,QAE1B,wBAAwB;AAC/B,SAAoBC,kBAAkB,QAAQ,kBAAkB;AAAC,OAC1DC,yBAAyB;AAAA,OACzBC,4BAA4B;AAAA,OAC5BC,YAAY;AAAA,OACZC,gBAAgB;AAEvB,IAAMC,GAAG,GAAGR,GAAG,CAACS,MAAM,CAAC,iBAAiB,CAAC;AAiCzC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,SAASC,eAAeA,CAAAC,IAAA,EAQ+C;EAAA,IARC;IAC7EC,KAAK;IACLC,UAAU,GAAG,CAAC;IACdC,cAAc,GAAGX,kBAAkB;IACnCY,YAAY,GAAG,EAAE;IACjBC,eAAe,GAAG,EAAE;IACpBC,cAAc,GAAGpB,sBAAsB;IACvCqB,uBAAuB,GAAG;EACS,CAAC,GAAAP,IAAA;EACpC,IAAMQ,YAAY,GAAGf,yBAAyB,CAC5CQ,KAAK,EACLM,uBACF,CAAC;EAED,IAAME,iBAAiB,GAAGf,4BAA4B,CACpDO,KAAK,EACLG,YAAY,EACZC,eACF,CAAC;EAED,IAAMK,WAAW,GAAG3B,WAAW,CAC5B4B,QAAgB,IAAK;IACpB,IAAIV,KAAK,IAAI,CAACd,QAAQ,CAACc,KAAK,CAAC,EAAE;MAC7BQ,iBAAiB,CAACE,QAAQ,CAAC;IAC7B,CAAC,MAAM;MACLd,GAAG,CAACe,KAAK,CAAC,qCAAqC,EAAEX,KA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
|
|
1
1
|
{
|
|
2
2
|
"name": "@deephaven/jsapi-components",
|
|
3
|
-
"version": "0.70.
|
|
3
|
+
"version": "0.70.1-alpha-picker-table.35+79b80350",
|
|
4
4
|
"description": "Deephaven JSAPI Components",
|
|
5
5
|
"author": "Deephaven Data Labs LLC",
|
|
6
6
|
"license": "Apache-2.0",
|
|
@@ -22,13 +22,13 @@
|
|
|
22
22
|
"build:sass": "sass --embed-sources --load-path=../../node_modules ./src:./dist"
|
|
23
23
|
},
|
|
24
24
|
"dependencies": {
|
|
25
|
-
"@deephaven/components": "^0.70.
|
|
26
|
-
"@deephaven/jsapi-bootstrap": "^0.70.
|
|
25
|
+
"@deephaven/components": "^0.70.1-alpha-picker-table.35+79b80350",
|
|
26
|
+
"@deephaven/jsapi-bootstrap": "^0.70.1-alpha-picker-table.35+79b80350",
|
|
27
27
|
"@deephaven/jsapi-types": "1.0.0-dev0.33.1",
|
|
28
|
-
"@deephaven/jsapi-utils": "^0.70.
|
|
29
|
-
"@deephaven/log": "^0.70.
|
|
30
|
-
"@deephaven/react-hooks": "^0.70.
|
|
31
|
-
"@deephaven/utils": "^0.70.
|
|
28
|
+
"@deephaven/jsapi-utils": "^0.70.1-alpha-picker-table.35+79b80350",
|
|
29
|
+
"@deephaven/log": "^0.70.1-alpha-picker-table.35+79b80350",
|
|
30
|
+
"@deephaven/react-hooks": "^0.70.1-alpha-picker-table.35+79b80350",
|
|
31
|
+
"@deephaven/utils": "^0.70.1-alpha-picker-table.35+79b80350",
|
|
32
32
|
"@types/js-cookie": "^3.0.3",
|
|
33
33
|
"classnames": "^2.3.2",
|
|
34
34
|
"js-cookie": "^3.0.5",
|
|
@@ -36,7 +36,7 @@
|
|
|
36
36
|
"prop-types": "^15.8.1"
|
|
37
37
|
},
|
|
38
38
|
"devDependencies": {
|
|
39
|
-
"@deephaven/jsapi-shim": "^0.70.
|
|
39
|
+
"@deephaven/jsapi-shim": "^0.70.1-alpha-picker-table.35+79b80350",
|
|
40
40
|
"react-test-renderer": "^17.0.2"
|
|
41
41
|
},
|
|
42
42
|
"peerDependencies": {
|
|
@@ -51,5 +51,5 @@
|
|
|
51
51
|
"publishConfig": {
|
|
52
52
|
"access": "public"
|
|
53
53
|
},
|
|
54
|
-
"gitHead": "
|
|
54
|
+
"gitHead": "79b8035064f6733a37186a6b11d91bb9bfaa7e3c"
|
|
55
55
|
}
|