@1771technologies/lytenyte-pro 1.0.0-beta.16 → 1.0.0-beta.17
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,4 +1,4 @@
|
|
|
1
|
-
import { getHoveredColumnIndex, getNearestFocusable, useDraggable, } from "@1771technologies/lytenyte-shared";
|
|
1
|
+
import { COLUMN_MARKER_ID, getHoveredColumnIndex, getNearestFocusable, useDraggable, } from "@1771technologies/lytenyte-shared";
|
|
2
2
|
import { useMemo, useRef } from "react";
|
|
3
3
|
export function useDragMove(grid, cell, onDragStart) {
|
|
4
4
|
const ctx = grid.state;
|
|
@@ -53,6 +53,8 @@ export function useDragMove(grid, cell, onDragStart) {
|
|
|
53
53
|
});
|
|
54
54
|
if (index == null)
|
|
55
55
|
return;
|
|
56
|
+
if (grid.api.columnFromIndex(index)?.id === COLUMN_MARKER_ID)
|
|
57
|
+
return;
|
|
56
58
|
const first = columns[0];
|
|
57
59
|
const currentIndex = grid.api.columnIndex(first);
|
|
58
60
|
const columnIndices = columns.map((c) => grid.api.columnIndex(c));
|
|
@@ -6,7 +6,7 @@ export const makeColumnAutosize = (grid) => {
|
|
|
6
6
|
const meta = grid.state.columnMeta.get();
|
|
7
7
|
const columns = params.columns
|
|
8
8
|
?.map((c) => resolveColumn(c, errorRef, meta))
|
|
9
|
-
.map((c) => c && grid.api.columnById(c))
|
|
9
|
+
.map((c) => c && (typeof c === "string" ? grid.api.columnById(c) : c))
|
|
10
10
|
.filter(Boolean) ?? grid.state.columnMeta.get().columnsVisible;
|
|
11
11
|
if (errorRef.current) {
|
|
12
12
|
console.error("Invalid column autosize column params");
|
|
@@ -62,11 +62,12 @@ export function columnAddRowGroup({ columns, rowGroupModel, rowGroupDisplayMode,
|
|
|
62
62
|
}
|
|
63
63
|
if (!hasGroupColumn)
|
|
64
64
|
columns = columns.filter((c) => !c.id.startsWith(GROUP_COLUMN_PREFIX));
|
|
65
|
+
// TODO: this can be improved - what if the columns are really large?
|
|
65
66
|
const keys = Object.keys(rowGroupColumnState);
|
|
66
67
|
for (let i = 0; i < keys.length; i++) {
|
|
67
|
-
|
|
68
|
+
const column = columns.find((c) => c.id === keys[i]);
|
|
69
|
+
if (!column)
|
|
68
70
|
continue;
|
|
69
|
-
const column = lookup.get(keys[i]);
|
|
70
71
|
Object.assign(column, rowGroupColumnState[keys[i]]);
|
|
71
72
|
}
|
|
72
73
|
return columns;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import type { Column, ColumnMeta } from "../../+types";
|
|
2
2
|
export declare function resolveColumn(c: string | number | Column<any>, errorRef: {
|
|
3
3
|
current: boolean;
|
|
4
|
-
}, meta: ColumnMeta<any>): string | undefined;
|
|
4
|
+
}, meta: ColumnMeta<any>): string | Column<any> | undefined;
|
|
@@ -1,5 +1,9 @@
|
|
|
1
|
+
import { GROUP_COLUMN_PREFIX } from "@1771technologies/lytenyte-shared";
|
|
1
2
|
export function resolveColumn(c, errorRef, meta) {
|
|
2
3
|
if (typeof c === "string") {
|
|
4
|
+
if (c.startsWith(GROUP_COLUMN_PREFIX)) {
|
|
5
|
+
return meta.columnsVisible.find((x) => x.id === c);
|
|
6
|
+
}
|
|
3
7
|
if (!meta.columnLookup.has(c)) {
|
|
4
8
|
errorRef.current = true;
|
|
5
9
|
console.error(`Invalid column ${c}`);
|
|
@@ -14,6 +18,9 @@ export function resolveColumn(c, errorRef, meta) {
|
|
|
14
18
|
}
|
|
15
19
|
return col?.id;
|
|
16
20
|
}
|
|
21
|
+
if (c.id.startsWith(GROUP_COLUMN_PREFIX)) {
|
|
22
|
+
return meta.columnsVisible.find((x) => x.id === c.id);
|
|
23
|
+
}
|
|
17
24
|
if (!meta.columnLookup.has(c.id)) {
|
|
18
25
|
errorRef.current = true;
|
|
19
26
|
console.error(`Invalid column ${c.id}`);
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@1771technologies/lytenyte-pro",
|
|
3
3
|
"description": "Blazingly fast headless React data grid with 100s of features.",
|
|
4
|
-
"version": "1.0.0-beta.
|
|
4
|
+
"version": "1.0.0-beta.17",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"license": "COMMERCIAL",
|
|
7
7
|
"files": [
|
|
@@ -49,12 +49,12 @@
|
|
|
49
49
|
},
|
|
50
50
|
"dependencies": {
|
|
51
51
|
"@1771technologies/atom": "^1.0.2",
|
|
52
|
-
"@1771technologies/lytenyte-
|
|
53
|
-
"@1771technologies/lytenyte-
|
|
54
|
-
"@1771technologies/lytenyte-
|
|
55
|
-
"@1771technologies/lytenyte-
|
|
56
|
-
"@1771technologies/lytenyte-
|
|
57
|
-
"@1771technologies/lytenyte-react-hooks": "1.0.0-beta.
|
|
52
|
+
"@1771technologies/lytenyte-core": "1.0.0-beta.17",
|
|
53
|
+
"@1771technologies/lytenyte-dragon": "1.0.0-beta.17",
|
|
54
|
+
"@1771technologies/lytenyte-shared": "1.0.0-beta.17",
|
|
55
|
+
"@1771technologies/lytenyte-dom-utils": "1.0.0-beta.17",
|
|
56
|
+
"@1771technologies/lytenyte-js-utils": "1.0.0-beta.17",
|
|
57
|
+
"@1771technologies/lytenyte-react-hooks": "1.0.0-beta.17"
|
|
58
58
|
},
|
|
59
59
|
"peerDependencies": {
|
|
60
60
|
"react": "^18.0.0 || ^19.0.0",
|