@deephaven/jsapi-components 0.72.1-beta.5 → 0.73.0
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/spectrum/ListView.d.ts +13 -0
- package/dist/spectrum/ListView.d.ts.map +1 -0
- package/dist/spectrum/ListView.js +54 -0
- package/dist/spectrum/ListView.js.map +1 -0
- package/dist/spectrum/index.d.ts +1 -0
- package/dist/spectrum/index.d.ts.map +1 -1
- package/dist/spectrum/index.js +1 -0
- package/dist/spectrum/index.js.map +1 -1
- package/package.json +9 -9
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import { ListViewProps as ListViewPropsBase } from '@deephaven/components';
|
|
3
|
+
import { dh as DhType } from '@deephaven/jsapi-types';
|
|
4
|
+
import { Settings } from '@deephaven/jsapi-utils';
|
|
5
|
+
export interface ListViewProps extends Omit<ListViewPropsBase, 'children'> {
|
|
6
|
+
table: DhType.Table;
|
|
7
|
+
keyColumn?: string;
|
|
8
|
+
labelColumn?: string;
|
|
9
|
+
settings?: Settings;
|
|
10
|
+
}
|
|
11
|
+
export declare function ListView({ table, keyColumn: keyColumnName, labelColumn: labelColumnName, settings, ...props }: ListViewProps): JSX.Element;
|
|
12
|
+
export default ListView;
|
|
13
|
+
//# sourceMappingURL=ListView.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ListView.d.ts","sourceRoot":"","sources":["../../src/spectrum/ListView.tsx"],"names":[],"mappings":";AAAA,OAAO,EAEL,aAAa,IAAI,iBAAiB,EAGnC,MAAM,uBAAuB,CAAC;AAC/B,OAAO,EAAE,EAAE,IAAI,MAAM,EAAE,MAAM,wBAAwB,CAAC;AACtD,OAAO,EAAE,QAAQ,EAAE,MAAM,wBAAwB,CAAC;AAMlD,MAAM,WAAW,aAAc,SAAQ,IAAI,CAAC,iBAAiB,EAAE,UAAU,CAAC;IACxE,KAAK,EAAE,MAAM,CAAC,KAAK,CAAC;IAEpB,SAAS,CAAC,EAAE,MAAM,CAAC;IAEnB,WAAW,CAAC,EAAE,MAAM,CAAC;IAIrB,QAAQ,CAAC,EAAE,QAAQ,CAAC;CACrB;AAED,wBAAgB,QAAQ,CAAC,EACvB,KAAK,EACL,SAAS,EAAE,aAAa,EACxB,WAAW,EAAE,eAAe,EAC5B,QAAQ,EACR,GAAG,KAAK,EACT,EAAE,aAAa,GAAG,GAAG,CAAC,OAAO,CAgC7B;AAED,eAAe,QAAQ,CAAC"}
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
var _excluded = ["table", "keyColumn", "labelColumn", "settings"];
|
|
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 _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; }
|
|
8
|
+
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; }
|
|
9
|
+
import { ListView as ListViewBase, useSpectrumThemeProvider } from '@deephaven/components';
|
|
10
|
+
import { LIST_VIEW_ROW_HEIGHTS } from '@deephaven/utils';
|
|
11
|
+
import useFormatter from "../useFormatter.js";
|
|
12
|
+
import useViewportData from "../useViewportData.js";
|
|
13
|
+
import { useItemRowDeserializer } from "./utils/index.js";
|
|
14
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
15
|
+
export function ListView(_ref) {
|
|
16
|
+
var _props$density;
|
|
17
|
+
var {
|
|
18
|
+
table,
|
|
19
|
+
keyColumn: keyColumnName,
|
|
20
|
+
labelColumn: labelColumnName,
|
|
21
|
+
settings
|
|
22
|
+
} = _ref,
|
|
23
|
+
props = _objectWithoutProperties(_ref, _excluded);
|
|
24
|
+
var {
|
|
25
|
+
scale
|
|
26
|
+
} = useSpectrumThemeProvider();
|
|
27
|
+
var itemHeight = LIST_VIEW_ROW_HEIGHTS[(_props$density = props.density) !== null && _props$density !== void 0 ? _props$density : 'regular'][scale];
|
|
28
|
+
var {
|
|
29
|
+
getFormattedString: formatValue
|
|
30
|
+
} = useFormatter(settings);
|
|
31
|
+
var deserializeRow = useItemRowDeserializer({
|
|
32
|
+
table,
|
|
33
|
+
keyColumnName,
|
|
34
|
+
labelColumnName,
|
|
35
|
+
formatValue
|
|
36
|
+
});
|
|
37
|
+
var {
|
|
38
|
+
viewportData,
|
|
39
|
+
onScroll
|
|
40
|
+
} = useViewportData({
|
|
41
|
+
reuseItemsOnTableResize: true,
|
|
42
|
+
table,
|
|
43
|
+
itemHeight,
|
|
44
|
+
deserializeRow
|
|
45
|
+
});
|
|
46
|
+
return /*#__PURE__*/_jsx(ListViewBase
|
|
47
|
+
// eslint-disable-next-line react/jsx-props-no-spreading
|
|
48
|
+
, _objectSpread(_objectSpread({}, props), {}, {
|
|
49
|
+
onScroll: onScroll,
|
|
50
|
+
children: viewportData.items
|
|
51
|
+
}));
|
|
52
|
+
}
|
|
53
|
+
export default ListView;
|
|
54
|
+
//# sourceMappingURL=ListView.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ListView.js","names":["ListView","ListViewBase","useSpectrumThemeProvider","LIST_VIEW_ROW_HEIGHTS","useFormatter","useViewportData","useItemRowDeserializer","jsx","_jsx","_ref","_props$density","table","keyColumn","keyColumnName","labelColumn","labelColumnName","settings","props","_objectWithoutProperties","_excluded","scale","itemHeight","density","getFormattedString","formatValue","deserializeRow","viewportData","onScroll","reuseItemsOnTableResize","_objectSpread","children","items"],"sources":["../../src/spectrum/ListView.tsx"],"sourcesContent":["import {\n ListView as ListViewBase,\n ListViewProps as ListViewPropsBase,\n NormalizedItemData,\n useSpectrumThemeProvider,\n} from '@deephaven/components';\nimport { dh as DhType } from '@deephaven/jsapi-types';\nimport { Settings } from '@deephaven/jsapi-utils';\nimport { LIST_VIEW_ROW_HEIGHTS } from '@deephaven/utils';\nimport useFormatter from '../useFormatter';\nimport useViewportData from '../useViewportData';\nimport { useItemRowDeserializer } from './utils';\n\nexport interface ListViewProps extends Omit<ListViewPropsBase, '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 settings?: Settings;\n}\n\nexport function ListView({\n table,\n keyColumn: keyColumnName,\n labelColumn: labelColumnName,\n settings,\n ...props\n}: ListViewProps): JSX.Element {\n const { scale } = useSpectrumThemeProvider();\n const itemHeight = LIST_VIEW_ROW_HEIGHTS[props.density ?? 'regular'][scale];\n\n const { getFormattedString: formatValue } = useFormatter(settings);\n\n const deserializeRow = useItemRowDeserializer({\n table,\n keyColumnName,\n labelColumnName,\n formatValue,\n });\n\n const { viewportData, onScroll } = useViewportData<\n NormalizedItemData,\n DhType.Table\n >({\n reuseItemsOnTableResize: true,\n table,\n itemHeight,\n deserializeRow,\n });\n\n return (\n <ListViewBase\n // eslint-disable-next-line react/jsx-props-no-spreading\n {...props}\n onScroll={onScroll}\n >\n {viewportData.items}\n </ListViewBase>\n );\n}\n\nexport default ListView;\n"],"mappings":";;;;;;;;AAAA,SACEA,QAAQ,IAAIC,YAAY,EAGxBC,wBAAwB,QACnB,uBAAuB;AAG9B,SAASC,qBAAqB,QAAQ,kBAAkB;AAAC,OAClDC,YAAY;AAAA,OACZC,eAAe;AAAA,SACbC,sBAAsB;AAAA,SAAAC,GAAA,IAAAC,IAAA;AAc/B,OAAO,SAASR,QAAQA,CAAAS,IAAA,EAMO;EAAA,IAAAC,cAAA;EAAA,IANN;MACvBC,KAAK;MACLC,SAAS,EAAEC,aAAa;MACxBC,WAAW,EAAEC,eAAe;MAC5BC;IAEa,CAAC,GAAAP,IAAA;IADXQ,KAAK,GAAAC,wBAAA,CAAAT,IAAA,EAAAU,SAAA;EAER,IAAM;IAAEC;EAAM,CAAC,GAAGlB,wBAAwB,CAAC,CAAC;EAC5C,IAAMmB,UAAU,GAAGlB,qBAAqB,EAAAO,cAAA,GAACO,KAAK,CAACK,OAAO,cAAAZ,cAAA,cAAAA,cAAA,GAAI,SAAS,CAAC,CAACU,KAAK,CAAC;EAE3E,IAAM;IAAEG,kBAAkB,EAAEC;EAAY,CAAC,GAAGpB,YAAY,CAACY,QAAQ,CAAC;EAElE,IAAMS,cAAc,GAAGnB,sBAAsB,CAAC;IAC5CK,KAAK;IACLE,aAAa;IACbE,eAAe;IACfS;EACF,CAAC,CAAC;EAEF,IAAM;IAAEE,YAAY;IAAEC;EAAS,CAAC,GAAGtB,eAAe,CAGhD;IACAuB,uBAAuB,EAAE,IAAI;IAC7BjB,KAAK;IACLU,UAAU;IACVI;EACF,CAAC,CAAC;EAEF,oBACEjB,IAAA,CAACP;EACC;EAAA,EAAA4B,aAAA,CAAAA,aAAA,KACIZ,KAAK;IACTU,QAAQ,EAAEA,QAAS;IAAAG,QAAA,EAElBJ,YAAY,CAACK;EAAK,EACP,CAAC;AAEnB;AAEA,eAAe/B,QAAQ"}
|
package/dist/spectrum/index.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/spectrum/index.ts"],"names":[],"mappings":"AAAA,cAAc,UAAU,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/spectrum/index.ts"],"names":[],"mappings":"AAAA,cAAc,YAAY,CAAC;AAC3B,cAAc,UAAU,CAAC"}
|
package/dist/spectrum/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","names":[],"sources":["../../src/spectrum/index.ts"],"sourcesContent":["export * from './Picker';\n"],"mappings":""}
|
|
1
|
+
{"version":3,"file":"index.js","names":[],"sources":["../../src/spectrum/index.ts"],"sourcesContent":["export * from './ListView';\nexport * from './Picker';\n"],"mappings":""}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@deephaven/jsapi-components",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.73.0",
|
|
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.
|
|
26
|
-
"@deephaven/jsapi-bootstrap": "^0.
|
|
25
|
+
"@deephaven/components": "^0.73.0",
|
|
26
|
+
"@deephaven/jsapi-bootstrap": "^0.73.0",
|
|
27
27
|
"@deephaven/jsapi-types": "1.0.0-dev0.33.1",
|
|
28
|
-
"@deephaven/jsapi-utils": "^0.
|
|
29
|
-
"@deephaven/log": "^0.
|
|
30
|
-
"@deephaven/react-hooks": "^0.
|
|
31
|
-
"@deephaven/utils": "^0.
|
|
28
|
+
"@deephaven/jsapi-utils": "^0.73.0",
|
|
29
|
+
"@deephaven/log": "^0.73.0",
|
|
30
|
+
"@deephaven/react-hooks": "^0.73.0",
|
|
31
|
+
"@deephaven/utils": "^0.73.0",
|
|
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.
|
|
39
|
+
"@deephaven/jsapi-shim": "^0.73.0",
|
|
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": "9e9e272cee02bc7b2c7cda19a00bf55385a0cffb"
|
|
55
55
|
}
|