@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/CHANGELOG.md +13 -0
- package/dist/lib.js +6091 -6063
- package/dist/lib.js.map +1 -0
- package/dist/lib.umd.cjs +23 -22
- package/dist/lib.umd.cjs.map +1 -0
- package/dist/src/components/PlAgDataTable/PlAgDataTable.vue.d.ts.map +1 -1
- package/dist/src/components/PlAgDataTable/sources/table-source.d.ts +3 -2
- package/dist/src/components/PlAgDataTable/sources/table-source.d.ts.map +1 -1
- package/dist/src/internal/createApp.d.ts.map +1 -1
- package/dist/style.css +1 -1
- package/dist/tsconfig.lib.tsbuildinfo +1 -1
- package/package.json +5 -5
- package/src/components/PlAgDataTable/PlAgDataTable.vue +8 -1
- package/src/components/PlAgDataTable/sources/table-source.ts +16 -10
- package/src/internal/createApp.ts +4 -2
- package/vite.config.ts +1 -0
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@platforma-sdk/ui-vue",
|
|
3
|
-
"version": "1.20.
|
|
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
|
-
"@
|
|
41
|
-
"@
|
|
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/
|
|
62
|
-
"@milaboratories/
|
|
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
|
-
|
|
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 {
|
|
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
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
if (
|
|
40
|
-
return '
|
|
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:
|
|
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
|
-
|
|
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
|
{
|