@1771technologies/lytenyte-pro 1.0.12 → 1.0.13
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 +21 -2
- package/dist/__play__/grid-navigation/cell-spans-large.play.d.ts +3 -0
- package/dist/__play__/grid-navigation/cell-spans-large.play.js +26 -0
- package/dist/__play__/grid-navigation/cell-spans-with-pins.play.d.ts +3 -0
- package/dist/__play__/grid-navigation/cell-spans-with-pins.play.js +27 -0
- package/dist/__play__/grid-navigation/cell-spans.play.d.ts +3 -0
- package/dist/__play__/grid-navigation/cell-spans.play.js +52 -0
- package/dist/__play__/grid-navigation/cell-with-tabbables.play.d.ts +3 -0
- package/dist/__play__/grid-navigation/cell-with-tabbables.play.js +47 -0
- package/dist/__play__/grid-navigation/column-groups.play.d.ts +3 -0
- package/dist/__play__/grid-navigation/column-groups.play.js +24 -0
- package/dist/__play__/grid-navigation/full-width-rows.play.d.ts +6 -0
- package/dist/__play__/grid-navigation/full-width-rows.play.js +67 -0
- package/dist/__play__/grid-navigation/horizontal-navigation.pt.d.ts +1 -0
- package/dist/__play__/grid-navigation/horizontal-navigation.pt.js +877 -0
- package/dist/__play__/grid-navigation/normal-layout.play.d.ts +10 -0
- package/dist/__play__/grid-navigation/normal-layout.play.js +72 -0
- package/dist/__play__/grid-navigation/pinned-gap-layout.play.d.ts +3 -0
- package/dist/__play__/grid-navigation/pinned-gap-layout.play.js +11 -0
- package/dist/__play__/grid-navigation/row-detail-with-spans.play.d.ts +6 -0
- package/dist/__play__/grid-navigation/row-detail-with-spans.play.js +79 -0
- package/dist/__play__/grid-navigation/row-detail.play.d.ts +6 -0
- package/dist/__play__/grid-navigation/row-detail.play.js +78 -0
- package/dist/__play__/grid-navigation/row-detail.pt.d.ts +1 -0
- package/dist/__play__/grid-navigation/row-detail.pt.js +68 -0
- package/dist/__play__/grid-navigation/vertical-navigation.pt.d.ts +1 -0
- package/dist/__play__/grid-navigation/vertical-navigation.pt.js +176 -0
- package/dist/__play__/test-utils/bank-data-smaller.d.ts +19 -0
- package/dist/__play__/test-utils/bank-data-smaller.js +252 -0
- package/dist/__play__/test-utils/row-handler.d.ts +6 -0
- package/dist/__play__/test-utils/row-handler.js +33 -0
- package/dist/cells/+types.cell.d.ts +1 -1
- package/dist/cells/cell-default.d.ts +1 -1
- package/dist/cells/cell-editor.js +19 -12
- package/dist/cells/cell-spacer.js +9 -4
- package/dist/cells/cell.js +4 -3
- package/dist/context.d.ts +3 -3
- package/dist/header/use-header-cell-renderer.js +1 -0
- package/dist/icons/index.js +1 -3
- package/dist/root/root.js +39 -56
- package/dist/rows/row/context.d.ts +2 -1
- package/dist/rows/row/context.js +1 -0
- package/dist/rows/row/row.d.ts +1 -1
- package/dist/rows/row/row.js +1 -1
- package/dist/rows/row/use-row-context-value.d.ts +2 -2
- package/dist/rows/row/use-row-context-value.js +3 -2
- package/dist/rows/row-detail-row.js +4 -87
- package/dist/rows/row-full-width.js +1 -1
- package/dist/state/api/cell-root.js +4 -3
- package/dist/state/api/focus-cell.d.ts +1 -1
- package/dist/state/api/focus-cell.js +19 -12
- package/dist/state/helpers/column-marker.js +2 -0
- package/dist/state/helpers/get-span-callback.js +1 -1
- package/dist/state/helpers/row-layout/row-layout.js +8 -28
- package/dist/state/use-lytenyte.js +3 -1
- package/dist/viewport/viewport.js +22 -15
- package/package.json +7 -7
|
@@ -2,7 +2,7 @@ import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-run
|
|
|
2
2
|
import { forwardRef } from "react";
|
|
3
3
|
import { useCombinedRefs } from "@1771technologies/lytenyte-react-hooks";
|
|
4
4
|
import { useGridRoot } from "../context.js";
|
|
5
|
-
import {
|
|
5
|
+
import { handleNavigation, useFocusTracking } from "@1771technologies/lytenyte-shared";
|
|
6
6
|
import { beginEditing } from "./begin-editing.js";
|
|
7
7
|
export const Viewport = forwardRef(function Viewport({ children, style, ...props }, forwarded) {
|
|
8
8
|
const ctx = useGridRoot();
|
|
@@ -12,24 +12,30 @@ export const Viewport = forwardRef(function Viewport({ children, style, ...props
|
|
|
12
12
|
const height = ctx.grid.state.heightTotal.useValue();
|
|
13
13
|
const rtl = ctx.grid.state.rtl.useValue();
|
|
14
14
|
const cellSelectionMode = ctx.grid.state.cellSelectionMode.useValue();
|
|
15
|
-
const focused = useFocusTracking(vp, ctx.grid.internal.focusActive);
|
|
15
|
+
const [focused, vpFocused] = useFocusTracking(vp, ctx.grid.internal.focusActive);
|
|
16
|
+
const shouldCapture = !focused && !vpFocused;
|
|
16
17
|
return (_jsxs(_Fragment, { children: [_jsxs("div", { tabIndex: 0, ...props, "data-ln-has-cell-selection": cellSelectionMode !== "none", onKeyDown: (e) => {
|
|
17
|
-
handleSkipInner(e);
|
|
18
18
|
props.onKeyDown?.(e);
|
|
19
|
-
if (e.defaultPrevented || e.
|
|
19
|
+
if (e.defaultPrevented || e.isPropagationStopped() || !vp)
|
|
20
20
|
return;
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
focusActive: ctx.grid.internal.focusActive,
|
|
29
|
-
id: ctx.grid.state.gridId.get(),
|
|
21
|
+
handleNavigation({
|
|
22
|
+
gridId: ctx.grid.state.gridId.get(),
|
|
23
|
+
rtl,
|
|
24
|
+
event: e,
|
|
25
|
+
viewport: vp,
|
|
26
|
+
topCount: ctx.grid.state.rowDataStore.rowTopCount.get(),
|
|
27
|
+
centerCount: ctx.grid.state.rowDataStore.rowCenterCount.get(),
|
|
30
28
|
getRootCell: ctx.grid.api.cellRoot,
|
|
31
|
-
rtl: ctx.grid.state.rtl.get(),
|
|
32
29
|
scrollIntoView: ctx.grid.api.scrollIntoView,
|
|
30
|
+
focusActive: ctx.grid.internal.focusActive,
|
|
31
|
+
columnCount: ctx.grid.state.columnMeta.get().columnsVisible.length,
|
|
32
|
+
rowCount: ctx.grid.state.rowDataStore.rowCount.get(),
|
|
33
|
+
isRowDetailExpanded: (r) => {
|
|
34
|
+
const row = ctx.grid.api.rowByIndex(r);
|
|
35
|
+
if (!row)
|
|
36
|
+
return false;
|
|
37
|
+
return ctx.grid.api.rowDetailIsExpanded(row);
|
|
38
|
+
},
|
|
33
39
|
});
|
|
34
40
|
if (e.key === "Enter" || e.key.length === 1) {
|
|
35
41
|
// We use a timeout to avoid setting the value on clicks. This can happen when a user types
|
|
@@ -66,11 +72,12 @@ export const Viewport = forwardRef(function Viewport({ children, style, ...props
|
|
|
66
72
|
position: "relative",
|
|
67
73
|
display: "flex",
|
|
68
74
|
flexDirection: "column",
|
|
75
|
+
contain: "strict",
|
|
69
76
|
width: "100%",
|
|
70
77
|
height: "100%",
|
|
71
78
|
overflow: style?.overflow ?? "auto",
|
|
72
79
|
direction: rtl ? "rtl" : "ltr",
|
|
73
|
-
}, children: [vp && children, !vp && _jsx("div", { style: { width, height } })] }),
|
|
80
|
+
}, children: [vp && children, !vp && _jsx("div", { style: { width, height } })] }), shouldCapture && (_jsx("div", { role: "none", "data-ln-focus-capture": true, onFocusCapture: (e) => {
|
|
74
81
|
e.preventDefault();
|
|
75
82
|
e.stopPropagation();
|
|
76
83
|
vp?.focus();
|
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.
|
|
4
|
+
"version": "1.0.13",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"license": "COMMERCIAL",
|
|
7
7
|
"files": [
|
|
@@ -48,12 +48,12 @@
|
|
|
48
48
|
"access": "public"
|
|
49
49
|
},
|
|
50
50
|
"dependencies": {
|
|
51
|
-
"@1771technologies/lytenyte-
|
|
52
|
-
"@1771technologies/lytenyte-
|
|
53
|
-
"@1771technologies/lytenyte-
|
|
54
|
-
"@1771technologies/lytenyte-
|
|
55
|
-
"@1771technologies/lytenyte-
|
|
56
|
-
"@1771technologies/lytenyte-react-hooks": "1.0.
|
|
51
|
+
"@1771technologies/lytenyte-core": "1.0.13",
|
|
52
|
+
"@1771technologies/lytenyte-dragon": "1.0.13",
|
|
53
|
+
"@1771technologies/lytenyte-shared": "1.0.13",
|
|
54
|
+
"@1771technologies/lytenyte-js-utils": "1.0.13",
|
|
55
|
+
"@1771technologies/lytenyte-dom-utils": "1.0.13",
|
|
56
|
+
"@1771technologies/lytenyte-react-hooks": "1.0.13"
|
|
57
57
|
},
|
|
58
58
|
"peerDependencies": {
|
|
59
59
|
"react": "^18.0.0 || ^19.0.0",
|