@noraent/nora-datagrid 0.0.47 → 0.0.48

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,6 +1,6 @@
1
1
  {
2
2
  "name": "@noraent/nora-datagrid",
3
- "version": "0.0.47",
3
+ "version": "0.0.48",
4
4
  "module": "./lib/esm/index.js",
5
5
  "main": "./lib/cjs/index.js",
6
6
  "private": false,
@@ -16,7 +16,8 @@ const NoraDataGridBody = React.forwardRef((props, ref) => {
16
16
  React.useImperativeHandle(ref, () => bodyRef.current);
17
17
  React.useEffect(() => {
18
18
  function handleClickOutside(event) {
19
- if (bodyRef.current && bodyRef.current.contains(event.target)) {
19
+ const gridContainerRef = gridRef.current.store.gridContainer;
20
+ if (gridContainerRef.current && gridContainerRef.current.contains(event.target)) {
20
21
  }
21
22
  else {
22
23
  // body 바깥 클릭 감지
@@ -27,9 +28,9 @@ const NoraDataGridBody = React.forwardRef((props, ref) => {
27
28
  }
28
29
  }
29
30
  }
30
- document.addEventListener("mousedown", handleClickOutside);
31
+ window.addEventListener("mousedown", handleClickOutside);
31
32
  return () => {
32
- document.removeEventListener("mousedown", handleClickOutside);
33
+ window.removeEventListener("mousedown", handleClickOutside);
33
34
  };
34
35
  }, []);
35
36
  return (_jsx("div", { ref: bodyRef, className: cx(classes.TableClasses.body.root, classes.TableClasses.body.classes), children: children }));
@@ -36,6 +36,7 @@ const DynamicVirtualScroll = React.memo(({ children }) => {
36
36
  var _a;
37
37
  const store = gridRef.current.store;
38
38
  const parentElement = (_a = store === null || store === void 0 ? void 0 : store.gridContainer.current) === null || _a === void 0 ? void 0 : _a.parentElement;
39
+ console.log("!!!!", parentElement);
39
40
  // ResizeObserver 인스턴스 생성: 부모 요소의 크기 변화를 감지함
40
41
  const observer = new ResizeObserver((entries) => {
41
42
  // 감지된 모든 요소에 대해 반복
@@ -1,3 +1,4 @@
1
+ import { DataGridPublicColumnModel } from "./types/dataGridCoreProps";
1
2
  export { DataGrid } from "./DataGrid";
2
3
  export * from "./hooks/useGridApiRef";
3
- export { type DataGridColDef } from "./types/dataGridCoreProps";
4
+ export type DataGridColDef = Array<DataGridPublicColumnModel>;
@@ -1,7 +1,6 @@
1
1
  import { EditStatus } from "./dataGridCoreEnum";
2
2
  import { GirdApi } from "./dataGridProps";
3
3
  export type DataGridColumn = DataGridColumnModel;
4
- export type DataGridColDef = Array<DataGridPublicColumnModel>;
5
4
  export type DataGridColumns = Array<DataGridPrivateColumnModel>;
6
5
  export type DataGridDataSource = Array<DataGridPrivateDataSourceModel>;
7
6
  /**
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@noraent/nora-datagrid",
3
- "version": "0.0.47",
3
+ "version": "0.0.48",
4
4
  "module": "./lib/esm/index.js",
5
5
  "main": "./lib/cjs/index.js",
6
6
  "private": false,
@@ -16,7 +16,8 @@ const NoraDataGridBody = React.forwardRef((props, ref) => {
16
16
  React.useImperativeHandle(ref, () => bodyRef.current);
17
17
  React.useEffect(() => {
18
18
  function handleClickOutside(event) {
19
- if (bodyRef.current && bodyRef.current.contains(event.target)) {
19
+ const gridContainerRef = gridRef.current.store.gridContainer;
20
+ if (gridContainerRef.current && gridContainerRef.current.contains(event.target)) {
20
21
  }
21
22
  else {
22
23
  // body 바깥 클릭 감지
@@ -27,9 +28,9 @@ const NoraDataGridBody = React.forwardRef((props, ref) => {
27
28
  }
28
29
  }
29
30
  }
30
- document.addEventListener("mousedown", handleClickOutside);
31
+ window.addEventListener("mousedown", handleClickOutside);
31
32
  return () => {
32
- document.removeEventListener("mousedown", handleClickOutside);
33
+ window.removeEventListener("mousedown", handleClickOutside);
33
34
  };
34
35
  }, []);
35
36
  return (_jsx("div", { ref: bodyRef, className: cx(classes.TableClasses.body.root, classes.TableClasses.body.classes), children: children }));
@@ -36,6 +36,7 @@ const DynamicVirtualScroll = React.memo(({ children }) => {
36
36
  var _a;
37
37
  const store = gridRef.current.store;
38
38
  const parentElement = (_a = store === null || store === void 0 ? void 0 : store.gridContainer.current) === null || _a === void 0 ? void 0 : _a.parentElement;
39
+ console.log("!!!!", parentElement);
39
40
  // ResizeObserver 인스턴스 생성: 부모 요소의 크기 변화를 감지함
40
41
  const observer = new ResizeObserver((entries) => {
41
42
  // 감지된 모든 요소에 대해 반복
@@ -1,3 +1,4 @@
1
+ import { DataGridPublicColumnModel } from "./types/dataGridCoreProps";
1
2
  export { DataGrid } from "./DataGrid";
2
3
  export * from "./hooks/useGridApiRef";
3
- export { type DataGridColDef } from "./types/dataGridCoreProps";
4
+ export type DataGridColDef = Array<DataGridPublicColumnModel>;
@@ -1,7 +1,6 @@
1
1
  import { EditStatus } from "./dataGridCoreEnum";
2
2
  import { GirdApi } from "./dataGridProps";
3
3
  export type DataGridColumn = DataGridColumnModel;
4
- export type DataGridColDef = Array<DataGridPublicColumnModel>;
5
4
  export type DataGridColumns = Array<DataGridPrivateColumnModel>;
6
5
  export type DataGridDataSource = Array<DataGridPrivateDataSourceModel>;
7
6
  /**
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@noraent/nora-datagrid",
3
- "version": "0.0.47",
3
+ "version": "0.0.48",
4
4
  "module": "./lib/esm/index.js",
5
5
  "main": "./lib/cjs/index.js",
6
6
  "private": false,