@platforma-sdk/ui-vue 1.7.22 → 1.7.26

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@platforma-sdk/ui-vue",
3
- "version": "1.7.22",
3
+ "version": "1.7.26",
4
4
  "type": "module",
5
5
  "main": "dist/lib.umd.cjs",
6
6
  "module": "dist/lib.js",
@@ -34,8 +34,8 @@
34
34
  "@ag-grid-enterprise/rich-select": "^32.3.0",
35
35
  "@ag-grid-enterprise/menu": "^32.3.0",
36
36
  "@ag-grid-enterprise/excel-export": "^32.3.0",
37
- "@platforma-sdk/model": "^1.7.20",
38
- "@milaboratories/uikit": "^1.2.28"
37
+ "@milaboratories/uikit": "^1.2.29",
38
+ "@platforma-sdk/model": "^1.7.20"
39
39
  },
40
40
  "devDependencies": {
41
41
  "@faker-js/faker": "^8.4.1",
@@ -238,9 +238,11 @@ const gridOptions = ref<GridOptions>({
238
238
  onRowDataUpdated: (event) => {
239
239
  event.api.autoSizeAllColumns();
240
240
  },
241
+ maintainColumnOrder: true,
241
242
  rowModelType: 'clientSide',
242
- maxBlocksInCache: 10000,
243
+ maxBlocksInCache: 1000,
243
244
  cacheBlockSize: 100,
245
+ blockLoadDebounceMillis: 500,
244
246
  serverSideSortAllLevels: true,
245
247
  suppressServerSideFullWidthLoadingRow: true,
246
248
  getRowId: (params) => params.data.id,
@@ -308,14 +310,6 @@ watch(
308
310
  };
309
311
  if (lodash.isEqual(gridState, selfState)) return;
310
312
 
311
- console.log(
312
- 'reloading; columnOrder changed',
313
- !lodash.isEqual(gridState.columnOrder, selfState.columnOrder),
314
- 'saved',
315
- gridState.columnOrder,
316
- 'current',
317
- selfState.columnOrder,
318
- );
319
313
  gridOptions.value.initialState = gridState;
320
314
  ++reloadKey.value;
321
315
  },
@@ -333,6 +327,10 @@ const onSheetChanged = (sheetId: string, newValue: string | number) => {
333
327
  if (state[sheetId] === newValue) return;
334
328
  state[sheetId] = newValue;
335
329
  sheetsState.value = state;
330
+ gridApi.value?.updateGridOptions({
331
+ loading: true,
332
+ loadingOverlayComponentParams: { notReady: false },
333
+ });
336
334
  };
337
335
 
338
336
  watch(
@@ -236,13 +236,11 @@ export async function makeSheets(
236
236
  * @param nRows number of rows
237
237
  * @returns
238
238
  */
239
- function columns2rows(fields: number[], columns: PTableVector[]): unknown[] {
239
+ function columns2rows(fields: number[], columns: PTableVector[], index: number): unknown[] {
240
240
  const nCols = columns.length;
241
241
  const rowData = [];
242
242
  for (let iRow = 0; iRow < columns[0].data.length; ++iRow) {
243
243
  const row: Record<string, unknown> = {};
244
-
245
- const index = [];
246
244
  for (let iCol = 0; iCol < nCols; ++iCol) {
247
245
  const field = fields[iCol].toString();
248
246
  const value = columns[iCol].data[iRow];
@@ -254,16 +252,10 @@ function columns2rows(fields: number[], columns: PTableVector[]): unknown[] {
254
252
  } else {
255
253
  row[field] = toDisplayValue(value, valueType);
256
254
  }
257
-
258
- index.push(valueType === 'Long' ? Number(value) : value);
259
255
  }
260
-
261
- // generate ID based on the axes information
262
- row['id'] = iRow.toString();
263
-
256
+ row['id'] = (index++).toString();
264
257
  rowData.push(row);
265
258
  }
266
-
267
259
  return rowData;
268
260
  }
269
261
 
@@ -357,7 +349,7 @@ export async function updatePFrameGridOptions(
357
349
  offset: params.request.startRow,
358
350
  length,
359
351
  });
360
- rowData = columns2rows(fields, data);
352
+ rowData = columns2rows(fields, data, params.request.startRow);
361
353
  }
362
354
  }
363
355