@1771technologies/lytenyte-pro 1.0.18 → 1.0.19

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/README.md CHANGED
@@ -110,12 +110,12 @@ information on available support channels and response options.
110
110
 
111
111
  ## Contributing
112
112
 
113
- Please review our [contributing guide](./CONTRIBUTING.md) to learn about our development
113
+ Please review our [contributing guide](https://github.com/1771-Technologies/lytenyte/blob/main/CONTRIBUTING.md) to learn about our development
114
114
  process, bug reporting procedures, and codebase maintenance practices.
115
115
 
116
116
  ## Changelog
117
117
 
118
- Our [changelog](https://www.1771technologies.com/docs/changelog/changelog) is regularly updated
118
+ Our [changelog](https://www.1771technologies.com/docs/changelog/latest) is regularly updated
119
119
  with detailed notes on new features, improvements, and bug fixes in each release.
120
120
  LyteNyte Grid follows [semantic versioning](https://semver.org/) to ensure clear and predictable upgrade paths.
121
121
 
package/dist/+types.d.ts CHANGED
@@ -2865,20 +2865,6 @@ export interface ColumnMoveParams<T> {
2865
2865
  */
2866
2866
  readonly updatePinState?: boolean;
2867
2867
  }
2868
- /**
2869
- * The accepted input types for the `focusCell` method, which updates the active focus in LyteNyte Grid.
2870
- * Supports various formats:
2871
- *
2872
- * - A row/column pair to focus a specific cell.
2873
- * - A header or group header cell position.
2874
- * - A directional alias ("next", "prev", "up", "down") relative to the current focus (only when the grid is focused).
2875
- *
2876
- * @group Grid API
2877
- */
2878
- export type FocusCellParams<T> = {
2879
- row: number;
2880
- column: string | number | Column<T>;
2881
- } | PositionHeaderCell | Omit<PositionHeaderGroupCell, "columnStartIndex" | "columnEndIndex"> | "next" | "prev" | "up" | "down";
2882
2868
  /**
2883
2869
  * The LyteNyte Grid API provides a comprehensive set of methods that allow developers
2884
2870
  * to programmatically query, update, and manipulate grid state and data.
@@ -2957,11 +2943,6 @@ export interface GridApi<T> {
2957
2943
  * Accepts a configuration object that controls the scroll behavior.
2958
2944
  */
2959
2945
  readonly scrollIntoView: (options: ScrollIntoViewOptions<T>) => void;
2960
- /**
2961
- * Sets focus to a specific cell or navigates the focus based on a direction keyword.
2962
- * Useful for keyboard-driven navigation and programmatic focus management.
2963
- */
2964
- readonly focusCell: (position: FocusCellParams<T>) => void;
2965
2946
  /**
2966
2947
  * Starts cell editing at a specified location. If the grid is set to read-only mode, this method has no effect.
2967
2948
  */
@@ -6150,6 +6131,10 @@ export interface RowDataSourceServerParams<T> {
6150
6131
  *
6151
6132
  * Use this property when you want the grid to reset based on some external piece of data, such as an
6152
6133
  * external search query.
6134
+ *
6135
+ * Note all the items in the list should be referentially stable. LyteNyte Grid will shallow compare the
6136
+ * array, and check equality using the `!==` operator. If an item is not stable it may result in an infinite
6137
+ * reset loop.
6153
6138
  */
6154
6139
  readonly dataFetchExternals?: unknown[];
6155
6140
  /**
@@ -30,7 +30,7 @@ const columns = [
30
30
  { id: "campaign" },
31
31
  { id: "pdays" },
32
32
  { id: "previous" },
33
- { id: "poutcome" },
33
+ { id: "poutcome", name: "P Outcome" },
34
34
  { id: "y" },
35
35
  ];
36
36
  export default function CellSelection({ data = bankDataSmall }) {
@@ -30,7 +30,7 @@ const columns = [
30
30
  { id: "campaign" },
31
31
  { id: "pdays" },
32
32
  { id: "previous" },
33
- { id: "poutcome" },
33
+ { id: "poutcome", name: "P Outcome" },
34
34
  { id: "y" },
35
35
  ];
36
36
  export default function FilterSelection({ data = bankDataSmall }) {
@@ -45,7 +45,7 @@ export function CellSelectionDriver() {
45
45
  const focusable = getNearestFocusable(gridId, target);
46
46
  if (!focusable)
47
47
  return;
48
- const position = getPositionFromFocusable(focusable, gridId);
48
+ const position = getPositionFromFocusable(gridId, focusable);
49
49
  if (position.kind !== "cell" && position.kind !== "full-width")
50
50
  return;
51
51
  const rowIndex = position.rowIndex;
@@ -132,7 +132,7 @@ export function CellSelectionDriver() {
132
132
  const focusable = getNearestFocusable(gridId, target);
133
133
  if (!focusable)
134
134
  return;
135
- const position = getPositionFromFocusable(focusable, gridId);
135
+ const position = getPositionFromFocusable(gridId, focusable);
136
136
  if (position.kind !== "cell" && position.kind !== "full-width")
137
137
  return;
138
138
  const rowIndex = position.rowIndex;
@@ -4,6 +4,6 @@ export const makePositionFromElement = (grid) => {
4
4
  const focusable = getNearestFocusable(grid.state.gridId.get(), el);
5
5
  if (!focusable)
6
6
  return null;
7
- return getPositionFromFocusable(focusable, grid.state.gridId.get());
7
+ return getPositionFromFocusable(grid.state.gridId.get(), focusable);
8
8
  };
9
9
  };
@@ -20,7 +20,6 @@ import { makeRowGroupColumnIndex } from "./api/row-group-column-index.js";
20
20
  import { makeRowGroupIsExpanded } from "./api/row-group-is-expanded.js";
21
21
  import { makeRowGroupToggle } from "./api/row-group-toggle.js";
22
22
  import { makeRowGroupApplyExpansions } from "./api/row-group-apply-expansions.js";
23
- import { makeFocusCell } from "./api/focus-cell.js";
24
23
  import { makeEditBegin } from "./api/edit-begin.js";
25
24
  import { makeEditIsCellActive } from "./api/edit-is-cell-active.js";
26
25
  import { makeEditEnd } from "./api/edit-end.js";
@@ -609,7 +608,6 @@ export function makeLyteNyte(p) {
609
608
  editEnd: makeEditEnd(grid),
610
609
  editIsCellActive: makeEditIsCellActive(grid),
611
610
  editUpdate: makeEditUpdate(grid),
612
- focusCell: makeFocusCell(grid),
613
611
  rowById: makeRowById(grid),
614
612
  rowByIndex: makeRowByIndex(grid),
615
613
  rowDetailIsExpanded: makeRowDetailIsExpanded(grid),
package/main.css CHANGED
@@ -282,6 +282,8 @@
282
282
  font-family: var(--lng1771-typeface);
283
283
 
284
284
  user-select: none;
285
+ -moz-user-select: none;
286
+ -webkit-user-select: none;
285
287
 
286
288
  background-color: var(--lng1771-gray-00);
287
289
 
@@ -386,7 +388,7 @@
386
388
  height: calc(100% - 8px);
387
389
  background-color: var(--lng1771-gray-20);
388
390
  }
389
- &[data-ln-pin="end"]::after {
391
+ &[data-ln-colpin="end"]::after {
390
392
  inset-inline-end: unset;
391
393
  inset-inline-start: 0px;
392
394
  }
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.18",
4
+ "version": "1.0.19",
5
5
  "type": "module",
6
6
  "license": "COMMERCIAL",
7
7
  "files": [
@@ -48,8 +48,8 @@
48
48
  "access": "public"
49
49
  },
50
50
  "dependencies": {
51
- "@1771technologies/lytenyte-core": "1.0.18",
52
- "@1771technologies/lytenyte-shared": "1.0.18"
51
+ "@1771technologies/lytenyte-shared": "1.0.19",
52
+ "@1771technologies/lytenyte-core": "1.0.19"
53
53
  },
54
54
  "peerDependencies": {
55
55
  "react": "^18.0.0 || ^19.0.0",
@@ -1,5 +0,0 @@
1
- import type { Grid, GridApi } from "../../+types";
2
- import type { InternalAtoms } from "../+types";
3
- export declare const makeFocusCell: (grid: Grid<any> & {
4
- internal: InternalAtoms;
5
- }) => GridApi<any>["focusCell"];
@@ -1,124 +0,0 @@
1
- import { focusCell, getHeaderRows, handleNavigation, isColumnFloatingHeader, } from "@1771technologies/lytenyte-shared";
2
- import { clamp } from "@1771technologies/lytenyte-shared";
3
- export const makeFocusCell = (grid) => {
4
- return (position) => {
5
- const vp = grid.state.viewport.get();
6
- if (!vp)
7
- return false;
8
- if (typeof position === "string") {
9
- let key = "";
10
- if (position === "up")
11
- key = "ArrowUp";
12
- else if (position === "down")
13
- key = "ArrowDown";
14
- else if (position === "next")
15
- key = grid.state.rtl.get() ? "ArrowLeft" : "ArrowRight";
16
- else if (position === "prev")
17
- key = grid.state.rtl.get() ? "ArrowRight" : "ArrowLeft";
18
- if (!key)
19
- return false;
20
- const ds = grid.state.rowDataStore;
21
- handleNavigation({
22
- event: {
23
- key,
24
- ctrlKey: false,
25
- metaKey: false,
26
- preventDefault: () => { },
27
- stopPropagation: () => { },
28
- },
29
- topCount: grid.state.rowDataStore.rowTopCount.get(),
30
- centerCount: grid.state.rowDataStore.rowCenterCount.get(),
31
- isRowDetailExpanded: (r) => {
32
- const row = grid.api.rowByIndex(r);
33
- if (!row)
34
- return false;
35
- return grid.api.rowDetailIsExpanded(row);
36
- },
37
- viewport: vp,
38
- rowCount: ds.rowCount.get(),
39
- columnCount: grid.state.columnMeta.get().columnsVisible.length,
40
- focusActive: grid.internal.focusActive,
41
- gridId: grid.state.gridId.get(),
42
- getRootCell: grid.api.cellRoot,
43
- rtl: grid.state.rtl.get(),
44
- scrollIntoView: grid.api.scrollIntoView,
45
- });
46
- return true;
47
- }
48
- if ("kind" in position) {
49
- if (position.kind === "header-cell") {
50
- grid.api.scrollIntoView({ column: position.colIndex });
51
- const run = () => {
52
- const header = getHeaderRows(vp);
53
- if (!header)
54
- return false;
55
- for (const row of header) {
56
- const cell = row.querySelector(`[data-ln-header-cell][data-ln-colindex="${position.colIndex}"]`);
57
- if (!cell)
58
- continue;
59
- if (isColumnFloatingHeader(cell))
60
- continue;
61
- cell.focus();
62
- return true;
63
- }
64
- return false;
65
- };
66
- if (!run()) {
67
- setTimeout(() => {
68
- if (!run()) {
69
- setTimeout(() => run(), 20);
70
- }
71
- }, 8);
72
- }
73
- return true;
74
- }
75
- else if (position.kind === "header-group-cell") {
76
- grid.api.scrollIntoView({ column: position.colIndex });
77
- const run = () => {
78
- const header = getHeaderRows(vp);
79
- if (!header)
80
- return false;
81
- const row = header[position.hierarchyRowIndex];
82
- if (!row)
83
- return false;
84
- const headers = Array.from(row.querySelectorAll("[data-ln-header-range]"));
85
- const match = headers.find((c) => {
86
- const [colStartStr, colEndStr] = c.getAttribute("data-ln-header-range").split(",");
87
- const colStart = Number.parseInt(colStartStr);
88
- const colEnd = Number.parseInt(colEndStr);
89
- return colStart <= position.colIndex && position.colIndex < colEnd;
90
- });
91
- if (match) {
92
- match.focus();
93
- grid.internal.focusActive.set((prev) => ({ ...prev, colIndex }));
94
- return true;
95
- }
96
- return false;
97
- };
98
- if (!run()) {
99
- setTimeout(() => {
100
- if (!run()) {
101
- setTimeout(() => run(), 20);
102
- }
103
- }, 8);
104
- }
105
- return true;
106
- }
107
- else {
108
- return false;
109
- }
110
- }
111
- const columnCount = grid.state.columnMeta.get().columnsVisible.length - 1;
112
- const colIndex = clamp(0, typeof position.column === "number" ? position.column : grid.api.columnIndex(position.column), columnCount);
113
- focusCell({
114
- colIndex,
115
- rowIndex: position.row,
116
- focusActive: grid.internal.focusActive,
117
- id: grid.state.gridId.get(),
118
- getRootCell: grid.api.cellRoot,
119
- scrollIntoView: grid.api.scrollIntoView,
120
- vp,
121
- });
122
- return false;
123
- };
124
- };