@1771technologies/lytenyte-pro 1.0.0-beta.26 → 1.0.0-beta.28
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 +6 -1
- package/dist/cells/cell-editor.js +4 -4
- package/dist/header/use-drag-move.js +1 -1
- package/dist/state/api/column-from-index.d.ts +1 -1
- package/dist/state/api/column-from-index.js +1 -1
- package/dist/state/api/edit-end.js +1 -1
- package/dist/state/helpers/edit-on-change.js +1 -0
- package/dist/state/use-lytenyte.js +2 -2
- package/dist/viewport/begin-editing.js +1 -1
- package/package.json +7 -7
package/dist/+types.d.ts
CHANGED
|
@@ -2710,7 +2710,7 @@ export interface GridApi<T> {
|
|
|
2710
2710
|
* Returns the column at the specified visible index. If the index is out of bounds or
|
|
2711
2711
|
* the column is hidden (due to visibility rules or collapsed groups), this will return null.
|
|
2712
2712
|
*/
|
|
2713
|
-
readonly
|
|
2713
|
+
readonly columnByIndex: (columnIndex: number) => Column<T> | null;
|
|
2714
2714
|
/**
|
|
2715
2715
|
* Returns the index of a visible column based on its id or column object.
|
|
2716
2716
|
* Returns -1 if the column is not currently visible (e.g., hidden or inside a collapsed group).
|
|
@@ -4217,6 +4217,11 @@ export interface EditSetterParams<T> {
|
|
|
4217
4217
|
* A reference to a column definition in LyteNyte Grid.
|
|
4218
4218
|
*/
|
|
4219
4219
|
readonly column: Column<T>;
|
|
4220
|
+
/**
|
|
4221
|
+
* The current edit value of the cell being edited. Useful when the cell is derived from data and not
|
|
4222
|
+
* actually present in the row data.
|
|
4223
|
+
*/
|
|
4224
|
+
readonly value: any;
|
|
4220
4225
|
/**
|
|
4221
4226
|
* The new row data after applying edits. This is an intermediate representation,
|
|
4222
4227
|
* not yet committed to the grid.
|
|
@@ -81,12 +81,12 @@ function EditRenderer({ cell }) {
|
|
|
81
81
|
if (!editRenderer) {
|
|
82
82
|
const type = column.type;
|
|
83
83
|
if (type === "number")
|
|
84
|
-
return (_jsx("input", { type: "number", value: value, onChange: (e) => onChange(Number.parseFloat(e.target.value)) }));
|
|
84
|
+
return (_jsx("input", { type: "number", value: value ?? "", onChange: (e) => onChange(Number.parseFloat(e.target.value)) }));
|
|
85
85
|
if (type === "date")
|
|
86
|
-
return _jsx("input", { type: "date", value: value, onChange: (e) => onChange(e.target.value) });
|
|
86
|
+
return _jsx("input", { type: "date", value: value ?? "", onChange: (e) => onChange(e.target.value) });
|
|
87
87
|
if (type === "datetime")
|
|
88
|
-
return (_jsx("input", { type: "datetime-local", value: value, onChange: (e) => onChange(e.target.value) }));
|
|
89
|
-
return _jsx("input", { value: value, onChange: (e) => onChange(e.target.value) });
|
|
88
|
+
return (_jsx("input", { type: "datetime-local", value: value ?? "", onChange: (e) => onChange(e.target.value) }));
|
|
89
|
+
return _jsx("input", { value: value ?? "", onChange: (e) => onChange(e.target.value) });
|
|
90
90
|
}
|
|
91
91
|
const Renderer = typeof editRenderer === "string" ? editFuncs[editRenderer] : editRenderer;
|
|
92
92
|
const validation = ctx.grid.internal.editValidation.useValue();
|
|
@@ -55,7 +55,7 @@ export function useDragMove(grid, cell, onDragStart) {
|
|
|
55
55
|
});
|
|
56
56
|
if (index == null)
|
|
57
57
|
return;
|
|
58
|
-
const columnTarget = grid.api.
|
|
58
|
+
const columnTarget = grid.api.columnByIndex(index);
|
|
59
59
|
if (columnTarget) {
|
|
60
60
|
if (columnTarget.id === COLUMN_MARKER_ID || columnTarget.id.startsWith(GROUP_COLUMN_PREFIX))
|
|
61
61
|
return;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import type { Grid, GridApi } from "../../+types";
|
|
2
|
-
export declare const
|
|
2
|
+
export declare const makeColumnByIndex: (grid: Grid<any>) => GridApi<any>["columnByIndex"];
|
|
@@ -11,7 +11,7 @@ export const makeEditEnd = (grid) => {
|
|
|
11
11
|
return;
|
|
12
12
|
}
|
|
13
13
|
const validation = grid.internal.editValidation.get();
|
|
14
|
-
if (!validation || Object.keys(validation).length
|
|
14
|
+
if (!validation || Object.keys(validation).length >= 1) {
|
|
15
15
|
grid.api.eventFire("editError", {
|
|
16
16
|
column: active.column,
|
|
17
17
|
rowIndex: active.rowIndex,
|
|
@@ -14,7 +14,7 @@ import { makeSortForColumn } from "./api/sort-for-column.js";
|
|
|
14
14
|
import { columnAddRowGroup } from "./helpers/column-add-row-group.js";
|
|
15
15
|
import { makeEventListeners } from "./api/event-listeners.js";
|
|
16
16
|
import { makeScrollIntoView } from "./api/scroll-into-view.js";
|
|
17
|
-
import {
|
|
17
|
+
import { makeColumnByIndex } from "./api/column-from-index.js";
|
|
18
18
|
import { makeColumnIndex } from "./api/column-index.js";
|
|
19
19
|
import { makeRowGroupColumnIndex } from "./api/row-group-column-index.js";
|
|
20
20
|
import { makeRowGroupIsExpanded } from "./api/row-group-is-expanded.js";
|
|
@@ -484,7 +484,7 @@ export function makeLyteNyte(p) {
|
|
|
484
484
|
const listeners = makeEventListeners();
|
|
485
485
|
Object.assign(api, {
|
|
486
486
|
columnField: makeColumnField(grid),
|
|
487
|
-
|
|
487
|
+
columnByIndex: makeColumnByIndex(grid),
|
|
488
488
|
columnIndex: makeColumnIndex(grid),
|
|
489
489
|
columnById: makeColumnById(grid),
|
|
490
490
|
columnResize: makeColumnResize(grid),
|
|
@@ -6,7 +6,7 @@ export function beginEditing(grid, activator, init) {
|
|
|
6
6
|
return;
|
|
7
7
|
if (activator && editActivator !== activator)
|
|
8
8
|
return;
|
|
9
|
-
const column = grid.api.
|
|
9
|
+
const column = grid.api.columnByIndex(focusPos.colIndex);
|
|
10
10
|
if (!column)
|
|
11
11
|
return;
|
|
12
12
|
if (grid.api.editIsCellActive({ column, rowIndex: focusPos.rowIndex }))
|
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.28",
|
|
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-core": "1.0.0-beta.
|
|
53
|
-
"@1771technologies/lytenyte-
|
|
54
|
-
"@1771technologies/lytenyte-
|
|
55
|
-
"@1771technologies/lytenyte-
|
|
56
|
-
"@1771technologies/lytenyte-
|
|
57
|
-
"@1771technologies/lytenyte-
|
|
52
|
+
"@1771technologies/lytenyte-core": "1.0.0-beta.28",
|
|
53
|
+
"@1771technologies/lytenyte-dragon": "1.0.0-beta.28",
|
|
54
|
+
"@1771technologies/lytenyte-shared": "1.0.0-beta.28",
|
|
55
|
+
"@1771technologies/lytenyte-dom-utils": "1.0.0-beta.28",
|
|
56
|
+
"@1771technologies/lytenyte-js-utils": "1.0.0-beta.28",
|
|
57
|
+
"@1771technologies/lytenyte-react-hooks": "1.0.0-beta.28"
|
|
58
58
|
},
|
|
59
59
|
"peerDependencies": {
|
|
60
60
|
"react": "^18.0.0 || ^19.0.0",
|