@hpcc-js/dgrid2 3.1.0 → 3.1.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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@hpcc-js/dgrid2",
3
- "version": "3.1.0",
3
+ "version": "3.1.1",
4
4
  "description": "hpcc-js - DGrid2",
5
5
  "type": "module",
6
6
  "exports": {
@@ -41,13 +41,8 @@
41
41
  },
42
42
  "devDependencies": {
43
43
  "@hpcc-js/esbuild-plugins": "^1.3.0",
44
- "react": "18.3.1",
45
- "react-data-grid": "7.0.0-beta.47",
46
- "react-dom": "18.3.1"
47
- },
48
- "peerDependencies": {
49
- "react": "^17.0.0 || ^18.0.0",
50
- "react-dom": "^17.0.0 || ^18.0.0"
44
+ "@hpcc-js/preact-shim": "^3.0.0",
45
+ "react-data-grid": "7.0.0-beta.47"
51
46
  },
52
47
  "repository": {
53
48
  "type": "git",
@@ -60,5 +55,5 @@
60
55
  "url": "https://github.com/hpcc-systems/Visualization/issues"
61
56
  },
62
57
  "homepage": "https://github.com/hpcc-systems/Visualization",
63
- "gitHead": "658c50fd965a7744ba8db675ba6878607c44d5e2"
58
+ "gitHead": "b4f63e027feea45ebdfc578ef9c85d107bd97322"
64
59
  }
@@ -1,3 +1,3 @@
1
1
  export const PKG_NAME = "@hpcc-js/dgrid2";
2
- export const PKG_VERSION = "3.1.0";
3
- export const BUILD_VERSION = "3.2.0";
2
+ export const PKG_VERSION = "3.1.1";
3
+ export const BUILD_VERSION = "3.2.1";
package/src/hooks.ts CHANGED
@@ -1,5 +1,5 @@
1
- import React from "react";
2
1
  import { Widget } from "@hpcc-js/common";
2
+ import * as React from "react";
3
3
 
4
4
  export function useData(widget: Widget): [string[], Array<string | number>[]] {
5
5
  // eslint-disable-next-line react-hooks/exhaustive-deps
@@ -9,3 +9,4 @@ export function useData(widget: Widget): [string[], Array<string | number>[]] {
9
9
 
10
10
  return [columns, data];
11
11
  }
12
+
@@ -1,4 +1,4 @@
1
- import React from "react";
1
+ import * as React from "react";
2
2
  import DataGrid, { Column, SelectColumn, SortColumn } from "react-data-grid";
3
3
  import { format, timeFormat, timeParse } from "@hpcc-js/common";
4
4
  import { useData } from "./hooks.ts";
@@ -33,7 +33,7 @@ const EmptyRowsRenderer: React.FunctionComponent<EmptyRowsRendererProps> = ({
33
33
  };
34
34
 
35
35
  interface ColumnEx<TRow, TSummaryRow = unknown> extends Column<TRow, TSummaryRow> {
36
- renderCell?: (props: any) => React.JSX.Element;
36
+ renderCell?: (props: any) => any;
37
37
  __hpcc_pattern?: ReturnType<typeof timeParse>;
38
38
  __hpcc_format?: ReturnType<typeof format> | ReturnType<typeof timeFormat>;
39
39
  }
@@ -145,7 +145,7 @@ export const ReactTable: React.FunctionComponent<ReactTableProps> = ({
145
145
  rows={rows}
146
146
  rowKeyGetter={rowKeyGetter}
147
147
  rowHeight={20}
148
- renderers={{ noRowsFallback: <EmptyRowsRenderer message={table.noDataMessage()} /> }}
148
+ renderers={{ noRowsFallback: <EmptyRowsRenderer message={table.noDataMessage()} /> as any }}
149
149
  className={table.darkMode() ? "rdg-dark" : "rdg-light"}
150
150
  sortColumns={sortColumn ? [sortColumn] : []}
151
151
  onSortColumnsChange={onSortColumnsChange}
package/src/table.ts CHANGED
@@ -1,6 +1,6 @@
1
- import React from "react";
2
- import { createRoot, Root } from "react-dom/client";
1
+ import * as React from "react";
3
2
  import { HTMLWidget } from "@hpcc-js/common";
3
+ import { render, unmountComponentAtNode } from "react-dom";
4
4
  import { ReactTable } from "./reactTable.tsx";
5
5
 
6
6
  import "./table.css";
@@ -10,7 +10,6 @@ export type ColumnType = "boolean" | "number" | "string" | "time";
10
10
  export class Table extends HTMLWidget {
11
11
 
12
12
  protected _div;
13
- protected _root: Root;
14
13
 
15
14
  constructor() {
16
15
  super();
@@ -59,18 +58,17 @@ export class Table extends HTMLWidget {
59
58
  .append("div")
60
59
  .style("display", "grid")
61
60
  ;
62
- this._root = createRoot(this._div.node());
63
61
  }
64
62
 
65
63
  update(domNode, element) {
66
64
  super.update(domNode, element);
67
65
  this._div.style("width", this.width() + "px");
68
66
  this._div.style("height", this.height() + "px");
69
- this._root.render(React.createElement(ReactTable, { table: this }));
67
+ render(React.createElement(ReactTable, { table: this }), this._div.node());
70
68
  }
71
69
 
72
70
  exit(domNode, element) {
73
- this._root.unmount();
71
+ unmountComponentAtNode(this._div.node());
74
72
  this._div.remove();
75
73
  super.exit(domNode, element);
76
74
  }
@@ -1,3 +1,3 @@
1
1
  export declare const PKG_NAME = "@hpcc-js/dgrid2";
2
- export declare const PKG_VERSION = "3.1.0";
3
- export declare const BUILD_VERSION = "3.2.0";
2
+ export declare const PKG_VERSION = "3.1.1";
3
+ export declare const BUILD_VERSION = "3.2.1";
@@ -1,4 +1,4 @@
1
- import React from "react";
1
+ import * as React from "react";
2
2
  import type { Table } from "./table.ts";
3
3
  import "react-data-grid/lib/styles.css";
4
4
  export type QuerySortItem = {
package/types/table.d.ts CHANGED
@@ -1,10 +1,8 @@
1
- import { Root } from "react-dom/client";
2
1
  import { HTMLWidget } from "@hpcc-js/common";
3
2
  import "./table.css";
4
3
  export type ColumnType = "boolean" | "number" | "string" | "time";
5
4
  export declare class Table extends HTMLWidget {
6
5
  protected _div: any;
7
- protected _root: Root;
8
6
  constructor();
9
7
  columnType(column: string): ColumnType;
10
8
  columnType(column: string, type: ColumnType): this;