@noraent/nora-datagrid 0.0.16 → 0.0.18
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/lib/cjs/App.js +2 -1
- package/lib/cjs/DataGrid.js +15 -0
- package/lib/cjs/buildPackage.json +1 -1
- package/lib/cjs/components/TwoDimensionalVirtualizedList.js +1 -2
- package/lib/esm/App.js +2 -1
- package/lib/esm/DataGrid.js +15 -0
- package/lib/esm/buildPackage.json +1 -1
- package/lib/esm/components/TwoDimensionalVirtualizedList.js +1 -2
- package/package.json +1 -1
package/lib/cjs/App.js
CHANGED
|
@@ -134,6 +134,7 @@ function App() {
|
|
|
134
134
|
note: `note-${i}`,
|
|
135
135
|
date: `${new Date()}`,
|
|
136
136
|
// height: 30,
|
|
137
|
+
// height: 20,
|
|
137
138
|
// height: Math.floor(Math.random() * 20) + 20,
|
|
138
139
|
};
|
|
139
140
|
});
|
|
@@ -143,7 +144,7 @@ function App() {
|
|
|
143
144
|
handleDataSource();
|
|
144
145
|
}, children: "\uB370\uC774\uD130 set" }), _jsx("button", { onClick: () => {
|
|
145
146
|
console.log("!!!!!", ref.current.getData());
|
|
146
|
-
}, children: "dd" }), _jsx("button", { children: "dd" }), _jsx("div", { style: { width: "1200px", height: "
|
|
147
|
+
}, children: "dd" }), _jsx("button", { children: "dd" }), _jsx("div", { style: { width: "1200px", height: "900px" }, children: _jsx(DataGrid, { gridRef: ref, columns: columns, dataSource: dataSource }) }), _jsx("button", { children: "dd" })] }));
|
|
147
148
|
}
|
|
148
149
|
export const initialItemsData = () => Array.from({ length: 10 }, (_, i) => {
|
|
149
150
|
return {
|
package/lib/cjs/DataGrid.js
CHANGED
|
@@ -7,6 +7,21 @@ import "./app.scss";
|
|
|
7
7
|
import { TwoDimensionalVirtualizedList } from "./components/TwoDimensionalVirtualizedList";
|
|
8
8
|
import { GridStoreContentProvider } from "./provider/GridStoreContent";
|
|
9
9
|
import useUpdateEffect from "./common/constants/utils";
|
|
10
|
+
console.log(`%c
|
|
11
|
+
███╗ ██╗ ██████╗ ██████╗ █████╗
|
|
12
|
+
████╗ ██║██╔═══██╗██╔══██╗██╔══██╗
|
|
13
|
+
██╔██╗ ██║██║ ██║██████╔╝███████║
|
|
14
|
+
██║╚██╗██║██║ ██║██╔══██╗██╔══██║
|
|
15
|
+
██║ ╚████║╚██████╔╝██║ ██║██║ ██║
|
|
16
|
+
╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝╚═╝ ╚═╝
|
|
17
|
+
|
|
18
|
+
██████╗ █████╗ ████████╗ █████╗ ██████╗ ██████╗ ██╗██████╗
|
|
19
|
+
██╔══██╗██╔══██╗╚══██╔══╝██╔══██╗ ██╔════╝ ██╔══██╗██║██╔══██╗
|
|
20
|
+
██║ ██║███████║ ██║ ███████║█████╗██║ ███╗██████╔╝██║██║ ██║
|
|
21
|
+
██║ ██║██╔══██║ ██║ ██╔══██║╚════╝██║ ██║██╔══██╗██║██║ ██║
|
|
22
|
+
██████╔╝██║ ██║ ██║ ██║ ██║ ╚██████╔╝██║ ██║██║██████╔╝
|
|
23
|
+
╚═════╝ ╚═╝ ╚═╝ ╚═╝ ╚═╝ ╚═╝ ╚═════╝ ╚═╝ ╚═╝╚═╝╚═════╝ v${process.env.REACT_APP_VERSION}
|
|
24
|
+
`, "color: #27c382; font-size:10px");
|
|
10
25
|
const DataGridMaster = React.forwardRef((props, _ref) => {
|
|
11
26
|
const { gridRef } = props;
|
|
12
27
|
const apiRef = useGridInitialization(gridRef, props);
|
|
@@ -13,7 +13,6 @@ import ImeComponent from "./ime/IMEComponent";
|
|
|
13
13
|
import NoDataComponent from "./body/NoDataComponent";
|
|
14
14
|
const initialWindowWidth = 800;
|
|
15
15
|
export const initialWindowHeight = 500;
|
|
16
|
-
const initialBodyHeight = initialWindowHeight - 34;
|
|
17
16
|
const overscanTopRow = 4;
|
|
18
17
|
const overscanBottomRow = 10;
|
|
19
18
|
const overscanColumn = 1;
|
|
@@ -110,7 +109,7 @@ const DynamicVirtualScroll = React.memo(({ children }) => {
|
|
|
110
109
|
const start = Math.max(0, binarySearchIndex(cumulativeHeights, scrollTop) - overscanTopRow);
|
|
111
110
|
let end = Math.min(start + overscanBottomRow, dataSource.length);
|
|
112
111
|
let startAdjust = start ? start + overscanTopRow : start;
|
|
113
|
-
while (end < dataSource.length && cumulativeHeights[end] - cumulativeHeights[startAdjust] <=
|
|
112
|
+
while (end < dataSource.length && cumulativeHeights[end] - cumulativeHeights[startAdjust] <= windowSize.height) {
|
|
114
113
|
end++;
|
|
115
114
|
}
|
|
116
115
|
end = Math.min(end + overscanBottomRow, dataSource.length);
|
package/lib/esm/App.js
CHANGED
|
@@ -134,6 +134,7 @@ function App() {
|
|
|
134
134
|
note: `note-${i}`,
|
|
135
135
|
date: `${new Date()}`,
|
|
136
136
|
// height: 30,
|
|
137
|
+
// height: 20,
|
|
137
138
|
// height: Math.floor(Math.random() * 20) + 20,
|
|
138
139
|
};
|
|
139
140
|
});
|
|
@@ -143,7 +144,7 @@ function App() {
|
|
|
143
144
|
handleDataSource();
|
|
144
145
|
}, children: "\uB370\uC774\uD130 set" }), _jsx("button", { onClick: () => {
|
|
145
146
|
console.log("!!!!!", ref.current.getData());
|
|
146
|
-
}, children: "dd" }), _jsx("button", { children: "dd" }), _jsx("div", { style: { width: "1200px", height: "
|
|
147
|
+
}, children: "dd" }), _jsx("button", { children: "dd" }), _jsx("div", { style: { width: "1200px", height: "900px" }, children: _jsx(DataGrid, { gridRef: ref, columns: columns, dataSource: dataSource }) }), _jsx("button", { children: "dd" })] }));
|
|
147
148
|
}
|
|
148
149
|
export const initialItemsData = () => Array.from({ length: 10 }, (_, i) => {
|
|
149
150
|
return {
|
package/lib/esm/DataGrid.js
CHANGED
|
@@ -7,6 +7,21 @@ import "./app.scss";
|
|
|
7
7
|
import { TwoDimensionalVirtualizedList } from "./components/TwoDimensionalVirtualizedList";
|
|
8
8
|
import { GridStoreContentProvider } from "./provider/GridStoreContent";
|
|
9
9
|
import useUpdateEffect from "./common/constants/utils";
|
|
10
|
+
console.log(`%c
|
|
11
|
+
███╗ ██╗ ██████╗ ██████╗ █████╗
|
|
12
|
+
████╗ ██║██╔═══██╗██╔══██╗██╔══██╗
|
|
13
|
+
██╔██╗ ██║██║ ██║██████╔╝███████║
|
|
14
|
+
██║╚██╗██║██║ ██║██╔══██╗██╔══██║
|
|
15
|
+
██║ ╚████║╚██████╔╝██║ ██║██║ ██║
|
|
16
|
+
╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝╚═╝ ╚═╝
|
|
17
|
+
|
|
18
|
+
██████╗ █████╗ ████████╗ █████╗ ██████╗ ██████╗ ██╗██████╗
|
|
19
|
+
██╔══██╗██╔══██╗╚══██╔══╝██╔══██╗ ██╔════╝ ██╔══██╗██║██╔══██╗
|
|
20
|
+
██║ ██║███████║ ██║ ███████║█████╗██║ ███╗██████╔╝██║██║ ██║
|
|
21
|
+
██║ ██║██╔══██║ ██║ ██╔══██║╚════╝██║ ██║██╔══██╗██║██║ ██║
|
|
22
|
+
██████╔╝██║ ██║ ██║ ██║ ██║ ╚██████╔╝██║ ██║██║██████╔╝
|
|
23
|
+
╚═════╝ ╚═╝ ╚═╝ ╚═╝ ╚═╝ ╚═╝ ╚═════╝ ╚═╝ ╚═╝╚═╝╚═════╝ v${process.env.REACT_APP_VERSION}
|
|
24
|
+
`, "color: #27c382; font-size:10px");
|
|
10
25
|
const DataGridMaster = React.forwardRef((props, _ref) => {
|
|
11
26
|
const { gridRef } = props;
|
|
12
27
|
const apiRef = useGridInitialization(gridRef, props);
|
|
@@ -13,7 +13,6 @@ import ImeComponent from "./ime/IMEComponent";
|
|
|
13
13
|
import NoDataComponent from "./body/NoDataComponent";
|
|
14
14
|
const initialWindowWidth = 800;
|
|
15
15
|
export const initialWindowHeight = 500;
|
|
16
|
-
const initialBodyHeight = initialWindowHeight - 34;
|
|
17
16
|
const overscanTopRow = 4;
|
|
18
17
|
const overscanBottomRow = 10;
|
|
19
18
|
const overscanColumn = 1;
|
|
@@ -110,7 +109,7 @@ const DynamicVirtualScroll = React.memo(({ children }) => {
|
|
|
110
109
|
const start = Math.max(0, binarySearchIndex(cumulativeHeights, scrollTop) - overscanTopRow);
|
|
111
110
|
let end = Math.min(start + overscanBottomRow, dataSource.length);
|
|
112
111
|
let startAdjust = start ? start + overscanTopRow : start;
|
|
113
|
-
while (end < dataSource.length && cumulativeHeights[end] - cumulativeHeights[startAdjust] <=
|
|
112
|
+
while (end < dataSource.length && cumulativeHeights[end] - cumulativeHeights[startAdjust] <= windowSize.height) {
|
|
114
113
|
end++;
|
|
115
114
|
}
|
|
116
115
|
end = Math.min(end + overscanBottomRow, dataSource.length);
|