@1771technologies/lytenyte-pro 1.0.12 → 1.0.14

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.
Files changed (57) hide show
  1. package/dist/+types.d.ts +21 -2
  2. package/dist/__play__/grid-navigation/cell-spans-large.play.d.ts +3 -0
  3. package/dist/__play__/grid-navigation/cell-spans-large.play.js +26 -0
  4. package/dist/__play__/grid-navigation/cell-spans-with-pins.play.d.ts +3 -0
  5. package/dist/__play__/grid-navigation/cell-spans-with-pins.play.js +27 -0
  6. package/dist/__play__/grid-navigation/cell-spans.play.d.ts +3 -0
  7. package/dist/__play__/grid-navigation/cell-spans.play.js +52 -0
  8. package/dist/__play__/grid-navigation/cell-with-tabbables.play.d.ts +3 -0
  9. package/dist/__play__/grid-navigation/cell-with-tabbables.play.js +47 -0
  10. package/dist/__play__/grid-navigation/column-groups.play.d.ts +3 -0
  11. package/dist/__play__/grid-navigation/column-groups.play.js +24 -0
  12. package/dist/__play__/grid-navigation/full-width-rows.play.d.ts +6 -0
  13. package/dist/__play__/grid-navigation/full-width-rows.play.js +67 -0
  14. package/dist/__play__/grid-navigation/horizontal-navigation.pt.d.ts +1 -0
  15. package/dist/__play__/grid-navigation/horizontal-navigation.pt.js +877 -0
  16. package/dist/__play__/grid-navigation/normal-layout.play.d.ts +10 -0
  17. package/dist/__play__/grid-navigation/normal-layout.play.js +72 -0
  18. package/dist/__play__/grid-navigation/pinned-gap-layout.play.d.ts +3 -0
  19. package/dist/__play__/grid-navigation/pinned-gap-layout.play.js +11 -0
  20. package/dist/__play__/grid-navigation/row-detail-with-spans.play.d.ts +6 -0
  21. package/dist/__play__/grid-navigation/row-detail-with-spans.play.js +79 -0
  22. package/dist/__play__/grid-navigation/row-detail.play.d.ts +6 -0
  23. package/dist/__play__/grid-navigation/row-detail.play.js +78 -0
  24. package/dist/__play__/grid-navigation/row-detail.pt.d.ts +1 -0
  25. package/dist/__play__/grid-navigation/row-detail.pt.js +68 -0
  26. package/dist/__play__/grid-navigation/vertical-navigation.pt.d.ts +1 -0
  27. package/dist/__play__/grid-navigation/vertical-navigation.pt.js +176 -0
  28. package/dist/__play__/test-utils/bank-data-smaller.d.ts +19 -0
  29. package/dist/__play__/test-utils/bank-data-smaller.js +252 -0
  30. package/dist/__play__/test-utils/row-handler.d.ts +6 -0
  31. package/dist/__play__/test-utils/row-handler.js +33 -0
  32. package/dist/cells/+types.cell.d.ts +1 -1
  33. package/dist/cells/cell-default.d.ts +1 -1
  34. package/dist/cells/cell-editor.js +19 -12
  35. package/dist/cells/cell-spacer.js +9 -4
  36. package/dist/cells/cell.js +4 -3
  37. package/dist/context.d.ts +3 -3
  38. package/dist/header/use-header-cell-renderer.js +1 -0
  39. package/dist/icons/index.js +1 -3
  40. package/dist/root/root.js +39 -56
  41. package/dist/rows/row/context.d.ts +2 -1
  42. package/dist/rows/row/context.js +1 -0
  43. package/dist/rows/row/row.d.ts +1 -1
  44. package/dist/rows/row/row.js +1 -1
  45. package/dist/rows/row/use-row-context-value.d.ts +2 -2
  46. package/dist/rows/row/use-row-context-value.js +3 -2
  47. package/dist/rows/row-detail-row.js +4 -87
  48. package/dist/rows/row-full-width.js +1 -1
  49. package/dist/state/api/cell-root.js +4 -3
  50. package/dist/state/api/focus-cell.d.ts +1 -1
  51. package/dist/state/api/focus-cell.js +19 -12
  52. package/dist/state/helpers/column-marker.js +2 -0
  53. package/dist/state/helpers/get-span-callback.js +1 -1
  54. package/dist/state/helpers/row-layout/row-layout.js +3 -22
  55. package/dist/state/use-lytenyte.js +3 -1
  56. package/dist/viewport/viewport.js +22 -15
  57. 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 { handleNavigationKeys, handleSkipInner, useFocusTracking, } from "@1771technologies/lytenyte-shared";
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.shiftKey)
19
+ if (e.defaultPrevented || e.isPropagationStopped() || !vp)
20
20
  return;
21
- const ds = ctx.grid.state.rowDataStore;
22
- handleNavigationKeys(e, {
23
- vp: ctx.grid.state.viewport.get(),
24
- rowCount: ds.rowCount.get(),
25
- topCount: ds.rowTopCount.get(),
26
- centerCount: ds.rowCenterCount.get(),
27
- columnCount: ctx.grid.state.columnMeta.get().columnsVisible.length,
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 } })] }), !focused && (_jsx("div", { role: "none", "data-ln-focus-capture": true, onFocusCapture: (e) => {
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.12",
4
+ "version": "1.0.14",
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-shared": "1.0.12",
52
- "@1771technologies/lytenyte-dom-utils": "1.0.12",
53
- "@1771technologies/lytenyte-js-utils": "1.0.12",
54
- "@1771technologies/lytenyte-core": "1.0.12",
55
- "@1771technologies/lytenyte-dragon": "1.0.12",
56
- "@1771technologies/lytenyte-react-hooks": "1.0.12"
51
+ "@1771technologies/lytenyte-core": "1.0.14",
52
+ "@1771technologies/lytenyte-dragon": "1.0.14",
53
+ "@1771technologies/lytenyte-shared": "1.0.14",
54
+ "@1771technologies/lytenyte-dom-utils": "1.0.14",
55
+ "@1771technologies/lytenyte-js-utils": "1.0.14",
56
+ "@1771technologies/lytenyte-react-hooks": "1.0.14"
57
57
  },
58
58
  "peerDependencies": {
59
59
  "react": "^18.0.0 || ^19.0.0",