@1771technologies/lytenyte-pro 1.0.0-beta.23 → 1.0.0-beta.24

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 CHANGED
@@ -2874,7 +2874,7 @@ export interface GridApi<T> {
2874
2874
  * Returns the raw cell data within a rectangular selection of the grid.
2875
2875
  * This can be useful for custom data processing or exporting workflows.
2876
2876
  */
2877
- readonly exportDataRect: (params?: ExportDataRectParams) => ExportDataRectResult<T>;
2877
+ readonly exportDataRect: (params?: ExportDataRectParams) => Promise<ExportDataRectResult<T>>;
2878
2878
  /**
2879
2879
  * Exports the cell data for a given rectangle of the grid as a CSV-formatted string.
2880
2880
  * The rectangle can be customized through parameters such as selected rows, columns, or cell ranges.
@@ -4844,7 +4844,7 @@ export type ExportDataRectFn<T> = (
4844
4844
  /**
4845
4845
  * Optional parameters for exporting a DataRect.
4846
4846
  */
4847
- params: ExportDataRectParams) => ExportDataRectResult<T>;
4847
+ params: ExportDataRectParams) => Promise<ExportDataRectResult<T>>;
4848
4848
  /**
4849
4849
  * Parameters for exporting a specific rectangular region of the grid using a DataRect.
4850
4850
  */
@@ -210,14 +210,27 @@ export function makeClientDataSourcePaginated(p) {
210
210
  const currentPage = rdsStore.get(pageInternal);
211
211
  const center = clamp(0, rowCount - currentPage * perPage, perPage);
212
212
  store.rowCenterCount.set(center);
213
- cleanup.push(rdsStore.sub(flatLength, () => {
214
- grid.state.rowDataStore.rowClearCache();
213
+ const updateCounts = () => {
215
214
  const rowCount = rdsStore.get(flatLength);
216
215
  const perPage = rdsStore.get(rowsPerPage);
217
216
  const currentPage = rdsStore.get(pageInternal);
218
217
  const center = clamp(0, rowCount - currentPage * perPage, perPage);
218
+ // Move to the last page if we are past the boundary
219
+ if (center === 0 && currentPage !== 0) {
220
+ const currentPage = rdsStore.get(pageCount) - 1;
221
+ rdsStore.set(page, currentPage);
222
+ rdsStore.set(snapshot, (prev) => prev + 1);
223
+ const center = clamp(0, rowCount - currentPage * perPage, perPage);
224
+ store.rowCenterCount.set(center);
225
+ grid.state.rowDataStore.rowClearCache();
226
+ return;
227
+ }
219
228
  store.rowCenterCount.set(center);
220
- }));
229
+ grid.state.rowDataStore.rowClearCache();
230
+ };
231
+ cleanup.push(rdsStore.sub(flatLength, updateCounts));
232
+ cleanup.push(rdsStore.sub(page, updateCounts));
233
+ cleanup.push(rdsStore.sub(rowsPerPage, updateCounts));
221
234
  cleanup.push(rdsStore.sub(pageInternal, () => {
222
235
  grid.state.rowDataStore.rowClearCache();
223
236
  }));
@@ -1,6 +1,6 @@
1
1
  import { getDataRect } from "../helpers/get-data-rect.js";
2
2
  export const makeExportDataRect = (grid) => {
3
- return (p) => {
3
+ return async (p) => {
4
4
  const s = grid.state;
5
5
  const rowCount = s.rowDataStore.rowCount.get();
6
6
  const visible = s.columnMeta.get().columnsVisible;
@@ -323,12 +323,13 @@ export function makeLyteNyte(p) {
323
323
  .map((x) => rds.rowToIndex(x))
324
324
  .filter((x) => x != null)
325
325
  .map((x) => [x, api.rowByIndex(x)]));
326
+ const headerHeight = g(headerHeightTotal);
326
327
  return computeRowPositions(rowCount, g(rowHeight), g(rowAutoHeightGuess), g(internal_rowAutoHeightCache), (i) => {
327
328
  const row = rows[i];
328
329
  if (!row || !api.rowDetailIsExpanded(row))
329
330
  return 0;
330
331
  return api.rowDetailRenderedHeight(row);
331
- }, innerHeight);
332
+ }, innerHeight - headerHeight);
332
333
  });
333
334
  const heightTotal = atom((g) => g(yPositions).at(-1));
334
335
  let prevLayout = DEFAULT_PREVIOUS_LAYOUT;
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.23",
4
+ "version": "1.0.0-beta.24",
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.23",
53
- "@1771technologies/lytenyte-dragon": "1.0.0-beta.23",
54
- "@1771technologies/lytenyte-shared": "1.0.0-beta.23",
55
- "@1771technologies/lytenyte-dom-utils": "1.0.0-beta.23",
56
- "@1771technologies/lytenyte-js-utils": "1.0.0-beta.23",
57
- "@1771technologies/lytenyte-react-hooks": "1.0.0-beta.23"
52
+ "@1771technologies/lytenyte-shared": "1.0.0-beta.24",
53
+ "@1771technologies/lytenyte-dom-utils": "1.0.0-beta.24",
54
+ "@1771technologies/lytenyte-js-utils": "1.0.0-beta.24",
55
+ "@1771technologies/lytenyte-core": "1.0.0-beta.24",
56
+ "@1771technologies/lytenyte-dragon": "1.0.0-beta.24",
57
+ "@1771technologies/lytenyte-react-hooks": "1.0.0-beta.24"
58
58
  },
59
59
  "peerDependencies": {
60
60
  "react": "^18.0.0 || ^19.0.0",