@xh/hoist 75.0.0-SNAPSHOT.1754347635253 → 75.0.0-SNAPSHOT.1754662698635

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.
@@ -397,7 +397,7 @@ export declare class GridModel extends HoistModel {
397
397
  *
398
398
  * Note that this getter will *not* change if just the data of selected record is changed
399
399
  * due to store loading or editing. Applications also interested in the contents of the
400
- * of the selection should use the {@link selectedRecord} getter instead.
400
+ * selection should use the {@link selectedRecord} getter instead.
401
401
  */
402
402
  get selectedId(): StoreRecordId;
403
403
  /** True if this grid has no records to show in its store. */
@@ -898,7 +898,7 @@ export class GridModel extends HoistModel {
898
898
  *
899
899
  * Note that this getter will *not* change if just the data of selected record is changed
900
900
  * due to store loading or editing. Applications also interested in the contents of the
901
- * of the selection should use the {@link selectedRecord} getter instead.
901
+ * selection should use the {@link selectedRecord} getter instead.
902
902
  */
903
903
  get selectedId(): StoreRecordId {
904
904
  return this.selModel.selectedId;
@@ -1038,25 +1038,24 @@ export class GridModel extends HoistModel {
1038
1038
  this.expandLevel = level;
1039
1039
 
1040
1040
  // 0) Not rendered, we are done.
1041
- const {agApi} = this;
1041
+ const {agApi, store} = this;
1042
1042
  if (!agApi) return;
1043
1043
 
1044
1044
  // 1) Update rendered grid.
1045
- if (agApi.getGridOption('groupDefaultExpanded') != level) {
1046
- // If the ag default is *not* set to this level just set it. This somewhat
1047
- // mysteriously (but efficiently) changes the currently rendered rows as well.
1048
- agApi.setGridOption('groupDefaultExpanded', level);
1049
- } else if (level == 0 || level >= this.maxDepth) {
1050
- // otherwise api methods available.
1045
+ agApi.setGridOption('groupDefaultExpanded', level);
1046
+ if (level == 0 || level >= this.maxDepth) {
1051
1047
  level == 0 ? agApi.collapseAll() : agApi.expandAll();
1052
1048
  } else {
1053
- // Otherwise, *toggle* the default.
1054
- // Surprisingly, this appears to be the only efficient way to do the bulk operation.
1055
- agApi.setGridOption('groupDefaultExpanded', 0);
1056
- agApi.setGridOption('groupDefaultExpanded', level);
1049
+ // Update raw nodes for efficiency
1050
+ // This approach documented in agGrids onGroupExpandedOrCollapsed() docs (2025)
1051
+ store.records.forEach(rec => {
1052
+ const node = agApi.getRowNode(rec.agId);
1053
+ if (node) {
1054
+ node.expanded = rec.depth < level;
1055
+ }
1056
+ });
1057
+ agApi.onGroupExpandedOrCollapsed();
1057
1058
  }
1058
-
1059
- // 2) Finally, be sure to update our state snapshot.
1060
1059
  this.noteAgExpandStateChange();
1061
1060
  }
1062
1061
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@xh/hoist",
3
- "version": "75.0.0-SNAPSHOT.1754347635253",
3
+ "version": "75.0.0-SNAPSHOT.1754662698635",
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",
@@ -95,27 +95,25 @@ export class IdentityService extends HoistService {
95
95
  !this.canAuthUserImpersonate,
96
96
  'User does not have right to impersonate or impersonation is disabled.'
97
97
  );
98
- return XH.fetchJson({
98
+ await XH.prefService.pushPendingAsync();
99
+ await XH.fetchJson({
99
100
  url: 'xh/impersonate',
100
101
  params: {
101
102
  username: username
102
103
  }
103
- }).then(() => {
104
- XH.reloadApp();
105
104
  });
105
+ XH.reloadApp();
106
106
  }
107
107
 
108
108
  /** Exit any active impersonation, reloading the app to resume accessing it as yourself. */
109
109
  async endImpersonateAsync() {
110
- return XH.fetchJson({
111
- url: 'xh/endImpersonate'
112
- })
113
- .then(() => {
114
- XH.reloadApp();
115
- })
116
- .catchDefault({
117
- message: 'Failed to end impersonation'
118
- });
110
+ try {
111
+ await XH.prefService.pushPendingAsync();
112
+ await XH.fetchJson({url: 'xh/endImpersonate'});
113
+ XH.reloadApp();
114
+ } catch (e) {
115
+ XH.handleException(e, {message: 'Failed to end impersonation'});
116
+ }
119
117
  }
120
118
 
121
119
  //------------------------