@sci-grid/react 1.0.8 → 1.1.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/index.cjs CHANGED
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const a=require("react/jsx-runtime"),e=require("react"),y=require("@sci-grid/core"),j=({provider:t,config:c={},className:R,style:n,onSort:u,onSelectionChange:i,onContextMenu:s,onHeaderContextMenu:f})=>{const d=e.useRef(null),r=e.useRef(null);return e.useEffect(()=>(d.current&&(r.current=new y.SciGrid(d.current,t,{...c,onSort:u,onSelectionChange:i,onContextMenu:s,onHeaderContextMenu:f})),()=>{var l;(l=r.current)==null||l.destroy(),r.current=null}),[]),e.useEffect(()=>{r.current&&r.current.updateProvider(t)},[t]),e.useEffect(()=>{r.current&&r.current.updateConfig({...c,onSort:u,onSelectionChange:i,onContextMenu:s,onHeaderContextMenu:f})},[c,u,i,s,f]),a.jsx("div",{ref:d,className:R,style:{width:"100%",height:"100%",...n}})};exports.SciGridReact=j;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const q=require("react/jsx-runtime"),c=require("react"),E=require("@sci-grid/core"),G=({provider:u,config:i={},className:y,style:j,onSort:e,onSelectionChange:s,onContextMenu:f,onHeaderContextMenu:t,onRowNumberContextMenu:d,getContextMenuItems:l})=>{const R=c.useRef(null),r=c.useRef(null);return c.useEffect(()=>(R.current&&(r.current=new E.SciGrid(R.current,u,{...i,onSort:e,onSelectionChange:s,onContextMenu:f,onHeaderContextMenu:t,onRowNumberContextMenu:d,getContextMenuItems:l})),()=>{var a;(a=r.current)==null||a.destroy(),r.current=null}),[]),c.useEffect(()=>{r.current&&r.current.updateProvider(u)},[u]),c.useEffect(()=>{r.current&&r.current.updateConfig({...i,onSort:e,onSelectionChange:s,onContextMenu:f,onHeaderContextMenu:t,onRowNumberContextMenu:d,getContextMenuItems:l})},[i,e,s,f,t,d,l]),q.jsx("div",{ref:R,className:y,style:{width:"100%",height:"100%",...j}})};exports.SciGridReact=G;
package/dist/index.js CHANGED
@@ -1,45 +1,51 @@
1
- import { jsx as w } from "react/jsx-runtime";
2
- import { useRef as l, useEffect as m } from "react";
3
- import { SciGrid as y } from "@sci-grid/core";
4
- const E = ({
5
- provider: t,
6
- config: u = {},
7
- className: p,
8
- style: R,
9
- onSort: c,
10
- onSelectionChange: f,
11
- onContextMenu: i,
12
- onHeaderContextMenu: e
1
+ import { jsx as j } from "react/jsx-runtime";
2
+ import { useRef as G, useEffect as m } from "react";
3
+ import { SciGrid as E } from "@sci-grid/core";
4
+ const q = ({
5
+ provider: c,
6
+ config: f = {},
7
+ className: R,
8
+ style: h,
9
+ onSort: i,
10
+ onSelectionChange: u,
11
+ onContextMenu: s,
12
+ onHeaderContextMenu: d,
13
+ onRowNumberContextMenu: l,
14
+ getContextMenuItems: p
13
15
  }) => {
14
- const s = l(null), r = l(null);
15
- return m(() => (s.current && (r.current = new y(s.current, t, {
16
- ...u,
17
- onSort: c,
18
- onSelectionChange: f,
19
- onContextMenu: i,
20
- onHeaderContextMenu: e
16
+ const t = G(null), r = G(null);
17
+ return m(() => (t.current && (r.current = new E(t.current, c, {
18
+ ...f,
19
+ onSort: i,
20
+ onSelectionChange: u,
21
+ onContextMenu: s,
22
+ onHeaderContextMenu: d,
23
+ onRowNumberContextMenu: l,
24
+ getContextMenuItems: p
21
25
  })), () => {
22
- var d;
23
- (d = r.current) == null || d.destroy(), r.current = null;
26
+ var y;
27
+ (y = r.current) == null || y.destroy(), r.current = null;
24
28
  }), []), m(() => {
25
- r.current && r.current.updateProvider(t);
26
- }, [t]), m(() => {
29
+ r.current && r.current.updateProvider(c);
30
+ }, [c]), m(() => {
27
31
  r.current && r.current.updateConfig({
28
- ...u,
29
- onSort: c,
30
- onSelectionChange: f,
31
- onContextMenu: i,
32
- onHeaderContextMenu: e
32
+ ...f,
33
+ onSort: i,
34
+ onSelectionChange: u,
35
+ onContextMenu: s,
36
+ onHeaderContextMenu: d,
37
+ onRowNumberContextMenu: l,
38
+ getContextMenuItems: p
33
39
  });
34
- }, [u, c, f, i, e]), /* @__PURE__ */ w(
40
+ }, [f, i, u, s, d, l, p]), /* @__PURE__ */ j(
35
41
  "div",
36
42
  {
37
- ref: s,
38
- className: p,
39
- style: { width: "100%", height: "100%", ...R }
43
+ ref: t,
44
+ className: R,
45
+ style: { width: "100%", height: "100%", ...h }
40
46
  }
41
47
  );
42
48
  };
43
49
  export {
44
- E as SciGridReact
50
+ q as SciGridReact
45
51
  };
@@ -9,10 +9,12 @@ interface SciGridReactProps {
9
9
  onSelectionChange?: (info: any) => void;
10
10
  onContextMenu?: (row: number, col: number, e: MouseEvent) => void;
11
11
  onHeaderContextMenu?: (col: number, e: MouseEvent) => void;
12
+ onRowNumberContextMenu?: (row: number, e: MouseEvent) => void;
13
+ getContextMenuItems?: GridConfig['getContextMenuItems'];
12
14
  }
13
15
  /**
14
16
  * SciGrid React Adapter
15
17
  * High-performance data grid component for React applications.
16
18
  */
17
- export declare const SciGridReact: ({ provider, config, className, style, onSort, onSelectionChange, onContextMenu, onHeaderContextMenu }: SciGridReactProps) => import("react/jsx-runtime").JSX.Element;
19
+ export declare const SciGridReact: ({ provider, config, className, style, onSort, onSelectionChange, onContextMenu, onHeaderContextMenu, onRowNumberContextMenu, getContextMenuItems }: SciGridReactProps) => import("react/jsx-runtime").JSX.Element;
18
20
  export {};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sci-grid/react",
3
- "version": "1.0.8",
3
+ "version": "1.1.0",
4
4
  "type": "module",
5
5
  "main": "./dist/index.js",
6
6
  "module": "./dist/index.js",
@@ -19,7 +19,7 @@
19
19
  "peerDependencies": {
20
20
  "react": ">=18.0.0",
21
21
  "react-dom": ">=18.0.0",
22
- "@sci-grid/core": "1.0.8"
22
+ "@sci-grid/core": "1.1.0"
23
23
  },
24
24
  "devDependencies": {
25
25
  "react": "^18.3.1",