@1771technologies/lytenyte-pro 1.0.2 → 1.0.3
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/+types.d.ts +24 -4
- package/dist/cell-selection/cell-selection-driver.js +2 -1
- package/dist/cell-selection/cell-style-row.d.ts +2 -2
- package/dist/cell-selection/cell-style-row.js +1 -1
- package/dist/cell-selection/get-root-cell.js +3 -83
- package/dist/cell-selection/index.d.ts +0 -1
- package/dist/cell-selection/index.js +0 -1
- package/dist/cell-selection/split-cell-selection-rect.d.ts +8 -1
- package/dist/cell-selection/split-cell-selection-rect.js +13 -4
- package/dist/cell-selection/split-on-pivot.d.ts +3 -0
- package/dist/cell-selection/split-on-pivot.js +50 -0
- package/dist/cells/cell-editor.js +1 -1
- package/dist/cells/cell-spacer.d.ts +3 -0
- package/dist/cells/cell-spacer.js +37 -0
- package/dist/cells/cell.d.ts +1 -3
- package/dist/cells/cell.js +11 -9
- package/dist/column-manager/branch.js +1 -1
- package/dist/column-manager/leaf.js +1 -1
- package/dist/column-manager/move-handle.d.ts +0 -7
- package/dist/column-manager/move-handle.js +23 -6
- package/dist/filter-tree/leaf.js +3 -1
- package/dist/grid-box/+types.d.ts +2 -2
- package/dist/grid-box/item.js +3 -3
- package/dist/grid-box/use-aggregation-box-items.js +1 -2
- package/dist/grid-box/use-column-box-items.d.ts +2 -3
- package/dist/grid-box/use-column-box-items.js +3 -3
- package/dist/grid-box/use-row-group-box-items.d.ts +3 -3
- package/dist/grid-box/use-row-group-box-items.js +41 -5
- package/dist/grid.d.ts +1 -1
- package/dist/header/resize-handler.js +21 -15
- package/dist/license.js +1 -1
- package/dist/row-data-source-client/use-client-data-source-paginated.js +154 -164
- package/dist/row-data-source-client/use-client-data-source.js +144 -177
- package/dist/row-data-source-client/use-client-tree-data-source.js +119 -152
- package/dist/row-data-source-server/use-server-data-source.js +102 -120
- package/dist/rows/row/row.d.ts +1 -1
- package/dist/rows/row/row.js +11 -4
- package/dist/rows/rows-sections.js +1 -1
- package/dist/sort-manager/+types.d.ts +2 -0
- package/dist/sort-manager/hooks/use-sort-row-item.js +6 -6
- package/dist/sort-manager/utils/sort-item-to-sort-model.js +5 -0
- package/dist/sort-manager/utils/sort-model-to-sort-items.js +2 -1
- package/dist/state/+types.d.ts +8 -10
- package/dist/state/api/cell-root.d.ts +5 -0
- package/dist/state/api/cell-root.js +64 -0
- package/dist/state/api/edit-begin.js +5 -9
- package/dist/state/api/edit-is-cell-active.d.ts +1 -1
- package/dist/state/api/edit-is-cell-active.js +2 -7
- package/dist/state/api/focus-cell.js +2 -2
- package/dist/state/helpers/column-layout.d.ts +3 -3
- package/dist/state/helpers/column-layout.js +9 -15
- package/dist/state/helpers/get-full-width-callback.d.ts +1 -1
- package/dist/state/helpers/get-full-width-callback.js +2 -0
- package/dist/state/helpers/get-span-callback.d.ts +1 -1
- package/dist/state/helpers/get-span-callback.js +2 -0
- package/dist/state/helpers/row-layout/row-layout.d.ts +5 -4
- package/dist/state/helpers/row-layout/row-layout.js +112 -346
- package/dist/state/use-lytenyte.js +398 -334
- package/dist/viewport/viewport.js +3 -2
- package/main.css +27 -3
- package/package.json +7 -7
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { focusCell
|
|
1
|
+
import { focusCell } from "@1771technologies/lytenyte-shared";
|
|
2
2
|
import { runWithBackoff } from "@1771technologies/lytenyte-js-utils";
|
|
3
3
|
import { editOnChange } from "../helpers/edit-on-change.js";
|
|
4
4
|
export const makeEditBegin = (grid) => {
|
|
@@ -38,18 +38,14 @@ export const makeEditBegin = (grid) => {
|
|
|
38
38
|
grid.api.scrollIntoView({ column, row: params.rowIndex });
|
|
39
39
|
// Let's try begin the cell edit.
|
|
40
40
|
const run = () => {
|
|
41
|
-
const layout = i.layout.get();
|
|
42
|
-
const row = layout.get(params.rowIndex);
|
|
43
|
-
if (!row)
|
|
44
|
-
return false;
|
|
45
|
-
if (isFullWidthMap(row))
|
|
46
|
-
return true;
|
|
47
41
|
const columnIndex = meta.columnsVisible.indexOf(column);
|
|
48
|
-
const cell =
|
|
42
|
+
const cell = grid.api.cellRoot(params.rowIndex, columnIndex);
|
|
49
43
|
if (!cell)
|
|
50
44
|
return false;
|
|
45
|
+
if (cell.kind === "full-width")
|
|
46
|
+
return true;
|
|
51
47
|
focusCell({
|
|
52
|
-
|
|
48
|
+
getRootCell: grid.api.cellRoot,
|
|
53
49
|
focusActive: i.focusActive,
|
|
54
50
|
id: grid.state.gridId.get(),
|
|
55
51
|
colIndex: columnIndex,
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import { isFullWidthMap } from "@1771technologies/lytenyte-shared";
|
|
2
1
|
export const makeEditIsCellActive = (grid) => {
|
|
3
2
|
return (params) => {
|
|
4
3
|
const active = grid.internal.editActivePos.get();
|
|
@@ -14,13 +13,9 @@ export const makeEditIsCellActive = (grid) => {
|
|
|
14
13
|
column = meta.columnsVisible.find((c) => c.id === params.column.id);
|
|
15
14
|
if (!column)
|
|
16
15
|
return false;
|
|
17
|
-
const layout = grid.internal.layout.get();
|
|
18
|
-
const row = layout.get(params.rowIndex);
|
|
19
|
-
if (!row || isFullWidthMap(row))
|
|
20
|
-
return false;
|
|
21
16
|
const colIndex = meta.columnsVisible.indexOf(column);
|
|
22
|
-
const cell =
|
|
23
|
-
if (!cell)
|
|
17
|
+
const cell = grid.api.cellRoot(params.rowIndex, colIndex);
|
|
18
|
+
if (!cell || cell.kind === "full-width")
|
|
24
19
|
return false;
|
|
25
20
|
return active.column.id === column.id && active.rowIndex === params.rowIndex;
|
|
26
21
|
};
|
|
@@ -32,7 +32,7 @@ export const makeFocusCell = (grid) => {
|
|
|
32
32
|
columnCount: grid.state.columnMeta.get().columnsVisible.length,
|
|
33
33
|
focusActive: grid.internal.focusActive,
|
|
34
34
|
id: grid.state.gridId.get(),
|
|
35
|
-
|
|
35
|
+
getRootCell: grid.api.cellRoot,
|
|
36
36
|
rtl: grid.state.rtl.get(),
|
|
37
37
|
scrollIntoView: grid.api.scrollIntoView,
|
|
38
38
|
});
|
|
@@ -108,7 +108,7 @@ export const makeFocusCell = (grid) => {
|
|
|
108
108
|
rowIndex: position.row,
|
|
109
109
|
focusActive: grid.internal.focusActive,
|
|
110
110
|
id: grid.state.gridId.get(),
|
|
111
|
-
|
|
111
|
+
getRootCell: grid.api.cellRoot,
|
|
112
112
|
scrollIntoView: grid.api.scrollIntoView,
|
|
113
113
|
vp,
|
|
114
114
|
});
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import type {
|
|
2
|
-
import type {
|
|
3
|
-
export declare function makeColumnLayout<T>(
|
|
1
|
+
import type { HeaderLayoutCell } from "../../+types";
|
|
2
|
+
import type { MakeColumnViewReturn } from "./column-view";
|
|
3
|
+
export declare function makeColumnLayout<T>(view: MakeColumnViewReturn<T>, floatingRowEnabled: boolean): HeaderLayoutCell<T>[][];
|
|
@@ -1,5 +1,7 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
1
|
+
export function makeColumnLayout(view, floatingRowEnabled) {
|
|
2
|
+
const combinedView = view.combinedView;
|
|
3
|
+
const groupMeta = view.meta;
|
|
4
|
+
const centerEnd = view.startCount + view.centerCount;
|
|
3
5
|
const layout = [];
|
|
4
6
|
const floatingRow = [];
|
|
5
7
|
for (let r = 0; r < combinedView.length; r++) {
|
|
@@ -8,15 +10,7 @@ export function makeColumnLayout(combinedView, groupMeta, b, focus, floatingRowE
|
|
|
8
10
|
for (let i = 0; i < row.length; i++) {
|
|
9
11
|
const c = row[i];
|
|
10
12
|
const colS = c.colStart;
|
|
11
|
-
const
|
|
12
|
-
if (!rangesOverlap(colS, colE, b.colStartStart, b.colStartEnd) && // not in start area
|
|
13
|
-
!rangesOverlap(colS, colE, b.colCenterStart, b.colCenterEnd) && // not in center area
|
|
14
|
-
!rangesOverlap(colS, colE, b.colEndStart, b.colEndEnd) && // not in end area
|
|
15
|
-
!(focus && rangesOverlap(colS, colE, focus.colIndex, focus.colIndex + 1)) // not if a cell in the column is focused
|
|
16
|
-
) {
|
|
17
|
-
continue;
|
|
18
|
-
}
|
|
19
|
-
const colPin = colS < b.colStartEnd ? "start" : colS >= b.colEndStart ? "end" : null;
|
|
13
|
+
const colPin = colS < view.startCount ? "start" : colS >= centerEnd ? "end" : null;
|
|
20
14
|
if (c.kind === "leaf") {
|
|
21
15
|
const vals = {
|
|
22
16
|
id: c.data.id,
|
|
@@ -28,8 +22,8 @@ export function makeColumnLayout(combinedView, groupMeta, b, focus, floatingRowE
|
|
|
28
22
|
colStart: c.colStart,
|
|
29
23
|
colEnd: c.colStart + c.colSpan,
|
|
30
24
|
colSpan: c.colSpan,
|
|
31
|
-
colFirstEndPin: c.colStart ===
|
|
32
|
-
colLastStartPin: c.colStart + c.colSpan ===
|
|
25
|
+
colFirstEndPin: c.colStart === centerEnd ? true : undefined,
|
|
26
|
+
colLastStartPin: c.colStart + c.colSpan === view.startCount ? true : undefined,
|
|
33
27
|
};
|
|
34
28
|
rowLayout.push({ kind: "cell", ...vals });
|
|
35
29
|
if (floatingRowEnabled) {
|
|
@@ -53,8 +47,8 @@ export function makeColumnLayout(combinedView, groupMeta, b, focus, floatingRowE
|
|
|
53
47
|
groupPath: c.data.groupPath,
|
|
54
48
|
start: c.data.start,
|
|
55
49
|
end: c.data.end,
|
|
56
|
-
colFirstEndPin: c.colStart ===
|
|
57
|
-
colLastStartPin: c.colStart + c.colSpan ===
|
|
50
|
+
colFirstEndPin: c.colStart === centerEnd ? true : undefined,
|
|
51
|
+
colLastStartPin: c.colStart + c.colSpan === view.startCount ? true : undefined,
|
|
58
52
|
});
|
|
59
53
|
}
|
|
60
54
|
layout.push(rowLayout);
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import type { Grid, RowDataSource, RowFullWidthPredicate } from "../../+types";
|
|
2
|
-
export declare function getFullWidthCallback<T>(rds: RowDataSource<T>, predicate: RowFullWidthPredicate<T
|
|
2
|
+
export declare function getFullWidthCallback<T>(rds: RowDataSource<T>, predicate: RowFullWidthPredicate<T> | null, grid: Grid<T>): ((r: number) => boolean) | null;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import type { Column, Grid, RowDataSource } from "../../+types";
|
|
2
|
-
export declare function getSpanFn<T>(rds: RowDataSource<T>, grid: Grid<T>, visibleColumns: Column<T>[], span: "row" | "col"): (r: number, c: number) => number;
|
|
2
|
+
export declare function getSpanFn<T>(rds: RowDataSource<T>, grid: Grid<T>, visibleColumns: Column<T>[], span: "row" | "col"): ((r: number, c: number) => number) | null;
|
|
@@ -1,8 +1,9 @@
|
|
|
1
|
-
import { type
|
|
1
|
+
import { type LayoutState, type SpanLayout } from "@1771technologies/lytenyte-shared";
|
|
2
2
|
import type { Column, PositionUnion, RowDataStore, RowLayout } from "../../../+types";
|
|
3
3
|
interface MakeRowViewArgs<T> {
|
|
4
|
-
|
|
5
|
-
|
|
4
|
+
view: SpanLayout;
|
|
5
|
+
layout: LayoutState;
|
|
6
|
+
viewCache: Map<number, RowLayout<T>>;
|
|
6
7
|
rds: RowDataStore<T>;
|
|
7
8
|
columns: Column<T>[];
|
|
8
9
|
focus: PositionUnion | null;
|
|
@@ -10,7 +11,7 @@ interface MakeRowViewArgs<T> {
|
|
|
10
11
|
/**
|
|
11
12
|
* This is quite a complex function so read each part carefully.
|
|
12
13
|
*/
|
|
13
|
-
export declare function makeRowLayout<T>({
|
|
14
|
+
export declare function makeRowLayout<T>({ view: n, viewCache, layout, rds, columns }: MakeRowViewArgs<T>): {
|
|
14
15
|
top: RowLayout<T>[];
|
|
15
16
|
center: RowLayout<T>[];
|
|
16
17
|
bottom: RowLayout<T>[];
|