@xh/hoist 75.0.0-SNAPSHOT.1752891558856 → 75.0.0-SNAPSHOT.1753115287677

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.
@@ -430,7 +430,7 @@ export class ActivityTrackingModel extends HoistModel implements ActivityDetailP
430
430
  emptyText: 'No activity reported...',
431
431
  sortBy: ['cubeLabel'],
432
432
  expandToLevel: 1,
433
- levelLabels: () => ['Total', ...this.groupingChooserModel.getValueDisplayNames()],
433
+ levelLabels: () => ['Total', ...this.groupingChooserModel.valueDisplayNames],
434
434
  columns: [
435
435
  {
436
436
  field: {
@@ -62,6 +62,7 @@ export declare class GroupingChooserModel extends HoistModel {
62
62
  get availableDims(): string[];
63
63
  get dimensionSpecs(): DimensionSpec[];
64
64
  get isValid(): boolean;
65
+ get valueDisplayNames(): string[];
65
66
  get isAddEnabled(): boolean;
66
67
  get isAddFavoriteEnabled(): boolean;
67
68
  constructor({ allowEmpty, commitOnChange, dimensions, initialFavorites, initialValue, maxDepth, persistWith, sortDimensions }: GroupingChooserConfig);
@@ -78,7 +79,6 @@ export declare class GroupingChooserModel extends HoistModel {
78
79
  commitPendingValueAndClose(): void;
79
80
  validateValue(value: string[]): boolean;
80
81
  getValueLabel(value: string[]): string;
81
- getValueDisplayNames(): string[];
82
82
  getDimDisplayName(dimName: string): string;
83
83
  onDragEnd(result: any): void;
84
84
  get favoritesOptions(): {
@@ -773,7 +773,7 @@ export class GridModel extends HoistModel {
773
773
  const {selModel} = this,
774
774
  row = this.agGridModel.getFirstSelectableRowNode();
775
775
 
776
- // If displayed select it -- we never want to auto-expand parent rows
776
+ // If displayed, or potentially expandable to display, select it.
777
777
  if (row && (expandParentGroups || row.displayed)) {
778
778
  const id = row.data.id;
779
779
  if (id != null) {
@@ -286,10 +286,14 @@ function levelExpandAction(gridModel: GridModel): RecordAction {
286
286
  const {maxDepth, expandToLevel} = gridModel;
287
287
  if (maxDepth <= 1) return {hidden: true};
288
288
 
289
+ // Validate level labels.
289
290
  const levelLabels = executeIfFunction(gridModel.levelLabels);
290
- if (!levelLabels || levelLabels.length < maxDepth + 1) {
291
+ if (!levelLabels) {
292
+ return {hidden: true};
293
+ }
294
+ if (levelLabels.length < maxDepth + 1) {
291
295
  gridModel.logDebug(
292
- '"levelLabels" not provided or of insufficient length. No menu items shown.'
296
+ 'Value produced by `GridModel.levelLabels` has insufficient length. No menu items shown.'
293
297
  );
294
298
  return {hidden: true};
295
299
  }
@@ -121,6 +121,11 @@ export class GroupingChooserModel extends HoistModel {
121
121
  return this.validateValue(this.pendingValue);
122
122
  }
123
123
 
124
+ @computed
125
+ get valueDisplayNames(): string[] {
126
+ return this.value.map(dimName => this.getDimDisplayName(dimName));
127
+ }
128
+
124
129
  @computed
125
130
  get isAddEnabled(): boolean {
126
131
  const {pendingValue, maxDepth, dimensionNames, availableDims} = this,
@@ -274,10 +279,6 @@ export class GroupingChooserModel extends HoistModel {
274
279
  return value.map(dimName => this.getDimDisplayName(dimName)).join(' › ');
275
280
  }
276
281
 
277
- getValueDisplayNames(): string[] {
278
- return this.value.map(dimName => this.getDimDisplayName(dimName));
279
- }
280
-
281
282
  getDimDisplayName(dimName: string) {
282
283
  return this.dimensions[dimName]?.displayName ?? dimName;
283
284
  }
@@ -4,7 +4,6 @@
4
4
  *
5
5
  * Copyright © 2025 Extremely Heavy Industries Inc.
6
6
  */
7
- import {GridOptions} from '@ag-grid-community/core';
8
7
  import {grid} from '@xh/hoist/cmp/grid';
9
8
  import {hframe, vbox} from '@xh/hoist/cmp/layout';
10
9
  import {BoxProps, hoistCmp, HoistProps, uses} from '@xh/hoist/core';
@@ -28,21 +27,15 @@ export const [LeftRightChooser, leftRightChooser] = hoistCmp.withFactory<LeftRig
28
27
  className: 'xh-lr-chooser',
29
28
 
30
29
  render({model, ...props}, ref) {
31
- const agOptions: GridOptions = {
32
- defaultColDef: {
33
- resizable: false
34
- }
35
- };
36
-
37
30
  return vbox({
38
31
  ref,
39
32
  items: [
40
33
  hframe({
41
34
  className: 'xh-lr-chooser__grid-frame',
42
35
  items: [
43
- grid({model: model.leftModel, agOptions}),
36
+ grid({model: model.leftModel}),
44
37
  chooserToolbar(),
45
- grid({model: model.rightModel, agOptions})
38
+ grid({model: model.rightModel})
46
39
  ]
47
40
  }),
48
41
  description()
@@ -158,16 +158,19 @@ export class LeftRightChooserModel extends HoistModel {
158
158
  ]
159
159
  };
160
160
 
161
- const leftTextCol = {
161
+ const colSpec = {
162
162
  field: 'text',
163
163
  flex: true,
164
+ resizable: true
165
+ },
166
+ leftTextCol = {
167
+ ...colSpec,
164
168
  headerName: () =>
165
169
  leftTitle + (showCounts ? ` (${this.leftModel.store.count})` : ''),
166
170
  renderer: this.getTextColRenderer('left')
167
171
  },
168
172
  rightTextCol = {
169
- field: 'text',
170
- flex: true,
173
+ ...colSpec,
171
174
  headerName: () =>
172
175
  rightTitle + (showCounts ? ` (${this.rightModel.store.count})` : ''),
173
176
  renderer: this.getTextColRenderer('right')
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@xh/hoist",
3
- "version": "75.0.0-SNAPSHOT.1752891558856",
3
+ "version": "75.0.0-SNAPSHOT.1753115287677",
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",