@platforma-sdk/ui-vue 1.30.24 → 1.30.25

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.30.24",
3
+ "version": "1.30.25",
4
4
  "type": "module",
5
5
  "main": "dist/lib.umd.cjs",
6
6
  "module": "dist/lib.js",
@@ -1,3 +1,4 @@
1
+ import type { AgGridEvent, AgPublicEventType } from 'ag-grid-enterprise';
1
2
  import { isColumnSelectionCol, type ColDef, type GridApi, type ValueGetterParams } from 'ag-grid-enterprise';
2
3
  import { nextTick } from 'vue';
3
4
  import { PlAgRowNumCheckbox } from '../../PlAgRowNumCheckbox';
@@ -110,6 +111,7 @@ function fixColumnOrder(gridApi: GridApi) {
110
111
 
111
112
  export function autoSizeRowNumberColumn(gridApi: GridApi) {
112
113
  const cellFake = createCellFake();
114
+
113
115
  gridApi.addEventListener('firstDataRendered', (event) => {
114
116
  adjustRowNumberColumnWidth(event.api, cellFake);
115
117
  });
@@ -130,12 +132,11 @@ export function autoSizeRowNumberColumn(gridApi: GridApi) {
130
132
  adjustRowNumberColumnWidth(event.api, cellFake, true);
131
133
  }
132
134
  });
133
- gridApi.addEventListener('sortChanged', (event) => {
134
- event.api.refreshCells();
135
- });
136
- gridApi.addEventListener('filterChanged', (event) => {
137
- event.api.refreshCells();
138
- });
135
+
136
+ const refreshCells = (event: AgGridEvent) => event.api.refreshCells();
137
+ const refreshCellsOn: AgPublicEventType[] = ['sortChanged', 'filterChanged', 'modelUpdated'];
138
+ refreshCellsOn.forEach((eventType) => gridApi.addEventListener(eventType, refreshCells));
139
+
139
140
  gridApi.addEventListener('displayedColumnsChanged', (event) => {
140
141
  fixColumnOrder(event.api);
141
142
  });
@@ -72,7 +72,7 @@ export async function updatePFrameGridOptions(
72
72
  const specs = model.tableSpec;
73
73
  type SpecId = string;
74
74
  const specId = (spec: PTableColumnSpec): SpecId =>
75
- spec.type === 'axis' ? canonicalize(spec.spec)! : spec.id;
75
+ spec.type === 'axis' ? canonicalize(getAxisId(spec.spec))! : spec.id;
76
76
  const dataSpecs = await pfDriver.getSpec(pt);
77
77
  const dataSpecsMap = new Map<SpecId, number>();
78
78
  dataSpecs.forEach((spec, i) => {
@@ -81,6 +81,8 @@ export async function updatePFrameGridOptions(
81
81
  const specsToDataSpecsMapping = new Map<number, number>();
82
82
  specs.forEach((spec, i) => {
83
83
  const dataSpecIdx = dataSpecsMap.get(specId(spec));
84
+ if (dataSpecIdx === undefined && spec.type === 'axis')
85
+ throw new Error(`axis ${JSON.stringify(spec.spec)} not present in join result`);
84
86
  specsToDataSpecsMapping.set(i, dataSpecIdx ?? -1);
85
87
  });
86
88