@deephaven/iris-grid 0.99.2-beta.0 → 0.99.2-beta.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.
@@ -1,12 +1,12 @@
1
- import { type EventHandlerResult, type Grid, GridMouseHandler, type GridPoint } from '@deephaven/grid';
1
+ import { type EventHandlerResult, type Grid, type GridPoint, GridTokenMouseHandler } from '@deephaven/grid';
2
2
  import type IrisGrid from '../IrisGrid';
3
- declare class IrisGridTokenMouseHandler extends GridMouseHandler {
3
+ declare class IrisGridTokenMouseHandler extends GridTokenMouseHandler {
4
4
  private irisGrid;
5
- private currentLinkBox?;
5
+ private lastColumn;
6
+ private lastRow;
6
7
  constructor(irisGrid: IrisGrid);
7
8
  private destroyTooltip;
8
- isHoveringLink(gridPoint: GridPoint, grid: Grid): boolean;
9
- private setCursor;
9
+ protected setCursor(gridPoint: GridPoint, grid: Grid): EventHandlerResult;
10
10
  onMove(gridPoint: GridPoint, grid: Grid): EventHandlerResult;
11
11
  onDown(): EventHandlerResult;
12
12
  onContextMenu(): EventHandlerResult;
@@ -1 +1 @@
1
- {"version":3,"file":"IrisGridTokenMouseHandler.d.ts","sourceRoot":"","sources":["../../src/mousehandlers/IrisGridTokenMouseHandler.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,KAAK,kBAAkB,EAEvB,KAAK,IAAI,EACT,gBAAgB,EAChB,KAAK,SAAS,EAKf,MAAM,iBAAiB,CAAC;AAEzB,OAAO,KAAK,QAAQ,MAAM,aAAa,CAAC;AAExC,cAAM,yBAA0B,SAAQ,gBAAgB;IACtD,OAAO,CAAC,QAAQ,CAAW;IAG3B,OAAO,CAAC,cAAc,CAAC,CAAW;gBAEtB,QAAQ,EAAE,QAAQ;IAM9B,OAAO,CAAC,cAAc;IAItB,cAAc,CAAC,SAAS,EAAE,SAAS,EAAE,IAAI,EAAE,IAAI,GAAG,OAAO;IAsDzD,OAAO,CAAC,SAAS;IASjB,MAAM,CAAC,SAAS,EAAE,SAAS,EAAE,IAAI,EAAE,IAAI,GAAG,kBAAkB;IA6B5D,MAAM,IAAI,kBAAkB;IAK5B,aAAa,IAAI,kBAAkB;IAKnC,OAAO,IAAI,kBAAkB;IAK7B,OAAO,IAAI,kBAAkB;CAI9B;AAED,eAAe,yBAAyB,CAAC"}
1
+ {"version":3,"file":"IrisGridTokenMouseHandler.d.ts","sourceRoot":"","sources":["../../src/mousehandlers/IrisGridTokenMouseHandler.tsx"],"names":[],"mappings":"AAAA,OAAO,EACL,KAAK,kBAAkB,EACvB,KAAK,IAAI,EACT,KAAK,SAAS,EAEd,qBAAqB,EAEtB,MAAM,iBAAiB,CAAC;AAEzB,OAAO,KAAK,QAAQ,MAAM,aAAa,CAAC;AAGxC,cAAM,yBAA0B,SAAQ,qBAAqB;IAC3D,OAAO,CAAC,QAAQ,CAAW;IAE3B,OAAO,CAAC,UAAU,CAAiB;IAEnC,OAAO,CAAC,OAAO,CAAiB;gBAEpB,QAAQ,EAAE,QAAQ;IAQ9B,OAAO,CAAC,cAAc;IAItB,SAAS,CAAC,SAAS,CAAC,SAAS,EAAE,SAAS,EAAE,IAAI,EAAE,IAAI,GAAG,kBAAkB;IASzE,MAAM,CAAC,SAAS,EAAE,SAAS,EAAE,IAAI,EAAE,IAAI,GAAG,kBAAkB;IAqE5D,MAAM,IAAI,kBAAkB;IAK5B,aAAa,IAAI,kBAAkB;IAKnC,OAAO,IAAI,kBAAkB;IAK7B,OAAO,IAAI,kBAAkB;CAI9B;AAED,eAAe,yBAAyB,CAAC"}
@@ -1,87 +1,27 @@
1
1
  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; }
2
2
  function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return typeof key === "symbol" ? key : String(key); }
3
3
  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); }
