@xh/hoist 79.0.0-SNAPSHOT.1764976082522 → 79.0.0-SNAPSHOT.1765206353828
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 +6 -0
- package/build/types/cmp/grid/GridModel.d.ts +3 -1
- package/cmp/grid/GridModel.ts +28 -17
- package/desktop/cmp/grid/impl/colchooser/ColChooserModel.ts +1 -1
- package/mobile/cmp/grid/impl/ColChooserModel.ts +1 -1
- package/package.json +1 -1
- package/svc/GridAutosizeService.ts +2 -2
- package/tsconfig.tsbuildinfo +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,12 @@
|
|
|
2
2
|
|
|
3
3
|
## 79.0.0-SNAPSHOT - unreleased
|
|
4
4
|
|
|
5
|
+
### 💥 Breaking Changes
|
|
6
|
+
|
|
7
|
+
* Renamed `GridModel.applyColumnStateChanges()` to `updateColumnState()` for clarity and better
|
|
8
|
+
symmetry with `setColumnState()`. The prior method remains as an alias but is now deprecated and
|
|
9
|
+
scheduled for removal in v82.
|
|
10
|
+
|
|
5
11
|
### 🐞 Bug Fixes
|
|
6
12
|
|
|
7
13
|
* Defaulted Highcharts font to Hoist default (--xh-font-family)
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { CellClickedEvent, CellContextMenuEvent, CellDoubleClickedEvent, CellEditingStartedEvent, CellEditingStoppedEvent, AgColumnState, RowClickedEvent, RowDoubleClickedEvent } from '@xh/hoist/kit/ag-grid';
|
|
2
1
|
import { AgGridModel } from '@xh/hoist/cmp/ag-grid';
|
|
3
2
|
import { Column, ColumnGroup, ColumnGroupSpec, ColumnSpec, GridAutosizeMode, GridFilterModelConfig, GridGroupSortFn, TreeStyle } from '@xh/hoist/cmp/grid';
|
|
4
3
|
import { GridFilterModel } from '@xh/hoist/cmp/grid/filter/GridFilterModel';
|
|
5
4
|
import { Awaitable, HoistModel, HSide, PlainObject, SizingMode, Some, TaskObserver, Thunkable, VSide } from '@xh/hoist/core';
|
|
6
5
|
import { Store, StoreConfig, StoreRecord, StoreRecordId, StoreRecordOrId, StoreSelectionConfig, StoreSelectionModel, StoreTransaction } from '@xh/hoist/data';
|
|
6
|
+
import { AgColumnState, CellClickedEvent, CellContextMenuEvent, CellDoubleClickedEvent, CellEditingStartedEvent, CellEditingStoppedEvent, RowClickedEvent, RowDoubleClickedEvent } from '@xh/hoist/kit/ag-grid';
|
|
7
7
|
import { ExportOptions } from '@xh/hoist/svc/GridExportService';
|
|
8
8
|
import { ReactNode, RefObject } from 'react';
|
|
9
9
|
import { GridAutosizeOptions } from './GridAutosizeOptions';
|
|
@@ -483,6 +483,8 @@ export declare class GridModel extends HoistModel {
|
|
|
483
483
|
* @param colStateChanges - changes to apply to the columns. If all leaf
|
|
484
484
|
* columns are represented in these changes then the sort order will be applied as well.
|
|
485
485
|
*/
|
|
486
|
+
updateColumnState(colStateChanges: Partial<ColumnState>[]): void;
|
|
487
|
+
/** @deprecated - use {@link updateColumnState} instead. */
|
|
486
488
|
applyColumnStateChanges(colStateChanges: Partial<ColumnState>[]): void;
|
|
487
489
|
getColumn(colId: string): Column;
|
|
488
490
|
getColumnGroup(groupId: string): ColumnGroup;
|
package/cmp/grid/GridModel.ts
CHANGED
|
@@ -4,17 +4,6 @@
|
|
|
4
4
|
*
|
|
5
5
|
* Copyright © 2025 Extremely Heavy Industries Inc.
|
|
6
6
|
*/
|
|
7
|
-
import {
|
|
8
|
-
CellClickedEvent,
|
|
9
|
-
CellContextMenuEvent,
|
|
10
|
-
CellDoubleClickedEvent,
|
|
11
|
-
CellEditingStartedEvent,
|
|
12
|
-
CellEditingStoppedEvent,
|
|
13
|
-
ColumnEvent,
|
|
14
|
-
AgColumnState,
|
|
15
|
-
RowClickedEvent,
|
|
16
|
-
RowDoubleClickedEvent
|
|
17
|
-
} from '@xh/hoist/kit/ag-grid';
|
|
18
7
|
import {AgGridModel} from '@xh/hoist/cmp/ag-grid';
|
|
19
8
|
import {
|
|
20
9
|
Column,
|
|
@@ -56,15 +45,27 @@ import {
|
|
|
56
45
|
import {ColChooserModel as DesktopColChooserModel} from '@xh/hoist/dynamics/desktop';
|
|
57
46
|
import {ColChooserModel as MobileColChooserModel} from '@xh/hoist/dynamics/mobile';
|
|
58
47
|
import {Icon} from '@xh/hoist/icon';
|
|
48
|
+
import {
|
|
49
|
+
AgColumnState,
|
|
50
|
+
CellClickedEvent,
|
|
51
|
+
CellContextMenuEvent,
|
|
52
|
+
CellDoubleClickedEvent,
|
|
53
|
+
CellEditingStartedEvent,
|
|
54
|
+
CellEditingStoppedEvent,
|
|
55
|
+
ColumnEvent,
|
|
56
|
+
RowClickedEvent,
|
|
57
|
+
RowDoubleClickedEvent
|
|
58
|
+
} from '@xh/hoist/kit/ag-grid';
|
|
59
59
|
import {action, bindable, makeObservable, observable, when} from '@xh/hoist/mobx';
|
|
60
60
|
import {wait, waitFor} from '@xh/hoist/promise';
|
|
61
61
|
import {ExportOptions} from '@xh/hoist/svc/GridExportService';
|
|
62
62
|
import {SECONDS} from '@xh/hoist/utils/datetime';
|
|
63
63
|
import {
|
|
64
|
-
|
|
64
|
+
apiDeprecated,
|
|
65
65
|
deepFreeze,
|
|
66
66
|
executeIfFunction,
|
|
67
67
|
logWithDebug,
|
|
68
|
+
sharePendingPromise,
|
|
68
69
|
throwIf,
|
|
69
70
|
warnIf,
|
|
70
71
|
withDefault
|
|
@@ -1183,7 +1184,7 @@ export class GridModel extends HoistModel {
|
|
|
1183
1184
|
);
|
|
1184
1185
|
|
|
1185
1186
|
pull(colStateChanges, null);
|
|
1186
|
-
this.
|
|
1187
|
+
this.updateColumnState(colStateChanges);
|
|
1187
1188
|
}
|
|
1188
1189
|
|
|
1189
1190
|
@action
|
|
@@ -1214,7 +1215,7 @@ export class GridModel extends HoistModel {
|
|
|
1214
1215
|
const col = this.findColumn(this.columns, colId);
|
|
1215
1216
|
if (!width || !col || col.flex) return;
|
|
1216
1217
|
const colStateChanges = [{colId, width, manuallySized: true}];
|
|
1217
|
-
this.
|
|
1218
|
+
this.updateColumnState(colStateChanges);
|
|
1218
1219
|
}
|
|
1219
1220
|
|
|
1220
1221
|
/**
|
|
@@ -1230,7 +1231,7 @@ export class GridModel extends HoistModel {
|
|
|
1230
1231
|
* columns are represented in these changes then the sort order will be applied as well.
|
|
1231
1232
|
*/
|
|
1232
1233
|
@action
|
|
1233
|
-
|
|
1234
|
+
updateColumnState(colStateChanges: Partial<ColumnState>[]): void {
|
|
1234
1235
|
if (isEmpty(colStateChanges)) return;
|
|
1235
1236
|
|
|
1236
1237
|
let columnState = cloneDeep(this.columnState);
|
|
@@ -1260,6 +1261,16 @@ export class GridModel extends HoistModel {
|
|
|
1260
1261
|
}
|
|
1261
1262
|
}
|
|
1262
1263
|
|
|
1264
|
+
/** @deprecated - use {@link updateColumnState} instead. */
|
|
1265
|
+
applyColumnStateChanges(colStateChanges: Partial<ColumnState>[]): void {
|
|
1266
|
+
apiDeprecated('GridModel.applyColumnStateChanges()', {
|
|
1267
|
+
msg: 'Use updateColumnState() instead.',
|
|
1268
|
+
v: '82',
|
|
1269
|
+
source: GridModel
|
|
1270
|
+
});
|
|
1271
|
+
this.updateColumnState(colStateChanges);
|
|
1272
|
+
}
|
|
1273
|
+
|
|
1263
1274
|
getColumn(colId: string): Column {
|
|
1264
1275
|
return this.findColumn(this.columns, colId);
|
|
1265
1276
|
}
|
|
@@ -1295,7 +1306,7 @@ export class GridModel extends HoistModel {
|
|
|
1295
1306
|
}
|
|
1296
1307
|
|
|
1297
1308
|
setColumnVisible(colId: string, visible: boolean) {
|
|
1298
|
-
this.
|
|
1309
|
+
this.updateColumnState([{colId, hidden: !visible}]);
|
|
1299
1310
|
}
|
|
1300
1311
|
|
|
1301
1312
|
showColumn(colId: string) {
|
|
@@ -1307,7 +1318,7 @@ export class GridModel extends HoistModel {
|
|
|
1307
1318
|
}
|
|
1308
1319
|
|
|
1309
1320
|
setColumnGroupVisible(groupId: string, visible: boolean) {
|
|
1310
|
-
this.
|
|
1321
|
+
this.updateColumnState(
|
|
1311
1322
|
this.getColumnGroup(groupId)
|
|
1312
1323
|
.getLeafColumns()
|
|
1313
1324
|
.map(({colId}) => ({colId, hidden: !visible}))
|
|
@@ -132,7 +132,7 @@ export class ColChooserModel extends HoistModel {
|
|
|
132
132
|
return {colId, hidden, pinned};
|
|
133
133
|
});
|
|
134
134
|
|
|
135
|
-
gridModel.
|
|
135
|
+
gridModel.updateColumnState(colChanges);
|
|
136
136
|
if (autosizeOnCommit) gridModel.autosizeAsync({showMask: true});
|
|
137
137
|
}
|
|
138
138
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@xh/hoist",
|
|
3
|
-
"version": "79.0.0-SNAPSHOT.
|
|
3
|
+
"version": "79.0.0-SNAPSHOT.1765206353828",
|
|
4
4
|
"description": "Hoist add-on for building and deploying React Applications.",
|
|
5
5
|
"repository": "github:xh/hoist-react",
|
|
6
6
|
"homepage": "https://xh.io",
|
|
@@ -79,7 +79,7 @@ export class GridAutosizeService extends HoistService {
|
|
|
79
79
|
|
|
80
80
|
runInAction(() => {
|
|
81
81
|
// Apply calculated widths to grid.
|
|
82
|
-
gridModel.
|
|
82
|
+
gridModel.updateColumnState(requiredWidths);
|
|
83
83
|
this.logDebug(
|
|
84
84
|
`Auto-sized ${requiredWidths.length} columns`,
|
|
85
85
|
`${records.length} records`
|
|
@@ -94,7 +94,7 @@ export class GridAutosizeService extends HoistService {
|
|
|
94
94
|
fillMode,
|
|
95
95
|
asManuallySized
|
|
96
96
|
);
|
|
97
|
-
gridModel.
|
|
97
|
+
gridModel.updateColumnState(fillWidths);
|
|
98
98
|
this.logDebug(`Auto-sized ${fillWidths.length} columns using fillMode`);
|
|
99
99
|
}
|
|
100
100
|
});
|