@deephaven/jsapi-components 0.71.1-beta.3 → 0.71.1-doomhaven.1
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 +0 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +0 -1
- package/dist/index.js.map +1 -1
- package/dist/spectrum/Picker/Picker.d.ts +1 -3
- package/dist/spectrum/Picker/Picker.d.ts.map +1 -1
- package/dist/spectrum/Picker/Picker.js +10 -8
- package/dist/spectrum/Picker/Picker.js.map +1 -1
- package/dist/useGetItemIndexByValue.d.ts.map +1 -1
- package/dist/useGetItemIndexByValue.js.map +1 -1
- package/package.json +9 -9
- package/dist/useFormatter.d.ts +0 -13
- package/dist/useFormatter.d.ts.map +0 -1
- package/dist/useFormatter.js +0 -37
- package/dist/useFormatter.js.map +0 -1
package/dist/index.d.ts
CHANGED
|
@@ -11,7 +11,6 @@ export { default as useDebouncedViewportSearch } from './useDebouncedViewportSea
|
|
|
11
11
|
export * from './useDebouncedViewportSelectionFilter';
|
|
12
12
|
export * from './useFilterConditionFactories';
|
|
13
13
|
export * from './useFilteredItemsWithDefaultValue';
|
|
14
|
-
export * from './useFormatter';
|
|
15
14
|
export * from './useGetItemIndexByValue';
|
|
16
15
|
export * from './useGetItemPosition';
|
|
17
16
|
export { default as useInitializeViewportData } from './useInitializeViewportData';
|
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,YAAY,CAAC;AAC3B,cAAc,iBAAiB,CAAC;AAChC,OAAO,EAAE,OAAO,IAAI,mBAAmB,EAAE,MAAM,uBAAuB,CA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,CAAC;AACjD,OAAO,EAAE,OAAO,IAAI,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAC7D,OAAO,EAAE,OAAO,IAAI,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AACjE,OAAO,EAAE,OAAO,IAAI,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAC3D,OAAO,EAAE,OAAO,IAAI,YAAY,EAAE,MAAM,gBAAgB,CAAC;AACzD,OAAO,EAAE,OAAO,IAAI,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAC3D,cAAc,kBAAkB,CAAC;AACjC,OAAO,EAAE,OAAO,IAAI,eAAe,EAAE,MAAM,mBAAmB,CAAC;AAC/D,YAAY,EAAE,4BAA4B,EAAE,MAAM,0BAA0B,CAAC;AAC7E,YAAY,EAAE,qBAAqB,EAAE,MAAM,mBAAmB,CAAC;AAC/D,cAAc,qBAAqB,CAAC"}
|
package/dist/index.js
CHANGED
|
@@ -11,7 +11,6 @@ export { default as useDebouncedViewportSearch } from "./useDebouncedViewportSea
|
|
|
11
11
|
export * from "./useDebouncedViewportSelectionFilter.js";
|
|
12
12
|
export * from "./useFilterConditionFactories.js";
|
|
13
13
|
export * from "./useFilteredItemsWithDefaultValue.js";
|
|
14
|
-
export * from "./useFormatter.js";
|
|
15
14
|
export * from "./useGetItemIndexByValue.js";
|
|
16
15
|
export * from "./useGetItemPosition.js";
|
|
17
16
|
export { default as useInitializeViewportData } from "./useInitializeViewportData.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 './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 './
|
|
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"}
|
|
@@ -1,13 +1,11 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
2
|
import { PickerProps as PickerPropsBase } from '@deephaven/components';
|
|
3
3
|
import { dh as DhType } from '@deephaven/jsapi-types';
|
|
4
|
-
import { Settings } from '@deephaven/jsapi-utils';
|
|
5
4
|
export interface PickerProps extends Omit<PickerPropsBase, 'children'> {
|
|
6
5
|
table: DhType.Table;
|
|
7
6
|
keyColumn?: string;
|
|
8
7
|
labelColumn?: string;
|
|
9
|
-
settings?: Settings;
|
|
10
8
|
}
|
|
11
|
-
export declare function Picker({ table, keyColumn: keyColumnName, labelColumn: labelColumnName, selectedKey,
|
|
9
|
+
export declare function Picker({ table, keyColumn: keyColumnName, labelColumn: labelColumnName, selectedKey, ...props }: PickerProps): JSX.Element;
|
|
12
10
|
export default Picker;
|
|
13
11
|
//# sourceMappingURL=Picker.d.ts.map
|
|
@@ -1 +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;
|
|
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;AAE/B,OAAO,EAAE,EAAE,IAAI,MAAM,EAAE,MAAM,wBAAwB,CAAC;AAYtD,MAAM,WAAW,WAAY,SAAQ,IAAI,CAAC,eAAe,EAAE,UAAU,CAAC;IACpE,KAAK,EAAE,MAAM,CAAC,KAAK,CAAC;IAEpB,SAAS,CAAC,EAAE,MAAM,CAAC;IAEnB,WAAW,CAAC,EAAE,MAAM,CAAC;CAGtB;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,CAkF3B;AAED,eAAe,MAAM,CAAC"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
var _excluded = ["table", "keyColumn", "labelColumn", "selectedKey"
|
|
1
|
+
var _excluded = ["table", "keyColumn", "labelColumn", "selectedKey"];
|
|
2
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
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
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; }
|
|
@@ -9,10 +9,11 @@ function _asyncToGenerator(fn) { return function () { var self = this, args = ar
|
|
|
9
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
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
11
|
import { Picker as PickerBase } from '@deephaven/components';
|
|
12
|
+
import { useApi } from '@deephaven/jsapi-bootstrap';
|
|
13
|
+
import { Formatter } from '@deephaven/jsapi-utils';
|
|
12
14
|
import Log from '@deephaven/log';
|
|
13
15
|
import { PICKER_ITEM_HEIGHT, PICKER_TOP_OFFSET } from '@deephaven/utils';
|
|
14
16
|
import { useCallback, useEffect, useMemo } from 'react';
|
|
15
|
-
import useFormatter from "../../useFormatter.js";
|
|
16
17
|
import useGetItemIndexByValue from "../../useGetItemIndexByValue.js";
|
|
17
18
|
import { useViewportData } from "../../useViewportData.js";
|
|
18
19
|
import { getPickerKeyColumn } from "./PickerUtils.js";
|
|
@@ -24,13 +25,14 @@ export function Picker(_ref) {
|
|
|
24
25
|
table,
|
|
25
26
|
keyColumn: keyColumnName,
|
|
26
27
|
labelColumn: labelColumnName,
|
|
27
|
-
selectedKey
|
|
28
|
-
settings
|
|
28
|
+
selectedKey
|
|
29
29
|
} = _ref,
|
|
30
30
|
props = _objectWithoutProperties(_ref, _excluded);
|
|
31
|
-
var
|
|
32
|
-
|
|
33
|
-
|
|
31
|
+
var dh = useApi();
|
|
32
|
+
var formatValue = useMemo(() => {
|
|
33
|
+
var formatter = new Formatter(dh);
|
|
34
|
+
return formatter.getFormattedString.bind(formatter);
|
|
35
|
+
}, [dh]);
|
|
34
36
|
var keyColumn = useMemo(() => getPickerKeyColumn(table, keyColumnName), [keyColumnName, table]);
|
|
35
37
|
var deserializeRow = usePickerItemRowDeserializer({
|
|
36
38
|
table,
|
|
@@ -76,7 +78,7 @@ export function Picker(_ref) {
|
|
|
76
78
|
return () => {
|
|
77
79
|
isCanceled = true;
|
|
78
80
|
};
|
|
79
|
-
}, [getItemIndexByValue,
|
|
81
|
+
}, [getItemIndexByValue, setViewport]);
|
|
80
82
|
return /*#__PURE__*/_jsx(PickerBase
|
|
81
83
|
// eslint-disable-next-line react/jsx-props-no-spreading
|
|
82
84
|
, _objectSpread(_objectSpread({}, props), {}, {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Picker.js","names":["Picker","PickerBase","Log","PICKER_ITEM_HEIGHT","PICKER_TOP_OFFSET","useCallback","useEffect","useMemo","
|
|
1
|
+
{"version":3,"file":"Picker.js","names":["Picker","PickerBase","useApi","Formatter","Log","PICKER_ITEM_HEIGHT","PICKER_TOP_OFFSET","useCallback","useEffect","useMemo","useGetItemIndexByValue","useViewportData","getPickerKeyColumn","usePickerItemRowDeserializer","jsx","_jsx","log","module","_ref","table","keyColumn","keyColumnName","labelColumn","labelColumnName","selectedKey","props","_objectWithoutProperties","_excluded","dh","formatValue","formatter","getFormattedString","bind","deserializeRow","getItemIndexByValue","columnName","name","value","getInitialScrollPosition","_asyncToGenerator","index","viewportData","onScroll","setViewport","reuseItemsOnTableResize","itemHeight","setViewportFromSelectedKey","isCanceled","then","catch","err","error","_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 { useApi } from '@deephaven/jsapi-bootstrap';\nimport { dh as DhType } from '@deephaven/jsapi-types';\nimport { Formatter } from '@deephaven/jsapi-utils';\nimport Log from '@deephaven/log';\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\nconst log = Log.module('jsapi-components.Picker');\n\nexport interface PickerProps extends Omit<PickerPropsBase, 'children'> {\n table: DhType.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 // TODO #1890 : descriptionColumn, iconColumn\n}\n\nexport function Picker({\n table,\n keyColumn: keyColumnName,\n labelColumn: labelColumnName,\n selectedKey,\n ...props\n}: PickerProps): JSX.Element {\n const dh = useApi();\n\n const formatValue = useMemo(() => {\n const formatter = new Formatter(dh);\n return formatter.getFormattedString.bind(formatter);\n }, [dh]);\n\n const keyColumn = useMemo(\n () => getPickerKeyColumn(table, keyColumnName),\n [keyColumnName, table]\n );\n\n const deserializeRow = usePickerItemRowDeserializer({\n table,\n keyColumnName,\n labelColumnName,\n formatValue,\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 DhType.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 let isCanceled = false;\n\n getItemIndexByValue()\n .then(index => {\n if (index == null || isCanceled) {\n return;\n }\n\n setViewport(index);\n })\n .catch(err => {\n log.error('Error setting viewport from selected key', err);\n });\n\n return () => {\n isCanceled = true;\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 selectedKey={selectedKey}\n onScroll={onScroll}\n >\n {viewportData.items}\n </PickerBase>\n );\n}\n\nexport default Picker;\n"],"mappings":";;;;;;;;;;AAAA,SAEEA,MAAM,IAAIC,UAAU,QAEf,uBAAuB;AAC9B,SAASC,MAAM,QAAQ,4BAA4B;AAEnD,SAASC,SAAS,QAAQ,wBAAwB;AAClD,OAAOC,GAAG,MAAM,gBAAgB;AAChC,SAASC,kBAAkB,EAAEC,iBAAiB,QAAQ,kBAAkB;AACxE,SAASC,WAAW,EAAEC,SAAS,EAAEC,OAAO,QAAQ,OAAO;AAAC,OACjDC,sBAAsB;AAAA,SACpBC,eAAe;AAAA,SACfC,kBAAkB;AAAA,SAClBC,4BAA4B;AAAA,SAAAC,GAAA,IAAAC,IAAA;AAErC,IAAMC,GAAG,GAAGZ,GAAG,CAACa,MAAM,CAAC,yBAAyB,CAAC;AAYjD,OAAO,SAASjB,MAAMA,CAAAkB,IAAA,EAMO;EAAA,IANN;MACrBC,KAAK;MACLC,SAAS,EAAEC,aAAa;MACxBC,WAAW,EAAEC,eAAe;MAC5BC;IAEW,CAAC,GAAAN,IAA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mB,CAAC,CAAC,CAClBc,IAAI,CAACR,KAAK,IAAI;MACb,IAAIA,KAAK,IAAI,IAAI,IAAIO,UAAU,EAAE;QAC/B;MACF;MAEAJ,WAAW,CAACH,KAAK,CAAC;IACpB,CAAC,CAAC,CACDS,KAAK,CAACC,GAAG,IAAI;MACZlC,GAAG,CAACmC,KAAK,CAAC,0CAA0C,EAAED,GAAG,CAAC;IAC5D,CAAC,CAAC;IAEJ,OAAO,MAAM;MACXH,UAAU,GAAG,IAAI;IACnB,CAAC;EACH,CAAC,EACD,CAACb,mBAAmB,EAAES,WAAW,CACnC,CAAC;EAED,oBACE5B,IAAA,CAACd;EACC;EAAA,EAAAmD,aAAA,CAAAA,aAAA,KACI3B,KAAK;IACTa,wBAAwB,EAAEA,wBAAyB;IACnDd,WAAW,EAAEA,WAAY;IACzBkB,QAAQ,EAAEA,QAAS;IAAAW,QAAA,EAElBZ,YAAY,CAACa;EAAK,EACT,CAAC;AAEjB;AAEA,eAAetD,MAAM"}
|
|
@@ -1 +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,
|
|
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"}
|
|
@@ -1 +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 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;
|
|
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"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@deephaven/jsapi-components",
|
|
3
|
-
"version": "0.71.1-
|
|
3
|
+
"version": "0.71.1-doomhaven.1+061873cc",
|
|
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.71.1-
|
|
26
|
-
"@deephaven/jsapi-bootstrap": "^0.71.1-
|
|
25
|
+
"@deephaven/components": "^0.71.1-doomhaven.1+061873cc",
|
|
26
|
+
"@deephaven/jsapi-bootstrap": "^0.71.1-doomhaven.1+061873cc",
|
|
27
27
|
"@deephaven/jsapi-types": "1.0.0-dev0.33.1",
|
|
28
|
-
"@deephaven/jsapi-utils": "^0.71.1-
|
|
29
|
-
"@deephaven/log": "^0.71.1-
|
|
30
|
-
"@deephaven/react-hooks": "^0.71.1-
|
|
31
|
-
"@deephaven/utils": "^0.71.1-
|
|
28
|
+
"@deephaven/jsapi-utils": "^0.71.1-doomhaven.1+061873cc",
|
|
29
|
+
"@deephaven/log": "^0.71.1-doomhaven.1+061873cc",
|
|
30
|
+
"@deephaven/react-hooks": "^0.71.1-doomhaven.1+061873cc",
|
|
31
|
+
"@deephaven/utils": "^0.71.1-doomhaven.1+061873cc",
|
|
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.71.1-
|
|
39
|
+
"@deephaven/jsapi-shim": "^0.71.1-doomhaven.1+061873cc",
|
|
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": "061873ccae250fe04edfc2df76d92d82d0940a04"
|
|
55
55
|
}
|
package/dist/useFormatter.d.ts
DELETED
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
import { Formatter, Settings } from '@deephaven/jsapi-utils';
|
|
2
|
-
export type UseFormatterResult = Pick<Formatter, 'getColumnFormat' | 'getColumnFormatMapForType' | 'getColumnTypeFormatter' | 'getFormattedString' | 'timeZone'>;
|
|
3
|
-
/**
|
|
4
|
-
* Returns a subset of members of a `Formatter` instance. The `Formatter` will be
|
|
5
|
-
* constructed based on the given options or fallback to the configuration found
|
|
6
|
-
* in the current `FormatSettingsContext`. Members that are functions are bound
|
|
7
|
-
* to the `Formatter` instance, so they are safe to destructure. Static methods
|
|
8
|
-
* can still be accessed statically from the `Formatter` class.
|
|
9
|
-
* @param settings Optional settings to use when constructing the `Formatter`
|
|
10
|
-
*/
|
|
11
|
-
export declare function useFormatter(settings?: Settings): UseFormatterResult;
|
|
12
|
-
export default useFormatter;
|
|
13
|
-
//# sourceMappingURL=useFormatter.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"useFormatter.d.ts","sourceRoot":"","sources":["../src/useFormatter.ts"],"names":[],"mappings":"AACA,OAAO,EAEL,SAAS,EACT,QAAQ,EACT,MAAM,wBAAwB,CAAC;AAIhC,MAAM,MAAM,kBAAkB,GAAG,IAAI,CACnC,SAAS,EACP,iBAAiB,GACjB,2BAA2B,GAC3B,wBAAwB,GACxB,oBAAoB,GACpB,UAAU,CACb,CAAC;AAEF;;;;;;;GAOG;AACH,wBAAgB,YAAY,CAAC,QAAQ,CAAC,EAAE,QAAQ,GAAG,kBAAkB,CA0BpE;AAED,eAAe,YAAY,CAAC"}
|
package/dist/useFormatter.js
DELETED
|
@@ -1,37 +0,0 @@
|
|
|
1
|
-
import { useApi } from '@deephaven/jsapi-bootstrap';
|
|
2
|
-
import { createFormatterFromSettings } from '@deephaven/jsapi-utils';
|
|
3
|
-
import { bindAllMethods } from '@deephaven/utils';
|
|
4
|
-
import { useMemo } from 'react';
|
|
5
|
-
/**
|
|
6
|
-
* Returns a subset of members of a `Formatter` instance. The `Formatter` will be
|
|
7
|
-
* constructed based on the given options or fallback to the configuration found
|
|
8
|
-
* in the current `FormatSettingsContext`. Members that are functions are bound
|
|
9
|
-
* to the `Formatter` instance, so they are safe to destructure. Static methods
|
|
10
|
-
* can still be accessed statically from the `Formatter` class.
|
|
11
|
-
* @param settings Optional settings to use when constructing the `Formatter`
|
|
12
|
-
*/
|
|
13
|
-
export function useFormatter(settings) {
|
|
14
|
-
var dh = useApi();
|
|
15
|
-
var formatter = useMemo(() => {
|
|
16
|
-
var instance = createFormatterFromSettings(dh, settings);
|
|
17
|
-
|
|
18
|
-
// Bind all methods so we can destructure them
|
|
19
|
-
bindAllMethods(instance);
|
|
20
|
-
return instance;
|
|
21
|
-
}, [dh, settings]);
|
|
22
|
-
var {
|
|
23
|
-
getColumnFormat,
|
|
24
|
-
getColumnFormatMapForType,
|
|
25
|
-
getColumnTypeFormatter,
|
|
26
|
-
getFormattedString
|
|
27
|
-
} = formatter;
|
|
28
|
-
return {
|
|
29
|
-
getColumnFormat,
|
|
30
|
-
getColumnFormatMapForType,
|
|
31
|
-
getColumnTypeFormatter,
|
|
32
|
-
getFormattedString,
|
|
33
|
-
timeZone: formatter.timeZone
|
|
34
|
-
};
|
|
35
|
-
}
|
|
36
|
-
export default useFormatter;
|
|
37
|
-
//# sourceMappingURL=useFormatter.js.map
|
package/dist/useFormatter.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"useFormatter.js","names":["useApi","createFormatterFromSettings","bindAllMethods","useMemo","useFormatter","settings","dh","formatter","instance","getColumnFormat","getColumnFormatMapForType","getColumnTypeFormatter","getFormattedString","timeZone"],"sources":["../src/useFormatter.ts"],"sourcesContent":["import { useApi } from '@deephaven/jsapi-bootstrap';\nimport {\n createFormatterFromSettings,\n Formatter,\n Settings,\n} from '@deephaven/jsapi-utils';\nimport { bindAllMethods } from '@deephaven/utils';\nimport { useMemo } from 'react';\n\nexport type UseFormatterResult = Pick<\n Formatter,\n | 'getColumnFormat'\n | 'getColumnFormatMapForType'\n | 'getColumnTypeFormatter'\n | 'getFormattedString'\n | 'timeZone'\n>;\n\n/**\n * Returns a subset of members of a `Formatter` instance. The `Formatter` will be\n * constructed based on the given options or fallback to the configuration found\n * in the current `FormatSettingsContext`. Members that are functions are bound\n * to the `Formatter` instance, so they are safe to destructure. Static methods\n * can still be accessed statically from the `Formatter` class.\n * @param settings Optional settings to use when constructing the `Formatter`\n */\nexport function useFormatter(settings?: Settings): UseFormatterResult {\n const dh = useApi();\n\n const formatter = useMemo(() => {\n const instance = createFormatterFromSettings(dh, settings);\n\n // Bind all methods so we can destructure them\n bindAllMethods(instance);\n\n return instance;\n }, [dh, settings]);\n\n const {\n getColumnFormat,\n getColumnFormatMapForType,\n getColumnTypeFormatter,\n getFormattedString,\n } = formatter;\n\n return {\n getColumnFormat,\n getColumnFormatMapForType,\n getColumnTypeFormatter,\n getFormattedString,\n timeZone: formatter.timeZone,\n };\n}\n\nexport default useFormatter;\n"],"mappings":"AAAA,SAASA,MAAM,QAAQ,4BAA4B;AACnD,SACEC,2BAA2B,QAGtB,wBAAwB;AAC/B,SAASC,cAAc,QAAQ,kBAAkB;AACjD,SAASC,OAAO,QAAQ,OAAO;AAW/B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,SAASC,YAAYA,CAACC,QAAmB,EAAsB;EACpE,IAAMC,EAAE,GAAGN,MAAM,CAAC,CAAC;EAEnB,IAAMO,SAAS,GAAGJ,OAAO,CAAC,MAAM;IAC9B,IAAMK,QAAQ,GAAGP,2BAA2B,CAACK,EAAE,EAAED,QAAQ,CAAC;;IAE1D;IACAH,cAAc,CAACM,QAAQ,CAAC;IAExB,OAAOA,QAAQ;EACjB,CAAC,EAAE,CAACF,EAAE,EAAED,QAAQ,CAAC,CAAC;EAElB,IAAM;IACJI,eAAe;IACfC,yBAAyB;IACzBC,sBAAsB;IACtBC;EACF,CAAC,GAAGL,SAAS;EAEb,OAAO;IACLE,eAAe;IACfC,yBAAyB;IACzBC,sBAAsB;IACtBC,kBAAkB;IAClBC,QAAQ,EAAEN,SAAS,CAACM;EACtB,CAAC;AACH;AAEA,eAAeT,YAAY"}
|