4
- import { getOrThrow, GridMouseHandler, GridUtils, isLinkToken, isTokenBoxCellRenderer } from '@deephaven/grid';
4
+ import { isLinkToken, GridTokenMouseHandler } from '@deephaven/grid';
5
5
  import deepEqual from 'fast-deep-equal';
6
- class IrisGridTokenMouseHandler extends GridMouseHandler {
7
- // Stores the current hovered token box if it exists with translated coordinates
8
-
6
+ import { jsx as _jsx } from "react/jsx-runtime";
7
+ import { Fragment as _Fragment } from "react/jsx-runtime";
8
+ import { jsxs as _jsxs } from "react/jsx-runtime";
9
+ // Handler also helps with other tooltips
10
+ class IrisGridTokenMouseHandler extends GridTokenMouseHandler {
9
11
  constructor(irisGrid) {
10
12
  super();
11
13
  _defineProperty(this, "irisGrid", void 0);
12
- _defineProperty(this, "currentLinkBox", void 0);
14
+ _defineProperty(this, "lastColumn", void 0);
15
+ _defineProperty(this, "lastRow", void 0);
13
16
  this.irisGrid = irisGrid;
17
+ this.lastColumn = null;
18
+ this.lastRow = null;
14
19
  }
15
20
  destroyTooltip() {
16
21
  this.irisGrid.setState({
17
- linkHoverTooltipProps: null
22
+ hoverTooltipProps: null
18
23
  });
19
24
  }
20
- isHoveringLink(gridPoint, grid) {
21
- var {
22
- column,
23
- row,
24
- x,
25
- y
26
- } = gridPoint;
27
- var {
28
- renderer,
29
- metrics,
30
- props
31
- } = grid;
32
- var {
33
- model
34
- } = props;
35
- if (column == null || row == null || metrics == null) {
36
- this.currentLinkBox = undefined;
37
- return false;
38
- }
39
- var {
40
- modelRows,
41
- modelColumns
42
- } = metrics;
43
- var modelRow = getOrThrow(modelRows, row);
44
- var modelColumn = getOrThrow(modelColumns, column);
45
- var renderType = model.renderTypeForCell(modelColumn, modelRow);
46
- var cellRenderer = renderer.getCellRenderer(renderType);
47
- if (!isTokenBoxCellRenderer(cellRenderer)) {
48
- return false;
49
- }
50
- if (this.currentLinkBox != null) {
51
- var {
52
- x1: left,
53
- y1: top,
54
- x2: right,
55
- y2: bottom
56
- } = this.currentLinkBox;
57
- if (x >= left && x <= right && y >= top && y <= bottom) {
58
- return true;
59
- }
60
- }
61
- var renderState = grid.updateRenderState();
62
- var tokensInCell = cellRenderer.getTokenBoxesForVisibleCell(column, row, renderState);
63
-
64
- // Loop through each link and check if cursor is in bounds
65
- for (var i = 0; i < tokensInCell.length; i += 1) {
66
- if (isLinkToken(tokensInCell[i].token)) {
67
- var translatedTokenBox = GridUtils.translateTokenBox(tokensInCell[i], metrics);
68
- var {
69
- x1: _left,
70
- x2: _right,
71
- y1: _top,
72
- y2: _bottom
73
- } = translatedTokenBox;
74
- if (x >= _left && x <= _right && y >= _top && y <= _bottom) {
75
- this.currentLinkBox = translatedTokenBox;
76
- return true;
77
- }
78
- }
79
- }
80
-
81
- // If this point is reached, that means the cursor was not hovering any of the links or there are no links
82
- this.currentLinkBox = undefined;
83
- return false;
84
- }
85
25
  setCursor(gridPoint, grid) {
86
26
  if (this.isHoveringLink(gridPoint, grid)) {
87
27
  this.cursor = 'pointer';
@@ -94,14 +34,15 @@ class IrisGridTokenMouseHandler extends GridMouseHandler {
94
34
  return false;
95
35
  }
96
36
  onMove(gridPoint, grid) {
37
+ var {
38
+ model
39
+ } = this.irisGrid.props;
97
40
  var isUserHoveringLink = this.isHoveringLink(gridPoint, grid);
41
+ var tooltip = model.tooltipForCell(gridPoint.column, gridPoint.row);
98
42
  if (isUserHoveringLink && this.currentLinkBox != null && isLinkToken(this.currentLinkBox.token)) {
99
43
  var {
100
- linkHoverTooltipProps
44
+ hoverTooltipProps
101
45
  } = this.irisGrid.state;
102
- if (this.currentLinkBox == null) {
103
- return false;
104
- }
105
46
  var {
106
47
  x1: left,
107
48
  y1: top,
@@ -119,15 +60,44 @@ class IrisGridTokenMouseHandler extends GridMouseHandler {
119
60
  width,
120
61
  height
121
62
  };
122
- if (!deepEqual(linkHoverTooltipProps, newProps)) {
63
+ if (!deepEqual(hoverTooltipProps, newProps)) {
123
64
  this.irisGrid.setState({
124
- linkHoverTooltipProps: newProps,
125
- linkHoverDisplayValue: href
65
+ hoverTooltipProps: newProps,
66
+ hoverDisplayValue: /*#__PURE__*/_jsxs(_Fragment, {
67
+ children: [href, " - Click once to follow.", /*#__PURE__*/_jsx("br", {}), "Click and hold to select this cell."]
68
+ })
126
69
  });
127
70
  }
71
+ } else if (tooltip !== null) {
72
+ var {
73
+ hoverTooltipProps: _hoverTooltipProps
74
+ } = this.irisGrid.state;
75
+ var _newProps = {
76
+ left: gridPoint.x,
77
+ top: gridPoint.y + 1,
78
+ width: 1,
79
+ height: 1
80
+ };
81
+ if (!deepEqual(_hoverTooltipProps, _newProps)) {
82
+ if (_hoverTooltipProps == null) {
83
+ this.irisGrid.setState({
84
+ hoverTooltipProps: _newProps,
85
+ hoverDisplayValue: tooltip
86
+ });
87
+ } else if (this.lastColumn !== gridPoint.column || this.lastRow !== gridPoint.row) {
88
+ this.irisGrid.setState({
89
+ hoverTooltipProps: null
90
+ }, () => this.irisGrid.setState({
91
+ hoverTooltipProps: _newProps,
92
+ hoverDisplayValue: tooltip
93
+ }));
94
+ }
95
+ }
128
96
  } else {
129
97
  this.destroyTooltip();
130
98
  }
99
+ this.lastColumn = gridPoint.column;
100
+ this.lastRow = gridPoint.row;
131
101
  return this.setCursor(gridPoint, grid);
132
102
  }
133
103
  onDown() {
@@ -1 +1 @@
1
- {"version":3,"file":"IrisGridTokenMouseHandler.js","names":["getOrThrow","GridMouseHandler","GridUtils","isLinkToken","isTokenBoxCellRenderer","deepEqual","IrisGridTokenMouseHandler","constructor","irisGrid","_defineProperty","destroyTooltip","setState","linkHoverTooltipProps","isHoveringLink","gridPoint","grid","column","row","x","y","renderer","metrics","props","model","currentLinkBox","undefined","modelRows","modelColumns","modelRow","modelColumn","renderType","renderTypeForCell","cellRenderer","getCellRenderer","x1","left","y1","top","x2","right","y2","bottom","renderState","updateRenderState","tokensInCell","getTokenBoxesForVisibleCell","i","length","token","translatedTokenBox","translateTokenBox","setCursor","cursor","stopPropagation","preventDefault","onMove","isUserHoveringLink","state","href","width","height","newProps","linkHoverDisplayValue","onDown","onContextMenu","onWheel","onLeave"],"sources":["../../src/mousehandlers/IrisGridTokenMouseHandler.ts"],"sourcesContent":["import {\n type EventHandlerResult,\n getOrThrow,\n type Grid,\n GridMouseHandler,\n type GridPoint,\n GridUtils,\n isLinkToken,\n type TokenBox,\n isTokenBoxCellRenderer,\n} from '@deephaven/grid';\nimport deepEqual from 'fast-deep-equal';\nimport type IrisGrid from '../IrisGrid';\n\nclass IrisGridTokenMouseHandler extends GridMouseHandler {\n private irisGrid: IrisGrid;\n\n // Stores the current hovered token box if it exists with translated coordinates\n private currentLinkBox?: TokenBox;\n\n constructor(irisGrid: IrisGrid) {\n super();\n\n this.irisGrid = irisGrid;\n }\n\n private destroyTooltip(): void {\n this.irisGrid.setState({ linkHoverTooltipProps: null });\n }\n\n isHoveringLink(gridPoint: GridPoint, grid: Grid): boolean {\n const { column, row, x, y } = gridPoint;\n const { renderer, metrics, props } = grid;\n const { model } = props;\n\n if (column == null || row == null || metrics == null) {\n this.currentLinkBox = undefined;\n return false;\n }\n\n const { modelRows, modelColumns } = metrics;\n const modelRow = getOrThrow(modelRows, row);\n const modelColumn = getOrThrow(modelColumns, column);\n\n const renderType = model.renderTypeForCell(modelColumn, modelRow);\n const cellRenderer = renderer.getCellRenderer(renderType);\n if (!isTokenBoxCellRenderer(cellRenderer)) {\n return false;\n }\n\n if (this.currentLinkBox != null) {\n const { x1: left, y1: top, x2: right, y2: bottom } = this.currentLinkBox;\n if (x >= left && x <= right && y >= top && y <= bottom) {\n return true;\n }\n }\n\n const renderState = grid.updateRenderState();\n const tokensInCell = cellRenderer.getTokenBoxesForVisibleCell(\n column,\n row,\n renderState\n );\n\n // Loop through each link and check if cursor is in bounds\n for (let i = 0; i < tokensInCell.length; i += 1) {\n if (isLinkToken(tokensInCell[i].token)) {\n const translatedTokenBox = GridUtils.translateTokenBox(\n tokensInCell[i],\n metrics\n );\n const { x1: left, x2: right, y1: top, y2: bottom } = translatedTokenBox;\n if (x >= left && x <= right && y >= top && y <= bottom) {\n this.currentLinkBox = translatedTokenBox;\n return true;\n }\n }\n }\n\n // If this point is reached, that means the cursor was not hovering any of the links or there are no links\n this.currentLinkBox = undefined;\n return false;\n }\n\n private setCursor(gridPoint: GridPoint, grid: Grid): EventHandlerResult {\n if (this.isHoveringLink(gridPoint, grid)) {\n this.cursor = 'pointer';\n return { stopPropagation: false, preventDefault: false };\n }\n this.cursor = null;\n return false;\n }\n\n onMove(gridPoint: GridPoint, grid: Grid): EventHandlerResult {\n const isUserHoveringLink = this.isHoveringLink(gridPoint, grid);\n if (\n isUserHoveringLink &&\n this.currentLinkBox != null &&\n isLinkToken(this.currentLinkBox.token)\n ) {\n const { linkHoverTooltipProps } = this.irisGrid.state;\n if (this.currentLinkBox == null) {\n return false;\n }\n const { x1: left, y1: top, x2: right, y2: bottom } = this.currentLinkBox;\n const { href } = this.currentLinkBox.token;\n const width = right - left;\n const height = bottom - top;\n const newProps = { left, top: top + 1, width, height };\n if (!deepEqual(linkHoverTooltipProps, newProps)) {\n this.irisGrid.setState({\n linkHoverTooltipProps: newProps,\n linkHoverDisplayValue: href,\n });\n }\n } else {\n this.destroyTooltip();\n }\n\n return this.setCursor(gridPoint, grid);\n }\n\n onDown(): EventHandlerResult {\n this.destroyTooltip();\n return false;\n }\n\n onContextMenu(): EventHandlerResult {\n this.destroyTooltip();\n return false;\n }\n\n onWheel(): EventHandlerResult {\n this.destroyTooltip();\n return false;\n }\n\n onLeave(): EventHandlerResult {\n this.destroyTooltip();\n return false;\n }\n}\n\nexport default IrisGridTokenMouseHandler;\n"],"mappings":";;;AAAA,SAEEA,UAAU,EAEVC,gBAAgB,EAEhBC,SAAS,EACTC,WAAW,EAEXC,sBAAsB,QACjB,iBAAiB;AACxB,OAAOC,SAAS,MAAM,iBAAiB;AAGvC,MAA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EA,OAAO,IAAI,CAACyC,SAAS,CAACrC,SAAS,EAAEC,IAAI,CAAC;EACxC;EAEAgD,MAAMA,CAAA,EAAuB;IAC3B,IAAI,CAACrD,cAAc,CAAC,CAAC;IACrB,OAAO,KAAK;EACd;EAEAsD,aAAaA,CAAA,EAAuB;IAClC,IAAI,CAACtD,cAAc,CAAC,CAAC;IACrB,OAAO,KAAK;EACd;EAEAuD,OAAOA,CAAA,EAAuB;IAC5B,IAAI,CAACvD,cAAc,CAAC,CAAC;IACrB,OAAO,KAAK;EACd;EAEAwD,OAAOA,CAAA,EAAuB;IAC5B,IAAI,CAACxD,cAAc,CAAC,CAAC;IACrB,OAAO,KAAK;EACd;AACF;AAEA,eAAeJ,yBAAyB"}
1
+ {"version":3,"file":"IrisGridTokenMouseHandler.js","names":["isLinkToken","GridTokenMouseHandler","deepEqual","jsx","_jsx","Fragment","_Fragment","jsxs","_jsxs","IrisGridTokenMouseHandler","constructor","irisGrid","_defineProperty","lastColumn","lastRow","destroyTooltip","setState","hoverTooltipProps","setCursor","gridPoint","grid","isHoveringLink","cursor","stopPropagation","preventDefault","onMove","model","props","isUserHoveringLink","tooltip","tooltipForCell","column","row","currentLinkBox","token","state","x1","left","y1","top","x2","right","y2","bottom","href","width","height","newProps","hoverDisplayValue","children","x","y","onDown","onContextMenu","onWheel","onLeave"],"sources":["../../src/mousehandlers/IrisGridTokenMouseHandler.tsx"],"sourcesContent":["import {\n type EventHandlerResult,\n type Grid,\n type GridPoint,\n isLinkToken,\n GridTokenMouseHandler,\n type GridRangeIndex,\n} from '@deephaven/grid';\nimport deepEqual from 'fast-deep-equal';\nimport type IrisGrid from '../IrisGrid';\n\n// Handler also helps with other tooltips\nclass IrisGridTokenMouseHandler extends GridTokenMouseHandler {\n private irisGrid: IrisGrid;\n\n private lastColumn: GridRangeIndex;\n\n private lastRow: GridRangeIndex;\n\n constructor(irisGrid: IrisGrid) {\n super();\n\n this.irisGrid = irisGrid;\n this.lastColumn = null;\n this.lastRow = null;\n }\n\n private destroyTooltip(): void {\n this.irisGrid.setState({ hoverTooltipProps: null });\n }\n\n protected setCursor(gridPoint: GridPoint, grid: Grid): EventHandlerResult {\n if (this.isHoveringLink(gridPoint, grid)) {\n this.cursor = 'pointer';\n return { stopPropagation: false, preventDefault: false };\n }\n this.cursor = null;\n return false;\n }\n\n onMove(gridPoint: GridPoint, grid: Grid): EventHandlerResult {\n const { model } = this.irisGrid.props;\n const isUserHoveringLink = this.isHoveringLink(gridPoint, grid);\n const tooltip = model.tooltipForCell(gridPoint.column, gridPoint.row);\n\n if (\n isUserHoveringLink &&\n this.currentLinkBox != null &&\n isLinkToken(this.currentLinkBox.token)\n ) {\n const { hoverTooltipProps } = this.irisGrid.state;\n const { x1: left, y1: top, x2: right, y2: bottom } = this.currentLinkBox;\n const { href } = this.currentLinkBox.token;\n const width = right - left;\n const height = bottom - top;\n const newProps = { left, top: top + 1, width, height };\n\n if (!deepEqual(hoverTooltipProps, newProps)) {\n this.irisGrid.setState({\n hoverTooltipProps: newProps,\n hoverDisplayValue: (\n <>\n {href} - Click once to follow.\n <br />\n Click and hold to select this cell.\n </>\n ),\n });\n }\n } else if (tooltip !== null) {\n const { hoverTooltipProps } = this.irisGrid.state;\n const newProps = {\n left: gridPoint.x,\n top: gridPoint.y + 1,\n width: 1,\n height: 1,\n };\n if (!deepEqual(hoverTooltipProps, newProps)) {\n if (hoverTooltipProps == null) {\n this.irisGrid.setState({\n hoverTooltipProps: newProps,\n hoverDisplayValue: tooltip,\n });\n } else if (\n this.lastColumn !== gridPoint.column ||\n this.lastRow !== gridPoint.row\n ) {\n this.irisGrid.setState(\n {\n hoverTooltipProps: null,\n },\n () =>\n this.irisGrid.setState({\n hoverTooltipProps: newProps,\n hoverDisplayValue: tooltip,\n })\n );\n }\n }\n } else {\n this.destroyTooltip();\n }\n\n this.lastColumn = gridPoint.column;\n this.lastRow = gridPoint.row;\n\n return this.setCursor(gridPoint, grid);\n }\n\n onDown(): EventHandlerResult {\n this.destroyTooltip();\n return false;\n }\n\n onContextMenu(): EventHandlerResult {\n this.destroyTooltip();\n return false;\n }\n\n onWheel(): EventHandlerResult {\n this.destroyTooltip();\n return false;\n }\n\n onLeave(): EventHandlerResult {\n this.destroyTooltip();\n return false;\n }\n}\n\nexport default IrisGridTokenMouseHandler;\n"],"mappings":";;;AAAA,SAIEA,WAAW,EACXC,qBAAqB,QAEhB,iBAAiB;AACxB,OAAOC,SAAS,MAAM,iBAAiB;AAAC,SAAAC,GAAA,IAAAC,IAAA;AAAA,SAAAC,QAAA,IAAAC,SAAA;AAAA,SAAAC,IAAA,IAAAC,KAAA;AAGxC;AACA,MAAMC,yBAAyB,SAASR,qBAAqB,CAAC;EAO5DS,WAAWA,CAACC,QAAkB,EAAE;IAC9B,KAAK,CAAC,CAAC;IAACC,eAAA;IAAAA,eAAA;IAAAA,eAAA;IAER,IAAI,CAACD,QAAQ,GAAGA,QAAQ;IACxB,IAAI,CAACE,UAAU,GAAG,IAAI;IACtB,IAAI,CAACC,OAAO,GAAG,IAAI;EACrB;EAEQC,cAAcA,CAAA,EAAS;IAC7B,IAAI,CAACJ,QAAQ,CAACK,QAAQ,CAAC;MAAEC,iBAAiB,EAAE;IAAK,CAAC,CAAC;EACrD;EAEUC,SAASA,CAACC,SAAoB,EAAEC,IAAU,EAAsB;IACxE,IAAI,IAAI,CAACC,cAAc,CAACF,SAAS,EAAEC,IAAI,CAAC,EAAE;MACxC,IAAI,CAACE,MAAM,GAAG,SAAS;MACvB,OAAO;QAAEC,eAAe,EAAE,KAAK;QAAEC,cAAc,EAAE;MAAM,CAAC;IAC1D;IACA,IAAI,CAACF,MAAM,GAAG,IAAI;IAClB,OAAO,KAAK;EACd;EAEAG,MAAMA,CAACN,SAAoB,EAAEC,IAAU,EAAsB;IAC3D,IAAM;MAAEM;IAAM,CAAC,GAAG,IAAI,CAACf,QAAQ,CAACgB,KAAK;IACrC,IAAMC,kBAAkB,GAAG,IAAI,CAACP,cAAc,CAACF,SAAS,E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,cAAc,CAAC,CAAC;IACrB,OAAO,KAAK;EACd;AACF;AAEA,eAAeN,yBAAyB"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@deephaven/iris-grid",
3
- "version": "0.99.2-beta.0+36d910da",
3
+ "version": "0.99.2-beta.1+d884bffe",
4
4
  "description": "Deephaven Iris Grid",
5
5
  "author": "Deephaven Data Labs LLC",
6
6
  "license": "Apache-2.0",
@@ -31,18 +31,18 @@
31
31
  "build:sass": "sass --embed-sources --load-path=../../node_modules ./src:./dist"
32
32
  },
33
33
  "dependencies": {
34
- "@deephaven/components": "^0.99.2-beta.0+36d910da",
35
- "@deephaven/console": "^0.99.2-beta.0+36d910da",
36
- "@deephaven/filters": "^0.99.2-beta.0+36d910da",
37
- "@deephaven/grid": "^0.99.2-beta.0+36d910da",
38
- "@deephaven/icons": "^0.99.2-beta.0+36d910da",
39
- "@deephaven/jsapi-components": "^0.99.2-beta.0+36d910da",
34
+ "@deephaven/components": "^0.99.2-beta.1+d884bffe",
35
+ "@deephaven/console": "^0.99.2-beta.1+d884bffe",
36
+ "@deephaven/filters": "^0.99.2-beta.1+d884bffe",
37
+ "@deephaven/grid": "^0.99.2-beta.1+d884bffe",
38
+ "@deephaven/icons": "^0.99.2-beta.1+d884bffe",
39
+ "@deephaven/jsapi-components": "^0.99.2-beta.1+d884bffe",
40
40
  "@deephaven/jsapi-types": "^1.0.0-dev0.34.0",
41
- "@deephaven/jsapi-utils": "^0.99.2-beta.0+36d910da",
42
- "@deephaven/log": "^0.99.2-beta.0+36d910da",
43
- "@deephaven/react-hooks": "^0.99.2-beta.0+36d910da",
44
- "@deephaven/storage": "^0.99.2-beta.0+36d910da",
45
- "@deephaven/utils": "^0.99.2-beta.0+36d910da",
41
+ "@deephaven/jsapi-utils": "^0.99.2-beta.1+d884bffe",
42
+ "@deephaven/log": "^0.99.2-beta.1+d884bffe",
43
+ "@deephaven/react-hooks": "^0.99.2-beta.1+d884bffe",
44
+ "@deephaven/storage": "^0.99.2-beta.1+d884bffe",
45
+ "@deephaven/utils": "^0.99.2-beta.1+d884bffe",
46
46
  "@dnd-kit/core": "^6.1.0",
47
47
  "@dnd-kit/sortable": "^7.0.2",
48
48
  "@dnd-kit/utilities": "^3.2.2",
@@ -65,9 +65,9 @@
65
65
  "react-dom": ">=16.8.0"
66
66
  },
67
67
  "devDependencies": {
68
- "@deephaven/jsapi-shim": "^0.99.2-beta.0+36d910da",
69
- "@deephaven/mocks": "^0.99.2-beta.0+36d910da",
70
- "@deephaven/test-utils": "^0.99.2-beta.0+36d910da",
68
+ "@deephaven/jsapi-shim": "^0.99.2-beta.1+d884bffe",
69
+ "@deephaven/mocks": "^0.99.2-beta.1+d884bffe",
70
+ "@deephaven/test-utils": "^0.99.2-beta.1+d884bffe",
71
71
  "deep-equal": "2.2.3"
72
72
  },
73
73
  "files": [
@@ -80,5 +80,5 @@
80
80
  "publishConfig": {
81
81
  "access": "public"
82
82
  },
83
- "gitHead": "36d910da75a0c628b9e45baf12282fb55e51e7e0"
83
+ "gitHead": "d884bffe5942af0baa0224a688661e5ea8917ea5"
84
84
  }