@platforma-sdk/ui-vue 1.20.7 → 1.20.10

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.20.7",
3
+ "version": "1.20.10",
4
4
  "type": "module",
5
5
  "main": "dist/lib.umd.cjs",
6
6
  "module": "dist/lib.js",
@@ -37,8 +37,8 @@
37
37
  "@ag-grid-community/theming": "^32.3.3",
38
38
  "@ag-grid-enterprise/side-bar": "^32.3.3",
39
39
  "@ag-grid-enterprise/column-tool-panel": "^32.3.3",
40
- "@milaboratories/uikit": "^2.2.34",
41
- "@platforma-sdk/model": "^1.20.6"
40
+ "@platforma-sdk/model": "^1.20.6",
41
+ "@milaboratories/uikit": "^2.2.34"
42
42
  },
43
43
  "devDependencies": {
44
44
  "@faker-js/faker": "^9.2.0",
@@ -58,8 +58,8 @@
58
58
  "yarpm": "^1.2.0",
59
59
  "semver": "^7.6.3",
60
60
  "@types/semver": "^7.5.8",
61
- "@milaboratories/helpers": "^1.6.10",
62
- "@milaboratories/eslint-config": "^1.0.0"
61
+ "@milaboratories/eslint-config": "^1.0.0",
62
+ "@milaboratories/helpers": "^1.6.11"
63
63
  },
64
64
  "scripts": {
65
65
  "test": "vitest run --passWithNoTests",
@@ -40,6 +40,7 @@ import { PlAgGridColumnManager } from '../PlAgGridColumnManager';
40
40
  import { autoSizeRowNumberColumn, PlAgDataTableRowNumberColId } from './sources/row-number';
41
41
  import { focusRow, makeOnceTracker, trackFirstDataRendered } from './sources/focus-row';
42
42
  import PlAgCsvExporter from '../PlAgCsvExporter/PlAgCsvExporter.vue';
43
+ import { isJsonEqual } from '@milaboratories/helpers';
43
44
 
44
45
  ModuleRegistry.registerModules([
45
46
  ClientSideRowModelModule,
@@ -113,11 +114,17 @@ const gridState = computed({
113
114
  = settings.value?.sourceType !== 'ptable' || gridOptions.value.rowModelType === 'clientSide' ? undefined : makeSorting(gridState.sort);
114
115
 
115
116
  const oldState = tableState.value;
116
- tableState.value = {
117
+
118
+ const newState = {
117
119
  ...oldState,
118
120
  gridState: { ...oldState.gridState, ...gridState },
119
121
  pTableParams: { ...oldState.pTableParams, sorting },
120
122
  };
123
+
124
+ // Note: the table constantly emits an unchanged state, so I added this
125
+ if (!isJsonEqual(oldState, newState)) {
126
+ tableState.value = newState;
127
+ }
121
128
  },
122
129
  });
123
130
 
@@ -1,7 +1,15 @@
1
- import type { ColDef, ICellRendererParams, IServerSideDatasource, IServerSideGetRowsParams, RowModelType } from '@ag-grid-community/core';
1
+ import type {
2
+ ColDef,
3
+ ICellRendererParams,
4
+ IServerSideDatasource,
5
+ IServerSideGetRowsParams,
6
+ RowModelType,
7
+ ValueFormatterParams,
8
+ } from '@ag-grid-community/core';
2
9
  import {
3
10
  getAxisId,
4
11
  pTableValue,
12
+ isPTableAbsent,
5
13
  type AxisId,
6
14
  type PColumnSpec,
7
15
  type PFrameDriver,
@@ -33,15 +41,13 @@ export function parseColId(str: string) {
33
41
  return JSON.parse(str) as PTableColumnSpec;
34
42
  }
35
43
 
36
- // do not use `any` please
37
- // eslint-disable-next-line @typescript-eslint/no-explicit-any
38
- export const defaultValueFormatter = (value: any) => {
39
- if (!value) {
40
- return 'ERROR';
41
- } else if (value.value === undefined) {
42
- return 'NULL';
44
+ export const defaultValueFormatter = (value: ValueFormatterParams<PlAgDataTableRow, PTableValue>) => {
45
+ if (value.value === undefined) {
46
+ return 'undefined';
47
+ } else if (isPTableAbsent(value.value)) {
48
+ return ''; // 'NULL';
43
49
  } else if (value.value === null) {
44
- return 'NA';
50
+ return ''; // 'NA';
45
51
  } else {
46
52
  return value.value.toString();
47
53
  }
@@ -292,7 +298,7 @@ export async function updatePFrameGridOptions(
292
298
  lastParams = params;
293
299
 
294
300
  let length = 0;
295
- let rowData: unknown[] = [];
301
+ let rowData: PlAgDataTableRow[] = [];
296
302
  if (rowCount > 0 && params.request.startRow !== undefined && params.request.endRow !== undefined) {
297
303
  length = Math.min(rowCount, params.request.endRow) - params.request.startRow;
298
304
  if (length > 0) {
@@ -1,4 +1,4 @@
1
- import { deepClone, throttle } from '@milaboratories/helpers';
1
+ import { deepClone, isJsonEqual, throttle } from '@milaboratories/helpers';
2
2
  import type { Mutable } from '@milaboratories/helpers';
3
3
  import type { NavigationState, BlockOutputsBase, BlockState, Platforma } from '@platforma-sdk/model';
4
4
  import { reactive, nextTick, computed, watch } from 'vue';
@@ -242,7 +242,9 @@ export function createApp<
242
242
  },
243
243
  autoSave: true,
244
244
  onSave(newData: AppModel) {
245
- setBlockArgsAndUiState(newData.args, newData.ui);
245
+ if (!isJsonEqual(newData.args, snapshot.args) || !isJsonEqual(newData.ui, snapshot.ui)) {
246
+ setBlockArgsAndUiState(newData.args, newData.ui);
247
+ }
246
248
  },
247
249
  },
248
250
  {
package/vite.config.ts CHANGED
@@ -7,6 +7,7 @@ export default defineConfig({
7
7
  plugins: [vue()],
8
8
  build: {
9
9
  emptyOutDir: false,
10
+ sourcemap: true,
10
11
  lib: {
11
12
  // Could also be a dictionary or array of multiple entry points
12
13
  entry: [resolve(__dirname, 'src/lib.ts')],